@oddsquad/vite-plugin-lit 0.5.0 → 0.6.1

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 (51) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +2 -0
  3. package/bin.mjs +20 -0
  4. package/dist/client/assets/{browser-agent-rpc-BXhoSh1z-CRHFLjFo.js → browser-agent-rpc-BXhoSh1z-F2EfZsFX.js} +3 -3
  5. package/dist/client/assets/{browser-agent-rpc-BXhoSh1z-CRHFLjFo.js.map → browser-agent-rpc-BXhoSh1z-F2EfZsFX.js.map} +1 -1
  6. package/dist/client/assets/{index-Gn4Hk_9s.js → index-B2HYO7lk.js} +52 -19
  7. package/dist/client/assets/index-B2HYO7lk.js.map +1 -0
  8. package/dist/client/index.html +1 -1
  9. package/lib/confine.d.ts +22 -0
  10. package/lib/confine.d.ts.map +1 -0
  11. package/lib/confine.js +39 -0
  12. package/lib/confine.js.map +1 -0
  13. package/lib/devframe/definition.d.ts +10 -2
  14. package/lib/devframe/definition.d.ts.map +1 -1
  15. package/lib/devframe/definition.js +31 -9
  16. package/lib/devframe/definition.js.map +1 -1
  17. package/lib/devframe/protocol.d.ts +7 -3
  18. package/lib/devframe/protocol.d.ts.map +1 -1
  19. package/lib/devframe/protocol.js.map +1 -1
  20. package/lib/devframe/vite.d.ts.map +1 -1
  21. package/lib/devframe/vite.js +3 -0
  22. package/lib/devframe/vite.js.map +1 -1
  23. package/lib/http.d.ts +5 -0
  24. package/lib/http.d.ts.map +1 -1
  25. package/lib/http.js +5 -0
  26. package/lib/http.js.map +1 -1
  27. package/lib/plugins/open-in-editor.d.ts.map +1 -1
  28. package/lib/plugins/open-in-editor.js +11 -19
  29. package/lib/plugins/open-in-editor.js.map +1 -1
  30. package/lib/runtime/timeline/chrome-tracks.d.ts +22 -0
  31. package/lib/runtime/timeline/chrome-tracks.d.ts.map +1 -0
  32. package/lib/runtime/timeline/chrome-tracks.js +74 -0
  33. package/lib/runtime/timeline/chrome-tracks.js.map +1 -0
  34. package/lib/runtime/timeline/clock.d.ts +6 -0
  35. package/lib/runtime/timeline/clock.d.ts.map +1 -1
  36. package/lib/runtime/timeline/clock.js +6 -0
  37. package/lib/runtime/timeline/clock.js.map +1 -1
  38. package/lib/runtime/timeline/install.js +27 -9
  39. package/lib/runtime/timeline/install.js.map +1 -1
  40. package/lib/snapshot.d.ts +2 -1
  41. package/lib/snapshot.d.ts.map +1 -1
  42. package/lib/snapshot.js +17 -1
  43. package/lib/snapshot.js.map +1 -1
  44. package/lib/source-meta.d.ts.map +1 -1
  45. package/lib/source-meta.js +40 -1
  46. package/lib/source-meta.js.map +1 -1
  47. package/package.json +6 -6
  48. package/types/timeline.d.ts +6 -0
  49. package/types/timeline.d.ts.map +1 -1
  50. package/types/timeline.js.map +1 -1
  51. package/dist/client/assets/index-Gn4Hk_9s.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAMA,MAAE;AAAWC,UAAED,IAAE,eAAa,KAAK,MAAIA,IAAE,YAAUA,IAAE,SAAS,iBAAe,wBAAuB,SAAS,aAAW,aAAY,cAAc;AAAUE,UAAE,OAAO;AAAEC,0BAAE,IAAI,QAAM;AAAE,IAAMC,MAAN,MAAO;CAAC,YAAY,GAAE,GAAE,GAAE;EAAC,IAAG,KAAK,eAAa,CAAC,GAAE,MAAIF,KAAE,MAAM,MAAM,mEAAmE;EAAE,KAAK,UAAQ,GAAE,KAAK,IAAE;CAAC;CAAC,IAAI,aAAY;EAAC,IAAI,IAAE,KAAK;EAAE,MAAM,IAAE,KAAK;EAAE,IAAGD,OAAG,KAAK,MAAI,GAAE;GAAC,MAAM,IAAE,KAAK,MAAI,KAAG,MAAI,EAAE;GAAO,MAAI,IAAEE,IAAE,IAAI,CAAC,IAAG,KAAK,MAAI,OAAK,KAAK,IAAE,IAAE,IAAI,cAAY,GAAG,YAAY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H;;;;;;;CAQA,YAA0B;EACxB,IAAI,OAAO,QAAQ,OAAO,MAAM;EAGhC,MAAM,aACJ,KAAK,SAAS,YACV,KAAK,cAAc,aACnB,KAAK,iBAAiB;EAC5B,MAAM,UACJ,KAAK,SAAS,aAAa,KAAK,eAAe,kBAAkB;EACnE,cAAc;GACZ,KAAK,KAAK;GACV,GAAI,eAAe,QAAQ,eAAe,SACtC,CAAC,IACD,EAAC,aAAa,WAAU;GAC5B,GAAI,YAAY,QAAQ,YAAY,SAAY,CAAC,IAAI,EAAC,QAAO;EAC/D,CAAC;CACH;;;;;;CAOA,kBAA0B,GAAiC;EACzD,KAAK,YAAY,EAAE,OAAO;CAC5B;;CAGA,kBAA0B,GAA8B;EACtD,KAAK,OAAO;EAEZ,KAAK,iBAAiB,WAAW,EAAE,OAAO,EAAE;EAC5C,KAAK,UAAU;CACjB;;;;;;;;;;;CAYA,uBAA+B;EAC7B,KAAK,OAAO;EACZ,KAAK,UAAU;CACjB;CAEA,SAAkB;EAChB,OAAO,CAAI;;8BAEe,aAAa;;mBAExB,KAAK;mBACL,KAAK;oBACJ,KAAK;;;2CAGkB,KAAK,kBAAkB;;oBAE9C,KAAK,SAAS;8BACJ,KAAK;;;;;oBAKf,KAAK,SAAS;gCACF,KAAK;8BACP,KAAK;8BACL,KAAK;;;;;UAMzB,KAAK,SAAS,YACV,CAAI;oCACkB,KAAK;kCAE3B;UAGJ,KAAK,SAAS,aACV,CAAI,4CACJ;;;CAIZ;AACF;AAzKG,gBAAM;AAGN,gBAAM;AAEN,gBAAM,iBAAiB;AACvB,gBAAM,cAAc;AACpB,gBAAM,eAAe;AAtDvB,mCAAc,oBAAoB","names":["t","e","s","o","n","r","i","S","c","h","a","l","p","d","u","f","b","y","v","m","H","M","j","AsyncDirective","PartType","repeat","noChange","directive","urlAlphabet","nanoid","setTimeout","serialize","diagnostics","defineDiagnostics","formatIssues","listeners"],"ignoreList":[0,1,2,3,4,5,6,7,8,11,12,13,14,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,48,49],"sources":["../../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.js","../../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/lit-html.js","../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/custom-element.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/base.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/query.js","../../../src/lib/tokens.ts","../../../src/lib/color-scheme.ts","../../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directive-helpers.js","../../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directive.js","../../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/async-directive.js","../../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directives/ref.js","../../../src/lib/timeline/derive.ts","../../../src/lib/timeline/filter.ts","../../../src/lib/segmented-tabs.ts","../../../src/panel/timeline-layers.ts","../../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directives/repeat.js","../../../node_modules/.pnpm/@lit-labs+virtualizer@2.1.1/node_modules/@lit-labs/virtualizer/events.js","../../../node_modules/.pnpm/@lit-labs+virtualizer@2.1.1/node_modules/@lit-labs/virtualizer/ScrollerController.js","../../../node_modules/.pnpm/@lit-labs+virtualizer@2.1.1/node_modules/@lit-labs/virtualizer/Virtualizer.js","../../../node_modules/.pnpm/@lit-labs+virtualizer@2.1.1/node_modules/@lit-labs/virtualizer/virtualize.js","../../../node_modules/.pnpm/devframe@1.1.0_@devframes+agentic@1.1.0_cac@7.0.0_srvx@1.0.5/node_modules/devframe/dist/utils/colors.mjs","../../../node_modules/.pnpm/nostics@1.3.0/node_modules/nostics/dist/index.mjs","../../../node_modules/.pnpm/nostics@1.3.0/node_modules/nostics/dist/formatters/ansi.mjs","../../../node_modules/.pnpm/devframe@1.1.0_@devframes+agentic@1.1.0_cac@7.0.0_srvx@1.0.5/node_modules/devframe/dist/tool-input-BAQXvvqL.mjs","../../../node_modules/.pnpm/devframe@1.1.0_@devframes+agentic@1.1.0_cac@7.0.0_srvx@1.0.5/node_modules/devframe/dist/hash-DdPnc4k3.mjs","../../../node_modules/.pnpm/devframe@1.1.0_@devframes+agentic@1.1.0_cac@7.0.0_srvx@1.0.5/node_modules/devframe/dist/utils/events.mjs","../../../node_modules/.pnpm/devframe@1.1.0_@devframes+agentic@1.1.0_cac@7.0.0_srvx@1.0.5/node_modules/devframe/dist/utils/url.mjs","../../../node_modules/.pnpm/devframe@1.1.0_@devframes+agentic@1.1.0_cac@7.0.0_srvx@1.0.5/node_modules/devframe/dist/utils/nanoid.mjs","../../../node_modules/.pnpm/devframe@1.1.0_@devframes+agentic@1.1.0_cac@7.0.0_srvx@1.0.5/node_modules/devframe/dist/shared-state-eQVYHNqA.mjs","../../../node_modules/.pnpm/devframe@1.1.0_@devframes+agentic@1.1.0_cac@7.0.0_srvx@1.0.5/node_modules/devframe/dist/structured-clone-CgtQ61SA.mjs","../../../node_modules/.pnpm/devframe@1.1.0_@devframes+agentic@1.1.0_cac@7.0.0_srvx@1.0.5/node_modules/devframe/dist/utils/streaming-channel.mjs","../../../node_modules/.pnpm/devframe@1.1.0_@devframes+agentic@1.1.0_cac@7.0.0_srvx@1.0.5/node_modules/devframe/dist/utils/agent-tool-name.mjs","../../../node_modules/.pnpm/devframe@1.1.0_@devframes+agentic@1.1.0_cac@7.0.0_srvx@1.0.5/node_modules/devframe/dist/client/index.mjs","../../../src/types/timeline.ts","../../../src/lib/devframe/protocol.ts","../../../src/panel/client.ts","../../../src/panel/open-in-editor.ts","../../../src/panel/timeline-span-detail.ts","../../../src/panel/timeline-event-list.ts","../../../src/lib/timeline/tracks.ts","../../../src/panel/timeline-tracks.ts","../../../src/panel/timeline-store.ts","../../../src/panel/timeline-view.ts","../../../src/types/hmr-incompatibility.ts","../../../node_modules/.pnpm/devframe@1.1.0_@devframes+agentic@1.1.0_cac@7.0.0_srvx@1.0.5/node_modules/devframe/dist/browser-agent-Pu-FLk6I.mjs","../../../node_modules/.pnpm/devframe@1.1.0_@devframes+agentic@1.1.0_cac@7.0.0_srvx@1.0.5/node_modules/devframe/dist/in-page-channel/index.mjs","../../../src/types/in-page.ts","../../../src/panel/in-page.ts","../../../src/panel/settings-override.ts","../../../src/panel/components-view.ts","../../../src/panel/updates-view.ts","../../../src/panel/deep-link.ts","../../../src/lib/override-baselines.ts","../../../src/panel/devtools-settings.ts","../../../src/lib/icons.ts","../../../src/panel/lit-devtools-panel.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new n(\"string\"==typeof t?t:t+\"\",void 0,s),i=(t,...e)=>{const o=1===t.length?t[0]:e.reduce((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if(\"number\"==typeof t)return t;throw Error(\"Value passed to 'css' function must be a 'css' function result: \"+t+\". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.\")})(s)+t[o+1],t[0]);return new n(o,t,s)},S=(s,o)=>{if(e)s.adoptedStyleSheets=o.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of o){const o=document.createElement(\"style\"),n=t.litNonce;void 0!==n&&o.setAttribute(\"nonce\",n),o.textContent=e.cssText,s.appendChild(o)}},c=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e=\"\";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t;export{n as CSSResult,S as adoptStyles,i as css,c as getCompatibleStyle,e as supportsAdoptingStyleSheets,r as unsafeCSS};\n//# sourceMappingURL=css-tag.js.map\n","import{getCompatibleStyle as t,adoptStyles as s}from\"./css-tag.js\";export{CSSResult,css,supportsAdoptingStyleSheets,unsafeCSS}from\"./css-tag.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{is:i,defineProperty:e,getOwnPropertyDescriptor:h,getOwnPropertyNames:r,getOwnPropertySymbols:o,getPrototypeOf:n}=Object,a=globalThis,c=a.trustedTypes,l=c?c.emptyScript:\"\",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},f=(t,s)=>!i(t,s),b={attribute:!0,type:String,converter:u,reflect:!1,useDefault:!1,hasChanged:f};Symbol.metadata??=Symbol(\"metadata\"),a.litPropertyMetadata??=new WeakMap;class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e(this.prototype,t,h)}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t}};return{get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d(\"elementProperties\")))return;const t=n(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(d(\"finalized\")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d(\"properties\"))){const t=this.properties,s=[...r(t),...o(t)];for(const i of s)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(t(s))}else void 0!==s&&i.push(t(s));return i}static _$Eu(t,s){const i=s.attribute;return!1===i?void 0:\"string\"==typeof i?i:\"string\"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h=\"function\"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=e;const r=h.fromAttribute(s,t.type);this[e]=r??this._$Ej?.get(e)??r,this._$Em=null}}requestUpdate(t,s,i,e=!1,h){if(void 0!==t){const r=this.constructor;if(!1===e&&(h=this[t]),i??=r.getPropertyOptions(t),!((i.hasChanged??f)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,i))))return;this.C(t,s,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),!0!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),!0===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];!0!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e)}}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(s)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}y.elementStyles=[],y.shadowRootOptions={mode:\"open\"},y[d(\"elementProperties\")]=new Map,y[d(\"finalized\")]=new Map,p?.({ReactiveElement:y}),(a.reactiveElementVersions??=[]).push(\"2.1.2\");export{y as ReactiveElement,s as adoptStyles,u as defaultConverter,t as getCompatibleStyle,f as notEqual};\n//# sourceMappingURL=reactive-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,i=t=>t,s=t.trustedTypes,e=s?s.createPolicy(\"lit-html\",{createHTML:t=>t}):void 0,h=\"$lit$\",o=`lit$${Math.random().toFixed(9).slice(2)}$`,n=\"?\"+o,r=`<${n}>`,l=document,c=()=>l.createComment(\"\"),a=t=>null===t||\"object\"!=typeof t&&\"function\"!=typeof t,u=Array.isArray,d=t=>u(t)||\"function\"==typeof t?.[Symbol.iterator],f=\"[ \\t\\n\\f\\r]\",v=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,_=/-->/g,m=/>/g,p=RegExp(`>|${f}(?:([^\\\\s\"'>=/]+)(${f}*=${f}*(?:[^ \\t\\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),g=/'/g,$=/\"/g,y=/^(?:script|style|textarea|title)$/i,x=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),b=x(1),w=x(2),T=x(3),E=Symbol.for(\"lit-noChange\"),A=Symbol.for(\"lit-nothing\"),C=new WeakMap,P=l.createTreeWalker(l,129);function V(t,i){if(!u(t)||!t.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return void 0!==e?e.createHTML(i):i}const N=(t,i)=>{const s=t.length-1,e=[];let n,l=2===i?\"<svg>\":3===i?\"<math>\":\"\",c=v;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,f=0;for(;f<s.length&&(c.lastIndex=f,u=c.exec(s),null!==u);)f=c.lastIndex,c===v?\"!--\"===u[1]?c=_:void 0!==u[1]?c=m:void 0!==u[2]?(y.test(u[2])&&(n=RegExp(\"</\"+u[2],\"g\")),c=p):void 0!==u[3]&&(c=p):c===p?\">\"===u[0]?(c=n??v,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?p:'\"'===u[3]?$:g):c===$||c===g?c=p:c===_||c===m?c=v:(c=p,n=void 0);const x=c===p&&t[i+1].startsWith(\"/>\")?\" \":\"\";l+=c===v?s+r:d>=0?(e.push(a),s.slice(0,d)+h+s.slice(d)+o+x):s+o+(-2===d?i:x)}return[V(t,l+(t[s]||\"<?>\")+(2===i?\"</svg>\":3===i?\"</math>\":\"\")),e]};class S{constructor({strings:t,_$litType$:i},e){let r;this.parts=[];let l=0,a=0;const u=t.length-1,d=this.parts,[f,v]=N(t,i);if(this.el=S.createElement(f,e),P.currentNode=this.el.content,2===i||3===i){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=P.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(h)){const i=v[a++],s=r.getAttribute(t).split(o),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:l,name:e[2],strings:s,ctor:\".\"===e[1]?I:\"?\"===e[1]?L:\"@\"===e[1]?z:H}),r.removeAttribute(t)}else t.startsWith(o)&&(d.push({type:6,index:l}),r.removeAttribute(t));if(y.test(r.tagName)){const t=r.textContent.split(o),i=t.length-1;if(i>0){r.textContent=s?s.emptyScript:\"\";for(let s=0;s<i;s++)r.append(t[s],c()),P.nextNode(),d.push({type:2,index:++l});r.append(t[i],c())}}}else if(8===r.nodeType)if(r.data===n)d.push({type:2,index:l});else{let t=-1;for(;-1!==(t=r.data.indexOf(o,t+1));)d.push({type:7,index:l}),t+=o.length-1}l++}}static createElement(t,i){const s=l.createElement(\"template\");return s.innerHTML=t,s}}function M(t,i,s=t,e){if(i===E)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=a(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(!1),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=M(t,h._$AS(t,i.values),h,e)),i}class R{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??l).importNode(i,!0);P.currentNode=e;let h=P.nextNode(),o=0,n=0,r=s[0];for(;void 0!==r;){if(o===r.index){let i;2===r.type?i=new k(h,h.nextSibling,this,t):1===r.type?i=new r.ctor(h,r.name,r.strings,this,t):6===r.type&&(i=new Z(h,this,t)),this._$AV.push(i),r=s[++n]}o!==r?.index&&(h=P.nextNode(),o++)}return P.currentNode=l,e}p(t){let i=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class k{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=A,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=M(this,t,i),a(t)?t===A||null==t||\"\"===t?(this._$AH!==A&&this._$AR(),this._$AH=A):t!==this._$AH&&t!==E&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):d(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==A&&a(this._$AH)?this._$AA.nextSibling.data=t:this.T(l.createTextNode(t)),this._$AH=t}$(t){const{values:i,_$litType$:s}=t,e=\"number\"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=S.createElement(V(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else{const t=new R(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t}}_$AC(t){let i=C.get(t.strings);return void 0===i&&C.set(t.strings,i=new S(t)),i}k(t){u(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new k(this.O(c()),this.O(c()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,s){for(this._$AP?.(!1,!0,s);t!==this._$AB;){const s=i(t).nextSibling;i(t).remove(),t=s}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class H{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=A,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||\"\"!==s[0]||\"\"!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=A}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=M(this,t,i,0),o=!a(t)||t!==this._$AH&&t!==E,o&&(this._$AH=t);else{const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=M(this,e[s+n],i,n),r===E&&(r=this._$AH[n]),o||=!a(r)||r!==this._$AH[n],r===A?t=A:t!==A&&(t+=(r??\"\")+h[n+1]),this._$AH[n]=r}o&&!e&&this.j(t)}j(t){t===A?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??\"\")}}class I extends H{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===A?void 0:t}}class L extends H{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==A)}}class z extends H{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5}_$AI(t,i=this){if((t=M(this,t,i,0)??A)===E)return;const s=this._$AH,e=t===A&&s!==A||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==A&&(s===A||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){\"function\"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class Z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){M(this,t)}}const j={M:h,P:o,A:n,C:1,L:N,R,D:d,V:M,I:k,H,N:L,U:z,B:I,F:Z},B=t.litHtmlPolyfillSupport;B?.(S,k),(t.litHtmlVersions??=[]).push(\"3.3.3\");const D=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new k(i.insertBefore(c(),t),t,void 0,s??{})}return h._$AI(t),h};export{j as _$LH,b as html,T as mathml,E as noChange,A as nothing,D as render,w as svg};\n//# sourceMappingURL=lit-html.js.map\n","import{ReactiveElement as t}from\"@lit/reactive-element\";export*from\"@lit/reactive-element\";import{render as e,noChange as r}from\"lit-html\";export*from\"lit-html\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const s=globalThis;class i extends t{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=e(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return r}}i._$litElement$=!0,i[\"finalized\"]=!0,s.litElementHydrateSupport?.({LitElement:i});const o=s.litElementPolyfillSupport;o?.({LitElement:i});const n={_$AK:(t,e,r)=>{t._$AK(e,r)},_$AL:t=>t._$AL};(s.litElementVersions??=[]).push(\"4.2.2\");export{i as LitElement,n as _$LE};\n//# sourceMappingURL=lit-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=t=>(e,o)=>{void 0!==o?o.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)};export{t as customElement};\n//# sourceMappingURL=custom-element.js.map\n","import{notEqual as t,defaultConverter as e}from\"../reactive-element.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o={attribute:!0,type:String,converter:e,reflect:!1,hasChanged:t},r=(t=o,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),\"setter\"===n&&((t=Object.create(t)).wrapped=!0),s.set(r.name,t),\"accessor\"===n){const{name:o}=r;return{set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t,!0,r)},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if(\"setter\"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t,!0,r)}}throw Error(\"Unsupported decorator location: \"+n)};function n(t){return(e,o)=>\"object\"==typeof o?r(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}export{n as property,r as standardProperty};\n//# sourceMappingURL=property.js.map\n","import{property as t}from\"./property.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function r(r){return t({...r,state:!0,attribute:!1})}export{r as state};\n//# sourceMappingURL=state.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst e=(e,t,c)=>(c.configurable=!0,c.enumerable=!0,Reflect.decorate&&\"object\"!=typeof t&&Object.defineProperty(e,t,c),c);export{e as desc};\n//# sourceMappingURL=base.js.map\n","import{desc as t}from\"./base.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function e(e,r){return(n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;if(r){const{get:e,set:r}=\"object\"==typeof s?n:i??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return t(n,s,{get(){let t=e.call(this);return void 0===t&&(t=o(this),(null!==t||this.hasUpdated)&&r.call(this,t)),t}})}return t(n,s,{get(){return o(this)}})}}export{e as query};\n//# sourceMappingURL=query.js.map\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {css, unsafeCSS} from 'lit';\n\n/**\n * Design token CSS custom properties for the Lit DevTools.\n *\n * Two entry points:\n * - **`tokens`** — Lit `css` template that defines the theme-agnostic base\n * tokens on `:host`. Semantic color aliases (`--lit-devtools-bg`, `--lit-devtools-surface`, `--lit-devtools-text`,\n * etc.) are inherited from `:root`, where {@link injectTokens} installs them.\n * Use as `static styles = [tokens, css`…`]`.\n * - **`injectTokens()`** — injects `:root { … }` into the page `<head>` once.\n * This makes semantic aliases available to every devtools surface, both\n * runtime elements (indicator, source-overlay) that build their shadow DOM\n * via `innerHTML` and Lit panel components that inherit from `:root`.\n * The injected stylesheet reacts to `prefers-color-scheme` and to\n * `.color-scheme-light` / `.color-scheme-dark` classes on `:root`.\n *\n * Sourced from the lit-design skill (`tokens/colors.css`). Defaults to the\n * dark DevTools theme; the light lit.dev website palette is applied when the\n * OS/browser requests a light color scheme or when `:root` has the matching\n * theme class.\n *\n * Fonts are system stacks (no webfonts). For the branded Manrope + Roboto Mono\n * see the lit-design skill's `fonts/` directory.\n */\n\nconst baseTokenCSS = `\n /* ---- Brand · the Lit flame ---- */\n --lit-devtools-lit-blue: #324fff;\n --lit-devtools-lit-blue-bright: #4d63ff;\n --lit-devtools-lit-indigo: #2a2c9d;\n --lit-devtools-lit-dark-blue: #283198;\n --lit-devtools-lit-cyan: #00ffff;\n --lit-devtools-lit-dark-cyan: #00e8ff;\n\n /* ---- Neutral ink scale (0 = near-black, 13 = white) ---- */\n --lit-devtools-ink-0: hsl(0 0% 1%);\n --lit-devtools-ink-1: hsl(0 0% 5%);\n --lit-devtools-ink-2: hsl(0 0% 7%);\n --lit-devtools-ink-3: hsl(0 0% 11%);\n --lit-devtools-ink-4: hsl(0 0% 13%);\n --lit-devtools-ink-5: hsl(0 0% 16%);\n --lit-devtools-ink-6: hsl(0 0% 21%);\n --lit-devtools-ink-7: hsl(0 0% 28%);\n --lit-devtools-ink-8: hsl(0 0% 38%);\n --lit-devtools-ink-9: hsl(0 0% 57%);\n --lit-devtools-ink-10: hsl(0 0% 63%);\n --lit-devtools-ink-11: hsl(0 0% 78%);\n --lit-devtools-ink-12: hsl(0 0% 89%);\n --lit-devtools-ink-13: hsl(0 0% 100%);\n\n /* ---- Typography ---- */\n --lit-devtools-font-sans: system-ui, -apple-system, 'Segoe UI', sans-serif;\n --lit-devtools-font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;\n\n --lit-devtools-weight-regular: 400;\n --lit-devtools-weight-medium: 500;\n --lit-devtools-weight-semibold: 600;\n --lit-devtools-weight-bold: 700;\n --lit-devtools-weight-extrabold: 800;\n\n --lit-devtools-text-2xs: 11px;\n --lit-devtools-text-xs: 12px;\n --lit-devtools-text-sm: 13px;\n --lit-devtools-text-md: 14px;\n --lit-devtools-text-base:16px;\n\n --lit-devtools-leading-tight: 1.15;\n --lit-devtools-leading-snug: 1.3;\n --lit-devtools-leading-normal: 1.5;\n\n --lit-devtools-tracking-tight: -0.02em;\n --lit-devtools-tracking-snug: -0.01em;\n --lit-devtools-tracking-normal: 0;\n --lit-devtools-tracking-wide: 0.02em;\n --lit-devtools-tracking-caps: 0.06em;\n\n /* ---- Spacing (4px base) ---- */\n --lit-devtools-space-0: 0;\n --lit-devtools-space-1: 2px;\n --lit-devtools-space-2: 4px;\n --lit-devtools-space-3: 6px;\n --lit-devtools-space-4: 8px;\n --lit-devtools-space-5: 12px;\n --lit-devtools-space-6: 16px;\n --lit-devtools-space-7: 20px;\n --lit-devtools-space-8: 24px;\n --lit-devtools-space-9: 32px;\n\n /* ---- Radius ---- */\n --lit-devtools-radius-xs: 3px;\n --lit-devtools-radius-sm: 5px;\n --lit-devtools-radius-md: 8px;\n --lit-devtools-radius-lg: 12px;\n --lit-devtools-radius-xl: 16px;\n --lit-devtools-radius-pill: 999px;\n\n /* ---- Elevation ---- */\n --lit-devtools-shadow-xs: 0 1px 2px hsl(0 0% 0% / 0.30);\n --lit-devtools-shadow-sm: 0 1px 5px hsl(0 0% 0% / 0.35);\n --lit-devtools-shadow-md: 0 4px 14px hsl(0 0% 0% / 0.40);\n --lit-devtools-shadow-lg: 0 12px 32px hsl(0 0% 0% / 0.50);\n --lit-devtools-shadow-xl: 0 24px 64px hsl(0 0% 0% / 0.55);\n --lit-devtools-shadow-window: 0 24px 80px hsl(0 0% 0% / 0.6),\n 0 0 0 1px hsl(0 0% 100% / 0.06);\n --lit-devtools-ring: 0 0 0 2px var(--lit-devtools-accent-ring);\n\n /* ---- Motion ---- */\n --lit-devtools-ease-standard: cubic-bezier(0.2, 0, 0, 1);\n --lit-devtools-dur-fast: 140ms;\n --lit-devtools-dur-normal: 220ms;\n`;\n\nconst darkThemeCSS = `\n /* ---- DARK · DevTools theme ---- */\n --lit-devtools-accent: var(--lit-devtools-lit-blue-bright);\n --lit-devtools-accent-hover: #6478ff;\n --lit-devtools-accent-pressed: #3d54f0;\n --lit-devtools-accent-soft: hsla(232 100% 65% / 0.16);\n --lit-devtools-accent-ring: hsla(232 100% 65% / 0.45);\n --lit-devtools-on-accent: #ffffff;\n --lit-devtools-accent-cyan: var(--lit-devtools-lit-dark-cyan);\n\n --lit-devtools-bg: var(--lit-devtools-ink-0);\n --lit-devtools-surface: var(--lit-devtools-ink-2);\n --lit-devtools-surface-low: var(--lit-devtools-ink-1);\n --lit-devtools-surface-container: var(--lit-devtools-ink-4);\n --lit-devtools-surface-container-high: var(--lit-devtools-ink-5);\n --lit-devtools-surface-elevated: var(--lit-devtools-ink-6);\n --lit-devtools-surface-hover: hsl(0 0% 100% / 0.04);\n --lit-devtools-surface-active: hsl(0 0% 100% / 0.07);\n\n --lit-devtools-text: var(--lit-devtools-ink-12);\n --lit-devtools-text-strong: var(--lit-devtools-ink-13);\n --lit-devtools-text-secondary: var(--lit-devtools-ink-10);\n --lit-devtools-text-muted: var(--lit-devtools-ink-8);\n --lit-devtools-text-link: var(--lit-devtools-lit-blue-bright);\n\n --lit-devtools-border: var(--lit-devtools-ink-6);\n --lit-devtools-border-strong: var(--lit-devtools-ink-7);\n --lit-devtools-border-subtle: hsl(0 0% 100% / 0.06);\n\n --lit-devtools-success: hsl(158 74% 53%);\n --lit-devtools-success-soft: hsl(158 74% 53% / 0.15);\n --lit-devtools-warning: #f4bf4f;\n --lit-devtools-warning-soft: hsl(43 88% 63% / 0.15);\n --lit-devtools-error: #ff6b6b;\n --lit-devtools-error-soft: hsl(0 100% 71% / 0.15);\n --lit-devtools-info: var(--lit-devtools-lit-dark-cyan);\n --lit-devtools-info-soft: hsl(187 100% 47% / 0.15);\n\n --lit-devtools-selection-bg: var(--lit-devtools-accent);\n --lit-devtools-on-selection: #ffffff;\n`;\n\nconst darkSchemeCSS = `color-scheme: dark;`;\n\nconst lightThemeCSS = `\n /* ---- LIGHT · lit.dev website theme ---- */\n --lit-devtools-accent: var(--lit-devtools-lit-blue);\n --lit-devtools-accent-hover: #1f3bff;\n --lit-devtools-accent-pressed: #2a2c9d;\n --lit-devtools-accent-soft: hsla(232 100% 60% / 0.12);\n --lit-devtools-accent-ring: hsla(232 100% 60% / 0.40);\n --lit-devtools-on-accent: #ffffff;\n --lit-devtools-accent-cyan: var(--lit-devtools-lit-dark-cyan);\n\n --lit-devtools-bg: #f4f4f4;\n --lit-devtools-surface: #ffffff;\n --lit-devtools-surface-low: #f3f3f3;\n --lit-devtools-surface-container: #ffffff;\n --lit-devtools-surface-container-high: #e8e8e8;\n --lit-devtools-surface-elevated: #ffffff;\n --lit-devtools-surface-hover: hsl(0 0% 0% / 0.04);\n --lit-devtools-surface-active: hsl(0 0% 0% / 0.07);\n\n --lit-devtools-text: #242424;\n --lit-devtools-text-strong: #000000;\n --lit-devtools-text-secondary: #6e6e6e;\n --lit-devtools-text-muted: #949494;\n --lit-devtools-text-link: #005dc7;\n\n --lit-devtools-border: #e2e2e2;\n --lit-devtools-border-strong: #c6c6c6;\n --lit-devtools-border-subtle: hsl(0 0% 0% / 0.07);\n\n --lit-devtools-success: #00865b;\n --lit-devtools-success-soft: hsl(158 100% 26% / 0.10);\n --lit-devtools-warning: #b26a00;\n --lit-devtools-warning-soft: hsl(40 100% 35% / 0.10);\n --lit-devtools-error: #ba1a1a;\n --lit-devtools-error-soft: hsl(0 75% 42% / 0.10);\n --lit-devtools-info: #005dc7;\n --lit-devtools-info-soft: hsl(210 100% 39% / 0.10);\n\n --lit-devtools-selection-bg: var(--lit-devtools-accent);\n --lit-devtools-on-selection: #ffffff;\n`;\n\nconst lightSchemeCSS = `color-scheme: light;`;\n\n/**\n * Default dark theme tokens as a flat string, primarily for use by\n * {@link injectTokens}. Prefer importing `tokens` for Lit components so the\n * semantic aliases are inherited from `:root`.\n */\nexport const tokenCSS = `${baseTokenCSS}\\n${darkThemeCSS}`;\n\n/**\n * Lit `css` template for use in panel component shadow roots.\n *\n * ```ts\n * import {tokens} from '../lib/tokens.js';\n * // ...\n * static override styles = [tokens, css`…`];\n * ```\n *\n * This installs the theme-agnostic base tokens on `:host`. Semantic aliases\n * (`--lit-devtools-bg`, `--lit-devtools-text`, etc.) are inherited from `:root`, where they are installed\n * by {@link injectTokens}. The panel iframe calls `injectTokens()` from\n * \\`lit-devtools-panel.ts\\` so all components inherit the same dark/light theme.\n */\nexport const tokens = css`\n :host {\n ${unsafeCSS(baseTokenCSS)}\n }\n`;\n\nlet _injected = false;\n\n/**\n * Options for {@link injectTokens} / {@link tokenStyleText}.\n */\nexport interface InjectTokensOptions {\n /**\n * Also declare `color-scheme` on `:root`. Only safe when the devtools OWN\n * the target document (the panel iframe / standalone panel page). Never set\n * this when injecting into the host page: `color-scheme` on the embedder's\n * `:root` makes the UA repaint the canvas dark for apps that don't declare\n * an opaque background. Defaults to `false`.\n */\n colorScheme?: boolean;\n}\n\n/**\n * Builds the token stylesheet text injected by {@link injectTokens}.\n *\n * By default the sheet defines custom properties only — inert for the host\n * page. With `colorScheme: true` it additionally declares `color-scheme` so\n * the owning document's UA surfaces (canvas, form controls, scrollbars)\n * follow the devtools theme.\n */\nexport const tokenStyleText = ({\n colorScheme = false,\n}: InjectTokensOptions = {}): string => {\n const dark = colorScheme\n ? `${darkThemeCSS}\\n ${darkSchemeCSS}`\n : darkThemeCSS;\n const light = colorScheme\n ? `${lightThemeCSS}\\n ${lightSchemeCSS}`\n : lightThemeCSS;\n return `\n :root {\n ${baseTokenCSS}\n ${dark}\n }\n @media (prefers-color-scheme: light) {\n :root {\n ${light}\n }\n }\n :root.color-scheme-light {\n ${light}\n }\n :root.color-scheme-dark {\n ${dark}\n }\n `;\n};\n\n/**\n * Injects `:root { … }` into the page `<head>` once.\n *\n * CSS custom properties defined on `:root` cascade through shadow DOM\n * boundaries, so this makes every `var(--lit-devtools-accent)` etc. resolve inside both\n * runtime elements (indicator, source-overlay) and Lit panel components.\n *\n * The injected stylesheet reacts to `prefers-color-scheme` and to\n * `.color-scheme-light` / `.color-scheme-dark` classes on the document root.\n * It never sets `color-scheme` on the host page; the panel opts in via\n * {@link InjectTokensOptions.colorScheme} for its own document.\n */\nexport const injectTokens = (options?: InjectTokensOptions): void => {\n if (_injected) return;\n _injected = true;\n const style = document.createElement('style');\n style.setAttribute('data-lit-devtools-tokens', '');\n style.textContent = tokenStyleText(options);\n document.head.prepend(style);\n};\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Panel color-scheme preference, persisted in `localStorage`.\n *\n * `auto` is the default and needs no JavaScript: the token values injected by\n * {@link injectTokens} in `tokens.ts` react to `prefers-color-scheme` via\n * `@media`, so the panel follows whatever scheme its host requests — the OS\n * when standalone, or the embedding app's `color-scheme` when docked in the\n * Vite DevTools shell (the iframe inherits it). An explicit `light`/`dark`\n * preference pins the matching `.color-scheme-light` / `.color-scheme-dark`\n * class on the document root, overriding the media query.\n */\nexport type ColorSchemePreference = 'auto' | 'dark' | 'light';\n\n/** localStorage key for the panel UI color-scheme preference. */\nexport const COLOR_SCHEME_LS_KEY = 'lit-devtools-color-scheme';\n\n/** Read the saved preference, defaulting to `auto`. */\nexport const readColorSchemePreference = (): ColorSchemePreference => {\n try {\n const raw = localStorage.getItem(COLOR_SCHEME_LS_KEY);\n if (raw === 'auto' || raw === 'dark' || raw === 'light') return raw;\n } catch {\n // ignore\n }\n return 'auto';\n};\n\n/**\n * Apply a preference to the document root. `light`/`dark` pin the matching\n * class; `auto` removes both and lets the `prefers-color-scheme` `@media` rule\n * in the injected tokens own the scheme (and live-update on OS changes).\n */\nexport const applyColorScheme = (pref: ColorSchemePreference): void => {\n const root = document.documentElement;\n root.classList.remove('color-scheme-light', 'color-scheme-dark');\n if (pref !== 'auto') root.classList.add('color-scheme-' + pref);\n};\n\n/** Persist a preference and apply it immediately. */\nexport const setColorSchemePreference = (pref: ColorSchemePreference): void => {\n try {\n localStorage.setItem(COLOR_SCHEME_LS_KEY, pref);\n } catch {\n // ignore\n }\n applyColorScheme(pref);\n};\n","import{_$LH as o}from\"./lit-html.js\";\n/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{I:t}=o,i=o=>o,n=o=>null===o||\"object\"!=typeof o&&\"function\"!=typeof o,e={HTML:1,SVG:2,MATHML:3},l=(o,t)=>void 0===t?void 0!==o?._$litType$:o?._$litType$===t,d=o=>null!=o?._$litType$?.h,c=o=>void 0!==o?._$litDirective$,f=o=>o?._$litDirective$,r=o=>void 0===o.strings,s=()=>document.createComment(\"\"),v=(o,n,e)=>{const l=o._$AA.parentNode,d=void 0===n?o._$AB:n._$AA;if(void 0===e){const i=l.insertBefore(s(),d),n=l.insertBefore(s(),d);e=new t(i,n,o,o.options)}else{const t=e._$AB.nextSibling,n=e._$AM,c=n!==o;if(c){let t;e._$AQ?.(o),e._$AM=o,void 0!==e._$AP&&(t=o._$AU)!==n._$AU&&e._$AP(t)}if(t!==d||c){let o=e._$AA;for(;o!==t;){const t=i(o).nextSibling;i(l).insertBefore(o,d),o=t}}}return e},u=(o,t,i=o)=>(o._$AI(t,i),o),m={},p=(o,t=m)=>o._$AH=t,M=o=>o._$AH,h=o=>{o._$AR(),o._$AA.remove()},j=o=>{o._$AR()};export{e as TemplateResultType,j as clearPart,M as getCommittedValue,f as getDirectiveClass,v as insertPart,d as isCompiledTemplateResult,c as isDirectiveResult,n as isPrimitive,r as isSingleExpression,l as isTemplateResult,h as removePart,u as setChildPartValue,p as setCommittedValue};\n//# sourceMappingURL=directive-helpers.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}export{i as Directive,t as PartType,e as directive};\n//# sourceMappingURL=directive.js.map\n","import{isSingleExpression as i}from\"./directive-helpers.js\";import{Directive as t,PartType as e}from\"./directive.js\";export{directive}from\"./directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const s=(i,t)=>{const e=i._$AN;if(void 0===e)return!1;for(const i of e)i._$AO?.(t,!1),s(i,t);return!0},o=i=>{let t,e;do{if(void 0===(t=i._$AM))break;e=t._$AN,e.delete(i),i=t}while(0===e?.size)},r=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(void 0===e)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),c(t)}};function h(i){void 0!==this._$AN?(o(this),this._$AM=i,r(this)):this._$AM=i}function n(i,t=!1,e=0){const r=this._$AH,h=this._$AN;if(void 0!==h&&0!==h.size)if(t)if(Array.isArray(r))for(let i=e;i<r.length;i++)s(r[i],!1),o(r[i]);else null!=r&&(s(r,!1),o(r));else s(this,i)}const c=i=>{i.type==e.CHILD&&(i._$AP??=n,i._$AQ??=h)};class f extends t{constructor(){super(...arguments),this._$AN=void 0}_$AT(i,t,e){super._$AT(i,t,e),r(this),this.isConnected=i._$AU}_$AO(i,t=!0){i!==this.isConnected&&(this.isConnected=i,i?this.reconnected?.():this.disconnected?.()),t&&(s(this,i),o(this))}setValue(t){if(i(this._$Ct))this._$Ct._$AI(t,this);else{const i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}}export{f as AsyncDirective,t as Directive,e as PartType};\n//# sourceMappingURL=async-directive.js.map\n","import{nothing as t}from\"../lit-html.js\";import{AsyncDirective as i}from\"../async-directive.js\";import{directive as s}from\"../directive.js\";\n/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const e=()=>new h;class h{}const o=new WeakMap,n=s(class extends i{render(i){return t}update(i,[s]){const e=s!==this.G;return e&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=s,this.ht=i.options?.host,this.rt(this.ct=i.element)),t}rt(t){if(void 0!==this.G)if(this.isConnected||(t=void 0),\"function\"==typeof this.G){const i=this.ht??globalThis;let s=o.get(i);void 0===s&&(s=new WeakMap,o.set(i,s)),void 0!==s.get(this.G)&&this.G.call(this.ht,void 0),s.set(this.G,t),void 0!==t&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){return\"function\"==typeof this.G?o.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});export{e as createRef,n as ref};\n//# sourceMappingURL=ref.js.map\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Derivation over recorded timeline events.\n *\n * The capture layers emit one event per phase boundary, which is the right\n * wire format and the wrong thing to read: a single update tick of one\n * component is five to ten rows whose durations the reader has to subtract by\n * hand. Everything needed to do better is already on the events — `groupId`\n * pairs a start with its end, `data.changed` names the reactive properties\n * that caused the update — so this module turns a flat event list into the\n * three shapes the panel and agents actually ask for:\n *\n * - {@link TimelineSpan} — a start/end pair collapsed into one entry with a\n * duration (\"`update` took 1.8ms\").\n * - {@link UpdateCycle} — one component's whole update tick, with the changed\n * property keys that triggered it (\"`<hmr-counter>` updated because\n * `count` changed\").\n * - {@link ComponentRollup} — per-component totals over a recording (\"this\n * component updated 340 times for 120ms\").\n *\n * Pure and dependency-free by design: it imports only the shared event types,\n * so the panel derives client-side over its 5000-event buffer and\n * `devframe/definition.ts` — which must stay framework-neutral — can derive\n * server-side over the ring buffer for the agent-facing summary.\n */\n\nimport type {TimelineEvent} from '../../types/timeline.js';\n\n/** Layer whose events describe Lit update ticks. */\nconst LIFECYCLE_LAYER_ID = 'lit-lifecycle';\n\n/** Layers whose events are developer input, for {@link attributeInput}. */\nconst INPUT_LAYER_IDS: readonly string[] = ['mouse', 'keyboard'];\n\n/** The phase that brackets an entire update tick. */\nconst ROOT_PHASE = 'performUpdate';\n\nconst START_SUFFIX = ':start';\nconst END_SUFFIX = ':end';\n\n/**\n * A start/end pair collapsed into one entry, or a point event that never had\n * an end to begin with.\n */\nexport interface TimelineSpan {\n layerId: string;\n /**\n * Stable across re-derivation of the same events, which a Lit `repeat()`\n * key and a selection comparison both need — the span objects themselves\n * are rebuilt whenever the event buffer changes.\n */\n key: string;\n /** The event title with its `:start` / `:end` suffix removed. */\n name: string;\n /** Pairing id as emitted; `undefined` for point events. */\n groupId?: number | string;\n start: number;\n /** Absent while the span is still open, or if its end was never recorded. */\n end?: number;\n /** `end - start`. Absent for open spans and for point events. */\n duration?: number;\n /** Reactive property keys that caused this update, where the phase has them. */\n changed?: string[];\n subtitle?: string;\n logType?: TimelineEvent['logType'];\n meta?: TimelineEvent['meta'];\n /** The events this span was built from, for the detail pane. */\n events: TimelineEvent[];\n}\n\n/** One component's complete update tick. */\nexport interface UpdateCycle {\n /** The `${elementId}:${tick}` groupId the phases share. */\n key: string;\n elementId: number;\n tagName: string;\n source?: {file: string; line: number};\n start: number;\n /** The `performUpdate` span's duration — see {@link toUpdateCycles}. */\n duration?: number;\n /** Union of the changed reactive property keys across the tick's phases. */\n changed: string[];\n phases: TimelineSpan[];\n /** The input event this update followed, if any. See {@link attributeInput}. */\n cause?: {layerId: string; type: string; detail?: string; time: number};\n}\n\n/** Per-component totals over a set of update cycles. */\nexport interface ComponentRollup {\n tagName: string;\n /** Every instance of this component that updated, in first-seen order. */\n elementIds: number[];\n updates: number;\n /** Summed `performUpdate` durations; excludes cycles with no measured end. */\n totalMs: number;\n maxMs: number;\n /** Changed-key frequency across the cycles, most frequent first. */\n reasons: Array<{key: string; count: number}>;\n source?: {file: string; line: number};\n}\n\n/** Reads `data.changed` defensively — `data` is `unknown` on the wire. */\nconst changedOf = (event: TimelineEvent): string[] | undefined => {\n const data = event.data;\n if (data === null || typeof data !== 'object') return undefined;\n const changed = (data as {changed?: unknown}).changed;\n if (!Array.isArray(changed)) return undefined;\n const keys = changed.filter((key): key is string => typeof key === 'string');\n return keys.length > 0 ? keys : undefined;\n};\n\nconst pointSpan = (event: TimelineEvent, index: number): TimelineSpan => ({\n layerId: event.layerId,\n key: `${event.layerId}:point:${index}`,\n name: event.title ?? event.layerId,\n start: event.time,\n changed: changedOf(event),\n subtitle: event.subtitle,\n logType: event.logType,\n meta: event.meta,\n events: [event],\n});\n\n/**\n * Collapses `:start` / `:end` event pairs into spans, passing anything else\n * through as a point span.\n *\n * Pairing is keyed on **layer + groupId + phase name**, never on `groupId`\n * alone: a whole update tick shares one groupId (`runtime/timeline/\n * lifecycle.ts` builds it as `${elementId}:${tick}`), so matching on the id\n * would marry `willUpdate:start` to `performUpdate:end`. Each phase occurs at\n * most once per tick, which makes the triple unique.\n *\n * Unmatched halves survive rather than disappear — the buffer is a bounded\n * ring, so its oldest end and its newest start routinely have no partner, and\n * an update that is still running has a genuinely open span.\n */\nexport const toSpans = (events: readonly TimelineEvent[]): TimelineSpan[] => {\n const spans: TimelineSpan[] = [];\n const open = new Map<string, TimelineSpan>();\n\n events.forEach((event, index) => {\n const title = event.title ?? event.layerId;\n const isStart = title.endsWith(START_SUFFIX);\n const isEnd = !isStart && title.endsWith(END_SUFFIX);\n\n if (event.groupId === undefined || (!isStart && !isEnd)) {\n spans.push(pointSpan(event, index));\n return;\n }\n\n const name = title.slice(\n 0,\n -(isStart ? START_SUFFIX.length : END_SUFFIX.length)\n );\n const key = `${event.layerId}:${event.groupId}:${name}`;\n\n if (isStart) {\n const span: TimelineSpan = {\n layerId: event.layerId,\n key,\n name,\n groupId: event.groupId,\n start: event.time,\n changed: changedOf(event),\n subtitle: event.subtitle,\n logType: event.logType,\n meta: event.meta,\n events: [event],\n };\n open.set(key, span);\n // Pushed on its start, so the list is already in start order and an\n // open span keeps its place instead of appearing when it finally ends.\n spans.push(span);\n return;\n }\n\n const span = open.get(key);\n if (span === undefined) {\n spans.push(pointSpan(event, index));\n return;\n }\n open.delete(key);\n span.events.push(event);\n // A negative delta means the buffer straddles a clock reset (the runtime\n // re-zeroes on the rising edge of recording). Report no duration rather\n // than a negative one; the span stays open, which is what it honestly is.\n if (event.time >= span.start) {\n span.end = event.time;\n span.duration = event.time - span.start;\n }\n span.changed ??= changedOf(event);\n });\n\n return spans.sort((a, b) => a.start - b.start);\n};\n\n/**\n * Groups lifecycle spans into update ticks.\n *\n * `duration` is taken from the `performUpdate` span alone, never from a sum of\n * the phases: `willUpdate` / `update` / `updated` all run *inside*\n * `performUpdate`, so summing counts the same milliseconds several times over.\n *\n * `changed` is the union across the tick's phases because only the phases that\n * receive a `PropertyValues` argument carry it — `performUpdate` takes none,\n * so the bracketing span is always silent about the reason.\n */\nexport const toUpdateCycles = (\n spans: readonly TimelineSpan[]\n): UpdateCycle[] => {\n const byGroup = new Map<string, UpdateCycle>();\n\n for (const span of spans) {\n const elementId = span.meta?.elementId;\n if (\n span.layerId !== LIFECYCLE_LAYER_ID ||\n span.groupId === undefined ||\n elementId === undefined\n ) {\n // Point lifecycle events (connect/disconnect) have no groupId and are\n // not update ticks; other layers are not this function's business.\n continue;\n }\n\n const key = String(span.groupId);\n let cycle = byGroup.get(key);\n if (cycle === undefined) {\n cycle = {\n key,\n elementId,\n tagName: span.meta?.tagName ?? 'unknown',\n source: span.meta?.source,\n start: span.start,\n changed: [],\n phases: [],\n };\n byGroup.set(key, cycle);\n }\n\n cycle.phases.push(span);\n if (span.start < cycle.start) cycle.start = span.start;\n if (span.name === ROOT_PHASE) cycle.duration = span.duration;\n for (const changedKey of span.changed ?? []) {\n if (!cycle.changed.includes(changedKey)) cycle.changed.push(changedKey);\n }\n }\n\n return [...byGroup.values()].sort((a, b) => a.start - b.start);\n};\n\n/**\n * Totals update cycles per component tag.\n *\n * Grouped by tag rather than by instance because the question this answers is\n * \"which *component* re-renders too much\" — a list of 200 rows each updating\n * twice is one component's problem, not 200. The instance ids are kept so the\n * caller can still drill in.\n */\nexport const rollup = (cycles: readonly UpdateCycle[]): ComponentRollup[] => {\n const byTag = new Map<\n string,\n {entry: ComponentRollup; reasons: Map<string, number>}\n >();\n\n for (const cycle of cycles) {\n let record = byTag.get(cycle.tagName);\n if (record === undefined) {\n record = {\n entry: {\n tagName: cycle.tagName,\n elementIds: [],\n updates: 0,\n totalMs: 0,\n maxMs: 0,\n reasons: [],\n source: cycle.source,\n },\n reasons: new Map(),\n };\n byTag.set(cycle.tagName, record);\n }\n\n const {entry, reasons} = record;\n entry.updates++;\n if (!entry.elementIds.includes(cycle.elementId)) {\n entry.elementIds.push(cycle.elementId);\n }\n entry.source ??= cycle.source;\n // An open or clock-straddling cycle contributes a count but no time —\n // better than inventing one, and the count is what flags a hot component.\n if (cycle.duration !== undefined) {\n entry.totalMs += cycle.duration;\n if (cycle.duration > entry.maxMs) entry.maxMs = cycle.duration;\n }\n for (const key of cycle.changed) {\n reasons.set(key, (reasons.get(key) ?? 0) + 1);\n }\n }\n\n const entries: ComponentRollup[] = [];\n for (const {entry, reasons} of byTag.values()) {\n entry.reasons = [...reasons]\n .map(([key, count]) => ({key, count}))\n .sort((a, b) => b.count - a.count || a.key.localeCompare(b.key));\n entries.push(entry);\n }\n\n // Slowest first, then most frequent: a component with no measured durations\n // still sorts above a quiet one.\n return entries.sort((a, b) => b.totalMs - a.totalMs || b.updates - a.updates);\n};\n\n/**\n * Attributes each update cycle to the input event that preceded it, within\n * `windowMs`.\n *\n * This is what the mouse and keyboard layers are for. On their own they\n * duplicate what the browser's own event log already shows; joined to the\n * updates they precede they answer the question the raw layers only imply —\n * an update with a cause is an interaction, and an update without one is a\n * timer, a signal, or a stray `requestUpdate()`.\n *\n * Returns a new array; cycles with no cause are returned as-is.\n */\nexport const attributeInput = (\n cycles: readonly UpdateCycle[],\n events: readonly TimelineEvent[],\n windowMs = 200\n): UpdateCycle[] => {\n const inputs = events\n .filter((event) => INPUT_LAYER_IDS.includes(event.layerId))\n .sort((a, b) => a.time - b.time);\n if (inputs.length === 0) return [...cycles];\n\n // Both sides are sorted by time, so one forward pass suffices.\n let cursor = 0;\n return cycles.map((cycle) => {\n while (\n cursor + 1 < inputs.length &&\n inputs[cursor + 1]!.time <= cycle.start\n ) {\n cursor++;\n }\n const candidate = inputs[cursor]!;\n const delta = cycle.start - candidate.time;\n if (delta < 0 || delta > windowMs) return cycle;\n return {\n ...cycle,\n cause: {\n layerId: candidate.layerId,\n type: candidate.title ?? candidate.layerId,\n detail: candidate.subtitle,\n time: candidate.time,\n },\n };\n });\n};\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The Timeline's element and regex filters, as pure functions.\n *\n * Both presentations (the list and the tracks) answer \"show me only this\n * element\" or \"only things matching /update/\". The filter state therefore\n * lives in `timeline-view` and each presentation applies it here, so the two\n * cannot drift apart on what a match means.\n */\n\nimport type {TimelineEvent} from '../../types/timeline.js';\nimport type {TimelineSpan} from './derive.js';\n\n/**\n * Compiles the regex box. An empty box matches everything. A pattern that\n * does not compile (the user is mid-typing `foo(`) disables the filter rather\n * than hiding every row, and is reported as `invalid` so the input can say so.\n */\nexport const compileRegex = (\n source: string\n): {re: RegExp | null; invalid: boolean} => {\n if (source === '') return {re: null, invalid: false};\n try {\n return {re: new RegExp(source, 'i'), invalid: false};\n } catch {\n return {re: null, invalid: true};\n }\n};\n\n/** Text the regex filter searches: element tag, name, subtitle and the\n * changed property keys (the reason is worth searching for by name). */\nexport const spanHaystack = (span: TimelineSpan): string =>\n `${span.meta?.tagName ?? ''} ${span.name} ${span.subtitle ?? ''} ${(\n span.changed ?? []\n ).join(' ')}`;\n\n/**\n * Applies the element and regex filters. `re` comes from {@link compileRegex}\n * so a caller filtering on every keystroke compiles once, not per span.\n */\nexport const filterSpans = (\n spans: readonly TimelineSpan[],\n elementId: number | null,\n re: RegExp | null\n): TimelineSpan[] =>\n spans.filter(\n (span) =>\n (elementId === null || span.meta?.elementId === elementId) &&\n (re === null || re.test(spanHaystack(span)))\n );\n\n/** Distinct elements (by stable id) seen across the recorded events. */\nexport const listElements = (\n events: readonly TimelineEvent[]\n): Array<{id: number; tag: string}> => {\n const seen = new Map<number, string>();\n for (const ev of events) {\n const id = ev.meta?.elementId;\n if (id != null && !seen.has(id)) {\n seen.set(id, ev.meta?.tagName ?? 'unknown');\n }\n }\n return [...seen].map(([id, tag]) => ({id, tag}));\n};\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {LitElement, html, css, nothing} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {tokens} from './tokens.js';\n\nexport interface TabItem {\n id: string;\n label: string;\n icon?: string;\n /** Optional count pill trailing the label. Hidden when absent or zero. */\n badge?: number;\n}\n\nexport type SegTabSize = 'sm' | 'md';\n\n/**\n * Inline segmented tab control. Renders a horizontal row of text-only tabs\n * with the active one highlighted by the accent color.\n *\n * Matches the SegmentedTabs spec from the Lit Design System devtools kit.\n */\n@customElement('segmented-tabs')\nexport class SegmentedTabs extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: flex;\n gap: var(--lit-devtools-space-1);\n align-self: stretch;\n }\n button {\n appearance: none;\n display: flex;\n align-items: center;\n gap: var(--lit-devtools-space-2);\n border: 0;\n background: none;\n font: inherit;\n color: var(--lit-devtools-text-muted);\n padding: 0 var(--lit-devtools-space-5);\n cursor: pointer;\n border-bottom: 2px solid transparent;\n white-space: nowrap;\n transition:\n color var(--lit-devtools-dur-fast) var(--lit-devtools-ease-standard),\n border-color var(--lit-devtools-dur-fast)\n var(--lit-devtools-ease-standard),\n background var(--lit-devtools-dur-fast)\n var(--lit-devtools-ease-standard);\n }\n button:hover {\n color: var(--lit-devtools-text);\n background: var(--lit-devtools-surface-hover);\n }\n button.active {\n color: var(--lit-devtools-accent);\n border-bottom-color: var(--lit-devtools-accent);\n }\n button:focus-visible {\n outline: 2px solid var(--lit-devtools-accent-ring);\n outline-offset: -2px;\n }\n button svg {\n width: 18px;\n height: 18px;\n flex-shrink: 0;\n }\n .badge {\n flex-shrink: 0;\n min-width: 16px;\n padding: 0 var(--lit-devtools-space-1);\n border-radius: var(--lit-devtools-radius-pill);\n background: var(--lit-devtools-error-soft);\n color: var(--lit-devtools-error);\n font-size: var(--lit-devtools-text-xs);\n line-height: 16px;\n text-align: center;\n }\n :host([size='sm']) button {\n font-size: var(--lit-devtools-text-xs);\n padding: 0 var(--lit-devtools-space-4);\n }\n :host([size='md']) button,\n :host(:not([size])) button {\n font-size: var(--lit-devtools-text-sm);\n padding: 0 var(--lit-devtools-space-5);\n }\n `,\n ];\n\n @property({type: Array}) declare items: TabItem[];\n\n @property() declare value: string;\n\n @property() declare size: SegTabSize;\n\n constructor() {\n super();\n this.items = [];\n this.value = '';\n this.size = 'md';\n }\n\n private _select(id: string): void {\n this.value = id;\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: {value: id},\n bubbles: true,\n composed: true,\n })\n );\n }\n\n override render() {\n return html`\n ${this.items.map(\n (item) => html`\n <button\n role=\"tab\"\n aria-selected=${item.id === this.value}\n class=${item.id === this.value ? 'active' : ''}\n @click=${() => this._select(item.id)}\n >\n ${\n item.icon\n ? html`<svg\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path d=${item.icon} />\n </svg>`\n : nothing\n }\n ${item.label}\n ${\n item.badge\n ? html`<span class=\"badge\">${item.badge}</span>`\n : nothing\n }\n </button>\n `\n )}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'segmented-tabs': SegmentedTabs;\n }\n}\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {LitElement, html, css, nothing} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {tokens} from '../lib/tokens.js';\n\nexport interface LayerState {\n id: string;\n label: string;\n color: number;\n enabled: boolean;\n}\n\n/** A layer's `0xRRGGBB` colour as a CSS hex string. */\nexport const hexColor = (color: number): string =>\n '#' + color.toString(16).padStart(6, '0');\n\n/** CSS colour of layer `id`, grey for a layer `layers` does not know. */\nexport const layerColor = (\n layers: readonly LayerState[],\n id: string\n): string => {\n const layer = layers.find((l) => l.id === id);\n return layer ? hexColor(layer.color) : '#888';\n};\n\n/**\n * Strip of colored pill toggles — one per timeline layer.\n *\n * Used twice by `timeline-view`: once for the capture toggles, and in Tracks\n * mode once more for which lanes to draw. `caption` labels the strip so the\n * two are not mistaken for each other.\n */\n@customElement('timeline-layers')\nexport class TimelineLayers extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: flex;\n gap: var(--lit-devtools-space-2);\n padding: var(--lit-devtools-space-3) var(--lit-devtools-space-5);\n border-bottom: 1px solid var(--lit-devtools-border);\n background: var(--lit-devtools-surface-low);\n flex-shrink: 0;\n flex-wrap: wrap;\n }\n button {\n display: flex;\n align-items: center;\n gap: var(--lit-devtools-space-2);\n padding: var(--lit-devtools-space-2) var(--lit-devtools-space-4);\n border-radius: var(--lit-devtools-radius-pill);\n background: var(--lit-devtools-surface-elevated);\n border: 1px solid transparent;\n color: var(--lit-devtools-text-secondary);\n font-size: var(--lit-devtools-text-2xs);\n cursor: pointer;\n user-select: none;\n transition: opacity var(--lit-devtools-dur-fast)\n var(--lit-devtools-ease-standard);\n }\n button.on {\n color: var(--lit-devtools-text);\n }\n button:hover {\n background: var(--lit-devtools-surface-hover);\n }\n .caption {\n align-self: center;\n color: var(--lit-devtools-text-muted);\n font-size: var(--lit-devtools-text-2xs);\n margin-right: var(--lit-devtools-space-2);\n }\n .dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n flex-shrink: 0;\n opacity: 0.4;\n }\n button.on .dot {\n opacity: 1;\n }\n `,\n ];\n\n @property({type: Array}) layers: LayerState[] = [];\n /** Optional leading label, e.g. \"Tracks\". */\n @property() caption = '';\n\n private _toggle(id: string) {\n this.dispatchEvent(\n new CustomEvent<{id: string}>('layer-toggle', {\n detail: {id},\n bubbles: true,\n composed: true,\n })\n );\n }\n\n override render() {\n return html`${\n this.caption\n ? html`<span class=\"caption\">${this.caption}</span>`\n : nothing\n }${this.layers.map(\n (l) => html`\n <button\n class=${l.enabled ? 'on' : ''}\n title=${l.enabled ? `Hide ${l.label}` : `Show ${l.label}`}\n @click=${() => this._toggle(l.id)}\n >\n <span class=\"dot\" style=${'background:' + hexColor(l.color)}></span>\n ${l.label}\n </button>\n `\n )}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'timeline-layers': TimelineLayers;\n }\n}\n","import{noChange as e}from\"../lit-html.js\";import{directive as s,Directive as t,PartType as r}from\"../directive.js\";import{getCommittedValue as l,setChildPartValue as o,insertPart as i,removePart as n,setCommittedValue as f}from\"../directive-helpers.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst u=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},c=s(class extends t{constructor(e){if(super(e),e.type!==r.CHILD)throw Error(\"repeat() can only be used in text expressions\")}dt(e,s,t){let r;void 0===t?t=s:void 0!==s&&(r=s);const l=[],o=[];let i=0;for(const s of e)l[i]=r?r(s,i):i,o[i]=t(s,i),i++;return{values:o,keys:l}}render(e,s,t){return this.dt(e,s,t).values}update(s,[t,r,c]){const d=l(s),{values:p,keys:a}=this.dt(t,r,c);if(!Array.isArray(d))return this.ut=a,p;const h=this.ut??=[],v=[];let m,y,x=0,j=d.length-1,k=0,w=p.length-1;for(;x<=j&&k<=w;)if(null===d[x])x++;else if(null===d[j])j--;else if(h[x]===a[k])v[k]=o(d[x],p[k]),x++,k++;else if(h[j]===a[w])v[w]=o(d[j],p[w]),j--,w--;else if(h[x]===a[w])v[w]=o(d[x],p[w]),i(s,v[w+1],d[x]),x++,w--;else if(h[j]===a[k])v[k]=o(d[j],p[k]),i(s,d[x],d[j]),j--,k++;else if(void 0===m&&(m=u(a,k,w),y=u(h,x,j)),m.has(h[x]))if(m.has(h[j])){const e=y.get(a[k]),t=void 0!==e?d[e]:null;if(null===t){const e=i(s,d[x]);o(e,p[k]),v[k]=e}else v[k]=o(t,p[k]),i(s,d[x],t),d[e]=null;k++}else n(d[j]),j--;else n(d[x]),x++;for(;k<=w;){const e=i(s,v[w+1]);o(e,p[k]),v[k++]=e}for(;x<=j;){const e=d[x++];null!==e&&n(e)}return this.ut=a,f(s,v),e}});export{c as repeat};\n//# sourceMappingURL=repeat.js.map\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nexport class RangeChangedEvent extends Event {\n constructor(range) {\n super(RangeChangedEvent.eventName, { bubbles: false });\n this.first = range.first;\n this.last = range.last;\n }\n}\nRangeChangedEvent.eventName = 'rangeChanged';\nexport class VisibilityChangedEvent extends Event {\n constructor(range) {\n super(VisibilityChangedEvent.eventName, { bubbles: false });\n this.first = range.first;\n this.last = range.last;\n }\n}\nVisibilityChangedEvent.eventName = 'visibilityChanged';\nexport class UnpinnedEvent extends Event {\n constructor() {\n super(UnpinnedEvent.eventName, { bubbles: false });\n }\n}\nUnpinnedEvent.eventName = 'unpinned';\n//# sourceMappingURL=events.js.map","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nexport class ScrollerShim {\n constructor(element) {\n this._element = null;\n const node = element ?? window;\n this._node = node;\n if (element) {\n this._element = element;\n }\n }\n get element() {\n return (this._element || document.scrollingElement || document.documentElement);\n }\n get scrollTop() {\n return this.element.scrollTop || window.scrollY;\n }\n get scrollLeft() {\n return this.element.scrollLeft || window.scrollX;\n }\n get scrollHeight() {\n return this.element.scrollHeight;\n }\n get scrollWidth() {\n return this.element.scrollWidth;\n }\n get viewportHeight() {\n return this._element\n ? this._element.getBoundingClientRect().height\n : window.innerHeight;\n }\n get viewportWidth() {\n return this._element\n ? this._element.getBoundingClientRect().width\n : window.innerWidth;\n }\n get maxScrollTop() {\n return this.scrollHeight - this.viewportHeight;\n }\n get maxScrollLeft() {\n return this.scrollWidth - this.viewportWidth;\n }\n}\nexport class ScrollerController extends ScrollerShim {\n constructor(client, element) {\n super(element);\n this._clients = new Set();\n this._retarget = null;\n this._end = null;\n this.__destination = null;\n this.correctingScrollError = false;\n this._checkForArrival = this._checkForArrival.bind(this);\n this._updateManagedScrollTo = this._updateManagedScrollTo.bind(this);\n this.scrollTo = this.scrollTo.bind(this);\n this.scrollBy = this.scrollBy.bind(this);\n const node = this._node;\n this._originalScrollTo = node.scrollTo;\n this._originalScrollBy = node.scrollBy;\n this._originalScroll = node.scroll;\n this._attach(client);\n }\n get _destination() {\n return this.__destination;\n }\n get scrolling() {\n return this._destination !== null;\n }\n scrollTo(p1, p2) {\n const options = typeof p1 === 'number' && typeof p2 === 'number'\n ? { left: p1, top: p2 }\n : p1;\n this._scrollTo(options);\n }\n scrollBy(p1, p2) {\n const options = typeof p1 === 'number' && typeof p2 === 'number'\n ? { left: p1, top: p2 }\n : p1;\n if (options.top !== undefined) {\n options.top += this.scrollTop;\n }\n if (options.left !== undefined) {\n options.left += this.scrollLeft;\n }\n this._scrollTo(options);\n }\n _nativeScrollTo(options) {\n this._originalScrollTo.bind(this._element || window)(options);\n }\n _scrollTo(options, retarget = null, end = null) {\n if (this._end !== null) {\n this._end();\n }\n if (options.behavior === 'smooth') {\n this._setDestination(options);\n this._retarget = retarget;\n this._end = end;\n }\n else {\n this._resetScrollState();\n }\n this._nativeScrollTo(options);\n }\n _setDestination(options) {\n let { top, left } = options;\n top =\n top === undefined\n ? undefined\n : Math.max(0, Math.min(top, this.maxScrollTop));\n left =\n left === undefined\n ? undefined\n : Math.max(0, Math.min(left, this.maxScrollLeft));\n if (this._destination !== null &&\n left === this._destination.left &&\n top === this._destination.top) {\n return false;\n }\n this.__destination = { top, left, behavior: 'smooth' };\n return true;\n }\n _resetScrollState() {\n this.__destination = null;\n this._retarget = null;\n this._end = null;\n }\n _updateManagedScrollTo(coordinates) {\n if (this._destination) {\n if (this._setDestination(coordinates)) {\n this._nativeScrollTo(this._destination);\n }\n }\n }\n managedScrollTo(options, retarget, end) {\n this._scrollTo(options, retarget, end);\n return this._updateManagedScrollTo;\n }\n correctScrollError(coordinates) {\n this.correctingScrollError = true;\n requestAnimationFrame(() => requestAnimationFrame(() => (this.correctingScrollError = false)));\n // Correct the error\n this._nativeScrollTo(coordinates);\n // Then, if we were headed for a specific destination, we continue scrolling:\n // First, we update our target destination, if applicable...\n if (this._retarget) {\n this._setDestination(this._retarget());\n }\n // Then we go ahead and resume scrolling\n if (this._destination) {\n this._nativeScrollTo(this._destination);\n }\n }\n _checkForArrival() {\n if (this._destination !== null) {\n const { scrollTop, scrollLeft } = this;\n let { top, left } = this._destination;\n top = Math.min(top || 0, this.maxScrollTop);\n left = Math.min(left || 0, this.maxScrollLeft);\n const topDiff = Math.abs(top - scrollTop);\n const leftDiff = Math.abs(left - scrollLeft);\n // We check to see if we've arrived at our destination.\n if (topDiff < 1 && leftDiff < 1) {\n if (this._end) {\n this._end();\n }\n this._resetScrollState();\n }\n }\n }\n detach(client) {\n this._clients.delete(client);\n /**\n * If there aren't any more clients, then return the node's default\n * scrolling methods\n */\n if (this._clients.size === 0) {\n this._node.scrollTo = this._originalScrollTo;\n this._node.scrollBy = this._originalScrollBy;\n this._node.scroll = this._originalScroll;\n this._node.removeEventListener('scroll', this._checkForArrival);\n }\n return null;\n }\n _attach(client) {\n this._clients.add(client);\n /**\n * The node should only have the methods shimmed when adding the first\n * client – otherwise it's redundant\n */\n if (this._clients.size === 1) {\n this._node.scrollTo = this.scrollTo;\n this._node.scrollBy = this.scrollBy;\n this._node.scroll = this.scrollTo;\n this._node.addEventListener('scroll', this._checkForArrival);\n }\n }\n}\n//# sourceMappingURL=ScrollerController.js.map","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport { RangeChangedEvent, VisibilityChangedEvent, UnpinnedEvent, } from './events.js';\nimport { ScrollerController } from './ScrollerController.js';\n// Virtualizer depends on `ResizeObserver`, which is supported in\n// all modern browsers. For developers whose browser support\n// matrix includes older browsers, we include a compatible\n// polyfill in the package; this bit of module state facilitates\n// a simple mechanism (see ./polyfillLoaders/ResizeObserver.js.)\n// for loading the polyfill.\nlet _ResizeObserver = typeof window !== 'undefined' ? window.ResizeObserver : undefined;\n/**\n * Call this function to provide a `ResizeObserver` polyfill for Virtualizer to use.\n * @param Ctor Constructor for a `ResizeObserver` polyfill (recommend using the one provided with the Virtualizer package)\n */\nexport function provideResizeObserver(Ctor) {\n _ResizeObserver = Ctor;\n}\nexport const virtualizerRef = Symbol('virtualizerRef');\nconst SIZER_ATTRIBUTE = 'virtualizer-sizer';\nlet DefaultLayoutConstructor;\n/**\n * Provides virtual scrolling boilerplate.\n *\n * Extensions of this class must set hostElement and layout.\n *\n * Extensions of this class must also override VirtualRepeater's DOM\n * manipulation methods.\n */\nexport class Virtualizer {\n constructor(config) {\n this._benchmarkStart = null;\n this._layout = null;\n this._clippingAncestors = [];\n /**\n * Layout provides these values, we set them on _render().\n * TODO @straversi: Can we find an XOR type, usable for the key here?\n */\n this._scrollSize = null;\n /**\n * Difference between scroll target's current and required scroll offsets.\n * Provided by layout.\n */\n this._scrollError = null;\n /**\n * A list of the positions (top, left) of the children in the current range.\n */\n this._childrenPos = null;\n // TODO: (graynorton): type\n this._childMeasurements = null;\n this._toBeMeasured = new Map();\n this._rangeChanged = true;\n this._itemsChanged = true;\n this._visibilityChanged = true;\n this._scrollerController = null;\n this._isScroller = false;\n this._sizer = null;\n /**\n * Resize observer attached to hostElement.\n */\n this._hostElementRO = null;\n /**\n * Resize observer attached to children.\n */\n this._childrenRO = null;\n this._mutationObserver = null;\n this._scrollEventListeners = [];\n this._scrollEventListenerOptions = {\n passive: true,\n };\n // TODO (graynorton): Rethink, per longer comment below\n this._loadListener = this._childLoaded.bind(this);\n /**\n * Index of element to scroll into view, plus scroll\n * behavior options, as imperatively specified via\n * `element(index).scrollIntoView()`\n */\n this._scrollIntoViewTarget = null;\n this._updateScrollIntoViewCoordinates = null;\n /**\n * Items to render. Set by items.\n */\n this._items = [];\n /**\n * Index of the first child in the range, not necessarily the first visible child.\n * TODO @straversi: Consider renaming these.\n */\n this._first = -1;\n /**\n * Index of the last child in the range.\n */\n this._last = -1;\n /**\n * Index of the first item intersecting the viewport.\n */\n this._firstVisible = -1;\n /**\n * Index of the last item intersecting the viewport.\n */\n this._lastVisible = -1;\n this._scheduled = new WeakSet();\n /**\n * Invoked at the end of each render cycle: children in the range are\n * measured, and their dimensions passed to this callback. Use it to layout\n * children as needed.\n */\n this._measureCallback = null;\n this._measureChildOverride = null;\n /**\n * State for `layoutComplete` promise\n */\n this._layoutCompletePromise = null;\n this._layoutCompleteResolver = null;\n this._layoutCompleteRejecter = null;\n this._pendingLayoutComplete = null;\n /**\n * Layout initialization is async because we dynamically load\n * the default layout if none is specified. This state is to track\n * whether init is complete.\n */\n this._layoutInitialized = null;\n /**\n * Track connection state to guard against errors / unnecessary work\n */\n this._connected = false;\n if (!config) {\n throw new Error('Virtualizer constructor requires a configuration object');\n }\n if (config.hostElement) {\n this._init(config);\n }\n else {\n throw new Error('Virtualizer configuration requires the \"hostElement\" property');\n }\n }\n set items(items) {\n if (Array.isArray(items) && items !== this._items) {\n this._itemsChanged = true;\n this._items = items;\n this._schedule(this._updateLayout);\n }\n }\n _init(config) {\n this._isScroller = !!config.scroller;\n this._initHostElement(config);\n // If no layout is specified, we make an empty\n // layout config, which will result in the default\n // layout with default parameters\n const layoutConfig = config.layout || {};\n // Save the promise returned by `_initLayout` as a state\n // variable we can check before updating layout config\n this._layoutInitialized = this._initLayout(layoutConfig);\n }\n _initObservers() {\n this._mutationObserver = new MutationObserver(this._finishDOMUpdate.bind(this));\n this._hostElementRO = new _ResizeObserver(() => this._hostElementSizeChanged());\n this._childrenRO = new _ResizeObserver(this._childrenSizeChanged.bind(this));\n }\n _initHostElement(config) {\n const hostElement = (this._hostElement = config.hostElement);\n this._applyVirtualizerStyles();\n hostElement[virtualizerRef] = this;\n }\n connected() {\n this._initObservers();\n const includeSelf = this._isScroller;\n this._clippingAncestors = getClippingAncestors(this._hostElement, includeSelf);\n this._scrollerController = new ScrollerController(this, this._clippingAncestors[0]);\n this._schedule(this._updateLayout);\n this._observeAndListen();\n this._connected = true;\n }\n _observeAndListen() {\n this._mutationObserver.observe(this._hostElement, { childList: true });\n this._hostElementRO.observe(this._hostElement);\n this._scrollEventListeners.push(window);\n window.addEventListener('scroll', this, this._scrollEventListenerOptions);\n this._clippingAncestors.forEach((ancestor) => {\n ancestor.addEventListener('scroll', this, this._scrollEventListenerOptions);\n this._scrollEventListeners.push(ancestor);\n this._hostElementRO.observe(ancestor);\n });\n this._hostElementRO.observe(this._scrollerController.element);\n this._children.forEach((child) => this._childrenRO.observe(child));\n this._scrollEventListeners.forEach((target) => target.addEventListener('scroll', this, this._scrollEventListenerOptions));\n }\n disconnected() {\n this._scrollEventListeners.forEach((target) => target.removeEventListener('scroll', this, this._scrollEventListenerOptions));\n this._scrollEventListeners = [];\n this._clippingAncestors = [];\n this._scrollerController?.detach(this);\n this._scrollerController = null;\n this._mutationObserver?.disconnect();\n this._mutationObserver = null;\n this._hostElementRO?.disconnect();\n this._hostElementRO = null;\n this._childrenRO?.disconnect();\n this._childrenRO = null;\n this._rejectLayoutCompletePromise('disconnected');\n this._connected = false;\n }\n _applyVirtualizerStyles() {\n const hostElement = this._hostElement;\n // Would rather set these CSS properties on the host using Shadow Root\n // style scoping (and falling back to a global stylesheet where native\n // Shadow DOM is not available), but this Mobile Safari bug is preventing\n // that from working: https://bugs.webkit.org/show_bug.cgi?id=226195\n const style = hostElement.style;\n style.display = style.display || 'block';\n style.position = style.position || 'relative';\n style.contain = style.contain || 'size layout';\n if (this._isScroller) {\n style.overflow = style.overflow || 'auto';\n style.minHeight = style.minHeight || '150px';\n }\n }\n _getSizer() {\n const hostElement = this._hostElement;\n if (!this._sizer) {\n // Use a preexisting sizer element if provided (for better integration\n // with vDOM renderers)\n let sizer = hostElement.querySelector(`[${SIZER_ATTRIBUTE}]`);\n if (!sizer) {\n sizer = document.createElement('div');\n sizer.setAttribute(SIZER_ATTRIBUTE, '');\n hostElement.appendChild(sizer);\n }\n // When the scrollHeight is large, the height of this element might be\n // ignored. Setting content and font-size ensures the element has a size.\n Object.assign(sizer.style, {\n position: 'absolute',\n margin: '-2px 0 0 0',\n padding: 0,\n visibility: 'hidden',\n fontSize: '2px',\n });\n sizer.textContent = '&nbsp;';\n sizer.setAttribute(SIZER_ATTRIBUTE, '');\n this._sizer = sizer;\n }\n return this._sizer;\n }\n async updateLayoutConfig(layoutConfig) {\n // If layout initialization hasn't finished yet, we wait\n // for it to finish so we can check whether the new config\n // is compatible with the existing layout before proceeding.\n await this._layoutInitialized;\n const Ctor = layoutConfig.type ||\n // The new config is compatible with the current layout,\n // so we update the config and return true to indicate\n // a successful update\n DefaultLayoutConstructor;\n if (typeof Ctor === 'function' && this._layout instanceof Ctor) {\n const config = { ...layoutConfig };\n delete config.type;\n this._layout.config = config;\n // The new config requires a different layout altogether, but\n // to limit implementation complexity we don't support dynamically\n // changing the layout of an existing virtualizer instance.\n // Returning false here lets the caller know that they should\n // instead make a new virtualizer instance with the desired layout.\n return true;\n }\n return false;\n }\n async _initLayout(layoutConfig) {\n let config;\n let Ctor;\n if (typeof layoutConfig.type === 'function') {\n // If we have a full LayoutSpecifier, the `type` property\n // gives us our constructor...\n Ctor = layoutConfig.type;\n // ...while the rest of the specifier is our layout config\n const copy = { ...layoutConfig };\n delete copy.type;\n config = copy;\n }\n else {\n // If we don't have a full LayoutSpecifier, we just\n // have a config for the default layout\n config = layoutConfig;\n }\n if (Ctor === undefined) {\n // If we don't have a constructor yet, load the default\n DefaultLayoutConstructor = Ctor = (await import('./layouts/flow.js'))\n .FlowLayout;\n }\n this._layout = new Ctor((message) => this._handleLayoutMessage(message), config);\n if (this._layout.measureChildren &&\n typeof this._layout.updateItemSizes === 'function') {\n if (typeof this._layout.measureChildren === 'function') {\n this._measureChildOverride = this._layout.measureChildren;\n }\n this._measureCallback = this._layout.updateItemSizes.bind(this._layout);\n }\n if (this._layout.listenForChildLoadEvents) {\n this._hostElement.addEventListener('load', this._loadListener, true);\n }\n this._schedule(this._updateLayout);\n }\n // TODO (graynorton): Rework benchmarking so that it has no API and\n // instead is always on except in production builds\n startBenchmarking() {\n if (this._benchmarkStart === null) {\n this._benchmarkStart = window.performance.now();\n }\n }\n stopBenchmarking() {\n if (this._benchmarkStart !== null) {\n const now = window.performance.now();\n const timeElapsed = now - this._benchmarkStart;\n const entries = performance.getEntriesByName('uv-virtualizing', 'measure');\n const virtualizationTime = entries\n .filter((e) => e.startTime >= this._benchmarkStart && e.startTime < now)\n .reduce((t, m) => t + m.duration, 0);\n this._benchmarkStart = null;\n return { timeElapsed, virtualizationTime };\n }\n return null;\n }\n _measureChildren() {\n const mm = {};\n const children = this._children;\n const fn = this._measureChildOverride || this._measureChild;\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n const idx = this._first + i;\n if (this._itemsChanged || this._toBeMeasured.has(child)) {\n mm[idx] = fn.call(this, child, this._items[idx]);\n }\n }\n this._childMeasurements = mm;\n this._schedule(this._updateLayout);\n this._toBeMeasured.clear();\n }\n /**\n * Returns the width, height, and margins of the given child.\n */\n _measureChild(element) {\n // offsetWidth doesn't take transforms in consideration, so we use\n // getBoundingClientRect which does.\n const { width, height } = element.getBoundingClientRect();\n return Object.assign({ width, height }, getMargins(element));\n }\n async _schedule(method) {\n if (!this._scheduled.has(method)) {\n this._scheduled.add(method);\n await Promise.resolve();\n this._scheduled.delete(method);\n method.call(this);\n }\n }\n async _updateDOM(state) {\n this._scrollSize = state.scrollSize;\n this._adjustRange(state.range);\n this._childrenPos = state.childPositions;\n this._scrollError = state.scrollError || null;\n const { _rangeChanged, _itemsChanged } = this;\n if (this._visibilityChanged) {\n this._notifyVisibility();\n this._visibilityChanged = false;\n }\n if (_rangeChanged || _itemsChanged) {\n this._notifyRange();\n this._rangeChanged = false;\n }\n this._finishDOMUpdate();\n }\n _finishDOMUpdate() {\n if (this._connected) {\n // _childrenRO should be non-null if we're connected\n this._children.forEach((child) => this._childrenRO.observe(child));\n this._checkScrollIntoViewTarget(this._childrenPos);\n this._positionChildren(this._childrenPos);\n this._sizeHostElement(this._scrollSize);\n this._correctScrollError();\n if (this._benchmarkStart && 'mark' in window.performance) {\n window.performance.mark('uv-end');\n }\n }\n }\n _updateLayout() {\n if (this._layout && this._connected) {\n this._layout.items = this._items;\n this._updateView();\n if (this._childMeasurements !== null) {\n // If the layout has been changed, we may have measurements but no callback\n if (this._measureCallback) {\n this._measureCallback(this._childMeasurements);\n }\n this._childMeasurements = null;\n }\n this._layout.reflowIfNeeded();\n if (this._benchmarkStart && 'mark' in window.performance) {\n window.performance.mark('uv-end');\n }\n }\n }\n _handleScrollEvent() {\n if (this._benchmarkStart && 'mark' in window.performance) {\n try {\n window.performance.measure('uv-virtualizing', 'uv-start', 'uv-end');\n }\n catch (e) {\n console.warn('Error measuring performance data: ', e);\n }\n window.performance.mark('uv-start');\n }\n if (this._scrollerController.correctingScrollError === false) {\n // This is a user-initiated scroll, so we unpin the layout\n this._layout?.unpin();\n }\n this._schedule(this._updateLayout);\n }\n handleEvent(event) {\n switch (event.type) {\n case 'scroll':\n if (event.currentTarget === window ||\n this._clippingAncestors.includes(event.currentTarget)) {\n this._handleScrollEvent();\n }\n break;\n default:\n console.warn('event not handled', event);\n }\n }\n _handleLayoutMessage(message) {\n if (message.type === 'stateChanged') {\n this._updateDOM(message);\n }\n else if (message.type === 'visibilityChanged') {\n this._firstVisible = message.firstVisible;\n this._lastVisible = message.lastVisible;\n this._notifyVisibility();\n }\n else if (message.type === 'unpinned') {\n this._hostElement.dispatchEvent(new UnpinnedEvent());\n }\n }\n get _children() {\n const arr = [];\n let next = this._hostElement.firstElementChild;\n while (next) {\n if (!next.hasAttribute(SIZER_ATTRIBUTE)) {\n arr.push(next);\n }\n next = next.nextElementSibling;\n }\n return arr;\n }\n _updateView() {\n const hostElement = this._hostElement;\n const scrollingElement = this._scrollerController?.element;\n const layout = this._layout;\n if (hostElement && scrollingElement && layout) {\n let top, left, bottom, right;\n const hostElementBounds = hostElement.getBoundingClientRect();\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n const ancestorBounds = this._clippingAncestors.map((ancestor) => ancestor.getBoundingClientRect());\n ancestorBounds.unshift(hostElementBounds);\n for (const bounds of ancestorBounds) {\n top = Math.max(top, bounds.top);\n left = Math.max(left, bounds.left);\n bottom = Math.min(bottom, bounds.bottom);\n right = Math.min(right, bounds.right);\n }\n const scrollingElementBounds = scrollingElement.getBoundingClientRect();\n const offsetWithinScroller = {\n left: hostElementBounds.left - scrollingElementBounds.left,\n top: hostElementBounds.top - scrollingElementBounds.top,\n };\n const totalScrollSize = {\n width: scrollingElement.scrollWidth,\n height: scrollingElement.scrollHeight,\n };\n const scrollTop = top - hostElementBounds.top + hostElement.scrollTop;\n const scrollLeft = left - hostElementBounds.left + hostElement.scrollLeft;\n const height = Math.max(0, bottom - top);\n const width = Math.max(0, right - left);\n layout.viewportSize = { width, height };\n layout.viewportScroll = { top: scrollTop, left: scrollLeft };\n layout.totalScrollSize = totalScrollSize;\n layout.offsetWithinScroller = offsetWithinScroller;\n }\n }\n /**\n * Styles the host element so that its size reflects the\n * total size of all items.\n */\n _sizeHostElement(size) {\n // Some browsers seem to crap out if the host element gets larger than\n // a certain size, so we clamp it here (this value based on ad hoc\n // testing in Chrome / Safari / Firefox Mac)\n const max = 8200000;\n const h = size && size.width !== null ? Math.min(max, size.width) : 0;\n const v = size && size.height !== null ? Math.min(max, size.height) : 0;\n if (this._isScroller) {\n this._getSizer().style.transform = `translate(${h}px, ${v}px)`;\n }\n else {\n const style = this._hostElement.style;\n style.minWidth = h ? `${h}px` : '100%';\n style.minHeight = v ? `${v}px` : '100%';\n }\n }\n /**\n * Sets the top and left transform style of the children from the values in\n * pos.\n */\n _positionChildren(pos) {\n if (pos) {\n pos.forEach(({ top, left, width, height, xOffset, yOffset }, index) => {\n const child = this._children[index - this._first];\n if (child) {\n child.style.position = 'absolute';\n child.style.boxSizing = 'border-box';\n child.style.transform = `translate(${left}px, ${top}px)`;\n if (width !== undefined) {\n child.style.width = width + 'px';\n }\n if (height !== undefined) {\n child.style.height = height + 'px';\n }\n child.style.left =\n xOffset === undefined ? null : xOffset + 'px';\n child.style.top =\n yOffset === undefined ? null : yOffset + 'px';\n }\n });\n }\n }\n async _adjustRange(range) {\n const { _first, _last, _firstVisible, _lastVisible } = this;\n this._first = range.first;\n this._last = range.last;\n this._firstVisible = range.firstVisible;\n this._lastVisible = range.lastVisible;\n this._rangeChanged =\n this._rangeChanged || this._first !== _first || this._last !== _last;\n this._visibilityChanged =\n this._visibilityChanged ||\n this._firstVisible !== _firstVisible ||\n this._lastVisible !== _lastVisible;\n }\n _correctScrollError() {\n if (this._scrollError) {\n const { scrollTop, scrollLeft } = this._scrollerController;\n const { top, left } = this._scrollError;\n this._scrollError = null;\n this._scrollerController.correctScrollError({\n top: scrollTop - top,\n left: scrollLeft - left,\n });\n }\n }\n element(index) {\n if (index === Infinity) {\n index = this._items.length - 1;\n }\n return this._items?.[index] === undefined\n ? undefined\n : {\n scrollIntoView: (options = {}) => this._scrollElementIntoView({ ...options, index }),\n };\n }\n _scrollElementIntoView(options) {\n if (options.index >= this._first && options.index <= this._last) {\n this._children[options.index - this._first].scrollIntoView(options);\n }\n else {\n options.index = Math.min(options.index, this._items.length - 1);\n if (options.behavior === 'smooth') {\n const coordinates = this._layout.getScrollIntoViewCoordinates(options);\n const { behavior } = options;\n this._updateScrollIntoViewCoordinates =\n this._scrollerController.managedScrollTo(Object.assign(coordinates, { behavior }), () => this._layout.getScrollIntoViewCoordinates(options), () => (this._scrollIntoViewTarget = null));\n this._scrollIntoViewTarget = options;\n }\n else {\n this._layout.pin = options;\n }\n }\n }\n /**\n * If we are smoothly scrolling to an element and the target element\n * is in the DOM, we update our target coordinates as needed\n */\n _checkScrollIntoViewTarget(pos) {\n const { index } = this._scrollIntoViewTarget || {};\n if (index && pos?.has(index)) {\n this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget));\n }\n }\n /**\n * Emits a rangechange event with the current first, last, firstVisible, and\n * lastVisible.\n */\n _notifyRange() {\n this._hostElement.dispatchEvent(new RangeChangedEvent({ first: this._first, last: this._last }));\n }\n _notifyVisibility() {\n this._hostElement.dispatchEvent(new VisibilityChangedEvent({\n first: this._firstVisible,\n last: this._lastVisible,\n }));\n }\n get layoutComplete() {\n // Lazily create promise\n if (!this._layoutCompletePromise) {\n this._layoutCompletePromise = new Promise((resolve, reject) => {\n this._layoutCompleteResolver = resolve;\n this._layoutCompleteRejecter = reject;\n });\n }\n return this._layoutCompletePromise;\n }\n _rejectLayoutCompletePromise(reason) {\n if (this._layoutCompleteRejecter !== null) {\n this._layoutCompleteRejecter(reason);\n }\n this._resetLayoutCompleteState();\n }\n _scheduleLayoutComplete() {\n // Don't do anything unless we have a pending promise\n // And only request a frame if we haven't already done so\n if (this._layoutCompletePromise && this._pendingLayoutComplete === null) {\n // Wait one additional frame to be sure the layout is stable\n this._pendingLayoutComplete = requestAnimationFrame(() => requestAnimationFrame(() => this._resolveLayoutCompletePromise()));\n }\n }\n _resolveLayoutCompletePromise() {\n if (this._layoutCompleteResolver !== null) {\n this._layoutCompleteResolver();\n }\n this._resetLayoutCompleteState();\n }\n _resetLayoutCompleteState() {\n this._layoutCompletePromise = null;\n this._layoutCompleteResolver = null;\n this._layoutCompleteRejecter = null;\n this._pendingLayoutComplete = null;\n }\n /**\n * Render and update the view at the next opportunity with the given\n * hostElement size.\n */\n _hostElementSizeChanged() {\n this._schedule(this._updateLayout);\n }\n // TODO (graynorton): Rethink how this works. Probably child loading is too specific\n // to have dedicated support for; might want some more generic lifecycle hooks for\n // layouts to use. Possibly handle measurement this way, too, or maybe that remains\n // a first-class feature?\n _childLoaded() { }\n // This is the callback for the ResizeObserver that watches the\n // virtualizer's children. We land here at the end of every virtualizer\n // update cycle that results in changes to physical items, and we also\n // end up here if one or more children change size independently of\n // the virtualizer update cycle.\n _childrenSizeChanged(changes) {\n // Only measure if the layout requires it\n if (this._layout?.measureChildren) {\n for (const change of changes) {\n this._toBeMeasured.set(change.target, change.contentRect);\n }\n this._measureChildren();\n }\n // If this is the end of an update cycle, we need to reset some\n // internal state. This should be a harmless no-op if we're handling\n // an out-of-cycle ResizeObserver callback, so we don't need to\n // distinguish between the two cases.\n this._scheduleLayoutComplete();\n this._itemsChanged = false;\n this._rangeChanged = false;\n }\n}\nfunction getMargins(el) {\n const style = window.getComputedStyle(el);\n return {\n marginTop: getMarginValue(style.marginTop),\n marginRight: getMarginValue(style.marginRight),\n marginBottom: getMarginValue(style.marginBottom),\n marginLeft: getMarginValue(style.marginLeft),\n };\n}\nfunction getMarginValue(value) {\n const float = value ? parseFloat(value) : NaN;\n return Number.isNaN(float) ? 0 : float;\n}\n// TODO (graynorton): Deal with iframes?\nfunction getParentElement(el) {\n if (el.assignedSlot !== null) {\n return el.assignedSlot;\n }\n if (el.parentElement !== null) {\n return el.parentElement;\n }\n const parentNode = el.parentNode;\n if (parentNode && parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n return parentNode.host || null;\n }\n return null;\n}\n///\nfunction getElementAncestors(el, includeSelf = false) {\n const ancestors = [];\n let parent = includeSelf ? el : getParentElement(el);\n while (parent !== null) {\n ancestors.push(parent);\n parent = getParentElement(parent);\n }\n return ancestors;\n}\nfunction getClippingAncestors(el, includeSelf = false) {\n let foundFixed = false;\n return getElementAncestors(el, includeSelf).filter((a) => {\n if (foundFixed) {\n return false;\n }\n const style = getComputedStyle(a);\n foundFixed = style.position === 'fixed';\n return style.overflow !== 'visible';\n });\n}\n//# sourceMappingURL=Virtualizer.js.map","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport { html, noChange } from 'lit';\nimport { directive, PartType } from 'lit/directive.js';\nimport { AsyncDirective } from 'lit/async-directive.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { Virtualizer } from './Virtualizer.js';\nexport { virtualizerRef } from './Virtualizer.js';\nexport const defaultKeyFunction = (item) => item;\nexport const defaultRenderItem = (item, idx) => html `${idx}: ${JSON.stringify(item, null, 2)}`;\nclass VirtualizeDirective extends AsyncDirective {\n constructor(part) {\n super(part);\n this._virtualizer = null;\n this._first = 0;\n this._last = -1;\n this._renderItem = (item, idx) => defaultRenderItem(item, idx + this._first);\n this._keyFunction = (item, idx) => defaultKeyFunction(item, idx + this._first);\n this._items = [];\n if (part.type !== PartType.CHILD) {\n throw new Error('The virtualize directive can only be used in child expressions');\n }\n }\n render(config) {\n if (config) {\n this._setFunctions(config);\n }\n const itemsToRender = [];\n if (this._first >= 0 && this._last >= this._first) {\n for (let i = this._first; i <= this._last; i++) {\n itemsToRender.push(this._items[i]);\n }\n }\n return repeat(itemsToRender, this._keyFunction, this._renderItem);\n }\n update(part, [config]) {\n this._setFunctions(config);\n const itemsChanged = this._items !== config.items;\n this._items = config.items || [];\n if (this._virtualizer) {\n this._updateVirtualizerConfig(part, config);\n }\n else {\n this._initialize(part, config);\n }\n return itemsChanged ? noChange : this.render();\n }\n async _updateVirtualizerConfig(part, config) {\n const compatible = await this._virtualizer.updateLayoutConfig(config.layout || {});\n if (!compatible) {\n const hostElement = part.parentNode;\n this._makeVirtualizer(hostElement, config);\n }\n this._virtualizer.items = this._items;\n }\n _setFunctions(config) {\n const { renderItem, keyFunction } = config;\n if (renderItem) {\n this._renderItem = (item, idx) => renderItem(item, idx + this._first);\n }\n if (keyFunction) {\n this._keyFunction = (item, idx) => keyFunction(item, idx + this._first);\n }\n }\n _makeVirtualizer(hostElement, config) {\n if (this._virtualizer) {\n this._virtualizer.disconnected();\n }\n const { layout, scroller, items } = config;\n this._virtualizer = new Virtualizer({ hostElement, layout, scroller });\n this._virtualizer.items = items;\n this._virtualizer.connected();\n }\n _initialize(part, config) {\n const hostElement = part.parentNode;\n if (hostElement && hostElement.nodeType === 1) {\n hostElement.addEventListener('rangeChanged', (e) => {\n this._first = e.first;\n this._last = e.last;\n this.setValue(this.render());\n });\n this._makeVirtualizer(hostElement, config);\n }\n }\n disconnected() {\n this._virtualizer?.disconnected();\n }\n reconnected() {\n this._virtualizer?.connected();\n }\n}\nexport const virtualize = directive(VirtualizeDirective);\n//# sourceMappingURL=virtualize.js.map","//#region src/utils/colors.ts\nfunction makeColor(open, close) {\n\tconst o = `\\x1B[${open}m`;\n\tconst c = `\\x1B[${close}m`;\n\treturn ((arg, ...values) => {\n\t\tif (Array.isArray(arg) && \"raw\" in arg) {\n\t\t\tconst strings = arg;\n\t\t\tlet out = \"\";\n\t\t\tfor (let i = 0; i < strings.length; i++) {\n\t\t\t\tout += strings[i];\n\t\t\t\tif (i < values.length) out += String(values[i]);\n\t\t\t}\n\t\t\treturn `${o}${out}${c}`;\n\t\t}\n\t\treturn `${o}${String(arg)}${c}`;\n\t});\n}\nconst colors = {\n\tblue: makeColor(34, 39),\n\tcyan: makeColor(36, 39),\n\tgray: makeColor(90, 39),\n\tgreen: makeColor(32, 39),\n\tred: makeColor(31, 39),\n\tyellow: makeColor(33, 39),\n\tbold: makeColor(1, 22),\n\tdim: makeColor(2, 22),\n\treset: makeColor(0, 0),\n\tunderline: makeColor(4, 24)\n};\n//#endregion\nexport { colors };\n","//#region src/formatters/plain.ts\n/**\n* Renders a diagnostic into a multi-line, unicode-decorated string suitable\n* for terminal output. The first line is `[<name>] <message>`; optional\n* details (`fix`, `sources`, `docs`) follow with `├▶`/`╰▶` connectors.\n*/\nfunction formatDiagnostic(diagnostic) {\n\tconst header = `[${diagnostic.name}] ${diagnostic.message}`;\n\tconst details = [];\n\tif (diagnostic.fix) details.push(`fix: ${diagnostic.fix}`);\n\tif (diagnostic.sources?.length) details.push(`sources: ${diagnostic.sources.join(\", \")}`);\n\tif (diagnostic.docs) details.push(`see: ${diagnostic.docs}`);\n\tif (details.length === 0) return header;\n\treturn [header, ...details.map((detail, i) => {\n\t\treturn `${i < details.length - 1 ? \"├▶\" : \"╰▶\"} ${detail}`;\n\t})].join(\"\\n\");\n}\n//#endregion\n//#region src/utils.ts\n/**\n* Transforms a value or a function that returns a value to a value.\n*\n* @param valFn either a value or a function that returns a value\n* @param args arguments to pass to the function if `valFn` is a function\n*\n* @internal\n*/\nfunction toValueWithArgs(valFn, ...args) {\n\treturn typeof valFn === \"function\" ? valFn(...args) : valFn;\n}\n//#endregion\n//#region src/diagnostic.ts\n/**\n* Creates a console reporter that renders each diagnostic with `formatter` and\n* prints the result via `console[method]`. Both default sensibly (`'warn'` and\n* {@link formatDiagnostic}); `method` can also be overridden per call through\n* the reporter options.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction createConsoleReporter({ method: defaultMethod = \"warn\", formatter = formatDiagnostic } = {}) {\n\treturn (diagnostic, { method = defaultMethod } = {}) => {\n\t\tconsole[method](formatter(diagnostic));\n\t};\n}\nconst captureStackTrace = Error.captureStackTrace;\nvar Diagnostic = class Diagnostic extends Error {\n\tname;\n\t/**\n\t* The diagnostic code, e.g. `MATH_E001`.\n\t* Also appears as the `name` property.\n\t*/\n\tcode;\n\t/**\n\t* URL to extended documentation for this diagnostic code.\n\t* Auto-generated from {@link DefineDiagnosticsOptions.docsBase}.\n\t*/\n\tdocs;\n\t/**\n\t* Optional actionable instructions on how to resolve the problem.\n\t*/\n\tfix;\n\t/**\n\t* Locations in user code that contributed to this diagnostic, in\n\t* `file:line:column` format. Relevant when the stack trace doesn't reflect\n\t* the user's source (e.g. compilers, bundlers), otherwise redundant with the\n\t* stack and should be omitted.\n\t*/\n\tsources;\n\t/**\n\t* Structured information associated with this diagnostic code.\n\t*/\n\tdata;\n\t/**\n\t* Alias for {@link Error.message}: the reason this diagnostic was raised.\n\t*/\n\tget why() {\n\t\treturn this.message;\n\t}\n\t/**\n\t* @param init structured initializer; `why` is required\n\t* @param captureFrom V8 stack-cutoff frame. Defaults to {@link Diagnostic}\n\t* so the top of the trace is the `new Diagnostic(...)` call site.\n\t* `defineDiagnostics` passes its action method to strip its own frames too.\n\t* Ignored on engines without `Error.captureStackTrace`.\n\t*/\n\tconstructor(init, captureFrom = Diagnostic) {\n\t\tsuper(init.why, { cause: init.cause });\n\t\tthis.code = this.name = init.code;\n\t\tthis.fix = init.fix;\n\t\tthis.docs = init.docs;\n\t\tthis.sources = init.sources;\n\t\tthis.data = init.data;\n\t\tcaptureStackTrace?.(this, captureFrom);\n\t}\n\t/**\n\t* Converts the diagnostic into a serializable structured object.\n\t*/\n\ttoJSON() {\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\twhy: this.why,\n\t\t\tfix: this.fix,\n\t\t\tdocs: this.docs,\n\t\t\tsources: this.sources,\n\t\t\tcause: this.cause,\n\t\t\tdata: this.data,\n\t\t\tstack: this.stack\n\t\t};\n\t}\n};\n/**\n* Resolves the docs URL for a code from a `docsBase` (string template or\n* resolver function). Shared by {@link defineDiagnostics} and\n* {@link defineProdDiagnostics}. Per-code `docs` overrides are handled by the\n* caller; this only covers the `docsBase`-derived case.\n*\n* @internal\n*/\nfunction deriveDocs(docsBase, code) {\n\treturn typeof docsBase === \"string\" ? `${docsBase}/${code.toLowerCase()}` : docsBase?.(code);\n}\n/**\n* Creates a typed diagnostics object from a set of code definitions. Each\n* code becomes a callable {@link DiagnosticHandle}: invoke to report, or\n* `throw` the result to raise. No `new` required, no proxy.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction defineDiagnostics(options) {\n\tconst reporters = options.reporters ?? [];\n\tconst result = {};\n\tconst { docsBase } = options;\n\tfor (const code of Object.keys(options.codes)) {\n\t\tconst def = options.codes[code];\n\t\tconst docs = def.docs === false ? void 0 : def.docs || deriveDocs(docsBase, code);\n\t\tconst handle = (params = {}, reporterOptions = {}) => {\n\t\t\tconst diagnostic = new Diagnostic({\n\t\t\t\tcode,\n\t\t\t\twhy: toValueWithArgs(def.why, params),\n\t\t\t\tfix: toValueWithArgs(def.fix, params),\n\t\t\t\tdocs,\n\t\t\t\tcause: params.cause,\n\t\t\t\tsources: params.sources,\n\t\t\t\tdata: toValueWithArgs(def.data, params)\n\t\t\t}, handle);\n\t\t\tfor (const reporter of reporters) reporter(diagnostic, reporterOptions);\n\t\t\treturn diagnostic;\n\t\t};\n\t\tresult[code] = handle;\n\t}\n\treturn result;\n}\n//#endregion\n//#region src/prod-diagnostics.ts\n/**\n* Production counterpart to {@link defineDiagnostics}. Returns a `Proxy` that\n* builds a minimal {@link Diagnostic} for any accessed code: the code becomes\n* the instance `name`, `docs` is derived from `docsBase`, and `why` points to\n* the docs URL when one exists (empty otherwise, so the thrown header is just\n* the code). It carries no catalog text or data, so it stays tiny in a bundle.\n*\n* The strip plugin (`@nostics/unplugin`) can rewrite a `defineDiagnostics()`\n* call into a `process.env.NODE_ENV === 'production'` ternary that selects this\n* factory in production, dropping every `why`/`fix` string from the bundle.\n*\n* @example\n* ```ts\n* const diagnostics = defineProdDiagnostics({ docsBase: 'https://docs.example.com' })\n* throw diagnostics.NUXT_B2011() // NUXT_B2011: https://docs.example.com/nuxt_b2011\n* ```\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction defineProdDiagnostics(options = {}) {\n\tconst { docsBase, reporters = [] } = options;\n\treturn new Proxy({}, { get(_target, code) {\n\t\tif (typeof code !== \"string\") return void 0;\n\t\tconst handle = (params = {}, reporterOptions = {}) => {\n\t\t\tconst docs = deriveDocs(docsBase, code);\n\t\t\tconst diagnostic = new Diagnostic({\n\t\t\t\tcode,\n\t\t\t\twhy: docs ?? \"\",\n\t\t\t\tdocs,\n\t\t\t\tcause: params.cause,\n\t\t\t\tsources: params.sources\n\t\t\t}, handle);\n\t\t\tfor (const reporter of reporters) reporter(diagnostic, reporterOptions);\n\t\t\treturn diagnostic;\n\t\t};\n\t\treturn handle;\n\t} });\n}\n//#endregion\nexport { Diagnostic, createConsoleReporter, defineDiagnostics, defineProdDiagnostics, formatDiagnostic };\n\n//# sourceMappingURL=index.mjs.map","//#region src/formatters/ansi.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ansiFormatter(colors) {\n\treturn (d) => {\n\t\tconst header = `${colors.bold(colors.red(`[${d.name}]`))} ${d.message}`;\n\t\tconst details = [];\n\t\tif (d.fix) details.push(`${colors.dim(\"fix:\")} ${d.fix}`);\n\t\tif (d.sources?.length) details.push(`${colors.dim(\"sources:\")} ${d.sources.join(\", \")}`);\n\t\tif (d.docs) details.push(`${colors.dim(\"see:\")} ${colors.cyan(d.docs)}`);\n\t\tif (details.length === 0) return header;\n\t\treturn [header, ...details.map((detail, i) => {\n\t\t\treturn `${colors.dim(i < details.length - 1 ? \"├▶\" : \"╰▶\")} ${detail}`;\n\t\t})].join(\"\\n\");\n\t};\n}\n//#endregion\nexport { ansiFormatter };\n\n//# sourceMappingURL=ansi.mjs.map","import { colors } from \"./utils/colors.mjs\";\nimport { defineDiagnostics } from \"nostics\";\nimport { ansiFormatter } from \"nostics/formatters/ansi\";\n//#region src/events.ts\n/**\n* Centralized registry of the core devframe event names: the node-side host\n* bus events, the client RPC connection events, and the server→client\n* broadcast notifications, so these names live in one place instead of\n* scattered string literals.\n*\n* **Keep this in sync with [`docs/content/8.references/3.events.md`](../../../docs/content/8.references/3.events.md)**\n* (the \"Core devframe events\" section): every name here appears in that page's\n* tables, and every name there resolves to an entry here. Add, rename, or\n* remove a name in both places in the same change, and reference\n* `DEVFRAME_EVENTS.*` from call sites instead of re-typing a literal.\n*\n* This map covers **notifications** (events, broadcasts). The request/response\n* RPC endpoints of the shared-state, streaming, and auth-handshake protocols\n* (`devframe:rpc:server-state:*`, `devframe:streaming:subscribe`,\n* `anonymous:devframe:auth`, …) are defined at their handlers and typed in\n* `types/rpc-augments.ts`; they aren't events and stay out of this map.\n*\n* The `EventEmitter` maps (`RpcClientEvents`, `DevframeAgentHostEvents`) and the\n* `DevframeRpcClientFunctions` augmentation declare these names as type-level\n* keys (a literal is unavoidable in a type position); those declarations mirror\n* this map and move with it.\n*/\nconst DEVFRAME_EVENTS = {\n\t/**\n\t* Node-side host `EventEmitter` events. The agent host (`ctx.agent.events`)\n\t* emits these as its tool/resource surface changes; protocol adapters (e.g.\n\t* MCP) subscribe to re-publish their manifest.\n\t*/\n\tbus: {\n\t\tagentManifestChanged: \"agent:manifest:changed\",\n\t\tagentToolRegistered: \"agent:tool:registered\",\n\t\tagentToolUnregistered: \"agent:tool:unregistered\",\n\t\tagentResourceRegistered: \"agent:resource:registered\",\n\t\tagentResourceUnregistered: \"agent:resource:unregistered\"\n\t},\n\t/**\n\t* Client-side RPC connection `EventEmitter` events (`rpc.events`) a UI\n\t* subscribes to for connection lifecycle and error surfacing.\n\t*/\n\tclient: {\n\t\tisTrustedUpdated: \"rpc:is-trusted:updated\",\n\t\terror: \"rpc:error\",\n\t\tconnectionStatus: \"connection:status\",\n\t\tconnectionError: \"connection:error\"\n\t},\n\t/**\n\t* Broadcast notifications the server pushes to clients (server → client),\n\t* `devframe:` prefix. The paired request methods (subscribe/get/set/…) are\n\t* RPC endpoints, not events, and are omitted deliberately.\n\t*/\n\tbroadcast: {\n\t\tauthRevoked: \"devframe:auth:revoked\",\n\t\tclientStateUpdated: \"devframe:rpc:client-state:updated\",\n\t\tclientStatePatch: \"devframe:rpc:client-state:patch\",\n\t\tstreamingChunk: \"devframe:streaming:chunk\",\n\t\tstreamingEnd: \"devframe:streaming:end\",\n\t\tstreamingUploadCancel: \"devframe:streaming:upload-cancel\"\n\t},\n\t/**\n\t* In-page channel notifications the page script pushes to its panels\n\t* (page script → panel), `devframe:` prefix. The paired request methods\n\t* (`devframe:in-page:page-state:subscribe`/`set`/`patch`) are call\n\t* endpoints, not events, and are defined at their handlers\n\t* (`in-page-channel/state.ts`).\n\t*/\n\tinPageChannel: {\n\t\tpanelStateUpdated: \"devframe:in-page:panel-state:updated\",\n\t\tpanelStatePatch: \"devframe:in-page:panel-state:patch\"\n\t},\n\t/** `postMessage` channels the runtime posts across window boundaries. */\n\tpostMessage: {\n\t\tremoteAssetsError: \"devframe:remote-assets-error\",\n\t\tinPageChannel: \"devframe:in-page-channel\"\n\t}\n};\n//#endregion\n//#region src/utils/nostics.ts\nconst formatAnsi = ansiFormatter(colors);\n/**\n* The reporter every {@link defineDiagnostics} call below wires in ahead of\n* any caller-supplied ones: prints the diagnostic through devframe's own\n* ANSI colors via `console[method]` (default `'warn'`).\n*/\nfunction devframeReporter(d, { method = \"warn\" } = {}) {\n\tconsole[method](formatAnsi(d));\n}\n/**\n* Drop-in replacement for `nostics`'s `defineDiagnostics()` with devframe's\n* ANSI console reporter pre-wired ahead of any `reporters` passed in. Every\n* `diagnostics.ts` in devframe core, `@devframes/hub`, `@devframes/json-render`,\n* and the built-in plugins defines its codes through this instead of\n* `nostics`'s own `defineDiagnostics`; the reporter registration lives\n* here, once, so none of them need to build their own reporter (`colors`,\n* `ansiFormatter`) or take a direct dependency on `nostics` themselves.\n*/\nfunction defineDiagnostics$1(options) {\n\treturn defineDiagnostics({\n\t\t...options,\n\t\treporters: [devframeReporter, ...options.reporters ?? []]\n\t});\n}\n//#endregion\n//#region ../../node_modules/.pnpm/birpc@4.2.0/node_modules/birpc/dist/index.mjs\nfunction createPromiseWithResolvers() {\n\tlet resolve;\n\tlet reject;\n\treturn {\n\t\tpromise: new Promise((res, rej) => {\n\t\t\tresolve = res;\n\t\t\treject = rej;\n\t\t}),\n\t\tresolve,\n\t\treject\n\t};\n}\nconst random = Math.random.bind(Math);\nconst urlAlphabet = \"useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict\";\nfunction nanoid(size = 21) {\n\tlet id = \"\";\n\tlet i = size;\n\twhile (i--) id += urlAlphabet[random() * 64 | 0];\n\treturn id;\n}\nconst DEFAULT_TIMEOUT = 6e4;\nconst defaultSerialize = (i) => i;\nconst defaultDeserialize = defaultSerialize;\nconst { clearTimeout, setTimeout } = globalThis;\nfunction createBirpc($functions, options) {\n\tconst { post, on, off = () => {}, eventNames = [], serialize = defaultSerialize, deserialize = defaultDeserialize, resolver, bind = \"rpc\", timeout = DEFAULT_TIMEOUT, proxify = true } = options;\n\tlet $closed = false;\n\tconst _rpcPromiseMap = /* @__PURE__ */ new Map();\n\tlet _promiseInit;\n\tlet rpc;\n\tasync function _call(method, args, event, optional) {\n\t\tif ($closed) throw new Error(`[birpc] rpc is closed, cannot call \"${method}\"`);\n\t\tconst req = {\n\t\t\tm: method,\n\t\t\ta: args,\n\t\t\tt: \"q\"\n\t\t};\n\t\tif (optional) req.o = true;\n\t\tconst send = async (_req) => post(serialize(_req));\n\t\tif (event) {\n\t\t\tawait send(req);\n\t\t\treturn;\n\t\t}\n\t\tif (_promiseInit) try {\n\t\t\tawait _promiseInit;\n\t\t} finally {\n\t\t\t_promiseInit = void 0;\n\t\t}\n\t\tlet { promise, resolve, reject } = createPromiseWithResolvers();\n\t\tconst id = nanoid();\n\t\treq.i = id;\n\t\tlet timeoutId;\n\t\tasync function handler(newReq = req) {\n\t\t\tif (timeout >= 0) {\n\t\t\t\ttimeoutId = setTimeout(() => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (options.onTimeoutError?.call(rpc, method, args) !== true) throw new Error(`[birpc] timeout on calling \"${method}\"`);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treject(e);\n\t\t\t\t\t}\n\t\t\t\t\t_rpcPromiseMap.delete(id);\n\t\t\t\t}, timeout);\n\t\t\t\tif (typeof timeoutId === \"object\") timeoutId = timeoutId.unref?.();\n\t\t\t}\n\t\t\t_rpcPromiseMap.set(id, {\n\t\t\t\tresolve,\n\t\t\t\treject,\n\t\t\t\ttimeoutId,\n\t\t\t\tmethod\n\t\t\t});\n\t\t\tawait send(newReq);\n\t\t\treturn promise;\n\t\t}\n\t\ttry {\n\t\t\tif (options.onRequest) await options.onRequest.call(rpc, req, handler, resolve);\n\t\t\telse await handler();\n\t\t} catch (e) {\n\t\t\tif (options.onGeneralError?.call(rpc, e) !== true) throw e;\n\t\t\treturn;\n\t\t} finally {\n\t\t\tclearTimeout(timeoutId);\n\t\t\t_rpcPromiseMap.delete(id);\n\t\t}\n\t\treturn promise;\n\t}\n\tconst builtinMethods = {\n\t\t$call: (method, ...args) => _call(method, args, false),\n\t\t$callOptional: (method, ...args) => _call(method, args, false, true),\n\t\t$callEvent: (method, ...args) => _call(method, args, true),\n\t\t$callRaw: (options) => _call(options.method, options.args, options.event, options.optional),\n\t\t$rejectPendingCalls,\n\t\tget $closed() {\n\t\t\treturn $closed;\n\t\t},\n\t\tget $meta() {\n\t\t\treturn options.meta;\n\t\t},\n\t\t$close,\n\t\t$functions\n\t};\n\tif (proxify) rpc = new Proxy({}, { get(_, method) {\n\t\tif (Object.hasOwn(builtinMethods, method)) return builtinMethods[method];\n\t\tif (method === \"then\" && !eventNames.includes(\"then\") && !(\"then\" in $functions)) return void 0;\n\t\tconst sendEvent = (...args) => _call(method, args, true);\n\t\tif (eventNames.includes(method)) {\n\t\t\tsendEvent.asEvent = sendEvent;\n\t\t\treturn sendEvent;\n\t\t}\n\t\tconst sendCall = (...args) => _call(method, args, false);\n\t\tsendCall.asEvent = sendEvent;\n\t\treturn sendCall;\n\t} });\n\telse rpc = builtinMethods;\n\tfunction $close(customError) {\n\t\t$closed = true;\n\t\t_rpcPromiseMap.forEach(({ reject, method }) => {\n\t\t\tconst error = /* @__PURE__ */ new Error(`[birpc] rpc is closed, cannot call \"${method}\"`);\n\t\t\tif (customError) {\n\t\t\t\tcustomError.cause ??= error;\n\t\t\t\treturn reject(customError);\n\t\t\t}\n\t\t\treject(error);\n\t\t});\n\t\t_rpcPromiseMap.clear();\n\t\toff(onMessage);\n\t}\n\tfunction $rejectPendingCalls(handler) {\n\t\tconst handlerResults = Array.from(_rpcPromiseMap.values()).map(({ method, reject }) => {\n\t\t\tif (!handler) return reject(/* @__PURE__ */ new Error(`[birpc]: rejected pending call \"${method}\".`));\n\t\t\treturn handler({\n\t\t\t\tmethod,\n\t\t\t\treject\n\t\t\t});\n\t\t});\n\t\t_rpcPromiseMap.clear();\n\t\treturn handlerResults;\n\t}\n\tasync function onMessage(data, ...extra) {\n\t\tlet msg;\n\t\ttry {\n\t\t\tmsg = deserialize(data);\n\t\t} catch (e) {\n\t\t\tif (options.onGeneralError?.call(rpc, e) !== true) throw e;\n\t\t\treturn;\n\t\t}\n\t\tif (msg.t === \"q\") {\n\t\t\tconst { m: method, a: args, o: optional } = msg;\n\t\t\tlet result, error;\n\t\t\tlet fn = await (resolver ? resolver.call(rpc, method, $functions[method]) : $functions[method]);\n\t\t\tif (optional) fn ||= () => void 0;\n\t\t\tif (!fn) error = /* @__PURE__ */ new Error(`[birpc] function \"${method}\" not found`);\n\t\t\telse try {\n\t\t\t\tresult = await fn.apply(bind === \"rpc\" ? rpc : $functions, args);\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t\tif (msg.i) {\n\t\t\t\tif (error && options.onFunctionError) {\n\t\t\t\t\tif (options.onFunctionError.call(rpc, error, method, args) === true) return;\n\t\t\t\t}\n\t\t\t\tif (!error) try {\n\t\t\t\t\tawait post(serialize({\n\t\t\t\t\t\tt: \"s\",\n\t\t\t\t\t\ti: msg.i,\n\t\t\t\t\t\tr: result\n\t\t\t\t\t}), ...extra);\n\t\t\t\t\treturn;\n\t\t\t\t} catch (e) {\n\t\t\t\t\terror = e;\n\t\t\t\t\tif (options.onGeneralError?.call(rpc, e, method, args) !== true) throw e;\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tawait post(serialize({\n\t\t\t\t\t\tt: \"s\",\n\t\t\t\t\t\ti: msg.i,\n\t\t\t\t\t\te: error\n\t\t\t\t\t}), ...extra);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (options.onGeneralError?.call(rpc, e, method, args) !== true) throw e;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst { i: ack, r: result, e: error } = msg;\n\t\t\tconst promise = _rpcPromiseMap.get(ack);\n\t\t\tif (promise) {\n\t\t\t\tclearTimeout(promise.timeoutId);\n\t\t\t\tif (error) promise.reject(error);\n\t\t\t\telse promise.resolve(result);\n\t\t\t}\n\t\t\t_rpcPromiseMap.delete(ack);\n\t\t}\n\t}\n\t_promiseInit = on(onMessage);\n\treturn rpc;\n}\n//#endregion\n//#region src/agent/safety.ts\n/**\n* An agent tool's safety classification: the explicit `agent.safety`, else\n* inferred from the function `type` (`static`/`query` are read-only, the rest\n* mutate). Shared by every agent surface (MCP host, WebMCP, in-page bridge).\n*/\nfunction resolveAgentSafety(type, agent) {\n\tif (agent.safety) return agent.safety;\n\treturn type === \"static\" || type === \"query\" || type == null ? \"read\" : \"action\";\n}\n//#endregion\n//#region src/agent/to-json-schema.ts\nconst FALLBACK_OBJECT_SCHEMA = Object.freeze({\n\ttype: \"object\",\n\tadditionalProperties: true\n});\n/**\n* Convert a Standard Schema to JSON Schema for the agent/MCP surface.\n*\n* Devframe stays validator-neutral, so conversion uses the schema's own\n* [Standard JSON Schema](https://standardschema.dev/) converter\n* (`~standard.jsonSchema`) when the validator provides one; zod 4 does,\n* for example. Validators without a native converter (e.g. valibot) degrade\n* to a permissive object schema rather than pulling in a converter library.\n*/\nfunction safeToJsonSchema(schema) {\n\tconst standard = schema[\"~standard\"];\n\tif (standard.jsonSchema) try {\n\t\treturn standard.jsonSchema.input({ target: \"draft-2020-12\" });\n\t} catch {\n\t\treturn FALLBACK_OBJECT_SCHEMA;\n\t}\n\treturn FALLBACK_OBJECT_SCHEMA;\n}\n/**\n* JSON Schema for an RPC function's positional args on the agent/MCP\n* surface. Each positional arg is advertised under `arg0` / `arg1` / …,\n* matching how the agent bridge coerces the incoming object payload back\n* into positional arguments.\n*\n* Returns `{ type: 'object', properties: {} }` when there are no args.\n* @internal\n*/\nfunction argsToJsonSchema(args) {\n\tif (!args || args.length === 0) return {\n\t\ttype: \"object\",\n\t\tproperties: {}\n\t};\n\tconst properties = {};\n\tconst required = [];\n\tfor (let i = 0; i < args.length; i++) {\n\t\tconst key = `arg${i}`;\n\t\tproperties[key] = safeToJsonSchema(args[i]);\n\t\trequired.push(key);\n\t}\n\treturn {\n\t\ttype: \"object\",\n\t\tproperties,\n\t\trequired,\n\t\tadditionalProperties: false\n\t};\n}\n//#endregion\n//#region src/tool-input.ts\n/**\n* Convert an object-shaped tool input into positional arguments.\n*\n* Tool schemas expose positional parameters as `arg0`, `arg1`, and so on.\n* Arrays pass through for callers that already provide positional arguments.\n*/\nfunction collectPositionalArgs(input, argumentCount) {\n\tif (Array.isArray(input)) return input;\n\tif (input === void 0 || input === null) return [];\n\tif (typeof input !== \"object\") return void 0;\n\tconst record = input;\n\tif (argumentCount != null) return Array.from({ length: argumentCount }, (_, index) => record[`arg${index}`]);\n\tif (\"arg0\" in record) {\n\t\tconst positional = [];\n\t\twhile (`arg${positional.length}` in record) positional.push(record[`arg${positional.length}`]);\n\t\treturn positional;\n\t}\n\treturn Object.keys(record).length === 0 ? [] : void 0;\n}\n/** Convert tool input for an RPC, preserving an untyped payload as arg 0. */\nfunction toolInputToRpcArgs(input, argumentCount) {\n\treturn collectPositionalArgs(input, argumentCount) ?? [input];\n}\n//#endregion\nexport { defineDiagnostics$1 as a, createBirpc as i, argsToJsonSchema as n, DEVFRAME_EVENTS as o, resolveAgentSafety as r, toolInputToRpcArgs as t };\n","//#region ../../node_modules/.pnpm/ohash@2.0.12/node_modules/ohash/dist/_chunks/is-equal.mjs\nfunction serialize(input) {\n\tif (typeof input === \"string\") return `'${input}'`;\n\treturn new Serializer().serialize(input);\n}\nconst asciiOrder = \" _-,;:!?.'\\\"()[]{}@*/\\\\&#%`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz\";\nconst asciiWeights = /*@__PURE__*/ (function() {\n\tconst weights = /* @__PURE__ */ new Uint8Array(128);\n\tfor (let i = 0; i < 69; i++) weights[asciiOrder.charCodeAt(i)] = i + 1;\n\tfor (let code = 65; code <= 90; code++) weights[code] = weights[code + 32];\n\treturn weights;\n})();\nfunction compareStrings(a, b) {\n\tif (a === b) return 0;\n\tconst length = Math.min(a.length, b.length);\n\tlet tieBreaker = 0;\n\tfor (let i = 0; i < length; i++) {\n\t\tconst codeA = a.charCodeAt(i);\n\t\tconst codeB = b.charCodeAt(i);\n\t\tif (codeA === codeB) continue;\n\t\tconst weightA = codeA < 128 && asciiWeights[codeA] ? asciiWeights[codeA] : codeA + 128;\n\t\tconst weightB = codeB < 128 && asciiWeights[codeB] ? asciiWeights[codeB] : codeB + 128;\n\t\tif (weightA !== weightB) return weightA < weightB ? -1 : 1;\n\t\tif (tieBreaker === 0) tieBreaker = codeA > codeB ? -1 : 1;\n\t}\n\tif (a.length !== b.length) return a.length < b.length ? -1 : 1;\n\treturn tieBreaker;\n}\nconst Serializer = /*@__PURE__*/ (function() {\n\tclass Serializer {\n\t\t#context = /* @__PURE__ */ new Map();\n\t\tcompare(a, b) {\n\t\t\tconst typeA = typeof a;\n\t\t\tconst typeB = typeof b;\n\t\t\tif (typeA === \"string\" && typeB === \"string\") return compareStrings(a, b);\n\t\t\tif (typeA === \"number\" && typeB === \"number\") return a - b;\n\t\t\treturn compareStrings(this.serialize(a, true), this.serialize(b, true));\n\t\t}\n\t\tserialize(value, noQuotes) {\n\t\t\tif (value === null) return \"null\";\n\t\t\tswitch (typeof value) {\n\t\t\t\tcase \"string\": return noQuotes ? value : `'${value}'`;\n\t\t\t\tcase \"bigint\": return `${value}n`;\n\t\t\t\tcase \"object\": return this.$object(value);\n\t\t\t\tcase \"function\": return this.$function(value);\n\t\t\t}\n\t\t\treturn String(value);\n\t\t}\n\t\tserializeObject(object) {\n\t\t\tconst objString = Object.prototype.toString.call(object);\n\t\t\tif (objString !== \"[object Object]\") return this.serializeBuiltInType(objString.length < 10 ? `unknown:${objString}` : objString.slice(8, -1), object);\n\t\t\tconst constructor = object.constructor;\n\t\t\tconst objName = constructor === Object || constructor === void 0 ? \"\" : constructor.name;\n\t\t\tif (objName !== \"\" && globalThis[objName] === constructor) return this.serializeBuiltInType(objName, object);\n\t\t\tif (\"toJSON\" in object && typeof object.toJSON === \"function\") {\n\t\t\t\tconst json = object.toJSON();\n\t\t\t\treturn objName + (json !== null && typeof json === \"object\" ? this.$object(json) : `(${this.serialize(json)})`);\n\t\t\t}\n\t\t\tconst keys = Object.keys(object).sort(compareStrings);\n\t\t\tlet content = `${objName}{`;\n\t\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\t\tconst key = keys[i];\n\t\t\t\tcontent += `${key}:${this.serialize(object[key])}`;\n\t\t\t\tif (i < keys.length - 1) content += \",\";\n\t\t\t}\n\t\t\treturn content + \"}\";\n\t\t}\n\t\tserializeBuiltInType(type, object) {\n\t\t\tconst handler = this[\"$\" + type];\n\t\t\tif (handler) return handler.call(this, object);\n\t\t\tif (typeof object.entries === \"function\") return this.serializeObjectEntries(type, object.entries());\n\t\t\tthrow new Error(`Cannot serialize ${type}`);\n\t\t}\n\t\tserializeObjectEntries(type, entries) {\n\t\t\tconst sortedEntries = Array.from(entries).sort((a, b) => this.compare(a[0], b[0]));\n\t\t\tlet content = `${type}{`;\n\t\t\tfor (let i = 0; i < sortedEntries.length; i++) {\n\t\t\t\tconst [key, value] = sortedEntries[i];\n\t\t\t\tcontent += `${this.serialize(key, true)}:${this.serialize(value)}`;\n\t\t\t\tif (i < sortedEntries.length - 1) content += \",\";\n\t\t\t}\n\t\t\treturn content + \"}\";\n\t\t}\n\t\t$object(object) {\n\t\t\tlet content = this.#context.get(object);\n\t\t\tif (content === void 0) {\n\t\t\t\tthis.#context.set(object, `#${this.#context.size}`);\n\t\t\t\tcontent = this.serializeObject(object);\n\t\t\t\tthis.#context.set(object, content);\n\t\t\t}\n\t\t\treturn content;\n\t\t}\n\t\t$function(fn) {\n\t\t\tconst fnStr = Function.prototype.toString.call(fn);\n\t\t\tif (fnStr.slice(-15) === \"[native code] }\") return `${fn.name || \"\"}()[native]`;\n\t\t\treturn `${fn.name}(${fn.length})${fnStr.replace(/\\s*\\n\\s*/g, \"\")}`;\n\t\t}\n\t\t$Array(arr) {\n\t\t\tlet content = \"[\";\n\t\t\tfor (let i = 0; i < arr.length; i++) {\n\t\t\t\tcontent += this.serialize(arr[i]);\n\t\t\t\tif (i < arr.length - 1) content += \",\";\n\t\t\t}\n\t\t\treturn content + \"]\";\n\t\t}\n\t\t$Date(date) {\n\t\t\ttry {\n\t\t\t\treturn `Date(${date.toISOString()})`;\n\t\t\t} catch {\n\t\t\t\treturn `Date(null)`;\n\t\t\t}\n\t\t}\n\t\t$ArrayBuffer(arr) {\n\t\t\treturn `ArrayBuffer[${new Uint8Array(arr).join(\",\")}]`;\n\t\t}\n\t\t$Set(set) {\n\t\t\treturn `Set${this.$Array(Array.from(set).sort((a, b) => this.compare(a, b)))}`;\n\t\t}\n\t\t$Map(map) {\n\t\t\treturn this.serializeObjectEntries(\"Map\", map.entries());\n\t\t}\n\t}\n\tfor (const type of [\n\t\t\"Error\",\n\t\t\"RegExp\",\n\t\t\"URL\"\n\t]) Serializer.prototype[\"$\" + type] = function(val) {\n\t\treturn `${type}(${val})`;\n\t};\n\tfor (const type of [\n\t\t\"Int8Array\",\n\t\t\"Uint8Array\",\n\t\t\"Uint8ClampedArray\",\n\t\t\"Int16Array\",\n\t\t\"Uint16Array\",\n\t\t\"Int32Array\",\n\t\t\"Uint32Array\",\n\t\t\"Float32Array\",\n\t\t\"Float64Array\"\n\t]) Serializer.prototype[\"$\" + type] = function(arr) {\n\t\treturn `${type}[${arr.join(\",\")}]`;\n\t};\n\tfor (const type of [\"BigInt64Array\", \"BigUint64Array\"]) Serializer.prototype[\"$\" + type] = function(arr) {\n\t\treturn `${type}[${arr.join(\"n,\")}${arr.length > 0 ? \"n\" : \"\"}]`;\n\t};\n\treturn Serializer;\n})();\n//#endregion\n//#region ../../node_modules/.pnpm/ohash@2.0.12/node_modules/ohash/dist/crypto/js/index.mjs\nconst H = [\n\t1779033703,\n\t-1150833019,\n\t1013904242,\n\t-1521486534,\n\t1359893119,\n\t-1694144372,\n\t528734635,\n\t1541459225\n];\nconst K = [\n\t1116352408,\n\t1899447441,\n\t-1245643825,\n\t-373957723,\n\t961987163,\n\t1508970993,\n\t-1841331548,\n\t-1424204075,\n\t-670586216,\n\t310598401,\n\t607225278,\n\t1426881987,\n\t1925078388,\n\t-2132889090,\n\t-1680079193,\n\t-1046744716,\n\t-459576895,\n\t-272742522,\n\t264347078,\n\t604807628,\n\t770255983,\n\t1249150122,\n\t1555081692,\n\t1996064986,\n\t-1740746414,\n\t-1473132947,\n\t-1341970488,\n\t-1084653625,\n\t-958395405,\n\t-710438585,\n\t113926993,\n\t338241895,\n\t666307205,\n\t773529912,\n\t1294757372,\n\t1396182291,\n\t1695183700,\n\t1986661051,\n\t-2117940946,\n\t-1838011259,\n\t-1564481375,\n\t-1474664885,\n\t-1035236496,\n\t-949202525,\n\t-778901479,\n\t-694614492,\n\t-200395387,\n\t275423344,\n\t430227734,\n\t506948616,\n\t659060556,\n\t883997877,\n\t958139571,\n\t1322822218,\n\t1537002063,\n\t1747873779,\n\t1955562222,\n\t2024104815,\n\t-2067236844,\n\t-1933114872,\n\t-1866530822,\n\t-1538233109,\n\t-1090935817,\n\t-965641998\n];\nconst base64KeyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\";\nconst W = [];\nvar SHA256 = class {\n\t_data = new WordArray();\n\t_hash = new WordArray([...H]);\n\t_nDataBytes = 0;\n\t_minBufferSize = 0;\n\tfinalize(messageUpdate) {\n\t\tif (messageUpdate) this._append(messageUpdate);\n\t\tconst nBitsTotal = this._nDataBytes * 8;\n\t\tconst nBitsLeft = this._data.sigBytes * 8;\n\t\tthis._data.words[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;\n\t\tthis._data.words[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math.floor(nBitsTotal / 4294967296);\n\t\tthis._data.words[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal;\n\t\tthis._data.sigBytes = this._data.words.length * 4;\n\t\tthis._process();\n\t\treturn this._hash;\n\t}\n\t_doProcessBlock(M, offset) {\n\t\tconst H = this._hash.words;\n\t\tlet a = H[0];\n\t\tlet b = H[1];\n\t\tlet c = H[2];\n\t\tlet d = H[3];\n\t\tlet e = H[4];\n\t\tlet f = H[5];\n\t\tlet g = H[6];\n\t\tlet h = H[7];\n\t\tfor (let i = 0; i < 64; i++) {\n\t\t\tif (i < 16) W[i] = M[offset + i] | 0;\n\t\t\telse {\n\t\t\t\tconst gamma0x = W[i - 15];\n\t\t\t\tconst gamma0 = (gamma0x << 25 | gamma0x >>> 7) ^ (gamma0x << 14 | gamma0x >>> 18) ^ gamma0x >>> 3;\n\t\t\t\tconst gamma1x = W[i - 2];\n\t\t\t\tconst gamma1 = (gamma1x << 15 | gamma1x >>> 17) ^ (gamma1x << 13 | gamma1x >>> 19) ^ gamma1x >>> 10;\n\t\t\t\tW[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];\n\t\t\t}\n\t\t\tconst ch = e & f ^ ~e & g;\n\t\t\tconst maj = a & b ^ a & c ^ b & c;\n\t\t\tconst sigma0 = (a << 30 | a >>> 2) ^ (a << 19 | a >>> 13) ^ (a << 10 | a >>> 22);\n\t\t\tconst sigma1 = (e << 26 | e >>> 6) ^ (e << 21 | e >>> 11) ^ (e << 7 | e >>> 25);\n\t\t\tconst t1 = h + sigma1 + ch + K[i] + W[i];\n\t\t\tconst t2 = sigma0 + maj;\n\t\t\th = g;\n\t\t\tg = f;\n\t\t\tf = e;\n\t\t\te = d + t1 | 0;\n\t\t\td = c;\n\t\t\tc = b;\n\t\t\tb = a;\n\t\t\ta = t1 + t2 | 0;\n\t\t}\n\t\tH[0] = H[0] + a | 0;\n\t\tH[1] = H[1] + b | 0;\n\t\tH[2] = H[2] + c | 0;\n\t\tH[3] = H[3] + d | 0;\n\t\tH[4] = H[4] + e | 0;\n\t\tH[5] = H[5] + f | 0;\n\t\tH[6] = H[6] + g | 0;\n\t\tH[7] = H[7] + h | 0;\n\t}\n\t_append(data) {\n\t\tif (typeof data === \"string\") data = WordArray.fromUtf8(data);\n\t\tthis._data.concat(data);\n\t\tthis._nDataBytes += data.sigBytes;\n\t}\n\t_process(doFlush) {\n\t\tlet processedWords;\n\t\tlet nBlocksReady = this._data.sigBytes / 64;\n\t\tif (doFlush) nBlocksReady = Math.ceil(nBlocksReady);\n\t\telse nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);\n\t\tconst nWordsReady = nBlocksReady * 16;\n\t\tconst nBytesReady = Math.min(nWordsReady * 4, this._data.sigBytes);\n\t\tif (nWordsReady) {\n\t\t\tfor (let offset = 0; offset < nWordsReady; offset += 16) this._doProcessBlock(this._data.words, offset);\n\t\t\tprocessedWords = this._data.words.splice(0, nWordsReady);\n\t\t\tthis._data.sigBytes -= nBytesReady;\n\t\t}\n\t\treturn new WordArray(processedWords, nBytesReady);\n\t}\n};\nvar WordArray = class WordArray {\n\twords;\n\tsigBytes;\n\tconstructor(words, sigBytes) {\n\t\twords = this.words = words || [];\n\t\tthis.sigBytes = sigBytes === void 0 ? words.length * 4 : sigBytes;\n\t}\n\tstatic fromUtf8(input) {\n\t\tconst str = unescape(encodeURIComponent(input));\n\t\tconst strlen = str.length;\n\t\tconst words = [];\n\t\tfor (let i = 0; i < strlen; i++) words[i >>> 2] |= (str.charCodeAt(i) & 255) << 24 - i % 4 * 8;\n\t\treturn new WordArray(words, strlen);\n\t}\n\ttoBase64() {\n\t\tconst base64Chars = [];\n\t\tfor (let i = 0; i < this.sigBytes; i += 3) {\n\t\t\tconst byte1 = this.words[i >>> 2] >>> 24 - i % 4 * 8 & 255;\n\t\t\tconst byte2 = this.words[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 255;\n\t\t\tconst byte3 = this.words[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 255;\n\t\t\tconst triplet = byte1 << 16 | byte2 << 8 | byte3;\n\t\t\tfor (let j = 0; j < 4 && i * 8 + j * 6 < this.sigBytes * 8; j++) base64Chars.push(base64KeyStr.charAt(triplet >>> 6 * (3 - j) & 63));\n\t\t}\n\t\treturn base64Chars.join(\"\");\n\t}\n\tconcat(wordArray) {\n\t\tthis.words[this.sigBytes >>> 2] &= 4294967295 << 32 - this.sigBytes % 4 * 8;\n\t\tthis.words.length = Math.ceil(this.sigBytes / 4);\n\t\tif (this.sigBytes % 4) for (let i = 0; i < wordArray.sigBytes; i++) {\n\t\t\tconst thatByte = wordArray.words[i >>> 2] >>> 24 - i % 4 * 8 & 255;\n\t\t\tthis.words[this.sigBytes + i >>> 2] |= thatByte << 24 - (this.sigBytes + i) % 4 * 8;\n\t\t}\n\t\telse for (let j = 0; j < wordArray.sigBytes; j += 4) this.words[this.sigBytes + j >>> 2] = wordArray.words[j >>> 2];\n\t\tthis.sigBytes += wordArray.sigBytes;\n\t}\n};\nfunction digest(message) {\n\treturn new SHA256().finalize(message).toBase64();\n}\n//#endregion\n//#region ../../node_modules/.pnpm/ohash@2.0.12/node_modules/ohash/dist/index.mjs\nfunction hash$1(input) {\n\treturn digest(serialize(input));\n}\n//#endregion\n//#region src/utils/hash.ts\n/**\n* Stable, deterministic hash of any structured-cloneable value.\n*/\nfunction hash(value) {\n\treturn hash$1(value);\n}\n//#endregion\nexport { hash as t };\n","//#region src/utils/events.ts\n/**\n* Create event emitter.\n*/\nfunction createEventEmitter() {\n\tconst _listeners = {};\n\tfunction emit(event, ...args) {\n\t\tconst callbacks = _listeners[event] || [];\n\t\tfor (let i = 0, length = callbacks.length; i < length; i++) {\n\t\t\tconst callback = callbacks[i];\n\t\t\tif (callback) callback(...args);\n\t\t}\n\t}\n\tfunction emitOnce(event, ...args) {\n\t\temit(event, ...args);\n\t\tdelete _listeners[event];\n\t}\n\tfunction on(event, cb) {\n\t\t(_listeners[event] ||= []).push(cb);\n\t\treturn () => {\n\t\t\t_listeners[event] = _listeners[event]?.filter((i) => cb !== i);\n\t\t};\n\t}\n\tfunction once(event, cb) {\n\t\tconst unsubscribe = on(event, ((...args) => {\n\t\t\tunsubscribe();\n\t\t\treturn cb(...args);\n\t\t}));\n\t\treturn unsubscribe;\n\t}\n\treturn {\n\t\t_listeners,\n\t\temit,\n\t\temitOnce,\n\t\ton,\n\t\tonce\n\t};\n}\n//#endregion\nexport { createEventEmitter };\n","//#region src/utils/url.ts\n/**\n* URL path-joining and slash-normalization helpers shared by the adapters,\n* the RPC clients, and the hub's mount-path plumbing. In-house replacements\n* for the handful of `ufo` functions devframe used, kept dependency-free and\n* browser-safe (pure string operations, no `node:` imports).\n*/\n/** Matches an explicit protocol prefix: `http://`, `wss://`, `file://`, … */\nconst PROTOCOL_RE = /^[\\w+.-]{2,}:\\/\\//;\n/** `input` with a leading `/` added when missing. */\nfunction withLeadingSlash(input) {\n\treturn input.startsWith(\"/\") ? input : `/${input}`;\n}\n/** `input` with a leading `/` removed; a bare `/` stays `/`. */\nfunction withoutLeadingSlash(input) {\n\treturn (input.startsWith(\"/\") ? input.slice(1) : input) || \"/\";\n}\n/** `input` with a trailing `/` added when missing. */\nfunction withTrailingSlash(input) {\n\treturn input.endsWith(\"/\") ? input : `${input}/`;\n}\n/** `input` with a trailing `/` removed; a bare `/` stays `/`. */\nfunction withoutTrailingSlash(input) {\n\treturn (input.endsWith(\"/\") ? input.slice(0, -1) : input) || \"/\";\n}\n/** Collapses runs of `/` in every path portion, preserving `://`. */\nfunction cleanDoubleSlashes(input) {\n\treturn input.split(\"://\").map((part) => part.replace(/\\/{2,}/g, \"/\")).join(\"://\");\n}\n/**\n* Joins path segments onto `base` with exactly one `/` at each seam.\n* A segment's leading `/` or `./` is dropped; empty and bare-`/` segments\n* are skipped; the last segment's trailing slash is preserved.\n*/\nfunction joinURL(base, ...segments) {\n\tlet url = base;\n\tfor (const segment of segments) {\n\t\tif (!segment || segment === \"/\") continue;\n\t\turl = url ? withTrailingSlash(url) + segment.replace(/^\\.?\\//, \"\") : segment;\n\t}\n\treturn url;\n}\n/**\n* Prefixes `input` with `base` unless it already carries the prefix or is an\n* absolute URL with a protocol. An empty or `/` base is a no-op.\n*/\nfunction withBase(input, base) {\n\tif (!base || base === \"/\" || PROTOCOL_RE.test(input)) return input;\n\tconst prefix = withoutTrailingSlash(base);\n\treturn input.startsWith(prefix) ? input : joinURL(prefix, input);\n}\n/** Replaces (or adds) the protocol of `input`: `withProtocol(url, 'ws://')`. */\nfunction withProtocol(input, protocol) {\n\tconst match = input.match(PROTOCOL_RE);\n\treturn protocol + (match ? input.slice(match[0].length) : input);\n}\n//#endregion\nexport { cleanDoubleSlashes, joinURL, withBase, withLeadingSlash, withProtocol, withTrailingSlash, withoutLeadingSlash, withoutTrailingSlash };\n","//#region src/utils/nanoid.ts\nconst urlAlphabet = \"useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict\";\nfunction nanoid(size = 21) {\n\tlet id = \"\";\n\tlet i = size;\n\twhile (i--) id += urlAlphabet[Math.random() * 64 | 0];\n\treturn id;\n}\n//#endregion\nexport { nanoid };\n","import { createEventEmitter } from \"./utils/events.mjs\";\nimport { nanoid } from \"./utils/nanoid.mjs\";\n//#region ../../node_modules/.pnpm/immer@11.1.18/node_modules/immer/dist/immer.mjs\nvar NOTHING = Symbol.for(\"immer-nothing\");\nvar DRAFTABLE = Symbol.for(\"immer-draftable\");\nvar DRAFT_STATE = Symbol.for(\"immer-state\");\nvar errors = [\n\tfunction(plugin) {\n\t\treturn `The plugin for '${plugin}' has not been loaded into Immer. To enable the plugin, import and call \\`enable${plugin}()\\` when initializing your application.`;\n\t},\n\tfunction(thing) {\n\t\treturn `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${thing}'`;\n\t},\n\t\"This object has been frozen and should not be mutated\",\n\tfunction(data) {\n\t\treturn \"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? \" + data;\n\t},\n\t\"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.\",\n\t\"Immer forbids circular references\",\n\t\"The first or second argument to `produce` must be a function\",\n\t\"The third argument to `produce` must be a function or undefined\",\n\t\"First argument to `createDraft` must be a plain object, an array, or an immerable object\",\n\t\"First argument to `finishDraft` must be a draft returned by `createDraft`\",\n\tfunction(thing) {\n\t\treturn `'current' expects a draft, got: ${thing}`;\n\t},\n\t\"Object.defineProperty() cannot be used on an Immer draft\",\n\t\"Object.setPrototypeOf() cannot be used on an Immer draft\",\n\t\"Immer only supports deleting array indices\",\n\t\"Immer only supports setting array indices and the 'length' property\",\n\tfunction(thing) {\n\t\treturn `'original' expects a draft, got: ${thing}`;\n\t}\n];\nfunction die(error, ...args) {\n\t{\n\t\tconst e = errors[error];\n\t\tconst msg = isFunction(e) ? e.apply(null, args) : e;\n\t\tthrow new Error(`[Immer] ${msg}`);\n\t}\n}\nvar O = Object;\nvar getPrototypeOf = O.getPrototypeOf;\nvar CONSTRUCTOR = \"constructor\";\nvar PROTOTYPE = \"prototype\";\nvar CONFIGURABLE = \"configurable\";\nvar ENUMERABLE = \"enumerable\";\nvar WRITABLE = \"writable\";\nvar VALUE = \"value\";\nvar isDraft = (value) => !!value && !!value[DRAFT_STATE];\nfunction isDraftable(value) {\n\tif (!value) return false;\n\treturn isPlainObject(value) || isArray(value) || !!value[DRAFTABLE] || !!value[CONSTRUCTOR]?.[DRAFTABLE] || isMap(value) || isSet(value);\n}\nvar objectCtorString = O[PROTOTYPE][CONSTRUCTOR].toString();\nvar cachedCtorStrings = /* @__PURE__ */ new WeakMap();\nfunction isPlainObject(value) {\n\tif (!value || !isObjectish(value)) return false;\n\tconst proto = getPrototypeOf(value);\n\tif (proto === null || proto === O[PROTOTYPE]) return true;\n\tconst Ctor = O.hasOwnProperty.call(proto, CONSTRUCTOR) && proto[CONSTRUCTOR];\n\tif (Ctor === Object) return true;\n\tif (!isFunction(Ctor)) return false;\n\tlet ctorString = cachedCtorStrings.get(Ctor);\n\tif (ctorString === void 0) {\n\t\tctorString = Function.toString.call(Ctor);\n\t\tcachedCtorStrings.set(Ctor, ctorString);\n\t}\n\treturn ctorString === objectCtorString;\n}\nfunction each(obj, iter, strict = true) {\n\tif (getArchtype(obj) === 0) (strict ? Reflect.ownKeys(obj) : O.keys(obj)).forEach((key) => {\n\t\titer(key, obj[key], obj);\n\t});\n\telse obj.forEach((entry, index) => iter(index, entry, obj));\n}\nfunction getArchtype(thing) {\n\tconst state = thing[DRAFT_STATE];\n\treturn state ? state.type_ : isArray(thing) ? 1 : isMap(thing) ? 2 : isSet(thing) ? 3 : 0;\n}\nvar has = (thing, prop, type = getArchtype(thing)) => type === 2 ? thing.has(prop) : O[PROTOTYPE].hasOwnProperty.call(thing, prop);\nvar get = (thing, prop, type = getArchtype(thing)) => type === 2 ? thing.get(prop) : thing[prop];\nvar set = (thing, propOrOldValue, value, type = getArchtype(thing)) => {\n\tif (type === 2) thing.set(propOrOldValue, value);\n\telse if (type === 3) thing.add(value);\n\telse thing[propOrOldValue] = value;\n};\nfunction is(x, y) {\n\tif (x === y) return x !== 0 || 1 / x === 1 / y;\n\telse return x !== x && y !== y;\n}\nvar isArray = Array.isArray;\nvar isMap = (target) => target instanceof Map;\nvar isSet = (target) => target instanceof Set;\nvar isObjectish = (target) => typeof target === \"object\";\nvar isFunction = (target) => typeof target === \"function\";\nvar isBoolean = (target) => typeof target === \"boolean\";\nfunction isArrayIndex(value) {\n\tconst n = +value;\n\treturn Number.isInteger(n) && String(n) === value;\n}\nvar getProxyDraft = (value) => {\n\tif (!isObjectish(value)) return null;\n\treturn value?.[DRAFT_STATE];\n};\nvar latest = (state) => state.copy_ || state.base_;\nvar getFinalValue = (state) => state.modified_ ? state.copy_ : state.base_;\nfunction shallowCopy(base, strict) {\n\tif (isMap(base)) return new Map(base);\n\tif (isSet(base)) return new Set(base);\n\tif (isArray(base)) return Array[PROTOTYPE].slice.call(base);\n\tconst isPlain = isPlainObject(base);\n\tif (strict === true || strict === \"class_only\" && !isPlain) {\n\t\tconst descriptors = O.getOwnPropertyDescriptors(base);\n\t\tdelete descriptors[DRAFT_STATE];\n\t\tlet keys = Reflect.ownKeys(descriptors);\n\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\tconst key = keys[i];\n\t\t\tconst desc = descriptors[key];\n\t\t\tif (desc[WRITABLE] === false) {\n\t\t\t\tdesc[WRITABLE] = true;\n\t\t\t\tdesc[CONFIGURABLE] = true;\n\t\t\t}\n\t\t\tif (desc.get || desc.set) descriptors[key] = {\n\t\t\t\t[CONFIGURABLE]: true,\n\t\t\t\t[WRITABLE]: true,\n\t\t\t\t[ENUMERABLE]: desc[ENUMERABLE],\n\t\t\t\t[VALUE]: base[key]\n\t\t\t};\n\t\t}\n\t\treturn O.create(getPrototypeOf(base), descriptors);\n\t} else {\n\t\tconst proto = getPrototypeOf(base);\n\t\tif (proto !== null && isPlain) return { ...base };\n\t\tconst obj = O.create(proto);\n\t\treturn O.assign(obj, base);\n\t}\n}\nfunction freeze(obj, deep = false) {\n\tif (isFrozen(obj) || isDraft(obj) || !isDraftable(obj)) return obj;\n\tif (getArchtype(obj) > 1) O.defineProperties(obj, {\n\t\tset: dontMutateMethodOverride,\n\t\tadd: dontMutateMethodOverride,\n\t\tclear: dontMutateMethodOverride,\n\t\tdelete: dontMutateMethodOverride\n\t});\n\tO.freeze(obj);\n\tif (deep) each(obj, (_key, value) => {\n\t\tfreeze(value, true);\n\t}, false);\n\treturn obj;\n}\nfunction dontMutateFrozenCollections() {\n\tdie(2);\n}\nvar dontMutateMethodOverride = { [VALUE]: dontMutateFrozenCollections };\nfunction isFrozen(obj) {\n\tif (obj === null || !isObjectish(obj)) return true;\n\treturn O.isFrozen(obj);\n}\nvar PluginMapSet = \"MapSet\";\nvar PluginPatches = \"Patches\";\nvar PluginArrayMethods = \"ArrayMethods\";\nvar plugins = {};\nfunction getPlugin(pluginKey) {\n\tconst plugin = plugins[pluginKey];\n\tif (!plugin) die(0, pluginKey);\n\treturn plugin;\n}\nvar isPluginLoaded = (pluginKey) => !!plugins[pluginKey];\nfunction loadPlugin(pluginKey, implementation) {\n\tif (!plugins[pluginKey]) plugins[pluginKey] = implementation;\n}\nvar currentScope;\nvar getCurrentScope = () => currentScope;\nvar createScope = (parent_, immer_) => ({\n\tdrafts_: [],\n\tparent_,\n\timmer_,\n\tcanAutoFreeze_: true,\n\tunfinalizedDrafts_: 0,\n\thandledSet_: /* @__PURE__ */ new Set(),\n\tprocessedForPatches_: /* @__PURE__ */ new Set(),\n\tmapSetPlugin_: isPluginLoaded(PluginMapSet) ? getPlugin(PluginMapSet) : void 0,\n\tarrayMethodsPlugin_: isPluginLoaded(PluginArrayMethods) ? getPlugin(PluginArrayMethods) : void 0\n});\nfunction usePatchesInScope(scope, patchListener) {\n\tif (patchListener) {\n\t\tscope.patchPlugin_ = getPlugin(PluginPatches);\n\t\tscope.patches_ = [];\n\t\tscope.inversePatches_ = [];\n\t\tscope.patchListener_ = patchListener;\n\t}\n}\nfunction revokeScope(scope) {\n\tleaveScope(scope);\n\tscope.drafts_.forEach(revokeDraft);\n\tscope.drafts_ = null;\n}\nfunction leaveScope(scope) {\n\tif (scope === currentScope) currentScope = scope.parent_;\n}\nvar enterScope = (immer2) => currentScope = createScope(currentScope, immer2);\nfunction revokeDraft(draft) {\n\tconst state = draft[DRAFT_STATE];\n\tif (state.type_ === 0 || state.type_ === 1) state.revoke_();\n\telse state.revoked_ = true;\n}\nfunction processResult(result, scope) {\n\tscope.unfinalizedDrafts_ = scope.drafts_.length;\n\tconst baseDraft = scope.drafts_[0];\n\tif (result !== void 0 && result !== baseDraft) {\n\t\tif (baseDraft[DRAFT_STATE].modified_) {\n\t\t\trevokeScope(scope);\n\t\t\tdie(4);\n\t\t}\n\t\tif (isDraftable(result)) result = finalize(scope, result);\n\t\tconst { patchPlugin_ } = scope;\n\t\tif (patchPlugin_) patchPlugin_.generateReplacementPatches_(baseDraft[DRAFT_STATE].base_, result, scope);\n\t} else result = finalize(scope, baseDraft);\n\tmaybeFreeze(scope, result, true);\n\trevokeScope(scope);\n\tif (scope.patches_) scope.patchListener_(scope.patches_, scope.inversePatches_);\n\treturn result !== NOTHING ? result : void 0;\n}\nfunction finalize(rootScope, value) {\n\tif (isFrozen(value)) return value;\n\tconst state = value[DRAFT_STATE];\n\tif (!state) return handleValue(value, rootScope.handledSet_, rootScope);\n\tif (!isSameScope(state, rootScope)) return value;\n\tif (!state.modified_) return state.base_;\n\tif (!state.finalized_) {\n\t\tconst { callbacks_ } = state;\n\t\tif (callbacks_) while (callbacks_.length > 0) callbacks_.pop()(rootScope);\n\t\tgeneratePatchesAndFinalize(state, rootScope);\n\t}\n\treturn state.copy_;\n}\nfunction maybeFreeze(scope, value, deep = false) {\n\tif (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) freeze(value, deep);\n}\nfunction markStateFinalized(state) {\n\tstate.finalized_ = true;\n\tstate.scope_.unfinalizedDrafts_--;\n}\nvar isSameScope = (state, rootScope) => state.scope_ === rootScope;\nvar EMPTY_LOCATIONS_RESULT = [];\nfunction updateDraftInParent(parent, draftValue, finalizedValue, originalKey) {\n\tconst parentCopy = latest(parent);\n\tconst parentType = parent.type_;\n\tif (originalKey !== void 0) {\n\t\tif (get(parentCopy, originalKey, parentType) === draftValue) {\n\t\t\tset(parentCopy, originalKey, finalizedValue, parentType);\n\t\t\treturn;\n\t\t}\n\t}\n\tif (!parent.draftLocations_) {\n\t\tconst draftLocations = parent.draftLocations_ = /* @__PURE__ */ new Map();\n\t\teach(parentCopy, (key, value) => {\n\t\t\tif (isDraft(value)) {\n\t\t\t\tconst keys = draftLocations.get(value) || [];\n\t\t\t\tkeys.push(key);\n\t\t\t\tdraftLocations.set(value, keys);\n\t\t\t}\n\t\t});\n\t}\n\tconst locations = parent.draftLocations_.get(draftValue) ?? EMPTY_LOCATIONS_RESULT;\n\tfor (const location of locations) set(parentCopy, location, finalizedValue, parentType);\n}\nfunction registerChildFinalizationCallback(parent, child, key) {\n\tparent.callbacks_.push(function childCleanup(rootScope) {\n\t\tconst state = child;\n\t\tif (!state || !isSameScope(state, rootScope)) return;\n\t\trootScope.mapSetPlugin_?.fixSetContents(state);\n\t\tconst finalizedValue = getFinalValue(state);\n\t\tupdateDraftInParent(parent, state.draft_ ?? state, finalizedValue, key);\n\t\tgeneratePatchesAndFinalize(state, rootScope);\n\t});\n}\nfunction generatePatchesAndFinalize(state, rootScope) {\n\tif (state.modified_ && !state.finalized_ && (state.type_ === 3 || state.type_ === 1 && state.allIndicesReassigned_ || (state.assigned_?.size ?? 0) > 0)) {\n\t\tconst { patchPlugin_ } = rootScope;\n\t\tif (patchPlugin_) {\n\t\t\tconst basePath = patchPlugin_.getPath(state);\n\t\t\tif (basePath) patchPlugin_.generatePatches_(state, basePath, rootScope);\n\t\t}\n\t\tmarkStateFinalized(state);\n\t}\n}\nfunction handleCrossReference(target, key, value) {\n\tconst { scope_ } = target;\n\tif (isDraft(value)) {\n\t\tconst state = value[DRAFT_STATE];\n\t\tif (isSameScope(state, scope_)) state.callbacks_.push(function crossReferenceCleanup() {\n\t\t\tprepareCopy(target);\n\t\t\tupdateDraftInParent(target, value, getFinalValue(state), key);\n\t\t});\n\t} else if (isDraftable(value)) target.callbacks_.push(function nestedDraftCleanup() {\n\t\tconst targetCopy = latest(target);\n\t\tif (target.type_ === 3) {\n\t\t\tif (targetCopy.has(value)) handleValue(value, scope_.handledSet_, scope_);\n\t\t} else if (get(targetCopy, key, target.type_) === value) {\n\t\t\tif (scope_.drafts_.length > 1 && (target.assigned_.get(key) ?? false) === true && target.copy_) handleValue(get(target.copy_, key, target.type_), scope_.handledSet_, scope_);\n\t\t}\n\t});\n}\nfunction handleValue(target, handledSet, rootScope) {\n\tif (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) return target;\n\tif (isDraft(target) || handledSet.has(target) || !isDraftable(target) || isFrozen(target)) return target;\n\thandledSet.add(target);\n\teach(target, (key, value) => {\n\t\tif (isDraft(value)) {\n\t\t\tconst state = value[DRAFT_STATE];\n\t\t\tif (isSameScope(state, rootScope)) {\n\t\t\t\tset(target, key, getFinalValue(state), target.type_);\n\t\t\t\tmarkStateFinalized(state);\n\t\t\t}\n\t\t} else if (isDraftable(value)) handleValue(value, handledSet, rootScope);\n\t});\n\treturn target;\n}\nfunction createProxyProxy(base, parent) {\n\tconst baseIsArray = isArray(base);\n\tconst state = {\n\t\ttype_: baseIsArray ? 1 : 0,\n\t\tscope_: parent ? parent.scope_ : getCurrentScope(),\n\t\tmodified_: false,\n\t\tfinalized_: false,\n\t\tassigned_: void 0,\n\t\tparent_: parent,\n\t\tbase_: base,\n\t\tdraft_: null,\n\t\tcopy_: null,\n\t\trevoke_: null,\n\t\tisManual_: false,\n\t\tcallbacks_: void 0\n\t};\n\tlet target = state;\n\tlet traps = objectTraps;\n\tif (baseIsArray) {\n\t\ttarget = [state];\n\t\ttraps = arrayTraps;\n\t}\n\tconst { revoke, proxy } = Proxy.revocable(target, traps);\n\tstate.draft_ = proxy;\n\tstate.revoke_ = revoke;\n\treturn [proxy, state];\n}\nvar objectTraps = {\n\tget(state, prop) {\n\t\tif (prop === DRAFT_STATE) return state;\n\t\tlet arrayPlugin = state.scope_.arrayMethodsPlugin_;\n\t\tconst isArrayWithStringProp = state.type_ === 1 && typeof prop === \"string\";\n\t\tif (isArrayWithStringProp) {\n\t\t\tif (arrayPlugin?.isArrayOperationMethod(prop)) return arrayPlugin.createMethodInterceptor(state, prop);\n\t\t}\n\t\tconst source = latest(state);\n\t\tif (!has(source, prop, state.type_)) return readPropFromProto(state, source, prop);\n\t\tconst value = source[prop];\n\t\tif (state.finalized_ || !isDraftable(value)) return value;\n\t\tif (isArrayWithStringProp && state.operationMethod && arrayPlugin?.isMutatingArrayMethod(state.operationMethod) && isArrayIndex(prop)) return value;\n\t\tif (value === peek(state.base_, prop) || isRelocatedBaseRef(state, prop, value)) {\n\t\t\tprepareCopy(state);\n\t\t\tconst childKey = state.type_ === 1 ? +prop : prop;\n\t\t\tconst childDraft = createProxy(state.scope_, value, state, childKey);\n\t\t\treturn state.copy_[childKey] = childDraft;\n\t\t}\n\t\treturn value;\n\t},\n\thas(state, prop) {\n\t\treturn prop in latest(state);\n\t},\n\townKeys(state) {\n\t\treturn Reflect.ownKeys(latest(state));\n\t},\n\tset(state, prop, value) {\n\t\tconst desc = getDescriptorFromProto(latest(state), prop);\n\t\tif (desc?.set) {\n\t\t\tdesc.set.call(state.draft_, value);\n\t\t\treturn true;\n\t\t}\n\t\tif (!state.modified_) {\n\t\t\tconst current2 = peek(latest(state), prop);\n\t\t\tconst currentState = current2?.[DRAFT_STATE];\n\t\t\tif (currentState && currentState.base_ === value) {\n\t\t\t\tstate.copy_[prop] = value;\n\t\t\t\tstate.assigned_.set(prop, false);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (is(value, current2) && (value !== void 0 || has(state.base_, prop, state.type_))) return true;\n\t\t\tprepareCopy(state);\n\t\t\tmarkChanged(state);\n\t\t}\n\t\tif (state.copy_[prop] === value && (value !== void 0 || has(state.copy_, prop, state.type_)) || Number.isNaN(value) && Number.isNaN(state.copy_[prop])) return true;\n\t\tstate.copy_[prop] = value;\n\t\tstate.assigned_.set(prop, true);\n\t\thandleCrossReference(state, prop, value);\n\t\treturn true;\n\t},\n\tdeleteProperty(state, prop) {\n\t\tprepareCopy(state);\n\t\tif (peek(state.base_, prop) !== void 0 || prop in state.base_) {\n\t\t\tstate.assigned_.set(prop, false);\n\t\t\tmarkChanged(state);\n\t\t} else state.assigned_.delete(prop);\n\t\tif (state.copy_) delete state.copy_[prop];\n\t\treturn true;\n\t},\n\tgetOwnPropertyDescriptor(state, prop) {\n\t\tconst owner = latest(state);\n\t\tconst desc = Reflect.getOwnPropertyDescriptor(owner, prop);\n\t\tif (!desc) return desc;\n\t\treturn {\n\t\t\t[WRITABLE]: true,\n\t\t\t[CONFIGURABLE]: state.type_ !== 1 || prop !== \"length\",\n\t\t\t[ENUMERABLE]: desc[ENUMERABLE],\n\t\t\t[VALUE]: owner[prop]\n\t\t};\n\t},\n\tdefineProperty() {\n\t\tdie(11);\n\t},\n\tgetPrototypeOf(state) {\n\t\treturn getPrototypeOf(state.base_);\n\t},\n\tsetPrototypeOf() {\n\t\tdie(12);\n\t}\n};\nvar arrayTraps = {};\nfor (let key in objectTraps) {\n\tlet fn = objectTraps[key];\n\tarrayTraps[key] = function() {\n\t\tconst args = arguments;\n\t\targs[0] = args[0][0];\n\t\treturn fn.apply(this, args);\n\t};\n}\narrayTraps.deleteProperty = function(state, prop) {\n\tif (isNaN(parseInt(prop))) die(13);\n\treturn arrayTraps.set.call(this, state, prop, void 0);\n};\narrayTraps.set = function(state, prop, value) {\n\tif (prop !== \"length\" && isNaN(parseInt(prop))) die(14);\n\treturn objectTraps.set.call(this, state[0], prop, value, state[0]);\n};\nfunction peek(draft, prop) {\n\tconst state = draft[DRAFT_STATE];\n\treturn (state ? latest(state) : draft)[prop];\n}\nfunction isRelocatedBaseRef(state, prop, value) {\n\tif (state.type_ !== 1 || !state.allIndicesReassigned_ || state.assigned_?.get(prop) || !isDraftable(value) || value[DRAFT_STATE]) return false;\n\treturn state.baseRefs_.has(value);\n}\nfunction readPropFromProto(state, source, prop) {\n\tconst desc = getDescriptorFromProto(source, prop);\n\treturn desc ? VALUE in desc ? desc[VALUE] : desc.get?.call(state.draft_) : void 0;\n}\nfunction getDescriptorFromProto(source, prop) {\n\tif (!(prop in source)) return void 0;\n\tlet proto = getPrototypeOf(source);\n\twhile (proto) {\n\t\tconst desc = Object.getOwnPropertyDescriptor(proto, prop);\n\t\tif (desc) return desc;\n\t\tproto = getPrototypeOf(proto);\n\t}\n}\nfunction markChanged(state) {\n\tif (!state.modified_) {\n\t\tstate.modified_ = true;\n\t\tif (state.parent_) markChanged(state.parent_);\n\t}\n}\nfunction prepareCopy(state) {\n\tif (!state.copy_) {\n\t\tstate.assigned_ = /* @__PURE__ */ new Map();\n\t\tstate.copy_ = shallowCopy(state.base_, state.scope_.immer_.useStrictShallowCopy_);\n\t}\n}\nvar Immer2 = class {\n\tconstructor(config) {\n\t\tthis.autoFreeze_ = true;\n\t\tthis.useStrictShallowCopy_ = false;\n\t\tthis.useStrictIteration_ = false;\n\t\t/**\n\t\t* The `produce` function takes a value and a \"recipe function\" (whose\n\t\t* return value often depends on the base state). The recipe function is\n\t\t* free to mutate its first argument however it wants. All mutations are\n\t\t* only ever applied to a __copy__ of the base state.\n\t\t*\n\t\t* Pass only a function to create a \"curried producer\" which relieves you\n\t\t* from passing the recipe function every time.\n\t\t*\n\t\t* Only plain objects and arrays are made mutable. All other objects are\n\t\t* considered uncopyable.\n\t\t*\n\t\t* Note: This function is __bound__ to its `Immer` instance.\n\t\t*\n\t\t* @param {any} base - the initial state\n\t\t* @param {Function} recipe - function that receives a proxy of the base state as first argument and which can be freely modified\n\t\t* @param {Function} patchListener - optional function that will be called with all the patches produced here\n\t\t* @returns {any} a new state, or the initial state if nothing was modified\n\t\t*/\n\t\tthis.produce = (base, recipe, patchListener) => {\n\t\t\tif (isFunction(base) && !isFunction(recipe)) {\n\t\t\t\tconst defaultBase = recipe;\n\t\t\t\trecipe = base;\n\t\t\t\tconst self = this;\n\t\t\t\treturn function curriedProduce(base2 = defaultBase, ...args) {\n\t\t\t\t\treturn self.produce(base2, (draft) => recipe.call(this, draft, ...args));\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (!isFunction(recipe)) die(6);\n\t\t\tif (patchListener !== void 0 && !isFunction(patchListener)) die(7);\n\t\t\tlet result;\n\t\t\tif (isDraftable(base)) {\n\t\t\t\tconst scope = enterScope(this);\n\t\t\t\tconst proxy = createProxy(scope, base, void 0);\n\t\t\t\tlet hasError = true;\n\t\t\t\ttry {\n\t\t\t\t\tresult = recipe(proxy);\n\t\t\t\t\thasError = false;\n\t\t\t\t} finally {\n\t\t\t\t\tif (hasError) revokeScope(scope);\n\t\t\t\t\telse leaveScope(scope);\n\t\t\t\t}\n\t\t\t\tusePatchesInScope(scope, patchListener);\n\t\t\t\treturn processResult(result, scope);\n\t\t\t} else if (!base || !isObjectish(base)) {\n\t\t\t\tresult = recipe(base);\n\t\t\t\tif (result === void 0) result = base;\n\t\t\t\tif (result === NOTHING) result = void 0;\n\t\t\t\tif (this.autoFreeze_) freeze(result, true);\n\t\t\t\tif (patchListener) {\n\t\t\t\t\tconst p = [];\n\t\t\t\t\tconst ip = [];\n\t\t\t\t\tgetPlugin(PluginPatches).generateReplacementPatches_(base, result, {\n\t\t\t\t\t\tpatches_: p,\n\t\t\t\t\t\tinversePatches_: ip\n\t\t\t\t\t});\n\t\t\t\t\tpatchListener(p, ip);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} else die(1, base);\n\t\t};\n\t\tthis.produceWithPatches = (base, recipe) => {\n\t\t\tif (isFunction(base)) return (state, ...args) => this.produceWithPatches(state, (draft) => base(draft, ...args));\n\t\t\tlet patches, inversePatches;\n\t\t\treturn [\n\t\t\t\tthis.produce(base, recipe, (p, ip) => {\n\t\t\t\t\tpatches = p;\n\t\t\t\t\tinversePatches = ip;\n\t\t\t\t}),\n\t\t\t\tpatches,\n\t\t\t\tinversePatches\n\t\t\t];\n\t\t};\n\t\tif (isBoolean(config?.autoFreeze)) this.setAutoFreeze(config.autoFreeze);\n\t\tif (isBoolean(config?.useStrictShallowCopy)) this.setUseStrictShallowCopy(config.useStrictShallowCopy);\n\t\tif (isBoolean(config?.useStrictIteration)) this.setUseStrictIteration(config.useStrictIteration);\n\t}\n\tcreateDraft(base) {\n\t\tif (!isDraftable(base)) die(8);\n\t\tif (isDraft(base)) base = current(base);\n\t\tconst scope = enterScope(this);\n\t\tconst proxy = createProxy(scope, base, void 0);\n\t\tproxy[DRAFT_STATE].isManual_ = true;\n\t\tleaveScope(scope);\n\t\treturn proxy;\n\t}\n\tfinishDraft(draft, patchListener) {\n\t\tconst state = draft && draft[DRAFT_STATE];\n\t\tif (!state || !state.isManual_) die(9);\n\t\tconst { scope_: scope } = state;\n\t\tusePatchesInScope(scope, patchListener);\n\t\treturn processResult(void 0, scope);\n\t}\n\t/**\n\t* Pass true to automatically freeze all copies created by Immer.\n\t*\n\t* By default, auto-freezing is enabled.\n\t*/\n\tsetAutoFreeze(value) {\n\t\tthis.autoFreeze_ = value;\n\t}\n\t/**\n\t* Pass true to enable strict shallow copy.\n\t*\n\t* By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.\n\t*/\n\tsetUseStrictShallowCopy(value) {\n\t\tthis.useStrictShallowCopy_ = value;\n\t}\n\t/**\n\t* Pass false to use faster iteration that skips non-enumerable properties\n\t* but still handles symbols for compatibility.\n\t*\n\t* By default, strict iteration is enabled (includes all own properties).\n\t*/\n\tsetUseStrictIteration(value) {\n\t\tthis.useStrictIteration_ = value;\n\t}\n\tshouldUseStrictIteration() {\n\t\treturn this.useStrictIteration_;\n\t}\n\tapplyPatches(base, patches) {\n\t\tlet i;\n\t\tfor (i = patches.length - 1; i >= 0; i--) {\n\t\t\tconst patch = patches[i];\n\t\t\tif (patch.path.length === 0 && patch.op === \"replace\") {\n\t\t\t\tbase = patch.value;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (i > -1) patches = patches.slice(i + 1);\n\t\tconst applyPatchesImpl = getPlugin(PluginPatches).applyPatches_;\n\t\tif (isDraft(base)) return applyPatchesImpl(base, patches);\n\t\treturn this.produce(base, (draft) => applyPatchesImpl(draft, patches));\n\t}\n};\nfunction createProxy(rootScope, value, parent, key) {\n\tconst [draft, state] = isMap(value) ? getPlugin(PluginMapSet).proxyMap_(value, parent) : isSet(value) ? getPlugin(PluginMapSet).proxySet_(value, parent) : createProxyProxy(value, parent);\n\t(parent?.scope_ ?? getCurrentScope()).drafts_.push(draft);\n\tstate.callbacks_ = parent?.callbacks_ ?? [];\n\tstate.key_ = key;\n\tif (parent && key !== void 0) registerChildFinalizationCallback(parent, state, key);\n\telse state.callbacks_.push(function rootDraftCleanup(rootScope2) {\n\t\trootScope2.mapSetPlugin_?.fixSetContents(state);\n\t\tconst { patchPlugin_ } = rootScope2;\n\t\tif (state.modified_ && patchPlugin_) patchPlugin_.generatePatches_(state, [], rootScope2);\n\t});\n\treturn draft;\n}\nfunction current(value) {\n\tif (!isDraft(value)) die(10, value);\n\treturn currentImpl(value);\n}\nfunction currentImpl(value) {\n\tif (!isDraftable(value) || isFrozen(value)) return value;\n\tconst state = value[DRAFT_STATE];\n\tlet copy;\n\tlet strict = true;\n\tif (state) {\n\t\tif (!state.modified_) return state.base_;\n\t\tstate.finalized_ = true;\n\t\tcopy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_);\n\t\tstrict = state.scope_.immer_.shouldUseStrictIteration();\n\t} else copy = shallowCopy(value, true);\n\teach(copy, (key, childValue) => {\n\t\tset(copy, key, currentImpl(childValue));\n\t}, strict);\n\tif (state) state.finalized_ = false;\n\treturn copy;\n}\nfunction enablePatches() {\n\tconst errorOffset = 16;\n\terrors.push(\"Sets cannot have \\\"replace\\\" patches.\", function(op) {\n\t\treturn \"Unsupported patch operation: \" + op;\n\t}, function(path) {\n\t\treturn \"Cannot apply patch, path doesn't resolve: \" + path;\n\t}, \"Patching reserved attributes like __proto__, prototype and constructor is not allowed\");\n\tfunction getPath(state, path = []) {\n\t\tif (state.key_ !== void 0) {\n\t\t\tconst parentCopy = state.parent_.copy_ ?? state.parent_.base_;\n\t\t\tconst proxyDraft = getProxyDraft(get(parentCopy, state.key_));\n\t\t\tconst valueAtKey = get(parentCopy, state.key_);\n\t\t\tif (valueAtKey === void 0) return null;\n\t\t\tif (valueAtKey !== state.draft_ && valueAtKey !== state.base_ && valueAtKey !== state.copy_) return null;\n\t\t\tif (proxyDraft != null && proxyDraft.base_ !== state.base_) return null;\n\t\t\tconst isSet2 = state.parent_.type_ === 3;\n\t\t\tlet key;\n\t\t\tif (isSet2) {\n\t\t\t\tconst setParent = state.parent_;\n\t\t\t\tkey = Array.from(setParent.drafts_.keys()).indexOf(state.key_);\n\t\t\t} else key = state.key_;\n\t\t\tif (!(isSet2 && parentCopy.size > key || has(parentCopy, key))) return null;\n\t\t\tpath.push(key);\n\t\t}\n\t\tif (state.parent_) return getPath(state.parent_, path);\n\t\tpath.reverse();\n\t\ttry {\n\t\t\tresolvePath(state.copy_, path);\n\t\t} catch (e) {\n\t\t\treturn null;\n\t\t}\n\t\treturn path;\n\t}\n\tfunction resolvePath(base, path) {\n\t\tlet current2 = base;\n\t\tfor (let i = 0; i < path.length - 1; i++) {\n\t\t\tconst key = path[i];\n\t\t\tcurrent2 = get(current2, key);\n\t\t\tif (!isObjectish(current2) || current2 === null) throw new Error(`Cannot resolve path at '${path.join(\"/\")}'`);\n\t\t}\n\t\treturn current2;\n\t}\n\tconst REPLACE = \"replace\";\n\tconst ADD = \"add\";\n\tconst REMOVE = \"remove\";\n\tfunction generatePatches_(state, basePath, scope) {\n\t\tif (state.scope_.processedForPatches_.has(state)) return;\n\t\tstate.scope_.processedForPatches_.add(state);\n\t\tconst { patches_, inversePatches_ } = scope;\n\t\tswitch (state.type_) {\n\t\t\tcase 0:\n\t\t\tcase 2: return generatePatchesFromAssigned(state, basePath, patches_, inversePatches_);\n\t\t\tcase 1: return generateArrayPatches(state, basePath, patches_, inversePatches_);\n\t\t\tcase 3: return generateSetPatches(state, basePath, patches_, inversePatches_);\n\t\t}\n\t}\n\tfunction generateArrayPatches(state, basePath, patches, inversePatches) {\n\t\tlet { base_, assigned_ } = state;\n\t\tlet copy_ = state.copy_;\n\t\tif (copy_.length < base_.length) {\n\t\t\t[base_, copy_] = [copy_, base_];\n\t\t\t[patches, inversePatches] = [inversePatches, patches];\n\t\t}\n\t\tconst allReassigned = state.allIndicesReassigned_ === true;\n\t\tfor (let i = 0; i < base_.length; i++) {\n\t\t\tconst copiedItem = copy_[i];\n\t\t\tconst baseItem = base_[i];\n\t\t\tif ((allReassigned || assigned_?.get(i.toString())) && copiedItem !== baseItem) {\n\t\t\t\tconst childState = copiedItem?.[DRAFT_STATE];\n\t\t\t\tif (childState && childState.modified_) continue;\n\t\t\t\tconst path = basePath.concat([i]);\n\t\t\t\tpatches.push({\n\t\t\t\t\top: REPLACE,\n\t\t\t\t\tpath,\n\t\t\t\t\tvalue: clonePatchValueIfNeeded(copiedItem)\n\t\t\t\t});\n\t\t\t\tinversePatches.push({\n\t\t\t\t\top: REPLACE,\n\t\t\t\t\tpath,\n\t\t\t\t\tvalue: clonePatchValueIfNeeded(baseItem)\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tfor (let i = base_.length; i < copy_.length; i++) {\n\t\t\tconst path = basePath.concat([i]);\n\t\t\tpatches.push({\n\t\t\t\top: ADD,\n\t\t\t\tpath,\n\t\t\t\tvalue: clonePatchValueIfNeeded(copy_[i])\n\t\t\t});\n\t\t}\n\t\tfor (let i = copy_.length - 1; base_.length <= i; --i) {\n\t\t\tconst path = basePath.concat([i]);\n\t\t\tinversePatches.push({\n\t\t\t\top: REMOVE,\n\t\t\t\tpath\n\t\t\t});\n\t\t}\n\t}\n\tfunction generatePatchesFromAssigned(state, basePath, patches, inversePatches) {\n\t\tconst { base_, copy_, type_ } = state;\n\t\teach(state.assigned_, (key, assignedValue) => {\n\t\t\tconst origValue = get(base_, key, type_);\n\t\t\tconst value = get(copy_, key, type_);\n\t\t\tconst op = !assignedValue ? REMOVE : has(base_, key) ? REPLACE : ADD;\n\t\t\tif (origValue === value && op === REPLACE) return;\n\t\t\tconst path = basePath.concat(key);\n\t\t\tpatches.push(op === REMOVE ? {\n\t\t\t\top,\n\t\t\t\tpath\n\t\t\t} : {\n\t\t\t\top,\n\t\t\t\tpath,\n\t\t\t\tvalue: clonePatchValueIfNeeded(value)\n\t\t\t});\n\t\t\tinversePatches.push(op === ADD ? {\n\t\t\t\top: REMOVE,\n\t\t\t\tpath\n\t\t\t} : op === REMOVE ? {\n\t\t\t\top: ADD,\n\t\t\t\tpath,\n\t\t\t\tvalue: clonePatchValueIfNeeded(origValue)\n\t\t\t} : {\n\t\t\t\top: REPLACE,\n\t\t\t\tpath,\n\t\t\t\tvalue: clonePatchValueIfNeeded(origValue)\n\t\t\t});\n\t\t});\n\t}\n\tfunction generateSetPatches(state, basePath, patches, inversePatches) {\n\t\tlet { base_, copy_ } = state;\n\t\tlet i = 0;\n\t\tbase_.forEach((value) => {\n\t\t\tif (!copy_.has(value)) {\n\t\t\t\tconst path = basePath.concat([i]);\n\t\t\t\tpatches.push({\n\t\t\t\t\top: REMOVE,\n\t\t\t\t\tpath,\n\t\t\t\t\tvalue\n\t\t\t\t});\n\t\t\t\tinversePatches.unshift({\n\t\t\t\t\top: ADD,\n\t\t\t\t\tpath,\n\t\t\t\t\tvalue\n\t\t\t\t});\n\t\t\t}\n\t\t\ti++;\n\t\t});\n\t\ti = 0;\n\t\tcopy_.forEach((value) => {\n\t\t\tif (!base_.has(value)) {\n\t\t\t\tconst path = basePath.concat([i]);\n\t\t\t\tpatches.push({\n\t\t\t\t\top: ADD,\n\t\t\t\t\tpath,\n\t\t\t\t\tvalue\n\t\t\t\t});\n\t\t\t\tinversePatches.unshift({\n\t\t\t\t\top: REMOVE,\n\t\t\t\t\tpath,\n\t\t\t\t\tvalue\n\t\t\t\t});\n\t\t\t}\n\t\t\ti++;\n\t\t});\n\t}\n\tfunction generateReplacementPatches_(baseValue, replacement, scope) {\n\t\tconst { patches_, inversePatches_ } = scope;\n\t\tpatches_.push({\n\t\t\top: REPLACE,\n\t\t\tpath: [],\n\t\t\tvalue: replacement === NOTHING ? void 0 : replacement\n\t\t});\n\t\tinversePatches_.push({\n\t\t\top: REPLACE,\n\t\t\tpath: [],\n\t\t\tvalue: baseValue\n\t\t});\n\t}\n\tfunction applyPatches_(draft, patches) {\n\t\tpatches.forEach((patch) => {\n\t\t\tconst { path, op } = patch;\n\t\t\tlet base = draft;\n\t\t\tfor (let i = 0; i < path.length - 1; i++) {\n\t\t\t\tconst parentType = getArchtype(base);\n\t\t\t\tlet p = path[i];\n\t\t\t\tif (typeof p !== \"string\" && typeof p !== \"number\") p = \"\" + p;\n\t\t\t\tif ((parentType === 0 || parentType === 1) && (p === \"__proto__\" || p === CONSTRUCTOR)) die(19);\n\t\t\t\tif (isFunction(base) && p === PROTOTYPE) die(19);\n\t\t\t\tbase = get(base, p);\n\t\t\t\tif (base === null || !isObjectish(base)) die(18, path.join(\"/\"));\n\t\t\t}\n\t\t\tconst type = getArchtype(base);\n\t\t\tconst value = deepClonePatchValue(patch.value);\n\t\t\tconst key = path[path.length - 1];\n\t\t\tswitch (op) {\n\t\t\t\tcase REPLACE: switch (type) {\n\t\t\t\t\tcase 2: return base.set(key, value);\n\t\t\t\t\tcase 3: die(errorOffset);\n\t\t\t\t\tdefault: return base[key] = value;\n\t\t\t\t}\n\t\t\t\tcase ADD: switch (type) {\n\t\t\t\t\tcase 1: return key === \"-\" ? base.push(value) : base.splice(key, 0, value);\n\t\t\t\t\tcase 2: return base.set(key, value);\n\t\t\t\t\tcase 3: return base.add(value);\n\t\t\t\t\tdefault: return base[key] = value;\n\t\t\t\t}\n\t\t\t\tcase REMOVE: switch (type) {\n\t\t\t\t\tcase 1: return base.splice(key, 1);\n\t\t\t\t\tcase 2: return base.delete(key);\n\t\t\t\t\tcase 3: return base.delete(patch.value);\n\t\t\t\t\tdefault: return delete base[key];\n\t\t\t\t}\n\t\t\t\tdefault: die(17, op);\n\t\t\t}\n\t\t});\n\t\treturn draft;\n\t}\n\tfunction deepClonePatchValue(obj) {\n\t\tif (!isDraftable(obj)) return obj;\n\t\tif (isArray(obj)) return obj.map(deepClonePatchValue);\n\t\tif (isMap(obj)) return new Map(Array.from(obj.entries()).map(([k, v]) => [k, deepClonePatchValue(v)]));\n\t\tif (isSet(obj)) return new Set(Array.from(obj).map(deepClonePatchValue));\n\t\tconst cloned = Object.create(getPrototypeOf(obj));\n\t\tfor (const key in obj) cloned[key] = deepClonePatchValue(obj[key]);\n\t\tif (has(obj, DRAFTABLE)) cloned[DRAFTABLE] = obj[DRAFTABLE];\n\t\treturn cloned;\n\t}\n\tfunction clonePatchValueIfNeeded(obj) {\n\t\tif (isDraft(obj)) return deepClonePatchValue(obj);\n\t\telse return obj;\n\t}\n\tloadPlugin(PluginPatches, {\n\t\tapplyPatches_,\n\t\tgeneratePatches_,\n\t\tgenerateReplacementPatches_,\n\t\tgetPath\n\t});\n}\nglobalThis.Iterator?.from;\nvar immer = new Immer2();\nvar produce = immer.produce;\nvar produceWithPatches = /* @__PURE__ */ immer.produceWithPatches.bind(immer);\nvar applyPatches = /* @__PURE__ */ immer.applyPatches.bind(immer);\n//#endregion\n//#region src/utils/shared-state.ts\n/**\n* Upper bound on retained syncIds. Loop echoes arrive near-immediately, so a\n* generous window preserves de-dup while capping memory on long-lived,\n* frequently-mutated states (e.g. a 1s terminal poll).\n*/\nconst MAX_SYNC_IDS = 1e3;\nfunction rememberSyncId(syncIds, syncId) {\n\tsyncIds.add(syncId);\n\tif (syncIds.size > MAX_SYNC_IDS) {\n\t\tconst oldest = syncIds.values().next().value;\n\t\tif (oldest !== void 0) syncIds.delete(oldest);\n\t}\n}\nfunction createSharedState(options) {\n\tconst { enablePatches: enablePatches$1 = false } = options;\n\tif (enablePatches$1) enablePatches();\n\tconst events = createEventEmitter();\n\tlet state = options.initialValue;\n\tconst syncIds = /* @__PURE__ */ new Set();\n\treturn {\n\t\ton: events.on,\n\t\tvalue: () => state,\n\t\tpatch: (patches, syncId = nanoid()) => {\n\t\t\tif (syncIds.has(syncId)) return;\n\t\t\tenablePatches();\n\t\t\tstate = applyPatches(state, patches);\n\t\t\trememberSyncId(syncIds, syncId);\n\t\t\tevents.emit(\"updated\", state, void 0, syncId);\n\t\t},\n\t\tmutate: (fn, syncId = nanoid()) => {\n\t\t\tif (syncIds.has(syncId)) return;\n\t\t\trememberSyncId(syncIds, syncId);\n\t\t\tif (enablePatches$1) {\n\t\t\t\tconst [nextState, patches] = produceWithPatches(state, fn);\n\t\t\t\tif (nextState === state) return;\n\t\t\t\tstate = nextState;\n\t\t\t\tevents.emit(\"updated\", state, patches, syncId);\n\t\t\t} else {\n\t\t\t\tconst nextState = produce(state, fn);\n\t\t\t\tif (nextState === state) return;\n\t\t\t\tstate = nextState;\n\t\t\t\tevents.emit(\"updated\", state, void 0, syncId);\n\t\t\t}\n\t\t},\n\t\tsyncIds\n\t};\n}\n//#endregion\nexport { createSharedState as t };\n","//#region ../../node_modules/.pnpm/structured-clone-es@2.0.1/node_modules/structured-clone-es/dist/index.mjs\nconst env = typeof self === \"object\" ? self : globalThis;\nconst SAFE_ERROR_NAMES = /* @__PURE__ */ new Set([\n\t\"Error\",\n\t\"EvalError\",\n\t\"RangeError\",\n\t\"ReferenceError\",\n\t\"SyntaxError\",\n\t\"TypeError\",\n\t\"URIError\",\n\t\"AggregateError\"\n]);\nconst SAFE_CONSTRUCTOR_NAMES = /* @__PURE__ */ new Set([\n\t\"Boolean\",\n\t\"Number\",\n\t\"String\",\n\t\"Int8Array\",\n\t\"Uint8Array\",\n\t\"Uint8ClampedArray\",\n\t\"Int16Array\",\n\t\"Uint16Array\",\n\t\"Int32Array\",\n\t\"Uint32Array\",\n\t\"Float16Array\",\n\t\"Float32Array\",\n\t\"Float64Array\",\n\t\"BigInt64Array\",\n\t\"BigUint64Array\"\n]);\nfunction deserializer($, _) {\n\tconst as = (out, index) => {\n\t\t$.set(index, out);\n\t\treturn out;\n\t};\n\tconst unpair = (index) => {\n\t\tif ($.has(index)) return $.get(index);\n\t\tconst [type, value] = _[index];\n\t\tswitch (type) {\n\t\t\tcase 0:\n\t\t\tcase -1: return as(value, index);\n\t\t\tcase 1: {\n\t\t\t\tconst arr = as([], index);\n\t\t\t\tfor (const index of value) arr.push(unpair(index));\n\t\t\t\treturn arr;\n\t\t\t}\n\t\t\tcase 2: {\n\t\t\t\tconst object = as({}, index);\n\t\t\t\tfor (const [key, index] of value) object[unpair(key)] = unpair(index);\n\t\t\t\treturn object;\n\t\t\t}\n\t\t\tcase 3: return as(new Date(value), index);\n\t\t\tcase 4: {\n\t\t\t\tconst { source, flags } = value;\n\t\t\t\treturn as(new RegExp(source, flags), index);\n\t\t\t}\n\t\t\tcase 5: {\n\t\t\t\tconst map = as(/* @__PURE__ */ new Map(), index);\n\t\t\t\tfor (const [key, index] of value) map.set(unpair(key), unpair(index));\n\t\t\t\treturn map;\n\t\t\t}\n\t\t\tcase 6: {\n\t\t\t\tconst set = as(/* @__PURE__ */ new Set(), index);\n\t\t\t\tfor (const index of value) set.add(unpair(index));\n\t\t\t\treturn set;\n\t\t\t}\n\t\t\tcase 7: {\n\t\t\t\tconst { name, message } = value;\n\t\t\t\tconst Ctor = SAFE_ERROR_NAMES.has(name) ? env[name] : void 0;\n\t\t\t\treturn as(new (Ctor ?? env.Error)(message), index);\n\t\t\t}\n\t\t\tcase 8: return as(BigInt(value), index);\n\t\t\tcase \"BigInt\": return as(Object(BigInt(value)), index);\n\t\t\tcase \"ArrayBuffer\": return as(new Uint8Array(value).buffer, value);\n\t\t\tcase \"DataView\": {\n\t\t\t\tconst { buffer } = new Uint8Array(value);\n\t\t\t\treturn as(new DataView(buffer), value);\n\t\t\t}\n\t\t}\n\t\tif (typeof type === \"string\" && SAFE_CONSTRUCTOR_NAMES.has(type)) return as(new env[type](value), index);\n\t\tthrow new TypeError(`unable to deserialize unsafe or unknown type: ${String(type)}`);\n\t};\n\treturn unpair;\n}\n/**\n* Returns a deserialized value from a serialized array of Records.\n* @param serialized a previously serialized value.\n*/\nfunction deserialize(serialized) {\n\treturn deserializer(/* @__PURE__ */ new Map(), serialized)(0);\n}\nconst EMPTY = \"\";\nconst { toString } = {};\nconst { keys } = Object;\nfunction typeOf(value) {\n\tconst type = typeof value;\n\tif (type !== \"object\" || !value) return [0, type];\n\tconst asString = toString.call(value).slice(8, -1);\n\tswitch (asString) {\n\t\tcase \"Array\": return [1, EMPTY];\n\t\tcase \"Object\": return [2, EMPTY];\n\t\tcase \"Date\": return [3, EMPTY];\n\t\tcase \"RegExp\": return [4, EMPTY];\n\t\tcase \"Map\": return [5, EMPTY];\n\t\tcase \"Set\": return [6, EMPTY];\n\t\tcase \"DataView\": return [1, asString];\n\t}\n\tif (asString.includes(\"Array\")) return [1, asString];\n\tif (asString.includes(\"Error\")) return [7, asString];\n\treturn [2, asString];\n}\nfunction shouldSkip([TYPE, type]) {\n\treturn TYPE === 0 && (type === \"function\" || type === \"symbol\");\n}\nfunction serializer(strict, json, $, _) {\n\tconst as = (out, value) => {\n\t\tconst index = _.push(out) - 1;\n\t\t$.set(value, index);\n\t\treturn index;\n\t};\n\tconst pair = (value) => {\n\t\tif ($.has(value)) return $.get(value);\n\t\tlet [TYPE, type] = typeOf(value);\n\t\tswitch (TYPE) {\n\t\t\tcase 0: {\n\t\t\t\tlet entry = value;\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase \"bigint\":\n\t\t\t\t\t\tTYPE = 8;\n\t\t\t\t\t\tentry = value.toString();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"function\":\n\t\t\t\t\tcase \"symbol\":\n\t\t\t\t\t\tif (strict) throw new TypeError(`unable to serialize ${type}`);\n\t\t\t\t\t\tentry = null;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"undefined\": return as([-1], value);\n\t\t\t\t}\n\t\t\t\treturn as([TYPE, entry], value);\n\t\t\t}\n\t\t\tcase 1: {\n\t\t\t\tif (type) {\n\t\t\t\t\tlet spread = value;\n\t\t\t\t\tif (type === \"DataView\") spread = new Uint8Array(value.buffer);\n\t\t\t\t\telse if (type === \"ArrayBuffer\") spread = new Uint8Array(value);\n\t\t\t\t\treturn as([type, [...spread]], value);\n\t\t\t\t}\n\t\t\t\tconst arr = [];\n\t\t\t\tconst index = as([TYPE, arr], value);\n\t\t\t\tfor (const entry of value) arr.push(pair(entry));\n\t\t\t\treturn index;\n\t\t\t}\n\t\t\tcase 2: {\n\t\t\t\tif (type) switch (type) {\n\t\t\t\t\tcase \"BigInt\": return as([type, value.toString()], value);\n\t\t\t\t\tcase \"Boolean\":\n\t\t\t\t\tcase \"Number\":\n\t\t\t\t\tcase \"String\": return as([type, value.valueOf()], value);\n\t\t\t\t}\n\t\t\t\tif (json && \"toJSON\" in value) return pair(value.toJSON());\n\t\t\t\tconst entries = [];\n\t\t\t\tconst index = as([TYPE, entries], value);\n\t\t\t\tfor (const key of keys(value)) if (strict || !shouldSkip(typeOf(value[key]))) entries.push([pair(key), pair(value[key])]);\n\t\t\t\treturn index;\n\t\t\t}\n\t\t\tcase 3: return as([TYPE, value.toISOString()], value);\n\t\t\tcase 4: {\n\t\t\t\tconst { source, flags } = value;\n\t\t\t\treturn as([TYPE, {\n\t\t\t\t\tsource,\n\t\t\t\t\tflags\n\t\t\t\t}], value);\n\t\t\t}\n\t\t\tcase 5: {\n\t\t\t\tconst entries = [];\n\t\t\t\tconst index = as([TYPE, entries], value);\n\t\t\t\tfor (const [key, entry] of value) if (strict || !(shouldSkip(typeOf(key)) || shouldSkip(typeOf(entry)))) entries.push([pair(key), pair(entry)]);\n\t\t\t\treturn index;\n\t\t\t}\n\t\t\tcase 6: {\n\t\t\t\tconst entries = [];\n\t\t\t\tconst index = as([TYPE, entries], value);\n\t\t\t\tfor (const entry of value) if (strict || !shouldSkip(typeOf(entry))) entries.push(pair(entry));\n\t\t\t\treturn index;\n\t\t\t}\n\t\t}\n\t\tconst { message } = value;\n\t\treturn as([TYPE, {\n\t\t\tname: type,\n\t\t\tmessage\n\t\t}], value);\n\t};\n\treturn pair;\n}\n/**\n* Returns an array of serialized Records.\n*/\nfunction serialize(value, options = {}) {\n\tconst _ = [];\n\tserializer(!(options.json || options.lossy), !!options.json, /* @__PURE__ */ new Map(), _)(value);\n\treturn _;\n}\nconst { parse: $parse, stringify: $stringify } = JSON;\nconst options = {\n\tjson: true,\n\tlossy: true\n};\n/**\n* Revive a previously stringified structured clone.\n* @param str previously stringified data as string.\n*/\nfunction parse(str) {\n\treturn deserialize($parse(str));\n}\n/**\n* Represent a structured clone value as string.\n* @param any some clone-able value to stringify.\n*/\nfunction stringify(any) {\n\treturn $stringify(serialize(any, options));\n}\n//#endregion\n//#region src/utils/structured-clone.ts\n/**\n* Serialize a structured-cloneable value (`Map`, `Set`, `Date`, `BigInt`,\n* cycles, class instances, …) into a JSON-safe records array.\n*/\nfunction structuredCloneSerialize(value) {\n\treturn serialize(value);\n}\n/**\n* Inverse of {@link structuredCloneSerialize}.\n*/\nfunction structuredCloneDeserialize(value) {\n\treturn deserialize(value);\n}\n/**\n* Serialize a structured-cloneable value to a single string. Equivalent\n* to `JSON.stringify(structuredCloneSerialize(value))`.\n*/\nfunction structuredCloneStringify(value) {\n\treturn stringify(value);\n}\n/**\n* Inverse of {@link structuredCloneStringify}.\n*/\nfunction structuredCloneParse(value) {\n\treturn parse(value);\n}\n//#endregion\nexport { structuredCloneStringify as i, structuredCloneParse as n, structuredCloneSerialize as r, structuredCloneDeserialize as t };\n","import { createEventEmitter } from \"./events.mjs\";\nimport { nanoid } from \"./nanoid.mjs\";\n//#region src/utils/streaming-channel.ts\nconst DEFAULT_HIGH_WATER_MARK = 256;\nvar StreamClosedError = class extends Error {\n\tname = \"StreamClosedError\";\n};\n/**\n* Build a server-side stream sink. RPC-agnostic; the RPC host wires\n* `events.on('chunk' | 'end')` to broadcast, and reads `buffer` to replay\n* for late or reconnecting subscribers.\n*/\nfunction createStreamSink(options = {}) {\n\tconst id = options.id ?? nanoid();\n\tconst replayWindow = Math.max(0, options.replayWindow ?? 0);\n\tconst events = createEventEmitter();\n\tconst controller = new AbortController();\n\tconst buffer = [];\n\tlet closed = false;\n\tlet lastSeq = 0;\n\tfunction write(chunk) {\n\t\tif (closed) throw new StreamClosedError(`Cannot write to a closed stream \"${id}\"`);\n\t\tlastSeq += 1;\n\t\tif (replayWindow > 0) {\n\t\t\tbuffer.push({\n\t\t\t\tseq: lastSeq,\n\t\t\t\tchunk\n\t\t\t});\n\t\t\tif (buffer.length > replayWindow) {\n\t\t\t\tif (buffer.length - replayWindow === 1) buffer.shift();\n\t\t\t\telse buffer.splice(0, buffer.length - replayWindow);\n\t\t\t}\n\t\t}\n\t\tevents.emit(\"chunk\", lastSeq, chunk);\n\t}\n\tfunction error(reason) {\n\t\tif (closed) return;\n\t\tclosed = true;\n\t\tconst payload = toErrorPayload(reason);\n\t\tcontroller.abort(reason);\n\t\tevents.emit(\"end\", payload);\n\t}\n\tfunction close() {\n\t\tif (closed) return;\n\t\tclosed = true;\n\t\tif (!controller.signal.aborted) controller.abort(\"stream closed\");\n\t\tevents.emit(\"end\", void 0);\n\t}\n\tfunction abort(reason) {\n\t\tif (closed) return;\n\t\tif (!controller.signal.aborted) controller.abort(reason ?? \"aborted\");\n\t}\n\tconst writable = new WritableStream({\n\t\twrite(chunk) {\n\t\t\twrite(chunk);\n\t\t},\n\t\tclose() {\n\t\t\tclose();\n\t\t},\n\t\tabort(reason) {\n\t\t\terror(reason);\n\t\t}\n\t});\n\treturn {\n\t\tid,\n\t\tsignal: controller.signal,\n\t\tget closed() {\n\t\t\treturn closed;\n\t\t},\n\t\tget lastSeq() {\n\t\t\treturn lastSeq;\n\t\t},\n\t\twrite,\n\t\terror,\n\t\tclose,\n\t\tabort,\n\t\twritable,\n\t\tevents,\n\t\tbuffer\n\t};\n}\n/**\n* Build a client-side stream reader. RPC-agnostic; the RPC host calls\n* `_push(seq, chunk)` on each incoming chunk and `_end(error?)` on the\n* terminal frame. Consumers iterate with `for await` or pipe `readable`.\n*/\nfunction createStreamReader(options = {}) {\n\tconst id = options.id ?? nanoid();\n\tconst highWaterMark = Math.max(1, options.highWaterMark ?? DEFAULT_HIGH_WATER_MARK);\n\tconst queue = [];\n\tlet lastSeenSeq = 0;\n\tlet done = false;\n\tlet cancelled = false;\n\tlet endError;\n\tlet pending;\n\tlet pullController;\n\tlet readableInstance;\n\tfunction drainNext() {\n\t\tif (!pending) return;\n\t\tif (queue.length > 0) {\n\t\t\tconst value = queue.shift();\n\t\t\tconst r = pending;\n\t\t\tpending = void 0;\n\t\t\tr.resolve({\n\t\t\t\tvalue,\n\t\t\t\tdone: false\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tif (done) {\n\t\t\tconst r = pending;\n\t\t\tpending = void 0;\n\t\t\tif (endError) {\n\t\t\t\tconst err = new Error(endError.message);\n\t\t\t\terr.name = endError.name;\n\t\t\t\tr.reject(err);\n\t\t\t} else r.resolve({\n\t\t\t\tvalue: void 0,\n\t\t\t\tdone: true\n\t\t\t});\n\t\t}\n\t}\n\tfunction feedReadable() {\n\t\tif (!pullController) return;\n\t\twhile (queue.length > 0) {\n\t\t\tconst v = queue.shift();\n\t\t\ttry {\n\t\t\t\tpullController.enqueue(v);\n\t\t\t} catch {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (done && pullController) {\n\t\t\ttry {\n\t\t\t\tif (endError) {\n\t\t\t\t\tconst err = new Error(endError.message);\n\t\t\t\t\terr.name = endError.name;\n\t\t\t\t\tpullController.error(err);\n\t\t\t\t} else pullController.close();\n\t\t\t} catch {}\n\t\t\tpullController = void 0;\n\t\t}\n\t}\n\tfunction push(seq, chunk) {\n\t\tif (done || cancelled) return;\n\t\tif (seq <= lastSeenSeq) return;\n\t\tlastSeenSeq = seq;\n\t\tqueue.push(chunk);\n\t\tif (queue.length > highWaterMark) {\n\t\t\tconst overflow = queue.length - highWaterMark;\n\t\t\tqueue.splice(0, overflow);\n\t\t\toptions.onOverflow?.(overflow);\n\t\t}\n\t\tdrainNext();\n\t\tif (readableInstance) feedReadable();\n\t}\n\tfunction end(error) {\n\t\tif (done) return;\n\t\tdone = true;\n\t\tendError = error;\n\t\tdrainNext();\n\t\tif (readableInstance) feedReadable();\n\t}\n\tfunction cancel() {\n\t\tif (cancelled || done) return;\n\t\tcancelled = true;\n\t\toptions.onCancel?.();\n\t\tend(void 0);\n\t}\n\tfunction getReadable() {\n\t\tif (readableInstance) return readableInstance;\n\t\treadableInstance = new ReadableStream({\n\t\t\tstart(controller) {\n\t\t\t\tpullController = controller;\n\t\t\t\tfeedReadable();\n\t\t\t},\n\t\t\tcancel() {\n\t\t\t\tcancel();\n\t\t\t}\n\t\t});\n\t\treturn readableInstance;\n\t}\n\treturn {\n\t\tid,\n\t\tget cancelled() {\n\t\t\treturn cancelled;\n\t\t},\n\t\tget done() {\n\t\t\treturn done;\n\t\t},\n\t\tget lastSeenSeq() {\n\t\t\treturn lastSeenSeq;\n\t\t},\n\t\tget readable() {\n\t\t\treturn getReadable();\n\t\t},\n\t\tcancel,\n\t\t_push: push,\n\t\t_end: end,\n\t\t[Symbol.asyncIterator]() {\n\t\t\treturn {\n\t\t\t\tnext() {\n\t\t\t\t\tif (queue.length > 0) return Promise.resolve({\n\t\t\t\t\t\tvalue: queue.shift(),\n\t\t\t\t\t\tdone: false\n\t\t\t\t\t});\n\t\t\t\t\tif (done) {\n\t\t\t\t\t\tif (endError) {\n\t\t\t\t\t\t\tconst err = new Error(endError.message);\n\t\t\t\t\t\t\terr.name = endError.name;\n\t\t\t\t\t\t\treturn Promise.reject(err);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn Promise.resolve({\n\t\t\t\t\t\t\tvalue: void 0,\n\t\t\t\t\t\t\tdone: true\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\t\t\tpending = {\n\t\t\t\t\t\t\tresolve,\n\t\t\t\t\t\t\treject\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\treturn() {\n\t\t\t\t\tcancel();\n\t\t\t\t\treturn Promise.resolve({\n\t\t\t\t\t\tvalue: void 0,\n\t\t\t\t\t\tdone: true\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t};\n}\nfunction toErrorPayload(reason) {\n\tif (reason instanceof Error) return {\n\t\tname: reason.name || \"Error\",\n\t\tmessage: reason.message\n\t};\n\tif (typeof reason === \"string\") return {\n\t\tname: \"Error\",\n\t\tmessage: reason\n\t};\n\ttry {\n\t\treturn {\n\t\t\tname: \"Error\",\n\t\t\tmessage: JSON.stringify(reason)\n\t\t};\n\t} catch {\n\t\treturn {\n\t\t\tname: \"Error\",\n\t\t\tmessage: String(reason)\n\t\t};\n\t}\n}\n//#endregion\nexport { createStreamReader, createStreamSink };\n","//#region src/utils/agent-tool-name.ts\n/**\n* Maximum tool-name length several MCP clients enforce (the Anthropic API\n* pattern is `^[a-zA-Z0-9_-]{1,128}$`).\n*/\nconst MAX_TOOL_NAME_LENGTH = 128;\n/**\n* Derive the wire-safe agent tool name for an internal tool id.\n*\n* Devframe tool ids are colon-namespaced: `devframe:<area>:<fn>` for\n* built-ins, `devframes:plugin:<slug>:<fn>` for plugin RPCs, and hub\n* command ids for command-derived tools. MCP clients constrain tool names\n* to `^[a-zA-Z0-9_-]{1,128}$`, so the agent/MCP boundary derives the wire\n* name automatically: every run of characters outside `[a-zA-Z0-9_-]`\n* becomes a single `_`, truncated to 128 characters. Internal ids never\n* change; resolution back to the id happens at the boundary.\n*\n* ```\n* devframe:state:read → devframe_state_read\n* devframes:plugin:git:status → devframes_plugin_git_status\n* ```\n*\n* A plain string transform with no node dependency, so browser-side UIs\n* that display a tool's id (e.g. the inspect plugin's agent view) can\n* import it too and show the name a client actually calls.\n*/\nfunction toAgentToolName(id) {\n\treturn id.replace(/[^\\w-]+/g, \"_\").slice(0, MAX_TOOL_NAME_LENGTH);\n}\n//#endregion\nexport { toAgentToolName };\n","import { a as defineDiagnostics, i as createBirpc, n as argsToJsonSchema, o as DEVFRAME_EVENTS, r as resolveAgentSafety, t as toolInputToRpcArgs } from \"../tool-input-BAQXvvqL.mjs\";\nimport { t as hash } from \"../hash-DdPnc4k3.mjs\";\nimport { createEventEmitter } from \"../utils/events.mjs\";\nimport { withBase, withProtocol } from \"../utils/url.mjs\";\nimport { t as createSharedState } from \"../shared-state-eQVYHNqA.mjs\";\nimport { i as structuredCloneStringify, n as structuredCloneParse, t as structuredCloneDeserialize } from \"../structured-clone-CgtQ61SA.mjs\";\nimport { createStreamReader, createStreamSink } from \"../utils/streaming-channel.mjs\";\nimport { toAgentToolName } from \"../utils/agent-tool-name.mjs\";\n//#region src/constants.ts\n/** Devframe runtime routes and static output conventions. */\nconst DEVFRAME_CONNECTION_META_FILENAME = \"__connection.json\";\n/**\n* Global key holding the serializable connection prepared by\n* `setupDevframeConnection()`. External viewers can use this key to read the\n* connection from another JavaScript realm.\n*/\nconst DEVFRAME_CONNECTION_KEY = \"__DEVFRAME_CONNECTION__\";\n/**\n* Request header carrying the SSE session id on every RPC `POST`. The\n* server mints the id as the stream's first event (`event: session`);\n* the client echoes it here so the POST joins that stream's birpc\n* channel. Mirrors birpc's own SSE helpers for wire compatibility.\n*/\nconst DEVFRAME_SSE_SESSION_HEADER = \"x-birpc-session\";\nconst DEVFRAME_RPC_DUMP_MANIFEST_FILENAME = \"__rpc-dump/index.json\";\n/**\n* Shared-state key carrying the wire-service advertisements (package name →\n* `DevframeServiceMeta`). Written by the node services host; mirrored to\n* clients for feature-detection via `client.services`.\n*/\nconst DEVFRAME_SERVICES_STATE_KEY = \"devframe:services\";\n/**\n* Page-URL **fragment** parameter carrying a one-time authentication code (OTP)\n* for \"magic link\" auth. A host can print a link like\n* `<origin>/#devframe_otp=<code>`; the client reads the code, exchanges it for a\n* token, and strips the parameter from the URL. The code rides the fragment\n* (never the query string) so the browser never transmits it to the server,\n* keeping it out of access logs and `Referer` headers. See `buildOtpAuthUrl`\n* (node) and the `authenticateWithUrlOtp` / `consumeOtpFromUrl` client utilities\n* (or `connectDevframe`'s `otpParam`).\n*/\nconst DEVFRAME_OTP_URL_PARAM = \"devframe_otp\";\n/**\n* WS upgrade-URL query parameter carrying a previously-issued bearer token.\n* Set by `createWsRpcChannel` (browser transport) whenever `authToken` is\n* passed; read at connect time by a host's connect-time trust hook (see\n* `recipes/interactive-auth`'s `onConnect`) so a returning client can be\n* trusted before its own `anonymous:devframe:auth` handshake call arrives.\n*/\nconst DEVFRAME_AUTH_TOKEN_QUERY_PARAM = \"devframe_auth_token\";\n/** External viewer origin requested during connection bootstrap. */\nconst DEVFRAME_VIEWER_ORIGIN_QUERY_PARAM = \"devframe_viewer_origin\";\n/** Token that authorizes an external viewer origin registration. */\nconst DEVFRAME_VIEWER_ORIGIN_TOKEN_QUERY_PARAM = \"devframe_viewer_origin_token\";\nDEVFRAME_EVENTS.postMessage.remoteAssetsError;\n//#endregion\n//#region src/rpc/cache.ts\n/**\n* @experimental API is expected to change.\n*/\nvar RpcCacheManager = class {\n\tcacheMap = /* @__PURE__ */ new Map();\n\toptions;\n\tkeySerializer;\n\tconstructor(options) {\n\t\tthis.options = options;\n\t\tthis.keySerializer = options.keySerializer || ((args) => hash(args));\n\t}\n\tupdateOptions(options) {\n\t\tthis.options = {\n\t\t\t...this.options,\n\t\t\t...options\n\t\t};\n\t}\n\tcached(m, a) {\n\t\tconst methodCache = this.cacheMap.get(m);\n\t\tif (methodCache) return methodCache.get(this.keySerializer(a));\n\t}\n\thas(m, a) {\n\t\treturn this.cacheMap.get(m)?.has(this.keySerializer(a)) ?? false;\n\t}\n\tapply(req, res) {\n\t\tconst methodCache = this.cacheMap.get(req.m) || /* @__PURE__ */ new Map();\n\t\tmethodCache.set(this.keySerializer(req.a), res);\n\t\tthis.cacheMap.set(req.m, methodCache);\n\t}\n\tvalidate(m) {\n\t\treturn this.options.functions.includes(m);\n\t}\n\tclear(fn) {\n\t\tif (fn) this.cacheMap.delete(fn);\n\t\telse this.cacheMap.clear();\n\t}\n};\n//#endregion\n//#region src/rpc/diagnostics.ts\nconst diagnostics = defineDiagnostics({\n\tdocsBase: \"https://devfra.me/errors\",\n\tcodes: {\n\t\tDF0019: {\n\t\t\twhy: (p) => `RPC function \"${p.name}\" has \\`agent\\` set but \\`jsonSerializable\\` is \\`false\\`; MCP requires JSON-serializable data.`,\n\t\t\tfix: \"Remove `jsonSerializable: false`, or remove `agent` to keep it RPC-only.\"\n\t\t},\n\t\tDF0020: {\n\t\t\twhy: (p) => `RPC function \"${p.name}\" declares \\`jsonSerializable: true\\` but the value at \"${p.path}\" is a ${p.type}.`,\n\t\t\tfix: \"Either drop `jsonSerializable: true` (falls back to structured-clone) or change the value to a JSON-safe shape.\"\n\t\t},\n\t\tDF0021: {\n\t\t\twhy: (p) => `RPC function \"${p.name}\" is already registered`,\n\t\t\tfix: \"Use the `force` parameter to overwrite an existing registration.\"\n\t\t},\n\t\tDF0022: { why: (p) => `RPC function \"${p.name}\" is not registered. Use register() to add new functions.` },\n\t\tDF0023: { why: (p) => `RPC function \"${p.name}\" is not registered` },\n\t\tDF0024: { why: (p) => `Either handler or setup function must be provided for RPC function \"${p.name}\"` },\n\t\tDF0025: { why: (p) => `Function \"${p.name}\" not found in dump store` },\n\t\tDF0026: { why: (p) => `No dump match for \"${p.name}\" with args: ${p.args}` },\n\t\tDF0027: { why: (p) => `Function \"${p.name}\" with type \"${p.type}\" cannot have dump configuration. Only \"static\" and \"query\" types support dumps.` },\n\t\tDF0028: {\n\t\t\twhy: (p) => `Function \"${p.name}\" with type \"${p.type}\" cannot use \\`snapshot: true\\`. Only \"query\" functions support this sugar; \"static\" functions have equivalent default behavior already.`,\n\t\t\tfix: \"Remove `snapshot: true`, or change the function type to `query`.\"\n\t\t},\n\t\tDF0043: {\n\t\t\twhy: (p) => `RPC function \"${p.name}\" received an invalid argument at position ${p.index}: ${p.issues}`,\n\t\t\tfix: \"Pass a value that satisfies the `args` schema declared for this function.\"\n\t\t},\n\t\tDF0044: {\n\t\t\twhy: (p) => `RPC function \"${p.name}\" returned a value that failed its \\`returns\\` schema: ${p.issues}`,\n\t\t\tfix: \"Make the handler return a value that satisfies the `returns` schema, or relax the schema.\"\n\t\t}\n\t}\n});\n//#endregion\n//#region src/rpc/agent-json-serialization.ts\n/**\n* Prevents using a coding-agent-exposed RPC function that is explicitly\n* marked as non-serializable, and marks these functions as serializable by\n* default.\n*\n* @internal\n*/\nfunction ensureAgentJsonSerializable(fnDef) {\n\tif (fnDef.agent && fnDef.jsonSerializable === false) throw diagnostics.DF0019({ name: fnDef.name });\n\tif (fnDef.agent && !fnDef.jsonSerializable) fnDef.jsonSerializable = true;\n}\n//#endregion\n//#region src/rpc/validate-io.ts\n/**\n* Run a single [Standard Schema](https://standardschema.dev) validator,\n* awaiting the result when the validator is asynchronous.\n*/\nasync function runStandardSchema(schema, value) {\n\tconst result = schema[\"~standard\"].validate(value);\n\treturn result instanceof Promise ? await result : result;\n}\n/**\n* Render Standard Schema issues into a single human-readable line for a\n* diagnostic message, prefixing each with its dotted path when present.\n*/\nfunction formatIssues(issues) {\n\treturn issues.map((issue) => {\n\t\tconst path = issue.path?.map((segment) => typeof segment === \"object\" ? segment.key : segment).join(\".\");\n\t\treturn path ? `${path}: ${issue.message}` : issue.message;\n\t}).join(\"; \");\n}\n/**\n* Validate positional arguments against their declared schemas. Only\n* indices with a schema are checked; extra arguments pass through\n* untouched. Throws `DF0038` on the first failing argument.\n*\n* Validation guards the payload without rewriting it: the original values\n* are handed to the handler unchanged, so a schema that describes a subset\n* of an object never silently strips the sender's extra fields (and any\n* declared transforms stay a purely type-level concern).\n*\n* @internal\n*/\nasync function validateRpcArgs(name, argsSchema, args) {\n\tconst original = args.slice();\n\tif (!argsSchema || argsSchema.length === 0) return original;\n\tfor (let index = 0; index < argsSchema.length; index++) {\n\t\tconst schema = argsSchema[index];\n\t\tif (!schema) continue;\n\t\tconst result = await runStandardSchema(schema, args[index]);\n\t\tif (result.issues) throw diagnostics.DF0043({\n\t\t\tname,\n\t\t\tindex,\n\t\t\tissues: formatIssues(result.issues)\n\t\t});\n\t}\n\treturn original;\n}\n/**\n* Validate a handler's resolved return value against its declared schema.\n* Throws `DF0039` when the value fails the schema, otherwise returns the\n* original value unchanged (guard-only, never rewriting the payload; see\n* {@link validateRpcArgs}). Passes through when no return schema is set.\n*\n* @internal\n*/\nasync function validateRpcReturn(name, returnSchema, value) {\n\tif (!returnSchema) return value;\n\tconst result = await runStandardSchema(returnSchema, value);\n\tif (result.issues) throw diagnostics.DF0044({\n\t\tname,\n\t\tissues: formatIssues(result.issues)\n\t});\n\treturn value;\n}\n//#endregion\n//#region src/rpc/handler.ts\nasync function getRpcResolvedSetupResult(definition, context) {\n\tif (!definition.setup) return {};\n\tif (typeof context === \"object\" && context !== null) {\n\t\tdefinition.__cache ??= /* @__PURE__ */ new WeakMap();\n\t\tconst cache = definition.__cache;\n\t\tlet promise = cache.get(context);\n\t\tif (!promise) {\n\t\t\tpromise = Promise.resolve(definition.setup(context));\n\t\t\tpromise.catch(() => {\n\t\t\t\tif (cache.get(context) === promise) cache.delete(context);\n\t\t\t});\n\t\t\tcache.set(context, promise);\n\t\t}\n\t\treturn await promise;\n\t}\n\tif (!definition.__promise) {\n\t\tconst promise = Promise.resolve(definition.setup(context));\n\t\tpromise.catch(() => {\n\t\t\tif (definition.__promise === promise) definition.__promise = void 0;\n\t\t});\n\t\tdefinition.__promise = promise;\n\t}\n\treturn await definition.__promise;\n}\nasync function getRpcHandler(definition, context) {\n\tlet handler = definition.handler;\n\tif (!handler) {\n\t\tconst result = await getRpcResolvedSetupResult(definition, context);\n\t\tif (!result.handler) throw diagnostics.DF0024({ name: definition.name });\n\t\thandler = result.handler;\n\t}\n\tconst argsSchema = definition.args;\n\tconst returnSchema = definition.returns;\n\tif (!argsSchema && !returnSchema) return handler;\n\tconst inner = handler;\n\tconst validating = async (...args) => {\n\t\tconst validatedArgs = await validateRpcArgs(definition.name, argsSchema, args);\n\t\tconst output = await inner(...validatedArgs);\n\t\treturn await validateRpcReturn(definition.name, returnSchema, output);\n\t};\n\treturn validating;\n}\n//#endregion\n//#region src/rpc/collector.ts\nvar RpcFunctionsCollectorBase = class {\n\tcontext;\n\tdefinitions = /* @__PURE__ */ new Map();\n\tfunctions;\n\t_onChanged = [];\n\tconstructor(context) {\n\t\tthis.context = context;\n\t\tconst definitions = this.definitions;\n\t\tconst self = this;\n\t\tthis.functions = new Proxy({}, {\n\t\t\tget(_, prop) {\n\t\t\t\tconst definition = definitions.get(prop);\n\t\t\t\tif (!definition) return void 0;\n\t\t\t\treturn getRpcHandler(definition, self.context);\n\t\t\t},\n\t\t\thas(_, prop) {\n\t\t\t\treturn definitions.has(prop);\n\t\t\t},\n\t\t\tgetOwnPropertyDescriptor(_, prop) {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: definitions.get(prop)?.handler,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\tenumerable: true\n\t\t\t\t};\n\t\t\t},\n\t\t\townKeys() {\n\t\t\t\treturn Array.from(definitions.keys());\n\t\t\t}\n\t\t});\n\t}\n\tregister(fnDef, force = false) {\n\t\tif (this.definitions.has(fnDef.name) && !force) throw diagnostics.DF0021({ name: fnDef.name });\n\t\tensureAgentJsonSerializable(fnDef);\n\t\tthis.definitions.set(fnDef.name, fnDef);\n\t\tthis._onChanged.forEach((cb) => cb(fnDef.name));\n\t}\n\tupdate(fn, force = false) {\n\t\tif (!this.definitions.has(fn.name) && !force) throw diagnostics.DF0022({ name: fn.name });\n\t\tensureAgentJsonSerializable(fn);\n\t\tthis.definitions.set(fn.name, fn);\n\t\tthis._onChanged.forEach((cb) => cb(fn.name));\n\t}\n\tonChanged(fn) {\n\t\tthis._onChanged.push(fn);\n\t\treturn () => {\n\t\t\tconst index = this._onChanged.indexOf(fn);\n\t\t\tif (index !== -1) this._onChanged.splice(index, 1);\n\t\t};\n\t}\n\tasync getHandler(name) {\n\t\treturn await getRpcHandler(this.definitions.get(name), this.context);\n\t}\n\tgetSchema(name) {\n\t\tconst definition = this.definitions.get(name);\n\t\tif (!definition) throw diagnostics.DF0023({ name: String(name) });\n\t\treturn {\n\t\t\targs: definition.args,\n\t\t\treturns: definition.returns\n\t\t};\n\t}\n\thas(name) {\n\t\treturn this.definitions.has(name);\n\t}\n\tget(name) {\n\t\treturn this.definitions.get(name);\n\t}\n\tlist() {\n\t\treturn Array.from(this.definitions.keys());\n\t}\n};\n//#endregion\n//#region src/rpc/serialization.ts\n/**\n* `JSON.stringify` with a single-pass strict replacer.\n*\n* Throws `DF0020` synchronously when the value contains a type JSON\n* cannot round-trip losslessly: `Map`, `Set`, `Date`, `BigInt`, class\n* instances, or `undefined` inside an array (silently becomes `null`).\n*\n* Native pass-throughs (no extra work needed):\n* - circular references: `JSON.stringify` raises `TypeError`.\n* - `BigInt` at top level: caught here for a friendlier error path.\n*\n* Lenient cases (allowed without throwing):\n* - `undefined` as an object property: legitimate optional field;\n* JSON.stringify just omits it.\n* - `undefined` at the root: legitimate \"action returned nothing\".\n* - `Symbol` / `Function` values: semantically \"drop me\" in JSON.\n*\n* `fnName` is used only for the diagnostic message; pass the RPC\n* function name when calling from a wire serializer / dump writer so\n* the error points at the offending function.\n*/\nfunction strictJsonStringify(value, fnName = \"\") {\n\treturn JSON.stringify(value, function strictReplacer(key, val) {\n\t\tconst holder = this;\n\t\tconst original = holder != null ? holder[key] : val;\n\t\tif (original === void 0) {\n\t\t\tif (Array.isArray(holder)) throw nonJsonAt(fnName, \"undefined\", holder, key);\n\t\t\treturn val;\n\t\t}\n\t\tif (original !== null) assertJsonSafe(original, holder, key, fnName);\n\t\treturn val;\n\t});\n}\n/** Throw `DF0020` when `original` is a type JSON can't round-trip losslessly. */\nfunction assertJsonSafe(original, holder, key, fnName) {\n\tif (typeof original === \"bigint\") throw nonJsonAt(fnName, \"BigInt\", holder, key);\n\tif (typeof original !== \"object\") return;\n\tif (original instanceof Map) throw nonJsonAt(fnName, \"Map\", holder, key);\n\tif (original instanceof Set) throw nonJsonAt(fnName, \"Set\", holder, key);\n\tif (original instanceof Date) throw nonJsonAt(fnName, \"Date\", holder, key);\n\tif (Array.isArray(original)) return;\n\tconst proto = Object.getPrototypeOf(original);\n\tif (proto !== null && proto !== Object.prototype) throw nonJsonAt(fnName, original.constructor?.name ?? \"class instance\", holder, key);\n}\nfunction nonJsonAt(fnName, type, parent, key) {\n\tconst path = formatPath(parent, key);\n\treturn diagnostics.DF0020({\n\t\tname: fnName || \"<anonymous>\",\n\t\ttype,\n\t\tpath\n\t});\n}\nfunction formatPath(parent, key) {\n\tif (Array.isArray(parent)) return `[${key}]`;\n\tif (key === \"\") return \"<root>\";\n\treturn key;\n}\n//#endregion\n//#region src/client/connection-storage.ts\nconst CONNECTION_META_KEY = \"__DEVFRAME_CONNECTION_META__\";\nconst CONNECTION_AUTH_TOKEN_KEY = \"__DEVFRAME_CONNECTION_AUTH_TOKEN__\";\nfunction readFromWindows(key) {\n\tconst getters = [\n\t\t() => window?.[key],\n\t\t() => globalThis?.[key],\n\t\t() => parent.window?.[key]\n\t];\n\tfor (const getter of getters) try {\n\t\tconst value = getter();\n\t\tif (value) return value;\n\t} catch {}\n}\nfunction readStoredConnection() {\n\treturn readFromWindows(DEVFRAME_CONNECTION_KEY);\n}\nfunction readStoredConnectionMeta() {\n\treturn readFromWindows(CONNECTION_META_KEY);\n}\nfunction readStoredAuthToken(userAuthToken) {\n\tif (userAuthToken) return userAuthToken;\n\ttry {\n\t\tconst token = localStorage.getItem(CONNECTION_AUTH_TOKEN_KEY);\n\t\tif (token) return token;\n\t} catch {}\n\treturn readFromWindows(CONNECTION_AUTH_TOKEN_KEY);\n}\nfunction storeConnection(connection) {\n\tglobalThis[DEVFRAME_CONNECTION_KEY] = connection;\n\tglobalThis[CONNECTION_META_KEY] = {\n\t\t...connection.connectionMeta,\n\t\tbaseUrl: connection.metaBaseUrl\n\t};\n\tif (connection.authToken) storeAuthToken(connection.authToken);\n}\nfunction storeAuthToken(token) {\n\ttry {\n\t\tlocalStorage.setItem(CONNECTION_AUTH_TOKEN_KEY, token);\n\t} catch {}\n\tglobalThis[CONNECTION_AUTH_TOKEN_KEY] = token;\n\tconst connection = readStoredConnection();\n\tif (connection) globalThis[DEVFRAME_CONNECTION_KEY] = {\n\t\t...connection,\n\t\tauthToken: token\n\t};\n}\n//#endregion\n//#region src/client/connection.ts\n/**\n* Allow an external viewer to connect by registering its browser origin with\n* the Devframe host. Returns `false` if the host did not provide an origin\n* registration token.\n*/\nasync function registerDevframeViewerOrigin(connection, origin = globalThis.location?.origin) {\n\tconst token = connection.connectionMeta.viewerOriginToken;\n\tif (!token || !origin) return false;\n\tconst url = new URL(connection.metaBaseUrl);\n\turl.searchParams.set(DEVFRAME_VIEWER_ORIGIN_QUERY_PARAM, origin);\n\turl.searchParams.set(DEVFRAME_VIEWER_ORIGIN_TOKEN_QUERY_PARAM, token);\n\tconst response = await fetch(url, { cache: \"no-store\" });\n\tif (!response.ok) throw new Error(`Failed to register external viewer origin (${response.status}).`);\n\treturn true;\n}\nfunction resolveMetaBaseUrl(baseURL) {\n\tconst metaPath = withBase(DEVFRAME_CONNECTION_META_FILENAME, baseURL);\n\ttry {\n\t\treturn new URL(metaPath, globalThis.location?.href).href;\n\t} catch {\n\t\treturn metaPath;\n\t}\n}\nfunction withAuthToken(connection, authToken) {\n\treturn authToken && authToken !== connection.authToken ? {\n\t\t...connection,\n\t\tauthToken\n\t} : connection;\n}\n/**\n* Return connection information previously prepared in this window or an\n* accessible parent window.\n*/\nfunction getDevframeConnection() {\n\tconst connection = readStoredConnection();\n\tif (connection) return withAuthToken(connection, readStoredAuthToken() ?? connection.authToken ?? connection.connectionMeta.authToken);\n\tconst connectionMeta = readStoredConnectionMeta();\n\tif (!connectionMeta) return void 0;\n\treturn {\n\t\tconnectionMeta,\n\t\tmetaBaseUrl: connectionMeta.baseUrl ?? resolveMetaBaseUrl(\"./\"),\n\t\tauthToken: readStoredAuthToken(connectionMeta.authToken)\n\t};\n}\n/**\n* Prepare the connection information shared by a devframe client and external\n* viewers. Reuses an explicit or previously prepared connection before\n* fetching `__connection.json` from the configured base URLs.\n*/\nasync function setupDevframeConnection(options = {}) {\n\tif (options.connection) {\n\t\tconst connection = withAuthToken(options.connection, readStoredAuthToken(options.authToken ?? options.connection.authToken ?? options.connection.connectionMeta.authToken));\n\t\tstoreConnection(connection);\n\t\treturn connection;\n\t}\n\tconst bases = Array.isArray(options.baseURL) ? options.baseURL : [options.baseURL ?? \"./\"];\n\tif (options.connectionMeta) {\n\t\tconst connection = {\n\t\t\tconnectionMeta: options.connectionMeta,\n\t\t\t/**\n\t\t\t* Preserve the established connectionMeta behavior: an explicitly\n\t\t\t* supplied descriptor resolves from the caller's explicit base.\n\t\t\t*/\n\t\t\tmetaBaseUrl: resolveMetaBaseUrl(bases[0] ?? \"./\"),\n\t\t\tauthToken: readStoredAuthToken(options.authToken ?? options.connectionMeta.authToken)\n\t\t};\n\t\tstoreConnection(connection);\n\t\treturn connection;\n\t}\n\tconst existing = getDevframeConnection();\n\tif (existing) {\n\t\tconst connection = withAuthToken(existing, readStoredAuthToken(options.authToken ?? existing.authToken ?? existing.connectionMeta.authToken));\n\t\tstoreConnection(connection);\n\t\treturn connection;\n\t}\n\tconst errors = [];\n\tfor (const base of bases) {\n\t\tconst metaPath = withBase(DEVFRAME_CONNECTION_META_FILENAME, base);\n\t\tconst metaUrl = resolveMetaBaseUrl(base);\n\t\ttry {\n\t\t\tconst response = await fetch(metaPath);\n\t\t\tif (!response.ok) throw new Error(`Failed to fetch connection meta from ${metaUrl}: ${response.status}`);\n\t\t\tconst connectionMeta = await response.json();\n\t\t\tconst loadedFrom = response.url || metaUrl;\n\t\t\tconst connection = {\n\t\t\t\tconnectionMeta,\n\t\t\t\t/**\n\t\t\t\t* A served `baseUrl` re-points relative resolution (RPC dump shards,\n\t\t\t\t* transport paths) at the meta that owns them: a static hub build's\n\t\t\t\t* per-frame meta directs each frame SPA at the hub's own dump.\n\t\t\t\t*/\n\t\t\t\tmetaBaseUrl: connectionMeta.baseUrl ? new URL(connectionMeta.baseUrl, loadedFrom).href : loadedFrom,\n\t\t\t\tauthToken: readStoredAuthToken(options.authToken ?? connectionMeta.authToken)\n\t\t\t};\n\t\t\tstoreConnection(connection);\n\t\t\treturn connection;\n\t\t} catch (error) {\n\t\t\terrors.push(error);\n\t\t}\n\t}\n\tthrow new Error(`Failed to get connection meta from ${bases.join(\", \")}`, { cause: errors });\n}\n/**\n* The error rejected from `rpc.call(...)` (and carried on\n* `rpc.connectionError`) when a call cannot be served because the connection is\n* down, the client is unauthorized, or a call timed out. Its `kind` lets a UI\n* tailor its message and recovery affordance without string-matching.\n*/\nvar DevframeConnectionError = class extends Error {\n\tname = \"DevframeConnectionError\";\n\tkind;\n\tconstructor(kind, message, options) {\n\t\tsuper(message, options);\n\t\tthis.kind = kind;\n\t}\n};\n/**\n* Whether a status means calls can be attempted. `connecting` counts because\n* the transport queues outgoing calls until the socket opens; the terminal\n* failure states short-circuit calls so a stuck socket never hangs the UI.\n*/\nfunction isCallableStatus(status) {\n\treturn status === \"connected\" || status === \"connecting\";\n}\n//#endregion\n//#region src/client/otp.ts\n/**\n* Read a one-time authentication code (OTP) from the current page URL's\n* fragment, without side effects. Returns `undefined` when the parameter is\n* absent.\n*/\nfunction readOtpFromUrl(param = DEVFRAME_OTP_URL_PARAM) {\n\ttry {\n\t\tconst hash = globalThis.location?.hash?.replace(/^#/, \"\") ?? \"\";\n\t\treturn new URLSearchParams(hash).get(param) || void 0;\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction stripParamFromUrl(param) {\n\ttry {\n\t\tconst url = new URL(globalThis.location.href);\n\t\tconst fragment = new URLSearchParams(url.hash.replace(/^#/, \"\"));\n\t\tif (!fragment.has(param)) return;\n\t\tfragment.delete(param);\n\t\turl.hash = fragment.toString();\n\t\tglobalThis.history?.replaceState(globalThis.history.state, \"\", url.href);\n\t} catch {}\n}\n/**\n* Read the one-time code from the page URL fragment and remove it from the\n* address bar (and the current history entry), so the single-use code isn't\n* left in the URL, browser history, or a `Referer`. Returns the code, or\n* `undefined` when absent.\n*/\nfunction consumeOtpFromUrl(param = DEVFRAME_OTP_URL_PARAM) {\n\tconst code = readOtpFromUrl(param);\n\tif (code) stripParamFromUrl(param);\n\treturn code;\n}\n/**\n* Consume a one-time code from the page URL (see {@link consumeOtpFromUrl}) and\n* exchange it for a token via the client. Resolves `true` when the client is\n* authenticated (already trusted, or the exchange succeeded), and `false` when\n* no code is present or the exchange failed.\n*\n* Higher-level integrations (e.g. Vite DevTools) that want to drive their own\n* authentication UI can disable `connectDevframe`'s built-in handling with\n* `otpParam: false` and call this (or {@link consumeOtpFromUrl}) themselves.\n*/\nasync function authenticateWithUrlOtp(rpc, options = {}) {\n\tconst code = consumeOtpFromUrl(options.param ?? \"devframe_otp\");\n\tif (!code) return false;\n\tif (rpc.isTrusted) return true;\n\treturn rpc.requestTrustWithCode(code);\n}\n//#endregion\n//#region src/client/rpc-services.ts\n/** @internal */\nfunction createDevframeServicesClient(rpc) {\n\tlet current = {};\n\tconst handles = /* @__PURE__ */ new WeakMap();\n\tlet statePromise;\n\tconst state = () => {\n\t\tstatePromise ??= rpc.sharedState.get(DEVFRAME_SERVICES_STATE_KEY, { initialValue: {} }).then((shared) => {\n\t\t\tcurrent = shared.value();\n\t\t\tshared.on(\"updated\", (value) => {\n\t\t\t\tcurrent = value;\n\t\t\t});\n\t\t\treturn shared;\n\t\t});\n\t\treturn statePromise;\n\t};\n\tstate();\n\treturn {\n\t\tstate,\n\t\thas: (pkg) => pkg in current,\n\t\tkeys: () => Object.keys(current),\n\t\tget: (pkg) => {\n\t\t\tconst entry = current[pkg];\n\t\t\tif (!entry) return void 0;\n\t\t\tlet handle = handles.get(entry);\n\t\t\tif (!handle) {\n\t\t\t\thandle = {\n\t\t\t\t\t...entry,\n\t\t\t\t\trpc: rpc.scope(entry.scope).rpc\n\t\t\t\t};\n\t\t\t\thandles.set(entry, handle);\n\t\t\t}\n\t\t\treturn handle;\n\t\t}\n\t};\n}\n//#endregion\n//#region src/client/rpc-shared-state.ts\nfunction createRpcSharedStateClientHost(rpc) {\n\tconst sharedState = /* @__PURE__ */ new Map();\n\tconst stateDisposers = /* @__PURE__ */ new Map();\n\tconst initialValues = /* @__PURE__ */ new Map();\n\tconst keyAddedListeners = /* @__PURE__ */ new Set();\n\tconst isStaticBackend = rpc.connectionMeta.backend === \"static\";\n\tfunction mergeWithInitialValue(key, serverState) {\n\t\tconst initial = initialValues.get(key);\n\t\tif (initial && typeof initial === \"object\" && !Array.isArray(initial) && typeof serverState === \"object\" && !Array.isArray(serverState)) return {\n\t\t\t...initial,\n\t\t\t...serverState\n\t\t};\n\t\treturn serverState;\n\t}\n\trpc.client.register({\n\t\tname: DEVFRAME_EVENTS.broadcast.clientStateUpdated,\n\t\ttype: \"event\",\n\t\thandler: (key, fullState, syncId) => {\n\t\t\tconst state = sharedState.get(key);\n\t\t\tif (!state || state.syncIds.has(syncId)) return;\n\t\t\tstate.mutate(() => mergeWithInitialValue(key, fullState), syncId);\n\t\t}\n\t});\n\trpc.client.register({\n\t\tname: DEVFRAME_EVENTS.broadcast.clientStatePatch,\n\t\ttype: \"event\",\n\t\thandler: (key, patches, syncId) => {\n\t\t\tconst state = sharedState.get(key);\n\t\t\tif (!state || state.syncIds.has(syncId)) return;\n\t\t\tstate.patch(patches, syncId);\n\t\t}\n\t});\n\tfunction registerSharedState(key, state) {\n\t\tconst offs = [];\n\t\toffs.push(state.on(\"updated\", (fullState, patches, syncId) => {\n\t\t\tif (isStaticBackend) return;\n\t\t\tif (patches) rpc.callEvent(\"devframe:rpc:server-state:patch\", key, patches, syncId);\n\t\t\telse rpc.callEvent(\"devframe:rpc:server-state:set\", key, fullState, syncId);\n\t\t}));\n\t\treturn () => {\n\t\t\tfor (const off of offs) off();\n\t\t};\n\t}\n\treturn {\n\t\tkeys: () => Array.from(sharedState.keys()),\n\t\tonKeyAdded(fn) {\n\t\t\tkeyAddedListeners.add(fn);\n\t\t\treturn () => {\n\t\t\t\tkeyAddedListeners.delete(fn);\n\t\t\t};\n\t\t},\n\t\tdelete(key) {\n\t\t\tconst dispose = stateDisposers.get(key);\n\t\t\tstateDisposers.delete(key);\n\t\t\tconst existed = sharedState.delete(key);\n\t\t\tinitialValues.delete(key);\n\t\t\tdispose?.();\n\t\t\treturn existed;\n\t\t},\n\t\tget: async (key, options) => {\n\t\t\tif (options?.initialValue !== void 0) initialValues.set(key, options.initialValue);\n\t\t\tif (sharedState.has(key)) return sharedState.get(key);\n\t\t\tconst state = createSharedState({\n\t\t\t\tinitialValue: options?.initialValue,\n\t\t\t\tenablePatches: false\n\t\t\t});\n\t\t\tasync function initSharedState() {\n\t\t\t\tif (!isStaticBackend) rpc.callEvent(\"devframe:rpc:server-state:subscribe\", key);\n\t\t\t\tif (options?.initialValue !== void 0) {\n\t\t\t\t\tsharedState.set(key, state);\n\t\t\t\t\tfor (const fn of keyAddedListeners) fn(key);\n\t\t\t\t\trpc.call(\"devframe:rpc:server-state:get\", key).then((serverState) => {\n\t\t\t\t\t\tif (serverState !== void 0) state.mutate(() => mergeWithInitialValue(key, serverState));\n\t\t\t\t\t}).catch((error) => {\n\t\t\t\t\t\tconsole.error(\"Error getting server state\", error);\n\t\t\t\t\t});\n\t\t\t\t\tstateDisposers.set(key, registerSharedState(key, state));\n\t\t\t\t\treturn state;\n\t\t\t\t} else {\n\t\t\t\t\tconst serverValue = await rpc.call(\"devframe:rpc:server-state:get\", key);\n\t\t\t\t\tstate.mutate(() => mergeWithInitialValue(key, serverValue));\n\t\t\t\t\tsharedState.set(key, state);\n\t\t\t\t\tfor (const fn of keyAddedListeners) fn(key);\n\t\t\t\t\tstateDisposers.set(key, registerSharedState(key, state));\n\t\t\t\t\treturn state;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn new Promise((resolve) => {\n\t\t\t\tif (!rpc.isTrusted) {\n\t\t\t\t\tresolve(state);\n\t\t\t\t\tlet initialized = false;\n\t\t\t\t\trpc.events.on(DEVFRAME_EVENTS.client.isTrustedUpdated, (isTrusted) => {\n\t\t\t\t\t\tif (isTrusted && !initialized) {\n\t\t\t\t\t\t\tinitialized = true;\n\t\t\t\t\t\t\tinitSharedState();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else initSharedState().then(resolve);\n\t\t\t});\n\t\t}\n\t};\n}\n//#endregion\n//#region src/rpc/wire-codec.ts\nconst EMPTY_WIRE_DEFS = /* @__PURE__ */ new Map();\n/**\n* Build the per-connection wire codec every live transport (WS server, WS\n* client, SSE server, SSE client) shares: per-method dispatch between strict\n* JSON (methods declared `jsonSerializable: true`) and `s:`-prefixed\n* structured-clone (everything else, including all error envelopes), with a\n* request-id → method map so a response independently picks the same\n* encoder as its request. One codec per connection; request-id spaces\n* don't collide across connections.\n*\n* @internal\n*/\nfunction createRpcWireCodec(definitions = EMPTY_WIRE_DEFS) {\n\tconst pendingRequestMethods = /* @__PURE__ */ new Map();\n\treturn {\n\t\tserialize: (msg) => {\n\t\t\tlet method;\n\t\t\tif (msg.t === \"q\") method = msg.m;\n\t\t\telse {\n\t\t\t\tmethod = pendingRequestMethods.get(msg.i);\n\t\t\t\tpendingRequestMethods.delete(msg.i);\n\t\t\t}\n\t\t\tif (!(msg.t === \"s\" && \"e\" in msg) && !!method && definitions.get(method)?.jsonSerializable === true) return strictJsonStringify(msg, method ?? \"\");\n\t\t\treturn `s:${structuredCloneStringify(msg)}`;\n\t\t},\n\t\tdeserialize: (raw) => {\n\t\t\tconst msg = raw.startsWith(\"s:\") ? structuredCloneParse(raw.slice(2)) : JSON.parse(raw);\n\t\t\tif (msg.t === \"q\" && msg.i && msg.m) pendingRequestMethods.set(msg.i, msg.m);\n\t\t\treturn msg;\n\t\t}\n\t};\n}\n//#endregion\n//#region src/rpc/transports/sse-client.ts\nfunction NOOP$1() {}\n/** Split the next complete SSE frame (up to a blank line) off the buffer. */\nfunction takeFrame(buffer) {\n\tconst boundary = buffer.search(/\\n\\n|\\r\\n\\r\\n/);\n\tif (boundary < 0) return void 0;\n\treturn {\n\t\tframe: buffer.slice(0, boundary),\n\t\trest: buffer.slice(boundary + (buffer[boundary] === \"\\r\" ? 4 : 2))\n\t};\n}\n/** Parse one SSE frame's lines into its event name and data lines. */\nfunction parseFrame(frame) {\n\tlet event = \"message\";\n\tconst data = [];\n\tfor (const rawLine of frame.split(/\\r?\\n/)) {\n\t\tif (rawLine.startsWith(\":\")) continue;\n\t\tif (rawLine.startsWith(\"event:\")) event = rawLine.slice(6).trimStart();\n\t\telse if (rawLine.startsWith(\"data:\")) data.push(rawLine.slice(5).replace(/^ /, \"\"));\n\t}\n\treturn {\n\t\tevent,\n\t\tdata\n\t};\n}\n/**\n* Build a birpc `ChannelOptions` object backed by an SSE stream (server →\n* client) and HTTP `POST` (client → server): the WebSocket-free counterpart\n* to `createWsRpcChannel`, wire-compatible with `attachSseRpcTransport`.\n*\n* The stream is consumed via `fetch` streaming (not `EventSource`), so it\n* works in browsers and server runtimes alike. The server's first frame\n* (`event: session`) carries the session id; every `POST` echoes it in the\n* `x-birpc-session` header. A response to a client-initiated request comes\n* back in the `POST`'s own body and is re-injected into the channel; a\n* dropped stream terminates the channel; there is no reconnect, matching\n* the WS channel's closed-is-done semantics.\n*/\nfunction createSseRpcChannel(options) {\n\tconst { onConnected = NOOP$1, onError = NOOP$1, onDisconnected = NOOP$1, definitions, fetch: fetchImpl = globalThis.fetch.bind(globalThis) } = options;\n\tlet url = options.url;\n\tif (options.authToken) url = `${url}${url.includes(\"?\") ? \"&\" : \"?\"}${DEVFRAME_AUTH_TOKEN_QUERY_PARAM}=${encodeURIComponent(options.authToken)}`;\n\tconst codec = createRpcWireCodec(definitions);\n\tconst abort = new AbortController();\n\tlet closed = false;\n\tlet onMessage;\n\tlet activeReader;\n\tlet resolveSession;\n\tlet rejectSession;\n\tconst sessionReady = new Promise((resolve, reject) => {\n\t\tresolveSession = resolve;\n\t\trejectSession = reject;\n\t});\n\tsessionReady.catch(() => {});\n\tfunction fail(error) {\n\t\tif (closed) return;\n\t\tclosed = true;\n\t\trejectSession(error);\n\t\tonError(error);\n\t\tonDisconnected();\n\t}\n\tfunction end() {\n\t\tif (closed) return;\n\t\tclosed = true;\n\t\trejectSession(/* @__PURE__ */ new Error(\"Devframe SSE stream closed\"));\n\t\tonDisconnected();\n\t}\n\tfunction dispatch(event, data) {\n\t\tif (event === \"session\") {\n\t\t\tresolveSession(data);\n\t\t\tonConnected();\n\t\t\treturn;\n\t\t}\n\t\tonMessage?.(data);\n\t}\n\t/** Parse the SSE byte stream frame by frame and dispatch each event. */\n\tasync function consume(stream) {\n\t\tconst reader = stream.getReader();\n\t\tactiveReader = reader;\n\t\tconst decoder = new TextDecoder();\n\t\tlet buffer = \"\";\n\t\tfor (;;) {\n\t\t\tconst { done, value } = await reader.read();\n\t\t\tif (done) break;\n\t\t\tbuffer += decoder.decode(value, { stream: true });\n\t\t\tfor (;;) {\n\t\t\t\tconst taken = takeFrame(buffer);\n\t\t\t\tif (!taken) break;\n\t\t\t\tbuffer = taken.rest;\n\t\t\t\tconst { event, data } = parseFrame(taken.frame);\n\t\t\t\tif (data.length > 0) dispatch(event, data.join(\"\\n\"));\n\t\t\t}\n\t\t}\n\t\tend();\n\t}\n\t(async () => {\n\t\ttry {\n\t\t\tconst response = await fetchImpl(url, {\n\t\t\t\theaders: { accept: \"text/event-stream\" },\n\t\t\t\tsignal: abort.signal\n\t\t\t});\n\t\t\tif (!response.ok || !response.body) throw new Error(`Devframe SSE stream request failed: ${response.status}`);\n\t\t\tawait consume(response.body);\n\t\t} catch (error) {\n\t\t\tif (abort.signal.aborted) {\n\t\t\t\tend();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfail(error instanceof Error ? error : new Error(String(error)));\n\t\t}\n\t})();\n\treturn {\n\t\tclose: () => {\n\t\t\tclosed = true;\n\t\t\tabort.abort();\n\t\t\tactiveReader?.cancel().catch(() => {});\n\t\t},\n\t\ton: (handler) => {\n\t\t\tonMessage = handler;\n\t\t},\n\t\tpost: async (data) => {\n\t\t\tlet sessionId;\n\t\t\ttry {\n\t\t\t\tsessionId = await sessionReady;\n\t\t\t} catch {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (closed) {\n\t\t\t\tonError(/* @__PURE__ */ new Error(\"Devframe SSE channel is closed; message dropped\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst response = await fetchImpl(url, {\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t\"content-type\": \"text/plain; charset=utf-8\",\n\t\t\t\t\t\t[DEVFRAME_SSE_SESSION_HEADER]: sessionId\n\t\t\t\t\t},\n\t\t\t\t\tbody: data\n\t\t\t\t});\n\t\t\t\tif (response.status === 200) {\n\t\t\t\t\tconst body = await response.text();\n\t\t\t\t\tif (body) onMessage?.(body);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!response.ok) throw new Error(`Devframe SSE POST failed: ${response.status}`);\n\t\t\t} catch (error) {\n\t\t\t\tonError(error instanceof Error ? error : new Error(String(error)));\n\t\t\t}\n\t\t},\n\t\tserialize: codec.serialize,\n\t\tdeserialize: codec.deserialize\n\t};\n}\n//#endregion\n//#region src/rpc/client.ts\nfunction createRpcClient(functions, options) {\n\tconst { channel, rpcOptions = {} } = options;\n\treturn createBirpc(functions, {\n\t\t...channel,\n\t\ttimeout: -1,\n\t\t...rpcOptions,\n\t\tproxify: false\n\t});\n}\n//#endregion\n//#region src/client/rpc-live.ts\n/**\n* The transport-independent half of a live RPC client mode (connection\n* status, pending-call guarding, and the trust handshake), shared by the\n* WebSocket and SSE modes. Each transport supplies only its channel.\n*/\nfunction createLiveRpcClientMode(options) {\n\tconst { transport, authToken, connectionMeta, events, clientRpc, rpcOptions = {}, callTimeout = 0 } = options;\n\tlet isTrusted = false;\n\tlet status = \"connecting\";\n\tlet connectionError = null;\n\tconst trustedPromise = Promise.withResolvers();\n\tfunction setStatus(next, error = null) {\n\t\tif (error) connectionError = error;\n\t\telse if (next === \"connected\") connectionError = null;\n\t\tif (next === status) return;\n\t\tconst previous = status;\n\t\tstatus = next;\n\t\tevents.emit(DEVFRAME_EVENTS.client.connectionStatus, next, previous);\n\t}\n\tconst pending = /* @__PURE__ */ new Set();\n\tfunction rejectAllPending(error) {\n\t\tfor (const entry of [...pending]) entry.reject(error);\n\t}\n\tfunction terminalError() {\n\t\tif (status === \"disconnected\" || status === \"error\") return new DevframeConnectionError(\"connection\", \"[devframe] Not connected to the devframe server\", { cause: connectionError ?? void 0 });\n\t\tif (status === \"unauthorized\") return new DevframeConnectionError(\"auth\", \"[devframe] Not authorized by the devframe server\", { cause: connectionError ?? void 0 });\n\t\treturn null;\n\t}\n\t/**\n\t* Wrap an in-flight call promise so it settles on server response, on an\n\t* optional wall-clock timeout, or when the connection drops, so it never hangs.\n\t*/\n\tfunction guardCall(promise, method) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tlet settled = false;\n\t\t\tlet timer;\n\t\t\tconst entry = { reject(error) {\n\t\t\t\tif (settled) return;\n\t\t\t\tfinish();\n\t\t\t\tevents.emit(DEVFRAME_EVENTS.client.error, error, method);\n\t\t\t\treject(error);\n\t\t\t} };\n\t\t\tfunction finish() {\n\t\t\t\tsettled = true;\n\t\t\t\tpending.delete(entry);\n\t\t\t\tif (timer) clearTimeout(timer);\n\t\t\t}\n\t\t\tpending.add(entry);\n\t\t\tif (callTimeout > 0) timer = setTimeout(() => {\n\t\t\t\tentry.reject(new DevframeConnectionError(\"timeout\", `[devframe] RPC call \"${method}\" timed out after ${callTimeout}ms`));\n\t\t\t}, callTimeout);\n\t\t\tpromise.then((value) => {\n\t\t\t\tif (settled) return;\n\t\t\t\tfinish();\n\t\t\t\tresolve(value);\n\t\t\t}, (error) => {\n\t\t\t\tif (settled) return;\n\t\t\t\tfinish();\n\t\t\t\tconst err = error instanceof Error ? error : new Error(String(error));\n\t\t\t\tevents.emit(DEVFRAME_EVENTS.client.error, err, method);\n\t\t\t\treject(err);\n\t\t\t});\n\t\t});\n\t}\n\tconst definitions = /* @__PURE__ */ new Map();\n\tfor (const name of connectionMeta.jsonSerializableMethods ?? []) definitions.set(name, { jsonSerializable: true });\n\tconst channel = options.createChannel({\n\t\tdefinitions,\n\t\tonError(error) {\n\t\t\tsetStatus(\"error\", error);\n\t\t\tevents.emit(DEVFRAME_EVENTS.client.connectionError, error);\n\t\t\trejectAllPending(new DevframeConnectionError(\"connection\", \"[devframe] Connection to the devframe server failed\", { cause: error }));\n\t\t},\n\t\tonDisconnected() {\n\t\t\tif (status !== \"error\") setStatus(\"disconnected\");\n\t\t\trejectAllPending(new DevframeConnectionError(\"connection\", \"[devframe] Disconnected from the devframe server\", { cause: connectionError ?? void 0 }));\n\t\t}\n\t});\n\tconst serverRpc = createRpcClient(clientRpc.functions, {\n\t\tchannel,\n\t\trpcOptions\n\t});\n\tclientRpc.register({\n\t\tname: DEVFRAME_EVENTS.broadcast.authRevoked,\n\t\ttype: \"event\",\n\t\thandler: () => {\n\t\t\tisTrusted = false;\n\t\t\tconst authError = new DevframeConnectionError(\"auth\", \"[devframe] The devframe server revoked this client's trust\");\n\t\t\tsetStatus(\"unauthorized\", authError);\n\t\t\tevents.emit(DEVFRAME_EVENTS.client.connectionError, authError);\n\t\t\trejectAllPending(authError);\n\t\t\tevents.emit(DEVFRAME_EVENTS.client.isTrustedUpdated, false);\n\t\t}\n\t});\n\tlet currentAuthToken = authToken;\n\tasync function requestTrustWithToken(token) {\n\t\tcurrentAuthToken = token;\n\t\tconst result = await serverRpc.$call(\"anonymous:devframe:auth\", {\n\t\t\tauthToken: token,\n\t\t\t/**\n\t\t\t* Sent raw; the server parses it into a display label (see\n\t\t\t* `describeUA` in `node/auth/state.ts`) so `ua-parser-modern` stays\n\t\t\t* out of the browser bundle.\n\t\t\t*/\n\t\t\tua: navigator.userAgent,\n\t\t\torigin: location.origin\n\t\t});\n\t\tisTrusted = result.isTrusted;\n\t\tif (isTrusted) {\n\t\t\ttrustedPromise.resolve(true);\n\t\t\tsetStatus(\"connected\");\n\t\t} else {\n\t\t\tconst authError = new DevframeConnectionError(\"auth\", \"[devframe] The devframe server refused this client's credentials\");\n\t\t\tsetStatus(\"unauthorized\", authError);\n\t\t\tevents.emit(DEVFRAME_EVENTS.client.connectionError, authError);\n\t\t}\n\t\tevents.emit(DEVFRAME_EVENTS.client.isTrustedUpdated, isTrusted);\n\t\treturn result.isTrusted;\n\t}\n\tasync function requestTrustWithCode(code) {\n\t\tconst token = (await serverRpc.$call(\"anonymous:devframe:auth:exchange\", {\n\t\t\tcode,\n\t\t\tua: navigator.userAgent,\n\t\t\torigin: location.origin\n\t\t}))?.authToken ?? null;\n\t\tif (token) {\n\t\t\tcurrentAuthToken = token;\n\t\t\tisTrusted = true;\n\t\t\ttrustedPromise.resolve(true);\n\t\t\tsetStatus(\"connected\");\n\t\t\tevents.emit(DEVFRAME_EVENTS.client.isTrustedUpdated, true);\n\t\t}\n\t\treturn token;\n\t}\n\tasync function requestAuthCode(options = {}) {\n\t\tawait serverRpc.$call(\"anonymous:devframe:auth:request-code\", {\n\t\t\tua: navigator.userAgent,\n\t\t\torigin: location.origin,\n\t\t\t...options.reissue ? { reissue: true } : {}\n\t\t});\n\t}\n\tasync function requestTrust() {\n\t\tif (isTrusted) return true;\n\t\treturn requestTrustWithToken(currentAuthToken ?? \"\");\n\t}\n\tasync function ensureTrusted(timeout = 6e4) {\n\t\tif (isTrusted) trustedPromise.resolve(true);\n\t\tif (timeout <= 0) return trustedPromise.promise;\n\t\tlet timer;\n\t\ttry {\n\t\t\tawait Promise.race([trustedPromise.promise, new Promise((_, reject) => {\n\t\t\t\ttimer = setTimeout(() => {\n\t\t\t\t\treject(/* @__PURE__ */ new Error(\"[devframe] Timeout waiting for rpc to be trusted\"));\n\t\t\t\t}, timeout);\n\t\t\t})]);\n\t\t\treturn isTrusted;\n\t\t} finally {\n\t\t\tclearTimeout(timer);\n\t\t}\n\t}\n\treturn {\n\t\ttransport,\n\t\tget isTrusted() {\n\t\t\treturn isTrusted;\n\t\t},\n\t\tget status() {\n\t\t\treturn status;\n\t\t},\n\t\tget connectionError() {\n\t\t\treturn connectionError;\n\t\t},\n\t\trequestTrust,\n\t\trequestTrustWithToken,\n\t\trequestTrustWithCode,\n\t\trequestAuthCode,\n\t\tensureTrusted,\n\t\tcall: (...args) => {\n\t\t\tconst method = String(args[0]);\n\t\t\tconst failFast = terminalError();\n\t\t\tif (failFast) {\n\t\t\t\tevents.emit(DEVFRAME_EVENTS.client.error, failFast, method);\n\t\t\t\treturn Promise.reject(failFast);\n\t\t\t}\n\t\t\treturn guardCall(serverRpc.$call(...args), method);\n\t\t},\n\t\tcallEvent: (...args) => {\n\t\t\tconst failFast = terminalError();\n\t\t\tif (failFast) {\n\t\t\t\tevents.emit(DEVFRAME_EVENTS.client.error, failFast, String(args[0]));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn serverRpc.$callEvent(...args);\n\t\t},\n\t\tcallOptional: (...args) => {\n\t\t\tconst method = String(args[0]);\n\t\t\tconst failFast = terminalError();\n\t\t\tif (failFast) {\n\t\t\t\tevents.emit(DEVFRAME_EVENTS.client.error, failFast, method);\n\t\t\t\treturn Promise.reject(failFast);\n\t\t\t}\n\t\t\treturn guardCall(serverRpc.$callOptional(...args), method);\n\t\t},\n\t\tclose: () => {\n\t\t\tchannel.close();\n\t\t}\n\t};\n}\n//#endregion\n//#region src/client/rpc-sse.ts\n/**\n* Resolve a {@link ConnectionMeta.sse} descriptor into a concrete\n* `http(s)://` URL, with the same proxy-safe rules as `resolveWsUrl`: the\n* object / relative-path forms resolve against where `__connection.json`\n* was loaded (the client trusts its own location, never a server-baked\n* hostname), while an explicit `port`/`host` (or a full `http(s)://` URL\n* string) opts into a cross-origin endpoint.\n*/\nfunction resolveSseUrl(sse, metaBaseUrl, loc) {\n\tconst base = (() => {\n\t\ttry {\n\t\t\treturn new URL(metaBaseUrl, loc.href);\n\t\t} catch {\n\t\t\treturn new URL(loc.href);\n\t\t}\n\t})();\n\tif (sse && typeof sse === \"object\") {\n\t\tif (sse.host != null || sse.port != null) {\n\t\t\tconst host = sse.host ?? `${base.hostname}:${sse.port}`;\n\t\t\treturn new URL(sse.path ?? \"/\", `${base.protocol}//${host}`).href;\n\t\t}\n\t\treturn new URL(sse.path ?? \"\", base).href;\n\t}\n\tconst str = sse ?? \"\";\n\tif (/^https?:\\/\\//i.test(str)) return str;\n\treturn new URL(str, base).href;\n}\n/**\n* The SSE-backed live client mode, picked by `connectDevframe` when the\n* server advertises SSE as its primary transport (`backend: 'sse'`) or when\n* the caller pins `transport: 'sse'`. Same status machine, call guarding,\n* and trust handshake as the WebSocket mode, over `createSseRpcChannel`.\n*/\nfunction createSseRpcClientMode(options) {\n\tconst { authToken, connectionMeta, metaBaseUrl, events, clientRpc, rpcOptions = {}, sseOptions = {}, callTimeout = 0 } = options;\n\tconst url = resolveSseUrl(connectionMeta.sse, metaBaseUrl ?? \"./\", location);\n\treturn createLiveRpcClientMode({\n\t\ttransport: \"sse\",\n\t\tauthToken,\n\t\tconnectionMeta,\n\t\tevents,\n\t\tclientRpc,\n\t\trpcOptions,\n\t\tcallTimeout,\n\t\tcreateChannel: (handlers) => createSseRpcChannel({\n\t\t\turl,\n\t\t\tauthToken,\n\t\t\tdefinitions: handlers.definitions,\n\t\t\t...sseOptions,\n\t\t\tonConnected() {\n\t\t\t\tsseOptions.onConnected?.();\n\t\t\t},\n\t\t\tonError(error) {\n\t\t\t\thandlers.onError(error);\n\t\t\t\tsseOptions.onError?.(error);\n\t\t\t},\n\t\t\tonDisconnected() {\n\t\t\t\thandlers.onDisconnected();\n\t\t\t\tsseOptions.onDisconnected?.();\n\t\t\t}\n\t\t})\n\t});\n}\n//#endregion\n//#region src/rpc/dump/error.ts\n/**\n* Inverse of {@link serializeDumpError}: rebuild a thrown `Error` from\n* the plain object stored in a dump record. Preserves `cause`, restores\n* the original `name`, and re-attaches any custom own properties.\n*/\nfunction reviveDumpError(stored) {\n\tconst { name, message, cause: rawCause, ...extras } = stored;\n\tconst cause = rawCause instanceof Error ? rawCause : isPlainErrorShape(rawCause) ? reviveDumpError(rawCause) : rawCause;\n\tconst error = cause !== void 0 ? new Error(message, { cause }) : new Error(message);\n\terror.name = name;\n\tObject.assign(error, extras);\n\treturn error;\n}\nfunction isPlainErrorShape(value) {\n\treturn typeof value === \"object\" && value !== null && typeof value.message === \"string\" && typeof value.name === \"string\";\n}\n//#endregion\n//#region src/client/static-rpc.ts\nfunction isStaticEntry(value) {\n\treturn typeof value === \"object\" && value !== null && value.type === \"static\" && typeof value.path === \"string\";\n}\nfunction isQueryEntry(value) {\n\treturn typeof value === \"object\" && value !== null && value.type === \"query\" && typeof value.records === \"object\" && value.records !== null;\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && (\"output\" in value || \"error\" in value);\n}\nfunction resolveRecordOutput(record) {\n\tif (record.error) throw reviveDumpError(record.error);\n\treturn record.output;\n}\nfunction hasMeaningfulArgs(args) {\n\treturn args.some((arg) => arg !== null && arg !== void 0);\n}\nfunction unwrapEnvelope(raw) {\n\tif (raw !== null && typeof raw === \"object\" && \"serialization\" in raw && \"data\" in raw) return raw.data;\n\treturn raw;\n}\nfunction createStaticRpcCaller(manifest, fetchJson) {\n\tconst staticCache = /* @__PURE__ */ new Map();\n\tconst queryRecordCache = /* @__PURE__ */ new Map();\n\tfunction reviveIfStructuredClone(value, serialization) {\n\t\tif (serialization === \"structured-clone\" && Array.isArray(value)) return structuredCloneDeserialize(value);\n\t\treturn value;\n\t}\n\tfunction decode(raw, serialization) {\n\t\treturn reviveIfStructuredClone(unwrapEnvelope(raw), serialization);\n\t}\n\tasync function loadStatic(entry) {\n\t\tif (!staticCache.has(entry.path)) staticCache.set(entry.path, fetchJson(entry.path).then((raw) => decode(raw, entry.serialization)));\n\t\tconst data = await staticCache.get(entry.path);\n\t\tif (isRecord(data)) return resolveRecordOutput(data);\n\t\treturn data;\n\t}\n\tasync function loadQueryRecord(path, serialization) {\n\t\tif (!queryRecordCache.has(path)) queryRecordCache.set(path, fetchJson(path).then((raw) => decode(raw, serialization)));\n\t\treturn await queryRecordCache.get(path);\n\t}\n\tasync function call(functionName, args) {\n\t\tif (!(functionName in manifest)) throw new Error(`[devframe-rpc] Function \"${functionName}\" not found in dump store`);\n\t\tconst entry = manifest[functionName];\n\t\tif (isStaticEntry(entry)) {\n\t\t\tif (hasMeaningfulArgs(args)) throw new Error(`[devframe-rpc] No dump match for \"${functionName}\" with args: ${JSON.stringify(args)}`);\n\t\t\treturn await loadStatic(entry);\n\t\t}\n\t\tif (isQueryEntry(entry)) {\n\t\t\tconst argsHash = hash(args);\n\t\t\tconst recordPath = entry.records[argsHash];\n\t\t\tif (recordPath) return resolveRecordOutput(await loadQueryRecord(recordPath, entry.serialization));\n\t\t\tif (entry.fallback) return resolveRecordOutput(await loadQueryRecord(entry.fallback, entry.serialization));\n\t\t\tthrow new Error(`[devframe-rpc] No dump match for \"${functionName}\" with args: ${JSON.stringify(args)}`);\n\t\t}\n\t\tif (!hasMeaningfulArgs(args)) return entry;\n\t\tthrow new Error(`[devframe-rpc] No dump match for \"${functionName}\" with args: ${JSON.stringify(args)}`);\n\t}\n\treturn {\n\t\tcall: async (functionName, args) => await call(functionName, args),\n\t\tcallOptional: async (functionName, args) => {\n\t\t\tif (!(functionName in manifest)) return void 0;\n\t\t\treturn await call(functionName, args);\n\t\t},\n\t\tcallEvent: async (_functionName, _args) => {}\n\t};\n}\n//#endregion\n//#region src/client/rpc-static.ts\nasync function createStaticRpcClientMode(options) {\n\tconst staticCaller = createStaticRpcCaller(await options.fetchJsonFromBases(DEVFRAME_RPC_DUMP_MANIFEST_FILENAME), options.fetchJsonFromBases);\n\treturn {\n\t\ttransport: \"static\",\n\t\tisTrusted: true,\n\t\t/**\n\t\t* A static backend has no live socket; every call is a local fetch, so it\n\t\t* is \"connected\" for its whole life.\n\t\t*/\n\t\tstatus: \"connected\",\n\t\tconnectionError: null,\n\t\trequestTrust: async () => true,\n\t\trequestTrustWithToken: async () => true,\n\t\t/** Static backends are always trusted, so there's nothing to exchange. */\n\t\trequestTrustWithCode: async () => null,\n\t\t/** No server terminal to print a code in. */\n\t\trequestAuthCode: async () => {},\n\t\tensureTrusted: async () => true,\n\t\tcall: (...args) => staticCaller.call(args[0], args.slice(1)),\n\t\tcallEvent: (...args) => staticCaller.callEvent(args[0], args.slice(1)),\n\t\tcallOptional: (...args) => staticCaller.callOptional(args[0], args.slice(1)),\n\t\t/** No live socket to close; every call is a local fetch. */\n\t\tclose: () => {}\n\t};\n}\n//#endregion\n//#region src/client/rpc-streaming.ts\nconst STREAM_KEY_SEPARATOR = \"\u001f\";\nfunction streamKey(channel, id) {\n\treturn `${channel}${STREAM_KEY_SEPARATOR}${id}`;\n}\n/**\n* Client-side streaming host. Mirrors `createRpcSharedStateClientHost`:\n* registers the two `:chunk` / `:end` event handlers once, then per-stream\n* state lives in a `Map<streamKey, StreamReader>`.\n*/\nfunction createRpcStreamingClientHost(rpc) {\n\tconst readers = /* @__PURE__ */ new Map();\n\tconst uploads = /* @__PURE__ */ new Map();\n\trpc.client.register({\n\t\tname: DEVFRAME_EVENTS.broadcast.streamingChunk,\n\t\ttype: \"event\",\n\t\thandler(channel, id, seq, chunk) {\n\t\t\treaders.get(streamKey(channel, id))?._push(seq, chunk);\n\t\t}\n\t});\n\trpc.client.register({\n\t\tname: DEVFRAME_EVENTS.broadcast.streamingEnd,\n\t\ttype: \"event\",\n\t\thandler(channel, id, error) {\n\t\t\tconst key = streamKey(channel, id);\n\t\t\tconst reader = readers.get(key);\n\t\t\tif (!reader) return;\n\t\t\treader._end(error);\n\t\t\treaders.delete(key);\n\t\t}\n\t});\n\trpc.client.register({\n\t\tname: DEVFRAME_EVENTS.broadcast.streamingUploadCancel,\n\t\ttype: \"event\",\n\t\thandler(channel, id) {\n\t\t\tconst key = streamKey(channel, id);\n\t\t\tconst sink = uploads.get(key);\n\t\t\tif (!sink) return;\n\t\t\tsink.abort(\"server cancelled upload\");\n\t\t\tuploads.delete(key);\n\t\t}\n\t});\n\trpc.events.on(DEVFRAME_EVENTS.client.isTrustedUpdated, (isTrusted) => {\n\t\tif (!isTrusted) return;\n\t\tfor (const [key, reader] of readers) {\n\t\t\tif (reader.cancelled || reader.done) continue;\n\t\t\tconst sepIdx = key.indexOf(STREAM_KEY_SEPARATOR);\n\t\t\tif (sepIdx < 0) continue;\n\t\t\tconst channel = key.slice(0, sepIdx);\n\t\t\tconst id = key.slice(sepIdx + 1);\n\t\t\trpc.callEvent(\"devframe:streaming:subscribe\", channel, id, { afterSeq: reader.lastSeenSeq });\n\t\t}\n\t});\n\tfunction subscribe(channel, id, options = {}) {\n\t\tconst key = streamKey(channel, id);\n\t\tconst existing = readers.get(key);\n\t\tif (existing) return existing;\n\t\tconst reader = createStreamReader({\n\t\t\tid,\n\t\t\thighWaterMark: options.highWaterMark,\n\t\t\tonOverflow(dropped) {\n\t\t\t\tconsole.warn(`[devframe] DF0029: Stream \"${channel}#${id}\" dropped ${dropped} chunk(s) after exceeding the client high-water mark.`);\n\t\t\t},\n\t\t\tonCancel() {\n\t\t\t\trpc.callEvent(\"devframe:streaming:cancel\", channel, id);\n\t\t\t\treaders.delete(key);\n\t\t\t}\n\t\t});\n\t\treaders.set(key, reader);\n\t\tif (rpc.isTrusted) rpc.callEvent(\"devframe:streaming:subscribe\", channel, id, { afterSeq: 0 });\n\t\telse {\n\t\t\tconst off = rpc.events.on(DEVFRAME_EVENTS.client.isTrustedUpdated, (trusted) => {\n\t\t\t\tif (trusted) {\n\t\t\t\t\toff();\n\t\t\t\t\tif (readers.has(key) && !reader.cancelled && !reader.done) rpc.callEvent(\"devframe:streaming:subscribe\", channel, id, { afterSeq: reader.lastSeenSeq });\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn reader;\n\t}\n\tfunction upload(channel, id) {\n\t\tconst key = streamKey(channel, id);\n\t\tconst existing = uploads.get(key);\n\t\tif (existing) return existing;\n\t\tconst sink = createStreamSink({ id });\n\t\tsink.events.on(\"chunk\", (seq, chunk) => {\n\t\t\trpc.callEvent(\"devframe:streaming:upload-chunk\", channel, id, seq, chunk);\n\t\t});\n\t\tsink.events.on(\"end\", (error) => {\n\t\t\trpc.callEvent(\"devframe:streaming:upload-end\", channel, id, error);\n\t\t\tuploads.delete(key);\n\t\t});\n\t\tuploads.set(key, sink);\n\t\treturn sink;\n\t}\n\treturn {\n\t\tsubscribe,\n\t\tupload\n\t};\n}\n//#endregion\n//#region src/rpc/transports/ws-client.ts\nfunction NOOP() {}\nconst EMPTY_DEFS = /* @__PURE__ */ new Map();\n/**\n* Build a birpc `ChannelOptions` object backed by a browser `WebSocket`.\n* Pass the result straight to `createRpcClient`'s `channel` option.\n*\n* Also returns `close()`, closing the underlying socket, mirroring the server transport's\n* existing `WsRpcTransport.close()`. `birpc`'s own `ChannelOptions` has no teardown of its own.\n*/\nfunction createWsRpcChannel(options) {\n\tlet url = options.url;\n\tif (options.authToken) url = `${url}?${DEVFRAME_AUTH_TOKEN_QUERY_PARAM}=${encodeURIComponent(options.authToken)}`;\n\tconst ws = new WebSocket(url);\n\tconst { onConnected = NOOP, onError = NOOP, onDisconnected = NOOP, definitions = EMPTY_DEFS } = options;\n\tws.addEventListener(\"open\", (e) => {\n\t\tonConnected(e);\n\t});\n\tws.addEventListener(\"error\", (e) => {\n\t\tconst _e = e instanceof Error ? e : new Error(e.type);\n\t\tonError(_e);\n\t});\n\tws.addEventListener(\"close\", (e) => {\n\t\tonDisconnected(e);\n\t});\n\tconst codec = createRpcWireCodec(definitions);\n\treturn {\n\t\tclose: () => {\n\t\t\tws.close();\n\t\t},\n\t\ton: (handler) => {\n\t\t\tws.addEventListener(\"message\", (e) => {\n\t\t\t\thandler(e.data);\n\t\t\t});\n\t\t},\n\t\tpost: (data) => {\n\t\t\tif (ws.readyState === WebSocket.OPEN) {\n\t\t\t\tws.send(data);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (ws.readyState === WebSocket.CONNECTING) {\n\t\t\t\tconst onOpen = () => {\n\t\t\t\t\tcleanup();\n\t\t\t\t\tif (ws.readyState === WebSocket.OPEN) ws.send(data);\n\t\t\t\t};\n\t\t\t\tconst onClose = () => cleanup();\n\t\t\t\tfunction cleanup() {\n\t\t\t\t\tws.removeEventListener(\"open\", onOpen);\n\t\t\t\t\tws.removeEventListener(\"close\", onClose);\n\t\t\t\t}\n\t\t\t\tws.addEventListener(\"open\", onOpen);\n\t\t\t\tws.addEventListener(\"close\", onClose);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonError(/* @__PURE__ */ new Error(\"Devframe WebSocket is not open; message dropped\"));\n\t\t},\n\t\tserialize: codec.serialize,\n\t\tdeserialize: codec.deserialize\n\t};\n}\n//#endregion\n//#region src/client/rpc-ws.ts\n/**\n* Resolve a {@link ConnectionMeta.websocket} descriptor into a concrete\n* `ws(s)://` URL.\n*\n* The object / relative-path forms connect to the page's own origin (only the\n* `http`→`ws` protocol swap is applied), resolving the path against where\n* `__connection.json` was loaded. This is deliberately host-agnostic so the\n* connection survives a reverse proxy that changes the domain or port, since the\n* client trusts its own location, never a server-baked hostname. An explicit\n* `port`/`host` (or a full `ws(s)://` URL string) opts into a cross-origin\n* endpoint, e.g. a side-car server on its own port.\n*/\nfunction resolveWsUrl(websocket, metaBaseUrl, loc) {\n\tconst base = (() => {\n\t\ttry {\n\t\t\treturn new URL(metaBaseUrl, loc.href);\n\t\t} catch {\n\t\t\treturn new URL(loc.href);\n\t\t}\n\t})();\n\tconst wsProtocol = base.protocol === \"https:\" ? \"wss:\" : \"ws:\";\n\tif (websocket && typeof websocket === \"object\") {\n\t\tif (websocket.host != null || websocket.port != null) {\n\t\t\tconst host = websocket.host ?? `${base.hostname}:${websocket.port}`;\n\t\t\tconst target = new URL(websocket.path ?? \"/\", `${wsProtocol}//${host}`);\n\t\t\ttarget.protocol = wsProtocol;\n\t\t\treturn target.href;\n\t\t}\n\t\tconst target = new URL(websocket.path ?? \"\", base);\n\t\ttarget.protocol = wsProtocol;\n\t\treturn target.href;\n\t}\n\tif (typeof websocket === \"number\") return `${wsProtocol}//${base.hostname}:${websocket}`;\n\tconst str = websocket ?? \"\";\n\tif (/^wss?:\\/\\//i.test(str)) return str;\n\tif (/^https?:\\/\\//i.test(str)) return withProtocol(str, /^https/i.test(str) ? \"wss://\" : \"ws://\");\n\tconst target = new URL(str, base);\n\ttarget.protocol = wsProtocol;\n\treturn target.href;\n}\nfunction createWsRpcClientMode(options) {\n\tconst { authToken, connectionMeta, metaBaseUrl, events, clientRpc, rpcOptions = {}, wsOptions = {}, callTimeout = 0 } = options;\n\tconst url = resolveWsUrl(connectionMeta.websocket, metaBaseUrl ?? \"./\", location);\n\treturn createLiveRpcClientMode({\n\t\ttransport: \"websocket\",\n\t\tauthToken,\n\t\tconnectionMeta,\n\t\tevents,\n\t\tclientRpc,\n\t\trpcOptions,\n\t\tcallTimeout,\n\t\tcreateChannel: (handlers) => createWsRpcChannel({\n\t\t\turl,\n\t\t\tauthToken,\n\t\t\tdefinitions: handlers.definitions,\n\t\t\t...wsOptions,\n\t\t\tonConnected(event) {\n\t\t\t\twsOptions.onConnected?.(event);\n\t\t\t},\n\t\t\tonError(error) {\n\t\t\t\thandlers.onError(error);\n\t\t\t\twsOptions.onError?.(error);\n\t\t\t},\n\t\t\tonDisconnected(event) {\n\t\t\t\thandlers.onDisconnected();\n\t\t\t\twsOptions.onDisconnected?.(event);\n\t\t\t}\n\t\t})\n\t});\n}\n//#endregion\n//#region src/utils/scope.ts\n/** Whether a name is already namespaced (contains a `:` separator). */\nfunction isQualifiedName(name) {\n\treturn name.includes(\":\");\n}\n/**\n* Prefix a bare name with `<namespace>:`. Names that already contain a\n* `:` are returned unchanged, so callers can reference another scope's\n* ids explicitly (e.g. `ctx.rpc.call('other-plugin:fn')`).\n*/\nfunction qualifyName(namespace, name) {\n\treturn isQualifiedName(name) ? name : `${namespace}:${name}`;\n}\n//#endregion\n//#region src/settings-store.ts\n/**\n* The key-value store surface over a lazily-resolved shared state, shared by\n* the node-side (file-backed) and client-side (RPC-mirrored) settings stores.\n* Each side supplies its own `store()` resolver; the read/write/subscribe\n* behavior on top of it is identical.\n*/\nfunction createSettingsStore(store) {\n\treturn {\n\t\tasync get(key) {\n\t\t\treturn (await store()).value()[key];\n\t\t},\n\t\tasync set(key, value) {\n\t\t\t(await store()).mutate((draft) => {\n\t\t\t\tdraft[key] = value;\n\t\t\t});\n\t\t},\n\t\tasync delete(key) {\n\t\t\t(await store()).mutate((draft) => {\n\t\t\t\tdelete draft[key];\n\t\t\t});\n\t\t},\n\t\tasync all() {\n\t\t\treturn (await store()).value();\n\t\t},\n\t\tasync onChange(fn) {\n\t\t\treturn (await store()).on(\"updated\", (full) => fn(full));\n\t\t}\n\t};\n}\n//#endregion\n//#region src/client/settings.ts\nfunction createClientSettingsStore(rpc, namespace, scope) {\n\tconst stateKey = `devframe:settings:${scope}:${namespace}`;\n\tlet statePromise;\n\tfunction store() {\n\t\tif (!statePromise) statePromise = rpc.sharedState.get(stateKey, { initialValue: {} });\n\t\treturn statePromise;\n\t}\n\treturn createSettingsStore(store);\n}\n/**\n* Build the client-side `settings` surface for a scope namespace. Mirrors\n* the node-side stores over the shared-state sync protocol.\n*/\nfunction createClientSettings(rpc, namespace) {\n\treturn {\n\t\tglobal: createClientSettingsStore(rpc, namespace, \"global\"),\n\t\tproject: createClientSettingsStore(rpc, namespace, \"project\")\n\t};\n}\n//#endregion\n//#region src/client/scope.ts\n/**\n* Build a namespace-scoped view of a {@link DevframeRpcClient}. Every RPC\n* id, shared-state key, and streaming channel passed through the returned\n* `rpc` surface is auto-namespaced with `<namespace>:`.\n*/\nfunction createScopedClientContext(rpc, namespace) {\n\treturn {\n\t\tnamespace,\n\t\tbase: rpc,\n\t\trpc: {\n\t\t\tnamespace,\n\t\t\tregister(fn) {\n\t\t\t\tif (isQualifiedName(fn.name)) throw new Error(`[devframe] Scoped client RPC registration for namespace \"${namespace}\" received an already-namespaced function name \"${fn.name}\". Pass a bare name without a \":\" separator.`);\n\t\t\t\trpc.client.register({\n\t\t\t\t\t...fn,\n\t\t\t\t\tname: `${namespace}:${fn.name}`\n\t\t\t\t});\n\t\t\t},\n\t\t\tcall: ((method, ...args) => rpc.call(qualifyName(namespace, method), ...args)),\n\t\t\tcallEvent: ((method, ...args) => rpc.callEvent(qualifyName(namespace, method), ...args)),\n\t\t\tcallOptional: ((method, ...args) => rpc.callOptional(qualifyName(namespace, method), ...args)),\n\t\t\tsharedState: ((key, options) => rpc.sharedState.get(qualifyName(namespace, key), options)),\n\t\t\tstreaming: {\n\t\t\t\tsubscribe: (channel, id, options) => rpc.streaming.subscribe(qualifyName(namespace, channel), id, options),\n\t\t\t\tupload: (channel, id) => rpc.streaming.upload(qualifyName(namespace, channel), id)\n\t\t\t}\n\t\t},\n\t\tsettings: createClientSettings(rpc, namespace),\n\t\tscope: rpc.scope\n\t};\n}\n//#endregion\n//#region src/client/webmcp.ts\n/**\n* The page's WebMCP model context, when the browser (or a polyfill)\n* provides one. Checks `document.modelContext` (current draft) first,\n* then `navigator.modelContext` (earlier drafts and polyfills).\n*/\nfunction resolveWebMcpModelContext() {\n\tif (typeof document !== \"undefined\") {\n\t\tconst context = document.modelContext;\n\t\tif (context) return context;\n\t}\n\tif (typeof navigator !== \"undefined\") {\n\t\tconst context = navigator.modelContext;\n\t\tif (context) return context;\n\t}\n}\n/**\n* Mirror the `agent`-flagged RPC functions of a browser-side collector\n* (`rpc.client`) onto the page's WebMCP model context as callable tools,\n* using the same `agent` signature, wire names, and `arg0`/`arg1`/… input\n* schema as the node-side MCP adapter. Functions without an `agent` field\n* stay unexposed (default-deny), and the tool set follows later\n* `register`/`update` calls. Returns a dispose that unregisters every tool.\n*/\nfunction registerWebMcpTools(clientRpc, options = {}) {\n\tconst resolved = options.modelContext ?? resolveWebMcpModelContext();\n\tif (!resolved) return () => {};\n\tconst modelContext = resolved;\n\t/** Unregister callbacks keyed by definition name. */\n\tconst registered = /* @__PURE__ */ new Map();\n\t/** Wire name → definition name, to detect sanitization collisions. */\n\tconst wireNames = /* @__PURE__ */ new Map();\n\tfunction register(def, agent) {\n\t\tconst name = toAgentToolName(def.name);\n\t\tconst owner = wireNames.get(name);\n\t\tif (owner && owner !== def.name) {\n\t\t\tconsole.warn(`[devframe] WebMCP tool name \"${name}\" (from \"${def.name}\") collides with \"${owner}\"; keeping the first registration.`);\n\t\t\treturn;\n\t\t}\n\t\tconst controller = new AbortController();\n\t\tconst safety = resolveAgentSafety(def.type, agent);\n\t\tconst result = modelContext.registerTool({\n\t\t\tname,\n\t\t\tdescription: agent.description,\n\t\t\tinputSchema: argsToJsonSchema(def.args),\n\t\t\tannotations: {\n\t\t\t\ttitle: agent.title ?? def.name,\n\t\t\t\treadOnlyHint: safety === \"read\",\n\t\t\t\tdestructiveHint: safety === \"destructive\"\n\t\t\t},\n\t\t\texecute: (args) => executeRpcTool(def, clientRpc.context, args)\n\t\t}, { signal: controller.signal });\n\t\tif (result && \"then\" in result) result.then(() => {}, () => {});\n\t\twireNames.set(name, def.name);\n\t\tregistered.set(def.name, () => {\n\t\t\tcontroller.abort();\n\t\t\tif (result && \"unregister\" in result && typeof result.unregister === \"function\") result.unregister();\n\t\t\twireNames.delete(name);\n\t\t});\n\t}\n\tfunction sync(id) {\n\t\tconst names = id ? [id] : [...clientRpc.definitions.keys()];\n\t\tfor (const name of names) {\n\t\t\tregistered.get(name)?.();\n\t\t\tregistered.delete(name);\n\t\t\tconst def = clientRpc.definitions.get(name);\n\t\t\tconst agent = def?.agent;\n\t\t\tif (def && agent) register(def, agent);\n\t\t}\n\t}\n\tsync();\n\tconst unsubscribe = clientRpc.onChanged((id) => sync(id));\n\treturn () => {\n\t\tunsubscribe();\n\t\tfor (const unregister of registered.values()) unregister();\n\t\tregistered.clear();\n\t};\n}\nasync function executeRpcTool(def, context, args) {\n\ttry {\n\t\tconst positional = toolInputToRpcArgs(args, def.args?.length);\n\t\treturn { content: [{\n\t\t\ttype: \"text\",\n\t\t\ttext: stringifyResult(await (await getRpcHandler(def, context))(...positional))\n\t\t}] };\n\t} catch (error) {\n\t\treturn {\n\t\t\tisError: true,\n\t\t\tcontent: [{\n\t\t\t\ttype: \"text\",\n\t\t\t\ttext: formatError(error)\n\t\t\t}]\n\t\t};\n\t}\n}\n/**\n* Agent-exposed functions are strict-JSON by contract (`jsonSerializable:\n* true` is enforced at registration), so plain `JSON.stringify` suffices.\n*/\nfunction stringifyResult(value) {\n\tif (value === void 0) return \"undefined\";\n\tif (typeof value === \"string\") return value;\n\treturn JSON.stringify(value, null, 2);\n}\nfunction formatError(error) {\n\tif (!(error instanceof Error)) return String(error);\n\tconst cause = error.cause instanceof Error ? ` (cause: ${error.cause.message})` : \"\";\n\treturn `${error.name}: ${error.message}${cause}`;\n}\n//#endregion\n//#region src/client/rpc.ts\n/**\n* Resolve the requested `transport` option against what the server\n* advertises. `'auto'` trusts the advertisement: the server's declared\n* primary (`backend`), preferring the WebSocket when both endpoints are\n* present; an explicit `'websocket'` / `'sse'` pins that transport and\n* throws when the server doesn't advertise it.\n*/\nfunction resolveClientTransport(requested, meta) {\n\tif (meta.backend === \"static\") return \"static\";\n\tconst hasWebsocket = meta.websocket !== void 0;\n\tconst hasSse = meta.sse !== void 0;\n\tif (requested === \"websocket\") {\n\t\tif (!hasWebsocket) throw new Error(\"[devframe] transport: 'websocket' was requested, but this server does not advertise a WebSocket endpoint\");\n\t\treturn \"websocket\";\n\t}\n\tif (requested === \"sse\") {\n\t\tif (!hasSse) throw new Error(\"[devframe] transport: 'sse' was requested, but this server does not advertise an SSE endpoint\");\n\t\treturn \"sse\";\n\t}\n\tif (meta.backend === \"sse\" && hasSse) return \"sse\";\n\tif (hasWebsocket) return \"websocket\";\n\tif (hasSse) return \"sse\";\n\tthrow new Error(\"[devframe] This server advertises no RPC transport (backend \\\"none\\\"), so there is nothing to connect to. Enable the WebSocket or SSE endpoint on the server, or use its static/MCP surfaces instead.\");\n}\nasync function getDevframeRpcClient(options = {}) {\n\tconst { baseURL = \"./\", rpcOptions = {}, cacheOptions = false } = options;\n\tconst events = createEventEmitter();\n\tconst bases = Array.isArray(baseURL) ? baseURL : [baseURL];\n\tlet connection = await setupDevframeConnection(options);\n\tconst { connectionMeta, metaBaseUrl, authToken } = connection;\n\tlet resolvedBaseURL = bases[0] ?? \"./\";\n\ttry {\n\t\tresolvedBaseURL = new URL(\".\", metaBaseUrl).href;\n\t} catch {}\n\tconst cacheManager = new RpcCacheManager({\n\t\tfunctions: [],\n\t\t...typeof options.cacheOptions === \"object\" ? options.cacheOptions : {}\n\t});\n\tconst context = { rpc: void 0 };\n\tconst clientRpc = new RpcFunctionsCollectorBase(context);\n\tconst disposeWebMcp = options.webmcp === false ? void 0 : registerWebMcpTools(clientRpc);\n\tlet disposeBrowserAgentBridge;\n\tlet closed = false;\n\tasync function fetchJsonFromBases(path) {\n\t\tconst candidates = [resolvedBaseURL, ...bases.filter((base) => base !== resolvedBaseURL)].filter((x) => x != null);\n\t\tconst errors = [];\n\t\tfor (const base of candidates) try {\n\t\t\treturn await fetch(withBase(path, base)).then((r) => {\n\t\t\t\tif (!r.ok) throw new Error(`Failed to fetch ${path} from ${base}: ${r.status}`);\n\t\t\t\treturn r.json();\n\t\t\t});\n\t\t} catch (error) {\n\t\t\terrors.push(error);\n\t\t}\n\t\tthrow new Error(`Failed to load ${path} from ${candidates.join(\", \")}`, { cause: errors });\n\t}\n\tconst liveModeOptions = {\n\t\tauthToken,\n\t\tconnectionMeta,\n\t\tmetaBaseUrl,\n\t\tevents,\n\t\tclientRpc,\n\t\tcallTimeout: options.callTimeout,\n\t\trpcOptions: {\n\t\t\t...rpcOptions,\n\t\t\tasync onRequest(req, next, resolve) {\n\t\t\t\tawait rpcOptions.onRequest?.call(this, req, next, resolve);\n\t\t\t\tif (cacheOptions && cacheManager?.validate(req.m)) {\n\t\t\t\t\tif (cacheManager.has(req.m, req.a)) return resolve(cacheManager.cached(req.m, req.a));\n\t\t\t\t\tconst res = await next(req);\n\t\t\t\t\tcacheManager.apply(req, res);\n\t\t\t\t} else await next(req);\n\t\t\t}\n\t\t}\n\t};\n\tconst transport = resolveClientTransport(options.transport ?? \"auto\", connectionMeta);\n\tconst mode = transport === \"static\" ? await createStaticRpcClientMode({ fetchJsonFromBases }) : transport === \"sse\" ? createSseRpcClientMode({\n\t\t...liveModeOptions,\n\t\tsseOptions: options.sseOptions\n\t}) : createWsRpcClientMode({\n\t\t...liveModeOptions,\n\t\twsOptions: options.wsOptions\n\t});\n\tlet authChannel;\n\ttry {\n\t\tauthChannel = new BroadcastChannel(\"devframe-auth\");\n\t} catch {}\n\tlet bootstrapAuthPromise;\n\tlet bootstrapAuthSettled = false;\n\tfunction gateOnBootstrapAuth(fn) {\n\t\treturn ((...args) => {\n\t\t\tif (bootstrapAuthSettled || !bootstrapAuthPromise) return fn(...args);\n\t\t\treturn bootstrapAuthPromise.then(() => fn(...args));\n\t\t});\n\t}\n\t/** Release authentication and transport resources even if another disposer fails. */\n\tfunction closeRpcClient() {\n\t\tclosed = true;\n\t\ttry {\n\t\t\tdisposeBrowserAgentBridge?.();\n\t\t\tdisposeWebMcp?.();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tauthChannel?.close();\n\t\t\t} finally {\n\t\t\t\tmode.close?.();\n\t\t\t}\n\t\t}\n\t}\n\tconst rpc = {\n\t\tevents,\n\t\tget isTrusted() {\n\t\t\treturn mode.isTrusted;\n\t\t},\n\t\tget status() {\n\t\t\treturn mode.status;\n\t\t},\n\t\tget connectionError() {\n\t\t\treturn mode.connectionError;\n\t\t},\n\t\tget transport() {\n\t\t\treturn mode.transport ?? transport;\n\t\t},\n\t\tget connection() {\n\t\t\treturn connection;\n\t\t},\n\t\tconnectionMeta,\n\t\tensureTrusted: mode.ensureTrusted,\n\t\trequestTrust: mode.requestTrust,\n\t\trequestTrustWithToken: async (token) => {\n\t\t\tstoreAuthToken(token);\n\t\t\tconnection = {\n\t\t\t\t...connection,\n\t\t\t\tauthToken: token\n\t\t\t};\n\t\t\treturn mode.requestTrustWithToken(token);\n\t\t},\n\t\trequestTrustWithCode: async (code) => {\n\t\t\tconst token = await mode.requestTrustWithCode(code);\n\t\t\tif (!token) return false;\n\t\t\tstoreAuthToken(token);\n\t\t\tconnection = {\n\t\t\t\t...connection,\n\t\t\t\tauthToken: token\n\t\t\t};\n\t\t\ttry {\n\t\t\t\tauthChannel?.postMessage({\n\t\t\t\t\ttype: \"auth-update\",\n\t\t\t\t\tauthToken: token\n\t\t\t\t});\n\t\t\t} catch {}\n\t\t\treturn true;\n\t\t},\n\t\trequestAuthCode: (options) => mode.requestAuthCode(options),\n\t\tcall: gateOnBootstrapAuth(mode.call),\n\t\tcallEvent: gateOnBootstrapAuth(mode.callEvent),\n\t\tcallOptional: gateOnBootstrapAuth(mode.callOptional),\n\t\tclient: clientRpc,\n\t\tsharedState: void 0,\n\t\tservices: void 0,\n\t\tstreaming: void 0,\n\t\tcacheManager,\n\t\tscope: void 0,\n\t\tclose: closeRpcClient\n\t};\n\trpc.sharedState = createRpcSharedStateClientHost(rpc);\n\trpc.streaming = createRpcStreamingClientHost(rpc);\n\trpc.services = createDevframeServicesClient(rpc);\n\tconst scopedCache = /* @__PURE__ */ new Map();\n\trpc.scope = ((namespace) => {\n\t\tif (!namespace) return rpc;\n\t\tlet scoped = scopedCache.get(namespace);\n\t\tif (!scoped) {\n\t\t\tscoped = createScopedClientContext(rpc, namespace);\n\t\t\tscopedCache.set(namespace, scoped);\n\t\t}\n\t\treturn scoped;\n\t});\n\tcontext.rpc = rpc;\n\tfunction isTopLevelUnframed() {\n\t\ttry {\n\t\t\treturn typeof window !== \"undefined\" && window.self === window.top;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}\n\tasync function runSimpleAuthPrompt() {\n\t\tif (options.simpleAuth === false || !isTopLevelUnframed()) return;\n\t\tif (typeof globalThis.prompt !== \"function\") return;\n\t\tawait rpc.requestAuthCode().catch(() => {});\n\t\twhile (!rpc.isTrusted) {\n\t\t\tconst code = globalThis.prompt(\"devframe: enter the authentication code shown in your terminal\");\n\t\t\tif (code == null) return;\n\t\t\tconst trimmed = code.trim();\n\t\t\tif (!trimmed) continue;\n\t\t\tif (await rpc.requestTrustWithCode(trimmed)) return;\n\t\t}\n\t}\n\tasync function bootstrapAuth() {\n\t\tconst trusted = await mode.requestTrust();\n\t\tconst otpParam = options.otpParam ?? \"devframe_otp\";\n\t\tconst viaOtp = otpParam ? await authenticateWithUrlOtp(rpc, { param: otpParam }) : false;\n\t\tif (trusted || viaOtp || rpc.isTrusted) return;\n\t\tawait runSimpleAuthPrompt();\n\t}\n\tbootstrapAuthPromise = bootstrapAuth().then(() => {\n\t\tbootstrapAuthSettled = true;\n\t}, () => {\n\t\tbootstrapAuthSettled = true;\n\t});\n\tif (connectionMeta.mcp) import(\"../browser-agent-rpc-BXhoSh1z.mjs\").then(({ setupBrowserAgentRpcBridge }) => {\n\t\tif (!closed) disposeBrowserAgentBridge = setupBrowserAgentRpcBridge(rpc);\n\t}).catch(() => {});\n\tif (authChannel) authChannel.onmessage = (event) => {\n\t\tif (event.data?.type === \"auth-update\" && event.data.authToken) rpc.requestTrustWithToken(event.data.authToken);\n\t};\n\treturn rpc;\n}\n//#endregion\n//#region src/client/index.ts\nconst connectDevframe = getDevframeRpcClient;\n//#endregion\nexport { DevframeConnectionError, authenticateWithUrlOtp, connectDevframe, consumeOtpFromUrl, createClientSettings, createRpcStreamingClientHost, createScopedClientContext, getDevframeConnection, getDevframeRpcClient, isCallableStatus, readOtpFromUrl, registerDevframeViewerOrigin, registerWebMcpTools, resolveClientTransport, resolveSseUrl, resolveWebMcpModelContext, resolveWsUrl, setupDevframeConnection };\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nexport interface TimelineLayer {\n id: string;\n label: string;\n color: number; // 0xRRGGBB\n}\n\nexport interface TimelineEvent<TData = unknown> {\n /**\n * Stable identity, stamped on the Node side (`${epoch}-${seq}`) when the\n * event is received, so it survives the stream, `recent-events` and a\n * snapshot export. Absent on events still in the page runtime.\n */\n id?: string;\n layerId: string;\n /**\n * Milliseconds since recording started, stamped in the browser page\n * (`performance.now()` re-zeroed on each recording start; see\n * `runtime/timeline/clock.ts`). Not comparable to any Node-side clock.\n */\n time: number;\n data: TData;\n title?: string;\n subtitle?: string;\n /** Pairs a start event with its matching end event in the same update group. */\n groupId?: number | string;\n logType?: 'default' | 'warning' | 'error';\n meta?: {\n elementId?: number;\n tagName?: string;\n source?: {file: string; line: number};\n };\n}\n\nexport interface TimelineLayersState {\n recordingState: boolean;\n litLifecycleEnabled: boolean;\n litRenderEnabled: boolean;\n /**\n * Per-part `lit-debug` events (`template updating`, `set part`, `commit\n * *`, …) — one per binding on *every* render, so a ticking clock or\n * animation floods the layer. Off by default; the `lit-render` layer's\n * begin/end render pair already covers the common case.\n */\n litRenderVerboseEnabled: boolean;\n mouseEventEnabled: boolean;\n keyboardEventEnabled: boolean;\n}\n\nexport const TIMELINE_LAYERS: readonly TimelineLayer[] = [\n {id: 'lit-lifecycle', label: 'Lit Lifecycle', color: 0x4d63ff},\n {id: 'lit-render', label: 'Lit Render', color: 0x325cff},\n {id: 'lit-render-verbose', label: 'Lit Render (verbose)', color: 0x99aeff},\n {id: 'mouse', label: 'Mouse', color: 0xa451af},\n {id: 'keyboard', label: 'Keyboard', color: 0x8151af},\n];\n\nexport const DEFAULT_LAYERS_STATE: TimelineLayersState = {\n recordingState: false,\n litLifecycleEnabled: true,\n litRenderEnabled: true,\n litRenderVerboseEnabled: false,\n mouseEventEnabled: false,\n keyboardEventEnabled: false,\n};\n\n/**\n * Snapshot of the plugin's resolved feature settings, surfaced in the panel's\n * Settings tab. The plugin produces this at config time (explicit options >\n * LIT_PLUGIN_* env > defaults) and serves it from the panel server. It's the\n * baseline the panel shows; some HMR settings can then be overridden live (see\n * {@link SettingsOverride}).\n */\nexport interface FeatureSettings {\n hmr: {\n enabled: boolean;\n reconnect: boolean;\n onIncompatible: 'reload' | 'warn';\n indicatorEnabled: boolean;\n indicatorCount: boolean;\n };\n sourceOverlay: {\n enabled: boolean;\n /** Hotkey letter combined with Ctrl+Shift to toggle the overlay. */\n key: string;\n editor: string;\n throttleMs: number;\n };\n timeline: boolean;\n /**\n * Which layer supplied each setting, keyed like {@link SettingsOverride}\n * (plus the read-only source-overlay rows). Lets the panel label a value\n * \"Zed (env)\" and name the baseline a panel override replaced. Optional so\n * older producers (and snapshots) without it still type-check.\n */\n sources?: SettingSources;\n}\n\n/**\n * Where a resolved setting came from, in precedence order after a panel\n * override: an explicit `litPlugin({...})` option, a `LIT_PLUGIN_*` env var,\n * or the built-in default.\n */\nexport type SettingSource = 'option' | 'env' | 'default';\n\n/** Per-setting {@link SettingSource}, as carried on {@link FeatureSettings}. */\nexport interface SettingSources {\n hmrReconnect?: SettingSource;\n hmrOnIncompatible?: SettingSource;\n hmrIndicatorVisible?: SettingSource;\n hmrIndicatorCount?: SettingSource;\n sourceOverlayEditor?: SettingSource;\n sourceOverlayKey?: SettingSource;\n sourceOverlayThrottleMs?: SettingSource;\n}\n\n/**\n * Runtime overrides the panel applies on top of the resolved env config, for\n * settings whose runtime is already injected (so they can change live). A\n * feature disabled at config time has no runtime, so it can't be enabled here\n * — only the behaviour of already-enabled features is overridable.\n *\n * Persisted under {@link SETTINGS_OVERRIDE_LS_KEY} (the panel and app share an\n * origin) so overrides survive reloads, and pushed live over\n * {@link SETTINGS_OVERRIDE_CHANNEL} via Vite HMR for immediate effect.\n */\nexport interface SettingsOverride {\n hmrReconnect?: boolean;\n hmrOnIncompatible?: 'reload' | 'warn';\n hmrIndicatorVisible?: boolean;\n hmrIndicatorCount?: boolean;\n /** Built-in editor key for the source overlay's open-in-editor target. */\n sourceOverlayEditor?: string;\n /**\n * Flash a short outline over every Lit element that completes an update.\n * Pure preference (no config-time baseline), so `undefined` reads as off.\n */\n flashUpdates?: boolean;\n /**\n * Colour the flash by how often the element updated in the last second,\n * calm to hot, instead of one flat colour. Only meaningful with\n * {@link SettingsOverride.flashUpdates}.\n */\n flashUpdatesRamp?: boolean;\n /**\n * Mirror the timeline into Chrome DevTools' Performance panel as custom\n * tracks (via `console.timeStamp`), independent of panel recording. Pure\n * preference (no config-time baseline), so `undefined` reads as off.\n */\n chromeTracks?: boolean;\n}\n\n/**\n * Built-in editors the source overlay can open files in. Keep in sync with\n * BUILTIN_EDITORS in lib/runtime/source-overlay/editors.ts.\n */\nexport const SOURCE_OVERLAY_EDITORS: ReadonlyArray<{\n value: string;\n label: string;\n}> = [\n {value: 'vscode', label: 'VS Code'},\n {value: 'cursor', label: 'Cursor'},\n {value: 'zed', label: 'Zed'},\n {value: 'idea', label: 'IntelliJ'},\n {value: 'windsurf', label: 'Windsurf'},\n];\n\n/** localStorage key holding the {@link SettingsOverride}. */\nexport const SETTINGS_OVERRIDE_LS_KEY = 'lit-devtools-overrides';\n\n/**\n * The resolved config value each overridden key was set against, recorded so\n * the Settings tab can notice when `.env` or plugin options moved on. Kept\n * beside the {@link SettingsOverride}, never inside it: the runtime applies and\n * receives the override as-is and has no use for these.\n */\nexport type OverrideBaselines = Partial<\n Record<\n | 'hmrReconnect'\n | 'hmrOnIncompatible'\n | 'hmrIndicatorVisible'\n | 'hmrIndicatorCount'\n | 'sourceOverlayEditor',\n unknown\n >\n>;\n\n/** localStorage key holding the {@link OverrideBaselines}. */\nexport const OVERRIDE_BASELINES_LS_KEY = 'lit-devtools-override-baselines';\n\n/** Vite HMR channel the server uses to push overrides to the app runtime. */\nexport const SETTINGS_OVERRIDE_CHANNEL = 'lit-devtools:settings-override';\n\n/**\n * Vite HMR channel the DevTools \"toggle source overlay\" command uses to tell\n * the app runtime to toggle the overlay (the command handler runs server-side).\n */\nexport const SOURCE_OVERLAY_TOGGLE_CHANNEL =\n 'lit-devtools:toggle-source-overlay';\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Shared wire contract between the Lit devframe's node-side definition\n * ({@link ../definition.ts}) and its panel: shared-state / streaming /\n * RPC-function names, their payload shapes, and the `devframe` registry\n * augmentations that type them end to end.\n *\n * @see plans/devframe-foundation.md\n */\n\nimport {DEFAULT_LAYERS_STATE} from '../../types/timeline.js';\nimport type {\n FeatureSettings,\n OverrideBaselines,\n SettingsOverride,\n TimelineEvent,\n TimelineLayer,\n TimelineLayersState,\n} from '../../types/timeline.js';\nimport type {\n InspectorCommand,\n InspectorDetails,\n InspectorMessage,\n InspectorTreeNode,\n} from '../../types/inspector.js';\nimport type {HmrIncompatibilityEvent} from '../../types/hmr-incompatibility.js';\nimport type {ComponentRollup, UpdateCycle} from '../timeline/derive.js';\n\n/** The devframe's scope id. RPC names become `lit:*`, MCP wire names `lit_*`. */\nexport const LIT_DEVFRAME_ID = 'lit';\n\n/** Shared-state key holding the {@link SessionState} snapshot. */\nexport const SESSION_STATE_KEY = 'session';\n\n/** Streaming channel name the timeline event batches are pushed on. */\nexport const TIMELINE_STREAM_NAME = 'timeline';\n\n/**\n * Id of the one long-lived timeline stream. Fixed rather than discovered:\n * there is exactly one page feed per dev session, so the panel can subscribe\n * without a round trip to look the id up. The node side re-`start()`s this id\n * if the transport dropped the stream after the last subscriber left.\n */\nexport const TIMELINE_STREAM_ID = 'live';\n\n/**\n * Cap on the node-side recent-events ring buffer. It is also the history a\n * (re)connecting panel is seeded with (see {@link RPC_TIMELINE_HISTORY}).\n */\nexport const RECENT_EVENTS_BUFFER_SIZE = 512;\n\n/** Bare (unscoped) name of the `get-meta` query. */\nexport const RPC_GET_META = 'get-meta';\n\n/** Bare name of the `list-components` query. */\nexport const RPC_LIST_COMPONENTS = 'list-components';\n\n/** Bare name of the `component-details` query. */\nexport const RPC_COMPONENT_DETAILS = 'component-details';\n\n/** Bare name of the `recent-events` query. */\nexport const RPC_RECENT_EVENTS = 'recent-events';\n\n/**\n * Bare name of the `timeline-history` query: the node's whole recent-events\n * buffer, oldest first, as `TimelineEvent[]`. What a live panel seeds itself\n * with on connect, since the stream only carries events from then on. Not\n * `recent-events`, whose live answer is filtered and capped for agents.\n */\nexport const RPC_TIMELINE_HISTORY = 'timeline-history';\n\n/** Bare name of the `update-summary` query. */\nexport const RPC_UPDATE_SUMMARY = 'update-summary';\n\n/** Bare name of the `inspect` action. */\nexport const RPC_INSPECT = 'inspect';\n\n/** Bare name of the `set-recording` action. */\nexport const RPC_SET_RECORDING = 'set-recording';\n\n/** Bare name of the `toggle-layer` action. */\nexport const RPC_TOGGLE_LAYER = 'toggle-layer';\n\n/** Bare name of the `set-settings-override` action. */\nexport const RPC_SET_SETTINGS_OVERRIDE = 'set-settings-override';\n\n/** Bare name of the `open-source` action. */\nexport const RPC_OPEN_SOURCE = 'open-source';\n\n/** Arguments for {@link RPC_OPEN_SOURCE}. */\nexport interface OpenSourceArgs {\n /**\n * The path as the panel has it: what the transform injected, so relative\n * to the Vite root (or absolute, when the file lives outside it).\n */\n file: string;\n line?: number;\n}\n\n/** What {@link RPC_OPEN_SOURCE} reports back. */\nexport interface OpenSourceResult {\n /**\n * False when no open service is installed on the host, which is the\n * panel's cue to fall back to `/__lit-open-in-editor`. Also false when the\n * file is missing or outside the allowed roots; the endpoint refuses those\n * paths too.\n */\n opened: boolean;\n}\n\n/** Freeze the current session into a static panel directory. */\nexport const RPC_EXPORT_SNAPSHOT = 'export-snapshot';\n\n/** Arguments for {@link RPC_EXPORT_SNAPSHOT}. */\nexport interface ExportSnapshotArgs {\n /**\n * Where to write. Relative paths resolve against the dev server's cwd,\n * and the result has to stay beneath it. Defaults to\n * `lit-devtools-snapshot`. An existing directory is only replaced when it\n * holds an earlier snapshot.\n */\n outDir?: string;\n}\n\n/** What {@link RPC_EXPORT_SNAPSHOT} reports back, for the panel to display. */\nexport interface ExportSnapshotResult {\n outDir: string;\n events: number;\n components: number;\n details: number;\n}\n\n/** Bare name of the `inspector-message` client (node → panel) event. */\nexport const RPC_INSPECTOR_MESSAGE = 'inspector-message';\n\n/** Bare name of the `hmr-incompatibilities` query. */\nexport const RPC_HMR_INCOMPATIBILITIES = 'hmr-incompatibilities';\n\n/** Bare name of the `hmr-incompatible` client (node → panel) event. */\nexport const RPC_HMR_INCOMPATIBLE = 'hmr-incompatible';\n\n/**\n * Bare name of the page-to-server event. A page runtime that is not on a Vite\n * dev server's HMR socket sends every channel message it would have sent over\n * `import.meta.hot` as `page-send(channel, data)`.\n */\nexport const RPC_PAGE_SEND = 'page-send';\n\n/**\n * Bare name of the server-to-page client event, the reverse direction of\n * {@link RPC_PAGE_SEND}: `page-receive(channel, data)`. Broadcast to every\n * connected client and marked optional, since the panel does not register it.\n */\nexport const RPC_PAGE_RECEIVE = 'page-receive';\n\n/**\n * Recording/layers snapshot shared between every surface (panel, page\n * runtime, MCP). Survives reconnect; mutated either by the `set-recording` /\n * `toggle-layer` actions below or directly by a panel through the generic\n * shared-state RPC devframe provides.\n *\n * `layers.recordingState` is the single authority for \"is recording\" — the\n * runtime's own layer state carries it, so a separate flag here would be a\n * second copy to keep in sync.\n */\nexport interface SessionState {\n layers: TimelineLayersState;\n /** Layers announced at runtime by app code through `addTimelineLayer()`. */\n customLayers: TimelineLayer[];\n}\n\nexport const DEFAULT_SESSION_STATE: SessionState = {\n layers: DEFAULT_LAYERS_STATE,\n customLayers: [],\n};\n\n/** Result of the `get-meta` query. */\nexport interface LitGetMetaResult {\n version: string;\n /** Built-in layers followed by any runtime-announced custom ones. */\n layers: TimelineLayer[];\n features: FeatureSettings | null;\n /** Channel and id to pass to `rpc.streaming.subscribe()`. */\n stream: {channel: string; id: string};\n}\n\n/** Argument of the `component-details` query. */\nexport interface ComponentDetailsArgs {\n id: number;\n}\n\n/** Argument of the `recent-events` query. */\nexport interface RecentEventsArgs {\n layerId?: string;\n elementId?: number;\n /**\n * Only events from the last `sinceMs` milliseconds, measured against\n * the newest event currently in the buffer — not wall-clock time.\n * `TimelineEvent.time` is \"ms since recording started\" in the page\n * (see `runtime/timeline/clock.ts`), which has no fixed relationship\n * to this process's clock.\n */\n sinceMs?: number;\n /** Default 50, hard ceiling 200 regardless of what's requested. */\n limit?: number;\n}\n\n/** Result of the `recent-events` query. */\nexport interface RecentEventsResult {\n /** Whether the timeline is currently recording. */\n recording: boolean;\n /** Most recent events matching the filters, oldest first. */\n events: TimelineEvent[];\n /** Total events currently held in the ring buffer, before filtering. */\n bufferSize: number;\n /** True if filtering matched more events than were returned. */\n truncated: boolean;\n}\n\n/** Argument of the `update-summary` query. */\nexport interface UpdateSummaryArgs {\n /** Restrict to one component, by tag name. */\n tagName?: string;\n /** Same window semantics as {@link RecentEventsArgs.sinceMs}. */\n sinceMs?: number;\n /** Cycles returned (the component totals always cover the whole window).\n * Default 50, hard ceiling 200. */\n limit?: number;\n}\n\n/** Result of the `update-summary` query. */\nexport interface UpdateSummaryResult {\n /** Whether the timeline is currently recording. */\n recording: boolean;\n /** Per-component totals over the window, slowest first. */\n components: ComponentRollup[];\n /** The most recent update cycles in the window, oldest first. */\n cycles: UpdateCycle[];\n /** Total events currently held in the ring buffer, before derivation. */\n bufferSize: number;\n /** True if more cycles were derived than were returned. */\n truncated: boolean;\n}\n\n/** Argument of the `set-recording` action. */\nexport interface SetRecordingArgs {\n recording: boolean;\n}\n\n/** Argument of the `toggle-layer` action. */\nexport interface ToggleLayerArgs {\n layerId: string;\n enabled: boolean;\n}\n\n/**\n * Maps a {@link TimelineLayer.id} to the {@link TimelineLayersState} flag\n * that gates it. Custom layers have no flag and are always on.\n */\nexport const LAYER_FLAGS: Readonly<Record<string, keyof TimelineLayersState>> =\n {\n 'lit-lifecycle': 'litLifecycleEnabled',\n 'lit-render': 'litRenderEnabled',\n 'lit-render-verbose': 'litRenderVerboseEnabled',\n mouse: 'mouseEventEnabled',\n keyboard: 'keyboardEventEnabled',\n };\n\n// Hand-typed rather than derived through `RpcDefinitionsToFunctionsWithNamespace`\n// (also exported by `devframe/rpc`): the definitions themselves live in\n// definition.ts next to their handlers, and hand-typing here avoids a\n// value-level dependency from this shared-contract module back onto it.\ndeclare module 'devframe' {\n interface DevframeRpcServerFunctions {\n 'lit:get-meta': () => Promise<LitGetMetaResult>;\n 'lit:list-components': () => Promise<InspectorTreeNode[]>;\n 'lit:component-details': (\n args: ComponentDetailsArgs\n ) => Promise<InspectorDetails | null>;\n 'lit:recent-events': (\n args?: RecentEventsArgs\n ) => Promise<RecentEventsResult>;\n 'lit:timeline-history': () => Promise<TimelineEvent[]>;\n 'lit:update-summary': (\n args?: UpdateSummaryArgs\n ) => Promise<UpdateSummaryResult>;\n 'lit:inspect': (command: InspectorCommand) => Promise<void>;\n 'lit:set-recording': (args: SetRecordingArgs) => Promise<void>;\n 'lit:toggle-layer': (args: ToggleLayerArgs) => Promise<void>;\n 'lit:set-settings-override': (override: SettingsOverride) => Promise<void>;\n 'lit:open-source': (args: OpenSourceArgs) => Promise<OpenSourceResult>;\n 'lit:export-snapshot': (\n args: ExportSnapshotArgs\n ) => Promise<ExportSnapshotResult>;\n 'lit:hmr-incompatibilities': () => Promise<HmrIncompatibilityEvent[]>;\n 'lit:page-send': (channel: string, data?: unknown) => void;\n }\n\n interface DevframeRpcClientFunctions {\n 'lit:inspector-message': (message: InspectorMessage) => void;\n 'lit:hmr-incompatible': (event: HmrIncompatibilityEvent) => void;\n 'lit:page-receive': (channel: string, data?: unknown) => void;\n }\n\n interface DevframeSettingsRegistry {\n lit: {\n /** Panel chrome preference. Mirrors `COLOR_SCHEME_LS_KEY`. */\n appearance?: 'auto' | 'dark' | 'light';\n /**\n * The Settings tab's live overrides, stored as one blob the way the\n * panel already treats them. Mirrors `SETTINGS_OVERRIDE_LS_KEY`, which\n * stays: the page runtime reads it synchronously at module-init time,\n * long before any client exists, and every settings-store read is\n * async by design.\n */\n override?: SettingsOverride;\n /**\n * The config value each overridden key was set against. A sibling of\n * `override` so the runtime never sees it. Mirrors\n * `OVERRIDE_BASELINES_LS_KEY`.\n */\n overrideBaselines?: OverrideBaselines;\n };\n }\n}\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The panel's single connection to the node side.\n *\n * The panel is served by the devframe host as a static SPA, so\n * `connectDevframe()` discovers the node side from the page URL — it reads\n * `__connection.json` next to `document.baseURI`, then dials the host's\n * WebSocket and completes the trust handshake. Every view shares one\n * connection through {@link litRpc}; opening a second would mean a second\n * socket and a second handshake.\n *\n * Replaces the old transport, where each view opened its own `EventSource`\n * against `/__lit-devtools-events` and POSTed to bespoke endpoints.\n */\n\nimport {connectDevframe, getDevframeConnection} from 'devframe/client';\nimport type {DevframeScopedClientContext} from 'devframe/client';\nimport type {SettingsForNamespace} from 'devframe';\nimport {LIT_DEVFRAME_ID} from '../lib/devframe/protocol.js';\nimport type {LitGetMetaResult} from '../lib/devframe/protocol.js';\n\n/**\n * The `lit:`-scoped client. The second parameter is what makes\n * `client.settings` typed against `DevframeSettingsRegistry.lit` (see\n * `lib/devframe/protocol.ts`) instead of a bare `Record<string, any>` —\n * `client.scope()` infers it, but this alias has to say so.\n */\nexport type LitClient = DevframeScopedClientContext<\n typeof LIT_DEVFRAME_ID,\n SettingsForNamespace<typeof LIT_DEVFRAME_ID>\n>;\n\nlet connecting: Promise<LitClient> | undefined;\n\n/**\n * The shared, `lit:`-scoped RPC client. Connects on first call; every later\n * call awaits the same connection.\n *\n * Rejects if the handshake never completes (the host is gone, or trust was\n * denied). Callers render an error state rather than retrying: the panel is\n * an iframe the developer can reload.\n */\nexport const litRpc = (): Promise<LitClient> =>\n (connecting ??= (async () => {\n const client = await connectDevframe();\n // The host mints a token per browser; until it does, calls would fail\n // with an auth error rather than waiting.\n await client.ensureTrusted();\n return client.scope(LIT_DEVFRAME_ID);\n })());\n\n/**\n * Whether this panel is a frozen snapshot rather than a live session.\n *\n * A static deploy answers queries out of a baked RPC dump and has no server\n * behind it, so anything that would *command* the page — refreshing the tree,\n * picking an element, toggling recording — has nothing to reach and is not\n * in the dump at all. Views check this to hide those affordances instead of\n * offering buttons that can only fail.\n *\n * Reads the already-resolved connection, so it is safe to call synchronously\n * during render once {@link litRpc} has settled; before that it reports\n * `false`, which is the right default for the live case.\n */\nexport const isSnapshot = (): boolean =>\n getDevframeConnection()?.connectionMeta.backend === 'static';\n\n/** One-shot metadata: version, layer list, resolved settings, stream address. */\nexport const getMeta = async (): Promise<LitGetMetaResult> => {\n const rpc = await litRpc();\n return rpc.rpc.call('get-meta');\n};\n\n/**\n * Formats a connection failure for display. `DevframeConnectionError` carries\n * a `type` of `'connection' | 'auth' | 'timeout'`; anything else is shown as\n * its message.\n */\nexport const describeError = (error: unknown): string => {\n if (error && typeof error === 'object' && 'type' in error) {\n const type = (error as {type: unknown}).type;\n if (type === 'auth') {\n return 'DevTools denied this panel access. Approve the connection in your terminal, then reload.';\n }\n if (type === 'timeout') {\n return 'The Lit plugin did not answer in time. Is the dev server still running?';\n }\n if (type === 'connection') {\n return 'Lost the connection to the dev server. Reload the panel once it is back.';\n }\n }\n return error instanceof Error ? error.message : String(error);\n};\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Opening a source location from the panel.\n *\n * Two paths, in order:\n *\n * 1. `lit:open-source`, which hands the location to `@devframes/service-open`\n * (the host-wide wire service a Vite hub always installs). The hop through\n * our own node side is what makes the path right: `file` is relative to\n * the Vite root, and the service resolves relative paths against the\n * host's `workspaceRoot`, which is a different directory whenever the\n * served app isn't the workspace itself.\n * 2. `/__lit-open-in-editor`, the plugin's own endpoint. Still the only path\n * the in-page source overlay has (it carries no devframe client and must\n * work with `timeline: false`), so it is not going anywhere; here it is\n * the fallback for a host with no open service.\n *\n * Both end up in `launch-editor`, so the user-visible result is the same.\n */\n\nimport {litRpc} from './client.js';\n\n/** Today's endpoint. The fallback, and what the source overlay always uses. */\nconst openViaEndpoint = async (file: string, line: number): Promise<void> => {\n const params = new URLSearchParams({file, line: String(line)});\n const res = await fetch(`/__lit-open-in-editor?${params.toString()}`);\n if (!res.ok) {\n throw new Error(\n `open-in-editor failed (${res.status}): ${await res.text()}`\n );\n }\n};\n\n/**\n * Open `file` at `line` in the developer's editor. Never throws: a failure is\n * logged, since there is no panel surface for it and the developer can always\n * open the file themselves.\n */\nexport const openInEditor = async (\n file: string,\n line: number\n): Promise<void> => {\n try {\n const client = await litRpc();\n const {opened} = await client.rpc.call('open-source', {file, line});\n if (opened) return;\n } catch (err) {\n console.warn(\n '[lit-devtools] open-source failed, falling back to the endpoint',\n err\n );\n }\n try {\n await openViaEndpoint(file, line);\n } catch (err) {\n console.warn('[lit-devtools] open-in-editor failed', err);\n }\n};\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {LitElement, html, css, nothing} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {tokens} from '../lib/tokens.js';\nimport type {TimelineSpan} from '../lib/timeline/derive.js';\nimport {openInEditor} from './open-in-editor.js';\n\n/**\n * Detail pane for one selected timeline span: layer, time, duration, changed\n * properties, element, source and raw data.\n *\n * Shared by the List and Tracks presentations of the Timeline so a selection\n * reads the same in both. The **filter** link only makes sense where there is\n * an element filter to set, so it is shown when `filterable` is set and\n * reported as an `element-filter` event; **inspect** bubbles an\n * `inspect-element` event up to the panel shell.\n */\n@customElement('timeline-span-detail')\nexport class TimelineSpanDetail extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n border-top: 1px solid var(--lit-devtools-border);\n background: var(--lit-devtools-surface-low);\n padding: var(--lit-devtools-space-5) var(--lit-devtools-space-5);\n font-size: var(--lit-devtools-text-2xs);\n font-family: var(--lit-devtools-font-mono);\n color: var(--lit-devtools-text-secondary);\n flex-shrink: 0;\n max-height: 130px;\n overflow-y: auto;\n }\n table {\n border-collapse: collapse;\n width: 100%;\n }\n td {\n padding: var(--lit-devtools-space-1) var(--lit-devtools-space-4)\n var(--lit-devtools-space-1) 0;\n vertical-align: top;\n }\n .key {\n color: var(--lit-devtools-text-muted);\n white-space: nowrap;\n }\n .val {\n color: var(--lit-devtools-text);\n word-break: break-all;\n }\n a {\n color: var(--lit-devtools-accent);\n text-decoration: none;\n cursor: pointer;\n }\n a:hover {\n text-decoration: underline;\n }\n .filter-link {\n margin-left: var(--lit-devtools-space-4);\n font-size: var(--lit-devtools-text-2xs);\n }\n `,\n ];\n\n @property({attribute: false}) span: TimelineSpan | undefined;\n /** Offer the **filter** link (both presentations honour the element filter). */\n @property({type: Boolean}) filterable = false;\n\n private _emit(type: 'element-filter' | 'inspect-element', id: number) {\n this.dispatchEvent(\n new CustomEvent(type, {\n detail: {id},\n bubbles: true,\n composed: true,\n })\n );\n }\n\n override render() {\n const row = this.span;\n if (!row) return nothing;\n const {meta} = row;\n const src = meta?.source;\n // Raw rows carry exactly one event; a collapsed span carries its start and\n // (once it closes) its end, whose payloads are the same minus `changed`.\n const data = row.events[0]?.data;\n const id = meta?.elementId;\n return html`\n <table>\n <tr>\n <td class=\"key\">layer</td>\n <td class=\"val\">${row.layerId}</td>\n </tr>\n <tr>\n <td class=\"key\">time</td>\n <td class=\"val\">${row.start.toFixed(3)} ms</td>\n </tr>\n ${\n row.duration !== undefined\n ? html`<tr>\n <td class=\"key\">duration</td>\n <td class=\"val\">${row.duration.toFixed(3)} ms</td>\n </tr>`\n : nothing\n }\n ${\n row.changed?.length\n ? html`<tr>\n <td class=\"key\">changed</td>\n <td class=\"val\">${row.changed.join(', ')}</td>\n </tr>`\n : nothing\n }\n ${\n meta?.tagName\n ? html`<tr>\n <td class=\"key\">element</td>\n <td class=\"val\">\n &lt;${meta.tagName}&gt; #${id}\n ${\n id != null && this.filterable\n ? html`<a\n class=\"filter-link\"\n @click=${() => this._emit('element-filter', id)}\n >filter</a\n >`\n : nothing\n }${\n id != null\n ? html`<a\n class=\"filter-link\"\n title=\"Open this element in the Components tab\"\n @click=${() => this._emit('inspect-element', id)}\n >inspect</a\n >`\n : nothing\n }\n </td>\n </tr>`\n : nothing\n }\n ${\n src\n ? html`<tr>\n <td class=\"key\">source</td>\n <td class=\"val\">\n <a\n class=\"src-link\"\n title=\"Open this file in your editor\"\n @click=${() => openInEditor(src.file, src.line)}\n >${src.file}:${src.line}</a\n >\n </td>\n </tr>`\n : nothing\n }\n ${\n data != null\n ? html`<tr>\n <td class=\"key\">data</td>\n <td class=\"val\">${JSON.stringify(data)}</td>\n </tr>`\n : nothing\n }\n </table>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'timeline-span-detail': TimelineSpanDetail;\n }\n}\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {LitElement, html, css, nothing} from 'lit';\nimport {customElement, property, state} from 'lit/decorators.js';\nimport {ref, createRef} from 'lit/directives/ref.js';\nimport {virtualize, virtualizerRef} from '@lit-labs/virtualizer/virtualize.js';\nimport type {VirtualizerHostElement} from '@lit-labs/virtualizer/virtualize.js';\nimport {tokens} from '../lib/tokens.js';\nimport type {TimelineEvent} from '../types/timeline.js';\nimport type {TimelineSpan} from '../lib/timeline/derive.js';\nimport {layerColor} from './timeline-layers.js';\nimport type {LayerState} from './timeline-layers.js';\nimport {compileRegex, filterSpans} from '../lib/timeline/filter.js';\nimport './timeline-span-detail.js';\n\nconst RAW_KEY_PREFIX = 'raw:';\n\n/** Whether `key` names a Raw-mode row rather than a collapsed span. */\nexport const isRawKey = (key: string): boolean =>\n key.startsWith(RAW_KEY_PREFIX);\n\n/**\n * Adapts one raw event to the row shape for the Raw toggle. Deliberately\n * drops `groupId`: pairing is what the collapsed mode is for, and without it\n * the duration cell reads \"point event\" rather than \"still open\".\n */\nconst rawRow = (event: TimelineEvent, index: number): TimelineSpan => ({\n layerId: event.layerId,\n key: `${RAW_KEY_PREFIX}${index}`,\n name: event.title ?? event.layerId,\n start: event.time,\n subtitle: event.subtitle,\n logType: event.logType,\n meta: event.meta,\n events: [event],\n});\n\n/** Lit updates are routinely sub-millisecond, so one decimal is not enough. */\nconst formatMs = (ms: number): string =>\n ms < 1 ? `${ms.toFixed(2)}ms` : `${ms.toFixed(1)}ms`;\n\nconst renderDuration = (row: TimelineSpan): string => {\n if (row.duration !== undefined) return formatMs(row.duration);\n // A span with a pairing id but no end is still running, or its end fell out\n // of the buffer. A point event never had one to wait for.\n return row.groupId === undefined ? '' : '…';\n};\n\n/**\n * Scrollable list of recorded timeline events with an inline detail pane.\n *\n * Rows are {@link TimelineSpan}s by default, not raw events: the capture\n * layers emit a start and an end per phase, so one update tick of one\n * component is five to ten raw rows whose durations the reader would\n * otherwise subtract by hand. The **Raw** toggle restores the per-event view\n * for ordering questions and for custom layers the pairing rules do not model.\n *\n * The spans and the selection belong to `timeline-view`, which shares both\n * with the Tracks presentation: this element reads `.spans` and\n * `.selectedKey` and reports clicks as a `span-select` event. It still reads\n * `.events` for Raw mode and the element picker.\n */\n@customElement('timeline-event-list')\nexport class TimelineEventList extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: flex;\n flex-direction: column;\n flex: 1;\n overflow: hidden;\n }\n .filterbar {\n display: flex;\n align-items: center;\n gap: var(--lit-devtools-space-3);\n padding: var(--lit-devtools-space-2) var(--lit-devtools-space-5);\n border-bottom: 1px solid var(--lit-devtools-border);\n font-size: var(--lit-devtools-text-2xs);\n color: var(--lit-devtools-text-muted);\n flex-shrink: 0;\n }\n .filterbar button {\n background: var(--lit-devtools-surface-elevated);\n color: var(--lit-devtools-text-muted);\n border: 1px solid var(--lit-devtools-border-strong);\n border-radius: var(--lit-devtools-radius-sm);\n padding: var(--lit-devtools-space-1) var(--lit-devtools-space-3);\n font-size: var(--lit-devtools-text-2xs);\n font-family: var(--lit-devtools-font-mono);\n cursor: pointer;\n }\n .filterbar button.on {\n color: var(--lit-devtools-text);\n border-color: var(--lit-devtools-accent);\n }\n .filterbar .count {\n margin-left: auto;\n color: var(--lit-devtools-text-muted);\n }\n .scroll {\n flex: 1;\n overflow-y: auto;\n padding: var(--lit-devtools-space-2) 0;\n }\n .empty {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n gap: var(--lit-devtools-space-4);\n color: var(--lit-devtools-text-muted);\n font-size: var(--lit-devtools-text-xs);\n }\n .hint {\n font-size: var(--lit-devtools-text-2xs);\n color: var(--lit-devtools-text-muted);\n }\n .row {\n /* The virtualizer positions rows absolutely; stretch them back. */\n box-sizing: border-box;\n width: 100%;\n display: flex;\n align-items: baseline;\n gap: var(--lit-devtools-space-4);\n padding: var(--lit-devtools-space-2) var(--lit-devtools-space-5);\n font-size: var(--lit-devtools-text-2xs);\n font-family: var(--lit-devtools-font-mono);\n border-bottom: 1px solid var(--lit-devtools-border);\n cursor: pointer;\n }\n .row:hover {\n background: var(--lit-devtools-surface-hover);\n }\n .row.selected {\n background: var(--lit-devtools-surface-active);\n }\n .time {\n color: var(--lit-devtools-text-muted);\n flex-shrink: 0;\n width: 56px;\n text-align: right;\n }\n .dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n flex-shrink: 0;\n margin-top: 2px;\n }\n .title {\n flex: 1;\n color: var(--lit-devtools-text);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .subtitle {\n color: var(--lit-devtools-text-muted);\n flex-shrink: 0;\n max-width: 200px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .changed {\n color: var(--lit-devtools-accent);\n flex-shrink: 0;\n max-width: 220px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .dur {\n color: var(--lit-devtools-text-secondary);\n flex-shrink: 0;\n width: 62px;\n text-align: right;\n }\n .dur.open {\n color: var(--lit-devtools-text-muted);\n }\n `,\n ];\n\n @property({type: Array}) events: TimelineEvent[] = [];\n /** `toSpans(events)`, derived once by `timeline-view` for both views. */\n @property({type: Array}) spans: TimelineSpan[] = [];\n @property({type: Array}) layers: LayerState[] = [];\n /** Key of the selected row. Keys survive re-derivation; the row objects\n * themselves are rebuilt whenever the event buffer changes. */\n @property({attribute: false}) selectedKey: string | null = null;\n /** Element id to filter the list to, or null for all elements. Owned by\n * `timeline-view`, which applies the same filter to the tracks. */\n @property({attribute: false}) elementFilter: number | null = null;\n /** Case-insensitive regex (source text) matched against tag/title/subtitle.\n * Owned by `timeline-view`, like `elementFilter`. */\n @property({attribute: false}) regex = '';\n /** One row per raw event instead of one per collapsed span. */\n @state() private _raw = false;\n\n private readonly _scrollRef = createRef<HTMLDivElement>();\n /** Rows for the current mode, recomputed only when the events,\n * spans or Raw mode change — deriving in `render()` would re-pair the whole buffer\n * on every keystroke in the regex box. */\n private _rowsCache: TimelineSpan[] = [];\n /** `_rowsCache` after the layer/element/regex filters, recomputed only when\n * one of those or `_rowsCache` itself changes — not on every render (e.g.\n * selecting a row must not re-filter up to `MAX_EVENTS` rows). */\n private _visibleCache: TimelineSpan[] = [];\n\n override willUpdate(changed: Map<string, unknown>) {\n if (changed.has('events') || changed.has('spans') || changed.has('_raw')) {\n // A selection that is not among these rows (a span key in Raw mode, or\n // one that fell out of the buffer) just shows as unselected here;\n // `timeline-view` owns clearing it.\n this._rowsCache = this._raw ? this.events.map(rawRow) : this.spans;\n }\n if (\n changed.has('events') ||\n changed.has('spans') ||\n changed.has('_raw') ||\n changed.has('layers') ||\n changed.has('elementFilter') ||\n changed.has('regex')\n ) {\n // Compile once per relevant change, not once per render; an invalid\n // pattern disables the filter (rather than hiding everything).\n this._visibleCache = filterSpans(\n this._rowsCache.filter((row) => this._layerOn(row)),\n this.elementFilter,\n compileRegex(this.regex).re\n );\n }\n }\n\n override updated(changed: Map<string, unknown>) {\n if (changed.has('events')) {\n const el = this._scrollRef.value;\n if (el) el.scrollTop = el.scrollHeight;\n }\n }\n\n private _select(key: string | null) {\n this.dispatchEvent(\n new CustomEvent<{key: string | null}>('span-select', {\n detail: {key},\n bubbles: true,\n composed: true,\n })\n );\n }\n\n /**\n * Scrolls the selected row into view, or to the newest row when nothing is\n * selected. `timeline-view` calls this when switching back from Tracks: the\n * list was hidden while the selection moved, so its own auto-scroll could\n * not follow.\n */\n reveal(): void {\n const el = this._scrollRef.value as\n | (HTMLDivElement & VirtualizerHostElement)\n | undefined;\n if (!el) return;\n const index =\n this.selectedKey === null\n ? -1\n : this._visibleCache.findIndex((row) => row.key === this.selectedKey);\n if (index === -1) {\n el.scrollTop = el.scrollHeight;\n return;\n }\n // A list that has only just received its rows has not laid out yet, and\n // the virtualizer throws until it has; wait for it a few frames.\n const attempt = (left: number): void => {\n try {\n el[virtualizerRef]?.element(index)?.scrollIntoView({block: 'center'});\n } catch {\n if (left > 0) requestAnimationFrame(() => attempt(left - 1));\n }\n };\n attempt(30);\n }\n\n private _layerOn(row: TimelineSpan): boolean {\n const l = this.layers.find((l) => l.id === row.layerId);\n return !l || l.enabled;\n }\n\n override render() {\n const visible = this._visibleCache;\n const selected =\n this.selectedKey === null\n ? undefined\n : this._rowsCache.find((row) => row.key === this.selectedKey);\n return html`\n ${\n this.events.length > 0\n ? html`\n <div class=\"filterbar\">\n <button\n class=${this._raw ? 'on' : ''}\n title=\"Show one row per recorded event instead of collapsing start/end pairs\"\n @click=${() => {\n this._raw = !this._raw;\n // Raw and collapsed rows have different keys, so the\n // selection cannot carry across the switch.\n this._select(null);\n }}\n >\n Raw\n </button>\n <span class=\"count\"\n >${visible.length} / ${this._rowsCache.length}</span\n >\n </div>\n `\n : nothing\n }\n ${\n // Two separate scrollers, not one with a switched child: the\n // virtualizer owns its host's scroll height, so an empty state\n // rendered into it after Clear would sit thousands of px above view.\n visible.length === 0\n ? html`\n <div class=\"scroll\">\n <div class=\"empty\">\n <span>No events recorded.</span>\n <span class=\"hint\"\n >Press Record then interact with the page.</span\n >\n </div>\n </div>\n `\n : html`\n <div class=\"scroll\" ${ref(this._scrollRef)}>\n ${virtualize({\n scroller: true,\n items: visible,\n // The directive re-renders its previous index range against\n // a new `items` before the virtualizer recomputes it, so the\n // tail of that range can briefly be past the end.\n keyFunction: (row, i) => row?.key ?? i,\n renderItem: (row) => (row ? this._renderRow(row) : html``),\n })}\n </div>\n `\n }\n ${\n selected\n ? html`<timeline-span-detail\n filterable\n .span=${selected}\n ></timeline-span-detail>`\n : nothing\n }\n `;\n }\n\n /** One row of the virtualized list (`virtualize`'s `renderItem`). */\n private _renderRow(row: TimelineSpan) {\n return html`\n <div\n class=\"row ${this.selectedKey === row.key ? 'selected' : ''}\"\n @click=${() => this._select(row.key)}\n >\n <span class=\"time\">${row.start.toFixed(1)}ms</span>\n <span\n class=\"dot\"\n style=${'background:' + layerColor(this.layers, row.layerId)}\n ></span>\n <span class=\"title\">${row.name}</span>\n ${\n row.changed?.length\n ? html`<span class=\"changed\">${row.changed.join(', ')}</span>`\n : nothing\n }\n <span class=\"subtitle\">${row.subtitle ?? nothing}</span>\n <span class=\"dur ${row.duration === undefined ? 'open' : ''}\"\n >${renderDuration(row)}</span\n >\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'timeline-event-list': TimelineEventList;\n }\n}\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Layout for the Timeline's track view: one horizontal lane per layer on a\n * shared time axis.\n *\n * The list answers \"what happened, in what order, to whom\". It cannot show\n * concurrency or rhythm — which layers fire together, how a click lines up\n * with the update tick it caused, how long a tick is next to its neighbours.\n * This module turns the same {@link TimelineSpan}s into lanes and rows, and\n * owns the arithmetic between milliseconds and pixels, so the element that\n * draws them (`panel/timeline-tracks.ts`) is only DOM.\n *\n * Pure and dependency-free, like `derive.ts`, so it is unit-tested without a\n * browser.\n */\n\nimport type {TimelineSpan} from './derive.js';\n\n/**\n * Spans in one row of a lane, sorted by start and never overlapping, so\n * {@link visibleRange} can binary-search them.\n */\nexport type TrackRow = TimelineSpan[];\n\n/** One lane: every span of one layer, packed into non-overlapping rows. */\nexport interface Track {\n layerId: string;\n rows: TrackRow[];\n}\n\n/**\n * Where a span stops occupying its row. A point event occupies only its own\n * instant; a span whose end has not arrived (still running, or its end fell\n * out of the buffer) occupies the rest of the recording, because that is\n * where it is drawn — up to the live edge.\n */\nexport const occupiedEnd = (span: TimelineSpan): number => {\n if (span.end !== undefined) return span.end;\n return span.groupId === undefined ? span.start : Infinity;\n};\n\n/**\n * Groups spans into one track per layer, in `layers` order, then any layer\n * the spans mention that `layers` does not (a custom layer announced after the\n * last `get-meta`), in first-seen order. A layer with no spans still gets an\n * empty track, so a lane does not appear and vanish as events arrive.\n *\n * Within a track, spans are packed greedily: each goes into the first row\n * whose last span has ended by the time it starts. Lit's lifecycle phases\n * nest, so one update tick lands as `performUpdate` on row 0 and\n * `willUpdate` / `update` / `updated` side by side on row 1 — the flame shape\n * falls out of the packing without modelling it.\n */\nexport const buildTracks = (\n spans: readonly TimelineSpan[],\n layers: readonly {id: string}[]\n): Track[] => {\n const byLayer = new Map<string, TimelineSpan[]>();\n for (const layer of layers) byLayer.set(layer.id, []);\n for (const span of spans) {\n let list = byLayer.get(span.layerId);\n if (list === undefined) {\n list = [];\n byLayer.set(span.layerId, list);\n }\n list.push(span);\n }\n return [...byLayer].map(([layerId, list]) => ({\n layerId,\n rows: packRows(list),\n }));\n};\n\nconst packRows = (spans: TimelineSpan[]): TrackRow[] => {\n // `toSpans` already sorts by start; re-sort only if a caller did not.\n const sorted = spans.every(\n (s, i) => i === 0 || spans[i - 1]!.start <= s.start\n )\n ? spans\n : [...spans].sort((a, b) => a.start - b.start);\n const rows: TrackRow[] = [];\n const rowEnds: number[] = [];\n for (const span of sorted) {\n let row = rowEnds.findIndex((end) => end <= span.start);\n if (row === -1) {\n row = rows.length;\n rows.push([]);\n rowEnds.push(-Infinity);\n }\n rows[row]!.push(span);\n rowEnds[row] = occupiedEnd(span);\n }\n return rows;\n};\n\n/**\n * The recording's time bounds over `spans`: the earliest start, and the\n * latest instant anything is known to have happened (an end, or the start of\n * a span with none). The origin is the earliest start rather than zero\n * because the panel's buffer is capped and rolls its oldest events off; a\n * long recording would otherwise open on an empty stretch.\n */\nexport const timeBounds = (\n spans: readonly TimelineSpan[]\n): {origin: number; extent: number} => {\n if (spans.length === 0) return {origin: 0, extent: 0};\n let origin = Infinity;\n let last = -Infinity;\n for (const span of spans) {\n origin = Math.min(origin, span.start);\n last = Math.max(last, span.end ?? span.start);\n }\n return {origin, extent: last - origin};\n};\n\n/** Deepest zoom, in multiples of \"fit\": about a microsecond per pixel on a\n * second-long recording, past which there is nothing left to separate. */\nexport const MAX_ZOOM = 100_000;\n\n/** A recording with a single instant in it still needs a nonzero axis. */\nconst MIN_EXTENT_MS = 1;\n\n/** Mapping between recording time and pixels for the current zoom and pan. */\nexport interface TimeScale {\n pxPerMs: number;\n /** First and last millisecond inside the plot. */\n start: number;\n end: number;\n toX(ms: number): number;\n toMs(x: number): number;\n}\n\n/**\n * Builds the scale for a plot `width` pixels wide showing a recording that\n * begins at `originMs` and runs for `extentMs`.\n *\n * `zoom` is a multiple of \"fit\" (1 shows the whole recording); `pan` is how\n * many milliseconds past the origin the left edge sits. Both are clamped, so\n * callers can apply a raw wheel or drag delta and read back where it landed.\n */\nexport const timeScale = (\n originMs: number,\n extentMs: number,\n width: number,\n zoom = 1,\n pan = 0\n): TimeScale => {\n const extent = Math.max(extentMs, MIN_EXTENT_MS);\n const z = clampZoom(zoom);\n const visibleMs = extent / z;\n const p = clampPan(pan, extent, z);\n const pxPerMs = Math.max(width, 1) / visibleMs;\n const start = originMs + p;\n return {\n pxPerMs,\n start,\n end: start + visibleMs,\n toX: (ms) => (ms - start) * pxPerMs,\n toMs: (x) => start + x / pxPerMs,\n };\n};\n\nexport const clampZoom = (zoom: number): number =>\n Math.min(Math.max(Number.isNaN(zoom) ? 1 : zoom, 1), MAX_ZOOM);\n\n/** Keeps the visible window inside the recording. */\nexport const clampPan = (\n pan: number,\n extentMs: number,\n zoom: number\n): number => {\n const extent = Math.max(extentMs, MIN_EXTENT_MS);\n const max = extent - extent / clampZoom(zoom);\n return Math.min(Math.max(Number.isNaN(pan) ? 0 : pan, 0), max);\n};\n\n/** The pan that puts the live edge (the end of the recording) at the right\n * of the plot, for following a recording in progress. */\nexport const livePan = (extentMs: number, zoom: number): number =>\n clampPan(Infinity, extentMs, zoom);\n\n/**\n * Zooms by `factor` while keeping the millisecond under pixel `x` where it\n * is, which is what a wheel over a timeline is expected to do.\n */\nexport const zoomAt = (\n originMs: number,\n extentMs: number,\n width: number,\n zoom: number,\n pan: number,\n x: number,\n factor: number\n): {zoom: number; pan: number} => {\n const before = timeScale(originMs, extentMs, width, zoom, pan);\n const anchor = before.toMs(x);\n const nextZoom = clampZoom(clampZoom(zoom) * factor);\n const after = timeScale(originMs, extentMs, width, nextZoom, 0);\n const nextPan = anchor - originMs - x / after.pxPerMs;\n return {zoom: nextZoom, pan: clampPan(nextPan, extentMs, nextZoom)};\n};\n\n/**\n * Index range `[from, to)` of the spans in `row` that intersect the window\n * `[start, end]`, found by binary search so a zoomed-in lane renders a\n * handful of marks rather than walking thousands.\n *\n * Only the span just before the first one starting inside the window can\n * reach into it, because a row's spans never overlap.\n */\nexport const visibleRange = (\n row: TrackRow,\n start: number,\n end: number\n): [number, number] => {\n const firstAtOrAfter = (t: number, inclusive: boolean) => {\n let lo = 0;\n let hi = row.length;\n while (lo < hi) {\n const mid = (lo + hi) >> 1;\n const s = row[mid]!.start;\n if (inclusive ? s < t : s <= t) lo = mid + 1;\n else hi = mid;\n }\n return lo;\n };\n let from = firstAtOrAfter(start, true);\n if (from > 0 && occupiedEnd(row[from - 1]!) >= start) from--;\n const to = firstAtOrAfter(end, false);\n return [from, Math.max(from, to)];\n};\n\n/**\n * A round tick interval (1, 2 or 5 times a power of ten, in milliseconds) at\n * least `minMs` long, for axis labels that land on readable numbers.\n */\nexport const niceStep = (minMs: number): number => {\n if (!(minMs > 0) || !Number.isFinite(minMs)) return 1;\n const pow = 10 ** Math.floor(Math.log10(minMs));\n for (const m of [1, 2, 5, 10]) {\n if (m * pow >= minMs) return m * pow;\n }\n return 10 * pow;\n};\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {LitElement, html, css, nothing} from 'lit';\nimport {customElement, property, state} from 'lit/decorators.js';\nimport {ref, createRef} from 'lit/directives/ref.js';\nimport {tokens} from '../lib/tokens.js';\nimport type {TimelineSpan} from '../lib/timeline/derive.js';\nimport {\n buildTracks,\n clampPan,\n clampZoom,\n livePan,\n niceStep,\n timeBounds,\n timeScale,\n visibleRange,\n zoomAt,\n} from '../lib/timeline/tracks.js';\nimport type {TimeScale, Track} from '../lib/timeline/tracks.js';\nimport {layerColor} from './timeline-layers.js';\nimport type {LayerState} from './timeline-layers.js';\nimport './timeline-span-detail.js';\n\n/** Height of one packed row inside a lane. */\nconst ROW_PX = 14;\n/** Marks narrower than this draw as a fixed-width tick, so sub-millisecond\n * Lit phases stay visible at any zoom. */\nconst MIN_MARK_PX = 2;\n/** Rough spacing between axis labels. */\nconst TICK_PX = 90;\n/** A pointer that moves less than this between down and up was a click. */\nconst DRAG_SLOP_PX = 3;\n\nconst formatAxis = (ms: number, step: number): string =>\n step >= 1000\n ? `${(ms / 1000).toFixed(step >= 10_000 ? 0 : 1)}s`\n : `${ms.toFixed(step >= 1 ? 0 : step >= 0.1 ? 1 : 2)}ms`;\n\nconst describe = (span: TimelineSpan): string => {\n const parts = [span.name];\n if (span.subtitle) parts.push(span.subtitle);\n parts.push(`@ ${span.start.toFixed(2)}ms`);\n if (span.duration !== undefined) parts.push(`${span.duration.toFixed(3)}ms`);\n else if (span.groupId !== undefined) parts.push('still open');\n return parts.join(' · ');\n};\n\n/**\n * The Timeline's Tracks presentation: one horizontal lane per layer on a\n * shared, recording-relative time axis, so concurrency and rhythm are\n * visible — which layers fire together, how a click lines up with the update\n * tick it caused, how long one tick is next to its neighbours.\n *\n * The same {@link TimelineSpan}s as the list, and the same selection: a click\n * on a mark emits `span-select`, and `timeline-view` passes the key back to\n * both presentations. `spans` arrive already narrowed by the view's element\n * and regex filters; `selectedSpan` does not, so the detail outlives a filter\n * that hides the selected mark. `visibleTracks` is a panel-local view filter, not the\n * capture toggle.\n *\n * Wheel zooms around the cursor, drag pans, double-click fits the whole\n * recording again. While recording and not panned away, the view follows the\n * live edge the way the list auto-scrolls.\n *\n * DOM rather than canvas: marks are absolutely positioned elements, and only\n * the ones inside the visible window are rendered (binary search per row,\n * plus at most one tick per pixel column), which keeps node count bounded and\n * gives hover titles and keyboard focus for free.\n */\n@customElement('timeline-tracks')\nexport class TimelineTracks extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: flex;\n flex-direction: column;\n flex: 1;\n overflow: hidden;\n font-size: var(--lit-devtools-text-2xs);\n font-family: var(--lit-devtools-font-mono);\n --gutter: 120px;\n }\n .axis,\n .lane {\n display: flex;\n }\n .axis {\n flex-shrink: 0;\n height: 20px;\n border-bottom: 1px solid var(--lit-devtools-border);\n color: var(--lit-devtools-text-muted);\n }\n .gutter {\n flex: 0 0 var(--gutter);\n box-sizing: border-box;\n padding: 0 var(--lit-devtools-space-4);\n display: flex;\n align-items: center;\n gap: var(--lit-devtools-space-2);\n overflow: hidden;\n white-space: nowrap;\n border-right: 1px solid var(--lit-devtools-border);\n }\n .ticks {\n position: relative;\n flex: 1;\n overflow: hidden;\n }\n .tick-label {\n position: absolute;\n top: 3px;\n padding-left: var(--lit-devtools-space-2);\n border-left: 1px solid var(--lit-devtools-border-strong);\n white-space: nowrap;\n }\n .lanes {\n flex: 1;\n overflow-y: auto;\n cursor: grab;\n user-select: none;\n touch-action: none;\n }\n .lanes.dragging {\n cursor: grabbing;\n }\n .lane {\n border-bottom: 1px solid var(--lit-devtools-border);\n }\n .lane .gutter {\n color: var(--lit-devtools-text-secondary);\n cursor: default;\n }\n .dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n flex-shrink: 0;\n }\n .plot {\n flex: 1;\n min-width: 0;\n max-height: calc(8 * ${ROW_PX}px);\n overflow-x: hidden;\n overflow-y: auto;\n }\n .rows {\n position: relative;\n }\n .mark {\n position: absolute;\n box-sizing: border-box;\n height: ${ROW_PX - 3}px;\n margin-top: 1px;\n border-radius: 2px;\n opacity: 0.85;\n overflow: hidden;\n white-space: nowrap;\n color: var(--lit-devtools-surface-low);\n font-size: 9px;\n line-height: ${ROW_PX - 3}px;\n padding: 0 2px;\n cursor: pointer;\n }\n .mark.tick {\n padding: 0;\n }\n .mark.open {\n opacity: 0.45;\n }\n .mark:hover {\n opacity: 1;\n }\n .mark.selected {\n opacity: 1;\n outline: 2px solid var(--lit-devtools-text);\n outline-offset: 0;\n z-index: 1;\n }\n .mark:focus-visible {\n outline: 2px solid var(--lit-devtools-accent-ring);\n z-index: 1;\n }\n .empty {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n flex: 1;\n gap: var(--lit-devtools-space-4);\n color: var(--lit-devtools-text-muted);\n font-family: var(--lit-devtools-font-sans);\n font-size: var(--lit-devtools-text-xs);\n }\n `,\n ];\n\n @property({type: Array}) spans: TimelineSpan[] = [];\n @property({type: Array}) layers: LayerState[] = [];\n @property({attribute: false}) selectedKey: string | null = null;\n /**\n * The selected span, resolved by the view against the unfiltered spans so\n * a filter that hides its mark does not close its detail pane.\n */\n @property({attribute: false}) selectedSpan: TimelineSpan | undefined;\n /** Layer ids to draw a lane for, in no particular order. */\n @property({type: Array}) visibleTracks: string[] = [];\n /** Follow the live edge while this is set and the user has not panned away. */\n @property({type: Boolean}) recording = false;\n\n /** Multiple of \"fit\"; 1 shows the whole recording. */\n @state() private _zoom = 1;\n /** Milliseconds past the origin at the left edge of the plot. */\n @state() private _pan = 0;\n /** Pinned to the live edge. Cleared by panning or zooming away from it,\n * restored by a double-click refit. */\n @state() private _follow = true;\n @state() private _width = 0;\n\n private readonly _ticksRef = createRef<HTMLDivElement>();\n private _resize: ResizeObserver | null = null;\n private _observed: Element | null = null;\n private _tracks: Track[] = [];\n private _visibleSpans: TimelineSpan[] = [];\n private _bounds = {origin: 0, extent: 0};\n private _drag: {x: number; pan: number; moved: boolean} | null = null;\n /** Set when a drag ends, so the click the browser fires after it does\n * not also select whatever mark the pointer happened to finish on. */\n private _suppressClick = false;\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this._resize?.disconnect();\n this._resize = null;\n this._observed = null;\n }\n\n override updated() {\n // The plot's width drives the scale. Its ticks row is re-created when the\n // view goes empty and back, so re-point the observer when it changes.\n const el = this._ticksRef.value ?? null;\n if (el === this._observed) return;\n this._resize?.disconnect();\n this._observed = el;\n if (!el) return;\n this._resize ??= new ResizeObserver(() => {\n this._width = this._observed?.clientWidth ?? 0;\n });\n this._resize.observe(el);\n }\n\n override willUpdate(changed: Map<string, unknown>) {\n if (\n changed.has('spans') ||\n changed.has('layers') ||\n changed.has('visibleTracks')\n ) {\n const shown = new Set(this.visibleTracks);\n this._visibleSpans = this.spans.filter((s) => shown.has(s.layerId));\n this._tracks = buildTracks(this._visibleSpans, this.layers).filter((t) =>\n shown.has(t.layerId)\n );\n this._bounds = timeBounds(this._visibleSpans);\n }\n }\n\n private _scale(): TimeScale {\n const {origin, extent} = this._bounds;\n const pan =\n this._follow && this.recording ? livePan(extent, this._zoom) : this._pan;\n return timeScale(origin, extent, this._width, this._zoom, pan);\n }\n\n /** Commit a zoom/pan, and keep following only if it still ends at the live\n * edge. */\n private _setView(zoom: number, pan: number) {\n const {extent} = this._bounds;\n this._zoom = clampZoom(zoom);\n this._pan = clampPan(pan, extent, this._zoom);\n this._follow = this._pan >= livePan(extent, this._zoom) - 1e-9;\n }\n\n private _currentPan(): number {\n return this._scale().start - this._bounds.origin;\n }\n\n private _onWheel(e: WheelEvent) {\n if (this._width === 0 || this._visibleSpans.length === 0) return;\n const plot = this._ticksRef.value;\n if (!plot) return;\n const x = e.clientX - plot.getBoundingClientRect().left;\n if (x < 0) return; // over the gutter: let the lanes scroll\n e.preventDefault();\n const {origin, extent} = this._bounds;\n const pan = this._currentPan();\n if (Math.abs(e.deltaX) > Math.abs(e.deltaY) || e.shiftKey) {\n // Horizontal scroll pans.\n const delta = e.shiftKey ? e.deltaY : e.deltaX;\n const scale = this._scale();\n this._setView(this._zoom, pan + delta / scale.pxPerMs);\n return;\n }\n const factor = Math.exp(-e.deltaY * 0.002);\n const next = zoomAt(\n origin,\n extent,\n this._width,\n this._zoom,\n pan,\n x,\n factor\n );\n this._setView(next.zoom, next.pan);\n }\n\n private _onPointerDown(e: PointerEvent) {\n if (e.button !== 0) return;\n this._drag = {x: e.clientX, pan: this._currentPan(), moved: false};\n }\n\n private _onPointerMove(e: PointerEvent) {\n const drag = this._drag;\n if (!drag) return;\n const dx = e.clientX - drag.x;\n if (!drag.moved && Math.abs(dx) < DRAG_SLOP_PX) return;\n if (!drag.moved) {\n drag.moved = true;\n (e.currentTarget as HTMLElement).setPointerCapture(e.pointerId);\n this.requestUpdate();\n }\n this._setView(this._zoom, drag.pan - dx / this._scale().pxPerMs);\n }\n\n private _onPointerUp() {\n if (this._drag?.moved) {\n this._suppressClick = true;\n setTimeout(() => (this._suppressClick = false));\n this.requestUpdate();\n }\n this._drag = null;\n }\n\n private _refit() {\n this._zoom = 1;\n this._pan = 0;\n this._follow = true;\n }\n\n private _select(key: string) {\n if (this._suppressClick) return;\n this.dispatchEvent(\n new CustomEvent<{key: string | null}>('span-select', {\n detail: {key},\n bubbles: true,\n composed: true,\n })\n );\n }\n\n override render() {\n const selected = this.selectedSpan;\n const detail = selected\n ? html`<timeline-span-detail\n filterable\n .span=${selected}\n ></timeline-span-detail>`\n : nothing;\n if (this._tracks.length === 0) {\n return html`<div class=\"empty\">\n ${\n this.visibleTracks.length === 0\n ? 'No tracks shown. Pick some above.'\n : 'No events recorded.'\n }\n </div>\n ${detail}`;\n }\n const scale = this._scale();\n return html`\n <div class=\"axis\">\n <div class=\"gutter\"></div>\n <div class=\"ticks\" ${ref(this._ticksRef)}>\n ${this._width > 0 ? this._renderTicks(scale) : nothing}\n </div>\n </div>\n <div\n class=\"lanes ${this._drag?.moved ? 'dragging' : ''}\"\n title=\"Wheel to zoom, drag to pan, double-click to fit\"\n @wheel=${this._onWheel}\n @pointerdown=${this._onPointerDown}\n @pointermove=${this._onPointerMove}\n @pointerup=${this._onPointerUp}\n @pointercancel=${this._onPointerUp}\n @dblclick=${this._refit}\n >\n ${this._tracks.map((track) => this._renderLane(track, scale))}\n </div>\n ${detail}\n `;\n }\n\n private _renderTicks(scale: TimeScale) {\n const step = niceStep(TICK_PX / scale.pxPerMs);\n const labels = [];\n for (\n let t = Math.ceil(scale.start / step) * step;\n t <= scale.end && labels.length < 200;\n t += step\n ) {\n labels.push(\n html`<span class=\"tick-label\" style=\"left:${scale.toX(t)}px\"\n >${formatAxis(t, step)}</span\n >`\n );\n }\n return labels;\n }\n\n private _renderLane(track: Track, scale: TimeScale) {\n const layer = this.layers.find((l) => l.id === track.layerId);\n const color = layerColor(this.layers, track.layerId);\n const rows = Math.max(track.rows.length, 1);\n return html`\n <div class=\"lane\">\n <div class=\"gutter\" title=${layer?.label ?? track.layerId}>\n <span class=\"dot\" style=\"background:${color}\"></span>\n ${layer?.label ?? track.layerId}\n </div>\n <div class=\"plot\">\n <div class=\"rows\" style=\"height:${rows * ROW_PX}px\">\n ${\n this._width > 0\n ? track.rows.map((row, i) =>\n this._renderRow(row, i, scale, color)\n )\n : nothing\n }\n </div>\n </div>\n </div>\n `;\n }\n\n private _renderRow(\n row: TimelineSpan[],\n rowIndex: number,\n scale: TimeScale,\n color: string\n ) {\n const [from, to] = visibleRange(row, scale.start, scale.end);\n const liveEdge = this._bounds.origin + this._bounds.extent;\n const marks = [];\n // At fit zoom thousands of sub-ms ticks share a handful of pixels; draw\n // one per pixel column (never dropping the selected one).\n let lastTickPx = -Infinity;\n for (let i = from; i < to; i++) {\n const span = row[i]!;\n const open = span.end === undefined && span.groupId !== undefined;\n const x0 = scale.toX(span.start);\n const x1 = scale.toX(span.end ?? (open ? liveEdge : span.start));\n const isTick = x1 - x0 < MIN_MARK_PX;\n const selected = span.key === this.selectedKey;\n if (isTick && !selected && Math.round(x0) === lastTickPx) continue;\n if (isTick) lastTickPx = Math.round(x0);\n // Clip to the plot so a long span panned half out of view still\n // shows its label at the left edge.\n const left = Math.max(x0, -1);\n const width = isTick ? MIN_MARK_PX : Math.min(x1, this._width + 1) - left;\n marks.push(html`<div\n class=\"mark ${isTick ? 'tick' : ''} ${open ? 'open' : ''} ${\n selected ? 'selected' : ''\n }\"\n role=\"button\"\n tabindex=\"0\"\n title=${describe(span)}\n style=\"left:${left}px;width:${width}px;top:${rowIndex * ROW_PX}px;background:${color}\"\n @click=${() => this._select(span.key)}\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n this._select(span.key);\n }\n }}\n >\n ${isTick || width < 40 ? nothing : span.name}\n </div>`);\n }\n return marks;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'timeline-tracks': TimelineTracks;\n }\n}\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The panel's single recorded-event buffer.\n *\n * More than one view reads the recording — the Timeline lists it, the Updates\n * tab derives update cycles from it — and both want the whole window, not a\n * slice. A per-view subscription would open a second reader on the same\n * devframe stream and keep a second copy of every event, so the buffer lives\n * here instead and the views are consumers.\n *\n * Module-scoped and started on first subscribe, for the panel document's\n * lifetime: the Timeline view is mounted (though hidden) the whole time\n * anyway, so there is no teardown case worth the complexity of ref-counting\n * the stream — and dropping the buffer whenever the developer switched tabs\n * would defeat the point of recording.\n */\n\nimport {litRpc, getMeta, describeError, isSnapshot} from './client.js';\nimport type {TimelineEvent} from '../types/timeline.js';\n\n/**\n * Cap on retained timeline events. The stream is unbounded (the mouse/keyboard\n * layers can emit at pointer-move rate), so without a cap the buffer — and the\n * views that re-render from it — grow for the whole session. Keep the most\n * recent events; older ones scroll off.\n */\nconst MAX_EVENTS = 5000;\n\n/**\n * sessionStorage key for the id of the newest event Clear (or a fresh\n * recording) threw away. A reloaded panel is refilled from the node's\n * `timeline-history`, which Clear does not touch (agents still read the same\n * buffer through `recent-events`), so without this a reload would resurrect\n * everything the developer cleared. sessionStorage, not a module variable:\n * the point is to survive the reload. Ids are `${epoch}-${seq}` with a seq\n * that never resets across Clear (see `devframe/definition.ts`).\n */\nconst CLEARED_THROUGH_KEY = 'lit-devtools:timeline-cleared-through';\n\nconst parseEventId = (\n id: string | undefined\n): {epoch: string; seq: number} | undefined => {\n if (id === undefined) return undefined;\n const cut = id.lastIndexOf('-');\n const seq = Number(id.slice(cut + 1));\n return cut > 0 && Number.isInteger(seq)\n ? {epoch: id.slice(0, cut), seq}\n : undefined;\n};\n\nconst readClearedThrough = (): {epoch: string; seq: number} | undefined => {\n try {\n return parseEventId(\n sessionStorage.getItem(CLEARED_THROUGH_KEY) ?? undefined\n );\n } catch {\n return undefined;\n }\n};\n\nconst rememberClearedThrough = (id: string): void => {\n try {\n sessionStorage.setItem(CLEARED_THROUGH_KEY, id);\n } catch {\n // Storage blocked: a reload then brings cleared events back. Harmless.\n }\n};\n\n/** Drops events at or before the cleared-through mark. A mark from another\n * epoch belongs to an earlier dev server and says nothing about these ids. */\nconst withoutCleared = (batch: TimelineEvent[]): TimelineEvent[] => {\n const mark = readClearedThrough();\n if (mark === undefined) return batch;\n return batch.filter((event) => {\n const id = parseEventId(event.id);\n return id === undefined || id.epoch !== mark.epoch || id.seq > mark.seq;\n });\n};\n\nlet events: TimelineEvent[] = [];\nlet error: string | null = null;\nlet started = false;\nconst listeners = new Set<() => void>();\n\nconst notify = (): void => {\n for (const listener of listeners) listener();\n};\n\n/** The retained events, oldest first. Replaced, never mutated in place, so a\n * consumer can use identity to decide whether to re-derive. */\nexport const getTimelineEvents = (): TimelineEvent[] => events;\n\n/** Connection failure from the initial subscribe, or null. */\nexport const getTimelineError = (): string | null => error;\n\nexport const clearTimelineEvents = (): void => {\n if (events.length === 0) return;\n const newest = events[events.length - 1]!.id;\n if (newest !== undefined) rememberClearedThrough(newest);\n events = [];\n notify();\n};\n\n/**\n * Subscribes to buffer changes and starts the reader on first use. The\n * returned function unsubscribes; it does not stop the reader.\n */\nexport const subscribeTimeline = (listener: () => void): (() => void) => {\n listeners.add(listener);\n void start();\n return () => {\n listeners.delete(listener);\n };\n};\n\nconst start = async (): Promise<void> => {\n if (started) return;\n started = true;\n try {\n const [rpc, meta] = await Promise.all([litRpc(), getMeta()]);\n\n // A frozen session has no live stream to subscribe to -- the events were\n // baked into `recent-events` at export time, and they are the whole point\n // of the snapshot. Read them once and stop.\n if (isSnapshot()) {\n const recorded = await rpc.rpc.call('recent-events', {});\n events = recorded.events.slice(-MAX_EVENTS);\n notify();\n return;\n }\n\n // Subscribe before asking for history. The stream carries only events\n // written after this point, and the history call is processed after the\n // subscribe on the same connection, so nothing falls between the two; an\n // event written in between shows up in both and is dropped below by id.\n const reader = rpc.rpc.streaming.subscribe<TimelineEvent[]>(\n meta.stream.channel,\n meta.stream.id,\n {highWaterMark: 4096}\n );\n\n // Seed with what the node already recorded, so a panel opened or\n // reloaded mid-session is not blank. One batch, so a deep link into it\n // resolves against the whole seed. A failed call is not fatal: the panel\n // is then just a late one, as it was before.\n const history = await rpc.rpc.call('timeline-history').catch(() => []);\n const seeded = withoutCleared(history).slice(-MAX_EVENTS);\n const seededIds = new Set(seeded.map((event) => event.id));\n if (seeded.length > 0) {\n events = seeded;\n notify();\n }\n\n // No recording check here: every capture layer in the page runtime is\n // already gated on the recording flag, so anything that reaches the\n // stream was recorded on purpose.\n for await (const batch of reader) {\n const fresh = withoutCleared(batch).filter(\n (event) => event.id === undefined || !seededIds.has(event.id)\n );\n if (fresh.length === 0) continue;\n const next = [...events, ...fresh];\n events = next.length > MAX_EVENTS ? next.slice(-MAX_EVENTS) : next;\n notify();\n }\n } catch (err) {\n error = describeError(err);\n notify();\n }\n};\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {LitElement, html, css, nothing} from 'lit';\nimport {customElement, state} from 'lit/decorators.js';\nimport {ref, createRef} from 'lit/directives/ref.js';\nimport {tokens} from '../lib/tokens.js';\nimport type {\n TimelineEvent,\n TimelineLayer,\n TimelineLayersState,\n} from '../types/timeline.js';\nimport type {LayerState} from './timeline-layers.js';\nimport {toSpans} from '../lib/timeline/derive.js';\nimport {\n compileRegex,\n filterSpans,\n listElements,\n} from '../lib/timeline/filter.js';\nimport type {TimelineSpan} from '../lib/timeline/derive.js';\nimport '../lib/segmented-tabs.js';\nimport type {TabItem} from '../lib/segmented-tabs.js';\nimport './timeline-layers.js';\nimport {isRawKey} from './timeline-event-list.js';\nimport type {TimelineEventList} from './timeline-event-list.js';\nimport './timeline-tracks.js';\nimport {litRpc, getMeta, describeError, isSnapshot} from './client.js';\nimport {\n clearTimelineEvents,\n getTimelineError,\n getTimelineEvents,\n subscribeTimeline,\n} from './timeline-store.js';\nimport type {LitClient} from './client.js';\nimport {LAYER_FLAGS, SESSION_STATE_KEY} from '../lib/devframe/protocol.js';\nimport type {SessionState} from '../lib/devframe/protocol.js';\n\ntype ViewMode = 'list' | 'tracks';\n\n/** localStorage key remembering List vs Tracks. */\nconst MODE_LS_KEY = 'lit-devtools-timeline-mode';\n/** localStorage key remembering which tracks the user hid. Stored as the\n * hidden set, not the shown one, so a layer seen for the first time (a\n * custom layer, a new built-in) gets a track by default. */\nconst HIDDEN_TRACKS_LS_KEY = 'lit-devtools-timeline-hidden-tracks';\n\nconst MODE_TABS: TabItem[] = [\n {id: 'list', label: 'List'},\n {id: 'tracks', label: 'Tracks'},\n];\n\nconst readMode = (): ViewMode => {\n try {\n return localStorage.getItem(MODE_LS_KEY) === 'tracks' ? 'tracks' : 'list';\n } catch {\n return 'list';\n }\n};\n\nconst readHiddenTracks = (): Set<string> => {\n try {\n const parsed: unknown = JSON.parse(\n localStorage.getItem(HIDDEN_TRACKS_LS_KEY) ?? '[]'\n );\n return new Set(\n Array.isArray(parsed)\n ? parsed.filter((id): id is string => typeof id === 'string')\n : []\n );\n } catch {\n return new Set();\n }\n};\n\nconst store = (key: string, value: string) => {\n try {\n localStorage.setItem(key, value);\n } catch {\n // ignore (private/storage unavailable)\n }\n};\n\n/**\n * The Timeline view: records and lists Lit lifecycle / render / input events.\n * One tab of the DevTools panel shell (`lit-devtools-panel`). The recorded\n * events come from `timeline-store.ts`, which the Updates view reads too; this\n * view owns the recording state and layer toggles, which live in devframe\n * shared state so it stays in sync with other panels and the page runtime.\n *\n * The events are shown two ways, List (`timeline-event-list`) and Tracks\n * (`timeline-tracks`). This view derives the spans once for both and owns\n * the selection and the element/regex filter, so clicking a mark and\n * switching to the list lands on the same row, and a filter typed in one\n * presentation is still applied in the other. Both stay mounted and the\n * inactive one is hidden, so the list keeps its Raw toggle and scroll and the\n * tracks keep their zoom.\n */\n@customElement('timeline-view')\nexport class TimelineView extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: flex;\n flex-direction: column;\n flex: 1;\n overflow: hidden;\n }\n :host([hidden]) {\n display: none;\n }\n .toolbar {\n display: flex;\n align-items: center;\n gap: var(--lit-devtools-space-4);\n padding: var(--lit-devtools-space-3) var(--lit-devtools-space-5);\n border-bottom: 1px solid var(--lit-devtools-border);\n background: var(--lit-devtools-surface-low);\n flex-shrink: 0;\n }\n .spacer {\n flex: 1;\n }\n button {\n padding: var(--lit-devtools-space-2) var(--lit-devtools-space-5);\n border-radius: var(--lit-devtools-radius-sm);\n border: 1px solid var(--lit-devtools-border);\n background: var(--lit-devtools-surface-elevated);\n color: var(--lit-devtools-text);\n font-size: var(--lit-devtools-text-2xs);\n cursor: pointer;\n }\n button:hover {\n background: var(--lit-devtools-surface-hover);\n border-color: var(--lit-devtools-border-strong);\n }\n .export-note {\n color: var(--lit-devtools-text-muted);\n font-size: var(--lit-devtools-text-2xs);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .record.active {\n border-color: var(--lit-devtools-error);\n background: var(--lit-devtools-error-soft);\n color: var(--lit-devtools-error);\n }\n .toolbar segmented-tabs {\n align-self: stretch;\n margin: calc(-1 * var(--lit-devtools-space-3)) 0;\n }\n .filterbar {\n display: flex;\n align-items: center;\n gap: var(--lit-devtools-space-3);\n padding: var(--lit-devtools-space-2) var(--lit-devtools-space-5);\n border-bottom: 1px solid var(--lit-devtools-border);\n font-size: var(--lit-devtools-text-2xs);\n color: var(--lit-devtools-text-muted);\n flex-shrink: 0;\n }\n .filterbar select,\n .filterbar input.regex {\n background: var(--lit-devtools-surface-elevated);\n color: var(--lit-devtools-text);\n border: 1px solid var(--lit-devtools-border-strong);\n border-radius: var(--lit-devtools-radius-sm);\n padding: var(--lit-devtools-space-1) var(--lit-devtools-space-3);\n font-size: var(--lit-devtools-text-2xs);\n font-family: var(--lit-devtools-font-mono);\n }\n .filterbar input.regex {\n min-width: 140px;\n }\n .filterbar input.regex::placeholder {\n color: var(--lit-devtools-text-muted);\n }\n .filterbar input.regex.invalid {\n border-color: var(--lit-devtools-error);\n }\n timeline-event-list,\n timeline-tracks {\n flex: 1;\n overflow: hidden;\n }\n [hidden] {\n display: none !important;\n }\n .error {\n padding: var(--lit-devtools-space-5);\n color: var(--lit-devtools-text-secondary);\n font-size: var(--lit-devtools-text-xs);\n }\n `,\n ];\n\n @state() private _recording = false;\n /** Whether a session state has been applied yet. The first one is the\n * panel catching up with a recording already under way, not a start. */\n private _sessionSeen = false;\n @state() private _exporting = false;\n /** Result or failure of the last export; `null` until one is attempted. */\n @state() private _exportNote: string | null = null;\n @state() private _events: TimelineEvent[] = [];\n @state() private _layers: LayerState[] = [];\n @state() private _error: string | null = null;\n @state() private _mode: ViewMode = readMode();\n /** Layers whose track the user hid. View-only: capture is untouched. */\n @state() private _hiddenTracks: Set<string> = readHiddenTracks();\n /** Selection shared by both presentations; see `timeline-event-list`. */\n @state() private _selectedKey: string | null = null;\n /** Element id both presentations are filtered to, or null for all. */\n @state() private _elementFilter: number | null = null;\n /** Case-insensitive regex source both presentations are filtered by. */\n @state() private _regex = '';\n\n /** `toSpans(_events)`, re-derived only when the buffer changes. */\n private _spans: TimelineSpan[] = [];\n private _spansOf: TimelineEvent[] | null = null;\n /** Distinct elements in `_events`, re-derived with `_spans` so a keystroke\n * in the regex box does not rescan the buffer. */\n private _elements: Array<{id: number; tag: string}> = [];\n /** `_spans` after the element and regex filters, for Tracks. The list\n * applies the same filter itself because its Raw mode filters events. */\n private _filteredSpans: TimelineSpan[] = [];\n /** An event id a deep link asked for that the store has not delivered yet;\n * the store loads asynchronously, so it is applied once events arrive. */\n private _pendingEventId: string | null = null;\n private _revealSelection = false;\n private _pendingSettled = false;\n private readonly _listRef = createRef<TimelineEventList>();\n /** Captured, not-hidden layer ids. Cached so a selection change does not\n * hand `timeline-tracks` a new array and re-pack every lane. */\n private _visibleTracks: string[] = [];\n\n /** Built-in + runtime-announced layers as of the last `get-meta` call. */\n private _baseLayers: TimelineLayer[] = [];\n private _rpc: LitClient | null = null;\n private _sessionOff: (() => void) | null = null;\n private _storeOff: (() => void) | null = null;\n /** False once `disconnectedCallback` runs, so a slow connect (or a stream\n * error racing a cancel) never touches state after teardown. */\n private _active = false;\n\n override connectedCallback() {\n super.connectedCallback();\n this._active = true;\n this._storeOff = subscribeTimeline(() => this._readStore());\n this._readStore();\n void this._connect();\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this._active = false;\n this._sessionOff?.();\n this._sessionOff = null;\n this._storeOff?.();\n this._storeOff = null;\n }\n\n override willUpdate(changed: Map<string, unknown>) {\n if (changed.has('_layers') || changed.has('_hiddenTracks')) {\n this._visibleTracks = this._layers\n .filter((l) => l.enabled && !this._hiddenTracks.has(l.id))\n .map((l) => l.id);\n }\n // The store hands out a new array whenever the buffer changes, so identity\n // is the memo key.\n if (this._events !== this._spansOf) {\n this._spansOf = this._events;\n this._spans = toSpans(this._events);\n this._elements = listElements(this._events);\n // Drop a stale element filter when its element is no longer recorded\n // (e.g. after Clear), otherwise both views would silently show nothing.\n if (\n this._elementFilter !== null &&\n !this._elements.some((el) => el.id === this._elementFilter)\n ) {\n this._elementFilter = null;\n }\n // A span can fall out of the buffer cap, or vanish on Clear. Raw-mode\n // keys are the list's to interpret.\n const key = this._selectedKey;\n if (\n key !== null &&\n !isRawKey(key) &&\n !this._spans.some((s) => s.key === key)\n ) {\n this._selectedKey = null;\n }\n this._applyPendingEvent();\n }\n if (\n changed.has('_events') ||\n changed.has('_elementFilter') ||\n changed.has('_regex')\n ) {\n // Recomputed on its own inputs only, so a selection change does not hand\n // `timeline-tracks` a new array and re-pack every lane.\n this._filteredSpans = filterSpans(\n this._spans,\n this._elementFilter,\n compileRegex(this._regex).re\n );\n }\n }\n\n /**\n * Select the span a deep link named. Its start event is the natural target\n * (`span.events[0]`), but any of the span's events matches, so a link to\n * either half of a pair lands on the same row.\n *\n * An id the buffer does not hold — evicted, or from another session — ends\n * with no selection and no error, once there are events to have looked in.\n */\n selectEvent(id: string): void {\n this._pendingEventId = id;\n this._applyPendingEvent();\n this.requestUpdate();\n }\n\n private _applyPendingEvent(): void {\n const id = this._pendingEventId;\n // An empty buffer is \"not loaded yet\", not \"not found\".\n if (id === null || this._spans.length === 0) return;\n const span = this._spans.find((s) => s.events.some((e) => e.id === id));\n this._pendingEventId = null;\n this._pendingSettled = true;\n // A miss clears the selection: the link named something, and leaving the\n // previous row highlighted would read as if that were it.\n this._selectedKey = span?.key ?? null;\n if (span !== undefined) this._revealSelection = true;\n }\n\n /** Id of the selected span's start event, for the shell's URL sync. While a\n * linked id is still waiting on the store it is reported as-is, so the\n * address bar does not drop it before the events land. */\n get selectedEventId(): string | null {\n if (this._pendingEventId !== null) return this._pendingEventId;\n const key = this._selectedKey;\n if (key === null) return null;\n return this._spans.find((s) => s.key === key)?.events[0]?.id ?? null;\n }\n\n override updated(changed: Map<string, unknown>) {\n if (this._revealSelection) {\n this._revealSelection = false;\n // After the *list's* update, not ours: it pins itself to the newest row\n // whenever its events change, which is exactly when a cold link lands.\n void this.updateComplete\n .then(() => this._listRef.value?.updateComplete)\n .then(() => this._listRef.value?.reveal());\n }\n if (changed.has('_selectedKey') || this._pendingSettled) {\n this._pendingSettled = false;\n this.dispatchEvent(new CustomEvent('selection-change'));\n }\n }\n\n private _readStore(): void {\n if (!this._active) return;\n this._events = getTimelineEvents();\n const storeError = getTimelineError();\n if (storeError !== null) this._error = storeError;\n }\n\n // ---------------------------------------------------------------------------\n // Connection\n // ---------------------------------------------------------------------------\n\n /**\n * Connects to the devframe RPC client and loads the layer list and shared\n * session state. The recorded events arrive separately, through\n * `timeline-store.ts`. Every step checks `_active` so a teardown mid-connect\n * never mutates state after the component is gone, and the whole flow is one\n * try/catch so a rejected connect never surfaces as an unhandled rejection.\n */\n private async _connect(): Promise<void> {\n try {\n const [rpc, meta] = await Promise.all([litRpc(), getMeta()]);\n if (!this._active) return;\n this._rpc = rpc;\n this._baseLayers = meta.layers;\n\n const session =\n await rpc.rpc.sharedState<SessionState>(SESSION_STATE_KEY);\n if (!this._active) return;\n this._applySession(session.value());\n this._sessionOff = session.on('updated', (state) =>\n this._applySession(state)\n );\n } catch (err) {\n if (this._active) {\n this._error = describeError(err);\n }\n }\n }\n\n /** Applies a `SessionState` snapshot (initial or from `session.on('updated', …)`)\n * to the recording flag and merged layer list. */\n private _applySession(state: {\n layers: TimelineLayersState;\n customLayers: readonly TimelineLayer[];\n }): void {\n const {recordingState} = state.layers;\n // The page re-zeroes its timeline clock on the rising edge of recording\n // (`runtime/timeline/clock.ts`), so the previous recording's events carry\n // times above everything captured after them. Keeping them would render a\n // list that runs backwards mid-scroll -- and, once spans are paired by\n // time, negative durations across the seam. The dev server drops its own\n // buffer on the same edge (`devframe/definition.ts`).\n //\n // Only a start the panel *watched*: the first state it applies is not an\n // edge. A panel opened (or reloaded) mid-recording sees `false` -> `true`\n // against its own default, and clearing then would wipe the events the\n // stream just replayed to it.\n if (this._sessionSeen && recordingState && !this._recording) {\n clearTimelineEvents();\n }\n this._sessionSeen = true;\n this._recording = recordingState;\n this._layers = this._mergeLayers(state.layers, state.customLayers);\n }\n\n /** Merges the base (built-in + already-known custom) layers with any custom\n * layers announced since, and resolves each one's enabled flag. Custom\n * layers have no entry in `LAYER_FLAGS` and are always enabled. */\n private _mergeLayers(\n flags: TimelineLayersState,\n customLayers: readonly TimelineLayer[]\n ): LayerState[] {\n const merged = [...this._baseLayers];\n for (const layer of customLayers) {\n if (!merged.some((l) => l.id === layer.id)) {\n merged.push(layer);\n }\n }\n return merged.map((l) => {\n const flag = LAYER_FLAGS[l.id];\n return {...l, enabled: flag ? flags[flag] : true};\n });\n }\n\n // ---------------------------------------------------------------------------\n // Actions\n // ---------------------------------------------------------------------------\n\n private _toggleRecord() {\n this._rpc?.rpc\n .call('set-recording', {recording: !this._recording})\n .catch((err) => {\n console.warn('[lit-devtools] set-recording failed', err);\n });\n }\n\n private _clear() {\n clearTimelineEvents();\n }\n\n /**\n * Freeze this session into a static panel directory the developer can zip\n * onto an issue. The dev server does the work -- it already holds the\n * timeline, the tree and the details -- so this is one call and a status\n * line, not a download.\n */\n private _exportSnapshot() {\n if (this._exporting) return;\n this._exporting = true;\n this._exportNote = 'Exporting…';\n this._rpc?.rpc\n .call('export-snapshot', {})\n .then((result) => {\n this._exportNote = `Wrote ${result.events} events and ${result.components} components to ${result.outDir}`;\n })\n .catch((err: unknown) => {\n this._exportNote = `Export failed: ${describeError(err)}`;\n })\n .finally(() => {\n this._exporting = false;\n });\n }\n\n private _onLayerToggle(e: CustomEvent<{id: string}>) {\n // Custom layers have no flag in `LAYER_FLAGS` and are always on; there is\n // nothing to toggle server-side.\n if (!LAYER_FLAGS[e.detail.id]) return;\n const layer = this._layers.find((l) => l.id === e.detail.id);\n if (!layer) return;\n this._rpc?.rpc\n .call('toggle-layer', {layerId: e.detail.id, enabled: !layer.enabled})\n .catch((err) => {\n console.warn('[lit-devtools] toggle-layer failed', err);\n });\n }\n\n private _onModeChange(e: CustomEvent<{value: string}>) {\n e.stopPropagation();\n this._mode = e.detail.value === 'tracks' ? 'tracks' : 'list';\n store(MODE_LS_KEY, this._mode);\n if (this._mode === 'list') {\n // The list was hidden while the selection may have moved; bring the\n // selected row (or the newest one) back into view.\n void this.updateComplete.then(() => this._listRef.value?.reveal());\n }\n }\n\n private _onTrackToggle(e: CustomEvent<{id: string}>) {\n // A view filter: this deliberately does not call `toggle-layer`.\n e.stopPropagation();\n const hidden = new Set(this._hiddenTracks);\n if (!hidden.delete(e.detail.id)) hidden.add(e.detail.id);\n this._hiddenTracks = hidden;\n store(HIDDEN_TRACKS_LS_KEY, JSON.stringify([...hidden]));\n }\n\n private _onElementSelect(e: Event) {\n const v = (e.target as HTMLSelectElement).value;\n this._elementFilter = v === '' ? null : Number(v);\n }\n\n private _onRegexInput(e: Event) {\n this._regex = (e.target as HTMLInputElement).value;\n }\n\n /** The detail pane's **filter** link. */\n private _onElementFilter(e: CustomEvent<{id: number}>) {\n this._elementFilter = e.detail.id;\n }\n\n private _onSpanSelect(e: CustomEvent<{key: string | null}>) {\n this._pendingEventId = null;\n this._selectedKey = e.detail.key;\n }\n\n override render() {\n if (this._error !== null) {\n return html`<div class=\"error\">${this._error}</div>`;\n }\n const tracks = this._mode === 'tracks';\n // Only captured layers can have events to draw.\n const captured = this._layers.filter((l) => l.enabled);\n return html`\n <div class=\"toolbar\">\n <segmented-tabs\n size=\"sm\"\n .items=${MODE_TABS}\n .value=${this._mode}\n @change=${this._onModeChange}\n ></segmented-tabs>\n ${\n this._exportNote === null\n ? nothing\n : html`<span class=\"export-note\">${this._exportNote}</span>`\n }\n <span class=\"spacer\"></span>\n <button\n ?disabled=${this._exporting || isSnapshot()}\n title=\"Write this session to a static panel directory you can attach to a bug report\"\n @click=${this._exportSnapshot}\n >\n Export snapshot\n </button>\n <button @click=${this._clear}>Clear</button>\n ${\n // A frozen session has nothing to record and no server to tell.\n isSnapshot()\n ? nothing\n : html`<button\n class=\"record ${this._recording ? 'active' : ''}\"\n @click=${this._toggleRecord}\n >\n ${this._recording ? '⏹ Stop' : '▶ Record'}\n </button>`\n }\n </div>\n <timeline-layers\n .layers=${this._layers}\n @layer-toggle=${this._onLayerToggle}\n ></timeline-layers>\n ${\n tracks\n ? html`<timeline-layers\n caption=\"Tracks\"\n .layers=${captured.map((l) => ({\n ...l,\n enabled: !this._hiddenTracks.has(l.id),\n }))}\n @layer-toggle=${this._onTrackToggle}\n ></timeline-layers>`\n : nothing\n }\n ${\n this._events.length > 0\n ? html`<div class=\"filterbar\">\n ${\n this._elements.length > 0\n ? html`\n <span>Element:</span>\n <select @change=${this._onElementSelect}>\n <option\n value=\"\"\n ?selected=${this._elementFilter === null}\n >\n All elements\n </option>\n ${this._elements.map(\n (el) => html`\n <option\n value=${el.id}\n ?selected=${this._elementFilter === el.id}\n >\n &lt;${el.tag}&gt; #${el.id}\n </option>\n `\n )}\n </select>\n `\n : nothing\n }\n <input\n class=\"regex ${compileRegex(this._regex).invalid ? 'invalid' : ''}\"\n type=\"text\"\n spellcheck=\"false\"\n placeholder=\"filter regex…\"\n title=\"Case-insensitive regex matched against element tag, title and subtitle\"\n .value=${this._regex}\n @input=${this._onRegexInput}\n />\n </div>`\n : nothing\n }\n <timeline-event-list\n ${ref(this._listRef)}\n ?hidden=${tracks}\n .events=${this._events}\n .spans=${this._spans}\n .layers=${this._layers}\n .selectedKey=${this._selectedKey}\n .elementFilter=${this._elementFilter}\n .regex=${this._regex}\n @span-select=${this._onSpanSelect}\n @element-filter=${this._onElementFilter}\n ></timeline-event-list>\n <timeline-tracks\n ?hidden=${!tracks}\n .spans=${this._filteredSpans}\n .layers=${this._layers}\n .visibleTracks=${this._visibleTracks}\n .selectedKey=${this._selectedKey}\n .selectedSpan=${\n this._selectedKey === null\n ? undefined\n : this._spans.find((s) => s.key === this._selectedKey)\n }\n ?recording=${this._recording}\n @span-select=${this._onSpanSelect}\n @element-filter=${this._onElementFilter}\n ></timeline-tracks>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'timeline-view': TimelineView;\n }\n}\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Shared types and channel constant for HMR-incompatibility reporting.\n *\n * When the browser runtime can't hot-patch a component in place it logs one\n * line to the console and, by default, full-reloads the page — which clears\n * the console before anyone reads it. These types carry the same reason, in\n * structured form, from the page runtime to the node side over the HMR\n * {@link HMR_INCOMPATIBLE_CHANNEL}, where it is cached so the DevTools panel\n * and an agent-facing query RPC can both read it back after the reload.\n *\n * The three reasons mirror the \"Cannot be patched in place\" cases documented\n * in `docs/src/content/docs/reference/limitations.mdx`; adding a fourth means\n * extending {@link HmrIncompatibilityReason} and {@link describeHmrReason}\n * together, plus the docs page.\n */\n\n/** Why a component couldn't be hot-patched in place, or a related silent case. */\nexport type HmrIncompatibilityReason =\n | {code: 'accessor-decorators'}\n | {code: 'patch-failed'; detail: string}\n | {code: 'observed-attributes-changed'};\n\n/**\n * One HMR-incompatibility notice from the page runtime. `action` reflects\n * what actually happened for *this* event, not just the configured default:\n * 'reload' / 'warn' come from `hmr.onIncompatible`; 'none' is the\n * `observed-attributes-changed` case, which never reloads regardless of that\n * setting (the patch already succeeded).\n */\nexport interface HmrIncompatibilityEvent {\n tagName: string;\n /** `Date.now()` in the browser — there is no shared clock with the timeline's `performance.now()`. */\n time: number;\n reason: HmrIncompatibilityReason;\n action: 'reload' | 'warn' | 'none';\n}\n\n/** HMR channel the page runtime uses to report an {@link HmrIncompatibilityEvent}. */\nexport const HMR_INCOMPATIBLE_CHANNEL = 'lit:hmr:incompatible';\n\n/**\n * How many events the node-side cache keeps, and the panel mirrors. A dev\n * session with many failing edits must not grow either without bound; the\n * newest are the ones worth keeping.\n */\nexport const MAX_HMR_INCOMPATIBILITIES = 50;\n\n/**\n * Human-readable text for a reason, shared by the browser console message in\n * `src/lib/runtime/patch.ts` and the DevTools panel's banner so the two can't\n * drift apart. The wording of the first two cases is asserted verbatim by\n * `src/test/unit/patch_test.ts` — it is part of the console output contract.\n */\nexport const describeHmrReason = (reason: HmrIncompatibilityReason): string => {\n switch (reason.code) {\n case 'accessor-decorators':\n return 'standard accessor decorators';\n case 'patch-failed':\n return `patching failed: ${reason.detail}`;\n case 'observed-attributes-changed':\n return \"observedAttributes changed; the platform registry can't pick this up\";\n }\n};\n","//#region src/client/browser-agent.ts\nconst REGISTRY_KEY = Symbol.for(\"devframe:browser-agent-registry\");\nconst { tools, listeners } = globalThis[REGISTRY_KEY] ??= {\n\ttools: /* @__PURE__ */ new Map(),\n\tlisteners: /* @__PURE__ */ new Set()\n};\nfunction notifyChanged() {\n\tfor (const listener of listeners) listener();\n}\nfunction registerBrowserAgentTool(tool) {\n\tconst key = Symbol(tool.id);\n\ttools.set(key, tool);\n\tnotifyChanged();\n\treturn () => {\n\t\tif (tools.delete(key)) notifyChanged();\n\t};\n}\nfunction listBrowserAgentTools() {\n\treturn [...tools.values()];\n}\nfunction onBrowserAgentToolsChanged(listener) {\n\tlisteners.add(listener);\n\treturn () => listeners.delete(listener);\n}\n//#endregion\nexport { onBrowserAgentToolsChanged as n, registerBrowserAgentTool as r, listBrowserAgentTools as t };\n","import { a as defineDiagnostics, i as createBirpc, n as argsToJsonSchema, o as DEVFRAME_EVENTS, r as resolveAgentSafety, t as toolInputToRpcArgs } from \"../tool-input-BAQXvvqL.mjs\";\nimport { createEventEmitter } from \"../utils/events.mjs\";\nimport { t as createSharedState } from \"../shared-state-eQVYHNqA.mjs\";\nimport { nanoid } from \"../utils/nanoid.mjs\";\nimport { r as registerBrowserAgentTool } from \"../browser-agent-Pu-FLk6I.mjs\";\n//#region src/in-page-channel/diagnostics.ts\nconst diagnostics = /* #__PURE__ */ defineDiagnostics({\n\tdocsBase: \"https://devfra.me/errors\",\n\tcodes: {\n\t\tDF0077: {\n\t\t\twhy: (p) => `In-page channel function \"${p.name}\" is not registered on this endpoint.`,\n\t\t\tfix: \"Declare the function in this endpoint's `functions` option.\"\n\t\t},\n\t\tDF0080: {\n\t\t\twhy: (p) => `In-page channel function \"${p.name}\" has \\`agent\\` set but \\`jsonSerializable\\` is \\`false\\`; MCP requires JSON-serializable data.`,\n\t\t\tfix: \"Remove `jsonSerializable: false`, or remove `agent` to keep it channel-only.\"\n\t\t}\n\t}\n});\n//#endregion\n//#region src/in-page-channel/protocol.ts\n/**\n* Wire protocol of the in-page channel handshake and its port-level control\n* frames. The envelope is transport-neutral by design: it identifies the\n* protocol (`channel` tag + `v`), the user channel (`name`), and the peers\n* (`panelId`, `instanceId`), so a future cross-tab transport (e.g. a\n* `BroadcastChannel`) can reuse it unchanged.\n*/\n/** `postMessage` tag every handshake message carries. */\nconst IN_PAGE_CHANNEL_TAG = DEVFRAME_EVENTS.postMessage.inPageChannel;\nfunction isControlFrame(data) {\n\treturn !!data && typeof data === \"object\" && \"__dfIpc\" in data;\n}\nfunction isHandshakeMessage(data) {\n\tif (!data || typeof data !== \"object\") return false;\n\tconst message = data;\n\treturn message.channel === IN_PAGE_CHANNEL_TAG && typeof message.name === \"string\" && typeof message.panelId === \"string\" && (message.kind === \"hello\" || message.kind === \"grant\");\n}\nconst INSTANCE_STORAGE_KEY = \"devframe:in-page-channel:instance\";\nlet memoryInstanceId;\n/**\n* The page context's instance id: one nanoid per browser tab, persisted in\n* `sessionStorage` so it survives page-script reloads. It scopes handshakes\n* when the same app is open in several tabs, since a panel pinned to an instance\n* id ignores grants from every other tab's page script.\n*/\nfunction resolveInstanceId(win) {\n\ttry {\n\t\tconst storage = win?.sessionStorage;\n\t\tif (storage) {\n\t\t\tlet id = storage.getItem(INSTANCE_STORAGE_KEY);\n\t\t\tif (!id) {\n\t\t\t\tid = nanoid();\n\t\t\t\tstorage.setItem(INSTANCE_STORAGE_KEY, id);\n\t\t\t}\n\t\t\treturn id;\n\t\t}\n\t} catch {}\n\tmemoryInstanceId ??= nanoid();\n\treturn memoryInstanceId;\n}\n/** Resolve the origins accepted during the handshake (default: same-origin). */\nfunction resolveAllowedOrigins(allowedOrigins, win) {\n\tif (allowedOrigins?.length) return allowedOrigins;\n\tconst origin = win?.location?.origin;\n\treturn origin && origin !== \"null\" ? [origin] : [\"*\"];\n}\n/**\n* Default handshake targets of a panel: its ancestor chain plus the\n* `opener` of each window, including a popup containing the panel iframe. `WindowProxy`\n* references stay valid across navigations, so hellos posted to these reach\n* a page script even after the host page reloads.\n*/\nfunction defaultHandshakeTargets(win) {\n\tconst targets = [];\n\ttry {\n\t\tlet current = win;\n\t\twhile (current.parent && current.parent !== current) {\n\t\t\ttargets.push(current.parent);\n\t\t\tcurrent = current.parent;\n\t\t}\n\t} catch {}\n\tfor (const current of [win, ...targets]) try {\n\t\tconst opener = current.opener;\n\t\tif (opener && opener !== win && !targets.includes(opener)) targets.push(opener);\n\t} catch {}\n\treturn targets;\n}\nconst DEFAULT_HEARTBEAT = {\n\tintervalMs: 5e3,\n\ttimeoutMs: 12e3\n};\n/** Resolve the heartbeat option against its defaults. */\nfunction resolveHeartbeat(option) {\n\treturn option === false ? void 0 : {\n\t\t...DEFAULT_HEARTBEAT,\n\t\t...option\n\t};\n}\n/** A coded in-page channel error; every failure mode carries a stable `code`. */\nvar InPageChannelError = class extends Error {\n\tcode;\n\tname = \"InPageChannelError\";\n\tconstructor(code, message, options) {\n\t\tsuper(message, options);\n\t\tthis.code = code;\n\t}\n};\nconst warned = /* @__PURE__ */ new Set();\n/**\n* `console.warn` once per distinct message, since handshake noise (foreign\n* origins, version mismatches, missing targets) repeats on every retry tick.\n*/\nfunction warnOnce(message) {\n\tif (!warned.has(message)) {\n\t\twarned.add(message);\n\t\tconsole.warn(`[devframe] ${message}`);\n\t}\n}\nfunction jsonArrayViolation(value, path, seen) {\n\tfor (let i = 0; i < value.length; i++) {\n\t\tconst violation = jsonViolation(value[i], `${path}[${i}]`, seen);\n\t\tif (violation) return violation;\n\t}\n}\nfunction jsonObjectViolation(value, path, seen) {\n\tconst proto = Object.getPrototypeOf(value);\n\tif (proto !== Object.prototype && proto !== null) return `${path} is an instance of ${value.constructor?.name ?? \"an exotic class\"}`;\n\tfor (const [key, entry] of Object.entries(value)) {\n\t\tconst violation = jsonViolation(entry, `${path}.${key}`, seen);\n\t\tif (violation) return violation;\n\t}\n}\nfunction jsonViolation(value, path, seen) {\n\tif (value === null || typeof value === \"boolean\" || typeof value === \"string\") return void 0;\n\tif (typeof value === \"number\") return Number.isFinite(value) ? void 0 : `${path} is ${value}`;\n\tif (typeof value !== \"object\") return `${path} is ${value === void 0 ? \"`undefined`\" : `a ${typeof value}`}`;\n\tif (seen.has(value)) return `${path} is circular`;\n\tseen.add(value);\n\treturn Array.isArray(value) ? jsonArrayViolation(value, path, seen) : jsonObjectViolation(value, path, seen);\n}\n/**\n* Enforce a `jsonSerializable: true` contract: throws code\n* `not-serializable` naming the offending path when the value contains\n* anything strict JSON can't represent, surfacing the bug at the offending\n* call instead of a silent coercion later.\n*/\nfunction assertJsonSerializable(value, what, functionName) {\n\tconst violation = jsonViolation(value, what, /* @__PURE__ */ new Set());\n\tif (violation) throw new InPageChannelError(\"not-serializable\", `in-page function \"${functionName}\" is declared jsonSerializable, but ${violation}`);\n}\nfunction formatIssues(issues) {\n\treturn issues.map((issue) => {\n\t\tconst path = issue.path?.map((s) => typeof s === \"object\" ? s.key : s).join(\".\");\n\t\treturn path ? `${path}: ${issue.message}` : issue.message;\n\t}).join(\"; \");\n}\n/**\n* Validate positional arguments against their Standard Schemas (mirrors the\n* RPC layer's `validateRpcArgs`): only indices with a schema are checked,\n* values pass through unchanged, the first failure rejects with code\n* `invalid-args`.\n*/\nasync function validateArgs(name, schemas, args) {\n\tfor (let index = 0; index < schemas.length; index++) {\n\t\tconst schema = schemas[index];\n\t\tif (!schema) continue;\n\t\tconst result = await schema[\"~standard\"].validate(args[index]);\n\t\tif (result.issues) throw new InPageChannelError(\"invalid-args\", `in-page function \"${name}\" rejected argument ${index}: ${formatIssues(result.issues)}`);\n\t}\n}\nfunction serializeArgs(codec, args) {\n\treturn codec.serialize ? args.map(codec.serialize) : args;\n}\nfunction deserializeResult(codec, result) {\n\treturn codec.deserialize && result !== void 0 ? codec.deserialize(result) : result;\n}\nfunction channelMethod(type, name) {\n\treturn `devframe:in-page:${type === \"event\" ? \"event\" : \"function\"}:${name}`;\n}\nconst FUNCTION_METHOD_PREFIX = channelMethod(\"function\", \"\");\nfunction createLocalFunctionRegistry(codec) {\n\tconst definitions = /* @__PURE__ */ new Map();\n\tconst listeners = /* @__PURE__ */ new Map();\n\treturn {\n\t\tdefinitions,\n\t\tregister(definition) {\n\t\t\tif (\"agent\" in definition && definition.agent) {\n\t\t\t\tif (definition.jsonSerializable === false) throw diagnostics.DF0080({ name: definition.name });\n\t\t\t\tdefinition.jsonSerializable = true;\n\t\t\t}\n\t\t\tdefinitions.set(channelMethod(definition.type, definition.name), definition);\n\t\t},\n\t\tregisterInternal(method, handler) {\n\t\t\tdefinitions.set(method, {\n\t\t\t\tname: method,\n\t\t\t\thandler\n\t\t\t});\n\t\t},\n\t\ton(name, listener) {\n\t\t\tconst key = channelMethod(\"event\", name);\n\t\t\tlet registered = listeners.get(key);\n\t\t\tif (!registered) {\n\t\t\t\tregistered = /* @__PURE__ */ new Set();\n\t\t\t\tlisteners.set(key, registered);\n\t\t\t}\n\t\t\tregistered.add(listener);\n\t\t\treturn () => {\n\t\t\t\tregistered.delete(listener);\n\t\t\t\tif (registered.size === 0) listeners.delete(key);\n\t\t\t};\n\t\t},\n\t\tresolve(name) {\n\t\t\tconst definition = definitions.get(name);\n\t\t\tconst registered = listeners.get(name);\n\t\t\tif (!definition && !registered?.size) return void 0;\n\t\t\treturn async (...rawArgs) => {\n\t\t\t\tconst args = codec.deserialize ? rawArgs.map(codec.deserialize) : rawArgs;\n\t\t\t\tif (definition?.jsonSerializable) assertJsonSerializable(args, \"its arguments\", definition.name);\n\t\t\t\tif (definition?.args?.length) await validateArgs(definition.name, definition.args, args);\n\t\t\t\tconst result = await definition?.handler?.(...args);\n\t\t\t\tfor (const listener of [...listeners.get(name) ?? []]) listener(...args);\n\t\t\t\tif (definition?.type === \"event\") return void 0;\n\t\t\t\tif (definition?.jsonSerializable && result !== void 0) assertJsonSerializable(result, \"its return value\", definition.name);\n\t\t\t\treturn codec.serialize && result !== void 0 ? codec.serialize(result) : result;\n\t\t\t};\n\t\t}\n\t};\n}\n/**\n* Consult each registry in order and, only once none owns the name, fall back\n* to the coded \"not registered\" error for a `function:` call (events stay\n* silent). The fallback lives here, after every registry, so chaining a\n* state registry ahead of the user registry never masks a real handler.\n*/\nfunction resolveLocalHandler(name, registries) {\n\tfor (const registry of registries) {\n\t\tconst handler = registry(name);\n\t\tif (handler) return handler;\n\t}\n\tif (name.startsWith(FUNCTION_METHOD_PREFIX)) return () => {\n\t\tthrow diagnostics.DF0077({ name: name.slice(FUNCTION_METHOD_PREFIX.length) });\n\t};\n}\n/** Register an endpoint's local agent functions for browser-backed transports. */\nfunction registerInPageAgentTools(channelName, registry) {\n\tconst disposals = [];\n\tfor (const definition of registry.definitions.values()) {\n\t\tif (definition.type === \"event\" || !(\"agent\" in definition) || !definition.agent) continue;\n\t\tconst agent = definition.agent;\n\t\tdisposals.push(registerBrowserAgentTool({\n\t\t\tid: `${channelName}:${definition.name}`,\n\t\t\ttitle: agent.title ?? definition.name,\n\t\t\tdescription: agent.description,\n\t\t\tsafety: resolveAgentSafety(definition.type, agent),\n\t\t\ttags: agent.tags,\n\t\t\tinputSchema: argsToJsonSchema(definition.args),\n\t\t\tinvoke: (args) => {\n\t\t\t\tconst positional = toolInputToRpcArgs(args, definition.args?.length);\n\t\t\t\treturn registry.resolve(channelMethod(definition.type, definition.name))(...positional);\n\t\t\t}\n\t\t}));\n\t}\n\treturn () => disposals.forEach((dispose) => dispose());\n}\nfunction wrapPostError(error) {\n\tif (error instanceof DOMException && error.name === \"DataCloneError\") return new InPageChannelError(\"not-cloneable\", `a payload could not be structured-cloned across the in-page channel: ${error.message}. Strip non-cloneable values (functions, DOM nodes, framework reactivity proxies) before sending: declare the function \\`jsonSerializable: true\\` for a precise error, or provide a \\`serialize\\` hook.`, { cause: error });\n\treturn error;\n}\nfunction attachChannelPort(port, options) {\n\tlet birpcHandler;\n\tlet disposed = false;\n\tconst attached = {\n\t\trpc: createBirpc({}, {\n\t\t\tpost: (data) => {\n\t\t\t\ttry {\n\t\t\t\t\tport.postMessage(data);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthrow wrapPostError(error);\n\t\t\t\t}\n\t\t\t},\n\t\t\ton: (fn) => {\n\t\t\t\tbirpcHandler = fn;\n\t\t\t},\n\t\t\toff: () => {\n\t\t\t\tbirpcHandler = void 0;\n\t\t\t},\n\t\t\t/**\n\t\t\t* Deadlines live at the endpoint layer (`withCallDeadline`) with\n\t\t\t* status-aware errors; birpc's own timer stays off.\n\t\t\t*/\n\t\t\ttimeout: -1,\n\t\t\tproxify: false,\n\t\t\tresolver: (name, resolved) => resolved ?? options.resolveLocal(name)\n\t\t}),\n\t\tlastActivity: Date.now(),\n\t\tpostControl(kind) {\n\t\t\ttry {\n\t\t\t\tport.postMessage({ __dfIpc: kind });\n\t\t\t} catch {}\n\t\t},\n\t\tdispose(disposeOptions) {\n\t\t\tif (disposed) return;\n\t\t\tdisposed = true;\n\t\t\tif (disposeOptions?.bye) attached.postControl(\"bye\");\n\t\t\tconst error = new InPageChannelError(\"closed\", `in-page channel call dropped: ${disposeOptions?.reason ?? \"the in-page channel port was closed\"}`);\n\t\t\tattached.rpc.$rejectPendingCalls(({ reject }) => reject(error));\n\t\t\tattached.rpc.$close();\n\t\t\tport.removeEventListener(\"message\", onMessage);\n\t\t\tport.removeEventListener(\"close\", onClose);\n\t\t\ttry {\n\t\t\t\tport.close();\n\t\t\t} catch {}\n\t\t}\n\t};\n\tfunction onMessage(event) {\n\t\tattached.lastActivity = Date.now();\n\t\tconst data = event.data;\n\t\tif (isControlFrame(data)) {\n\t\t\tif (data.__dfIpc === \"bye\") options.onPeerClosed();\n\t\t\telse options.onControl(data.__dfIpc);\n\t\t\treturn;\n\t\t}\n\t\tbirpcHandler?.(data);\n\t}\n\tfunction onClose() {\n\t\toptions.onPeerClosed();\n\t}\n\tport.addEventListener(\"message\", onMessage);\n\tport.addEventListener(\"close\", onClose);\n\tport.start?.();\n\treturn attached;\n}\n/**\n* Race a call against its deadline, rejecting with a status-aware error\n* (code `timeout`). `ms <= 0` disables the deadline.\n*/\nfunction withCallDeadline(promise, ms, describeTimeout) {\n\tif (ms <= 0) return promise;\n\treturn new Promise((resolve, reject) => {\n\t\tconst timer = setTimeout(() => reject(new InPageChannelError(\"timeout\", describeTimeout())), ms);\n\t\tpromise.then((value) => {\n\t\t\tclearTimeout(timer);\n\t\t\tresolve(value);\n\t\t}, (error) => {\n\t\t\tclearTimeout(timer);\n\t\t\treject(error);\n\t\t});\n\t});\n}\n//#endregion\n//#region src/in-page-channel/state.ts\n/**\n* The channel shared-state layer: `createSharedState` pumped over the\n* in-page channel, mirroring the RPC shared-state wire design with the page\n* script playing the server's role: it owns the canonical value, replays a\n* snapshot to every (re)subscribing panel, and fans syncId-deduplicated\n* updates out to the panels subscribed to each key.\n*\n* Request endpoints (panel → page script) are defined here at their\n* handlers, like the RPC layer's `devframe:rpc:server-state:*`; the\n* page-script → panel notifications live in `DEVFRAME_EVENTS.inPageChannel`.\n*/\nconst IN_PAGE_STATE_RPC = {\n\t/** Subscribe to a key; returns the authority's current snapshot. */\n\tsubscribe: \"devframe:in-page:page-state:subscribe\",\n\t/** Replace a key's value (panel mutation forwarded up). */\n\tset: \"devframe:in-page:page-state:set\",\n\t/** Patch a key's value (panel mutation forwarded up). */\n\tpatch: \"devframe:in-page:page-state:patch\"\n};\n/** The page-script (authority) half of the channel shared-state layer. */\nfunction createPageScriptStateHost(peers) {\n\tconst states = /* @__PURE__ */ new Map();\n\treturn {\n\t\tget: async (key, options) => {\n\t\t\tconst existing = states.get(key);\n\t\t\tif (existing) return existing;\n\t\t\tif (options?.initialValue === void 0) throw new InPageChannelError(\"state-uninitialized\", `in-page shared state \"${key}\" was accessed before initialization; the page script is the authority, so its first \\`sharedState.get(\"${key}\")\\` must provide \\`initialValue\\``);\n\t\t\tconst state = createSharedState({\n\t\t\t\tinitialValue: options.initialValue,\n\t\t\t\tenablePatches: true\n\t\t\t});\n\t\t\tstates.set(key, state);\n\t\t\tstate.on(\"updated\", (fullState, patches, syncId) => {\n\t\t\t\tfor (const peer of peers()) {\n\t\t\t\t\tif (!peer.subscribedStates.has(key)) continue;\n\t\t\t\t\tif (patches) peer.callEventRaw(DEVFRAME_EVENTS.inPageChannel.panelStatePatch, [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tpatches,\n\t\t\t\t\t\tsyncId\n\t\t\t\t\t]);\n\t\t\t\t\telse peer.callEventRaw(DEVFRAME_EVENTS.inPageChannel.panelStateUpdated, [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tfullState,\n\t\t\t\t\t\tsyncId\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn state;\n\t\t},\n\t\tcreatePeerHandlers(peer) {\n\t\t\treturn {\n\t\t\t\t[IN_PAGE_STATE_RPC.subscribe]: (key) => {\n\t\t\t\t\tpeer.subscribedStates.add(key);\n\t\t\t\t\treturn states.get(key)?.value();\n\t\t\t\t},\n\t\t\t\t[IN_PAGE_STATE_RPC.set]: (key, fullState, syncId) => {\n\t\t\t\t\tconst state = states.get(key);\n\t\t\t\t\tif (state && !state.syncIds.has(syncId)) state.mutate(() => fullState, syncId);\n\t\t\t\t},\n\t\t\t\t[IN_PAGE_STATE_RPC.patch]: (key, patches, syncId) => {\n\t\t\t\t\tstates.get(key)?.patch(patches, syncId);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t};\n}\n/** The panel (mirror) half of the channel shared-state layer. */\nfunction createPanelStateHost(options) {\n\tconst states = /* @__PURE__ */ new Map();\n\tconst seeded = /* @__PURE__ */ new Set();\n\tconst seedWaiters = /* @__PURE__ */ new Map();\n\t/**\n\t* SyncIds of snapshot adoptions. Adopting the authority's replay must not\n\t* echo straight back up as a `set`; the authority already has the value.\n\t*/\n\tconst adoptedSyncIds = /* @__PURE__ */ new Set();\n\tfunction markSeeded(key) {\n\t\tseeded.add(key);\n\t\tconst waiters = seedWaiters.get(key);\n\t\tif (waiters) {\n\t\t\tseedWaiters.delete(key);\n\t\t\tfor (const resolve of waiters) resolve();\n\t\t}\n\t}\n\tfunction adopt(key, snapshot) {\n\t\tconst state = states.get(key);\n\t\tif (state && snapshot !== void 0) {\n\t\t\tconst syncId = nanoid();\n\t\t\tadoptedSyncIds.add(syncId);\n\t\t\tstate.mutate(() => snapshot, syncId);\n\t\t}\n\t\tmarkSeeded(key);\n\t}\n\tfunction subscribeNow(key) {\n\t\toptions.call(IN_PAGE_STATE_RPC.subscribe, [key]).then((snapshot) => adopt(key, snapshot)).catch((error) => {\n\t\t\tconsole.warn(`[devframe] in-page shared state \"${key}\": subscribe failed`, error);\n\t\t});\n\t}\n\treturn {\n\t\thandlers: {\n\t\t\t[DEVFRAME_EVENTS.inPageChannel.panelStateUpdated]: (key, fullState, syncId) => {\n\t\t\t\tconst state = states.get(key);\n\t\t\t\tif (state && !state.syncIds.has(syncId)) state.mutate(() => fullState, syncId);\n\t\t\t\tmarkSeeded(key);\n\t\t\t},\n\t\t\t[DEVFRAME_EVENTS.inPageChannel.panelStatePatch]: (key, patches, syncId) => {\n\t\t\t\tstates.get(key)?.patch(patches, syncId);\n\t\t\t\tmarkSeeded(key);\n\t\t\t}\n\t\t},\n\t\tresubscribe() {\n\t\t\tfor (const key of states.keys()) subscribeNow(key);\n\t\t},\n\t\tget: (key, getOptions) => {\n\t\t\tconst existing = states.get(key);\n\t\t\tif (existing) return Promise.resolve(existing);\n\t\t\tconst state = createSharedState({\n\t\t\t\t/**\n\t\t\t\t* Without an initial value the state stays empty until the\n\t\t\t\t* authority's first replay resolves the returned promise.\n\t\t\t\t*/\n\t\t\t\tinitialValue: getOptions?.initialValue,\n\t\t\t\tenablePatches: true\n\t\t\t});\n\t\t\tstates.set(key, state);\n\t\t\tstate.on(\"updated\", (fullState, patches, syncId) => {\n\t\t\t\tif (adoptedSyncIds.delete(syncId)) return;\n\t\t\t\tif (!options.isConnected()) return;\n\t\t\t\tif (patches) options.callEvent(IN_PAGE_STATE_RPC.patch, [\n\t\t\t\t\tkey,\n\t\t\t\t\tpatches,\n\t\t\t\t\tsyncId\n\t\t\t\t]);\n\t\t\t\telse options.callEvent(IN_PAGE_STATE_RPC.set, [\n\t\t\t\t\tkey,\n\t\t\t\t\tfullState,\n\t\t\t\t\tsyncId\n\t\t\t\t]);\n\t\t\t});\n\t\t\tif (options.isConnected()) subscribeNow(key);\n\t\t\tif (getOptions?.initialValue !== void 0) return Promise.resolve(state);\n\t\t\treturn new Promise((resolve) => {\n\t\t\t\tif (seeded.has(key)) {\n\t\t\t\t\tresolve(state);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst waiters = seedWaiters.get(key) ?? [];\n\t\t\t\twaiters.push(() => resolve(state));\n\t\t\t\tseedWaiters.set(key, waiters);\n\t\t\t});\n\t\t}\n\t};\n}\n//#endregion\n//#region src/in-page-channel/page-script.ts\n/**\n* Create the page-script endpoint of an in-page channel.\n*\n* It listens for panel hellos on the host page's window and answers each\n* with a dedicated `MessageChannel` port (same-origin enforced both ways),\n* keeping one live peer per panel: dock iframe, popup, and Document-PiP\n* panels all handshake the same way, and a panel reload is simply a new\n* handshake. No server is involved at any point.\n*/\nfunction createPageScriptChannel(options) {\n\tconst { name } = options;\n\tconst callTimeoutMs = options.callTimeoutMs ?? 15e3;\n\tconst win = options.window === false ? void 0 : options.window ?? (typeof window === \"undefined\" ? void 0 : window);\n\tconst allowedOrigins = resolveAllowedOrigins(options.allowedOrigins, win);\n\tconst instanceId = resolveInstanceId(win);\n\tconst heartbeat = resolveHeartbeat(options.heartbeat);\n\tconst codec = {\n\t\tserialize: options.serialize,\n\t\tdeserialize: options.deserialize\n\t};\n\tconst events = createEventEmitter();\n\tconst peers = /* @__PURE__ */ new Map();\n\tlet closed = false;\n\tlet heartbeatTimer;\n\tconst registry = createLocalFunctionRegistry(codec);\n\tfor (const [fnName, definition] of Object.entries(options.functions)) registry.register({\n\t\t...definition,\n\t\tname: fnName\n\t});\n\tfor (const [eventName, definition] of Object.entries(options.events ?? {})) registry.register({\n\t\t...definition,\n\t\tname: eventName,\n\t\ttype: \"event\"\n\t});\n\tconst disposeAgentTools = registerInPageAgentTools(name, registry);\n\tconst stateHost = createPageScriptStateHost(function* () {\n\t\tfor (const peer of peers.values()) yield {\n\t\t\tsubscribedStates: peer.subscribedStates,\n\t\t\tcallEventRaw: (method, args) => {\n\t\t\t\tpeer.attached.rpc.$callRaw({\n\t\t\t\t\tmethod,\n\t\t\t\t\targs: serializeArgs(codec, args),\n\t\t\t\t\tevent: true,\n\t\t\t\t\toptional: true\n\t\t\t\t}).catch(() => {});\n\t\t\t}\n\t\t};\n\t});\n\tfunction removePeer(id, disposeOptions) {\n\t\tconst peer = peers.get(id);\n\t\tif (!peer) return;\n\t\tpeers.delete(id);\n\t\tpeer.attached.dispose(disposeOptions);\n\t\tif (peers.size === 0 && heartbeatTimer) {\n\t\t\tclearInterval(heartbeatTimer);\n\t\t\theartbeatTimer = void 0;\n\t\t}\n\t\tevents.emit(\"panel:disconnected\", peer.peer);\n\t}\n\tfunction addPeer(port, id) {\n\t\tremovePeer(id, { reason: \"the panel re-connected\" });\n\t\tconst internal = {\n\t\t\tid,\n\t\t\tsubscribedStates: /* @__PURE__ */ new Set()\n\t\t};\n\t\tinternal.internalHandlers = stateHost.createPeerHandlers({\n\t\t\tsubscribedStates: internal.subscribedStates,\n\t\t\tcallEventRaw: (method, args) => {\n\t\t\t\tinternal.attached.rpc.$callRaw({\n\t\t\t\t\tmethod,\n\t\t\t\t\targs: serializeArgs(codec, args),\n\t\t\t\t\tevent: true,\n\t\t\t\t\toptional: true\n\t\t\t\t}).catch(() => {});\n\t\t\t}\n\t\t});\n\t\tconst stateRegistry = createLocalFunctionRegistry(codec);\n\t\tfor (const [method, handler] of Object.entries(internal.internalHandlers)) stateRegistry.registerInternal(method, handler);\n\t\tinternal.attached = attachChannelPort(port, {\n\t\t\tresolveLocal: (fnName) => resolveLocalHandler(fnName, [stateRegistry.resolve, registry.resolve]),\n\t\t\tonControl: (kind) => {\n\t\t\t\tif (kind === \"ping\") internal.attached.postControl(\"pong\");\n\t\t\t},\n\t\t\tonPeerClosed: () => removePeer(id, { reason: \"the panel disconnected\" })\n\t\t});\n\t\tinternal.peer = {\n\t\t\tid,\n\t\t\tcall: (fnName, ...args) => withCallDeadline(internal.attached.rpc.$call(channelMethod(\"function\", fnName), ...serializeArgs(codec, args)).then((result) => deserializeResult(codec, result)), callTimeoutMs, () => `in-page channel \"${name}\": call \"${fnName}\" to panel \"${id}\" timed out after ${callTimeoutMs}ms`),\n\t\t\tclose: () => removePeer(id, {\n\t\t\t\tbye: true,\n\t\t\t\treason: \"the page script closed this panel\"\n\t\t\t})\n\t\t};\n\t\tpeers.set(id, internal);\n\t\tif (heartbeat && !heartbeatTimer) heartbeatTimer = setInterval(() => {\n\t\t\tconst now = Date.now();\n\t\t\tfor (const peer of [...peers.values()]) if (now - peer.attached.lastActivity > heartbeat.timeoutMs) removePeer(peer.id, { reason: \"the panel went silent (heartbeat timeout)\" });\n\t\t}, heartbeat.intervalMs);\n\t\tevents.emit(\"panel:connected\", internal.peer);\n\t\treturn internal.peer;\n\t}\n\tconst onWindowMessage = (event) => {\n\t\tif (closed) return;\n\t\tconst data = event.data;\n\t\tif (!isHandshakeMessage(data) || data.kind !== \"hello\" || data.name !== name) return;\n\t\tif (data.v !== 2) {\n\t\t\twarnOnce(`in-page channel \"${name}\": ignoring a hello with protocol version ${data.v} (this side speaks 2); align the devframe versions of the page script and the panel`);\n\t\t\treturn;\n\t\t}\n\t\tif (!allowedOrigins.includes(\"*\") && !allowedOrigins.includes(event.origin)) {\n\t\t\twarnOnce(`in-page channel \"${name}\": ignoring a hello from disallowed origin \"${event.origin}\"`);\n\t\t\treturn;\n\t\t}\n\t\tif (data.instanceId && data.instanceId !== instanceId) return;\n\t\tconst source = event.source;\n\t\tif (!source || typeof source.postMessage !== \"function\") return;\n\t\tconst messageChannel = new MessageChannel();\n\t\taddPeer(messageChannel.port1, data.panelId);\n\t\tconst grant = {\n\t\t\tchannel: IN_PAGE_CHANNEL_TAG,\n\t\t\tv: 2,\n\t\t\tkind: \"grant\",\n\t\t\tname,\n\t\t\tpanelId: data.panelId,\n\t\t\tinstanceId\n\t\t};\n\t\ttry {\n\t\t\tsource.postMessage(grant, allowedOrigins.includes(\"*\") ? \"*\" : event.origin, [messageChannel.port2]);\n\t\t} catch (error) {\n\t\t\tconsole.warn(`[devframe] in-page channel \"${name}\": failed to grant a port`, error);\n\t\t\tremovePeer(data.panelId, { reason: \"the grant could not be delivered\" });\n\t\t}\n\t};\n\twin?.addEventListener(\"message\", onWindowMessage);\n\tconst emit = (fnName, ...args) => {\n\t\tconst wireArgs = serializeArgs(codec, args);\n\t\tfor (const peer of peers.values()) peer.attached.rpc.$callRaw({\n\t\t\tmethod: channelMethod(\"event\", fnName),\n\t\t\targs: wireArgs,\n\t\t\tevent: true,\n\t\t\toptional: true\n\t\t}).catch(() => {});\n\t};\n\treturn {\n\t\tname,\n\t\tinstanceId,\n\t\tget panels() {\n\t\t\treturn [...peers.values()].map((peer) => peer.peer);\n\t\t},\n\t\tevents: {\n\t\t\ton: events.on,\n\t\t\tonce: events.once\n\t\t},\n\t\temit,\n\t\ton: (fnName, listener) => registry.on(fnName, listener),\n\t\tsharedState: stateHost,\n\t\taddPanelPort: (port) => addPeer(port, `transport:${nanoid(8)}`),\n\t\tclose: () => {\n\t\t\tif (closed) return;\n\t\t\tclosed = true;\n\t\t\tdisposeAgentTools();\n\t\t\twin?.removeEventListener(\"message\", onWindowMessage);\n\t\t\tfor (const id of [...peers.keys()]) removePeer(id, {\n\t\t\t\tbye: true,\n\t\t\t\treason: \"the page script closed the channel\"\n\t\t\t});\n\t\t}\n\t};\n}\n//#endregion\n//#region src/in-page-channel/panel.ts\nconst DEFAULT_HELLO_INTERVAL_MS = 300;\nconst HELLO_INTERVAL_CAP_MS = 3e3;\nconst DEFAULT_EVENT_BUFFER_LIMIT = 64;\n/**\n* Connect the panel endpoint of an in-page channel.\n*\n* The panel initiates: it posts a versioned hello to every window a\n* page script can live in (its ancestor chain and those windows' openers),\n* retrying with backoff until one answers with a dedicated port, so boot\n* order never matters, and a reload of either side is just a re-handshake\n* (`WindowProxy` references survive navigations). While `connecting`,\n* outgoing calls and events are buffered; when no page script exists at all\n* (e.g. the panel opened standalone), the endpoint stays `connecting` and\n* the UI can key a fallback state off `status` / `whenConnected()`.\n*/\nfunction connectPanelChannel(options) {\n\tconst { name } = options;\n\tconst callTimeoutMs = options.callTimeoutMs ?? 15e3;\n\tconst eventBufferLimit = options.eventBufferLimit ?? DEFAULT_EVENT_BUFFER_LIMIT;\n\tconst win = options.window === false ? void 0 : options.window ?? (typeof window === \"undefined\" ? void 0 : window);\n\tconst allowedOrigins = resolveAllowedOrigins(options.allowedOrigins, win);\n\tconst heartbeat = resolveHeartbeat(options.heartbeat);\n\tconst codec = {\n\t\tserialize: options.serialize,\n\t\tdeserialize: options.deserialize\n\t};\n\tconst panelId = nanoid();\n\tconst targets = options.targets ?? (win ? defaultHandshakeTargets(win) : []);\n\tconst canHandshake = !!win && targets.length > 0;\n\tconst events = createEventEmitter();\n\tconst registry = createLocalFunctionRegistry(codec);\n\tfor (const [fnName, definition] of Object.entries(options.functions)) registry.register({\n\t\t...definition,\n\t\tname: fnName\n\t});\n\tfor (const [eventName, definition] of Object.entries(options.events ?? {})) registry.register({\n\t\t...definition,\n\t\tname: eventName,\n\t\ttype: \"event\"\n\t});\n\tconst disposeAgentTools = registerInPageAgentTools(name, registry);\n\tlet status = \"connecting\";\n\tlet attached;\n\tlet pageScriptInfo;\n\tlet helloTimer;\n\tlet heartbeatTimer;\n\tlet droppedEventsWarned = false;\n\tconst pendingCalls = [];\n\tconst eventBuffer = [];\n\tconst connectedWaiters = [];\n\tfunction setStatus(next) {\n\t\tif (status !== next) {\n\t\t\tstatus = next;\n\t\t\tevents.emit(\"status:updated\", next);\n\t\t}\n\t}\n\tconst stateHost = createPanelStateHost({\n\t\tisConnected: () => status === \"connected\",\n\t\tcallEvent: (method, args) => sendEvent(method, serializeArgs(codec, args)),\n\t\tcall: (method, args) => enqueueCall(method, serializeArgs(codec, args))\n\t});\n\tconst stateRegistry = createLocalFunctionRegistry(codec);\n\tfor (const [method, handler] of Object.entries(stateHost.handlers)) stateRegistry.registerInternal(method, handler);\n\tfunction sendEventNow(method, args) {\n\t\tattached?.rpc.$callRaw({\n\t\t\tmethod,\n\t\t\targs,\n\t\t\tevent: true,\n\t\t\toptional: true\n\t\t}).catch(() => {});\n\t}\n\tfunction sendEvent(method, args) {\n\t\tif (status === \"closed\") return;\n\t\tif (status === \"connected\" && attached) {\n\t\t\tsendEventNow(method, args);\n\t\t\treturn;\n\t\t}\n\t\tif (eventBuffer.length >= eventBufferLimit) {\n\t\t\teventBuffer.shift();\n\t\t\tif (!droppedEventsWarned) {\n\t\t\t\tdroppedEventsWarned = true;\n\t\t\t\tconsole.warn(`[devframe] in-page channel \"${name}\": event buffer overflowed while connecting, so the oldest events are being dropped (limit ${eventBufferLimit})`);\n\t\t\t}\n\t\t}\n\t\teventBuffer.push({\n\t\t\tmethod,\n\t\t\targs\n\t\t});\n\t}\n\tfunction enqueueCall(method, args) {\n\t\tif (status === \"closed\") return Promise.reject(new InPageChannelError(\"closed\", `in-page channel \"${name}\": call \"${method}\" rejected because the channel is closed`));\n\t\treturn withCallDeadline(new Promise((resolve, reject) => {\n\t\t\tconst run = () => {\n\t\t\t\tattached.rpc.$call(method, ...args).then((result) => resolve(deserializeResult(codec, result)), reject);\n\t\t\t};\n\t\t\tif (status === \"connected\" && attached) run();\n\t\t\telse pendingCalls.push({\n\t\t\t\trun,\n\t\t\t\treject\n\t\t\t});\n\t\t}), callTimeoutMs, () => `in-page channel \"${name}\": call \"${method}\" timed out after ${callTimeoutMs}ms (status: ${status}${status === \"connecting\" ? \"; is the page script loaded?\" : \"\"})`);\n\t}\n\tfunction adoptPort(port, info) {\n\t\tattached?.dispose({\n\t\t\tbye: true,\n\t\t\treason: \"the panel adopted a newer port\"\n\t\t});\n\t\tattached = attachChannelPort(port, {\n\t\t\tresolveLocal: (fnName) => resolveLocalHandler(fnName, [stateRegistry.resolve, registry.resolve]),\n\t\t\tonControl: (kind) => {\n\t\t\t\tif (kind === \"ping\") attached?.postControl(\"pong\");\n\t\t\t},\n\t\t\tonPeerClosed: () => handleDisconnect(\"the page script went away\")\n\t\t});\n\t\tpageScriptInfo = info;\n\t\tstopTimers();\n\t\tsetStatus(\"connected\");\n\t\tif (heartbeat) heartbeatTimer = setInterval(() => {\n\t\t\tif (!attached) return;\n\t\t\tif (Date.now() - attached.lastActivity > heartbeat.timeoutMs) handleDisconnect(\"the page script went silent (heartbeat timeout)\");\n\t\t\telse attached.postControl(\"ping\");\n\t\t}, heartbeat.intervalMs);\n\t\tfor (const call of pendingCalls.splice(0)) call.run();\n\t\tfor (const { method, args } of eventBuffer.splice(0)) sendEventNow(method, args);\n\t\tstateHost.resubscribe();\n\t\tfor (const waiter of connectedWaiters.splice(0)) waiter.resolve();\n\t}\n\tfunction stopTimers() {\n\t\tif (helloTimer) {\n\t\t\tclearTimeout(helloTimer);\n\t\t\thelloTimer = void 0;\n\t\t}\n\t\tif (heartbeatTimer) {\n\t\t\tclearInterval(heartbeatTimer);\n\t\t\theartbeatTimer = void 0;\n\t\t}\n\t}\n\tfunction handleDisconnect(reason) {\n\t\tif (status === \"closed\") return;\n\t\tattached?.dispose({ reason });\n\t\tattached = void 0;\n\t\tpageScriptInfo = void 0;\n\t\tstopTimers();\n\t\tsetStatus(\"connecting\");\n\t\tif (canHandshake) startHelloLoop();\n\t\telse warnOnce(`in-page channel \"${name}\": transport lost (${reason}) and the panel has no handshake targets, so it stays disconnected`);\n\t}\n\tfunction startHelloLoop() {\n\t\tif (helloTimer || !canHandshake || status !== \"connecting\") return;\n\t\tlet delay = options.helloIntervalMs ?? DEFAULT_HELLO_INTERVAL_MS;\n\t\tconst tick = () => {\n\t\t\tconst hello = {\n\t\t\t\tchannel: IN_PAGE_CHANNEL_TAG,\n\t\t\t\tv: 2,\n\t\t\t\tkind: \"hello\",\n\t\t\t\tname,\n\t\t\t\tpanelId,\n\t\t\t\tinstanceId: options.instanceId\n\t\t\t};\n\t\t\tfor (const target of targets) for (const origin of allowedOrigins) try {\n\t\t\t\ttarget.postMessage(hello, origin);\n\t\t\t} catch {}\n\t\t\tdelay = Math.min(delay * 1.5, HELLO_INTERVAL_CAP_MS);\n\t\t\thelloTimer = setTimeout(tick, delay);\n\t\t};\n\t\ttick();\n\t}\n\tconst onWindowMessage = (event) => {\n\t\tif (status === \"closed\") return;\n\t\tconst data = event.data;\n\t\tif (!isHandshakeMessage(data) || data.kind !== \"grant\" || data.name !== name || data.panelId !== panelId) return;\n\t\tif (data.v !== 2) {\n\t\t\twarnOnce(`in-page channel \"${name}\": ignoring a grant with protocol version ${data.v} (this side speaks 2); align the devframe versions of the page script and the panel`);\n\t\t\treturn;\n\t\t}\n\t\tif (!allowedOrigins.includes(\"*\") && !allowedOrigins.includes(event.origin)) {\n\t\t\twarnOnce(`in-page channel \"${name}\": ignoring a grant from disallowed origin \"${event.origin}\"`);\n\t\t\treturn;\n\t\t}\n\t\tif (options.instanceId && data.instanceId !== options.instanceId) return;\n\t\tconst port = event.ports?.[0];\n\t\tif (port) adoptPort(port, { instanceId: data.instanceId });\n\t};\n\twin?.addEventListener(\"message\", onWindowMessage);\n\tif (options.transport) adoptPort(options.transport);\n\telse if (canHandshake) startHelloLoop();\n\telse warnOnce(`in-page channel \"${name}\": the panel has no handshake targets (not embedded, no opener) and no transport, so calls will buffer until a transport appears or the channel is closed`);\n\treturn {\n\t\tname,\n\t\tget status() {\n\t\t\treturn status;\n\t\t},\n\t\tget pageScript() {\n\t\t\treturn pageScriptInfo;\n\t\t},\n\t\tevents: {\n\t\t\ton: events.on,\n\t\t\tonce: events.once\n\t\t},\n\t\twhenConnected: (timeoutMs) => {\n\t\t\tif (status === \"connected\") return Promise.resolve();\n\t\t\tif (status === \"closed\") return Promise.reject(new InPageChannelError(\"closed\", `in-page channel \"${name}\" is closed`));\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tconst waiter = {\n\t\t\t\t\tresolve,\n\t\t\t\t\treject\n\t\t\t\t};\n\t\t\t\tconnectedWaiters.push(waiter);\n\t\t\t\tif (timeoutMs !== void 0 && timeoutMs > 0) setTimeout(() => {\n\t\t\t\t\tconst index = connectedWaiters.indexOf(waiter);\n\t\t\t\t\tif (index >= 0) {\n\t\t\t\t\t\tconnectedWaiters.splice(index, 1);\n\t\t\t\t\t\treject(new InPageChannelError(\"timeout\", `in-page channel \"${name}\": no page script answered within ${timeoutMs}ms; it may not be loaded in this context (render a fallback state)`));\n\t\t\t\t\t}\n\t\t\t\t}, timeoutMs);\n\t\t\t});\n\t\t},\n\t\tcall: (fnName, ...args) => enqueueCall(channelMethod(\"function\", fnName), serializeArgs(codec, args)),\n\t\temit: (fnName, ...args) => sendEvent(channelMethod(\"event\", fnName), serializeArgs(codec, args)),\n\t\ton: (fnName, listener) => registry.on(fnName, listener),\n\t\tsharedState: stateHost,\n\t\tclose: () => {\n\t\t\tif (status === \"closed\") return;\n\t\t\tsetStatus(\"closed\");\n\t\t\tdisposeAgentTools();\n\t\t\tstopTimers();\n\t\t\twin?.removeEventListener(\"message\", onWindowMessage);\n\t\t\tattached?.dispose({\n\t\t\t\tbye: true,\n\t\t\t\treason: \"the panel closed the channel\"\n\t\t\t});\n\t\t\tattached = void 0;\n\t\t\tpageScriptInfo = void 0;\n\t\t\tconst closedError = new InPageChannelError(\"closed\", `in-page channel \"${name}\" was closed`);\n\t\t\tfor (const call of pendingCalls.splice(0)) call.reject(closedError);\n\t\t\teventBuffer.length = 0;\n\t\t\tfor (const waiter of connectedWaiters.splice(0)) waiter.reject(closedError);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/in-page-channel/index.ts\n/**\n* Define one in-page channel function, the `defineRpcFunction` authoring\n* shape narrowed to the browser (see {@link InPageFunctionDefinition}).\n* Pure identity: it only types the definition. Functions live in\n* side-specific files and are passed to their endpoint via `functions`; the\n* shared protocol file carries only the contract type and the channel-name\n* constant.\n*/\nfunction defineChannelFunction(definition) {\n\treturn definition;\n}\n//#endregion\nexport { InPageChannelError, connectPanelChannel, createPageScriptChannel, defineChannelFunction };\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The direct page ↔ panel channel, for interactions that never need the node\n * side.\n *\n * Everything else the Components tab does goes panel → node → page over RPC\n * and Vite's HMR channel, and should keep going that way: the node side caches\n * the tree and the last details so a panel that connects late has something to\n * render, and so the MCP tools can answer without a panel open. None of that\n * is true of the hover outline — it is pure page-local drawing, it is issued\n * on every `mouseenter` in the tree, and nothing but the page itself ever\n * wants to know about it.\n *\n * Devframe's in-page channel connects a page script to a panel iframe over a\n * `MessageChannel` with no server in the path (same-origin, handshake by\n * posting to the ancestor chain). Two consequences:\n *\n * - The outline stops paying a full round trip through node on every pointer\n * move.\n * - It keeps working where there is no node side at all, which is what a\n * static snapshot of the panel needs to be more than a screenshot.\n *\n * The channel is best-effort by construction. A panel opened as its own tab\n * has no ancestor page script to handshake with, so both sides must treat\n * \"not connected\" as normal and fall back to the RPC path.\n */\n\n/** Channel name, shared by both endpoints. */\nexport const LIT_IN_PAGE_CHANNEL = 'lit:in-page';\n\n/**\n * Contract for {@link LIT_IN_PAGE_CHANNEL}.\n *\n * `highlight` is an event, not a query: the panel does not want an answer, and\n * a fire-and-forget emit is what keeps a hover cheap. `id` is the same stable\n * numeric element id used everywhere else (the timeline's `idOf()` WeakMap),\n * so a tree node, a details payload, and an outline all agree on identity.\n * `null` clears the outline.\n */\nexport interface LitInPageProtocol {\n events: {\n pageScript: {\n highlight: (id: number | null) => void;\n };\n };\n}\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The panel end of the direct page channel (see `types/in-page.ts`).\n *\n * Connected lazily, on first use, rather than at panel boot: connecting posts\n * handshake hellos at every window a page script could live in, and a panel\n * whose user never opens the Components tab has no reason to do that.\n *\n * There is deliberately no error path. The channel is an optimisation over a\n * working RPC route, and it legitimately never connects when the panel is\n * opened as its own tab (no ancestor page to handshake with). Callers check\n * {@link inPageConnected} and fall back.\n */\n\nimport {connectPanelChannel} from 'devframe/in-page-channel';\nimport type {PanelChannel} from 'devframe/in-page-channel';\nimport {LIT_IN_PAGE_CHANNEL, type LitInPageProtocol} from '../types/in-page.js';\n\nlet channel: PanelChannel<LitInPageProtocol> | undefined;\n\n/** The shared channel endpoint, created on first call. */\nexport const inPageChannel = (): PanelChannel<LitInPageProtocol> =>\n (channel ??= connectPanelChannel<LitInPageProtocol>({\n name: LIT_IN_PAGE_CHANNEL,\n functions: {},\n }));\n\n/**\n * Whether the fast path is usable right now. A plain status check, not a\n * promise: callers are on an interaction path (a pointer move over the tree)\n * and must decide synchronously which transport to use.\n */\nexport const inPageConnected = (): boolean =>\n inPageChannel().status === 'connected';\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The panel's single owner of the {@link SettingsOverride}: what it is right\n * now, how it changes, and who wants to know.\n *\n * Three copies have to agree — `localStorage` (the app runtime reads it\n * synchronously at boot, before any DevTools connection exists), devframe's\n * per-user settings store (the durable one, survives a different browser),\n * and the live page (pushed over RPC so a loaded app reacts now). Any tab\n * that flips a preference goes through here so all three move together and\n * every other tab showing the same preference re-renders.\n */\n\nimport {\n OVERRIDE_BASELINES_LS_KEY,\n SETTINGS_OVERRIDE_LS_KEY,\n type OverrideBaselines,\n type SettingsOverride,\n} from '../types/timeline.js';\nimport {litRpc} from './client.js';\n\ntype Listener = (override: SettingsOverride) => void;\n\nconst listeners = new Set<Listener>();\n\nconst notify = (override: SettingsOverride): void => {\n for (const cb of listeners) cb(override);\n};\n\n/** The runtime's copy; `{}` when unset or unparsable. */\nexport const readOverride = (): SettingsOverride => {\n try {\n const raw = localStorage.getItem(SETTINGS_OVERRIDE_LS_KEY);\n if (raw !== null) return JSON.parse(raw) as SettingsOverride;\n } catch {\n // storage unavailable / malformed — fall through to defaults\n }\n return {};\n};\n\nconst writeLocal = (override: SettingsOverride | null): void => {\n try {\n if (override === null) localStorage.removeItem(SETTINGS_OVERRIDE_LS_KEY);\n else\n localStorage.setItem(SETTINGS_OVERRIDE_LS_KEY, JSON.stringify(override));\n } catch {\n // ignore (private mode / storage unavailable)\n }\n};\n\n/**\n * The config values the current overrides were made against; `{}` when unset\n * or unparsable. Deliberately separate from the override itself, so the\n * runtime's apply and the live push never carry it.\n */\nexport const readBaselines = (): OverrideBaselines => {\n try {\n const raw = localStorage.getItem(OVERRIDE_BASELINES_LS_KEY);\n if (raw !== null) return JSON.parse(raw) as OverrideBaselines;\n } catch {\n // storage unavailable / malformed — treat as none recorded\n }\n return {};\n};\n\nconst writeLocalBaselines = (baselines: OverrideBaselines | null): void => {\n try {\n if (baselines === null || Object.keys(baselines).length === 0)\n localStorage.removeItem(OVERRIDE_BASELINES_LS_KEY);\n else\n localStorage.setItem(\n OVERRIDE_BASELINES_LS_KEY,\n JSON.stringify(baselines)\n );\n } catch {\n // ignore (private mode / storage unavailable)\n }\n};\n\n/** Write the durable baselines (or delete them when empty), best-effort. */\nconst persistBaselines = (baselines: OverrideBaselines | undefined): void => {\n const empty = baselines === undefined || Object.keys(baselines).length === 0;\n litRpc()\n .then((rpc) =>\n empty\n ? rpc.settings.global.delete('overrideBaselines')\n : rpc.settings.global.set('overrideBaselines', baselines)\n )\n .catch(() => {\n // dev tool — ignore connection/call errors\n });\n};\n\n/** Send an override to the app runtime over RPC, best-effort. */\nconst pushLive = (override: SettingsOverride): void => {\n litRpc()\n .then((rpc) => rpc.rpc.call('set-settings-override', override))\n .catch(() => {\n // dev tool — ignore connection/call errors\n });\n};\n\n/** Write the durable copy (or delete it with `undefined`), best-effort. */\nconst persist = (override: SettingsOverride | undefined): void => {\n litRpc()\n .then((rpc) =>\n override === undefined\n ? rpc.settings.global.delete('override')\n : rpc.settings.global.set('override', override)\n )\n .catch(() => {\n // dev tool — ignore connection/call errors\n });\n};\n\n/**\n * Subscribe to override changes made anywhere in the panel. Returns the\n * unsubscribe function. Fires for every path below, not for external writes\n * to `localStorage`.\n */\nexport const onOverrideChange = (cb: Listener): (() => void) => {\n listeners.add(cb);\n return () => {\n listeners.delete(cb);\n };\n};\n\n/**\n * A change made in this panel: all three copies, then listeners. `baselines`,\n * when given, replaces the recorded baselines (local and durable; never sent\n * to the page).\n */\nexport const commitOverride = (\n next: SettingsOverride,\n baselines?: OverrideBaselines\n): void => {\n writeLocal(next);\n persist(next);\n if (baselines !== undefined) {\n writeLocalBaselines(baselines);\n persistBaselines(baselines);\n }\n pushLive(next);\n notify(next);\n};\n\n/** Merge a few fields into the current override and commit. */\nexport const patchOverride = (patch: Partial<SettingsOverride>): void => {\n commitOverride({...readOverride(), ...patch});\n};\n\n/**\n * A value that arrived *from* the durable store: mirror it locally and to the\n * page, but don't write it back — that would be a pointless round trip.\n */\nexport const adoptOverride = (\n next: SettingsOverride,\n baselines?: OverrideBaselines\n): void => {\n writeLocal(next);\n if (baselines !== undefined) writeLocalBaselines(baselines);\n pushLive(next);\n notify(next);\n};\n\n/**\n * Drop every override. `envValues`, when known, is pushed to the live runtime\n * so it reverts now — an empty override would leave the current live values\n * in place. Not persisted: they're the resolved config, not a preference.\n */\nexport const resetOverride = (envValues?: SettingsOverride): void => {\n writeLocal(null);\n persist(undefined);\n writeLocalBaselines(null);\n persistBaselines(undefined);\n if (envValues !== undefined) pushLive(envValues);\n notify({});\n};\n\n/**\n * Drop one key from the override, leaving the rest in place. `baseline` is\n * that key's resolved config value; it goes to the live runtime alongside the\n * remaining override (a missing field would leave the current live value in\n * place) but isn't stored, so the key reads as un-overridden again.\n */\nexport const dropOverrideKey = <K extends keyof SettingsOverride>(\n key: K,\n baseline: SettingsOverride[K]\n): void => {\n const next = {...readOverride()};\n delete next[key];\n const empty = Object.keys(next).length === 0;\n writeLocal(empty ? null : next);\n persist(empty ? undefined : next);\n const baselines = readBaselines();\n delete baselines[key as keyof OverrideBaselines];\n writeLocalBaselines(baselines);\n persistBaselines(baselines);\n pushLive({...next, [key]: baseline});\n notify(next);\n};\n\n/**\n * Re-stamp one key's baseline to the config value it has now (\"Keep\"), so the\n * changed-config hint goes away while the override stays.\n */\nexport const keepBaseline = (\n key: keyof OverrideBaselines,\n current: unknown\n): void => {\n const next = {...readBaselines(), [key]: current};\n writeLocalBaselines(next);\n persistBaselines(next);\n notify(readOverride());\n};\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {LitElement, html, css, nothing, type TemplateResult} from 'lit';\nimport {customElement, state} from 'lit/decorators.js';\nimport {tokens} from '../lib/tokens.js';\nimport {\n type InspectorCommand,\n type InspectorDetails,\n type InspectorMessage,\n type InspectorTreeNode,\n} from '../types/inspector.js';\nimport {\n describeHmrReason,\n MAX_HMR_INCOMPATIBILITIES,\n type HmrIncompatibilityEvent,\n} from '../types/hmr-incompatibility.js';\nimport {describeError, isSnapshot, litRpc, type LitClient} from './client.js';\nimport {openInEditor} from './open-in-editor.js';\nimport {inPageChannel, inPageConnected} from './in-page.js';\nimport {\n onOverrideChange,\n patchOverride,\n readOverride,\n} from './settings-override.js';\n\n/** localStorage key remembering the opt-in live-tree toggle. */\nconst LIVE_LS_KEY = 'lit-devtools-components-live';\n\n/**\n * The Components view: a hierarchical tree of the page's Lit elements (left)\n * and a details pane for the selected one (right). A tab of the DevTools panel\n * shell (\\`lit-devtools-panel\\`).\n *\n * It can't touch the page DOM directly (separate iframe), so it drives the\n * page's inspector runtime over devframe RPC: it calls the `inspect` action\n * with {@link InspectorCommand}s and receives {@link InspectorMessage}s\n * through the registered `inspector-message` client function. An overlay\n * inspect-pick arrives as a `pick` message; the view selects that node and\n * asks its host to switch to this tab.\n *\n * It also caches {@link HmrIncompatibilityEvent}s pushed over the\n * `hmr-incompatible` client function (primed from the node side's own cache\n * on connect, same as the tree) and renders them as a banner above the tree —\n * see \"Cannot be patched in place\" in the limitations docs for what these\n * mean. `hmr-count-change` bubbles the current count up to the panel shell so\n * it can badge the tab even while another tab is in front.\n */\n@customElement('components-view')\nexport class ComponentsView extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: flex;\n flex-direction: column;\n flex: 1;\n overflow: hidden;\n }\n :host([hidden]) {\n display: none;\n }\n .toolbar {\n display: flex;\n align-items: center;\n gap: var(--lit-devtools-space-4);\n padding: var(--lit-devtools-space-3) var(--lit-devtools-space-5);\n border-bottom: 1px solid var(--lit-devtools-border);\n background: var(--lit-devtools-surface-low);\n flex-shrink: 0;\n }\n .spacer {\n flex: 1;\n }\n button {\n padding: var(--lit-devtools-space-2) var(--lit-devtools-space-5);\n border-radius: var(--lit-devtools-radius-sm);\n border: 1px solid var(--lit-devtools-border);\n background: var(--lit-devtools-surface-elevated);\n color: var(--lit-devtools-text);\n font-size: var(--lit-devtools-text-2xs);\n cursor: pointer;\n }\n button:hover {\n background: var(--lit-devtools-surface-hover);\n border-color: var(--lit-devtools-border-strong);\n }\n button.pick.active,\n button.live.active,\n button.flash.active {\n border-color: var(--lit-devtools-accent);\n background: var(--lit-devtools-accent-soft);\n color: var(--lit-devtools-accent);\n }\n button:disabled {\n opacity: 0.4;\n cursor: default;\n }\n .body {\n display: flex;\n flex: 1;\n overflow: hidden;\n }\n .tree {\n flex: 1;\n overflow: auto;\n padding: var(--lit-devtools-space-2) 0;\n min-width: 0;\n }\n .empty {\n padding: var(--lit-devtools-space-6);\n color: var(--lit-devtools-text-muted);\n font-size: var(--lit-devtools-text-xs);\n }\n .row {\n display: flex;\n align-items: center;\n gap: var(--lit-devtools-space-2);\n padding: 1px var(--lit-devtools-space-5);\n white-space: nowrap;\n cursor: pointer;\n font-family: var(--lit-devtools-font-mono);\n font-size: var(--lit-devtools-text-xs);\n line-height: 18px;\n }\n .row:hover {\n background: var(--lit-devtools-surface-hover);\n }\n .row.selected {\n background: var(--lit-devtools-surface-active);\n }\n .twisty {\n width: 12px;\n text-align: center;\n color: var(--lit-devtools-text-muted);\n flex-shrink: 0;\n }\n .twisty.leaf {\n visibility: hidden;\n }\n .tag {\n color: var(--lit-devtools-accent);\n }\n .tag .punct {\n color: var(--lit-devtools-text-muted);\n }\n .details {\n width: 340px;\n flex-shrink: 0;\n border-left: 1px solid var(--lit-devtools-border);\n overflow: auto;\n padding: var(--lit-devtools-space-5) var(--lit-devtools-space-5);\n font-size: var(--lit-devtools-text-xs);\n }\n .details h2 {\n font-size: var(--lit-devtools-text-xs);\n font-family: var(--lit-devtools-font-mono);\n color: var(--lit-devtools-accent);\n margin: 0 0 var(--lit-devtools-space-1);\n }\n .src {\n background: none;\n border: 0;\n padding: 0;\n color: var(--lit-devtools-text-link);\n font-size: var(--lit-devtools-text-2xs);\n cursor: pointer;\n text-decoration: underline;\n word-break: break-all;\n text-align: left;\n }\n section {\n margin-top: var(--lit-devtools-space-5);\n }\n section > .label {\n text-transform: uppercase;\n letter-spacing: var(--lit-devtools-tracking-caps);\n font-size: var(--lit-devtools-text-2xs);\n color: var(--lit-devtools-text-muted);\n margin-bottom: var(--lit-devtools-space-2);\n }\n table {\n width: 100%;\n border-collapse: collapse;\n font-family: var(--lit-devtools-font-mono);\n }\n td {\n padding: 2px var(--lit-devtools-space-4) 2px 0;\n vertical-align: top;\n word-break: break-word;\n }\n td.name {\n color: var(--lit-devtools-text);\n white-space: nowrap;\n }\n td.val {\n color: var(--lit-devtools-warning);\n width: 100%;\n }\n .badge {\n display: inline-block;\n margin-left: var(--lit-devtools-space-2);\n padding: 0 var(--lit-devtools-space-2);\n border-radius: var(--lit-devtools-radius-xs);\n font-size: 9px;\n background: var(--lit-devtools-surface-elevated);\n color: var(--lit-devtools-text-secondary);\n vertical-align: middle;\n }\n .flags {\n display: flex;\n gap: var(--lit-devtools-space-4);\n flex-wrap: wrap;\n }\n .flag {\n padding: 1px var(--lit-devtools-space-4);\n border-radius: var(--lit-devtools-radius-xs);\n background: var(--lit-devtools-surface-elevated);\n color: var(--lit-devtools-text-secondary);\n font-size: var(--lit-devtools-text-2xs);\n }\n .flag.on {\n background: var(--lit-devtools-accent-soft);\n color: var(--lit-devtools-accent);\n }\n .placeholder {\n color: var(--lit-devtools-text-muted);\n padding: var(--lit-devtools-space-8) 0;\n text-align: center;\n }\n .hmr-banner {\n flex-shrink: 0;\n border-bottom: 1px solid var(--lit-devtools-border);\n background: var(--lit-devtools-error-soft);\n }\n .hmr-toggle {\n display: flex;\n align-items: center;\n gap: var(--lit-devtools-space-3);\n width: 100%;\n padding: var(--lit-devtools-space-2) var(--lit-devtools-space-5);\n border: 0;\n background: none;\n color: var(--lit-devtools-error);\n font-size: var(--lit-devtools-text-xs);\n font-weight: var(--lit-devtools-weight-semibold);\n text-align: left;\n cursor: pointer;\n }\n .hmr-toggle:hover {\n background: var(--lit-devtools-surface-hover);\n }\n .hmr-count {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 16px;\n padding: 0 var(--lit-devtools-space-2);\n border-radius: var(--lit-devtools-radius-pill);\n background: var(--lit-devtools-error);\n color: var(--lit-devtools-bg);\n font-size: var(--lit-devtools-text-2xs);\n font-weight: var(--lit-devtools-weight-bold);\n }\n .hmr-chevron {\n margin-left: auto;\n color: var(--lit-devtools-error);\n }\n .hmr-list {\n list-style: none;\n margin: 0;\n padding: 0 var(--lit-devtools-space-5) var(--lit-devtools-space-3);\n max-height: 160px;\n overflow-y: auto;\n }\n .hmr-item {\n display: flex;\n align-items: baseline;\n gap: var(--lit-devtools-space-3);\n padding: var(--lit-devtools-space-2) 0;\n border-top: 1px solid var(--lit-devtools-border-subtle);\n font-size: var(--lit-devtools-text-2xs);\n }\n .hmr-item:first-child {\n border-top: 0;\n }\n .hmr-reason {\n flex: 1;\n min-width: 0;\n color: var(--lit-devtools-text);\n }\n .hmr-outcome,\n .hmr-time {\n flex-shrink: 0;\n color: var(--lit-devtools-text-muted);\n white-space: nowrap;\n }\n `,\n ];\n\n @state() private _roots: InspectorTreeNode[] = [];\n @state() private _selectedId: number | null = null;\n @state() private _details: InspectorDetails | null = null;\n /** True when the selected element is no longer in the page (removed / GC'd). */\n @state() private _gone = false;\n @state() private _expanded = new Set<number>();\n @state() private _picking = false;\n /** Opt-in live tree (MutationObserver in the page); persisted, default off. */\n @state() private _live = false;\n /** Mirror of the `flashUpdates` override; the Settings tab shows it too. */\n @state() private _flash = false;\n /** Set when the devframe connection fails; rendered in place of the tree. */\n @state() private _error: string | null = null;\n /** Cached HMR-incompatibility events, most recent last; primed from the\n * node side's cache, then appended to as `hmr-incompatible` pushes arrive. */\n @state() private _hmrIncompatibilities: HmrIncompatibilityEvent[] = [];\n /** Collapse state of the banner; the events themselves are never cleared. */\n @state() private _hmrExpanded = true;\n\n private _rpc: LitClient | null = null;\n private _unsubscribeOverride: (() => void) | null = null;\n\n override connectedCallback() {\n super.connectedCallback();\n this._live = localStorage.getItem(LIVE_LS_KEY) === 'true';\n this._flash = readOverride().flashUpdates ?? false;\n this._unsubscribeOverride = onOverrideChange((o) => {\n this._flash = o.flashUpdates ?? false;\n });\n void this._connect();\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this._unsubscribeOverride?.();\n this._unsubscribeOverride = null;\n this._call({type: 'watch', id: null});\n if (this._live) this._call({type: 'observe', enabled: false});\n }\n\n override updated(changed: Map<string, unknown>) {\n if (changed.has('_hmrIncompatibilities')) {\n // Let the panel shell badge the Components tab even while another tab\n // is in front — same cross-tab-visibility need `inspector-activate`\n // solves for overlay picks, but passive: no tab switch.\n this.dispatchEvent(\n new CustomEvent('hmr-count-change', {\n detail: {count: this._hmrIncompatibilities.length},\n bubbles: true,\n composed: true,\n })\n );\n }\n }\n\n /** Count of cached HMR-incompatibility events; the panel shell's tab badge. */\n get hmrIncompatibilityCount(): number {\n return this._hmrIncompatibilities.length;\n }\n\n // ---------------------------------------------------------------------------\n // Transport\n // ---------------------------------------------------------------------------\n\n /**\n * Connects to the shared devframe client and registers the node → panel\n * `inspector-message` and `hmr-incompatible` pushes. Primes the tree and\n * the HMR-incompatibility list from the node side's caches (so a panel\n * opened after the page loaded isn't blank), then requests a fresh tree —\n * mirroring the old SSE `open` handler, which kicked off the first `tree`\n * request only once the stream was subscribed.\n */\n private async _connect(): Promise<void> {\n try {\n const rpc = await litRpc();\n this._rpc = rpc;\n rpc.rpc.register({\n name: 'inspector-message',\n type: 'event',\n handler: this._onMessage,\n });\n rpc.rpc.register({\n name: 'hmr-incompatible',\n type: 'event',\n handler: this._onHmrIncompatible,\n });\n this._roots = await rpc.rpc.call('list-components');\n this._hmrIncompatibilities = await rpc.rpc.call('hmr-incompatibilities');\n // The baked tree above is all a frozen session has; asking the page for\n // a fresh one would reject (`inspect` is an action, so it is not in the\n // dump) and surface as an unhandled rejection in the console.\n if (!isSnapshot()) void rpc.rpc.call('inspect', {type: 'tree'});\n } catch (err) {\n this._error = describeError(err);\n }\n }\n\n /** Send an {@link InspectorCommand}; a no-op until the client connects. */\n private _call(cmd: InspectorCommand): void {\n if (this._rpc === null) return;\n // Nothing to command in a frozen session: there is no page, and the\n // action is not in the dump.\n if (isSnapshot()) return;\n this._rpc.rpc.call('inspect', cmd).catch((err: unknown) => {\n console.warn('[lit-devtools] inspector call failed', err);\n });\n }\n\n private _onMessage = (msg: InspectorMessage): void => {\n switch (msg.type) {\n case 'ready':\n // Runtime (re)connected — refresh the tree and re-arm any selection.\n this._call({type: 'tree'});\n if (this._selectedId !== null) {\n this._call({type: 'watch', id: this._selectedId});\n }\n break;\n case 'tree':\n this._roots = msg.roots;\n // Re-reveal the selection against the fresh tree: a just-picked node may\n // not have existed in the previous _roots, so the reveal in _select()\n // found no ancestors to expand and the node stayed hidden.\n if (this._selectedId !== null) {\n this._revealAncestors(this._selectedId);\n }\n break;\n case 'details':\n if (msg.details.id === this._selectedId) {\n this._details = msg.details;\n this._gone = false;\n }\n break;\n case 'gone':\n if (msg.id === this._selectedId) {\n this._details = null;\n this._gone = true;\n }\n break;\n case 'pick':\n this._picking = false;\n this._select(msg.id);\n // Bring this tab to the front so the pick is visible.\n this.dispatchEvent(\n new CustomEvent('inspector-activate', {bubbles: true, composed: true})\n );\n break;\n }\n };\n\n /**\n * A component couldn't be hot-patched in place; append it to the banner,\n * keeping only the newest {@link MAX_HMR_INCOMPATIBILITIES} so a long\n * session with many failing edits can't grow this without bound — the same\n * cap the node-side cache applies before it ever broadcasts.\n */\n private _onHmrIncompatible = (event: HmrIncompatibilityEvent): void => {\n this._hmrIncompatibilities = [...this._hmrIncompatibilities, event].slice(\n -MAX_HMR_INCOMPATIBILITIES\n );\n };\n\n // ---------------------------------------------------------------------------\n // Selection / expansion\n // ---------------------------------------------------------------------------\n\n /**\n * Select an element by id from outside (e.g. a timeline event's \"inspect\"\n * link). Same as a tree click; the host is responsible for switching tabs.\n */\n selectById(id: number): void {\n this._select(id);\n }\n\n /** The currently selected element id, for the shell's URL sync. */\n get selectedId(): number | null {\n return this._selectedId;\n }\n\n private _select(id: number): void {\n if (this._selectedId === id) return;\n // Let the shell re-sync the URL hash: a selection is part of \"where the\n // panel is\", and a link that drops it would reopen the wrong view.\n this.dispatchEvent(\n new CustomEvent('selection-change', {detail: {id}, bubbles: true})\n );\n if (this._selectedId !== null) {\n this._call({type: 'watch', id: null});\n }\n this._selectedId = id;\n this._details = null;\n this._gone = false;\n this._revealAncestors(id);\n this._call({type: 'tree'}); // refresh in case the picked node is new\n this._call({type: 'details', id});\n this._call({type: 'watch', id});\n }\n\n /** Expand every ancestor of `id` so the selected node is visible. */\n private _revealAncestors(id: number): void {\n const path = findAncestors(this._roots, id);\n if (path === null) return;\n const next = new Set(this._expanded);\n for (const ancestorId of path) next.add(ancestorId);\n this._expanded = next;\n }\n\n private _toggleExpand(id: number): void {\n const next = new Set(this._expanded);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n this._expanded = next;\n }\n\n // ---------------------------------------------------------------------------\n // Actions\n // ---------------------------------------------------------------------------\n\n private _refresh(): void {\n this._call({type: 'tree'});\n if (this._selectedId !== null) {\n this._call({type: 'details', id: this._selectedId});\n }\n }\n\n private _togglePick(): void {\n this._picking = !this._picking;\n this._call({type: 'pick'});\n }\n\n private _toggleLive(): void {\n this._live = !this._live;\n try {\n localStorage.setItem(LIVE_LS_KEY, String(this._live));\n } catch {\n // ignore (private/storage unavailable)\n }\n this._call({type: 'observe', enabled: this._live});\n // Leaving live mode, pull one fresh tree so it doesn't go stale silently.\n if (!this._live) this._call({type: 'tree'});\n }\n\n /**\n * Flash-on-update is a settings override, not an inspector command: the\n * page runtime reads it at boot (so it survives reloads) and gets live\n * pushes, and the Settings tab mirrors the same switch.\n */\n private _toggleFlash(): void {\n patchOverride({flashUpdates: !this._flash});\n }\n\n /**\n * Outline an element in the page. Fires on every `mouseenter` in the tree,\n * which is why it prefers the direct page channel: the RPC route is\n * panel -> node -> HMR -> page, a full round trip through the dev server\n * for something the page could have drawn itself.\n *\n * The channel is not always there — a panel opened as its own tab has no\n * page script in its ancestry — so the RPC route stays as the fallback and\n * is still the only path when the page predates this version.\n */\n private _highlight(id: number | null): void {\n if (inPageConnected()) {\n inPageChannel().emit('highlight', id);\n return;\n }\n this._call({type: 'highlight', id});\n }\n\n private _toggleHmrExpanded(): void {\n this._hmrExpanded = !this._hmrExpanded;\n }\n\n private _openSource(): void {\n const src = this._details?.source;\n if (src === undefined) return;\n void openInEditor(src.file, src.line);\n }\n\n // ---------------------------------------------------------------------------\n // Render\n // ---------------------------------------------------------------------------\n\n private _renderNode(node: InspectorTreeNode, depth: number): TemplateResult {\n const hasChildren = node.children.length > 0;\n const expanded = this._expanded.has(node.id);\n return html`\n <div\n class=\"row ${node.id === this._selectedId ? 'selected' : ''}\"\n style=\"padding-left:${8 + depth * 14}px\"\n @click=${() => this._select(node.id)}\n @mouseenter=${() => this._highlight(node.id)}\n >\n <span\n class=\"twisty ${hasChildren ? '' : 'leaf'}\"\n @click=${(e: Event) => {\n e.stopPropagation();\n this._toggleExpand(node.id);\n }}\n >${hasChildren ? (expanded ? '▾' : '▸') : '•'}</span\n >\n <span class=\"tag\"\n ><span class=\"punct\">&lt;</span>${node.tagName}<span class=\"punct\"\n >&gt;</span\n ></span\n >\n </div>\n ${\n hasChildren && expanded\n ? node.children.map((c) => this._renderNode(c, depth + 1))\n : nothing\n }\n `;\n }\n\n private _renderPropTable(\n props: InspectorDetails['properties']\n ): TemplateResult {\n return html`\n <table>\n ${props.map(\n (p) => html`\n <tr>\n <td class=\"name\">\n ${p.name}${\n p.reflects\n ? html`<span class=\"badge\" title=\"reflects to attribute\"\n >${\n typeof p.attribute === 'string' ? p.attribute : 'attr'\n }</span\n >`\n : nothing\n }\n </td>\n <td class=\"val\">${p.value}</td>\n </tr>\n `\n )}\n </table>\n `;\n }\n\n private _renderDetails(): TemplateResult {\n const d = this._details;\n if (d === null) {\n let message: string;\n if (this._gone) {\n message = 'This element is no longer in the page.';\n } else if (this._selectedId === null) {\n message = 'Select a component to inspect.';\n } else {\n message = 'Loading…';\n }\n return html`<div class=\"placeholder\">${message}</div>`;\n }\n const props = d.properties.filter((p) => !p.state);\n const stateProps = d.properties.filter((p) => p.state);\n return html`\n <h2>&lt;${d.tagName}&gt;</h2>\n ${\n d.source !== undefined\n ? html`<button class=\"src\" @click=${this._openSource}>\n ${d.source.file}:${d.source.line}\n </button>`\n : nothing\n }\n <section>\n <div class=\"flags\">\n <span class=\"flag ${d.flags.hasUpdated ? 'on' : ''}\">updated</span>\n <span class=\"flag ${d.flags.isUpdatePending ? 'on' : ''}\"\n >update pending</span\n >\n <span class=\"flag ${d.flags.hasShadowRoot ? 'on' : ''}\"\n >shadow root</span\n >\n </div>\n </section>\n ${\n props.length > 0\n ? html`<section>\n <div class=\"label\">Properties</div>\n ${this._renderPropTable(props)}\n </section>`\n : nothing\n }\n ${\n stateProps.length > 0\n ? html`<section>\n <div class=\"label\">State</div>\n ${this._renderPropTable(stateProps)}\n </section>`\n : nothing\n }\n ${\n d.attributes.length > 0\n ? html`<section>\n <div class=\"label\">Attributes</div>\n <table>\n ${d.attributes.map(\n (a) =>\n html`<tr>\n <td class=\"name\">${a.name}</td>\n <td class=\"val\">${a.value}</td>\n </tr>`\n )}\n </table>\n </section>`\n : nothing\n }\n `;\n }\n\n /**\n * Collapsible banner listing components that couldn't be hot-patched in\n * place, most recent first. Rendered only when there's at least one —\n * see `hmrIncompatibilityCount` for the tab-strip badge that covers the\n * case where the developer is parked on another tab.\n */\n private _renderHmrBanner(): TemplateResult | typeof nothing {\n if (this._hmrIncompatibilities.length === 0) return nothing;\n return html`\n <section class=\"hmr-banner\">\n <button\n class=\"hmr-toggle\"\n aria-expanded=${this._hmrExpanded}\n @click=${this._toggleHmrExpanded}\n >\n <span class=\"hmr-title\">HMR issues</span>\n <span class=\"hmr-count\">${this._hmrIncompatibilities.length}</span>\n <span class=\"hmr-chevron\">${this._hmrExpanded ? '▾' : '▸'}</span>\n </button>\n ${\n this._hmrExpanded\n ? html`\n <ul class=\"hmr-list\">\n ${[...this._hmrIncompatibilities].reverse().map(\n (e) => html`\n <li class=\"hmr-item\">\n <span class=\"tag\"\n ><span class=\"punct\">&lt;</span>${e.tagName}<span\n class=\"punct\"\n >&gt;</span\n ></span\n >\n <span class=\"hmr-reason\"\n >${describeHmrReason(e.reason)}</span\n >\n ${\n e.action !== 'none'\n ? html`<span class=\"hmr-outcome\"\n >${\n e.action === 'reload'\n ? 'reloaded'\n : 'warned only'\n }</span\n >`\n : nothing\n }\n <span class=\"hmr-time\"\n >${formatRelativeTime(e.time)}</span\n >\n </li>\n `\n )}\n </ul>\n `\n : nothing\n }\n </section>\n `;\n }\n\n override render() {\n return html`\n <div class=\"toolbar\">\n <button\n class=\"pick ${this._picking ? 'active' : ''}\"\n title=\"Pick an element on the page (Meta+Shift+E)\"\n @click=${this._togglePick}\n >\n ⌖ Pick\n </button>\n <span class=\"spacer\"></span>\n <button\n class=\"live ${this._live ? 'active' : ''}\"\n title=\"Update the tree automatically as the page changes\"\n @click=${this._toggleLive}\n >\n ${this._live ? '● Live' : '○ Live'}\n </button>\n <button\n class=\"flash ${this._flash ? 'active' : ''}\"\n title=\"Flash elements on the page when they update\"\n @click=${this._toggleFlash}\n >\n ⚡ Flash\n </button>\n <button @click=${this._refresh} ?disabled=${this._live}>Refresh</button>\n </div>\n ${this._renderHmrBanner()}\n <div class=\"body\">\n <div class=\"tree\" @mouseleave=${() => this._highlight(null)}>\n ${\n this._error !== null\n ? html`<div class=\"empty\">${this._error}</div>`\n : this._roots.length === 0\n ? html`<div class=\"empty\">\n No Lit components found on the page.\n </div>`\n : this._roots.map((n) => this._renderNode(n, 0))\n }\n </div>\n <div class=\"details\">${this._renderDetails()}</div>\n </div>\n `;\n }\n}\n\n/**\n * Coarse relative time for an {@link HmrIncompatibilityEvent}'s `Date.now()`\n * timestamp (there is no live clock tick in this view — good enough for a\n * banner of rare, one-off events, unlike the timeline's precise `ms` display).\n */\nconst formatRelativeTime = (time: number): string => {\n const seconds = Math.max(0, Math.round((Date.now() - time) / 1000));\n if (seconds < 5) return 'just now';\n if (seconds < 60) return `${seconds}s ago`;\n const minutes = Math.round(seconds / 60);\n if (minutes < 60) return `${minutes}m ago`;\n const hours = Math.round(minutes / 60);\n return `${hours}h ago`;\n};\n\n/**\n * Returns the ids of every ancestor of `id` (nearest last), or `null` if `id`\n * isn't in the tree. The target id itself is not included.\n */\nconst findAncestors = (\n nodes: InspectorTreeNode[],\n id: number\n): number[] | null => {\n const trail: number[] = [];\n const walk = (list: InspectorTreeNode[]): boolean => {\n for (const node of list) {\n if (node.id === id) return true;\n trail.push(node.id);\n if (walk(node.children)) return true;\n trail.pop();\n }\n return false;\n };\n return walk(nodes) ? [...trail] : null;\n};\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'components-view': ComponentsView;\n }\n}\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {LitElement, html, css, nothing} from 'lit';\nimport {customElement, state} from 'lit/decorators.js';\nimport {repeat} from 'lit/directives/repeat.js';\nimport {tokens} from '../lib/tokens.js';\nimport {\n attributeInput,\n rollup,\n toSpans,\n toUpdateCycles,\n} from '../lib/timeline/derive.js';\nimport type {ComponentRollup, UpdateCycle} from '../lib/timeline/derive.js';\nimport type {TimelineEvent} from '../types/timeline.js';\nimport {\n getTimelineError,\n getTimelineEvents,\n subscribeTimeline,\n} from './timeline-store.js';\nimport {openInEditor} from './open-in-editor.js';\n\n/**\n * The Updates view: which components re-rendered, how often, how long for, and\n * why.\n *\n * The Timeline answers \"what happened, in what order\". This answers the two\n * questions that actually send a developer to a devtools panel — *which\n * component updates too much* (the table) and *why did this one update* (the\n * cycle list, keyed on the changed reactive properties). Both are derived from\n * the same recording; nothing extra is captured for this view.\n */\n@customElement('updates-view')\nexport class UpdatesView extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: flex;\n flex-direction: column;\n flex: 1;\n overflow: hidden;\n }\n :host([hidden]) {\n display: none;\n }\n .pane {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n .pane.components {\n flex: 1;\n min-height: 0;\n }\n .pane.cycles {\n flex: 1;\n min-height: 0;\n border-top: 1px solid var(--lit-devtools-border);\n }\n .head {\n display: flex;\n align-items: center;\n gap: var(--lit-devtools-space-3);\n padding: var(--lit-devtools-space-2) var(--lit-devtools-space-5);\n border-bottom: 1px solid var(--lit-devtools-border);\n background: var(--lit-devtools-surface-low);\n font-size: var(--lit-devtools-text-2xs);\n color: var(--lit-devtools-text-muted);\n flex-shrink: 0;\n }\n .head .count {\n margin-left: auto;\n }\n .scroll {\n flex: 1;\n overflow-y: auto;\n }\n .row {\n display: flex;\n align-items: baseline;\n gap: var(--lit-devtools-space-4);\n padding: var(--lit-devtools-space-2) var(--lit-devtools-space-5);\n font-size: var(--lit-devtools-text-2xs);\n font-family: var(--lit-devtools-font-mono);\n border-bottom: 1px solid var(--lit-devtools-border);\n cursor: pointer;\n }\n .row:hover {\n background: var(--lit-devtools-surface-hover);\n }\n .row.selected {\n background: var(--lit-devtools-surface-active);\n }\n .tag {\n flex: 1;\n color: var(--lit-devtools-text);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .num {\n color: var(--lit-devtools-text-secondary);\n flex-shrink: 0;\n width: 72px;\n text-align: right;\n }\n .reasons {\n color: var(--lit-devtools-accent);\n flex-shrink: 0;\n max-width: 240px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .cause {\n color: var(--lit-devtools-text-muted);\n flex-shrink: 0;\n max-width: 200px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .time {\n color: var(--lit-devtools-text-muted);\n flex-shrink: 0;\n width: 64px;\n text-align: right;\n }\n .empty {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n gap: var(--lit-devtools-space-4);\n color: var(--lit-devtools-text-muted);\n font-size: var(--lit-devtools-text-xs);\n padding: var(--lit-devtools-space-5);\n text-align: center;\n }\n .hint {\n font-size: var(--lit-devtools-text-2xs);\n color: var(--lit-devtools-text-muted);\n }\n .error {\n padding: var(--lit-devtools-space-5);\n color: var(--lit-devtools-error);\n font-size: var(--lit-devtools-text-xs);\n }\n a {\n color: var(--lit-devtools-accent);\n text-decoration: none;\n cursor: pointer;\n }\n a:hover {\n text-decoration: underline;\n }\n .link {\n flex-shrink: 0;\n font-size: var(--lit-devtools-text-2xs);\n }\n `,\n ];\n\n @state() private _events: TimelineEvent[] = [];\n @state() private _error: string | null = null;\n /** Tag of the selected component row, or null for \"none picked yet\". */\n @state() private _selectedTag: string | null = null;\n\n private _storeOff: (() => void) | null = null;\n /** Derivation is memoised on the event array's identity: the store replaces\n * the array rather than mutating it, and re-deriving the whole buffer on\n * every unrelated state change would be wasteful. */\n private _derivedFrom: TimelineEvent[] | null = null;\n private _components: ComponentRollup[] = [];\n private _cycles: UpdateCycle[] = [];\n /** Element id from a deep link that has not matched a component yet. Held\n * rather than dropped: a link can arrive before the recording it names has\n * streamed in, which is the normal case for a freshly opened snapshot. */\n private _pendingId: number | null = null;\n\n override connectedCallback() {\n super.connectedCallback();\n this._storeOff = subscribeTimeline(() => this._readStore());\n this._readStore();\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this._storeOff?.();\n this._storeOff = null;\n }\n\n private _readStore(): void {\n this._events = getTimelineEvents();\n this._error = getTimelineError();\n }\n\n override willUpdate() {\n if (this._derivedFrom === this._events) return;\n this._derivedFrom = this._events;\n this._cycles = attributeInput(\n toUpdateCycles(toSpans(this._events)),\n this._events\n );\n this._components = rollup(this._cycles);\n // Keep the selection meaningful: a tag that no longer updated in the\n // retained window would leave the lower pane permanently empty.\n if (\n this._selectedTag !== null &&\n !this._components.some((c) => c.tagName === this._selectedTag)\n ) {\n this._selectedTag = null;\n }\n this._resolvePending();\n }\n\n private _resolvePending(): void {\n if (this._pendingId === null) return;\n const match = this._components.find((c) =>\n c.elementIds.includes(this._pendingId!)\n );\n if (match === undefined) return;\n this._pendingId = null;\n this._selectedTag = match.tagName;\n }\n\n /**\n * The element id the current selection stands for, for the panel shell's\n * deep link. A row is a component *tag*, so this reports the first instance\n * of it that updated — which selects the same row on the way back in.\n */\n get selectedId(): number | null {\n const selected = this._components.find(\n (c) => c.tagName === this._selectedTag\n );\n return selected?.elementIds[0] ?? null;\n }\n\n /** Selects the component row that the given element instance belongs to. */\n selectById(elementId: number): void {\n this._pendingId = elementId;\n this._resolvePending();\n }\n\n private _select(tagName: string): void {\n this._selectedTag = tagName;\n this._pendingId = null;\n this.dispatchEvent(new CustomEvent('selection-change'));\n }\n\n /** Ask the panel shell to open the Components tab on this element. */\n private _inspect(id: number) {\n this.dispatchEvent(\n new CustomEvent('inspect-element', {\n detail: {id},\n bubbles: true,\n composed: true,\n })\n );\n }\n\n override render() {\n if (this._error !== null) {\n return html`<div class=\"error\">${this._error}</div>`;\n }\n if (this._components.length === 0) {\n return html`\n <div class=\"empty\">\n <span>No component updates recorded.</span>\n <span class=\"hint\">\n Press Record in the Timeline tab, with the Lit Lifecycle layer on,\n then interact with the page.\n </span>\n </div>\n `;\n }\n return html`\n <div class=\"pane components\">\n <div class=\"head\">\n <span>Component</span>\n <span class=\"count\">${this._components.length} components</span>\n </div>\n <div class=\"scroll\">\n ${repeat(\n this._components,\n (entry) => entry.tagName,\n (entry) => this._renderComponent(entry)\n )}\n </div>\n </div>\n ${this._renderCycles()}\n `;\n }\n\n private _renderComponent(entry: ComponentRollup) {\n const instances =\n entry.elementIds.length > 1 ? ` ×${entry.elementIds.length}` : '';\n return html`\n <div\n class=\"row ${this._selectedTag === entry.tagName ? 'selected' : ''}\"\n @click=${() => this._select(entry.tagName)}\n >\n <span class=\"tag\">&lt;${entry.tagName}&gt;${instances}</span>\n <span class=\"reasons\"\n >${entry.reasons.map((r) => r.key).join(', ')}</span\n >\n <span class=\"num\" title=\"Updates recorded\">${entry.updates}×</span>\n <span class=\"num\" title=\"Total time in performUpdate\"\n >${formatMs(entry.totalMs)}</span\n >\n <span class=\"num\" title=\"Slowest single update\"\n >${formatMs(entry.maxMs)}</span\n >\n </div>\n `;\n }\n\n private _renderCycles() {\n if (this._selectedTag === null) {\n return html`\n <div class=\"pane cycles\">\n <div class=\"empty\">\n <span class=\"hint\">\n Pick a component to see each of its updates and what changed.\n </span>\n </div>\n </div>\n `;\n }\n const cycles = this._cycles.filter((c) => c.tagName === this._selectedTag);\n const source = this._components.find(\n (c) => c.tagName === this._selectedTag\n )?.source;\n return html`\n <div class=\"pane cycles\">\n <div class=\"head\">\n <span>&lt;${this._selectedTag}&gt; updates</span>\n ${\n source\n ? html`<a\n class=\"link\"\n title=\"Open this file in your editor\"\n @click=${() => openInEditor(source.file, source.line)}\n >${source.file}:${source.line}</a\n >`\n : nothing\n }\n <span class=\"count\">${cycles.length}</span>\n </div>\n <div class=\"scroll\">\n ${repeat(\n cycles,\n (cycle) => cycle.key,\n (cycle) => html`\n <div class=\"row\">\n <span class=\"time\">${cycle.start.toFixed(1)}ms</span>\n <span class=\"num\">${formatMs(cycle.duration)}</span>\n <span class=\"tag\"\n >${\n cycle.changed.length > 0\n ? cycle.changed.join(', ')\n : html`<span class=\"hint\">no changed properties</span>`\n }</span\n >\n <span class=\"cause\">${renderCause(cycle)}</span>\n <a\n class=\"link\"\n title=\"Open this instance in the Components tab\"\n @click=${() => this._inspect(cycle.elementId)}\n >#${cycle.elementId}</a\n >\n </div>\n `\n )}\n </div>\n </div>\n `;\n }\n}\n\n/** Lit updates are routinely sub-millisecond, so one decimal is not enough. */\nconst formatMs = (ms: number | undefined): string => {\n if (ms === undefined) return '—';\n return ms < 1 ? `${ms.toFixed(2)}ms` : `${ms.toFixed(1)}ms`;\n};\n\n/**\n * \"after click (412, 88)\" — or nothing. An update with no cause within the\n * attribution window is a timer, a signal or a stray `requestUpdate()`, and\n * saying so wrongly would be worse than saying nothing.\n */\nconst renderCause = (cycle: UpdateCycle): string => {\n const {cause} = cycle;\n if (cause === undefined) return '';\n return `after ${cause.type}${cause.detail ? ` ${cause.detail}` : ''}`;\n};\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'updates-view': UpdatesView;\n }\n}\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Addressing a specific view inside the panel.\n *\n * Two arrival paths, because the panel runs in two quite different places:\n *\n * - **Inside the DevTools hub.** Anything holding an RPC client — another\n * devframe, a command, this plugin's own node side when the page overlay\n * picks an element — calls `hub:docks:activate` with `{dockId, params}`.\n * The hub mirrors the request into the `devframe:docks:active` shared\n * state, so a panel that mounts *because of* the activation still sees it\n * instead of missing a live broadcast.\n * - **Standalone, or as an exported snapshot.** There is no hub; the URL is\n * the only carrier. Devframe's guidance is the hash, not the query string,\n * since the query is where handshake tokens live and those must not travel\n * in a link someone pastes into an issue.\n *\n * Both collapse to the same {@link DeepLink}, so callers handle one shape.\n */\n\nimport {litRpc} from './client.js';\n\n/** The hub's mirrored activation slot. */\nconst DOCKS_ACTIVE_STATE = 'devframe:docks:active';\n\n/** Our dock id, as the hub knows it. */\nconst LIT_DOCK_ID = 'lit';\n\n/**\n * Tabs a link can name. A value rather than a bare union because the same list\n * is validated in two places and cast in a third; adding a view should not\n * mean remembering all of them.\n */\nexport const DEEP_LINK_TABS = [\n 'components',\n 'updates',\n 'timeline',\n 'settings',\n] as const;\n\nexport type DeepLinkTab = (typeof DEEP_LINK_TABS)[number];\n\nconst isTab = (value: unknown): value is DeepLinkTab =>\n typeof value === 'string' &&\n (DEEP_LINK_TABS as readonly string[]).includes(value);\n\n/** A resolved link into the panel. Every field is optional and additive. */\nexport interface DeepLink {\n /** Which tab to show. */\n tab?: DeepLinkTab;\n /** Element to select, by stable id: a node in the Components tree, or the\n * component row it belongs to in Updates. */\n componentId?: number;\n /** Timeline event to select, by the id the node side stamped on it (see\n * `TimelineEvent.id`). Survives a snapshot export, unlike a buffer index. */\n eventId?: string;\n}\n\n/** True when a link asks for anything at all. */\nconst hasLink = (link: DeepLink): boolean =>\n link.tab !== undefined ||\n link.componentId !== undefined ||\n link.eventId !== undefined;\n\n/** Parse a `DeepLink` out of hash params, ignoring anything unrecognised. */\nexport const fromParams = (params: URLSearchParams): DeepLink => {\n const link: DeepLink = {};\n const tab = params.get('tab');\n if (isTab(tab)) {\n link.tab = tab;\n }\n const id = Number(params.get('component'));\n // `Number('')` is 0 and `Number(null)` is 0, so require the param to be\n // there *and* numeric before trusting it — id 0 is a real element id.\n if (params.get('component') !== null && Number.isInteger(id)) {\n link.componentId = id;\n }\n const eventId = params.get('event');\n if (eventId !== null && eventId !== '') link.eventId = eventId;\n return link;\n};\n\n/** Read the link encoded in the current URL hash, if any. */\nexport const readHashLink = (): DeepLink =>\n fromParams(new URLSearchParams(location.hash.replace(/^#/, '')));\n\n/**\n * Reflect the panel's current position into the URL hash, so copying the\n * address bar produces a link that reopens it.\n *\n * `replaceState`, not `pushState`: clicking through a component tree is\n * browsing one view, not navigating between pages, and stacking a history\n * entry per click would turn Back into a frustration. Merges into whatever\n * else is in the hash rather than overwriting it.\n */\nexport const writeHashLink = (link: DeepLink): void => {\n const params = new URLSearchParams(location.hash.replace(/^#/, ''));\n if (link.tab === undefined) params.delete('tab');\n else params.set('tab', link.tab);\n if (link.componentId === undefined) params.delete('component');\n else params.set('component', String(link.componentId));\n if (link.eventId === undefined) params.delete('event');\n else params.set('event', link.eventId);\n const next = params.toString();\n if (next === location.hash.replace(/^#/, '')) return;\n history.replaceState(\n history.state,\n '',\n next === '' ? location.pathname : `#${next}`\n );\n};\n\n/**\n * Call `apply` for every link addressed at this panel: once for the URL hash\n * the panel opened with, then again whenever the hub activates our dock with\n * params, and on manual hash edits / back-forward.\n *\n * Never throws. Deep links are a convenience; a panel with no hub (or an\n * older one with no activation state) simply keeps the hash path.\n */\nexport const onDeepLink = (apply: (link: DeepLink) => void): void => {\n const hashLink = readHashLink();\n if (hasLink(hashLink)) apply(hashLink);\n window.addEventListener('hashchange', () => apply(readHashLink()));\n\n void (async () => {\n try {\n const client = await litRpc();\n const state = await client.base.sharedState.get<{\n activation: {dockId: string; params?: Record<string, unknown>} | null;\n }>(DOCKS_ACTIVE_STATE);\n const handle = (value: {\n activation: {dockId: string; params?: Record<string, unknown>} | null;\n }): void => {\n const activation = value.activation;\n if (activation === null || activation.dockId !== LIT_DOCK_ID) return;\n const params = activation.params;\n if (params === undefined) return;\n const link: DeepLink = {};\n const tab = params['tab'];\n if (isTab(tab)) {\n link.tab = tab;\n }\n const id = params['componentId'];\n if (typeof id === 'number' && Number.isInteger(id)) {\n link.componentId = id;\n }\n const eventId = params['eventId'];\n if (typeof eventId === 'string' && eventId !== '') {\n link.eventId = eventId;\n }\n if (hasLink(link)) apply(link);\n };\n handle(state.value());\n state.on('updated', handle);\n } catch {\n // No hub, or no activation slot — the hash path above still works.\n }\n })();\n};\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport type {OverrideBaselines} from '../types/timeline.js';\n\n/**\n * Whether the config value an override was made against has since changed.\n *\n * `recorded` is `undefined` for a legacy override that predates baseline\n * tracking, which never counts as a change (no false positives). Values are\n * compared structurally. The source-overlay editor reports `'custom'` for an\n * `EditorConfig` object, which can't be compared meaningfully, so any side\n * being `'custom'` skips the check.\n */\nexport const baselineChanged = (\n key: keyof OverrideBaselines,\n recorded: unknown,\n current: unknown\n): boolean => {\n if (recorded === undefined || current === undefined) return false;\n if (\n key === 'sourceOverlayEditor' &&\n (recorded === 'custom' || current === 'custom')\n ) {\n return false;\n }\n return JSON.stringify(recorded) !== JSON.stringify(current);\n};\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {LitElement, html, css, nothing} from 'lit';\nimport {customElement, state} from 'lit/decorators.js';\nimport {tokens} from '../lib/tokens.js';\nimport {\n readColorSchemePreference,\n setColorSchemePreference,\n type ColorSchemePreference,\n} from '../lib/color-scheme.js';\nimport {\n SOURCE_OVERLAY_EDITORS,\n type FeatureSettings,\n type OverrideBaselines,\n type SettingSources,\n type SettingsOverride,\n} from '../types/timeline.js';\nimport {baselineChanged} from '../lib/override-baselines.js';\nimport {getMeta, litRpc, type LitClient} from './client.js';\nimport {\n adoptOverride,\n commitOverride,\n dropOverrideKey,\n onOverrideChange,\n keepBaseline,\n readBaselines,\n readOverride,\n resetOverride,\n} from './settings-override.js';\n\n/** Settings a panel override can replace and that have a config baseline. */\ntype OverridableKey =\n | 'hmrReconnect'\n | 'hmrOnIncompatible'\n | 'hmrIndicatorVisible'\n | 'hmrIndicatorCount'\n | 'sourceOverlayEditor';\n\n/** The settings this panel persists, as `DevframeSettingsRegistry.lit`. */\ntype LitSettings = Awaited<ReturnType<LitClient['settings']['global']['all']>>;\n\n/**\n * Settings view. Shows the plugin's resolved feature settings and lets the\n * HMR ones be overridden live — persisted (same-origin localStorage, read by\n * the app runtime on load) and pushed over HMR for immediate effect. Settings\n * whose feature is disabled at config time can't be enabled here (their runtime\n * isn't injected); those stay read-only.\n */\n@customElement('devtools-settings')\nexport class DevtoolsSettings extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n flex: 1;\n overflow-y: auto;\n padding: var(--lit-devtools-space-5) var(--lit-devtools-space-6);\n font-size: var(--lit-devtools-text-xs);\n line-height: var(--lit-devtools-leading-normal);\n }\n .note {\n color: var(--lit-devtools-text-muted);\n margin: 0 0 var(--lit-devtools-space-5);\n }\n .note code {\n color: var(--lit-devtools-accent);\n font-family: var(--lit-devtools-font-mono);\n }\n section {\n border: 1px solid var(--lit-devtools-border);\n border-radius: var(--lit-devtools-radius-md);\n margin-bottom: var(--lit-devtools-space-5);\n overflow: hidden;\n }\n h3 {\n display: flex;\n align-items: center;\n gap: var(--lit-devtools-space-4);\n margin: 0;\n padding: var(--lit-devtools-space-3) var(--lit-devtools-space-5);\n font-size: var(--lit-devtools-text-xs);\n background: var(--lit-devtools-surface-low);\n border-bottom: 1px solid var(--lit-devtools-border);\n }\n .pill {\n font-size: var(--lit-devtools-text-2xs);\n font-weight: var(--lit-devtools-weight-semibold);\n text-transform: uppercase;\n letter-spacing: var(--lit-devtools-tracking-caps);\n padding: 1px var(--lit-devtools-space-4);\n border-radius: var(--lit-devtools-radius-pill);\n border: 1px solid var(--lit-devtools-border-strong);\n color: var(--lit-devtools-text-muted);\n }\n .pill.on {\n color: var(--lit-devtools-accent);\n border-color: var(--lit-devtools-accent);\n background: var(--lit-devtools-accent-soft);\n }\n .reset {\n margin-left: auto;\n appearance: none;\n border: 1px solid var(--lit-devtools-border-strong);\n background: var(--lit-devtools-surface-elevated);\n color: var(--lit-devtools-text);\n border-radius: var(--lit-devtools-radius-sm);\n font: inherit;\n font-size: var(--lit-devtools-text-2xs);\n padding: var(--lit-devtools-space-1) var(--lit-devtools-space-4);\n cursor: pointer;\n }\n .reset:hover {\n background: var(--lit-devtools-surface-hover);\n }\n table {\n width: 100%;\n border-collapse: collapse;\n }\n td {\n padding: var(--lit-devtools-space-3) var(--lit-devtools-space-5);\n vertical-align: middle;\n }\n tr:not(:last-child) td {\n border-bottom: 1px solid var(--lit-devtools-border);\n }\n .key {\n color: var(--lit-devtools-text-muted);\n white-space: nowrap;\n width: 1%;\n }\n .val {\n color: var(--lit-devtools-text);\n font-family: var(--lit-devtools-font-mono);\n }\n .env {\n color: var(--lit-devtools-text-muted);\n font-family: var(--lit-devtools-font-mono);\n font-size: var(--lit-devtools-text-2xs);\n }\n .ovr {\n color: var(--lit-devtools-warning);\n font-size: var(--lit-devtools-text-2xs);\n margin-left: var(--lit-devtools-space-3);\n vertical-align: middle;\n }\n .src {\n margin-left: var(--lit-devtools-space-3);\n vertical-align: middle;\n }\n .row-reset {\n appearance: none;\n border: 1px solid var(--lit-devtools-border-strong);\n background: var(--lit-devtools-surface-elevated);\n color: var(--lit-devtools-text-muted);\n border-radius: var(--lit-devtools-radius-sm);\n font: inherit;\n font-size: var(--lit-devtools-text-2xs);\n line-height: 1;\n padding: 1px var(--lit-devtools-space-2);\n margin-left: var(--lit-devtools-space-3);\n vertical-align: middle;\n cursor: pointer;\n }\n .row-reset:hover {\n background: var(--lit-devtools-surface-hover);\n color: var(--lit-devtools-text);\n }\n .nudge {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: var(--lit-devtools-space-3);\n margin-top: var(--lit-devtools-space-2);\n color: var(--lit-devtools-warning);\n font-family: inherit;\n font-size: var(--lit-devtools-text-2xs);\n }\n .nudge button {\n appearance: none;\n border: 1px solid var(--lit-devtools-border-strong);\n background: var(--lit-devtools-surface-elevated);\n color: var(--lit-devtools-text);\n border-radius: var(--lit-devtools-radius-sm);\n font: inherit;\n line-height: 1;\n padding: 1px var(--lit-devtools-space-3);\n cursor: pointer;\n }\n .nudge button:hover {\n background: var(--lit-devtools-surface-hover);\n }\n label.toggle {\n display: inline-flex;\n align-items: center;\n gap: var(--lit-devtools-space-3);\n cursor: pointer;\n vertical-align: middle;\n }\n input,\n select {\n accent-color: var(--lit-devtools-accent);\n font: inherit;\n font-family: var(--lit-devtools-font-mono);\n vertical-align: middle;\n }\n select {\n background: var(--lit-devtools-surface-elevated);\n color: var(--lit-devtools-text);\n border: 1px solid var(--lit-devtools-border-strong);\n border-radius: var(--lit-devtools-radius-sm);\n padding: 1px var(--lit-devtools-space-2);\n }\n .row-disabled {\n opacity: 0.5;\n }\n .empty {\n color: var(--lit-devtools-text-muted);\n padding: var(--lit-devtools-space-3) var(--lit-devtools-space-5);\n }\n .empty code {\n color: var(--lit-devtools-accent);\n font-family: var(--lit-devtools-font-mono);\n }\n .loading {\n color: var(--lit-devtools-text-muted);\n }\n `,\n ];\n\n @state() private _settings: FeatureSettings | null = null;\n @state() private _override: SettingsOverride = {};\n @state() private _recorded: OverrideBaselines = {};\n @state() private _loaded = false;\n @state() private _colorScheme: ColorSchemePreference = 'auto';\n\n private _unsubscribeOverride: (() => void) | null = null;\n\n override connectedCallback() {\n super.connectedCallback();\n // Synchronous first, from `localStorage`, so the tab paints the right\n // values (and the panel the right scheme) with no flash. `_hydrate()`\n // then reconciles against the durable store, which is what makes these\n // preferences survive a different browser or cleared site data.\n this._override = readOverride();\n this._recorded = readBaselines();\n // Other tabs (Components' Flash button) flip overrides too; stay in sync.\n this._unsubscribeOverride = onOverrideChange((o) => {\n this._override = o;\n this._recorded = readBaselines();\n });\n this._colorScheme = readColorSchemePreference();\n void this._fetch();\n void this._hydrate();\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this._unsubscribeOverride?.();\n this._unsubscribeOverride = null;\n }\n\n /**\n * Adopt the persisted preferences from devframe's per-user settings store,\n * letting them win over this browser's `localStorage` copy.\n *\n * `global`, not `project`: in `devframe@1.0.0` the `project` store lives in\n * `<workspaceRoot>/node_modules/.<app>/devframe` (private per checkout, and\n * wiped by a clean install), while `global` is per-user, which is what \"my\n * editor\", \"my color scheme\", \"how I like HMR to behave\" actually are.\n * Project-wide defaults already have a home: the committed `litPlugin({...})`\n * config.\n *\n * Subscribes rather than reading once. The client-side store is a mirror of\n * a shared state, and it is empty until the first sync arrives -- a `get()`\n * issued right after connecting reads `undefined` even when the server has\n * a value on disk. `onChange` gets the first sync as an update; the `all()`\n * below covers a sync that landed before the subscription did.\n *\n * Never throws: without a hub the panel just keeps its `localStorage`\n * values.\n */\n private async _hydrate(): Promise<void> {\n try {\n const {settings} = await litRpc();\n await settings.global.onChange((all) => this._adopt(all));\n this._adopt(await settings.global.all());\n } catch {\n // dev tool — a missing or unreachable settings store is not an error\n }\n }\n\n /**\n * Apply a settings snapshot. Both branches no-op when the value already\n * matches, which is what stops `_adopt` -> `commitOverride` -> store write ->\n * `onChange` -> `_adopt` from looping.\n */\n private _adopt(all: Readonly<LitSettings>): void {\n const {appearance, override, overrideBaselines} = all;\n if (appearance !== undefined && appearance !== this._colorScheme) {\n this._colorScheme = appearance;\n setColorSchemePreference(appearance);\n }\n if (\n override !== undefined &&\n (JSON.stringify(override) !== JSON.stringify(this._override) ||\n JSON.stringify(overrideBaselines ?? {}) !==\n JSON.stringify(readBaselines()))\n ) {\n // Mirrors to the page and `localStorage` without writing back to the\n // store the value just came from; `_override` updates via the listener.\n // The baselines come along so a second browser judges \"config changed\"\n // against what the first one recorded.\n adoptOverride(override, overrideBaselines ?? {});\n }\n }\n\n /** Write one preference through to the durable store, best-effort. */\n private _persist<K extends keyof LitSettings>(\n key: K,\n value: LitSettings[K] | undefined\n ): void {\n litRpc()\n .then((rpc) =>\n value === undefined\n ? rpc.settings.global.delete(key)\n : rpc.settings.global.set(key, value)\n )\n .catch(() => {\n // dev tool — ignore connection/call errors\n });\n }\n\n private _setColorScheme(scheme: ColorSchemePreference): void {\n this._colorScheme = scheme;\n // `localStorage` first and synchronously: it applies the class right\n // away, and is what the panel reads before its first paint next time.\n setColorSchemePreference(scheme);\n this._persist('appearance', scheme);\n }\n\n private async _fetch() {\n try {\n const meta = await getMeta();\n this._settings = meta.features;\n } catch {\n this._settings = null;\n } finally {\n this._loaded = true;\n }\n }\n\n private _set<K extends keyof SettingsOverride>(\n key: K,\n value: SettingsOverride[K]\n ) {\n // Remember the config value this override was made against, so a later\n // change to `.env` or the plugin options can be pointed out.\n const s = this._settings;\n const baselines = readBaselines();\n if (s !== null && key in this._baselines(s)) {\n baselines[key as OverridableKey] =\n this._baselines(s)[key as OverridableKey];\n }\n commitOverride({...this._override, [key]: value}, baselines);\n }\n\n /** The resolved config value of every overridable setting. */\n private _baselines(\n s: FeatureSettings\n ): Required<Pick<SettingsOverride, OverridableKey>> {\n return {\n hmrReconnect: s.hmr.reconnect,\n hmrOnIncompatible: s.hmr.onIncompatible,\n hmrIndicatorVisible: s.hmr.indicatorEnabled,\n hmrIndicatorCount: s.hmr.indicatorCount,\n sourceOverlayEditor: s.sourceOverlay.editor,\n };\n }\n\n /** Clear overrides and revert the runtime to the resolved env values. */\n private _reset() {\n const s = this._settings;\n // The env values go along so the live runtime reverts now (an empty\n // override would leave the current live values in place). Preferences\n // with no config baseline revert to off.\n resetOverride(\n s === null\n ? undefined\n : ({\n ...this._baselines(s),\n flashUpdates: false,\n flashUpdatesRamp: false,\n chromeTracks: false,\n } satisfies SettingsOverride)\n );\n }\n\n /** Drop one overridden setting, reverting it (live) to its baseline. */\n private _resetKey(key: OverridableKey) {\n const s = this._settings;\n if (s === null) return;\n dropOverrideKey(key, this._baselines(s)[key]);\n }\n\n private _pill(on: boolean) {\n return html`<span class=\"pill ${on ? 'on' : ''}\"\n >${on ? 'enabled' : 'disabled'}</span\n >`;\n }\n\n /**\n * Origin badge behind a value, from the server-side provenance:\n * \"(env)\", \"(option)\" or \"(default)\". Nothing when the server sent none.\n */\n private _source(key: keyof SettingSources) {\n const src = this._settings?.sources?.[key];\n return src ? html`<span class=\"env src\">(${src})</span>` : nothing;\n }\n\n /**\n * Badge for an overridable row. Without an override it's the plain origin\n * badge; with one it's \"(overridden)\", the baseline it replaced\n * (\"env: Zed\") and a reset for just this row. `baseline` is the config\n * value as the row displays it, `fmt` renders a recorded raw value the same\n * way. When the config value moved since the override was made, a second\n * line says so and offers Reset or Keep.\n */\n private _ovrSource(\n key: OverridableKey,\n baseline: string,\n fmt: (value: unknown) => string = String\n ) {\n if (this._override[key] === undefined) return this._source(key);\n const src = this._settings?.sources?.[key] ?? 'config';\n const s = this._settings;\n const current = s === null ? undefined : this._baselines(s)[key];\n const changed = baselineChanged(key, this._recorded[key], current);\n return html`<span class=\"ovr\">(overridden)</span>\n <span class=\"env\">${src}: ${baseline}</span>\n <button\n class=\"row-reset\"\n title=\"Reset to the ${src} value\"\n aria-label=\"Reset to the ${src} value\"\n @click=${() => this._resetKey(key)}\n >\n ×\n </button>\n ${\n changed\n ? html`<div class=\"nudge\" data-nudge=${key}>\n <span\n >Config changed since you overrode this: was\n ${fmt(this._recorded[key])}, now ${baseline}</span\n >\n <button @click=${() => this._resetKey(key)}>Reset</button>\n <button @click=${() => keepBaseline(key, current)}>Keep</button>\n </div>`\n : nothing\n }`;\n }\n\n private _readonlyRow(\n key: string,\n value: unknown,\n env?: string,\n source?: keyof SettingSources\n ) {\n return html`\n <tr>\n <td class=\"key\">${key}</td>\n <td class=\"val\">\n ${String(value)} ${source ? this._source(source) : nothing}\n ${env ? html`<span class=\"env\">${env}</span>` : nothing}\n </td>\n </tr>\n `;\n }\n\n private _renderAppearance() {\n return html`\n <section>\n <h3>Appearance</h3>\n <table>\n <tr>\n <td class=\"key\">color scheme</td>\n <td class=\"val\">\n <select\n @change=${(e: Event) =>\n this._setColorScheme(\n (e.target as HTMLSelectElement)\n .value as ColorSchemePreference\n )}\n >\n ${(\n [\n ['auto', 'Auto'],\n ['dark', 'Dark'],\n ['light', 'Light'],\n ] as Array<[ColorSchemePreference, string]>\n ).map(\n ([value, label]) =>\n html`<option\n value=${value}\n ?selected=${this._colorScheme === value}\n >\n ${label}\n </option>`\n )}\n </select>\n </td>\n </tr>\n </table>\n </section>\n `;\n }\n\n private _renderHmr(s: FeatureSettings) {\n const o = this._override;\n if (!s.hmr.enabled) {\n return html`<p class=\"empty\">\n Enable with <code>hmr: true</code> or <code>LIT_PLUGIN_HMR=true</code>.\n </p>`;\n }\n const reconnect = o.hmrReconnect ?? s.hmr.reconnect;\n const onIncompatible = o.hmrOnIncompatible ?? s.hmr.onIncompatible;\n // The indicator element only exists when enabled at config time, so it can\n // be hidden/shown (and its count toggled) live but not created here.\n const indicatorVisible = o.hmrIndicatorVisible ?? s.hmr.indicatorEnabled;\n const indicatorCount = o.hmrIndicatorCount ?? s.hmr.indicatorCount;\n return html`\n <table>\n <tr>\n <td class=\"key\">reconnect</td>\n <td class=\"val\">\n <label class=\"toggle\">\n <input\n type=\"checkbox\"\n .checked=${reconnect}\n @change=${(e: Event) =>\n this._set(\n 'hmrReconnect',\n (e.target as HTMLInputElement).checked\n )}\n />\n ${reconnect ? 'on' : 'off'}\n </label>\n ${this._ovrSource(\n 'hmrReconnect',\n s.hmr.reconnect ? 'on' : 'off',\n (v) => (v ? 'on' : 'off')\n )}\n </td>\n </tr>\n <tr>\n <td class=\"key\">on incompatible</td>\n <td class=\"val\">\n <select\n @change=${(e: Event) =>\n this._set(\n 'hmrOnIncompatible',\n (e.target as HTMLSelectElement).value as 'reload' | 'warn'\n )}\n >\n <option value=\"reload\" ?selected=${onIncompatible === 'reload'}>\n reload\n </option>\n <option value=\"warn\" ?selected=${onIncompatible === 'warn'}>\n warn\n </option>\n </select>\n ${this._ovrSource('hmrOnIncompatible', s.hmr.onIncompatible)}\n </td>\n </tr>\n <tr class=${s.hmr.indicatorEnabled ? '' : 'row-disabled'}>\n <td class=\"key\">indicator</td>\n <td class=\"val\">\n <label class=\"toggle\">\n <input\n type=\"checkbox\"\n .checked=${indicatorVisible}\n ?disabled=${!s.hmr.indicatorEnabled}\n @change=${(e: Event) =>\n this._set(\n 'hmrIndicatorVisible',\n (e.target as HTMLInputElement).checked\n )}\n />\n ${\n s.hmr.indicatorEnabled\n ? indicatorVisible\n ? 'shown'\n : 'hidden'\n : 'off (config)'\n }\n </label>\n ${this._ovrSource(\n 'hmrIndicatorVisible',\n s.hmr.indicatorEnabled ? 'shown' : 'off (config)',\n (v) => (v ? 'shown' : 'off (config)')\n )}\n </td>\n </tr>\n <tr class=${s.hmr.indicatorEnabled ? '' : 'row-disabled'}>\n <td class=\"key\">indicator count</td>\n <td class=\"val\">\n <label class=\"toggle\">\n <input\n type=\"checkbox\"\n .checked=${indicatorCount}\n ?disabled=${!s.hmr.indicatorEnabled}\n @change=${(e: Event) =>\n this._set(\n 'hmrIndicatorCount',\n (e.target as HTMLInputElement).checked\n )}\n />\n ${indicatorCount ? 'shown' : 'hidden'}\n </label>\n ${this._ovrSource(\n 'hmrIndicatorCount',\n s.hmr.indicatorCount ? 'shown' : 'hidden',\n (v) => (v ? 'shown' : 'hidden')\n )}\n </td>\n </tr>\n </table>\n `;\n }\n\n /**\n * The editor select. A custom `EditorConfig` object (reported as\n * `'custom'`) isn't one of the built-in choices, so the select is disabled\n * and just shows \"Custom\".\n */\n private _renderEditorRow(s: FeatureSettings) {\n const baseline = s.sourceOverlay.editor;\n const custom = baseline === 'custom';\n const current = this._override.sourceOverlayEditor ?? baseline;\n const editorLabel = (value: string) =>\n SOURCE_OVERLAY_EDITORS.find((ed) => ed.value === value)?.label ??\n (value === 'custom' ? 'Custom' : value);\n const label = editorLabel(baseline);\n return html`\n <tr>\n <td class=\"key\">editor</td>\n <td class=\"val\">\n <select\n ?disabled=${custom}\n @change=${(e: Event) =>\n this._set(\n 'sourceOverlayEditor',\n (e.target as HTMLSelectElement).value\n )}\n >\n ${\n custom\n ? html`<option value=\"custom\" selected>Custom</option>`\n : SOURCE_OVERLAY_EDITORS.map(\n (ed) =>\n html`<option\n value=${ed.value}\n ?selected=${ed.value === current}\n >\n ${ed.label}\n </option>`\n )\n }\n </select>\n ${this._ovrSource('sourceOverlayEditor', label, (v) =>\n editorLabel(String(v))\n )}\n </td>\n </tr>\n `;\n }\n\n /**\n * Page-overlay preferences for the Components tab. Pure preferences, no\n * config-time baseline, so an unset value simply means off and the\n * \"overridden\" marker never applies.\n */\n private _renderComponents() {\n const o = this._override;\n const flash = o.flashUpdates ?? false;\n const ramp = o.flashUpdatesRamp ?? false;\n return html`\n <table>\n <tr>\n <td class=\"key\">flash updates</td>\n <td class=\"val\">\n <label class=\"toggle\">\n <input\n type=\"checkbox\"\n .checked=${flash}\n @change=${(e: Event) =>\n this._set(\n 'flashUpdates',\n (e.target as HTMLInputElement).checked\n )}\n />\n ${flash ? 'on' : 'off'}\n </label>\n </td>\n </tr>\n <tr class=${flash ? '' : 'row-disabled'}>\n <td class=\"key\">colour by frequency</td>\n <td class=\"val\">\n <label class=\"toggle\">\n <input\n type=\"checkbox\"\n .checked=${ramp}\n ?disabled=${!flash}\n @change=${(e: Event) =>\n this._set(\n 'flashUpdatesRamp',\n (e.target as HTMLInputElement).checked\n )}\n />\n ${ramp ? 'calm → hot' : 'single colour'}\n </label>\n </td>\n </tr>\n </table>\n `;\n }\n\n /**\n * Timeline preferences. Pure preference, no config-time baseline, so an\n * unset value means off.\n */\n private _renderTimelinePrefs() {\n const chrome = this._override.chromeTracks ?? false;\n return html`\n <table>\n <tr>\n <td class=\"key\">chrome performance tracks</td>\n <td class=\"val\">\n <label class=\"toggle\">\n <input\n type=\"checkbox\"\n .checked=${chrome}\n @change=${(e: Event) =>\n this._set(\n 'chromeTracks',\n (e.target as HTMLInputElement).checked\n )}\n />\n ${chrome ? 'on' : 'off'}\n </label>\n </td>\n </tr>\n </table>\n `;\n }\n\n override render() {\n if (!this._loaded) {\n return html`<p class=\"loading\">Loading settings…</p>`;\n }\n const s = this._settings;\n const appearance = this._renderAppearance();\n if (s === null) {\n return html`${appearance}\n <p class=\"empty\">Settings unavailable.</p>`;\n }\n const hasOverride = Object.keys(this._override).length > 0;\n return html`\n <p class=\"note\">\n Resolved from plugin options and <code>LIT_PLUGIN_*</code> env at\n startup. Controls below override the running app live; the rest are\n config-time (change them in your Vite config / <code>.env</code> and\n restart).\n ${\n hasOverride\n ? html`<button class=\"reset\" @click=${this._reset}>\n Reset to env\n </button>`\n : nothing\n }\n </p>\n\n ${appearance}\n\n <section>\n <h3>HMR ${this._pill(s.hmr.enabled)}</h3>\n ${this._renderHmr(s)}\n </section>\n\n <section>\n <h3>Source Overlay ${this._pill(s.sourceOverlay.enabled)}</h3>\n ${\n s.sourceOverlay.enabled\n ? html`<table>\n ${this._readonlyRow(\n 'hotkey',\n `Ctrl+Shift+${s.sourceOverlay.key.toUpperCase()}`,\n 'LIT_PLUGIN_SOURCE_OVERLAY_KEY',\n 'sourceOverlayKey'\n )}\n ${this._renderEditorRow(s)}\n ${this._readonlyRow(\n 'throttle (ms)',\n s.sourceOverlay.throttleMs,\n 'LIT_PLUGIN_SOURCE_OVERLAY_THROTTLE_MS',\n 'sourceOverlayThrottleMs'\n )}\n </table>`\n : html`<p class=\"empty\">\n Enable with <code>sourceOverlay: true</code> or\n <code>LIT_PLUGIN_SOURCE_OVERLAY=true</code>.\n </p>`\n }\n </section>\n\n <section>\n <h3>Components ${this._pill(s.timeline)}</h3>\n ${\n s.timeline\n ? this._renderComponents()\n : html`<p class=\"empty\">\n Needs the timeline runtime: enable with\n <code>timeline: true</code> or\n <code>LIT_PLUGIN_TIMELINE=true</code>.\n </p>`\n }\n </section>\n\n <section>\n <h3>Timeline ${this._pill(s.timeline)}</h3>\n <p class=\"empty\">\n Layers and recording are controlled in the Timeline tab.\n </p>\n ${s.timeline ? this._renderTimelinePrefs() : nothing}\n </section>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-settings': DevtoolsSettings;\n }\n}\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n// Phosphor Icons (https://phosphoricons.com, MIT) inlined so the devtools\n// modules stay self-contained with no extra icon library dependency.\n// Panel icons are SVG path data used via <svg viewBox=\"0 0 256 256\"\n// fill=\"currentColor\"><path d={...}/></svg>; runtime icons are full markup\n// injected as raw HTML.\n\n/** `cube` — Components tab. */\nexport const CUBE_ICON =\n 'M223.68,66.15,135.68,18h0a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32h0l80.34,44L128,120,47.66,76ZM40,90l80,43.78v85.79L40,175.82Zm96,129.57V133.82L216,90v85.78Z';\n\n/** `clock` — Timeline tab. */\nexport const CLOCK_ICON =\n 'M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z';\n\n/** `notification` — Updates tab. */\nexport const NOTIFICATION_ICON =\n 'M216,128v80a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V56A16,16,0,0,1,48,40h80a8,8,0,0,1,0,16H48V208H200V128a8,8,0,0,1,16,0Zm16-68a36,36,0,1,1-36-36A36,36,0,0,1,232,60Zm-16,0a20,20,0,1,0-20,20A20,20,0,0,0,216,60Z';\n\n/** `gear` — Settings tab. */\nexport const GEAR_ICON =\n 'M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.21,107.21,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.71,107.71,0,0,0-26.25-10.87,8,8,0,0,0-7.06,1.49L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.21,107.21,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8,8,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8,8,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z';\n\n/** `code` — the source overlay's \"open in editor\" affordance. */\nexport const CODE_ICON = `<svg viewBox=\"0 0 256 256\" aria-hidden=\"true\"><path d=\"M69.12,94.15,28.5,128l40.62,33.85a8,8,0,1,1-10.24,12.29l-48-40a8,8,0,0,1,0-12.29l48-40a8,8,0,0,1,10.24,12.3Zm176,27.7-48-40a8,8,0,1,0-10.24,12.3L227.5,128l-40.62,33.85a8,8,0,1,0,10.24,12.29l48-40a8,8,0,0,0,0-12.29ZM162.73,32.48a8,8,0,0,0-10.25,4.79l-64,176a8,8,0,0,0,4.79,10.26A8.14,8.14,0,0,0,96,224a8,8,0,0,0,7.52-5.27l64-176A8,8,0,0,0,162.73,32.48Z\"></path></svg>`;\n\n/** `copy-simple` — the source overlay's \"copy path\" affordance. */\nexport const COPY_ICON = `<svg viewBox=\"0 0 256 256\" aria-hidden=\"true\"><path d=\"M184,64H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H184a8,8,0,0,0,8-8V72A8,8,0,0,0,184,64Zm-8,144H48V80H176ZM224,40V184a8,8,0,0,1-16,0V48H72a8,8,0,0,1,0-16H216A8,8,0,0,1,224,40Z\"></path></svg>`;\n\n/** `flame` — the HMR update indicator's mark. */\nexport const FLAME_ICON = `<svg viewBox=\"0 0 256 256\" aria-hidden=\"true\"><path d=\"M183.89,153.34a57.6,57.6,0,0,1-46.56,46.55A8.75,8.75,0,0,1,136,200a8,8,0,0,1-1.32-15.89c16.57-2.79,30.63-16.85,33.44-33.45a8,8,0,0,1,15.78,2.68ZM216,144a88,88,0,0,1-176,0c0-27.92,11-56.47,32.66-84.85a8,8,0,0,1,11.93-.89l24.12,23.41,22-60.41a8,8,0,0,1,12.63-3.41C165.21,36,216,84.55,216,144Zm-16,0c0-46.09-35.79-85.92-58.21-106.33L119.52,98.74a8,8,0,0,1-13.09,3L80.06,76.16C64.09,99.21,56,122,56,144a72,72,0,0,0,144,0Z\"></path></svg>`;\n","/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {LitElement, html, css, nothing} from 'lit';\nimport {customElement, query, state} from 'lit/decorators.js';\nimport {tokens, injectTokens} from '../lib/tokens.js';\nimport {\n applyColorScheme,\n readColorSchemePreference,\n} from '../lib/color-scheme.js';\nimport './timeline-view.js';\n\n// Install the shared design tokens on the panel iframe's :root before the\n// views render. Panel components inherit the semantic aliases from :root.\n// The panel owns this document, so it also declares `color-scheme` (host-page\n// injections must not — see `injectTokens`).\ninjectTokens({colorScheme: true});\n// Own the color-scheme class once the panel module is live: re-assert the\n// saved preference (the Settings tab mounts lazily, so it can't). `auto` needs\n// no JS — the tokens' `prefers-color-scheme` @media rule resolves it live.\napplyColorScheme(readColorSchemePreference());\nimport './components-view.js';\nimport type {ComponentsView} from './components-view.js';\nimport './updates-view.js';\nimport type {UpdatesView} from './updates-view.js';\nimport type {TimelineView} from './timeline-view.js';\nimport {onDeepLink, writeHashLink} from './deep-link.js';\nimport type {DeepLinkTab} from './deep-link.js';\nimport './devtools-settings.js';\nimport '../lib/segmented-tabs.js';\nimport type {TabItem} from '../lib/segmented-tabs.js';\nimport {\n CUBE_ICON,\n CLOCK_ICON,\n GEAR_ICON,\n NOTIFICATION_ICON,\n} from '../lib/icons.js';\n\n/**\n * Tabs hosted by the panel. The Timeline is the first; this list is the\n * extension point for future Lit DevTools views.\n */\nconst TABS: readonly TabItem[] = [\n {id: 'components', label: 'Components', icon: CUBE_ICON},\n {id: 'updates', label: 'Updates', icon: NOTIFICATION_ICON},\n {id: 'timeline', label: 'Timeline', icon: CLOCK_ICON},\n {id: 'settings', label: 'Settings', icon: GEAR_ICON},\n];\n\n/** Inline Lit logo mark. */\nconst LIT_LOGO_SVG = html`<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"-32 0 320 320\"\n width=\"20\"\n height=\"20\"\n aria-hidden=\"true\"\n>\n <path\n fill=\"#00e8ff\"\n d=\"m64 192l25.926-44.727l38.233-19.114l63.974 63.974l10.833 61.754L192 320l-64-64l-38.074-25.615z\"\n />\n <path\n fill=\"#283198\"\n d=\"M128 256V128l64-64v128zM0 256l64 64l9.202-60.602L64 192l-37.542 23.71z\"\n />\n <path\n fill=\"#324fff\"\n d=\"M64 192V64l64-64v128zm128 128V192l64-64v128zM0 256V128l64 64z\"\n />\n <path fill=\"#0ff\" d=\"M64 320V192l64 64z\" />\n</svg>`;\n\n/**\n * Root of the Lit DevTools panel — a tabbed shell. Each tab's view is kept\n * mounted and merely hidden when inactive, so the Timeline keeps recording\n * (and holds its events) while another tab is in front.\n */\n@customElement('lit-devtools-panel')\nexport class LitDevtoolsPanel extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: flex;\n flex-direction: column;\n height: 100vh;\n font-family: var(--lit-devtools-font-sans);\n font-size: var(--lit-devtools-text-sm);\n background: var(--lit-devtools-bg);\n color: var(--lit-devtools-text);\n overflow: hidden;\n }\n header {\n display: flex;\n align-items: center;\n gap: var(--lit-devtools-space-6);\n padding: 0 var(--lit-devtools-space-5);\n border-bottom: 1px solid var(--lit-devtools-border);\n background: var(--lit-devtools-surface-low);\n flex-shrink: 0;\n }\n .brand {\n display: flex;\n align-items: center;\n gap: var(--lit-devtools-space-4);\n color: var(--lit-devtools-text-strong);\n font-weight: var(--lit-devtools-weight-bold);\n font-size: var(--lit-devtools-text-xs);\n letter-spacing: var(--lit-devtools-tracking-caps);\n text-transform: uppercase;\n padding: var(--lit-devtools-space-5) 0;\n }\n .brand svg {\n display: block;\n }\n .view {\n display: flex;\n flex-direction: column;\n flex: 1;\n overflow: hidden;\n }\n `,\n ];\n\n @state() private _tab = 'components';\n\n /** Mirrors `ComponentsView.hmrIncompatibilityCount`; see `_onHmrCountChange`. */\n @state() private _hmrCount = 0;\n\n @query('components-view') private _componentsView?: ComponentsView;\n @query('updates-view') private _updatesView?: UpdatesView;\n @query('timeline-view') private _timelineView?: TimelineView;\n\n /**\n * Tab items for the strip, badging \"Components\" with the current\n * HMR-incompatibility count when there is one.\n */\n private get _tabs(): readonly TabItem[] {\n if (this._hmrCount === 0) return TABS;\n return TABS.map((t) =>\n t.id === 'components' ? {...t, badge: this._hmrCount} : t\n );\n }\n\n private _onTabChange(e: CustomEvent<{value: string}>) {\n this._tab = e.detail.value;\n this._syncHash();\n }\n\n /**\n * Deep links are wired after the first render, not in `connectedCallback`:\n * the `@query` for the Components view resolves against rendered DOM, and a\n * link naming a component would silently drop its selection if applied\n * before there is a view to hand it to.\n */\n override firstUpdated() {\n // Two sources, one shape: the URL hash the panel opened with (standalone,\n // or a snapshot someone was sent) and the hub activating our dock with\n // params (another devframe, a command, or this plugin's own overlay pick).\n onDeepLink((link) => {\n if (link.tab !== undefined) this._tab = link.tab;\n if (link.componentId === undefined && link.eventId !== undefined) {\n // The timeline is always mounted, but its store fills asynchronously;\n // `selectEvent` holds the id until the events are there.\n this._tab = 'timeline';\n const eventId = link.eventId;\n void this.updateComplete.then(() => {\n this._timelineView?.selectEvent(eventId);\n this._syncHash();\n });\n return;\n }\n if (link.componentId === undefined) {\n this._syncHash();\n return;\n }\n // An element id means the same thing in both views, so honour the tab\n // the link asked for and only default to Components when it named none\n // — otherwise `#tab=updates&component=3` would land on the wrong tab and\n // look like the parameter was ignored.\n if (link.tab !== 'updates') this._tab = 'components';\n const componentId = link.componentId;\n // The Updates view is mounted lazily, so a link naming it has no view to\n // hand the id to until the tab switch has actually rendered.\n void this.updateComplete.then(() => {\n if (this._tab === 'updates') {\n this._updatesView?.selectById(componentId);\n } else {\n this._componentsView?.selectById(componentId);\n }\n this._syncHash();\n });\n });\n }\n\n /**\n * Keep the address bar pointing at what is on screen, so copying it is a\n * link. Only meaningful when the panel owns its URL — docked in the hub it\n * is an iframe nobody reads the address of, and writing there would be\n * noise.\n */\n private _syncHash(): void {\n if (window.top !== window.self) return;\n // Whichever view owns a selection on the tab in front; both express it as\n // a stable element id, so one parameter round-trips for either.\n const selectedId =\n this._tab === 'updates'\n ? this._updatesView?.selectedId\n : this._componentsView?.selectedId;\n const eventId =\n this._tab === 'timeline' ? this._timelineView?.selectedEventId : null;\n writeHashLink({\n tab: this._tab as DeepLinkTab,\n ...(selectedId === null || selectedId === undefined\n ? {}\n : {componentId: selectedId}),\n ...(eventId === null || eventId === undefined ? {} : {eventId}),\n });\n }\n\n /**\n * A component couldn't be hot-patched in place. Passive badge only — unlike\n * `_onInspectorActivate`, this must not switch tabs: an incompatibility is\n * not something the developer asked to look at.\n */\n private _onHmrCountChange(e: CustomEvent<{count: number}>) {\n this._hmrCount = e.detail.count;\n }\n\n /** A timeline event's \"inspect\" link — open the Components tab on it. */\n private _onInspectElement(e: CustomEvent<{id: number}>) {\n this._tab = 'components';\n // The view is always mounted, so it can select without waiting for render.\n this._componentsView?.selectById(e.detail.id);\n this._syncHash();\n }\n\n /**\n * A component was picked via the overlay inspector — switch to the\n * Components tab so the picked element is what the panel shows.\n *\n * Bringing the dock itself to the front is the host's job, not ours: the\n * node side calls `docks.activate()` when it forwards the pick (see\n * lib/devframe/vite.ts). That replaced reaching into the parent frame's\n * `__VITE_DEVTOOLS_CLIENT_CONTEXT__`, which only worked inside Vite\n * DevTools and only while the panel was same-origin with the shell.\n */\n private _onInspectorActivate() {\n this._tab = 'components';\n this._syncHash();\n }\n\n override render() {\n return html`\n <header>\n <span class=\"brand\">${LIT_LOGO_SVG} Lit DevTools</span>\n <segmented-tabs\n .items=${this._tabs}\n .value=${this._tab}\n @change=${this._onTabChange}\n ></segmented-tabs>\n </header>\n <div class=\"view\" @inspect-element=${this._onInspectElement}>\n <timeline-view\n ?hidden=${this._tab !== 'timeline'}\n @selection-change=${this._syncHash}\n ></timeline-view>\n <!-- Kept mounted (like the timeline) so an overlay inspect-pick can\n arrive and switch us here even while another tab is in front. -->\n <components-view\n ?hidden=${this._tab !== 'components'}\n @inspector-activate=${this._onInspectorActivate}\n @selection-change=${this._syncHash}\n @hmr-count-change=${this._onHmrCountChange}\n ></components-view>\n <!-- Mounted lazily: the recording it derives from lives in the\n timeline store and keeps filling whether or not this view exists,\n so there is nothing here to keep alive in the background. -->\n ${\n this._tab === 'updates'\n ? html`<updates-view\n @selection-change=${this._syncHash}\n ></updates-view>`\n : nothing\n }\n ${\n this._tab === 'settings'\n ? html`<devtools-settings></devtools-settings>`\n : nothing\n }\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'lit-devtools-panel': LitDevtoolsPanel;\n }\n}\n"],"file":"index-B2HYO7lk.js"}