@adia-ai/web-modules 0.6.40 → 0.6.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog — @adia-ai/web-modules
2
2
 
3
+ ## [0.6.42] — 2026-05-26
4
+
5
+ ### Changed — `<admin-page-header>` yaml absorbing header-anatomy corpus fixes
6
+
7
+ - **`shell/admin-page-header/admin-page-header.yaml`** + sidecar updated to reflect the header-anatomy patterns absorbed during gen-review cycle 14-17 (proper `<header><div>+<div data-actions></div></div><p>` shape; section bleed conventions for full-width content).
8
+
9
+ ## [0.6.41] — 2026-05-26
10
+
11
+ ### Maintenance
12
+
13
+ - **Lockstep version bump only — pure ride-along.** No source changes in any of the 9 packages this cycle. Substantive v0.6.41 work is REPO-LEVEL: adia-ui-release skill v1.8.0 → v1.9.0 (catalog-drift recurring graduation — §Step 5.5 pre-commit trip-wire + supersedes-WT contract + §Step 5 allowlist convention; closes FEEDBACK-75). Version bump preserves 9-package lockstep coherence; published tarballs identical to v0.6.40 modulo version metadata.
14
+
3
15
  ## [0.6.40] — 2026-05-26
4
16
 
5
17
  ### Fixed — `<admin-entity-item>` wraps `<icon-ui>` in `<span slot="icon">` (mirrors `<nav-item-ui>`)
@@ -49,7 +49,7 @@ var vE=Object.defineProperty;var W=(s,t)=>()=>(s&&(t=s(s=0)),t);var te=(s,t)=>{f
49
49
  `+c+" Compute the full attr value as a single expression and interpolate the whole.")}continue}let a=+o[1],l=r.name;l[0]==="@"?(n.removeAttribute(l),e[a]={t:"e",n,name:l.slice(1),c:void 0,_fx:null}):l[0]==="."?(n.removeAttribute(l),e[a]={t:"p",n,name:QO(n,l.slice(1)),c:void 0,_fx:null,_resolved:!1}):l[0]==="?"?(n.removeAttribute(l),console.warn(`[template] Lit-style boolean attribute "${l}=" is not supported.
50
50
  Element: <${n.tagName.toLowerCase()}>
51
51
  Use .${l.slice(1)}=\${value} (property binding) instead \u2014 the primitive reflects the property to the DOM attribute for you.
52
- See USAGE.md \xA7 Template parser \u2014 invariants + unsupported syntaxes.`),e[a]={t:"n",n:document.createTextNode(""),c:void 0,_fx:null}):e[a]={t:"a",n,name:l,c:void 0,_fx:null}}return e}function ph(s){for(let t of s)t&&t._fx&&(t._fx(),t._fx=null)}function Ed(s){if(s.n.nodeType===1&&s.n[Ad])return s.n;let t=document.createElement("span");return t.style.display="contents",t[Ad]=!0,s.n.replaceWith(t),s.n=t,t}var MO=s=>s!=null&&typeof s=="object"&&s.strings,RO=s=>typeof s=="function"||s!=null&&typeof s.handleEvent=="function";function Cd(s,t){if(t!==s.c){if(s.t==="n")if(t!=null&&t._directive)t._commit(Ed(s));else if(MO(t))Js(t,Ed(s));else if(Array.isArray(t)){let e=Ed(s);e.replaceChildren();for(let i of t)if(MO(i)){let n=document.createElement("span");n.style.display="contents",e.appendChild(n),Js(i,n)}else e.appendChild(document.createTextNode(i??""))}else if(t instanceof Node)s.n.replaceWith(t),s.n=t;else if(s.n[Ad]){let e=document.createTextNode(t??"");s.n.replaceWith(e),s.n=e}else s.n.textContent=t??"";else if(s.t==="a")t==null||t===!1?s.n.removeAttribute(s.name):s.n.setAttribute(s.name,t===!0?"":t);else if(s.t==="p"){if(!s._resolved){let e=QO(s.n,s.name);e!==s.name&&(s.name=e),s._resolved=!0}s.n[s.name]=t}else s.t==="e"&&(RO(s.c)&&s.n.removeEventListener(s.name,s.c),RO(t)&&s.n.addEventListener(s.name,t));s.c=t}}function ME(s,t){for(let e=0;e<s.length;e++){let i=s[e];if(!i)continue;let n=t[e],r=i.t!=="e"&&typeof n=="function",o=!r&&i.t!=="e"&&kd(n);if(i._fx&&!r&&!o&&(i._fx(),i._fx=null),r){i._fx||(i._fx=rs(()=>Cd(i,n())));continue}if(o){i._fx||(i._fx=rs(()=>Cd(i,n.value)));continue}Cd(i,n)}}function RE(s,t,e){return{_directive:!0,_commit(i){let n=i[tn]||new Map,r=new Map,o=[];for(let l=0;l<s.length;l++){let h=t(s[l],l);if(r.has(h))continue;o.push(h);let c=e(s[l],l);if(n.has(h)){let u=n.get(h);Js(c,u),r.set(h,u)}else{let u=document.createElement("span");u.style.display="contents",Js(c,u),r.set(h,u)}}for(let[l,h]of n)r.has(l)||(h._i&&ph(h._i.p),h.remove());let a=null;for(let l=o.length-1;l>=0;l--){let h=r.get(o[l]);(h.nextSibling!==a||h.parentNode!==i)&&i.insertBefore(h,a),a=h}i[tn]=r}}}var mh=new Map,IO=new Set(["input-interaction","keyboard-navigation","forms-data","layout-measurement","motion-positioning","animation-feedback","visual-dynamics","interaction-delight","audio-haptics-sensory"]);function DO(s){if(!s.name)throw new Error("Trait requires a name");if(!s.setup)throw new Error(`Trait "${s.name}" requires a setup function`);if(!s.category)throw new Error(`Trait "${s.name}" requires a category`);if(!IO.has(s.category))throw new Error(`Trait "${s.name}" has unknown category "${s.category}". Known: ${[...IO].join(", ")}`);if(!s.description)throw new Error(`Trait "${s.name}" requires a description`);let t=Object.freeze({name:s.name,category:s.category,description:s.description,attributes:Object.freeze(s.attributes||[]),events:Object.freeze(s.events||[]),config:Object.freeze(s.config||[])});function e(){let i=null;return{schema:t,connect(n,r){i=s.setup({host:n,...r||{}})},disconnect(n){i&&(i(),i=null);for(let r of t.attributes)n.hasAttribute(r)&&(console.warn(`Trait "${t.name}": attribute "${r}" still present after disconnect`),n.removeAttribute(r))}}}return e.schema=t,mh.set(s.name,e),e}function XO(s){return mh.get(s)||null}function AX(s){return mh.get(s)?.schema||null}function EX(){return[...mh.keys()]}var $d=Symbol(),va=Symbol();function IE(s,t){s[va]=new Map,s[$d]=new Map;for(let[e,i]of Object.entries(t)){let n=i.attribute??e.toLowerCase(),r=i.type??String,o=Ii(i.default??void 0);s[$d].set(e,o),Object.defineProperty(s,e,{get(){return o.value},set(a){let l=o.peek();Object.is(l,a)||(s[va].set(e,l),o.value=a,i.reflect&&DE(s,n,a,r))},configurable:!0})}}function DE(s,t,e,i){i===Boolean?e?s.setAttribute(t,""):s.removeAttribute(t):e==null?s.removeAttribute(t):s.setAttribute(t,String(e))}var XE=(s,t)=>t===Boolean?s!==null:t===Number?s===null?null:+s:s;function qE(s){if(Object.hasOwn(s,"_sa"))return;s._sa=!0;let t=s.styles;if(!t)return;let e=Array.isArray(t)?t:[t];document.adoptedStyleSheets=[...document.adoptedStyleSheets,...e.filter(i=>!document.adoptedStyleSheets.includes(i))]}function qO(s){if(Object.hasOwn(s,"_pp"))return;s._pp={};let t=s.parts;if(t)for(let[e,i]of Object.entries(t)){let n=document.createElement("template");n.innerHTML=i,s._pp[e]=n.content.firstElementChild}}var x=class extends HTMLElement{static get properties(){return{}}static get traits(){return[]}static get observedAttributes(){let t=Object.entries(this.properties).map(([e,i])=>i.attribute??e.toLowerCase());return t.includes("traits")?t:[...t,"traits"]}#t=[];#e=[];#i=[];#s=null;#n=null;#r=null;#a=Ii(0);constructor(){super(),this.internals=this.attachInternals(),IE(this,this.constructor.properties)}connectedCallback(){let t=this.constructor;t._tag||(t._tag=this.localName),qE(t),qO(t),U(()=>this.connected()),this.#t.push(rs(()=>{for(let i of this[$d].values())i.value;this.#a.value;let e=t.template(this);if(e&&Js(e,this),this.render(),this[va].size){let i=new Map(this[va]);this[va].clear(),this.updated(i)}},{host:this.localName,onError:this.onError?e=>this.onError(e):null})),this.#r||(this.#r=new Set);for(let e of t.traits)this.#l(e);this.#c(),this.#s&&this.#o()}disconnectedCallback(){this._i&&ph(this._i.p);for(let t of this.#t)t();this.#t.length=0;for(let t of this.#i)t.value=void 0;this.#i.length=0;for(let t of this.#e)t.disconnect(this);this.#e.length=0,this.#r?.clear(),this.#n?.(),this.#n=null,this.#s?.disconnect?.(this),this.disconnected()}#o(){let t=this.#s;t.connect?.(this),this.#n=t.subscribe?.(()=>{this.#a.value++})}get controller(){return this.#s}set controller(t){this.#n?.(),this.#n=null,this.#s?.disconnect?.(this),this.#s=t,t&&this.isConnected&&this.#o()}#l(t,{declarative:e=!1}={}){this.#r.add(t);let i=t();i.connect(this,{host:this,signal:Ii,computed:wd,effect:rs}),e&&(i._declarative=!0),this.#e.push(i)}addTrait(t){return this.#r||(this.#r=new Set),this.#r.has(t)?this:(this.#l(t),this)}#c(){let t=this.getAttribute("traits");if(t)for(let e of t.split(/\s+/).filter(Boolean)){let i=XO(e);if(!i){console.warn(`<${this.localName}> traits="${e}" \u2014 trait not found. Did you forget to import it?`);continue}this.#r.has(i)||this.#l(i,{declarative:!0})}}#h(){if(!this.#r)return;let t=[];for(let e of this.#e)if(e._declarative){e.disconnect(this);for(let i of this.#r)if(i.schema?.name&&e.schema?.name===i.schema.name){this.#r.delete(i);break}}else t.push(e);this.#e.length=0,this.#e.push(...t),this.#c()}attributeChangedCallback(t,e,i){if(t==="traits"){this.isConnected&&this.#h();return}for(let[n,r]of Object.entries(this.constructor.properties))if((r.attribute??n.toLowerCase())===t){this[n]=XE(i,r.type??String);break}}static template=()=>null;static create(t={}){let e=this._tag??customElements.getName?.(this);if(!e)throw new Error("Component not registered");let i=document.createElement(e);for(let[n,r]of Object.entries(t))i[n]=r;return i}signal(t){let e=Ii(t);return this.#i.push(e),e}ensure(t){for(let r of this.children)if(r.getAttribute("slot")===t)return r;let e=this.#u(t);if(e)return e;qO(this.constructor);let i=this.constructor._pp?.[t];if(!i)return null;let n=i.cloneNode(!0);return n._uiPart=!0,this.appendChild(n),n}drop(t){for(let i of this.children)if(i.getAttribute("slot")===t){i.remove();return}let e=this.#u(t);e&&e.remove()}#u(t){for(let e of this.querySelectorAll(`[slot="${t}"]`)){let i=e.parentElement,n=!0;for(;i&&i!==this;){if(i.localName.includes("-")){n=!1;break}i=i.parentElement}if(n&&i===this)return e}return null}reconcile(t,e,i,n){let r=t[tn]||new Map,o=new Map,a=[];for(let h=0;h<e.length;h++){let c=e[h],u=i(c,h);if(o.has(u))continue;let d=r.get(u);d?n(c,h,d):d=n(c,h,null),o.set(u,d),a.push(u)}for(let[h,c]of r)o.has(h)||c.remove();let l=null;for(let h=a.length-1;h>=0;h--){let c=o.get(a[h]);(c.nextSibling!==l||c.parentNode!==t)&&t.insertBefore(c,l),l=c}t[tn]=o}connected(){}render(){}disconnected(){}updated(t){}};var NO=new WeakSet,xa=class s{#t=null;#e=new Set;get host(){return this.#t}connect(t){let e=this.constructor;!NO.has(e)&&e!==s&&(NO.add(e),e.schema||console.warn(`AdiaUI: ${e.name} extends BaseController without static schema`),this.getState===s.prototype.getState&&console.error(`AdiaUI: ${e.schema?.name??e.name} must implement getState()`)),this.#t&&this.#t!==t&&console.warn(`AdiaUI: ${e.schema?.name??e.name} already connected to a different host`),this.#t=t,this.onConnect(t),this.reflect()}disconnect(t){let e=t??this.#t;e&&(this.onDisconnect(e),this.#t=null)}subscribe(t){return this.#e.add(t),()=>this.#e.delete(t)}notify(){this.reflect();for(let t of this.#e)t()}onConnect(t){}onDisconnect(t){}reflect(){}getState(){throw new Error(`${this.constructor.schema?.name??this.constructor.name}: getState() not implemented`)}},ZO=class extends xa{static schema={name:"route",state:{path:"string",params:"object",route:"object",previous:"string"},commands:["navigate","replace","back","forward","setRoutes"],attributes:["data-route-path"]};#t=[];#e="";#i="";#s={};#n=null;#r=!0;#a=null;constructor({routes:t=[],initial:e,historySync:i=!0}={}){super(),this.#t=t,this.#r=i,this.#e=e??location.pathname,this.#o()}getState(){return{path:this.#e,params:{...this.#s},route:this.#n,previous:this.#i}}reflect(){let t=this.host;t&&t.setAttribute("data-route-path",this.#e)}onConnect(t){this.#r&&(this.#a=()=>{this.#i=this.#e,this.#e=location.pathname,this.#o(),this.notify()},window.addEventListener("popstate",this.#a))}onDisconnect(){this.#a&&(window.removeEventListener("popstate",this.#a),this.#a=null)}#o(){this.#s={},this.#n=null;for(let t of this.#t){let e=this.#l(t.path,this.#e);if(e){this.#s=e.params,this.#n=t;return}}}#l(t,e){let i=t.split("/").filter(Boolean),n=e.split("/").filter(Boolean);if(!t.includes(":"))return t===e?{params:{}}:null;if(i.length!==n.length)return null;let r={};for(let o=0;o<i.length;o++)if(i[o].startsWith(":"))r[i[o].slice(1)]=n[o];else if(i[o]!==n[o])return null;return{params:r}}commands={navigate:t=>{t!==this.#e&&(this.#i=this.#e,this.#e=t,this.#o(),this.#r&&history.pushState(null,"",t),this.notify())},replace:t=>{this.#i=this.#e,this.#e=t,this.#o(),this.#r&&history.replaceState(null,"",t),this.notify()},back:()=>{this.#r&&history.back()},forward:()=>{this.#r&&history.forward()},setRoutes:t=>{this.#t=t,this.#o(),this.notify()}}};var Pd=class extends x{static template=()=>null;#t=null;get abort(){return this.#t||(this.#t=new AbortController),this.#t}get signal(){return this.abort.signal}emit(t,e){this.dispatchEvent(e!==void 0?new CustomEvent(t,{bubbles:!0,detail:e}):new Event(t,{bubbles:!0}))}disconnected(){this.#t?.abort(),this.#t=null}},Qd=class extends xa{static schema={name:"route",state:{path:"string",params:"object",route:"object",previous:"string"},commands:["navigate","replace","back","forward","setRoutes"],attributes:["data-route-path"]};#t=[];#e="";#i="";#s={};#n=null;#r=!0;#a=null;constructor({routes:t=[],initial:e,historySync:i=!0}={}){super(),this.#t=t,this.#r=i,this.#e=e??location.pathname,this.#o()}getState(){return{path:this.#e,params:{...this.#s},route:this.#n,previous:this.#i}}reflect(){let t=this.host;t&&t.setAttribute("data-route-path",this.#e)}onConnect(t){this.#r&&(this.#a=()=>{this.#i=this.#e,this.#e=location.pathname,this.#o(),this.notify()},window.addEventListener("popstate",this.#a))}onDisconnect(){this.#a&&(window.removeEventListener("popstate",this.#a),this.#a=null)}#o(){this.#s={},this.#n=null;for(let t of this.#t){let e=this.#l(t.path,this.#e);if(e){this.#s=e.params,this.#n=t;return}}}#l(t,e){let i=t.split("/").filter(Boolean),n=e.split("/").filter(Boolean);if(!t.includes(":"))return t===e?{params:{}}:null;if(i.length!==n.length)return null;let r={};for(let o=0;o<i.length;o++)if(i[o].startsWith(":"))r[i[o].slice(1)]=n[o];else if(i[o]!==n[o])return null;return{params:r}}commands={navigate:t=>{t!==this.#e&&(this.#i=this.#e,this.#e=t,this.#o(),this.#r&&history.pushState(null,"",t),this.notify())},replace:t=>{this.#i=this.#e,this.#e=t,this.#o(),this.#r&&history.replaceState(null,"",t),this.notify()},back:()=>{this.#r&&history.back()},forward:()=>{this.#r&&history.forward()},setRoutes:t=>{this.#t=t,this.#o(),this.notify()}}},Td=class extends Pd{#t=new Map;#e=null;#i=null;get#s(){return this.#e||this.controller}set routes(t){this.#e?this.#e.commands.setRoutes(t):(this.#e=new Qd({routes:t}),this.controller=this.#e)}navigate(t){this.#s?.commands.navigate(t)}replace(t){this.#s?.commands.replace(t)}connected(){super.connected(),document.addEventListener("click",this.#n)}disconnected(){super.disconnected(),document.removeEventListener("click",this.#n)}#n=t=>{let e=this.#s;if(!e)return;let i=t.target.closest("a[href]");if(!i||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||i.target&&i.target!=="_self")return;let n=i.getAttribute("href");n.startsWith("http")||n.startsWith("//")||n.startsWith("#")||(t.preventDefault(),e.commands.navigate(n))};render(){let t=this.#s;if(!t)return;let{path:e,route:i}=t.getState();e!==this.#i&&(this.#i=e,i?.content&&this.#r(i,t))}async#r(t,e){let i;if(this.#t.has(t.content))i=this.#t.get(t.content);else try{let r=await fetch(t.content,{signal:this.signal});if(!r.ok)return;i=await r.text(),this.#t.set(t.content,i)}catch(r){r.name!=="AbortError"&&console.error("Router fetch error:",r);return}this.templateResolver&&(i=await this.templateResolver(i,t)),this.innerHTML=i;for(let r of this.querySelectorAll("script")){let o=r.getAttribute("type")||"";if(o==="application/json"||o==="application/ld+json")continue;let a=document.createElement("script");o&&(a.type=o),r.src?a.src=r.src:a.textContent=r.textContent,r.replaceWith(a)}if(this.scrollTo(0,0),(this.closest("section")||this.parentElement)?.scrollTo(0,0),t.title&&(document.title=t.title),t.content?.endsWith(".content.html")){let r=t.content.replace(".content.html",".setup.js");try{let o=await import(r);o.default&&o.default(this)}catch{}}let n=e.getState();this.emit("route-loaded",{path:n.path,params:n.params,title:t.title||"",section:t.section||""})}};customElements.define("router-ui",Td);function qX(s,t){customElements.define(s,t)}function S(s,t){return customElements.get(s)?!1:(customElements.define(s,t),!0)}function NX(s){return!!customElements.get(s)}var en=class extends x{static properties={name:{type:String,default:"",reflect:!0},size:{type:String,default:"",reflect:!0},label:{type:String,default:"",reflect:!0},weight:{type:String,default:"regular",reflect:!0}};connected(){this.setAttribute("role",this.label?"img":"presentation"),this.label||this.setAttribute("aria-hidden","true")}render(){this.label&&this.setAttribute("aria-label",this.label);let t=wO(this.name,this.weight||"regular");t&&this.innerHTML!==t&&(this.innerHTML=t),this.size&&this.#t(this.size)?this.style.setProperty("--icon-size",this.#e(this.size)):this.style.getPropertyValue("--icon-size")&&this.style.removeProperty("--icon-size")}#t(t){return/^\d+(\.\d+)?(px|rem|em)?$/.test(t)}#e(t){return/^\d+(\.\d+)?$/.test(t)?`${t}px`:t}};S("icon-ui",en);var NE={plus:["+","\uFF0B"],minus:["-","\u2212","\u2013"],x:["\xD7","x ","X "],check:["\u2713","\u2714"],"arrow-right":["\u2192",">"],"arrow-left":["\u2190","<"]},sn=class s extends x{static properties={text:{type:String,default:"",reflect:!0},variant:{type:String,default:"solid",reflect:!0},color:{type:String,default:"",reflect:!0},size:{type:String,default:"md",reflect:!0},disabled:{type:Boolean,default:!1,reflect:!0},stretch:{type:Boolean,default:!1,reflect:!0},icon:{type:String,default:"",reflect:!0},type:{type:String,default:"button",reflect:!0}};static template=()=>null;connected(){this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.addEventListener("click",this.#i),this.addEventListener("keydown",this.#s)}render(){if(this.text&&this.setAttribute("aria-label",this.text),this.icon){let t=this.querySelector("icon-ui");if(!t||t.name!==this.icon){t&&t.remove();let e=document.createElement("icon-ui");e.setAttribute("name",this.icon),this.prepend(e)}}if(this.icon&&this.text){let t=NE[this.icon];t&&t.some(e=>this.text.startsWith(e))&&(s.#e.has(this)||(s.#e.add(this),console.warn(`[button-ui] text="${this.text}" begins with a symbol that icon="${this.icon}" already renders \u2014 the glyph appears twice. Drop the leading symbol from text= (the icon provides it).`,this)))}if(this.icon&&!this.text){let t=this.getAttribute("aria-label"),e=this.getAttribute("aria-labelledby"),i=this.getAttribute("title");!t&&!e&&i?this.setAttribute("aria-label",i):!t&&!e&&!i&&(s.#t.has(this)||(s.#t.add(this),console.warn(`[button-ui] Icon-only button is missing an accessible name.
52
+ See USAGE.md \xA7 Template parser \u2014 invariants + unsupported syntaxes.`),e[a]={t:"n",n:document.createTextNode(""),c:void 0,_fx:null}):e[a]={t:"a",n,name:l,c:void 0,_fx:null}}return e}function ph(s){for(let t of s)t&&t._fx&&(t._fx(),t._fx=null)}function Ed(s){if(s.n.nodeType===1&&s.n[Ad])return s.n;let t=document.createElement("span");return t.style.display="contents",t[Ad]=!0,s.n.replaceWith(t),s.n=t,t}var MO=s=>s!=null&&typeof s=="object"&&s.strings,RO=s=>typeof s=="function"||s!=null&&typeof s.handleEvent=="function";function Cd(s,t){if(t!==s.c){if(s.t==="n")if(t!=null&&t._directive)t._commit(Ed(s));else if(MO(t))Js(t,Ed(s));else if(Array.isArray(t)){let e=Ed(s);e.replaceChildren();for(let i of t)if(MO(i)){let n=document.createElement("span");n.style.display="contents",e.appendChild(n),Js(i,n)}else e.appendChild(document.createTextNode(i??""))}else if(t instanceof Node)s.n.replaceWith(t),s.n=t;else if(s.n[Ad]){let e=document.createTextNode(t??"");s.n.replaceWith(e),s.n=e}else s.n.textContent=t??"";else if(s.t==="a")t==null||t===!1?s.n.removeAttribute(s.name):s.n.setAttribute(s.name,t===!0?"":t);else if(s.t==="p"){if(!s._resolved){let e=QO(s.n,s.name);e!==s.name&&(s.name=e),s._resolved=!0}s.n[s.name]=t}else s.t==="e"&&(RO(s.c)&&s.n.removeEventListener(s.name,s.c),RO(t)&&s.n.addEventListener(s.name,t));s.c=t}}function ME(s,t){for(let e=0;e<s.length;e++){let i=s[e];if(!i)continue;let n=t[e],r=i.t!=="e"&&typeof n=="function",o=!r&&i.t!=="e"&&kd(n);if(i._fx&&!r&&!o&&(i._fx(),i._fx=null),r){i._fx||(i._fx=rs(()=>Cd(i,n())));continue}if(o){i._fx||(i._fx=rs(()=>Cd(i,n.value)));continue}Cd(i,n)}}function RE(s,t,e){return{_directive:!0,_commit(i){let n=i[tn]||new Map,r=new Map,o=[];for(let l=0;l<s.length;l++){let h=t(s[l],l);if(r.has(h))continue;o.push(h);let c=e(s[l],l);if(n.has(h)){let u=n.get(h);Js(c,u),r.set(h,u)}else{let u=document.createElement("span");u.style.display="contents",Js(c,u),r.set(h,u)}}for(let[l,h]of n)r.has(l)||(h._i&&ph(h._i.p),h.remove());let a=null;for(let l=o.length-1;l>=0;l--){let h=r.get(o[l]);(h.nextSibling!==a||h.parentNode!==i)&&i.insertBefore(h,a),a=h}i[tn]=r}}}var mh=new Map,IO=new Set(["input-interaction","keyboard-navigation","forms-data","layout-measurement","motion-positioning","animation-feedback","visual-dynamics","interaction-delight","audio-haptics-sensory"]);function DO(s){if(!s.name)throw new Error("Trait requires a name");if(!s.setup)throw new Error(`Trait "${s.name}" requires a setup function`);if(!s.category)throw new Error(`Trait "${s.name}" requires a category`);if(!IO.has(s.category))throw new Error(`Trait "${s.name}" has unknown category "${s.category}". Known: ${[...IO].join(", ")}`);if(!s.description)throw new Error(`Trait "${s.name}" requires a description`);let t=Object.freeze({name:s.name,category:s.category,description:s.description,attributes:Object.freeze(s.attributes||[]),events:Object.freeze(s.events||[]),config:Object.freeze(s.config||[])});function e(){let i=null;return{schema:t,connect(n,r){i=s.setup({host:n,...r||{}})},disconnect(n){i&&(i(),i=null);for(let r of t.attributes)n.hasAttribute(r)&&(console.warn(`Trait "${t.name}": attribute "${r}" still present after disconnect`),n.removeAttribute(r))}}}return e.schema=t,mh.set(s.name,e),e}function XO(s){return mh.get(s)||null}function AX(s){return mh.get(s)?.schema||null}function EX(){return[...mh.keys()]}var $d=Symbol(),va=Symbol();function IE(s,t){s[va]=new Map,s[$d]=new Map;for(let[e,i]of Object.entries(t)){let n=i.attribute??e.toLowerCase(),r=i.type??String,o=Ii(i.default??void 0);s[$d].set(e,o),Object.defineProperty(s,e,{get(){return o.value},set(a){let l=o.peek();Object.is(l,a)||(s[va].set(e,l),o.value=a,i.reflect&&DE(s,n,a,r))},configurable:!0})}}function DE(s,t,e,i){i===Boolean?e?s.setAttribute(t,""):s.removeAttribute(t):e==null?s.removeAttribute(t):s.setAttribute(t,String(e))}var XE=(s,t)=>t===Boolean?s!==null:t===Number?s===null?null:+s:s;function qE(s){if(Object.hasOwn(s,"_sa"))return;s._sa=!0;let t=s.styles;if(!t)return;let e=Array.isArray(t)?t:[t];document.adoptedStyleSheets=[...document.adoptedStyleSheets,...e.filter(i=>!document.adoptedStyleSheets.includes(i))]}function qO(s){if(Object.hasOwn(s,"_pp"))return;s._pp={};let t=s.parts;if(t)for(let[e,i]of Object.entries(t)){let n=document.createElement("template");n.innerHTML=i,s._pp[e]=n.content.firstElementChild}}var x=class extends HTMLElement{static get properties(){return{}}static get traits(){return[]}static get observedAttributes(){let t=Object.entries(this.properties).map(([e,i])=>i.attribute??e.toLowerCase());return t.includes("traits")?t:[...t,"traits"]}#t=[];#e=[];#i=[];#s=null;#n=null;#r=null;#a=Ii(0);constructor(){super(),this.internals=this.attachInternals(),IE(this,this.constructor.properties)}connectedCallback(){let t=this.constructor;t._tag||(t._tag=this.localName),qE(t),qO(t),U(()=>this.connected()),this.#t.push(rs(()=>{for(let i of this[$d].values())i.value;this.#a.value;let e=t.template(this);if(e&&Js(e,this),this.render(),this[va].size){let i=new Map(this[va]);this[va].clear(),this.updated(i)}},{host:this.localName,onError:this.onError?e=>this.onError(e):null})),this.#r||(this.#r=new Set);for(let e of t.traits)this.#l(e);this.#c(),this.#s&&this.#o()}disconnectedCallback(){this._i&&ph(this._i.p);for(let t of this.#t)t();this.#t.length=0;for(let t of this.#i)t.value=void 0;this.#i.length=0;for(let t of this.#e)t.disconnect(this);this.#e.length=0,this.#r?.clear(),this.#n?.(),this.#n=null,this.#s?.disconnect?.(this),this.disconnected()}#o(){let t=this.#s;t.connect?.(this),this.#n=t.subscribe?.(()=>{this.#a.value++})}get controller(){return this.#s}set controller(t){this.#n?.(),this.#n=null,this.#s?.disconnect?.(this),this.#s=t,t&&this.isConnected&&this.#o()}#l(t,{declarative:e=!1}={}){this.#r.add(t);let i=t();i.connect(this,{host:this,signal:Ii,computed:wd,effect:rs}),e&&(i._declarative=!0),this.#e.push(i)}addTrait(t){return this.#r||(this.#r=new Set),this.#r.has(t)?this:(this.#l(t),this)}#c(){let t=this.getAttribute("traits");if(t)for(let e of t.split(/\s+/).filter(Boolean)){let i=XO(e);if(!i){console.warn(`<${this.localName}> traits="${e}" \u2014 trait not found. Did you forget to import it?`);continue}this.#r.has(i)||this.#l(i,{declarative:!0})}}#h(){if(!this.#r)return;let t=[];for(let e of this.#e)if(e._declarative){e.disconnect(this);for(let i of this.#r)if(i.schema?.name&&e.schema?.name===i.schema.name){this.#r.delete(i);break}}else t.push(e);this.#e.length=0,this.#e.push(...t),this.#c()}attributeChangedCallback(t,e,i){if(t==="traits"){this.isConnected&&this.#h();return}for(let[n,r]of Object.entries(this.constructor.properties))if((r.attribute??n.toLowerCase())===t){this[n]=XE(i,r.type??String);break}}static template=()=>null;static create(t={}){let e=this._tag??customElements.getName?.(this);if(!e)throw new Error("Component not registered");let i=document.createElement(e);for(let[n,r]of Object.entries(t))i[n]=r;return i}signal(t){let e=Ii(t);return this.#i.push(e),e}ensure(t){for(let r of this.children)if(r.getAttribute("slot")===t)return r;let e=this.#u(t);if(e)return e;qO(this.constructor);let i=this.constructor._pp?.[t];if(!i)return null;let n=i.cloneNode(!0);return n._uiPart=!0,this.appendChild(n),n}drop(t){for(let i of this.children)if(i.getAttribute("slot")===t){i.remove();return}let e=this.#u(t);e&&e.remove()}#u(t){for(let e of this.querySelectorAll(`[slot="${t}"]`)){let i=e.parentElement,n=!0;for(;i&&i!==this;){if(i.localName.includes("-")){n=!1;break}i=i.parentElement}if(n&&i===this)return e}return null}reconcile(t,e,i,n){let r=t[tn]||new Map,o=new Map,a=[];for(let h=0;h<e.length;h++){let c=e[h],u=i(c,h);if(o.has(u))continue;let d=r.get(u);d?n(c,h,d):d=n(c,h,null),o.set(u,d),a.push(u)}for(let[h,c]of r)o.has(h)||c.remove();let l=null;for(let h=a.length-1;h>=0;h--){let c=o.get(a[h]);(c.nextSibling!==l||c.parentNode!==t)&&t.insertBefore(c,l),l=c}t[tn]=o}connected(){}render(){}disconnected(){}updated(t){}};var NO=new WeakSet,xa=class s{#t=null;#e=new Set;get host(){return this.#t}connect(t){let e=this.constructor;!NO.has(e)&&e!==s&&(NO.add(e),e.schema||console.warn(`AdiaUI: ${e.name} extends BaseController without static schema`),this.getState===s.prototype.getState&&console.error(`AdiaUI: ${e.schema?.name??e.name} must implement getState()`)),this.#t&&this.#t!==t&&console.warn(`AdiaUI: ${e.schema?.name??e.name} already connected to a different host`),this.#t=t,this.onConnect(t),this.reflect()}disconnect(t){let e=t??this.#t;e&&(this.onDisconnect(e),this.#t=null)}subscribe(t){return this.#e.add(t),()=>this.#e.delete(t)}notify(){this.reflect();for(let t of this.#e)t()}onConnect(t){}onDisconnect(t){}reflect(){}getState(){throw new Error(`${this.constructor.schema?.name??this.constructor.name}: getState() not implemented`)}},ZO=class extends xa{static schema={name:"route",state:{path:"string",params:"object",route:"object",previous:"string"},commands:["navigate","replace","back","forward","setRoutes"],attributes:["data-route-path"]};#t=[];#e="";#i="";#s={};#n=null;#r=!0;#a=null;constructor({routes:t=[],initial:e,historySync:i=!0}={}){super(),this.#t=t,this.#r=i,this.#e=e??location.pathname,this.#o()}getState(){return{path:this.#e,params:{...this.#s},route:this.#n,previous:this.#i}}reflect(){let t=this.host;t&&t.setAttribute("data-route-path",this.#e)}onConnect(t){this.#r&&(this.#a=()=>{this.#i=this.#e,this.#e=location.pathname,this.#o(),this.notify()},window.addEventListener("popstate",this.#a))}onDisconnect(){this.#a&&(window.removeEventListener("popstate",this.#a),this.#a=null)}#o(){this.#s={},this.#n=null;for(let t of this.#t){let e=this.#l(t.path,this.#e);if(e){this.#s=e.params,this.#n=t;return}}}#l(t,e){let i=t.split("/").filter(Boolean),n=e.split("/").filter(Boolean);if(!t.includes(":"))return t===e?{params:{}}:null;if(i.length!==n.length)return null;let r={};for(let o=0;o<i.length;o++)if(i[o].startsWith(":"))r[i[o].slice(1)]=n[o];else if(i[o]!==n[o])return null;return{params:r}}commands={navigate:t=>{t!==this.#e&&(this.#i=this.#e,this.#e=t,this.#o(),this.#r&&history.pushState(null,"",t),this.notify())},replace:t=>{this.#i=this.#e,this.#e=t,this.#o(),this.#r&&history.replaceState(null,"",t),this.notify()},back:()=>{this.#r&&history.back()},forward:()=>{this.#r&&history.forward()},setRoutes:t=>{this.#t=t,this.#o(),this.notify()}}};var Pd=class extends x{static template=()=>null;#t=null;get abort(){return this.#t||(this.#t=new AbortController),this.#t}get signal(){return this.abort.signal}emit(t,e){this.dispatchEvent(e!==void 0?new CustomEvent(t,{bubbles:!0,detail:e}):new Event(t,{bubbles:!0}))}disconnected(){this.#t?.abort(),this.#t=null}},Qd=class extends xa{static schema={name:"route",state:{path:"string",params:"object",route:"object",previous:"string"},commands:["navigate","replace","back","forward","setRoutes"],attributes:["data-route-path"]};#t=[];#e="";#i="";#s={};#n=null;#r=!0;#a=null;constructor({routes:t=[],initial:e,historySync:i=!0}={}){super(),this.#t=t,this.#r=i,this.#e=e??location.pathname,this.#o()}getState(){return{path:this.#e,params:{...this.#s},route:this.#n,previous:this.#i}}reflect(){let t=this.host;t&&t.setAttribute("data-route-path",this.#e)}onConnect(t){this.#r&&(this.#a=()=>{this.#i=this.#e,this.#e=location.pathname,this.#o(),this.notify()},window.addEventListener("popstate",this.#a))}onDisconnect(){this.#a&&(window.removeEventListener("popstate",this.#a),this.#a=null)}#o(){this.#s={},this.#n=null;for(let t of this.#t){let e=this.#l(t.path,this.#e);if(e){this.#s=e.params,this.#n=t;return}}}#l(t,e){let i=t.split("/").filter(Boolean),n=e.split("/").filter(Boolean);if(!t.includes(":"))return t===e?{params:{}}:null;if(i.length!==n.length)return null;let r={};for(let o=0;o<i.length;o++)if(i[o].startsWith(":"))r[i[o].slice(1)]=n[o];else if(i[o]!==n[o])return null;return{params:r}}commands={navigate:t=>{t!==this.#e&&(this.#i=this.#e,this.#e=t,this.#o(),this.#r&&history.pushState(null,"",t),this.notify())},replace:t=>{this.#i=this.#e,this.#e=t,this.#o(),this.#r&&history.replaceState(null,"",t),this.notify()},back:()=>{this.#r&&history.back()},forward:()=>{this.#r&&history.forward()},setRoutes:t=>{this.#t=t,this.#o(),this.notify()}}},Td=class extends Pd{#t=new Map;#e=null;#i=null;get#s(){return this.#e||this.controller}set routes(t){this.#e?this.#e.commands.setRoutes(t):(this.#e=new Qd({routes:t}),this.controller=this.#e,this.#e.notify())}navigate(t){this.#s?.commands.navigate(t)}replace(t){this.#s?.commands.replace(t)}connected(){super.connected(),document.addEventListener("click",this.#n)}disconnected(){super.disconnected(),document.removeEventListener("click",this.#n)}#n=t=>{let e=this.#s;if(!e)return;let i=t.target.closest("a[href]");if(!i||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||i.target&&i.target!=="_self")return;let n=i.getAttribute("href");n.startsWith("http")||n.startsWith("//")||n.startsWith("#")||(t.preventDefault(),e.commands.navigate(n))};render(){let t=this.#s;if(!t)return;let{path:e,route:i}=t.getState();e!==this.#i&&(this.#i=e,i?.content&&this.#r(i,t))}async#r(t,e){let i;if(this.#t.has(t.content))i=this.#t.get(t.content);else try{let r=await fetch(t.content,{signal:this.signal});if(!r.ok)return;i=await r.text(),this.#t.set(t.content,i)}catch(r){r.name!=="AbortError"&&console.error("Router fetch error:",r);return}this.templateResolver&&(i=await this.templateResolver(i,t)),this.innerHTML=i;for(let r of this.querySelectorAll("script")){let o=r.getAttribute("type")||"";if(o==="application/json"||o==="application/ld+json")continue;let a=document.createElement("script");o&&(a.type=o),r.src?a.src=r.src:a.textContent=r.textContent,r.replaceWith(a)}if(this.scrollTo(0,0),(this.closest("section")||this.parentElement)?.scrollTo(0,0),t.title&&(document.title=t.title),t.content?.endsWith(".content.html")){let r=t.content.replace(".content.html",".setup.js");try{let o=await import(r);o.default&&o.default(this)}catch{}}let n=e.getState();this.emit("route-loaded",{path:n.path,params:n.params,title:t.title||"",section:t.section||""})}};customElements.define("router-ui",Td);function qX(s,t){customElements.define(s,t)}function S(s,t){return customElements.get(s)?!1:(customElements.define(s,t),!0)}function NX(s){return!!customElements.get(s)}var en=class extends x{static properties={name:{type:String,default:"",reflect:!0},size:{type:String,default:"",reflect:!0},label:{type:String,default:"",reflect:!0},weight:{type:String,default:"regular",reflect:!0}};connected(){this.setAttribute("role",this.label?"img":"presentation"),this.label||this.setAttribute("aria-hidden","true")}render(){this.label&&this.setAttribute("aria-label",this.label);let t=wO(this.name,this.weight||"regular");t&&this.innerHTML!==t&&(this.innerHTML=t),this.size&&this.#t(this.size)?this.style.setProperty("--icon-size",this.#e(this.size)):this.style.getPropertyValue("--icon-size")&&this.style.removeProperty("--icon-size")}#t(t){return/^\d+(\.\d+)?(px|rem|em)?$/.test(t)}#e(t){return/^\d+(\.\d+)?$/.test(t)?`${t}px`:t}};S("icon-ui",en);var NE={plus:["+","\uFF0B"],minus:["-","\u2212","\u2013"],x:["\xD7","x ","X "],check:["\u2713","\u2714"],"arrow-right":["\u2192",">"],"arrow-left":["\u2190","<"]},sn=class s extends x{static properties={text:{type:String,default:"",reflect:!0},variant:{type:String,default:"solid",reflect:!0},color:{type:String,default:"",reflect:!0},size:{type:String,default:"md",reflect:!0},disabled:{type:Boolean,default:!1,reflect:!0},stretch:{type:Boolean,default:!1,reflect:!0},icon:{type:String,default:"",reflect:!0},type:{type:String,default:"button",reflect:!0}};static template=()=>null;connected(){this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.addEventListener("click",this.#i),this.addEventListener("keydown",this.#s)}render(){if(this.text&&this.setAttribute("aria-label",this.text),this.icon){let t=this.querySelector("icon-ui");if(!t||t.name!==this.icon){t&&t.remove();let e=document.createElement("icon-ui");e.setAttribute("name",this.icon),this.prepend(e)}}if(this.icon&&this.text){let t=NE[this.icon];t&&t.some(e=>this.text.startsWith(e))&&(s.#e.has(this)||(s.#e.add(this),console.warn(`[button-ui] text="${this.text}" begins with a symbol that icon="${this.icon}" already renders \u2014 the glyph appears twice. Drop the leading symbol from text= (the icon provides it).`,this)))}if(this.icon&&!this.text){let t=this.getAttribute("aria-label"),e=this.getAttribute("aria-labelledby"),i=this.getAttribute("title");!t&&!e&&i?this.setAttribute("aria-label",i):!t&&!e&&!i&&(s.#t.has(this)||(s.#t.add(this),console.warn(`[button-ui] Icon-only button is missing an accessible name.
53
53
  Element: <button-ui icon="${this.icon}">
54
54
  Add one of:
55
55
  aria-label="Undo" \u2190 explicit accessible name
@@ -287,7 +287,7 @@ Correct shape for <chart-ui x="label" y="value">:
287
287
  <text-ui slot="label" data-demo-toggle-label></text-ui>
288
288
  <switch-ui slot="switch" data-demo-toggle-switch></switch-ui>
289
289
  </row-ui>
290
- `};static template=()=>null;#t=null;#e=null;#i=null;#s=!1;connected(){if(this.state)this.state=this.state==="on"?"on":"off";else{let t=this.initial==="on"?"on":"off";this.state=t}this.#t=this.ensure("bar"),this.#e=this.#t.querySelector("[data-demo-toggle-switch]"),this.#i=this.#t.querySelector("[data-demo-toggle-label]"),this.#s||(this.#s=!0,this.#e.addEventListener("change",this.#n))}disconnected(){this.#e&&this.#e.removeEventListener("change",this.#n),this.#t=null,this.#e=null,this.#i=null,this.#s=!1}render(){if(!this.#t)return;let t=this.state==="on";this.#e.checked!==t&&(this.#e.checked=t),this.#i&&(this.#i.textContent=t?this.labelOn:this.labelOff)}toggle(){this.state=this.state==="on"?"off":"on",this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{state:this.state}}))}#n=t=>{t.stopPropagation();let e=this.#e.checked?"on":"off";e!==this.state&&(this.state=e,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{state:this.state}})))}};S("demo-toggle-ui",Uo);var Fo=class extends x{static properties={src:{type:String,default:"",reflect:!0},markdown:{type:String,default:"",reflect:!1}};static template=()=>null;#t=null;#e="";#i="";connected(){this.#t||(this.#t=document.createElement("div"),this.#t.setAttribute("data-richtext-body",""),this.appendChild(this.#t))}render(){if(this.src&&this.src!==this.#e){this.#e=this.src,this.#i="",this.#s();return}this.markdown&&this.markdown!==this.#i&&(this.#i=this.markdown,this.#e="",this.#t.innerHTML=li(this.markdown))}async#s(){try{let t=await fetch(this.src);if(!this.isConnected)return;if(!t.ok){this.#t.innerHTML=`<p>Failed to load: ${this.src}</p>`;return}let e=await t.text();if(!this.isConnected)return;this.#t.innerHTML=li(e)}catch(t){if(!this.isConnected)return;this.#t.innerHTML=`<p>Error: ${t.message}</p>`}}};S("richtext-ui",Fo);var Yo=class extends x{static properties={pace:{type:Number,default:0,reflect:!0},hideCursor:{type:Boolean,default:!1,reflect:!0,attribute:"hide-cursor"},streaming:{type:Boolean,default:!1,reflect:!0}};#t=null;#e=null;#i="";get tokens(){return this.#t}set tokens(t){this.#t=t,t&&this.#s(t)}static template=()=>null;async#s(t){this.#e?.abort(),this.#e=new AbortController;let e=this.#e.signal;this.#i="",this.textContent="",this.streaming=!0,this.dispatchEvent(new Event("stream-start",{bubbles:!0}));try{for await(let i of t){if(e.aborted)break;if(this.#i+=i,this.pace>0)for(let n of i){if(e.aborted)break;this.textContent+=n,await new Promise(r=>setTimeout(r,this.pace))}else this.textContent=this.#i}}catch(i){e.aborted||this.dispatchEvent(new CustomEvent("stream-error",{bubbles:!0,detail:{error:i}}))}e.aborted||(this.streaming=!1,this.dispatchEvent(new Event("stream-end",{bubbles:!0})))}stop(){this.#e?.abort(),this.streaming=!1}clear(){this.stop(),this.#i="",this.textContent=""}disconnected(){this.stop()}};S("stream-ui",Yo);var It=new Map([["Row","row-ui"],["Column","col-ui"],["List","list-ui"],["ListItem","list-item-ui"],["Grid","grid-ui"],["Stack","stack-ui"],["Block","block-ui"],["Text","text-ui"],["Image","image-ui"],["Icon","icon-ui"],["Divider","divider-ui"],["Badge","badge-ui"],["Avatar","avatar-ui"],["AvatarGroup","avatar-group-ui"],["Progress","progress-ui"],["Skeleton","skeleton-ui"],["Code","code-ui"],["Stat","stat-ui"],["EmptyState","empty-state-ui"],["Input","input-ui"],["TextField","input-ui"],["TextArea","textarea-ui"],["Field","field-ui"],["CheckBox","check-ui"],["Toggle","switch-ui"],["Switch","switch-ui"],["Slider","slider-ui"],["Range","range-ui"],["Rating","rating-ui"],["ChoicePicker","select-ui"],["Select","select-ui"],["Radio","radio-ui"],["DateTimeInput","calendar-picker-ui"],["CalendarPicker","calendar-picker-ui"],["ColorPicker","color-picker-ui"],["Upload","upload-ui"],["OtpInput","otp-input-ui"],["Button","button-ui"],["LoadingIndicator","progress-ui"],["ErrorContainer","card-ui"],["Card","card-ui"],["Tabs","tabs-ui"],["Tab","tab-ui"],["Panel","pane-ui"],["Pane","pane-ui"],["Modal","modal-ui"],["Dialog","modal-ui"],["Drawer","drawer-ui"],["Toast","toast-ui"],["Popover","popover-ui"],["Accordion","accordion-ui"],["AccordionItem","accordion-item-ui"],["Alert","alert-ui"],["Tooltip","tooltip-ui"],["Menu","menu-ui"],["Section","section"],["Header","header"],["Footer","footer"],["Stream","stream-ui"],["Table","table-ui"],["Chart","chart-ui"],["Embed","embed-ui"],["Swiper","swiper-ui"],["Slideshow","swiper-ui"],["Carousel","swiper-ui"],["Breadcrumb","breadcrumb-ui"],["Link","link-ui"],["Anchor","link-ui"],["Hyperlink","link-ui"],["NavLink","link-ui"],["Nav","nav-ui"],["NavGroup","nav-group-ui"],["NavItem","nav-item-ui"],["Noodles","noodles-ui"],["Pagination","pagination-ui"],["SegmentedControl","segmented-ui"],["Segment","segment-ui"],["ToggleGroup","toggle-group-ui"],["Command","command-ui"],["Kbd","kbd-ui"],["Toolbar","toolbar-ui"],["Tag","tag-ui"],["Timeline","timeline-ui"],["TimelineItem","timeline-item-ui"],["button-ui","button-ui"],["card-ui","card-ui"],["text-ui","text-ui"],["input-ui","input-ui"],["text-field-ui","input-ui"],["select-ui","select-ui"],["toggle-ui","switch-ui"],["check-ui","check-ui"],["slider-ui","slider-ui"],["badge-ui","badge-ui"],["avatar-ui","avatar-ui"],["icon-ui","icon-ui"],["image-ui","image-ui"],["divider-ui","divider-ui"],["progress-ui","progress-ui"],["skeleton-ui","skeleton-ui"],["tabs-ui","tabs-ui"],["tab-ui","tab-ui"],["modal-ui","modal-ui"],["dialog-ui","modal-ui"],["drawer-ui","drawer-ui"],["toast-ui","toast-ui"],["popover-ui","popover-ui"],["panel-ui","pane-ui"],["accordion-ui","accordion-ui"],["alert-ui","alert-ui"],["tooltip-ui","tooltip-ui"],["menu-ui","menu-ui"],["table-ui","table-ui"],["chart-ui","chart-ui"],["code-ui","code-ui"],["textarea-ui","textarea-ui"],["radio-ui","radio-ui"],["tag-ui","tag-ui"],["search-ui","search-ui"],["upload-ui","upload-ui"],["breadcrumb-ui","breadcrumb-ui"],["link-ui","link-ui"],["nav-ui","nav-ui"],["noodles-ui","noodles-ui"],["pagination-ui","pagination-ui"],["segmented-control-ui","segmented-ui"],["segment-ui","segment-ui"],["command-ui","command-ui"],["calendar-picker-ui","calendar-picker-ui"],["color-picker-ui","color-picker-ui"],["kbd-ui","kbd-ui"],["toolbar-ui","toolbar-ui"],["otp-input-ui","otp-input-ui"],["embed-ui","embed-ui"],["stream-ui","stream-ui"],["row-ui","row-ui"],["col-ui","col-ui"],["grid-ui","grid-ui"],["stack-ui","stack-ui"],["block-ui","block-ui"],["list-ui","list-ui"],["range-ui","range-ui"],["datetime-ui","calendar-picker-ui"],["timeline-ui","timeline-ui"],["timeline-item-ui","timeline-item-ui"],["avatar-group-ui","avatar-group-ui"],["Keyboard","kbd-ui"],["DatePicker","calendar-picker-ui"],["CommandPalette","command-ui"],["FormContainer","form"],["Sidebar","admin-sidebar"],["Segmented","segmented-ui"],["OTP","otp-input-ui"],["Textarea","textarea-ui"],["RichText","richtext-ui"],["Richtext","richtext-ui"],["DescriptionList","description-list-ui"],["ActionItem","action-item-ui"],["ActionList","action-list-ui"],["Inspector","inspector-ui"],["Heatmap","heatmap-ui"],["ChatThread","chat-thread"],["ChatInput","chat-input-ui"],["OptionCard","option-card-ui"],["Option","option-card-ui"],["AdminCommand","admin-command"],["AdminContent","admin-content"],["AdminPage","admin-page"],["AdminPageBody","admin-page-body"],["AdminPageHeader","admin-page-header"],["AdminScroll","admin-scroll"],["AdminShell","admin-shell"],["AdminSidebar","admin-sidebar"],["AdminStatusbar","admin-statusbar"],["AdminTopbar","admin-topbar"],["ChatComposer","chat-composer"],["ChatEmpty","chat-empty"],["ChatHeader","chat-header"],["ChatShell","chat-shell"],["ChatSidebar","chat-sidebar"],["ChatStatus","chat-status"],["EditorCanvas","editor-canvas"],["EditorCanvasEmpty","editor-canvas-empty"],["EditorShell","editor-shell"],["EditorSidebar","editor-sidebar"],["EditorStatusbar","editor-statusbar"],["EditorToolbar","editor-toolbar"],["GenRoot","gen-root"],["SimpleContent","simple-content"],["SimpleHero","simple-hero"],["SimpleShell","simple-shell"],["ThemePanel","theme-panel"]]);function Ku(s){return It.get(s)||null}function d1(s,t){It.set(s,t)}var ts=class s{#t;#e;#i=new Map;#s=new Map;#n=new Map;#r=[];#a=null;#o=!1;constructor(t,e=It,{batch:i=!1}={}){this.#t=t,this.#e=e,this.#o=i}process(t){t&&(this.#o?(this.#r.push(t),this.#a===null&&(this.#a=requestAnimationFrame(()=>this.#l()))):this.#c(t))}#l(){this.#a=null;let t=this.#r.splice(0);for(let e of t)this.#c(e)}#c(t){switch(t.type||t.messageType){case"createSurface":this.#d(t);break;case"updateComponents":this.#p(t);break;case"updateDataModel":this.#P(t);break;case"wireComponents":this.#u(t);break;case"deleteSurface":this.#R(t);break;case"updateStyles":this.#X(t);break;case"removeStyles":this.#Q(t);break;case"meta":break;default:console.warn("A2UI: unknown message type",t.type)}}#h=null;async#u(t){if(!this.#h){let{WiringEngine:e}=await Promise.resolve().then(()=>(eO(),Q1));this.#h=new e({updateDataModel:(i,n,r)=>{this.#P({surfaceId:i,path:n,value:r})},getElement:(i,n)=>this.#i.get(i)?.elements.get(n)||null})}await this.#h.process(t)}async processStream(t){for await(let e of t)this.process(e)}#d({surfaceId:t,catalogId:e,root:i}){if(this.#i.has(t))return;let n=document.createElement("div");n.setAttribute("data-a2ui-surface",t),e&&n.setAttribute("data-catalog",e),this.#t.appendChild(n),this.#i.set(t,{root:n,rootId:typeof i=="string"&&i?i:"root",elements:new Map,dataModel:{},bindings:new Map,adoptedSheets:new Map})}#p({surfaceId:t,components:e}){let i=this.#i.get(t);i||(i={root:this.#t,rootId:"root",elements:new Map,dataModel:{},bindings:new Map,adoptedSheets:new Map},this.#i.set(t,i),this.#t&&typeof this.#t.setAttribute=="function"&&this.#t.setAttribute("data-a2ui-surface",t));for(let l of e)if(!(!l.id&&l.id!==0)){if(l.component==="ContextBindings"){i.contextBindings=l;continue}try{let h=i.elements.get(l.id),c=l.component==="Text"?this.#S(l.variant,l):Ku(l.component,this.#e);if(!c){h||(h=document.createElement("div"),h.setAttribute("data-a2ui-id",l.id),h.setAttribute("data-a2ui-unknown",l.component),h.textContent=`[unknown: ${l.component}]`,i.elements.set(l.id,h),this.#s.set(l.id,h));continue}if(!h)h=document.createElement(c),h.setAttribute("data-a2ui-id",l.id),i.elements.set(l.id,h),this.#s.set(l.id,h);else if(h.localName!==c){let d=document.createElement(c);d.setAttribute("data-a2ui-id",l.id),h.replaceWith(d),h=d,i.elements.set(l.id,h),this.#s.set(l.id,h)}l._surfaceId=t,Object.values(l).some(d=>d&&typeof d=="object"&&d.path)&&i.bindings.set(l.id,l),this.#x(h,l)}catch(h){console.warn(`A2UI: component "${l.id}" (${l.component}) failed:`,h.message)}}this.#b(e);let n=new Map;for(let l of e){for(let h of Array.isArray(l.children)?l.children:[])n.set(h,l.id);l.child&&n.set(l.child,l.id)}let r=(l,h)=>{let c=new Set,u=l;for(;u!=null;){if(u===h||c.has(u))return!0;c.add(u),u=n.get(u)}return!1};for(let l of e){let h=i.elements.get(l.id);if(h)try{let c=Array.isArray(l.children)?l.children:[];for(let u of c){if(u===l.id||r(l.id,u))continue;let d=i.elements.get(u);d&&d.parentElement!==h&&h.appendChild(d)}if(l.child&&l.child!==l.id&&!r(l.id,l.child)){let u=i.elements.get(l.child);u&&u.parentElement!==h&&h.appendChild(u)}}catch(c){console.warn(`A2UI: tree build failed for "${l.id}":`,c.message)}}let o=i.rootId??"root";if(e.find(l=>l.id===o)){let l=i.elements.get(o);l&&l.parentElement!==i.root&&i.root.appendChild(l)}}static#f=new Set(["Header","Section","Footer","Img","Image","Video","Picture","Iframe","Aside","Divider"]);static#m=new Set(["Header","Section","Footer"]);static#O=new Set(["header","body","footer"]);#g=new Set;#b(t){let e=new Map;for(let i of t)i.id!=null&&e.set(i.id,i);for(let i of t){let n=i.component==="Card"||i.component==="ErrorContainer",r=i.component==="Drawer";if(!n&&!r)continue;let o=r?s.#m:s.#f,a=r?"<drawer-ui>":"<card-ui>",l=Array.isArray(i.children)?i.children:[];for(let h of l){let c=e.get(h);if(!c||typeof c.slot=="string"&&s.#O.has(c.slot)||o.has(c.component))continue;let u=`${i.id}::${h}::${c.component}`;this.#g.has(u)||(this.#g.add(u),console.warn(`A2UI: ${a} (id="${i.id}") body must wrap "${c.component}" (id="${h}") in <Section>. Direct flow children bypass the canonical body slot and lose --card-inset margin. Canonical children: ${[...o].join(", ")}`+(r?', or slot="header|body|footer".':".")))}}}static#y=new Set(["data","columns","options","itemRenderer","textContent"]);static#w=new Set(["h1","h2","h3","h4","h5","h6","p","small","span","em","strong","code","text-ui"]);static#v={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body:"p",caption:"small"};static#k=new Set(["autocomplete","autofocus","autocapitalize","autocorrect","inputmode","enterkeyhint","spellcheck","maxlength","minlength","readonly","novalidate","formnovalidate","formaction","formenctype","formmethod","formtarget","multiple","pattern","placeholder","required","tabindex","accesskey","autoplay","autopictureinpicture","controls","crossorigin","disablepictureinpicture","disableremoteplayback","loop","muted","playsinline","preload","srcset","srcdoc","srclang","sizes","loading","decoding","fetchpriority","ismap","usemap","hreflang","referrerpolicy","download","contenteditable","contextmenu","draggable","dirname","colspan","rowspan","headers","allowfullscreen","allowpaymentrequest","itemid","itemprop","itemref","itemscope","itemtype","nomodule","nonce"]);#S(t,e){return!e?.slot&&s.#v[t]?s.#v[t]:"text-ui"}#x(t,e){let i=new Set(["id","component","children","child","_surfaceId"]);e.component==="Text"&&e.variant&&!e.slot&&s.#v[e.variant]&&i.add("variant");let n=this.#n.get(e.id),r={};for(let[o,a]of Object.entries(e)){if(i.has(o))continue;let l=a&&typeof a=="object"&&a.path,h=this.#E(a,e._surfaceId);if(r[o]=h,!(n&&Object.is(n[o],h))){if(o==="style"&&typeof h=="string"){t.style.cssText=h;continue}if(s.#y.has(o)&&h!=null){if(o==="textContent"&&!s.#w.has(t.localName)){t.setAttribute("text",String(h));continue}t[o]=h;continue}typeof h=="boolean"?h?t.setAttribute(o,""):t.removeAttribute(o):h!=null?t.setAttribute(this.#A(o),String(h)):l&&t.removeAttribute(this.#A(o))}}if(n)for(let o of Object.keys(n))!(o in r)&&!i.has(o)&&t.removeAttribute(this.#A(o));this.#n.set(e.id,r)}#A(t){return s.#k.has(t.toLowerCase())?t.toLowerCase():t.replace(/([A-Z])/g,"-$1").toLowerCase()}#E(t,e){if(t==null)return null;if(typeof t!="object")return t;if(t.path){let i=e?this.#i.get(e):null;return i?this.#C(i.dataModel,t.path):t.path}return t}#C(t,e){return!e||e==="/"?t:e.split("/").filter(Boolean).reduce((i,n)=>i?.[n],t)}#P({surfaceId:t,path:e,value:i}){let n=this.#i.get(t);if(n){if(!e||e==="/")n.dataModel=i??{};else{let r=e.split("/").filter(Boolean),o=n.dataModel;for(let a=0;a<r.length-1;a++)o[r[a]]==null&&(o[r[a]]={}),o=o[r[a]];o[r[r.length-1]]=i}for(let[r,o]of n.bindings){let a=n.elements.get(r);a&&this.#x(a,o)}}}#R({surfaceId:t}){let e=this.#i.get(t);if(e){this.#h?.teardown(t);for(let[i]of e.elements)this.#s.delete(i);if(e.adoptedSheets&&e.adoptedSheets.size>0){let i=new Set;for(let n of e.adoptedSheets.values())i.add(n.sheet);document.adoptedStyleSheets=document.adoptedStyleSheets.filter(n=>!i.has(n)),e.adoptedSheets.clear()}e.root.remove(),this.#i.delete(t)}}static#T=new Set(["root","html","body"]);#X({surfaceId:t,styleId:e,css:i}){if(typeof e!="string"||e.length===0){this.#M(null,"styles-rejected",{surfaceId:t,styleId:e,reason:"invalid-payload: styleId must be a non-empty string"});return}if(typeof i!="string"){this.#M(null,"styles-rejected",{surfaceId:t,styleId:e,reason:"invalid-payload: css must be a string"});return}let n=this.#i.get(t);if(!n){this.#M(null,"styles-rejected",{surfaceId:t,styleId:e,reason:"no-such-surface"});return}let r=this.#N(i,t);if(r.rejected){this.#M(n.root,"styles-rejected",{surfaceId:t,styleId:e,reason:r.reason});return}let o=n.adoptedSheets.get(e);o&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(a=>a!==o.sheet)),document.adoptedStyleSheets=[...document.adoptedStyleSheets,r.sheet],n.adoptedSheets.set(e,{sheet:r.sheet,ruleCount:r.sheet.cssRules.length,appliedAt:typeof performance<"u"?performance.now():Date.now()}),this.#M(n.root,"styles-applied",{surfaceId:t,styleId:e,ruleCount:r.sheet.cssRules.length,validationWarnings:r.warnings})}#Q({surfaceId:t,styleId:e}){let i=this.#i.get(t);if(!i)return;let n=i.adoptedSheets.get(e);n&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(r=>r!==n.sheet),i.adoptedSheets.delete(e),this.#M(i.root,"styles-removed",{surfaceId:t,styleId:e}))}#N(t,e){let i=[];if(/^\s*@import\b/im.test(t))return{rejected:!0,reason:"forbidden-import"};if(/^\s*@charset\b/im.test(t))return{rejected:!0,reason:"forbidden-charset"};let n=new CSSStyleSheet;try{n.replaceSync(t)}catch(l){return{rejected:!0,reason:"parse-error: "+(l?.message||String(l))}}for(let l of n.cssRules){let h=this.#L(l);if(h)return{rejected:!0,reason:h}}if(/url\s*\(\s*["']?\s*(?:https?:|\/\/)/i.test(t))return{rejected:!0,reason:"external-url"};for(let l of n.cssRules)if(l.constructor?.name==="CSSPropertyRule"||l.cssText?.startsWith("@property")){let h=l.cssText.match(/@property\s+(--[\w-]+)/);h&&i.push({kind:"property-registered-globally",name:h[1]})}let r=this.#D(n,e),o=this.#I(n,e),a=new CSSStyleSheet;try{a.replaceSync(o)}catch(l){return{rejected:!0,reason:"scope-wrap-failed: "+(l?.message||String(l))}}return r.length>0&&i.push({kind:"animations-namespaced",count:r.length}),{rejected:!1,sheet:a,warnings:i}}#L(t){let e=t.cssText||"";if(/^@import\b/i.test(e))return"forbidden-import";if(/^@charset\b/i.test(e))return"forbidden-charset";if(/^@scope\b/i.test(e))return"forbidden-scope-directive";if(t.selectorText){let i=this.#$(t.selectorText);for(let n of i){let r=n.trim().replace(/^:scope\s*/,"");if(r.startsWith(":root"))return"forbidden-root-selector";let o=r.match(/^([a-zA-Z*][\w-]*)/);if(!o)continue;let a=o[1].toLowerCase();if(s.#T.has(a))return`forbidden-${a}-selector`}}return null}#$(t){let e=[],i=0,n=0;for(let r=0;r<t.length;r++){let o=t[r];o==="("?i++:o===")"?i--:o===","&&i===0&&(e.push(t.slice(n,r)),n=r+1)}return e.push(t.slice(n)),e}#D(t,e){let i=[],n=String(e).replace(/[^a-zA-Z0-9_-]/g,"_");for(let o=0;o<t.cssRules.length;o++){let a=t.cssRules[o];if(a.constructor?.name==="CSSKeyframesRule"||a.cssText?.startsWith("@keyframes")){let l=a.name;if(!l)continue;let h=`${n}_${l}`;try{a.name=h}catch{let c=a.cssText.replace(/@keyframes\s+[\w-]+/,`@keyframes ${h}`);t.deleteRule(o),t.insertRule(c,o)}i.push({from:l,to:h})}}if(i.length===0)return i;let r=new Map(i.map(o=>[o.from,o.to]));for(let o of t.cssRules)if(o.style)for(let a of["animation","animation-name"]){let l=o.style.getPropertyValue(a);if(!l)continue;let h=l.replace(/\b([\w-]+)\b/g,c=>r.has(c)?r.get(c):c);h!==l&&o.style.setProperty(a,h)}return i}#I(t,e){let i=[];for(let r of t.cssRules)i.push(r.cssText);return`@scope ([data-a2ui-surface="${String(e).replace(/"/g,'\\"')}"]) {
290
+ `};static template=()=>null;#t=null;#e=null;#i=null;#s=!1;connected(){if(this.state)this.state=this.state==="on"?"on":"off";else{let t=this.initial==="on"?"on":"off";this.state=t}this.#t=this.ensure("bar"),this.#e=this.#t.querySelector("[data-demo-toggle-switch]"),this.#i=this.#t.querySelector("[data-demo-toggle-label]"),this.#s||(this.#s=!0,this.#e.addEventListener("change",this.#n))}disconnected(){this.#e&&this.#e.removeEventListener("change",this.#n),this.#t=null,this.#e=null,this.#i=null,this.#s=!1}render(){if(!this.#t)return;let t=this.state==="on";this.#e.checked!==t&&(this.#e.checked=t),this.#i&&(this.#i.textContent=t?this.labelOn:this.labelOff)}toggle(){this.state=this.state==="on"?"off":"on",this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{state:this.state}}))}#n=t=>{t.stopPropagation();let e=this.#e.checked?"on":"off";e!==this.state&&(this.state=e,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{state:this.state}})))}};S("demo-toggle-ui",Uo);var Fo=class extends x{static properties={src:{type:String,default:"",reflect:!0},markdown:{type:String,default:"",reflect:!1}};static template=()=>null;#t=null;#e="";#i="";connected(){this.#t||(this.#t=document.createElement("div"),this.#t.setAttribute("data-richtext-body",""),this.appendChild(this.#t))}render(){if(this.src&&this.src!==this.#e){this.#e=this.src,this.#i="",this.#s();return}this.markdown&&this.markdown!==this.#i&&(this.#i=this.markdown,this.#e="",this.#t.innerHTML=li(this.markdown))}async#s(){try{let t=await fetch(this.src);if(!this.isConnected)return;if(!t.ok){this.#t.innerHTML=`<p>Failed to load: ${this.src}</p>`;return}let e=await t.text();if(!this.isConnected)return;this.#t.innerHTML=li(e)}catch(t){if(!this.isConnected)return;this.#t.innerHTML=`<p>Error: ${t.message}</p>`}}};S("richtext-ui",Fo);var Yo=class extends x{static properties={pace:{type:Number,default:0,reflect:!0},hideCursor:{type:Boolean,default:!1,reflect:!0,attribute:"hide-cursor"},streaming:{type:Boolean,default:!1,reflect:!0}};#t=null;#e=null;#i="";get tokens(){return this.#t}set tokens(t){this.#t=t,t&&this.#s(t)}static template=()=>null;async#s(t){this.#e?.abort(),this.#e=new AbortController;let e=this.#e.signal;this.#i="",this.textContent="",this.streaming=!0,this.dispatchEvent(new Event("stream-start",{bubbles:!0}));try{for await(let i of t){if(e.aborted)break;if(this.#i+=i,this.pace>0)for(let n of i){if(e.aborted)break;this.textContent+=n,await new Promise(r=>setTimeout(r,this.pace))}else this.textContent=this.#i}}catch(i){e.aborted||this.dispatchEvent(new CustomEvent("stream-error",{bubbles:!0,detail:{error:i}}))}e.aborted||(this.streaming=!1,this.dispatchEvent(new Event("stream-end",{bubbles:!0})))}stop(){this.#e?.abort(),this.streaming=!1}clear(){this.stop(),this.#i="",this.textContent=""}disconnected(){this.stop()}};S("stream-ui",Yo);var It=new Map([["Row","row-ui"],["Column","col-ui"],["List","list-ui"],["ListItem","list-item-ui"],["Grid","grid-ui"],["Stack","stack-ui"],["Block","block-ui"],["Text","text-ui"],["Image","image-ui"],["Icon","icon-ui"],["Divider","divider-ui"],["Badge","badge-ui"],["Avatar","avatar-ui"],["AvatarGroup","avatar-group-ui"],["Progress","progress-ui"],["ProgressRow","progress-row-ui"],["DateRangePicker","date-range-picker-ui"],["DatetimePicker","datetime-picker-ui"],["CalendarGrid","calendar-grid-ui"],["CalendarPicker","calendar-picker-ui"],["Combobox","combobox-ui"],["Skeleton","skeleton-ui"],["Stepper","stepper-ui"],["StepperItem","stepper-item-ui"],["Tour","tour-ui"],["TourStep","tour-step-ui"],["IntegrationCard","integration-card-ui"],["Code","code-ui"],["Stat","stat-ui"],["EmptyState","empty-state-ui"],["Input","input-ui"],["TextField","input-ui"],["TextArea","textarea-ui"],["Field","field-ui"],["CheckBox","check-ui"],["Toggle","switch-ui"],["Switch","switch-ui"],["Slider","slider-ui"],["Range","range-ui"],["Rating","rating-ui"],["ChoicePicker","select-ui"],["Select","select-ui"],["Radio","radio-ui"],["DateTimeInput","calendar-picker-ui"],["CalendarPicker","calendar-picker-ui"],["ColorPicker","color-picker-ui"],["Upload","upload-ui"],["OtpInput","otp-input-ui"],["Button","button-ui"],["LoadingIndicator","progress-ui"],["ErrorContainer","card-ui"],["Card","card-ui"],["Tabs","tabs-ui"],["Tab","tab-ui"],["Panel","pane-ui"],["Pane","pane-ui"],["Modal","modal-ui"],["Dialog","modal-ui"],["Drawer","drawer-ui"],["Toast","toast-ui"],["Popover","popover-ui"],["Accordion","accordion-ui"],["AccordionItem","accordion-item-ui"],["Alert","alert-ui"],["Tooltip","tooltip-ui"],["Menu","menu-ui"],["Section","section"],["Header","header"],["Footer","footer"],["Stream","stream-ui"],["Table","table-ui"],["ColDef","col-def"],["Chart","chart-ui"],["Embed","embed-ui"],["Swiper","swiper-ui"],["Slideshow","swiper-ui"],["Carousel","swiper-ui"],["Breadcrumb","breadcrumb-ui"],["Link","link-ui"],["Anchor","link-ui"],["Hyperlink","link-ui"],["NavLink","link-ui"],["Nav","nav-ui"],["NavGroup","nav-group-ui"],["NavItem","nav-item-ui"],["Noodles","noodles-ui"],["Pagination","pagination-ui"],["SegmentedControl","segmented-ui"],["Segment","segment-ui"],["ToggleGroup","toggle-group-ui"],["Command","command-ui"],["Kbd","kbd-ui"],["Toolbar","toolbar-ui"],["Tag","tag-ui"],["Timeline","timeline-ui"],["TimelineItem","timeline-item-ui"],["button-ui","button-ui"],["card-ui","card-ui"],["text-ui","text-ui"],["input-ui","input-ui"],["text-field-ui","input-ui"],["select-ui","select-ui"],["toggle-ui","switch-ui"],["check-ui","check-ui"],["slider-ui","slider-ui"],["badge-ui","badge-ui"],["avatar-ui","avatar-ui"],["icon-ui","icon-ui"],["image-ui","image-ui"],["divider-ui","divider-ui"],["progress-ui","progress-ui"],["skeleton-ui","skeleton-ui"],["tabs-ui","tabs-ui"],["tab-ui","tab-ui"],["modal-ui","modal-ui"],["dialog-ui","modal-ui"],["drawer-ui","drawer-ui"],["toast-ui","toast-ui"],["popover-ui","popover-ui"],["panel-ui","pane-ui"],["accordion-ui","accordion-ui"],["alert-ui","alert-ui"],["tooltip-ui","tooltip-ui"],["menu-ui","menu-ui"],["table-ui","table-ui"],["chart-ui","chart-ui"],["code-ui","code-ui"],["textarea-ui","textarea-ui"],["radio-ui","radio-ui"],["tag-ui","tag-ui"],["search-ui","search-ui"],["upload-ui","upload-ui"],["breadcrumb-ui","breadcrumb-ui"],["link-ui","link-ui"],["nav-ui","nav-ui"],["noodles-ui","noodles-ui"],["pagination-ui","pagination-ui"],["segmented-control-ui","segmented-ui"],["segment-ui","segment-ui"],["command-ui","command-ui"],["calendar-picker-ui","calendar-picker-ui"],["color-picker-ui","color-picker-ui"],["kbd-ui","kbd-ui"],["toolbar-ui","toolbar-ui"],["otp-input-ui","otp-input-ui"],["embed-ui","embed-ui"],["stream-ui","stream-ui"],["row-ui","row-ui"],["col-ui","col-ui"],["grid-ui","grid-ui"],["stack-ui","stack-ui"],["block-ui","block-ui"],["list-ui","list-ui"],["range-ui","range-ui"],["datetime-ui","calendar-picker-ui"],["timeline-ui","timeline-ui"],["timeline-item-ui","timeline-item-ui"],["avatar-group-ui","avatar-group-ui"],["Keyboard","kbd-ui"],["DatePicker","calendar-picker-ui"],["CommandPalette","command-ui"],["FormContainer","form"],["Sidebar","admin-sidebar"],["Segmented","segmented-ui"],["OTP","otp-input-ui"],["Textarea","textarea-ui"],["RichText","richtext-ui"],["Richtext","richtext-ui"],["DescriptionList","description-list-ui"],["ActionItem","action-item-ui"],["ActionList","action-list-ui"],["Inspector","inspector-ui"],["Heatmap","heatmap-ui"],["ChatThread","chat-thread"],["ChatInput","chat-input-ui"],["OptionCard","option-card-ui"],["Option","option-card-ui"],["AdminCommand","admin-command"],["AdminContent","admin-content"],["AdminPage","admin-page"],["AdminPageBody","admin-page-body"],["AdminPageHeader","admin-page-header"],["AdminScroll","admin-scroll"],["AdminShell","admin-shell"],["AdminSidebar","admin-sidebar"],["AdminStatusbar","admin-statusbar"],["AdminTopbar","admin-topbar"],["ChatComposer","chat-composer"],["ChatEmpty","chat-empty"],["ChatHeader","chat-header"],["ChatShell","chat-shell"],["ChatSidebar","chat-sidebar"],["ChatStatus","chat-status"],["EditorCanvas","editor-canvas"],["EditorCanvasEmpty","editor-canvas-empty"],["EditorShell","editor-shell"],["EditorSidebar","editor-sidebar"],["EditorStatusbar","editor-statusbar"],["EditorToolbar","editor-toolbar"],["GenRoot","gen-root"],["SimpleContent","simple-content"],["SimpleHero","simple-hero"],["SimpleShell","simple-shell"],["ThemePanel","theme-panel"]]);function Ku(s){return It.get(s)||null}function d1(s,t){It.set(s,t)}var ts=class s{#t;#e;#i=new Map;#s=new Map;#n=new Map;#r=[];#a=null;#o=!1;constructor(t,e=It,{batch:i=!1}={}){this.#t=t,this.#e=e,this.#o=i}process(t){t&&(this.#o?(this.#r.push(t),this.#a===null&&(this.#a=requestAnimationFrame(()=>this.#l()))):this.#c(t))}#l(){this.#a=null;let t=this.#r.splice(0);for(let e of t)this.#c(e)}#c(t){switch(t.type||t.messageType){case"createSurface":this.#d(t);break;case"updateComponents":this.#p(t);break;case"updateDataModel":this.#P(t);break;case"wireComponents":this.#u(t);break;case"deleteSurface":this.#R(t);break;case"updateStyles":this.#X(t);break;case"removeStyles":this.#Q(t);break;case"meta":break;default:console.warn("A2UI: unknown message type",t.type)}}#h=null;async#u(t){if(!this.#h){let{WiringEngine:e}=await Promise.resolve().then(()=>(eO(),Q1));this.#h=new e({updateDataModel:(i,n,r)=>{this.#P({surfaceId:i,path:n,value:r})},getElement:(i,n)=>this.#i.get(i)?.elements.get(n)||null})}await this.#h.process(t)}async processStream(t){for await(let e of t)this.process(e)}#d({surfaceId:t,catalogId:e,root:i}){if(this.#i.has(t))return;let n=document.createElement("div");n.setAttribute("data-a2ui-surface",t),e&&n.setAttribute("data-catalog",e),this.#t.appendChild(n),this.#i.set(t,{root:n,rootId:typeof i=="string"&&i?i:"root",elements:new Map,dataModel:{},bindings:new Map,adoptedSheets:new Map})}#p({surfaceId:t,components:e}){let i=this.#i.get(t);i||(i={root:this.#t,rootId:"root",elements:new Map,dataModel:{},bindings:new Map,adoptedSheets:new Map},this.#i.set(t,i),this.#t&&typeof this.#t.setAttribute=="function"&&this.#t.setAttribute("data-a2ui-surface",t));for(let l of e)if(!(!l.id&&l.id!==0)){if(l.component==="ContextBindings"){i.contextBindings=l;continue}try{let h=i.elements.get(l.id),c=l.component==="Text"?this.#S(l.variant,l):Ku(l.component,this.#e);if(!c){h||(h=document.createElement("div"),h.setAttribute("data-a2ui-id",l.id),h.setAttribute("data-a2ui-unknown",l.component),h.textContent=`[unknown: ${l.component}]`,i.elements.set(l.id,h),this.#s.set(l.id,h));continue}if(!h)h=document.createElement(c),h.setAttribute("data-a2ui-id",l.id),i.elements.set(l.id,h),this.#s.set(l.id,h);else if(h.localName!==c){let d=document.createElement(c);d.setAttribute("data-a2ui-id",l.id),h.replaceWith(d),h=d,i.elements.set(l.id,h),this.#s.set(l.id,h)}l._surfaceId=t,Object.values(l).some(d=>d&&typeof d=="object"&&d.path)&&i.bindings.set(l.id,l),this.#x(h,l)}catch(h){console.warn(`A2UI: component "${l.id}" (${l.component}) failed:`,h.message)}}this.#b(e);let n=new Map;for(let l of e){for(let h of Array.isArray(l.children)?l.children:[])n.set(h,l.id);l.child&&n.set(l.child,l.id)}let r=(l,h)=>{let c=new Set,u=l;for(;u!=null;){if(u===h||c.has(u))return!0;c.add(u),u=n.get(u)}return!1};for(let l of e){let h=i.elements.get(l.id);if(h)try{let c=Array.isArray(l.children)?l.children:[];for(let u of c){if(u===l.id||r(l.id,u))continue;let d=i.elements.get(u);d&&d.parentElement!==h&&h.appendChild(d)}if(l.child&&l.child!==l.id&&!r(l.id,l.child)){let u=i.elements.get(l.child);u&&u.parentElement!==h&&h.appendChild(u)}}catch(c){console.warn(`A2UI: tree build failed for "${l.id}":`,c.message)}}let o=i.rootId??"root";if(e.find(l=>l.id===o)){let l=i.elements.get(o);l&&l.parentElement!==i.root&&i.root.appendChild(l)}}static#f=new Set(["Header","Section","Footer","Img","Image","Video","Picture","Iframe","Aside","Divider"]);static#m=new Set(["Header","Section","Footer"]);static#O=new Set(["header","body","footer"]);#g=new Set;#b(t){let e=new Map;for(let i of t)i.id!=null&&e.set(i.id,i);for(let i of t){let n=i.component==="Card"||i.component==="ErrorContainer",r=i.component==="Drawer";if(!n&&!r)continue;let o=r?s.#m:s.#f,a=r?"<drawer-ui>":"<card-ui>",l=Array.isArray(i.children)?i.children:[];for(let h of l){let c=e.get(h);if(!c||typeof c.slot=="string"&&s.#O.has(c.slot)||o.has(c.component))continue;let u=`${i.id}::${h}::${c.component}`;this.#g.has(u)||(this.#g.add(u),console.warn(`A2UI: ${a} (id="${i.id}") body must wrap "${c.component}" (id="${h}") in <Section>. Direct flow children bypass the canonical body slot and lose --card-inset margin. Canonical children: ${[...o].join(", ")}`+(r?', or slot="header|body|footer".':".")))}}}static#y=new Set(["data","columns","options","itemRenderer","textContent"]);static#w=new Set(["h1","h2","h3","h4","h5","h6","p","small","span","em","strong","code","text-ui"]);static#v={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body:"p",caption:"small"};static#k=new Set(["autocomplete","autofocus","autocapitalize","autocorrect","inputmode","enterkeyhint","spellcheck","maxlength","minlength","readonly","novalidate","formnovalidate","formaction","formenctype","formmethod","formtarget","multiple","pattern","placeholder","required","tabindex","accesskey","autoplay","autopictureinpicture","controls","crossorigin","disablepictureinpicture","disableremoteplayback","loop","muted","playsinline","preload","srcset","srcdoc","srclang","sizes","loading","decoding","fetchpriority","ismap","usemap","hreflang","referrerpolicy","download","contenteditable","contextmenu","draggable","dirname","colspan","rowspan","headers","allowfullscreen","allowpaymentrequest","itemid","itemprop","itemref","itemscope","itemtype","nomodule","nonce"]);#S(t,e){return!e?.slot&&s.#v[t]?s.#v[t]:"text-ui"}#x(t,e){let i=new Set(["id","component","children","child","_surfaceId"]);e.component==="Text"&&e.variant&&!e.slot&&s.#v[e.variant]&&i.add("variant");let n=this.#n.get(e.id),r={};for(let[o,a]of Object.entries(e)){if(i.has(o))continue;let l=a&&typeof a=="object"&&a.path,h=this.#E(a,e._surfaceId);if(r[o]=h,!(n&&Object.is(n[o],h))){if(o==="style"&&typeof h=="string"){t.style.cssText=h;continue}if(s.#y.has(o)&&h!=null){if(o==="textContent"&&!s.#w.has(t.localName)){t.setAttribute("text",String(h));continue}let c=h;if(typeof c=="string"&&(c.startsWith("[")||c.startsWith("{")))try{c=JSON.parse(c)}catch{}t[o]=c;continue}typeof h=="boolean"?h?t.setAttribute(o,""):t.removeAttribute(o):h!=null?t.setAttribute(this.#A(o),String(h)):l&&t.removeAttribute(this.#A(o))}}if(n)for(let o of Object.keys(n))!(o in r)&&!i.has(o)&&t.removeAttribute(this.#A(o));this.#n.set(e.id,r)}#A(t){return s.#k.has(t.toLowerCase())?t.toLowerCase():t.replace(/([A-Z])/g,"-$1").toLowerCase()}#E(t,e){if(t==null)return null;if(typeof t!="object")return t;if(t.path){let i=e?this.#i.get(e):null;return i?this.#C(i.dataModel,t.path):t.path}return t}#C(t,e){return!e||e==="/"?t:e.split("/").filter(Boolean).reduce((i,n)=>i?.[n],t)}#P({surfaceId:t,path:e,value:i}){let n=this.#i.get(t);if(n){if(!e||e==="/")n.dataModel=i??{};else{let r=e.split("/").filter(Boolean),o=n.dataModel;for(let a=0;a<r.length-1;a++)o[r[a]]==null&&(o[r[a]]={}),o=o[r[a]];o[r[r.length-1]]=i}for(let[r,o]of n.bindings){let a=n.elements.get(r);a&&this.#x(a,o)}}}#R({surfaceId:t}){let e=this.#i.get(t);if(e){this.#h?.teardown(t);for(let[i]of e.elements)this.#s.delete(i);if(e.adoptedSheets&&e.adoptedSheets.size>0){let i=new Set;for(let n of e.adoptedSheets.values())i.add(n.sheet);document.adoptedStyleSheets=document.adoptedStyleSheets.filter(n=>!i.has(n)),e.adoptedSheets.clear()}e.root.remove(),this.#i.delete(t)}}static#T=new Set(["root","html","body"]);#X({surfaceId:t,styleId:e,css:i}){if(typeof e!="string"||e.length===0){this.#M(null,"styles-rejected",{surfaceId:t,styleId:e,reason:"invalid-payload: styleId must be a non-empty string"});return}if(typeof i!="string"){this.#M(null,"styles-rejected",{surfaceId:t,styleId:e,reason:"invalid-payload: css must be a string"});return}let n=this.#i.get(t);if(!n){this.#M(null,"styles-rejected",{surfaceId:t,styleId:e,reason:"no-such-surface"});return}let r=this.#N(i,t);if(r.rejected){this.#M(n.root,"styles-rejected",{surfaceId:t,styleId:e,reason:r.reason});return}let o=n.adoptedSheets.get(e);o&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(a=>a!==o.sheet)),document.adoptedStyleSheets=[...document.adoptedStyleSheets,r.sheet],n.adoptedSheets.set(e,{sheet:r.sheet,ruleCount:r.sheet.cssRules.length,appliedAt:typeof performance<"u"?performance.now():Date.now()}),this.#M(n.root,"styles-applied",{surfaceId:t,styleId:e,ruleCount:r.sheet.cssRules.length,validationWarnings:r.warnings})}#Q({surfaceId:t,styleId:e}){let i=this.#i.get(t);if(!i)return;let n=i.adoptedSheets.get(e);n&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(r=>r!==n.sheet),i.adoptedSheets.delete(e),this.#M(i.root,"styles-removed",{surfaceId:t,styleId:e}))}#N(t,e){let i=[];if(/^\s*@import\b/im.test(t))return{rejected:!0,reason:"forbidden-import"};if(/^\s*@charset\b/im.test(t))return{rejected:!0,reason:"forbidden-charset"};let n=new CSSStyleSheet;try{n.replaceSync(t)}catch(l){return{rejected:!0,reason:"parse-error: "+(l?.message||String(l))}}for(let l of n.cssRules){let h=this.#L(l);if(h)return{rejected:!0,reason:h}}if(/url\s*\(\s*["']?\s*(?:https?:|\/\/)/i.test(t))return{rejected:!0,reason:"external-url"};for(let l of n.cssRules)if(l.constructor?.name==="CSSPropertyRule"||l.cssText?.startsWith("@property")){let h=l.cssText.match(/@property\s+(--[\w-]+)/);h&&i.push({kind:"property-registered-globally",name:h[1]})}let r=this.#D(n,e),o=this.#I(n,e),a=new CSSStyleSheet;try{a.replaceSync(o)}catch(l){return{rejected:!0,reason:"scope-wrap-failed: "+(l?.message||String(l))}}return r.length>0&&i.push({kind:"animations-namespaced",count:r.length}),{rejected:!1,sheet:a,warnings:i}}#L(t){let e=t.cssText||"";if(/^@import\b/i.test(e))return"forbidden-import";if(/^@charset\b/i.test(e))return"forbidden-charset";if(/^@scope\b/i.test(e))return"forbidden-scope-directive";if(t.selectorText){let i=this.#$(t.selectorText);for(let n of i){let r=n.trim().replace(/^:scope\s*/,"");if(r.startsWith(":root"))return"forbidden-root-selector";let o=r.match(/^([a-zA-Z*][\w-]*)/);if(!o)continue;let a=o[1].toLowerCase();if(s.#T.has(a))return`forbidden-${a}-selector`}}return null}#$(t){let e=[],i=0,n=0;for(let r=0;r<t.length;r++){let o=t[r];o==="("?i++:o===")"?i--:o===","&&i===0&&(e.push(t.slice(n,r)),n=r+1)}return e.push(t.slice(n)),e}#D(t,e){let i=[],n=String(e).replace(/[^a-zA-Z0-9_-]/g,"_");for(let o=0;o<t.cssRules.length;o++){let a=t.cssRules[o];if(a.constructor?.name==="CSSKeyframesRule"||a.cssText?.startsWith("@keyframes")){let l=a.name;if(!l)continue;let h=`${n}_${l}`;try{a.name=h}catch{let c=a.cssText.replace(/@keyframes\s+[\w-]+/,`@keyframes ${h}`);t.deleteRule(o),t.insertRule(c,o)}i.push({from:l,to:h})}}if(i.length===0)return i;let r=new Map(i.map(o=>[o.from,o.to]));for(let o of t.cssRules)if(o.style)for(let a of["animation","animation-name"]){let l=o.style.getPropertyValue(a);if(!l)continue;let h=l.replace(/\b([\w-]+)\b/g,c=>r.has(c)?r.get(c):c);h!==l&&o.style.setProperty(a,h)}return i}#I(t,e){let i=[];for(let r of t.cssRules)i.push(r.cssText);return`@scope ([data-a2ui-surface="${String(e).replace(/"/g,'\\"')}"]) {
291
291
  ${i.join(`
292
292
  `)}
293
293
  }`}#M(t,e,i){let n=t||this.#t;if(!(!n||typeof CustomEvent>"u"))try{n.dispatchEvent(new CustomEvent(e,{detail:i,bubbles:!0,composed:!1}))}catch{}}getSurface(t){return this.#i.get(t)}getElement(t){return this.#s.get(t)}get surfaces(){return[...this.#i.keys()]}getStylesheets(t){return this.#i.get(t)?.adoptedSheets??new Map}reset(){this.#a!==null&&(cancelAnimationFrame(this.#a),this.#a=null),this.#r.length=0;let t=new Set;for(let[,e]of this.#i)if(e.adoptedSheets)for(let i of e.adoptedSheets.values())t.add(i.sheet);t.size>0&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(e=>!t.has(e)));for(let[,e]of this.#i)e.root===this.#t?e.root.innerHTML="":e.root.remove();this.#i.clear(),this.#s.clear(),this.#n.clear()}set batching(t){this.#o=!!t}get batching(){return this.#o}};function nd(s,t={}){let e=s;if(t.catalog){let i=t.catalog instanceof Map?[...t.catalog.keys()]:Object.keys(t.catalog),n=s.includes("?")?"&":"?";e=`${s}${n}a2ui_catalog=${encodeURIComponent(i.join(","))}`}return{[Symbol.asyncIterator](){let i=new EventSource(e),n=[],r=null,o=!1;return i.onmessage=a=>{try{let l=JSON.parse(a.data);if(r){let h=r;r=null,h({value:l,done:!1})}else n.push(l)}catch{console.warn("A2UI SSE: invalid JSON",a.data)}},i.onerror=()=>{if(o=!0,i.close(),r){let a=r;r=null,a({value:void 0,done:!0})}},t.signal&&t.signal.addEventListener("abort",()=>{if(o=!0,i.close(),r){let a=r;r=null,a({value:void 0,done:!0})}}),{next(){return n.length>0?Promise.resolve({value:n.shift(),done:!1}):o?Promise.resolve({value:void 0,done:!0}):new Promise(a=>{r=a})},return(){return o=!0,i.close(),Promise.resolve({value:void 0,done:!0})}}}}}function rd(s,t={}){return{[Symbol.asyncIterator](){let e=new WebSocket(s),i=[],n=null,r=!1;return e.onopen=()=>{if(t.catalog){let o=t.catalog instanceof Map?[...t.catalog.keys()]:Object.keys(t.catalog);e.send(JSON.stringify({type:"a2ui:catalog",supportedTypes:o}))}},e.onmessage=o=>{try{let a=JSON.parse(o.data);if(n){let l=n;n=null,l({value:a,done:!1})}else i.push(a)}catch{console.warn("A2UI WS: invalid JSON",o.data)}},e.onclose=()=>{if(r=!0,n){let o=n;n=null,o({value:void 0,done:!0})}},e.onerror=()=>{r=!0,e.close()},{next(){return i.length>0?Promise.resolve({value:i.shift(),done:!1}):r?Promise.resolve({value:void 0,done:!0}):new Promise(o=>{n=o})},return(){return r=!0,e.close(),Promise.resolve({value:void 0,done:!0})}}}}}function M1(s,t=0){return{async*[Symbol.asyncIterator](){for(let e of s)t>0&&await new Promise(i=>setTimeout(i,t)),yield e}}}function od(s,t={}){let e=(s.split(":")[0]||"").toLowerCase();return e==="ws"||e==="wss"?wD(s,t):L1(s,t)}function T1(s,t){if(s.result?.content){for(let e of s.result.content)if(e.type==="resource"&&e.resource?.mimeType==="application/json+a2ui")try{let i=JSON.parse(e.resource.text);for(let n of Array.isArray(i)?i:[i])t(n)}catch{}else if(e.type==="text")try{let i=JSON.parse(e.text);i.type&&(i.type.startsWith("create")||i.type.startsWith("update")||i.type.startsWith("delete"))&&t(i)}catch{}}}function wD(s,t){return{async*[Symbol.asyncIterator](){let{signal:e,catalog:i,onAction:n}=t,r=new WebSocket(s);if(await new Promise((c,u)=>{r.onopen=c,r.onerror=u,e&&e.addEventListener("abort",()=>{r.close(),u(new DOMException("Aborted","AbortError"))},{once:!0})}),i){let c=i instanceof Map?[...i.keys()]:Object.keys(i);r.send(JSON.stringify({jsonrpc:"2.0",method:"a2ui/catalog",params:{supportedTypes:c}}))}let o=[],a=null,l=!1,h=c=>{if(a){let u=a;a=null,u({value:c,done:!1})}else o.push(c)};for(r.onmessage=c=>{try{let u=JSON.parse(c.data);T1(u,h),u.method==="a2ui/action"&&n&&n(u.params?.name,u.params?.arguments).then(d=>{r.send(JSON.stringify({jsonrpc:"2.0",id:u.id,result:d}))}).catch(d=>{r.send(JSON.stringify({jsonrpc:"2.0",id:u.id,error:{code:-1,message:d.message}}))})}catch{console.warn("A2UI MCP: invalid message",c.data)}},r.onclose=()=>{if(l=!0,a){let c=a;a=null,c({value:void 0,done:!0})}},r.onerror=()=>{l=!0,r.close()},e&&e.addEventListener("abort",()=>{if(l=!0,r.close(),a){let c=a;a=null,c({value:void 0,done:!0})}});!l||o.length>0;)if(o.length>0)yield o.shift();else{if(l)break;{let c=await new Promise(u=>{a=u});if(c.done)break;yield c.value}}}}}function L1(s,t){return{async*[Symbol.asyncIterator](){let{signal:e,catalog:i,onAction:n}=t,r=[],o=null,a=!1,l=g=>{if(o){let y=o;o=null,y({value:g,done:!1})}else r.push(g)},h=()=>{if(a=!0,o){let g=o;o=null,g({value:void 0,done:!0})}},c={jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-11-25",capabilities:{},clientInfo:{name:"a2ui-runtime",version:"0.0.0"}}},u;try{u=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream"},body:JSON.stringify(c),signal:e})}catch(g){console.warn("A2UI MCP HTTP: initialize failed",g);return}if(!u.ok){console.warn(`A2UI MCP HTTP: initialize returned ${u.status}`);return}let d=u.headers.get("mcp-session-id");if(!d){console.warn("A2UI MCP HTTP: server did not return mcp-session-id header");try{await u.text()}catch{}return}try{if((u.headers.get("content-type")||"").includes("text/event-stream")){let y=u.body.getReader(),v=new TextDecoder,w="";for(;;){let{done:k,value:E}=await y.read();if(k||(w+=v.decode(E,{stream:!0}),w.includes(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adia-ai/web-modules",
3
- "version": "0.6.40",
3
+ "version": "0.6.42",
4
4
  "description": "AdiaUI composite custom elements \u2014 shell, chat, editor, runtime clusters built from @adia-ai/web-components primitives. Subpath exports per cluster.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://adiaui.dev/a2ui/v0_9/components/AdminPageHeader.json",
4
4
  "title": "AdminPageHeader",
5
- "description": "Module-tier page-header band. CSS-only — no behavior, no JS.\nSticky top band inside <admin-page>. Owns full-width concerns\n(sticky position, border-bottom, background); wraps an inner\n<header-ui> or raw <header> for the centered reading column\n(max-width, gutter, rhythm).\n",
5
+ "description": "Module-tier page-header band. CSS-only — no behavior, no JS.\nSticky top band inside <admin-page>. Owns full-width concerns\n(sticky position, border-bottom, background); wraps an inner\n<header-ui> for the centered reading column (max-width, gutter,\nrhythm). Do NOT use a raw <header> element — slot-named regions\n(action, description, icon, heading) are silently ignored without\n<header-ui>'s shadow-DOM slot routing.\n",
6
6
  "type": "object",
7
7
  "allOf": [
8
8
  {
@@ -40,7 +40,7 @@
40
40
  ],
41
41
  "slots": {
42
42
  "default": {
43
- "description": "Default — typically <header-ui> or <header> with title + actions."
43
+ "description": "Default — <header-ui> with title + actions (slot=\"action\"). Raw <header> works for the CSS rhythm but drops named slots."
44
44
  }
45
45
  },
46
46
  "states": [
@@ -10,8 +10,10 @@ description: |
10
10
  Module-tier page-header band. CSS-only — no behavior, no JS.
11
11
  Sticky top band inside <admin-page>. Owns full-width concerns
12
12
  (sticky position, border-bottom, background); wraps an inner
13
- <header-ui> or raw <header> for the centered reading column
14
- (max-width, gutter, rhythm).
13
+ <header-ui> for the centered reading column (max-width, gutter,
14
+ rhythm). Do NOT use a raw <header> element — slot-named regions
15
+ (action, description, icon, heading) are silently ignored without
16
+ <header-ui>'s shadow-DOM slot routing.
15
17
 
16
18
  props: {}
17
19
 
@@ -20,7 +22,8 @@ events: {}
20
22
  slots:
21
23
  default:
22
24
  description: >-
23
- Default — typically <header-ui> or <header> with title + actions.
25
+ Default — <header-ui> with title + actions (slot="action").
26
+ Raw <header> works for the CSS rhythm but drops named slots.
24
27
 
25
28
  states:
26
29
  - name: idle
@@ -37,6 +40,8 @@ a2ui:
37
40
  reason: 'Sticky chrome vs content layout separation.'
38
41
  - rule: 'Always inside <admin-page slot="header">; for shell-tier chrome use <admin-topbar> instead.'
39
42
  reason: 'Page-tier vs shell-tier distinction.'
43
+ - rule: 'Always wrap an inner <header-ui> — not a raw <header>. Raw <header> has no shadow DOM; slot="action" and other named slots on its children are silently dropped.'
44
+ reason: 'header-ui provides the shadow-DOM slot routing that makes slot="action" / slot="heading" / slot="description" work; raw <header> matches the CSS positioning but cannot route named slots.'
40
45
 
41
46
  keywords:
42
47
  - admin-page-header