@zhama/a2ui 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/context/index.cjs +573 -202
- package/dist/context/index.js +573 -202
- package/dist/data/index.cjs +2 -2
- package/dist/data/index.js +2 -2
- package/dist/index-DWKa15py.d.cts +230 -0
- package/dist/index-DkGx4cbd.d.ts +230 -0
- package/dist/index.cjs +512 -138
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +512 -138
- package/dist/styles/index.cjs +590 -216
- package/dist/styles/index.d.cts +1 -1
- package/dist/styles/index.d.ts +1 -1
- package/dist/styles/index.js +590 -216
- package/dist/ui/index.cjs +2 -2
- package/dist/ui/index.js +2 -2
- package/package.json +2 -2
- package/dist/index-CfG_a073.d.cts +0 -143
- package/dist/index-DZnukf8z.d.ts +0 -143
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {isV09Message,STANDARD_CATALOG_ID,A2UI_MIME_TYPE,A2UI_EXTENSION_URI,video,valueToValueMap,valueMapToObject,updatesToValueMap,updateDataModel,updateComponents,textField,textButton,text,tabs,slider,row,resetIdCounter,objectToValueMap,normalizePath,modal,messagesToJsonl,list,jsonlToMessages,image,icon,h5,h4,h3,h2,h1,generateId,flattenObjectToValueMap,divider,deleteSurface,dateTimeInput,createV09Messages,createSurface,createStatusSurface,createRecommendationSurface,createOrchestrationSurface,createInputFormSurface,createChatSurface,column,choicePicker,checkbox,card,caption,button,body,audioPlayer,SURFACE_IDS,DEFAULT_PATH_MAPPINGS}from'@zhama/a2ui-core';export{A2UI_EXTENSION_URI,A2UI_MIME_TYPE,DEFAULT_PATH_MAPPINGS,STANDARD_CATALOG_ID,SURFACE_IDS,audioPlayer,body,button,caption,card,checkbox,choicePicker,column,createChatSurface,createInputFormSurface,createOrchestrationSurface,createRecommendationSurface,createStatusSurface,createSurface,createV09Messages,dateTimeInput,deleteSurface,divider,flattenObjectToValueMap,generateId,h1,h2,h3,h4,h5,icon,image,isV09Message,jsonlToMessages,list,messagesToJsonl,modal,normalizePath,objectToValueMap,resetIdCounter,row,slider,tabs,text,textButton,textField,updateComponents,updateDataModel,updatesToValueMap,valueMapToObject,valueToValueMap,video}from'@zhama/a2ui-core';import kt from'react-markdown';import {createContext,useContext,useState,useCallback,useEffect}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import*as gt from'lucide-react';var Xe=Object.defineProperty;var wo=(e,t,o)=>t in e?Xe(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o;var $=(e,t)=>{for(var o in t)Xe(e,o,{get:t[o],enumerable:true});};var I=(e,t,o)=>wo(e,typeof t!="symbol"?t+"":t,o);var Qe={};$(Qe,{A2uiMessageProcessor:()=>y,createMessageProcessor:()=>Ze,isAnyComponentNode:()=>k,isBooleanValue:()=>Ve,isComponentArrayReference:()=>ae,isNumberValue:()=>$e,isObject:()=>f,isPath:()=>ne,isResolvedAudioPlayer:()=>se,isResolvedButton:()=>ie,isResolvedCard:()=>le,isResolvedCheckbox:()=>ce,isResolvedColumn:()=>pe,isResolvedDateTimeInput:()=>de,isResolvedDivider:()=>ue,isResolvedIcon:()=>fe,isResolvedImage:()=>me,isResolvedList:()=>he,isResolvedModal:()=>ge,isResolvedMultipleChoice:()=>xe,isResolvedRow:()=>be,isResolvedSlider:()=>ye,isResolvedTabItem:()=>Ee,isResolvedTabs:()=>ve,isResolvedText:()=>Ce,isResolvedTextField:()=>Re,isResolvedVideo:()=>we,isStringValue:()=>N,isValueMap:()=>qe});function qe(e){return f(e)}function ne(e,t){return e==="path"&&typeof t=="string"}function f(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ae(e){return f(e)?"explicitList"in e||"template"in e:false}function N(e){return !!(typeof e=="string"||f(e)&&"path"in e&&typeof e.path=="string")}function $e(e){return !!(typeof e=="number"||f(e)&&"path"in e&&typeof e.path=="string")}function Ve(e){return !!(typeof e=="boolean"||f(e)&&"path"in e&&typeof e.path=="string")}function k(e){return f(e)?"id"in e&&"type"in e&&"properties"in e:false}function se(e){return f(e)&&"url"in e&&N(e.url)}function ie(e){return f(e)&&"child"in e&&k(e.child)&&"action"in e}function le(e){return f(e)?"child"in e?k(e.child):"children"in e?Array.isArray(e.children)&&e.children.every(k):false:false}function ce(e){return f(e)&&"label"in e&&N(e.label)&&"value"in e&&Ve(e.value)}function pe(e){return f(e)&&"children"in e&&Array.isArray(e.children)&&e.children.every(k)}function de(e){return f(e)&&"value"in e&&N(e.value)}function ue(e){return f(e)}function me(e){return f(e)&&"url"in e&&N(e.url)}function fe(e){return f(e)&&"name"in e&&N(e.name)}function he(e){return f(e)&&"children"in e&&Array.isArray(e.children)&&e.children.every(k)}function ge(e){return f(e)&&"entryPointChild"in e&&k(e.entryPointChild)&&"contentChild"in e&&k(e.contentChild)}function xe(e){return f(e)&&"selections"in e}function be(e){return f(e)&&"children"in e&&Array.isArray(e.children)&&e.children.every(k)}function ye(e){return f(e)&&"value"in e&&$e(e.value)}function Ee(e){return f(e)&&"title"in e&&N(e.title)&&"child"in e&&k(e.child)}function ve(e){return f(e)&&"tabItems"in e&&Array.isArray(e.tabItems)&&e.tabItems.every(Ee)}function Ce(e){return f(e)&&"text"in e&&N(e.text)}function Re(e){return f(e)&&"label"in e&&N(e.label)}function we(e){return f(e)&&"url"in e&&N(e.url)}var B=class B{constructor(t={}){I(this,"mapCtor",Map);I(this,"arrayCtor",Array);I(this,"setCtor",Set);I(this,"objCtor",Object);I(this,"surfaces");this.arrayCtor=t.arrayCtor??Array,this.mapCtor=t.mapCtor??Map,this.setCtor=t.setCtor??Set,this.objCtor=t.objCtor??Object,this.surfaces=new this.mapCtor;}getSurfaces(){return this.surfaces}clearSurfaces(){this.surfaces.clear();}processMessages(t){console.log("[A2UI] processMessages called with",t.length,"messages");for(let o of t)"createSurface"in o?this.handleCreateSurface(o):"updateComponents"in o?this.handleUpdateComponents(o):"updateDataModel"in o?this.handleUpdateDataModel(o):"deleteSurface"in o?this.handleDeleteSurface(o):console.warn("[A2UI] Unknown message type:",Object.keys(o));}getData(t,o,n=B.DEFAULT_SURFACE_ID){let a=this.getOrCreateSurface(n);if(!a)return console.warn("[A2UI] getData: surface not found:",n),null;let r;return o==="."||o===""?r=t.dataContextPath??"/":r=this.resolvePath(o,t.dataContextPath),this.getDataByPath(a.dataModel,r)}setData(t,o,n,a=B.DEFAULT_SURFACE_ID){if(!t){console.warn("No component node set");return}let r=this.getOrCreateSurface(a);if(!r)return;let s;o==="."||o===""?s=t.dataContextPath??"/":s=this.resolvePath(o,t.dataContextPath),this.setDataByPath(r.dataModel,s,n);}resolvePath(t,o){return t.startsWith("/")?t:o&&o!=="/"?o.endsWith("/")?`${o}${t}`:`${o}/${t}`:`/${t}`}handleCreateSurface(t){let{createSurface:o}=t,n=o.surfaceId,a=this.getOrCreateSurface(n);a.catalogId=o.catalogId;}handleUpdateComponents(t){let{updateComponents:o}=t,n=o.surfaceId,a=this.getOrCreateSurface(n);for(let r of o.components)a.components.set(r.id,r),a.rootComponentId||(a.rootComponentId=r.id);this.rebuildComponentTree(a);}handleUpdateDataModel(t){let{updateDataModel:o}=t,n=o.surfaceId,a=this.getOrCreateSurface(n),r=o.path??"/",s=o.op??"replace",i=o.value;s==="remove"?this.removeDataByPath(a.dataModel,r):i!==void 0&&this.setDataByPath(a.dataModel,r,i),this.rebuildComponentTree(a);}handleDeleteSurface(t){let{deleteSurface:o}=t;this.surfaces.delete(o.surfaceId);}setDataByPath(t,o,n){let a=this.normalizePath(o).split("/").filter(i=>i);if(a.length===0){if(f(n)&&!(n instanceof Map)){t.clear();for(let[i,l]of Object.entries(n))t.set(i,l);}return}let r=t;for(let i=0;i<a.length-1;i++){let l=a[i],c;if(r instanceof Map?c=r.get(l):Array.isArray(r)&&/^\d+$/.test(l)&&(c=r[parseInt(l,10)]),c===void 0||typeof c!="object"||c===null){let u=new this.mapCtor;r instanceof Map?r.set(l,u):Array.isArray(r)&&(r[parseInt(l,10)]=u),c=u;}r=c;}let s=a[a.length-1];r instanceof Map?r.set(s,n):Array.isArray(r)&&/^\d+$/.test(s)&&(r[parseInt(s,10)]=n);}removeDataByPath(t,o){let n=this.normalizePath(o).split("/").filter(s=>s);if(n.length===0){t.clear();return}let a=t;for(let s=0;s<n.length-1;s++){let i=n[s],l;if(a instanceof Map?l=a.get(i):Array.isArray(a)&&/^\d+$/.test(i)&&(l=a[parseInt(i,10)]),l===void 0||typeof l!="object"||l===null)return;a=l;}let r=n[n.length-1];a instanceof Map&&a.delete(r);}normalizePath(t){return "/"+t.replace(/\[(\d+)\]/g,".$1").split(".").filter(a=>a.length>0).join("/")}getDataByPath(t,o){let n=this.normalizePath(o).split("/").filter(r=>r),a=t;for(let r of n){if(a==null)return null;if(a instanceof Map)a=a.get(r);else if(Array.isArray(a)&&/^\d+$/.test(r))a=a[parseInt(r,10)];else if(f(a))a=a[r];else return null}return a??null}getOrCreateSurface(t){let o=this.surfaces.get(t);return o||(o={rootComponentId:null,componentTree:null,dataModel:new this.mapCtor,components:new this.mapCtor,styles:{}},this.surfaces.set(t,o)),o}rebuildComponentTree(t){if(!t.rootComponentId){t.componentTree=null;return}let o=new this.setCtor;t.componentTree=this.buildNodeRecursive(t.rootComponentId,t,o,"/","");}buildNodeRecursive(t,o,n,a,r=""){let s=`${t}${r}`,{components:i}=o;if(!i.has(t))return null;if(n.has(s))throw new Error(`Circular dependency for component "${s}".`);n.add(s);let l=i.get(t),c=l.component,u={...l};delete u.id,delete u.component;let d={};for(let[P,D]of Object.entries(u))d[P]=this.resolvePropertyValue(D,o,n,a,r);n.delete(s);let w=l.weight,x={id:s,dataContextPath:a,weight:typeof w=="number"||typeof w=="string"?w:void 0};switch(c){case "Text":if(!Ce(d))throw new Error(`Invalid data; expected ${c}`);return {...x,type:"Text",properties:d};case "Image":if(!me(d))throw new Error(`Invalid data; expected ${c}`);return {...x,type:"Image",properties:d};case "Icon":if(!fe(d))throw new Error(`Invalid data; expected ${c}`);return {...x,type:"Icon",properties:d};case "Video":if(!we(d))throw new Error(`Invalid data; expected ${c}`);return {...x,type:"Video",properties:d};case "AudioPlayer":if(!se(d))throw new Error(`Invalid data; expected ${c}`);return {...x,type:"AudioPlayer",properties:d};case "Row":if(!be(d))throw new Error(`Invalid data; expected ${c}`);return {...x,type:"Row",properties:d};case "Column":if(!pe(d))throw new Error(`Invalid data; expected ${c}`);return {...x,type:"Column",properties:d};case "List":if(!he(d))throw new Error(`Invalid data; expected ${c}`);return {...x,type:"List",properties:d};case "Card":if(!le(d))throw new Error(`Invalid data; expected ${c}`);return {...x,type:"Card",properties:d};case "Tabs":if(!ve(d))throw new Error(`Invalid data; expected ${c}`);return {...x,type:"Tabs",properties:d};case "Divider":if(!ue(d))throw new Error(`Invalid data; expected ${c}`);return {...x,type:"Divider",properties:d};case "Modal":if(!ge(d))throw new Error(`Invalid data; expected ${c}`);return {...x,type:"Modal",properties:d};case "Button":if(!ie(d))throw new Error(`Invalid data; expected ${c}`);return {...x,type:"Button",properties:d};case "CheckBox":if(!ce(d))throw new Error(`Invalid data; expected ${c}`);return {...x,type:"CheckBox",properties:d};case "TextField":if(!Re(d))throw new Error(`Invalid data; expected ${c}`);return {...x,type:"TextField",properties:d};case "DateTimeInput":if(!de(d))throw new Error(`Invalid data; expected ${c}`);return {...x,type:"DateTimeInput",properties:d};case "MultipleChoice":if(!xe(d))throw new Error(`Invalid data; expected ${c}`);return {...x,type:"MultipleChoice",properties:d};case "Slider":if(!ye(d))throw new Error(`Invalid data; expected ${c}`);return {...x,type:"Slider",properties:d};default:return {...x,type:c,properties:d}}}resolvePropertyValue(t,o,n,a,r=""){if(typeof t=="string"&&o.components.has(t))return this.buildNodeRecursive(t,o,n,a,r);if(ae(t)){if(t.explicitList)return t.explicitList.map(s=>this.buildNodeRecursive(s,o,n,a,r));if(t.template){let s=this.resolvePath(t.template.dataBinding,a),i=this.getDataByPath(o.dataModel,s),l=t.template;return Array.isArray(i)?i.map((c,u)=>{let x=`:${[...a.split("/").filter(D=>/^\d+$/.test(D)),u].join(":")}`,P=`${s}/${u}`;return this.buildNodeRecursive(l.componentId,o,n,P,x)}):i instanceof Map?Array.from(i.keys(),c=>{let u=`:${c}`,d=`${s}/${c}`;return this.buildNodeRecursive(l.componentId,o,n,d,u)}):[]}}if(Array.isArray(t))return t.map(s=>this.resolvePropertyValue(s,o,n,a,r));if(f(t)){let s={};for(let[i,l]of Object.entries(t)){let c=l;if(ne(i,l)&&a!=="/"){c=l.replace(/^\.?\/item/,"").replace(/^\.?\/text/,"").replace(/^\.?\/label/,"").replace(/^\.?\//,""),s[i]=c;continue}s[i]=this.resolvePropertyValue(c,o,n,a,r);}return s}return t}};I(B,"DEFAULT_SURFACE_ID","@default");var y=B;function Ze(){return new y}var tt={};$(tt,{A2UI_EVENT_NAME:()=>et});var et="a2uiaction";var ot={};$(ot,{A2UI_EXTENSION_URI:()=>A2UI_EXTENSION_URI,A2UI_MIME_TYPE:()=>A2UI_MIME_TYPE,STANDARD_CATALOG_ID:()=>STANDARD_CATALOG_ID,isV09Message:()=>isV09Message});var mt={};$(mt,{GRID:()=>S,PALETTE_KEYS:()=>je,SHADES:()=>Ne,appendToAll:()=>ct,baseStyles:()=>rt,behaviorStyles:()=>ke,borderStyles:()=>Se,classesToString:()=>pt,cloneDefaultTheme:()=>lt,cn:()=>ut,colorStyles:()=>Ie,createTheme:()=>st,defaultTheme:()=>M,getA2UIStyles:()=>nt,getInverseKey:()=>Be,iconStyles:()=>Te,layoutStyles:()=>Ae,merge:()=>T,mergeStyles:()=>it,structuralStyles:()=>A,stylesToCSS:()=>dt,toProp:()=>C,typographyStyles:()=>Me});function To(){let e=[];for(let t=0;t<=100;t+=5){let o=t/100;e.push(`.a2-opacity-${t} { opacity: ${o}; }`);}for(let t=0;t<=100;t+=5){let o=t/100;e.push(`.a2-ho-${t}:hover { opacity: ${o}; }`);}return e.push(`
|
|
1
|
+
import {isV09Message,STANDARD_CATALOG_ID,A2UI_MIME_TYPE,A2UI_EXTENSION_URI,video,valueToValueMap,valueMapToObject,updatesToValueMap,updateDataModel,updateComponents,textField,textButton,text,tabs,slider,row,resetIdCounter,objectToValueMap,normalizePath,modal,messagesToJsonl,list,jsonlToMessages,image,icon,h5,h4,h3,h2,h1,generateId,flattenObjectToValueMap,divider,deleteSurface,dateTimeInput,createV09Messages,createSurface,createStatusSurface,createRecommendationSurface,createOrchestrationSurface,createInputFormSurface,createChatSurface,column,choicePicker,checkbox,card,caption,button,body,audioPlayer,SURFACE_IDS,DEFAULT_PATH_MAPPINGS}from'@zhama/a2ui-core';export{A2UI_EXTENSION_URI,A2UI_MIME_TYPE,DEFAULT_PATH_MAPPINGS,STANDARD_CATALOG_ID,SURFACE_IDS,audioPlayer,body,button,caption,card,checkbox,choicePicker,column,createChatSurface,createInputFormSurface,createOrchestrationSurface,createRecommendationSurface,createStatusSurface,createSurface,createV09Messages,dateTimeInput,deleteSurface,divider,flattenObjectToValueMap,generateId,h1,h2,h3,h4,h5,icon,image,isV09Message,jsonlToMessages,list,messagesToJsonl,modal,normalizePath,objectToValueMap,resetIdCounter,row,slider,tabs,text,textButton,textField,updateComponents,updateDataModel,updatesToValueMap,valueMapToObject,valueToValueMap,video}from'@zhama/a2ui-core';import Nt from'react-markdown';import {createContext,useContext,useState,useCallback,useEffect}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import*as bt from'lucide-react';var Ze=Object.defineProperty;var Io=(e,t,o)=>t in e?Ze(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o;var $=(e,t)=>{for(var o in t)Ze(e,o,{get:t[o],enumerable:true});};var T=(e,t,o)=>Io(e,typeof t!="symbol"?t+"":t,o);var tt={};$(tt,{A2uiMessageProcessor:()=>v,createMessageProcessor:()=>et,isAnyComponentNode:()=>S,isBooleanValue:()=>Fe,isComponentArrayReference:()=>ae,isNumberValue:()=>$e,isObject:()=>g,isPath:()=>ne,isResolvedAudioPlayer:()=>se,isResolvedButton:()=>ie,isResolvedCard:()=>le,isResolvedCheckbox:()=>de,isResolvedColumn:()=>ce,isResolvedDateTimeInput:()=>pe,isResolvedDivider:()=>ue,isResolvedIcon:()=>fe,isResolvedImage:()=>me,isResolvedList:()=>ge,isResolvedModal:()=>he,isResolvedMultipleChoice:()=>xe,isResolvedRow:()=>be,isResolvedSlider:()=>ye,isResolvedTabItem:()=>Ve,isResolvedTabs:()=>ve,isResolvedText:()=>Ce,isResolvedTextField:()=>Re,isResolvedVideo:()=>we,isStringValue:()=>I,isValueMap:()=>Qe});function Qe(e){return g(e)}function ne(e,t){return e==="path"&&typeof t=="string"}function g(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ae(e){return g(e)?"explicitList"in e||"template"in e:false}function I(e){return !!(typeof e=="string"||g(e)&&"path"in e&&typeof e.path=="string")}function $e(e){return !!(typeof e=="number"||g(e)&&"path"in e&&typeof e.path=="string")}function Fe(e){return !!(typeof e=="boolean"||g(e)&&"path"in e&&typeof e.path=="string")}function S(e){return g(e)?"id"in e&&"type"in e&&"properties"in e:false}function se(e){return g(e)&&"url"in e&&I(e.url)}function ie(e){return g(e)&&"child"in e&&S(e.child)&&"action"in e}function le(e){return g(e)?"child"in e?S(e.child):"children"in e?Array.isArray(e.children)&&e.children.every(S):false:false}function de(e){return g(e)&&"label"in e&&I(e.label)&&"value"in e&&Fe(e.value)}function ce(e){return g(e)&&"children"in e&&Array.isArray(e.children)&&e.children.every(S)}function pe(e){return g(e)&&"value"in e&&I(e.value)}function ue(e){return g(e)}function me(e){return g(e)&&"url"in e&&I(e.url)}function fe(e){return g(e)&&"name"in e&&I(e.name)}function ge(e){return g(e)&&"children"in e&&Array.isArray(e.children)&&e.children.every(S)}function he(e){return g(e)&&"entryPointChild"in e&&S(e.entryPointChild)&&"contentChild"in e&&S(e.contentChild)}function xe(e){return g(e)&&"selections"in e}function be(e){return g(e)&&"children"in e&&Array.isArray(e.children)&&e.children.every(S)}function ye(e){return g(e)&&"value"in e&&$e(e.value)}function Ve(e){return g(e)&&"title"in e&&I(e.title)&&"child"in e&&S(e.child)}function ve(e){return g(e)&&"tabItems"in e&&Array.isArray(e.tabItems)&&e.tabItems.every(Ve)}function Ce(e){return g(e)&&"text"in e&&I(e.text)}function Re(e){return g(e)&&"label"in e&&I(e.label)}function we(e){return g(e)&&"url"in e&&I(e.url)}var j=class j{constructor(t={}){T(this,"mapCtor",Map);T(this,"arrayCtor",Array);T(this,"setCtor",Set);T(this,"objCtor",Object);T(this,"surfaces");this.arrayCtor=t.arrayCtor??Array,this.mapCtor=t.mapCtor??Map,this.setCtor=t.setCtor??Set,this.objCtor=t.objCtor??Object,this.surfaces=new this.mapCtor;}getSurfaces(){return this.surfaces}clearSurfaces(){this.surfaces.clear();}processMessages(t){console.log("[A2UI] processMessages called with",t.length,"messages");for(let o of t)"createSurface"in o?this.handleCreateSurface(o):"updateComponents"in o?this.handleUpdateComponents(o):"updateDataModel"in o?this.handleUpdateDataModel(o):"deleteSurface"in o?this.handleDeleteSurface(o):console.warn("[A2UI] Unknown message type:",Object.keys(o));}getData(t,o,n=j.DEFAULT_SURFACE_ID){let a=this.getOrCreateSurface(n);if(!a)return console.warn("[A2UI] getData: surface not found:",n),null;let r;o==="."||o===""?r=t.dataContextPath??"/":r=this.resolvePath(o,t.dataContextPath);let s=this.getDataByPath(a.dataModel,r);return console.log("[A2UI] getData:",{surfaceId:n,relativePath:o,finalPath:r,result:s,dataModelSize:a.dataModel.size,formData:a.dataModel.get("form")}),s}setData(t,o,n,a=j.DEFAULT_SURFACE_ID){if(!t){console.warn("No component node set");return}let r=this.getOrCreateSurface(a);if(!r)return;let s;o==="."||o===""?s=t.dataContextPath??"/":s=this.resolvePath(o,t.dataContextPath),console.log("[A2UI] setData:",{surfaceId:a,relativePath:o,finalPath:s,value:n}),this.setDataByPath(r.dataModel,s,n),console.log("[A2UI] dataModel after setData:",{surfaceId:a,formData:r.dataModel.get("form")});}resolvePath(t,o){return t.startsWith("/")?t:o&&o!=="/"?o.endsWith("/")?`${o}${t}`:`${o}/${t}`:`/${t}`}handleCreateSurface(t){let{createSurface:o}=t,n=o.surfaceId,a=this.getOrCreateSurface(n);a.catalogId=o.catalogId;}handleUpdateComponents(t){let{updateComponents:o}=t,n=o.surfaceId,a=this.getOrCreateSurface(n);for(let i of o.components)a.components.set(i.id,i);let r=o.components,s=null;for(let i of r)if(i.id.endsWith("-root")){s=i.id;break}if(!s){let i=new this.setCtor;for(let l of r){let u=l;if(Array.isArray(u.children))for(let c of u.children)typeof c=="string"&&i.add(c);typeof u.child=="string"&&i.add(u.child);}let d=["Column","Row","List","Card"];for(let l of r)if(!i.has(l.id)&&d.includes(l.component)){s=l.id;break}}!s&&r.length>0&&(s=r[r.length-1].id),s&&(a.rootComponentId=s),this.rebuildComponentTree(a);}handleUpdateDataModel(t){let{updateDataModel:o}=t,n=o.surfaceId,a=this.getOrCreateSurface(n),r=o.path??"/",s=o.op??"replace",i=o.value;s==="remove"?this.removeDataByPath(a.dataModel,r):i!==void 0&&this.setDataByPath(a.dataModel,r,i),this.rebuildComponentTree(a);}handleDeleteSurface(t){let{deleteSurface:o}=t;this.surfaces.delete(o.surfaceId);}setDataByPath(t,o,n){let a=this.normalizePath(o).split("/").filter(i=>i);if(a.length===0){if(g(n)&&!(n instanceof Map)){t.clear();for(let[i,d]of Object.entries(n))t.set(i,d);}return}let r=t;for(let i=0;i<a.length-1;i++){let d=a[i],l;if(r instanceof Map?l=r.get(d):Array.isArray(r)&&/^\d+$/.test(d)?l=r[parseInt(d,10)]:g(r)&&(l=r[d]),l===void 0||typeof l!="object"||l===null){let u=new this.mapCtor;r instanceof Map?r.set(d,u):Array.isArray(r)?r[parseInt(d,10)]=u:g(r)&&(r[d]=u),l=u;}r=l;}let s=a[a.length-1];r instanceof Map?r.set(s,n):Array.isArray(r)&&/^\d+$/.test(s)?r[parseInt(s,10)]=n:g(r)&&(r[s]=n);}removeDataByPath(t,o){let n=this.normalizePath(o).split("/").filter(s=>s);if(n.length===0){t.clear();return}let a=t;for(let s=0;s<n.length-1;s++){let i=n[s],d;if(a instanceof Map?d=a.get(i):Array.isArray(a)&&/^\d+$/.test(i)&&(d=a[parseInt(i,10)]),d===void 0||typeof d!="object"||d===null)return;a=d;}let r=n[n.length-1];a instanceof Map&&a.delete(r);}normalizePath(t){return "/"+t.replace(/\[(\d+)\]/g,".$1").split(".").filter(a=>a.length>0).join("/")}getDataByPath(t,o){let n=this.normalizePath(o).split("/").filter(r=>r),a=t;for(let r of n){if(a==null)return null;if(a instanceof Map)a=a.get(r);else if(Array.isArray(a)&&/^\d+$/.test(r))a=a[parseInt(r,10)];else if(g(a))a=a[r];else return null}return a??null}getOrCreateSurface(t){let o=this.surfaces.get(t);return o||(o={rootComponentId:null,componentTree:null,dataModel:new this.mapCtor,components:new this.mapCtor,styles:{}},this.surfaces.set(t,o)),o}rebuildComponentTree(t){if(!t.rootComponentId){t.componentTree=null;return}let o=new this.setCtor;t.componentTree=this.buildNodeRecursive(t.rootComponentId,t,o,"/","");}buildNodeRecursive(t,o,n,a,r=""){let s=`${t}${r}`,{components:i}=o;if(!i.has(t))return null;if(n.has(s))throw new Error(`Circular dependency for component "${s}".`);n.add(s);let d=i.get(t),l=d.component,u={...d};delete u.id,delete u.component;let c={};for(let[P,k]of Object.entries(u))c[P]=this.resolvePropertyValue(k,o,n,a,r);n.delete(s);let f=d.weight,x={id:s,dataContextPath:a,weight:typeof f=="number"||typeof f=="string"?f:void 0};switch(l){case "Text":if(!Ce(c))throw new Error(`Invalid data; expected ${l}`);return {...x,type:"Text",properties:c};case "Image":if(!me(c))throw new Error(`Invalid data; expected ${l}`);return {...x,type:"Image",properties:c};case "Icon":if(!fe(c))throw new Error(`Invalid data; expected ${l}`);return {...x,type:"Icon",properties:c};case "Video":if(!we(c))throw new Error(`Invalid data; expected ${l}`);return {...x,type:"Video",properties:c};case "AudioPlayer":if(!se(c))throw new Error(`Invalid data; expected ${l}`);return {...x,type:"AudioPlayer",properties:c};case "Row":if(!be(c))throw new Error(`Invalid data; expected ${l}`);return {...x,type:"Row",properties:c};case "Column":if(!ce(c))throw new Error(`Invalid data; expected ${l}`);return {...x,type:"Column",properties:c};case "List":if(!ge(c))throw new Error(`Invalid data; expected ${l}`);return {...x,type:"List",properties:c};case "Card":if(!le(c))throw new Error(`Invalid data; expected ${l}`);return {...x,type:"Card",properties:c};case "Tabs":if(!ve(c))throw new Error(`Invalid data; expected ${l}`);return {...x,type:"Tabs",properties:c};case "Divider":if(!ue(c))throw new Error(`Invalid data; expected ${l}`);return {...x,type:"Divider",properties:c};case "Modal":if(!he(c))throw new Error(`Invalid data; expected ${l}`);return {...x,type:"Modal",properties:c};case "Button":if(!ie(c))throw new Error(`Invalid data; expected ${l}`);return {...x,type:"Button",properties:c};case "CheckBox":if(!de(c))throw new Error(`Invalid data; expected ${l}`);return {...x,type:"CheckBox",properties:c};case "TextField":if(!Re(c))throw new Error(`Invalid data; expected ${l}`);return {...x,type:"TextField",properties:c};case "DateTimeInput":if(!pe(c))throw new Error(`Invalid data; expected ${l}`);return {...x,type:"DateTimeInput",properties:c};case "MultipleChoice":if(!xe(c))throw new Error(`Invalid data; expected ${l}`);return {...x,type:"MultipleChoice",properties:c};case "Slider":if(!ye(c))throw new Error(`Invalid data; expected ${l}`);return {...x,type:"Slider",properties:c};default:return {...x,type:l,properties:c}}}resolvePropertyValue(t,o,n,a,r=""){if(typeof t=="string"&&o.components.has(t))return this.buildNodeRecursive(t,o,n,a,r);if(ae(t)){if(t.explicitList)return t.explicitList.map(s=>this.buildNodeRecursive(s,o,n,a,r));if(t.template){let s=this.resolvePath(t.template.dataBinding,a),i=this.getDataByPath(o.dataModel,s),d=t.template;return Array.isArray(i)?i.map((l,u)=>{let x=`:${[...a.split("/").filter(k=>/^\d+$/.test(k)),u].join(":")}`,P=`${s}/${u}`;return this.buildNodeRecursive(d.componentId,o,n,P,x)}):i instanceof Map?Array.from(i.keys(),l=>{let u=`:${l}`,c=`${s}/${l}`;return this.buildNodeRecursive(d.componentId,o,n,c,u)}):[]}}if(Array.isArray(t))return t.map(s=>this.resolvePropertyValue(s,o,n,a,r));if(g(t)){let s={};for(let[i,d]of Object.entries(t)){let l=d;if(ne(i,d)&&a!=="/"){l=d.replace(/^\.?\/item/,"").replace(/^\.?\/text/,"").replace(/^\.?\/label/,"").replace(/^\.?\//,""),s[i]=l;continue}s[i]=this.resolvePropertyValue(l,o,n,a,r);}return s}return t}};T(j,"DEFAULT_SURFACE_ID","@default");var v=j;function et(){return new v}var rt={};$(rt,{A2UI_EVENT_NAME:()=>ot});var ot="a2uiaction";var nt={};$(nt,{A2UI_EXTENSION_URI:()=>A2UI_EXTENSION_URI,A2UI_MIME_TYPE:()=>A2UI_MIME_TYPE,STANDARD_CATALOG_ID:()=>STANDARD_CATALOG_ID,isV09Message:()=>isV09Message});var gt={};$(gt,{GRID:()=>N,PALETTE_KEYS:()=>Ee,SHADES:()=>Ie,appendToAll:()=>pt,baseStyles:()=>at,behaviorStyles:()=>Se,borderStyles:()=>Ne,classesToString:()=>ut,cloneDefaultTheme:()=>ct,cn:()=>ft,colorStyles:()=>ke,createTheme:()=>lt,defaultTheme:()=>D,generateThemeCSS:()=>Oo,getA2UIStyles:()=>st,getInverseKey:()=>je,iconStyles:()=>Te,injectTheme:()=>Lo,layoutStyles:()=>Me,merge:()=>M,mergeStyles:()=>dt,structuralStyles:()=>A,stylesToCSS:()=>mt,tegoOSDarkTheme:()=>zo,tegoOSTheme:()=>Bo,toProp:()=>R,typographyStyles:()=>Ae});function Ao(){let e=[];for(let t=0;t<=100;t+=5){let o=t/100;e.push(`.a2-opacity-${t} { opacity: ${o}; }`);}for(let t=0;t<=100;t+=5){let o=t/100;e.push(`.a2-ho-${t}:hover { opacity: ${o}; }`);}return e.push(`
|
|
2
2
|
.a2-cursor-auto { cursor: auto; }
|
|
3
3
|
.a2-cursor-default { cursor: default; }
|
|
4
4
|
.a2-cursor-pointer { cursor: pointer; }
|
|
@@ -130,8 +130,30 @@ import {isV09Message,STANDARD_CATALOG_ID,A2UI_MIME_TYPE,A2UI_EXTENSION_URI,video
|
|
|
130
130
|
.a2-scrollbar-thin {
|
|
131
131
|
scrollbar-width: thin;
|
|
132
132
|
}
|
|
133
|
+
`),e.push(`
|
|
134
|
+
@keyframes a2-spin {
|
|
135
|
+
from { transform: rotate(0deg); }
|
|
136
|
+
to { transform: rotate(360deg); }
|
|
137
|
+
}
|
|
138
|
+
@keyframes a2-pulse {
|
|
139
|
+
0%, 100% { opacity: 1; }
|
|
140
|
+
50% { opacity: 0.5; }
|
|
141
|
+
}
|
|
142
|
+
@keyframes a2-bounce {
|
|
143
|
+
0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
|
|
144
|
+
50% { transform: translateY(0); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
|
|
145
|
+
}
|
|
146
|
+
@keyframes a2-ping {
|
|
147
|
+
75%, 100% { transform: scale(2); opacity: 0; }
|
|
148
|
+
}
|
|
149
|
+
`),e.push(`
|
|
150
|
+
.a2-animate-spin { animation: a2-spin 1s linear infinite; }
|
|
151
|
+
.a2-animate-pulse { animation: a2-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
|
|
152
|
+
.a2-animate-bounce { animation: a2-bounce 1s infinite; }
|
|
153
|
+
.a2-animate-ping { animation: a2-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }
|
|
154
|
+
.a2-animate-none { animation: none; }
|
|
133
155
|
`),e.join(`
|
|
134
|
-
`)}var
|
|
156
|
+
`)}var Se=Ao();var N=4,Ie=[0,5,10,15,20,25,30,35,40,50,60,70,80,90,95,98,99,100],Ee=["p","s","t","n","nv","e"];function R(e){return `--${e.replace(/([a-z]+)(\d+)/,"$1-$2")}`}function je(e){let t=e.match(/^([a-z]+)(\d+)$/);if(!t)return e;let o=t[1],n=t[2];if(!o||!n)return e;let r=100-parseInt(n,10),s=Ie.reduce((i,d)=>Math.abs(d-r)<Math.abs(i-r)?d:i);return `${o}${s}`}function Do(){let e=[];for(let t=0;t<=24;t++)e.push(`.a2-br-${t} { border-radius: ${t*4}px; }`);e.push(`
|
|
135
157
|
.a2-br-none { border-radius: 0; }
|
|
136
158
|
.a2-br-sm { border-radius: 2px; }
|
|
137
159
|
.a2-br-md { border-radius: 6px; }
|
|
@@ -191,153 +213,487 @@ import {isV09Message,STANDARD_CATALOG_ID,A2UI_MIME_TYPE,A2UI_EXTENSION_URI,video
|
|
|
191
213
|
.a2-ring-inset { box-shadow: inset 0 0 0 2px var(--a2-ring-color, currentColor); }
|
|
192
214
|
.a2-ring-primary { --a2-ring-color: light-dark(var(--p-35), var(--p-60)); }
|
|
193
215
|
`),e.join(`
|
|
194
|
-
`)}var
|
|
216
|
+
`)}var Ne=Do();function Po(e){let t=[];for(let o of Ie){let n=`${e}${o}`,a=je(n);t.push(`.a2-bc-${n} { border-color: light-dark(var(${R(n)}), var(${R(a)})); }`),t.push(`.a2-bgc-${n} { background-color: light-dark(var(${R(n)}), var(${R(a)})); }`),t.push(`.a2-bbgc-${n}::backdrop { background-color: light-dark(var(${R(n)}), var(${R(a)})); }`);for(let r=1;r<=9;r++){let s=r*10;t.push(`
|
|
195
217
|
.a2-bgc-${n}_${s} {
|
|
196
218
|
background-color: light-dark(
|
|
197
|
-
oklch(from var(${
|
|
198
|
-
oklch(from var(${
|
|
219
|
+
oklch(from var(${R(n)}) l c h / ${r/10}),
|
|
220
|
+
oklch(from var(${R(a)}) l c h / ${r/10})
|
|
199
221
|
);
|
|
200
222
|
}
|
|
201
223
|
.a2-bbgc-${n}_${s}::backdrop {
|
|
202
224
|
background-color: light-dark(
|
|
203
|
-
oklch(from var(${
|
|
204
|
-
oklch(from var(${
|
|
225
|
+
oklch(from var(${R(n)}) l c h / ${r/10}),
|
|
226
|
+
oklch(from var(${R(a)}) l c h / ${r/10})
|
|
205
227
|
);
|
|
206
228
|
}
|
|
207
|
-
`);}t.push(`.a2-c-${n} { color: light-dark(var(${
|
|
208
|
-
`)}function
|
|
229
|
+
`);}t.push(`.a2-c-${n} { color: light-dark(var(${R(n)}), var(${R(a)})); }`);}return t.join(`
|
|
230
|
+
`)}function $o(){return `
|
|
231
|
+
/* ========================================
|
|
232
|
+
* A2UI \u4E3B\u9898\u53D8\u91CF\u7CFB\u7EDF
|
|
233
|
+
*
|
|
234
|
+
* \u5BBF\u4E3B\u5E94\u7528\u53EF\u4EE5\u901A\u8FC7\u8BBE\u7F6E\u8FD9\u4E9B\u53D8\u91CF\u6765\u81EA\u5B9A\u4E49\u4E3B\u9898
|
|
235
|
+
* \u6240\u6709\u53D8\u91CF\u4F7F\u7528 HSL \u683C\u5F0F\uFF08\u4E0D\u542B hsl() \u51FD\u6570\uFF09
|
|
236
|
+
* \u4F8B\u5982: --a2-primary: 230 83% 60%;
|
|
237
|
+
* ======================================== */
|
|
238
|
+
|
|
239
|
+
:root, :host, .a2ui-root {
|
|
240
|
+
/* ===== \u8BED\u4E49\u5316\u989C\u8272\u53D8\u91CF ===== */
|
|
241
|
+
|
|
242
|
+
/* Primary - \u4E3B\u8272\u8C03\uFF08\u6309\u94AE\u3001\u94FE\u63A5\u3001\u5F3A\u8C03\u5143\u7D20\uFF09 */
|
|
243
|
+
--a2-primary: 230 83% 60%;
|
|
244
|
+
--a2-primary-foreground: 210 40% 98%;
|
|
245
|
+
|
|
246
|
+
/* Secondary - \u6B21\u8981\u8272\uFF08\u6B21\u8981\u6309\u94AE\u3001\u6807\u7B7E\uFF09 */
|
|
247
|
+
--a2-secondary: 210 40% 96%;
|
|
248
|
+
--a2-secondary-foreground: 222 84% 5%;
|
|
249
|
+
|
|
250
|
+
/* Muted - \u67D4\u548C\u8272\uFF08\u7981\u7528\u72B6\u6001\u3001\u6B21\u8981\u6587\u5B57\uFF09 */
|
|
251
|
+
--a2-muted: 210 40% 96%;
|
|
252
|
+
--a2-muted-foreground: 215 16% 47%;
|
|
253
|
+
|
|
254
|
+
/* Accent - \u5F3A\u8C03\u8272\uFF08\u60AC\u505C\u3001\u9009\u4E2D\u72B6\u6001\uFF09 */
|
|
255
|
+
--a2-accent: 210 40% 96%;
|
|
256
|
+
--a2-accent-foreground: 222 84% 5%;
|
|
257
|
+
|
|
258
|
+
/* Destructive - \u5371\u9669\u8272\uFF08\u5220\u9664\u3001\u9519\u8BEF\uFF09 */
|
|
259
|
+
--a2-destructive: 0 84% 60%;
|
|
260
|
+
--a2-destructive-foreground: 210 40% 98%;
|
|
261
|
+
|
|
262
|
+
/* Background & Foreground - \u80CC\u666F\u548C\u524D\u666F */
|
|
263
|
+
--a2-background: 0 0% 100%;
|
|
264
|
+
--a2-foreground: 222 84% 5%;
|
|
265
|
+
|
|
266
|
+
/* Card - \u5361\u7247 */
|
|
267
|
+
--a2-card: 0 0% 100%;
|
|
268
|
+
--a2-card-foreground: 222 84% 5%;
|
|
269
|
+
|
|
270
|
+
/* Popover - \u5F39\u51FA\u5C42 */
|
|
271
|
+
--a2-popover: 0 0% 100%;
|
|
272
|
+
--a2-popover-foreground: 222 84% 5%;
|
|
273
|
+
|
|
274
|
+
/* Border & Input - \u8FB9\u6846\u548C\u8F93\u5165\u6846 */
|
|
275
|
+
--a2-border: 214 32% 91%;
|
|
276
|
+
--a2-input: 214 32% 91%;
|
|
277
|
+
--a2-ring: 230 83% 60%;
|
|
278
|
+
|
|
279
|
+
/* Success/Warning/Info - \u72B6\u6001\u8272 */
|
|
280
|
+
--a2-success: 142 76% 36%;
|
|
281
|
+
--a2-success-foreground: 0 0% 98%;
|
|
282
|
+
--a2-warning: 38 92% 50%;
|
|
283
|
+
--a2-warning-foreground: 0 0% 98%;
|
|
284
|
+
--a2-info: 199 89% 48%;
|
|
285
|
+
--a2-info-foreground: 0 0% 98%;
|
|
286
|
+
|
|
287
|
+
/* ===== \u5E03\u5C40\u53D8\u91CF ===== */
|
|
288
|
+
--a2-radius: 0.5rem;
|
|
289
|
+
--a2-radius-sm: 0.25rem;
|
|
290
|
+
--a2-radius-lg: 0.75rem;
|
|
291
|
+
|
|
292
|
+
/* ===== \u5B57\u4F53\u53D8\u91CF ===== */
|
|
293
|
+
--a2-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
294
|
+
--a2-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
|
|
295
|
+
|
|
296
|
+
/* ===== \u9634\u5F71\u53D8\u91CF ===== */
|
|
297
|
+
--a2-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
298
|
+
--a2-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
|
299
|
+
--a2-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
|
300
|
+
--a2-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/* \u6697\u8272\u4E3B\u9898 */
|
|
304
|
+
.dark, [data-theme="dark"] {
|
|
305
|
+
--a2-primary: 230 85% 65%;
|
|
306
|
+
--a2-primary-foreground: 0 0% 17%;
|
|
307
|
+
|
|
308
|
+
--a2-secondary: 0 0% 22%;
|
|
309
|
+
--a2-secondary-foreground: 0 0% 95%;
|
|
310
|
+
|
|
311
|
+
--a2-muted: 0 0% 22%;
|
|
312
|
+
--a2-muted-foreground: 0 0% 70%;
|
|
313
|
+
|
|
314
|
+
--a2-accent: 0 0% 22%;
|
|
315
|
+
--a2-accent-foreground: 0 0% 95%;
|
|
316
|
+
|
|
317
|
+
--a2-destructive: 0 63% 31%;
|
|
318
|
+
--a2-destructive-foreground: 0 0% 95%;
|
|
319
|
+
|
|
320
|
+
--a2-background: 0 0% 17%;
|
|
321
|
+
--a2-foreground: 0 0% 95%;
|
|
322
|
+
|
|
323
|
+
--a2-card: 0 0% 20%;
|
|
324
|
+
--a2-card-foreground: 0 0% 95%;
|
|
325
|
+
|
|
326
|
+
--a2-popover: 0 0% 17%;
|
|
327
|
+
--a2-popover-foreground: 0 0% 95%;
|
|
328
|
+
|
|
329
|
+
--a2-border: 0 0% 27%;
|
|
330
|
+
--a2-input: 0 0% 30%;
|
|
331
|
+
--a2-ring: 230 85% 65%;
|
|
332
|
+
|
|
333
|
+
--a2-success: 142 70% 45%;
|
|
334
|
+
--a2-warning: 38 92% 50%;
|
|
335
|
+
--a2-info: 199 89% 48%;
|
|
336
|
+
}
|
|
337
|
+
`}function Fo(){return `
|
|
338
|
+
/* ========================================
|
|
339
|
+
* \u8BED\u4E49\u5316\u989C\u8272\u5DE5\u5177\u7C7B
|
|
340
|
+
* \u4F7F\u7528 A2UI \u4E3B\u9898\u53D8\u91CF (--a2-*)
|
|
341
|
+
* ======================================== */
|
|
342
|
+
|
|
343
|
+
/* Primary */
|
|
344
|
+
.a2-bg-primary { background-color: hsl(var(--a2-primary)); }
|
|
345
|
+
.a2-bg-primary-foreground { background-color: hsl(var(--a2-primary-foreground)); }
|
|
346
|
+
.a2-text-primary { color: hsl(var(--a2-primary)); }
|
|
347
|
+
.a2-text-primary-foreground { color: hsl(var(--a2-primary-foreground)); }
|
|
348
|
+
.a2-border-primary { border-color: hsl(var(--a2-primary)); }
|
|
349
|
+
|
|
350
|
+
/* Secondary */
|
|
351
|
+
.a2-bg-secondary { background-color: hsl(var(--a2-secondary)); }
|
|
352
|
+
.a2-text-secondary-foreground { color: hsl(var(--a2-secondary-foreground)); }
|
|
353
|
+
.a2-border-secondary { border-color: hsl(var(--a2-secondary)); }
|
|
354
|
+
|
|
355
|
+
/* Muted */
|
|
356
|
+
.a2-bg-muted { background-color: hsl(var(--a2-muted)); }
|
|
357
|
+
.a2-text-muted-foreground { color: hsl(var(--a2-muted-foreground)); }
|
|
358
|
+
|
|
359
|
+
/* Accent */
|
|
360
|
+
.a2-bg-accent { background-color: hsl(var(--a2-accent)); }
|
|
361
|
+
.a2-text-accent-foreground { color: hsl(var(--a2-accent-foreground)); }
|
|
362
|
+
|
|
363
|
+
/* Destructive */
|
|
364
|
+
.a2-bg-destructive { background-color: hsl(var(--a2-destructive)); }
|
|
365
|
+
.a2-text-destructive { color: hsl(var(--a2-destructive)); }
|
|
366
|
+
.a2-text-destructive-foreground { color: hsl(var(--a2-destructive-foreground)); }
|
|
367
|
+
|
|
368
|
+
/* Background & Foreground */
|
|
369
|
+
.a2-bg-background { background-color: hsl(var(--a2-background)); }
|
|
370
|
+
.a2-text-foreground { color: hsl(var(--a2-foreground)); }
|
|
371
|
+
|
|
372
|
+
/* Card */
|
|
373
|
+
.a2-bg-card { background-color: hsl(var(--a2-card)); }
|
|
374
|
+
.a2-text-card-foreground { color: hsl(var(--a2-card-foreground)); }
|
|
375
|
+
|
|
376
|
+
/* Popover */
|
|
377
|
+
.a2-bg-popover { background-color: hsl(var(--a2-popover)); }
|
|
378
|
+
.a2-text-popover-foreground { color: hsl(var(--a2-popover-foreground)); }
|
|
379
|
+
|
|
380
|
+
/* Border */
|
|
381
|
+
.a2-border-default { border-color: hsl(var(--a2-border)); }
|
|
382
|
+
.a2-border-input { border-color: hsl(var(--a2-input)); }
|
|
383
|
+
|
|
384
|
+
/* Ring */
|
|
385
|
+
.a2-ring { box-shadow: 0 0 0 2px hsl(var(--a2-ring)); }
|
|
386
|
+
.a2-ring-offset { box-shadow: 0 0 0 2px hsl(var(--a2-background)), 0 0 0 4px hsl(var(--a2-ring)); }
|
|
387
|
+
|
|
388
|
+
/* Status Colors */
|
|
389
|
+
.a2-bg-success { background-color: hsl(var(--a2-success)); }
|
|
390
|
+
.a2-text-success { color: hsl(var(--a2-success)); }
|
|
391
|
+
.a2-bg-warning { background-color: hsl(var(--a2-warning)); }
|
|
392
|
+
.a2-text-warning { color: hsl(var(--a2-warning)); }
|
|
393
|
+
.a2-bg-info { background-color: hsl(var(--a2-info)); }
|
|
394
|
+
.a2-text-info { color: hsl(var(--a2-info)); }
|
|
395
|
+
|
|
396
|
+
/* Radius */
|
|
397
|
+
.a2-rounded { border-radius: var(--a2-radius); }
|
|
398
|
+
.a2-rounded-sm { border-radius: var(--a2-radius-sm); }
|
|
399
|
+
.a2-rounded-lg { border-radius: var(--a2-radius-lg); }
|
|
400
|
+
.a2-rounded-full { border-radius: 9999px; }
|
|
401
|
+
.a2-rounded-none { border-radius: 0; }
|
|
402
|
+
|
|
403
|
+
/* Shadow */
|
|
404
|
+
.a2-shadow-sm { box-shadow: var(--a2-shadow-sm); }
|
|
405
|
+
.a2-shadow { box-shadow: var(--a2-shadow); }
|
|
406
|
+
.a2-shadow-md { box-shadow: var(--a2-shadow-md); }
|
|
407
|
+
.a2-shadow-lg { box-shadow: var(--a2-shadow-lg); }
|
|
408
|
+
.a2-shadow-none { box-shadow: none; }
|
|
409
|
+
|
|
410
|
+
/* ========================================
|
|
411
|
+
* Markdown \u6837\u5F0F - \u4E13\u4E1A\u7B80\u6D01\u8BBE\u8BA1
|
|
412
|
+
* \u4F7F\u7528 !important \u786E\u4FDD\u4F18\u5148\u4E8E Tailwind preflight reset
|
|
413
|
+
* ======================================== */
|
|
414
|
+
|
|
415
|
+
p.a2-md-p {
|
|
416
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
|
|
417
|
+
font-weight: 400 !important;
|
|
418
|
+
font-size: 14px !important;
|
|
419
|
+
line-height: 1.7 !important;
|
|
420
|
+
color: inherit !important;
|
|
421
|
+
margin: 0 0 12px 0 !important;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
p.a2-md-p:last-child {
|
|
425
|
+
margin-bottom: 0 !important;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
h1.a2-md-h1 {
|
|
429
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
|
|
430
|
+
font-weight: 700 !important;
|
|
431
|
+
font-size: 24px !important;
|
|
432
|
+
line-height: 1.4 !important;
|
|
433
|
+
color: hsl(var(--a2-foreground)) !important;
|
|
434
|
+
margin: 24px 0 16px 0 !important;
|
|
435
|
+
letter-spacing: -0.02em !important;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
h1.a2-md-h1:first-child {
|
|
439
|
+
margin-top: 0 !important;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
h2.a2-md-h2 {
|
|
443
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
|
|
444
|
+
font-weight: 600 !important;
|
|
445
|
+
font-size: 18px !important;
|
|
446
|
+
line-height: 1.45 !important;
|
|
447
|
+
color: hsl(var(--a2-foreground)) !important;
|
|
448
|
+
margin: 20px 0 12px 0 !important;
|
|
449
|
+
letter-spacing: -0.01em !important;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
h2.a2-md-h2:first-child {
|
|
453
|
+
margin-top: 0 !important;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
h3.a2-md-h3 {
|
|
457
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
|
|
458
|
+
font-weight: 600 !important;
|
|
459
|
+
font-size: 16px !important;
|
|
460
|
+
line-height: 1.5 !important;
|
|
461
|
+
color: hsl(var(--a2-foreground)) !important;
|
|
462
|
+
margin: 16px 0 8px 0 !important;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
h3.a2-md-h3:first-child {
|
|
466
|
+
margin-top: 0 !important;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
h4.a2-md-h4 {
|
|
470
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
|
|
471
|
+
font-weight: 600 !important;
|
|
472
|
+
font-size: 14px !important;
|
|
473
|
+
line-height: 1.55 !important;
|
|
474
|
+
color: hsl(var(--a2-foreground)) !important;
|
|
475
|
+
margin: 12px 0 6px 0 !important;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
h4.a2-md-h4:first-child {
|
|
479
|
+
margin-top: 0 !important;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
h5.a2-md-h5 {
|
|
483
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
|
|
484
|
+
font-weight: 500 !important;
|
|
485
|
+
font-size: 13px !important;
|
|
486
|
+
line-height: 1.55 !important;
|
|
487
|
+
color: hsl(var(--a2-muted-foreground)) !important;
|
|
488
|
+
margin: 8px 0 4px 0 !important;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
h5.a2-md-h5:first-child {
|
|
492
|
+
margin-top: 0 !important;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
ul.a2-md-ul {
|
|
496
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
|
|
497
|
+
font-size: 14px !important;
|
|
498
|
+
line-height: 1.7 !important;
|
|
499
|
+
color: hsl(var(--a2-foreground)) !important;
|
|
500
|
+
margin: 0 0 12px 0 !important;
|
|
501
|
+
padding-left: 20px !important;
|
|
502
|
+
list-style-type: disc !important;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
ol.a2-md-ol {
|
|
506
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
|
|
507
|
+
font-size: 14px !important;
|
|
508
|
+
line-height: 1.7 !important;
|
|
509
|
+
color: hsl(var(--a2-foreground)) !important;
|
|
510
|
+
margin: 0 0 12px 0 !important;
|
|
511
|
+
padding-left: 20px !important;
|
|
512
|
+
list-style-type: decimal !important;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
li.a2-md-li {
|
|
516
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
|
|
517
|
+
font-size: 14px !important;
|
|
518
|
+
line-height: 1.7 !important;
|
|
519
|
+
color: hsl(var(--a2-foreground)) !important;
|
|
520
|
+
margin-bottom: 4px !important;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
a.a2-md-a {
|
|
524
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
|
|
525
|
+
font-weight: 500 !important;
|
|
526
|
+
color: hsl(var(--a2-primary)) !important;
|
|
527
|
+
text-decoration: none !important;
|
|
528
|
+
transition: opacity 0.15s ease !important;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
a.a2-md-a:hover {
|
|
532
|
+
opacity: 0.8 !important;
|
|
533
|
+
text-decoration: underline !important;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
strong.a2-md-strong {
|
|
537
|
+
font-weight: 600 !important;
|
|
538
|
+
color: inherit !important;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
em.a2-md-em {
|
|
542
|
+
font-style: italic !important;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
code.a2-md-code {
|
|
546
|
+
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace !important;
|
|
547
|
+
font-size: 13px !important;
|
|
548
|
+
background-color: hsl(var(--a2-muted)) !important;
|
|
549
|
+
color: hsl(var(--a2-foreground)) !important;
|
|
550
|
+
padding: 2px 6px !important;
|
|
551
|
+
border-radius: 4px !important;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
blockquote.a2-md-blockquote {
|
|
555
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
|
|
556
|
+
font-size: 14px !important;
|
|
557
|
+
line-height: 1.7 !important;
|
|
558
|
+
color: hsl(var(--a2-muted-foreground)) !important;
|
|
559
|
+
font-style: italic !important;
|
|
560
|
+
margin: 12px 0 !important;
|
|
561
|
+
padding-left: 16px !important;
|
|
562
|
+
border-left: 3px solid hsl(var(--a2-primary)) !important;
|
|
563
|
+
}
|
|
564
|
+
`}function Vo(){let e=[];e.push($o()),e.push(Fo()),e.push(`
|
|
209
565
|
:root, :host, .a2ui-root {
|
|
210
|
-
/* Primary */
|
|
211
|
-
--p-0:
|
|
212
|
-
--p-5:
|
|
213
|
-
--p-10:
|
|
214
|
-
--p-15:
|
|
215
|
-
--p-20:
|
|
216
|
-
--p-25:
|
|
217
|
-
--p-30:
|
|
218
|
-
--p-35:
|
|
219
|
-
--p-40:
|
|
220
|
-
--p-50:
|
|
221
|
-
--p-60:
|
|
222
|
-
--p-70:
|
|
223
|
-
--p-80:
|
|
224
|
-
--p-90:
|
|
225
|
-
--p-95:
|
|
226
|
-
--p-98:
|
|
227
|
-
--p-99:
|
|
228
|
-
--p-100:
|
|
229
|
-
|
|
230
|
-
/*
|
|
231
|
-
--
|
|
232
|
-
--
|
|
233
|
-
--
|
|
234
|
-
--
|
|
235
|
-
--
|
|
236
|
-
--
|
|
237
|
-
--
|
|
238
|
-
--
|
|
239
|
-
--
|
|
240
|
-
--
|
|
241
|
-
--
|
|
242
|
-
--
|
|
243
|
-
--
|
|
244
|
-
--
|
|
245
|
-
--
|
|
246
|
-
--
|
|
247
|
-
--
|
|
248
|
-
--
|
|
249
|
-
|
|
250
|
-
/*
|
|
251
|
-
--
|
|
252
|
-
--
|
|
253
|
-
--
|
|
254
|
-
--
|
|
255
|
-
--
|
|
256
|
-
--
|
|
257
|
-
--
|
|
258
|
-
--
|
|
259
|
-
--
|
|
260
|
-
--
|
|
261
|
-
--
|
|
262
|
-
--
|
|
263
|
-
--
|
|
264
|
-
--
|
|
265
|
-
--
|
|
266
|
-
--
|
|
267
|
-
--
|
|
268
|
-
--
|
|
269
|
-
|
|
270
|
-
/*
|
|
271
|
-
--
|
|
272
|
-
--
|
|
273
|
-
--
|
|
274
|
-
--
|
|
275
|
-
--
|
|
276
|
-
--
|
|
277
|
-
--
|
|
278
|
-
--
|
|
279
|
-
--
|
|
280
|
-
--
|
|
281
|
-
--
|
|
282
|
-
--
|
|
283
|
-
--
|
|
284
|
-
--
|
|
285
|
-
--
|
|
286
|
-
--
|
|
287
|
-
--
|
|
288
|
-
--
|
|
289
|
-
|
|
290
|
-
/* Neutral Variant */
|
|
291
|
-
--nv-0:
|
|
292
|
-
--nv-5:
|
|
293
|
-
--nv-10:
|
|
294
|
-
--nv-15:
|
|
295
|
-
--nv-20:
|
|
296
|
-
--nv-25:
|
|
297
|
-
--nv-30:
|
|
298
|
-
--nv-35:
|
|
299
|
-
--nv-40:
|
|
300
|
-
--nv-50:
|
|
301
|
-
--nv-60:
|
|
302
|
-
--nv-70:
|
|
303
|
-
--nv-80:
|
|
304
|
-
--nv-90:
|
|
305
|
-
--nv-95:
|
|
306
|
-
--nv-98:
|
|
307
|
-
--nv-99:
|
|
308
|
-
--nv-100:
|
|
309
|
-
|
|
310
|
-
/* Error */
|
|
311
|
-
--e-0:
|
|
312
|
-
--e-5:
|
|
313
|
-
--e-10:
|
|
314
|
-
--e-15:
|
|
315
|
-
--e-20:
|
|
316
|
-
--e-25:
|
|
317
|
-
--e-30:
|
|
318
|
-
--e-35:
|
|
319
|
-
--e-40:
|
|
320
|
-
--e-50:
|
|
321
|
-
--e-60:
|
|
322
|
-
--e-70:
|
|
323
|
-
--e-80:
|
|
324
|
-
--e-90:
|
|
325
|
-
--e-95:
|
|
326
|
-
--e-98:
|
|
327
|
-
--e-99:
|
|
328
|
-
--e-100:
|
|
566
|
+
/* Primary - tego-os \u84DD\u8272\u4E3B\u9898 */
|
|
567
|
+
--p-0: hsl(0 0% 100%);
|
|
568
|
+
--p-5: hsl(230 83% 97%);
|
|
569
|
+
--p-10: hsl(230 83% 94%);
|
|
570
|
+
--p-15: hsl(230 83% 90%);
|
|
571
|
+
--p-20: hsl(230 83% 85%);
|
|
572
|
+
--p-25: hsl(230 83% 80%);
|
|
573
|
+
--p-30: hsl(230 83% 70%);
|
|
574
|
+
--p-35: hsl(230 83% 60%);
|
|
575
|
+
--p-40: hsl(230 83% 55%);
|
|
576
|
+
--p-50: hsl(230 83% 50%);
|
|
577
|
+
--p-60: hsl(230 83% 45%);
|
|
578
|
+
--p-70: hsl(230 83% 40%);
|
|
579
|
+
--p-80: hsl(230 83% 35%);
|
|
580
|
+
--p-90: hsl(230 83% 28%);
|
|
581
|
+
--p-95: hsl(230 83% 23%);
|
|
582
|
+
--p-98: hsl(230 83% 18%);
|
|
583
|
+
--p-99: hsl(230 83% 15%);
|
|
584
|
+
--p-100: hsl(230 83% 10%);
|
|
585
|
+
|
|
586
|
+
/* Neutral - tego-os \u7070\u8272\u7CFB\uFF08\u5E26\u8F7B\u5FAE\u84DD\u8C03\uFF09 */
|
|
587
|
+
--n-0: hsl(0 0% 100%);
|
|
588
|
+
--n-5: hsl(210 40% 98%);
|
|
589
|
+
--n-10: hsl(210 40% 96%);
|
|
590
|
+
--n-15: hsl(214 32% 94%);
|
|
591
|
+
--n-20: hsl(214 32% 91%);
|
|
592
|
+
--n-25: hsl(214 32% 85%);
|
|
593
|
+
--n-30: hsl(215 20% 70%);
|
|
594
|
+
--n-35: hsl(215 16% 60%);
|
|
595
|
+
--n-40: hsl(215 16% 50%);
|
|
596
|
+
--n-50: hsl(215 16% 47%);
|
|
597
|
+
--n-60: hsl(220 14% 35%);
|
|
598
|
+
--n-70: hsl(220 20% 25%);
|
|
599
|
+
--n-80: hsl(222 40% 15%);
|
|
600
|
+
--n-90: hsl(222 84% 10%);
|
|
601
|
+
--n-95: hsl(222 84% 7%);
|
|
602
|
+
--n-98: hsl(222 84% 6%);
|
|
603
|
+
--n-99: hsl(222 84% 5.5%);
|
|
604
|
+
--n-100: hsl(222 84% 5%);
|
|
605
|
+
|
|
606
|
+
/* Secondary - \u6B21\u8981\u8272\uFF08\u6D45\u7070\uFF09 */
|
|
607
|
+
--s-0: hsl(0 0% 100%);
|
|
608
|
+
--s-5: hsl(210 40% 98%);
|
|
609
|
+
--s-10: hsl(210 40% 96%);
|
|
610
|
+
--s-15: hsl(210 40% 94%);
|
|
611
|
+
--s-20: hsl(210 40% 90%);
|
|
612
|
+
--s-25: hsl(210 40% 85%);
|
|
613
|
+
--s-30: hsl(210 40% 80%);
|
|
614
|
+
--s-35: hsl(210 40% 70%);
|
|
615
|
+
--s-40: hsl(210 40% 60%);
|
|
616
|
+
--s-50: hsl(210 40% 50%);
|
|
617
|
+
--s-60: hsl(210 40% 40%);
|
|
618
|
+
--s-70: hsl(210 40% 30%);
|
|
619
|
+
--s-80: hsl(210 40% 20%);
|
|
620
|
+
--s-90: hsl(210 40% 15%);
|
|
621
|
+
--s-95: hsl(210 40% 10%);
|
|
622
|
+
--s-98: hsl(210 40% 7%);
|
|
623
|
+
--s-99: hsl(210 40% 5%);
|
|
624
|
+
--s-100: hsl(210 40% 3%);
|
|
625
|
+
|
|
626
|
+
/* Tertiary - \u5F3A\u8C03\u8272\uFF08\u7EFF\u8272\uFF09 */
|
|
627
|
+
--t-0: hsl(0 0% 100%);
|
|
628
|
+
--t-5: hsl(142 76% 97%);
|
|
629
|
+
--t-10: hsl(142 76% 90%);
|
|
630
|
+
--t-15: hsl(142 76% 80%);
|
|
631
|
+
--t-20: hsl(142 76% 70%);
|
|
632
|
+
--t-25: hsl(142 76% 60%);
|
|
633
|
+
--t-30: hsl(142 76% 50%);
|
|
634
|
+
--t-35: hsl(142 76% 45%);
|
|
635
|
+
--t-40: hsl(142 76% 40%);
|
|
636
|
+
--t-50: hsl(142 76% 36%);
|
|
637
|
+
--t-60: hsl(142 76% 32%);
|
|
638
|
+
--t-70: hsl(142 76% 28%);
|
|
639
|
+
--t-80: hsl(142 76% 24%);
|
|
640
|
+
--t-90: hsl(142 76% 20%);
|
|
641
|
+
--t-95: hsl(142 76% 16%);
|
|
642
|
+
--t-98: hsl(142 76% 12%);
|
|
643
|
+
--t-99: hsl(142 76% 10%);
|
|
644
|
+
--t-100: hsl(142 76% 8%);
|
|
645
|
+
|
|
646
|
+
/* Neutral Variant - \u7070\u8272\u53D8\u4F53 */
|
|
647
|
+
--nv-0: hsl(0 0% 100%);
|
|
648
|
+
--nv-5: hsl(210 40% 98%);
|
|
649
|
+
--nv-10: hsl(210 40% 96%);
|
|
650
|
+
--nv-15: hsl(214 32% 94%);
|
|
651
|
+
--nv-20: hsl(214 32% 91%);
|
|
652
|
+
--nv-25: hsl(214 32% 85%);
|
|
653
|
+
--nv-30: hsl(215 20% 70%);
|
|
654
|
+
--nv-35: hsl(215 16% 60%);
|
|
655
|
+
--nv-40: hsl(215 16% 50%);
|
|
656
|
+
--nv-50: hsl(215 16% 47%);
|
|
657
|
+
--nv-60: hsl(220 14% 35%);
|
|
658
|
+
--nv-70: hsl(220 20% 25%);
|
|
659
|
+
--nv-80: hsl(222 40% 15%);
|
|
660
|
+
--nv-90: hsl(222 84% 10%);
|
|
661
|
+
--nv-95: hsl(222 84% 7%);
|
|
662
|
+
--nv-98: hsl(222 84% 6%);
|
|
663
|
+
--nv-99: hsl(222 84% 5.5%);
|
|
664
|
+
--nv-100: hsl(222 84% 5%);
|
|
665
|
+
|
|
666
|
+
/* Error - \u7EA2\u8272\uFF08\u5371\u9669/\u9519\u8BEF\uFF09 */
|
|
667
|
+
--e-0: hsl(0 0% 100%);
|
|
668
|
+
--e-5: hsl(0 84% 97%);
|
|
669
|
+
--e-10: hsl(0 84% 92%);
|
|
670
|
+
--e-15: hsl(0 84% 85%);
|
|
671
|
+
--e-20: hsl(0 84% 78%);
|
|
672
|
+
--e-25: hsl(0 84% 72%);
|
|
673
|
+
--e-30: hsl(0 84% 66%);
|
|
674
|
+
--e-35: hsl(0 84% 60%);
|
|
675
|
+
--e-40: hsl(0 84% 55%);
|
|
676
|
+
--e-50: hsl(0 84% 50%);
|
|
677
|
+
--e-60: hsl(0 84% 45%);
|
|
678
|
+
--e-70: hsl(0 84% 40%);
|
|
679
|
+
--e-80: hsl(0 84% 35%);
|
|
680
|
+
--e-90: hsl(0 84% 28%);
|
|
681
|
+
--e-95: hsl(0 84% 22%);
|
|
682
|
+
--e-98: hsl(0 84% 16%);
|
|
683
|
+
--e-99: hsl(0 84% 12%);
|
|
684
|
+
--e-100: hsl(0 84% 8%);
|
|
329
685
|
|
|
330
686
|
/* Color scheme */
|
|
331
|
-
color-scheme:
|
|
687
|
+
color-scheme: light dark;
|
|
332
688
|
}
|
|
333
|
-
`);for(let t of
|
|
689
|
+
`);for(let t of Ee)e.push(Po(t));return e.push(`
|
|
334
690
|
.a2-bgc-transparent { background-color: transparent; }
|
|
335
691
|
.a2-c-inherit { color: inherit; }
|
|
336
692
|
.a2-c-current { color: currentColor; }
|
|
337
693
|
.a2-bc-transparent { border-color: transparent; }
|
|
338
694
|
.a2-bc-current { border-color: currentColor; }
|
|
339
695
|
`),e.join(`
|
|
340
|
-
`)}var
|
|
696
|
+
`)}var ke=Vo();function Eo(){return `
|
|
341
697
|
/* Material Icons Support */
|
|
342
698
|
.a2-icon {
|
|
343
699
|
font-family: 'Material Symbols Outlined', 'Material Icons', sans-serif;
|
|
@@ -367,7 +723,7 @@ import {isV09Message,STANDARD_CATALOG_ID,A2UI_MIME_TYPE,A2UI_EXTENSION_URI,video
|
|
|
367
723
|
.a2-icon-outlined {
|
|
368
724
|
font-variation-settings: 'FILL' 0;
|
|
369
725
|
}
|
|
370
|
-
`}var Te=
|
|
726
|
+
`}var Te=Eo();function jo(){let e=[];e.push(`
|
|
371
727
|
:root, :host, .a2ui-root {
|
|
372
728
|
${Array.from({length:16},(t,o)=>`--a2-g-${o+1}: ${(o+1)*4}px;`).join(`
|
|
373
729
|
`)}
|
|
@@ -466,6 +822,21 @@ import {isV09Message,STANDARD_CATALOG_ID,A2UI_MIME_TYPE,A2UI_EXTENSION_URI,video
|
|
|
466
822
|
.a2-min-h-0 { min-height: 0; }
|
|
467
823
|
.a2-min-w-0 { min-width: 0; }
|
|
468
824
|
.a2-max-w-full { max-width: 100%; }
|
|
825
|
+
.a2-max-w-xs { max-width: 20rem; }
|
|
826
|
+
.a2-max-w-sm { max-width: 24rem; }
|
|
827
|
+
.a2-max-w-md { max-width: 28rem; }
|
|
828
|
+
.a2-max-w-lg { max-width: 32rem; }
|
|
829
|
+
.a2-max-w-xl { max-width: 36rem; }
|
|
830
|
+
.a2-max-h-20 { max-height: 80px; }
|
|
831
|
+
.a2-max-h-24 { max-height: 96px; }
|
|
832
|
+
.a2-max-h-32 { max-height: 128px; }
|
|
833
|
+
.a2-max-h-40 { max-height: 160px; }
|
|
834
|
+
.a2-max-h-48 { max-height: 192px; }
|
|
835
|
+
.a2-max-h-56 { max-height: 224px; }
|
|
836
|
+
.a2-max-h-64 { max-height: 256px; }
|
|
837
|
+
.a2-max-h-72 { max-height: 288px; }
|
|
838
|
+
.a2-max-h-80 { max-height: 320px; }
|
|
839
|
+
.a2-max-h-96 { max-height: 384px; }
|
|
469
840
|
|
|
470
841
|
/* Overflow */
|
|
471
842
|
.a2-overflow-auto { overflow: auto; }
|
|
@@ -513,7 +884,7 @@ import {isV09Message,STANDARD_CATALOG_ID,A2UI_MIME_TYPE,A2UI_EXTENSION_URI,video
|
|
|
513
884
|
margin: 0;
|
|
514
885
|
}
|
|
515
886
|
`),e.join(`
|
|
516
|
-
`)}var
|
|
887
|
+
`)}var Me=jo();function Uo(){let e=[];e.push(`
|
|
517
888
|
:root, :host, .a2ui-root {
|
|
518
889
|
/* Font families */
|
|
519
890
|
--a2-font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
@@ -611,14 +982,14 @@ import {isV09Message,STANDARD_CATALOG_ID,A2UI_MIME_TYPE,A2UI_EXTENSION_URI,video
|
|
|
611
982
|
.a2-va-text-top { vertical-align: text-top; }
|
|
612
983
|
.a2-va-text-bottom { vertical-align: text-bottom; }
|
|
613
984
|
`),e.join(`
|
|
614
|
-
`)}var
|
|
985
|
+
`)}var Ae=Uo();var at=`
|
|
615
986
|
/* A2UI Base Styles */
|
|
616
987
|
.a2ui-root {
|
|
617
988
|
font-family: var(--a2-font-sans);
|
|
618
989
|
font-size: var(--a2-text-bm);
|
|
619
990
|
line-height: 1.5;
|
|
620
|
-
color:
|
|
621
|
-
background-color:
|
|
991
|
+
color: hsl(var(--a2-foreground));
|
|
992
|
+
background-color: transparent;
|
|
622
993
|
-webkit-font-smoothing: antialiased;
|
|
623
994
|
-moz-osx-font-smoothing: grayscale;
|
|
624
995
|
box-sizing: border-box;
|
|
@@ -698,5 +1069,8 @@ import {isV09Message,STANDARD_CATALOG_ID,A2UI_MIME_TYPE,A2UI_EXTENSION_URI,video
|
|
|
698
1069
|
.a2ui-root::-webkit-scrollbar-thumb:hover {
|
|
699
1070
|
background: light-dark(var(--n-40), var(--n-60));
|
|
700
1071
|
}
|
|
701
|
-
`,A=[
|
|
702
|
-
`);function nt(){return A}function U(){return {}}var M={additionalStyles:{Button:{},Card:{},Text:{h1:{},h2:{},h3:{},h4:{},h5:{},body:{},caption:{}}},components:{AudioPlayer:{"a2-w-full":true},Button:{"a2-dsp-iflex":true,"a2-al-center":true,"a2-jc-center":true,"a2-gap-2":true,"a2-px-4":true,"a2-py-2":true,"a2-br-3":true,"a2-bw-0":true,"a2-bs-solid":true,"a2-bgc-p35":true,"a2-c-n0":true,"a2-font-sans":true,"a2-fw-500":true,"a2-text-bm":true,"a2-cursor-pointer":true,"a2-transition":true,"a2-ho-80":true,"a2-active-scale-95":true,"a2-select-none":true},Card:{"a2-pos-rel":true,"a2-br-4":true,"a2-p-4":true,"a2-bgc-n0":true,"a2-border":true,"a2-bc-n90":true,"a2-shadow":true,"a2-transition":true,"a2-hover-shadow-md":true,"a2-overflow-hidden":true},Column:{"a2-dsp-flexvert":true,"a2-gap-2":true},CheckBox:{container:{"a2-dsp-iflex":true,"a2-al-center":true,"a2-gap-2":true,"a2-cursor-pointer":true},element:{"a2-wp-4":true,"a2-hp-4":true,"a2-br-1":true,"a2-border":true,"a2-bc-n60":true,"a2-bgc-n0":true,"a2-cursor-pointer":true},label:{"a2-font-sans":true,"a2-text-bm":true,"a2-fw-400":true,"a2-c-n70":true,"a2-flex-1":true}},DateTimeInput:{container:{"a2-dsp-flexhor":true,"a2-al-center":true,"a2-gap-2":true,"a2-w-full":true,"a2-text-bm":true,"a2-ws-nowrap":true},element:{"a2-px-3":true,"a2-py-2":true,"a2-br-2":true,"a2-border":true,"a2-bc-n60":true,"a2-bgc-n0":true,"a2-c-n70":true,"a2-transition-colors":true},label:{"a2-c-n70":true,"a2-text-bm":true,"a2-flex-0":true}},Divider:{"a2-bgc-n90":true,"a2-my-4":true},Image:{all:{"a2-br-2":true,"a2-media-cover":true,"a2-w-full":true,"a2-h-full":true},avatar:{"a2-br-50pc":true},header:U(),icon:U(),largeFeature:U(),mediumFeature:U(),smallFeature:U()},Icon:{"a2-icon":true,"a2-dsp-iflex":true,"a2-al-center":true,"a2-jc-center":true},List:{"a2-dsp-flexvert":true,"a2-gap-4":true,"a2-p-2":true},Modal:{backdrop:{"a2-pos-fixed":true,"a2-inset-0":true,"a2-dsp-flex":true,"a2-al-center":true,"a2-jc-center":true,"a2-bgc-n100_50":true,"a2-z-50":true,"a2-blur-sm":true},element:{"a2-br-4":true,"a2-bgc-n0":true,"a2-p-4":true,"a2-border":true,"a2-bc-n80":true,"a2-shadow-xl":true}},MultipleChoice:{container:{"a2-dsp-flexvert":true,"a2-gap-2":true},element:{"a2-px-3":true,"a2-py-2":true,"a2-br-2":true,"a2-border":true,"a2-bc-n60":true,"a2-bgc-n0":true,"a2-w-full":true},label:{"a2-text-bm":true,"a2-fw-500":true}},Row:{"a2-dsp-flexhor":true,"a2-gap-4":true},Slider:{container:{"a2-dsp-flexvert":true,"a2-gap-1":true},element:{"a2-w-full":true},label:{"a2-text-bm":true,"a2-fw-500":true}},Tabs:{container:{"a2-dsp-flexvert":true,"a2-gap-4":true},controls:{all:{"a2-px-4":true,"a2-py-2":true,"a2-text-bm":true,"a2-fw-500":true,"a2-cursor-pointer":true,"a2-transition-colors":true,"a2-br-t-2":true},selected:{"a2-bw-b-2":true,"a2-bc-p50":true,"a2-c-p50":true}},element:{"a2-dsp-flexhor":true,"a2-border-b":true,"a2-bc-n90":true}},Text:{all:{},h1:{"a2-font-sans":true,"a2-fw-600":true,"a2-text-hs":true,"a2-m-0":true,"a2-p-0":true,"a2-c-n95":true},h2:{"a2-font-sans":true,"a2-fw-600":true,"a2-text-tl":true,"a2-m-0":true,"a2-p-0":true,"a2-c-n95":true},h3:{"a2-font-sans":true,"a2-fw-600":true,"a2-text-tm":true,"a2-m-0":true,"a2-p-0":true,"a2-c-n90":true},h4:{"a2-font-sans":true,"a2-fw-500":true,"a2-text-bl":true,"a2-m-0":true,"a2-p-0":true,"a2-c-n90":true},h5:{"a2-font-sans":true,"a2-fw-500":true,"a2-text-bm":true,"a2-m-0":true,"a2-p-0":true,"a2-c-n80":true},h6:{"a2-font-sans":true,"a2-fw-500":true,"a2-text-bs":true,"a2-m-0":true,"a2-p-0":true,"a2-c-n70":true},body:{"a2-font-sans":true,"a2-fw-400":true,"a2-text-bm":true,"a2-lh-relaxed":true,"a2-c-n80":true},caption:{"a2-font-sans":true,"a2-fw-400":true,"a2-text-bs":true,"a2-c-n60":true},label:{"a2-font-sans":true,"a2-fw-500":true,"a2-text-bm":true,"a2-c-n70":true}},TextField:{container:{"a2-dsp-flexhor":true,"a2-al-center":true,"a2-gap-2":true,"a2-w-full":true,"a2-text-bm":true,"a2-ws-nowrap":true},element:{"a2-text-bm":true,"a2-px-3":true,"a2-py-2":true,"a2-br-2":true,"a2-border":true,"a2-bc-n60":true,"a2-bgc-n0":true,"a2-c-n90":true,"a2-flex-1":true,"a2-transition-colors":true,"a2-focus-visible-ring":true},label:{"a2-flex-0":true,"a2-c-n70":true,"a2-fw-500":true}},Video:{"a2-br-2":true,"a2-media-cover":true}},elements:{a:{"a2-font-sans":true,"a2-fw-500":true,"a2-dsp-iflex":true,"a2-al-center":true,"a2-td-none":true,"a2-c-p40":true},audio:{"a2-w-full":true},body:{"a2-font-serif":true,"a2-fw-400":true,"a2-text-bm":true,"a2-mt-0":true,"a2-mb-2":true,"a2-c-n90":true},button:{"a2-font-sans":true,"a2-fw-500":true,"a2-py-3":true,"a2-px-5":true,"a2-mb-1":true,"a2-br-4":true,"a2-bw-0":true,"a2-bs-solid":true,"a2-bgc-s30":true,"a2-ho-80":true},h1:{"a2-font-sans":true,"a2-fw-500":true,"a2-mt-0":true,"a2-mb-2":true},h2:{"a2-font-sans":true,"a2-fw-500":true,"a2-mt-0":true,"a2-mb-2":true},h3:{"a2-font-sans":true,"a2-fw-500":true,"a2-mt-0":true,"a2-mb-2":true},h4:{"a2-font-sans":true,"a2-fw-500":true,"a2-mt-0":true,"a2-mb-2":true},h5:{"a2-font-sans":true,"a2-fw-500":true,"a2-mt-0":true,"a2-mb-2":true},iframe:{"a2-scrollbar-none":true},input:{"a2-font-sans":true,"a2-fw-400":true,"a2-px-4":true,"a2-py-2":true,"a2-br-2":true,"a2-border":true,"a2-bc-s70":true,"a2-bs-solid":true,"a2-c-n90":true},p:{"a2-font-serif":true,"a2-fw-400":true,"a2-m-0":true,"a2-text-bm":true,"a2-c-n90":true},pre:{"a2-font-mono":true,"a2-fw-400":true,"a2-text-bm":true,"a2-ws-pre":true},textarea:{"a2-font-sans":true,"a2-fw-400":true,"a2-px-4":true,"a2-py-2":true,"a2-br-2":true,"a2-border":true,"a2-bc-s70":true,"a2-bs-solid":true,"a2-c-n90":true,"a2-resize-y":true},video:{"a2-media-cover":true}},markdown:{p:["a2-font-serif","a2-fw-400","a2-text-bm","a2-lh-relaxed","a2-c-n90","a2-mb-2"],h1:["a2-font-sans","a2-fw-500","a2-text-hs","a2-m-0","a2-mb-2"],h2:["a2-font-sans","a2-fw-500","a2-text-tl","a2-m-0","a2-mb-2"],h3:["a2-font-sans","a2-fw-500","a2-text-tm","a2-m-0","a2-mb-2"],h4:["a2-font-sans","a2-fw-500","a2-text-bl","a2-m-0","a2-mb-2"],h5:["a2-font-sans","a2-fw-500","a2-text-bm","a2-m-0","a2-mb-1","a2-c-n70"],ul:["a2-font-serif","a2-fw-400","a2-text-bm","a2-m-0"],ol:["a2-font-serif","a2-fw-400","a2-text-bm","a2-m-0"],li:["a2-font-serif","a2-fw-400","a2-text-bm"],a:["a2-font-sans","a2-fw-500","a2-c-p40","a2-td-none"],strong:["a2-fw-700"],em:["a2-fs-italic"],code:["a2-font-mono","a2-text-bs","a2-bgc-n95","a2-px-1","a2-br-1"],blockquote:["a2-pl-4","a2-border-l","a2-bw-l-3","a2-bc-p60","a2-c-n50","a2-fs-italic"]}};function at(e,t){let o={...e};for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let a=o[n],r=t[n];typeof a=="object"&&a!==null&&typeof r=="object"&&r!==null&&!Array.isArray(a)&&!Array.isArray(r)?o[n]=at(a,r):o[n]=r;}return o}function st(e){return at(M,e)}function it(...e){let t={};for(let o of e)if(o)for(let[n,a]of Object.entries(o)){let r=n.split("-").slice(0,2).join("-")+"-",s=Object.keys(t).filter(i=>i.startsWith(r));for(let i of s)delete t[i];t[n]=a;}return t}function lt(){return JSON.parse(JSON.stringify(M))}function T(...e){let t={};for(let o of e)if(o)for(let[n,a]of Object.entries(o)){let r=n.split("-"),s=r.length>=3?r.slice(0,2).join("-")+"-":n,i=Object.keys(t).filter(l=>l.startsWith(s));for(let l of i)delete t[l];t[n]=a;}return t}function ct(e,t,...o){let n=structuredClone(e);for(let a of o)for(let r of Object.keys(a)){let s=r.split("-").slice(0,2).join("-")+"-";for(let[i,l]of Object.entries(n)){if(t.includes(i))continue;let c=false;for(let u=0;u<l.length;u++)l[u]?.startsWith(s)&&(c=true,l[u]=r);c||l.push(r);}}return n}function pt(e){return Object.entries(e).filter(([,t])=>t).map(([t])=>t).join(" ")}function dt(e){let t={};for(let[o,n]of Object.entries(e)){let a=o.replace(/-([a-z])/g,(r,s)=>s.toUpperCase());t[a]=n;}return t}function ut(...e){let t=[];for(let o of e)if(o){if(typeof o=="string")t.push(o);else if(typeof o=="object")for(let[n,a]of Object.entries(o))a&&t.push(n);}return t.join(" ")}var Nt={};$(Nt,{Audio:()=>H,Button:()=>Y,Card:()=>J,Checkbox:()=>Q,Column:()=>G,ComponentRegistry:()=>V,ComponentRenderer:()=>R,DateTimeInput:()=>te,Divider:()=>q,Icon:()=>L,Image:()=>O,List:()=>W,Markdown:()=>Ge,Modal:()=>Z,MultipleChoice:()=>oe,Root:()=>j,Row:()=>K,Slider:()=>re,Surface:()=>Ke,Tabs:()=>X,Text:()=>z,TextField:()=>ee,Video:()=>_,cn:()=>p,componentRegistry:()=>E,extractNumberValue:()=>F,extractStringValue:()=>g,renderMarkdown:()=>We});var Ue=createContext(M);function Bo({theme:e=M,children:t}){return jsx(Ue.Provider,{value:e,children:t})}function m(){return useContext(Ue)}function g(e,t,o,n){if(e===null)return "";if(typeof e=="string")return e;if(typeof e=="object"&&"path"in e&&e.path){if(!o||!t)return console.warn("[A2UI] extractStringValue: no processor or component for path:",e.path),"(no model)";let a=o.getData(t,e.path,n??y.DEFAULT_SURFACE_ID);return a===null?(console.warn("[A2UI] extractStringValue: null value for path:",e.path),""):typeof a=="number"?String(a):typeof a!="string"?(console.warn("[A2UI] extractStringValue: non-string value for path:",e.path,typeof a),""):a}return ""}function F(e,t,o,n){if(e===null)return 0;if(typeof e=="number")return e;if(typeof e=="object"&&"path"in e&&e.path){if(!o||!t)return -1;let a=o.getData(t,e.path,n??y.DEFAULT_SURFACE_ID);return typeof a=="string"&&(a=Number.parseInt(a,10),Number.isNaN(a)&&(a=null)),a===null||typeof a!="number"?-1:a}return 0}function ft(e,t,o,n){if(e===null)return false;if(typeof e=="boolean")return e;if(typeof e=="object"&&"path"in e&&e.path){if(!o||!t)return false;let a=o.getData(t,e.path,n??y.DEFAULT_SURFACE_ID);return typeof a=="boolean"?a:typeof a=="string"?a.toLowerCase()==="true":false}return false}function p(...e){let t=[];for(let o of e)if(o){if(typeof o=="string")t.push(o);else if(typeof o=="object")for(let[n,a]of Object.entries(o))a&&t.push(n);}return t.join(" ")}function z({component:e,processor:t,surfaceId:o,text:n,usageHint:a="body",markdown:r=true}){let s=m(),i=g(n,e,t,o);if(!i)return jsx("span",{className:"a2-c-n50",children:"(empty)"});let l=T(s.components.Text.all,a?s.components.Text[a]:{});if(r){let c=()=>{switch(a){case "h1":return `# ${i}`;case "h2":return `## ${i}`;case "h3":return `### ${i}`;case "h4":return `#### ${i}`;case "h5":return `##### ${i}`;case "caption":return `*${i}*`;default:return i}};return jsx("section",{className:p(l),children:jsx(kt,{components:{p:({children:u})=>jsx("p",{className:s.markdown.p.join(" "),children:u}),h1:({children:u})=>jsx("h1",{className:s.markdown.h1.join(" "),children:u}),h2:({children:u})=>jsx("h2",{className:s.markdown.h2.join(" "),children:u}),h3:({children:u})=>jsx("h3",{className:s.markdown.h3.join(" "),children:u}),h4:({children:u})=>jsx("h4",{className:s.markdown.h4.join(" "),children:u}),h5:({children:u})=>jsx("h5",{className:s.markdown.h5.join(" "),children:u}),ul:({children:u})=>jsx("ul",{className:s.markdown.ul.join(" "),children:u}),ol:({children:u})=>jsx("ol",{className:s.markdown.ol.join(" "),children:u}),li:({children:u})=>jsx("li",{className:s.markdown.li.join(" "),children:u}),a:({children:u,href:d})=>jsx("a",{href:d,className:s.markdown.a.join(" "),children:u}),strong:({children:u})=>jsx("strong",{className:s.markdown.strong.join(" "),children:u}),em:({children:u})=>jsx("em",{className:s.markdown.em.join(" "),children:u})},children:c()})})}switch(a){case "h1":return jsx("h1",{className:p(l),children:i});case "h2":return jsx("h2",{className:p(l),children:i});case "h3":return jsx("h3",{className:p(l),children:i});case "h4":return jsx("h4",{className:p(l),children:i});case "h5":return jsx("h5",{className:p(l),children:i});case "caption":return jsx("span",{className:p(l),children:i});default:return jsx("p",{className:p(l),children:i})}}function O({component:e,processor:t,surfaceId:o,url:n,usageHint:a,fit:r="cover"}){let s=m(),i=g(n,e,t,o);if(!i)return jsx("div",{className:"a2-c-n50",children:"(no image)"});let l=T(s.components.Image.all,a?s.components.Image[a]:{}),c={objectFit:r??"cover"};return jsx("img",{src:i,alt:"",className:p(l),style:c})}function L({component:e,processor:t,surfaceId:o,name:n,size:a=20,className:r,container:s,variant:i}){let l=m(),c=g(n,e,t,o);if(!c)return null;let u=c.split("-").map(D=>D.charAt(0).toUpperCase()+D.slice(1)).join(""),d=gt[u]??gt[c],w={blue:{backgroundColor:"oklch(95% 0.04 240)",color:"oklch(55% 0.15 240)"},green:{backgroundColor:"oklch(95% 0.04 160)",color:"oklch(55% 0.15 160)"},purple:{backgroundColor:"oklch(95% 0.04 285)",color:"oklch(55% 0.15 285)"},orange:{backgroundColor:"oklch(95% 0.04 60)",color:"oklch(55% 0.15 60)"},red:{backgroundColor:"oklch(95% 0.04 25)",color:"oklch(55% 0.15 25)"},primary:{backgroundColor:"light-dark(var(--p-5), var(--p-95))",color:"light-dark(var(--p-50), var(--p-40))"}},x=i?w[i]:w.primary,P=()=>d?jsx(d,{size:a,className:p(l.components.Icon,r)}):jsx("span",{className:p(l.components.Icon,"material-icons",r),style:{fontSize:a},children:c});return s?jsx("div",{className:"a2-dsp-flex a2-flex-0 a2-al-center a2-jc-center a2-br-xl a2-transition",style:{width:40,height:40,...x},children:P()}):P()}function _({component:e,processor:t,surfaceId:o,url:n}){let a=m(),r=g(n,e,t,o);return r?jsx("section",{className:p(a.components.Video),children:jsx("video",{controls:true,src:r,className:"a2-w-full"})}):jsx("div",{className:"a2-c-n50",children:"(no video)"})}function H({component:e,processor:t,surfaceId:o,url:n,description:a}){let r=m(),s=g(n,e,t,o),i=a?g(a,e,t,o):void 0;return s?jsxs("section",{className:p(r.components.AudioPlayer),children:[i&&jsx("p",{className:"a2-mb-2 a2-text-bm",children:i}),jsx("audio",{controls:true,src:s,className:"a2-w-full"})]}):jsx("div",{className:"a2-c-n50",children:"(no audio)"})}function Y({component:e,action:t,children:o,onAction:n}){let a=m(),r=()=>{if(!t||!n)return;let s={eventType:"a2ui.action",action:t,dataContextPath:e.dataContextPath??"/",sourceComponentId:e.id,sourceComponent:e};n(s);};return jsx("button",{type:"button",className:p(a.components.Button),onClick:r,children:o})}var xt={start:"a2-al-start",center:"a2-al-center",end:"a2-al-end",stretch:"a2-al-stretch"},bt={start:"a2-jc-start",center:"a2-jc-center",end:"a2-jc-end",spaceBetween:"a2-jc-between",spaceAround:"a2-jc-around",spaceEvenly:"a2-jc-evenly"};function K({component:e,alignment:t="stretch",distribution:o="start",children:n}){let a=m(),r=xt[t]??xt.stretch,s=bt[o]??bt.start,l=(e.properties??{}).gap,c=l!==void 0?{gap:`${l*4}px`}:void 0;return jsx("section",{className:p(a.components.Row,r,s),style:c,children:n})}var yt={start:"a2-al-start",center:"a2-al-center",end:"a2-al-end",stretch:"a2-al-stretch"},vt={start:"a2-jc-start",center:"a2-jc-center",end:"a2-jc-end",spaceBetween:"a2-jc-between",spaceAround:"a2-jc-around",spaceEvenly:"a2-jc-evenly"};function G({component:e,alignment:t="stretch",distribution:o="start",children:n}){let a=m(),r=yt[t]??yt.stretch,s=vt[o]??vt.start,l=(e.properties??{}).spaceY,c=l!==void 0?{gap:`${l*4}px`}:void 0;return jsx("section",{className:p(a.components.Column,r,s),style:c,children:n})}function W({component:e,direction:t="vertical",columns:o=2,children:n}){let a=m(),s=(e?.properties??{}).columns??o,i,l,c=a.components.List;switch(t==="grid"&&typeof c=="object"&&(c=Object.fromEntries(Object.entries(c).filter(([u])=>!u.includes("flex")&&!u.includes("flexvert")&&!u.includes("flexhor")))),t){case "horizontal":i="a2-flex-row a2-overflow-x-auto";break;case "grid":i="a2-dsp-grid",l={gridTemplateColumns:`repeat(${s}, minmax(0, 1fr))`};break;default:i="a2-flex-col";}return jsx("section",{className:p(c,i),style:l,children:n})}function J({component:e,children:t}){let o=m(),a=(e.properties??{}).padding,r=a!==void 0?{padding:`${a*.25}rem`}:void 0;return jsx("section",{className:p(o.components.Card),style:r,children:t})}function X({component:e,processor:t,surfaceId:o,titles:n,children:a}){let r=m(),[s,i]=useState(0),l=()=>jsx("div",{className:p(r.components.Tabs.element),children:n.map((u,d)=>{let w=g(u,e,t,o),x=s===d?T(r.components.Tabs.controls.all,r.components.Tabs.controls.selected):{...r.components.Tabs.controls.all};return jsx("button",{disabled:s===d,className:p(x),onClick:()=>i(d),children:w},d)})}),c=a?.[s];return jsxs("section",{className:p(r.components.Tabs.container),children:[l(),jsx("div",{className:"a2-mt-4",children:c})]})}function q({axis:e="horizontal",thickness:t=1,color:o}){let n=m(),a={};o&&(a.borderColor=o),t&&(a.borderWidth=t);let r=e==="vertical"?"a2-border-l a2-h-full":"a2-border-t a2-w-full";return jsx("hr",{className:p(n.components.Divider,r),style:a})}function Z({entryPoint:e,content:t}){let o=m(),[n,a]=useState(false),r=useCallback(()=>{a(false);},[]);return useEffect(()=>{if(!n)return;let s=i=>{i.key==="Escape"&&r();};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[n,r]),n?jsx("dialog",{className:p(o.components.Modal.backdrop),open:true,role:"dialog","aria-modal":"true",onClick:s=>{s.target===s.currentTarget&&r();},children:jsxs("section",{className:p(o.components.Modal.element),children:[jsx("div",{className:"a2-mb-2 a2-dsp-flexhor a2-jc-end",children:jsx("button",{type:"button",className:"a2-br-2 a2-p-1 a2-ho-80 a2-transition-colors",onClick:r,"aria-label":"Close modal",children:"\u2715"})}),t]})}):jsx("button",{type:"button",onClick:()=>a(true),className:"a2-cursor-pointer",children:e})}function Q({component:e,processor:t,surfaceId:o,label:n,value:a}){let r=m(),s=g(n,e,t,o),i=ft(a,e,t,o),l=c=>{!a||!t||typeof a!="object"||!("path"in a)||!a.path||t.setData(e,a.path,c.target.checked,o??y.DEFAULT_SURFACE_ID);};return jsxs("section",{className:p(r.components.CheckBox.container),children:[jsx("input",{type:"checkbox",id:`checkbox-${e.id}`,className:p(r.components.CheckBox.element),checked:i,onChange:l}),jsx("label",{htmlFor:`checkbox-${e.id}`,className:p(r.components.CheckBox.label),children:s})]})}function ee({component:e,processor:t,surfaceId:o,label:n,text:a,usageHint:r="shortText"}){let s=m(),i=g(n,e,t,o),l=a?g(a,e,t,o):"",c=w=>{!a||!t||typeof a!="object"||!("path"in a)||!a.path||t.setData(e,a.path,w.target.value,o??y.DEFAULT_SURFACE_ID);},u=r==="number"?"number":r==="obscured"?"password":"text",d=r==="longText";return jsxs("section",{className:p(s.components.TextField.container),children:[i&&jsx("label",{htmlFor:`textfield-${e.id}`,className:p(s.components.TextField.label),children:i}),d?jsx("textarea",{id:`textfield-${e.id}`,className:p(s.components.TextField.element),value:l,onChange:c,placeholder:"Please enter a value",rows:4}):jsx("input",{id:`textfield-${e.id}`,type:u,className:p(s.components.TextField.element),value:l,onChange:c,placeholder:"Please enter a value",autoComplete:"off"})]})}function te({component:e,processor:t,surfaceId:o,value:n,enableDate:a=true,enableTime:r=true}){let s=m(),i=g(n,e,t,o),l=u=>{!n||!t||typeof n!="object"||!("path"in n)||!n.path||t.setData(e,n.path,u.target.value,o??y.DEFAULT_SURFACE_ID);},c="datetime-local";return a&&!r?c="date":!a&&r&&(c="time"),jsx("section",{className:p(s.components.DateTimeInput.container),children:jsx("input",{type:c,id:`datetime-${e.id}`,className:p(s.components.DateTimeInput.element),value:i,onChange:l})})}function oe({component:e,processor:t,surfaceId:o,value:n,options:a=[],label:r}){let s=m(),i=r?g(r,e,t,o):"Select an item",l=c=>{!n||!t||typeof n!="object"||!("path"in n)||!n.path||t.setData(e,n.path,[c.target.value],o??y.DEFAULT_SURFACE_ID);};return jsxs("section",{className:p(s.components.MultipleChoice.container),children:[jsx("label",{htmlFor:`multichoice-${e.id}`,className:p(s.components.MultipleChoice.label),children:i}),jsx("select",{id:`multichoice-${e.id}`,className:p(s.components.MultipleChoice.element),onChange:l,children:a?.map((c,u)=>{let d=g(c.label,e,t,o);return jsx("option",{value:c.value,children:d},u)})})]})}function re({component:e,processor:t,surfaceId:o,value:n,min:a=0,max:r=100}){let s=m(),i=F(n,e,t,o),l=c=>{!n||!t||typeof n!="object"||!("path"in n)||!n.path||t.setData(e,n.path,Number(c.target.value),o??y.DEFAULT_SURFACE_ID);};return jsxs("section",{className:p(s.components.Slider.container),children:[jsx("input",{type:"range",id:`slider-${e.id}`,className:p(s.components.Slider.element),value:i,min:a,max:r,onChange:l}),jsx("span",{className:p(s.components.Slider.label),children:i})]})}var V=class{constructor(){I(this,"registry",new Map);}register(t,o){if(!/^[a-zA-Z0-9]+$/.test(t))throw new Error(`[Registry] Invalid typeName '${t}'. Must be alphanumeric.`);this.registry.set(t,o);}get(t){return this.registry.get(t)}has(t){return this.registry.has(t)}unregister(t){return this.registry.delete(t)}getRegisteredTypes(){return Array.from(this.registry.keys())}},E=new V;function j({processor:e,surfaceId:t,childComponents:o,enableCustomElements:n=false,onAction:a}){return !o||!Array.isArray(o)?null:jsx(Fragment,{children:o.map(r=>jsx(R,{component:r,processor:e,surfaceId:t,enableCustomElements:n,onAction:a},r.id))})}function R({component:e,processor:t,surfaceId:o,enableCustomElements:n,onAction:a}){if(n){let r=E.get(e.type);if(r)return jsx(r,{component:e,processor:t,surfaceId:o,...e.properties},e.id)}switch(e.type){case "Text":{let r=e;return jsx(z,{component:r,processor:t,surfaceId:o,text:r.properties.text,usageHint:r.properties.usageHint},r.id)}case "Image":{let r=e;return jsx(O,{component:r,processor:t,surfaceId:o,url:r.properties.url,usageHint:r.properties.usageHint,fit:r.properties.fit},r.id)}case "Icon":{let r=e;return jsx(L,{component:r,processor:t,surfaceId:o,name:r.properties.name,container:r.properties.container,variant:r.properties.variant,size:r.properties.size},r.id)}case "Video":{let r=e;return jsx(_,{component:r,processor:t,surfaceId:o,url:r.properties.url},r.id)}case "AudioPlayer":{let r=e;return jsx(H,{component:r,processor:t,surfaceId:o,url:r.properties.url,description:r.properties.description},r.id)}case "Button":{let r=e;return jsx(Y,{component:r,processor:t,surfaceId:o,action:r.properties.action,onAction:a,children:r.properties.child&&jsx(R,{component:r.properties.child,processor:t,surfaceId:o,enableCustomElements:n,onAction:a})},r.id)}case "Row":{let r=e;return jsx(K,{component:r,processor:t,surfaceId:o,alignment:r.properties.alignment,distribution:r.properties.distribution,children:r.properties.children?.map(s=>jsx(R,{component:s,processor:t,surfaceId:o,enableCustomElements:n,onAction:a},s.id))},r.id)}case "Column":{let r=e;return jsx(G,{component:r,processor:t,surfaceId:o,alignment:r.properties.alignment,distribution:r.properties.distribution,children:r.properties.children?.map(s=>jsx(R,{component:s,processor:t,surfaceId:o,enableCustomElements:n,onAction:a},s.id))},r.id)}case "List":{let r=e;return jsx(W,{component:r,processor:t,surfaceId:o,direction:r.properties.direction,children:r.properties.children?.map(s=>jsx(R,{component:s,processor:t,surfaceId:o,enableCustomElements:n,onAction:a},s.id))},r.id)}case "Card":{let r=e,s=r.properties.children??(r.properties.child?[r.properties.child]:[]);return jsx(J,{component:r,processor:t,surfaceId:o,children:s.map(i=>jsx(R,{component:i,processor:t,surfaceId:o,enableCustomElements:n,onAction:a},i.id))},r.id)}case "Tabs":{let r=e,s=r.properties.tabItems?.map(l=>l.title)??[],i=r.properties.tabItems?.map(l=>jsx(R,{component:l.child,processor:t,surfaceId:o,enableCustomElements:n,onAction:a},l.child.id));return jsx(X,{component:r,processor:t,surfaceId:o,titles:s,children:i},r.id)}case "Divider":{let r=e;return jsx(q,{component:r,processor:t,surfaceId:o,axis:r.properties.axis,thickness:r.properties.thickness,color:r.properties.color},r.id)}case "Modal":{let r=e;return jsx(Z,{component:r,processor:t,surfaceId:o,entryPoint:jsx(R,{component:r.properties.entryPointChild,processor:t,surfaceId:o,enableCustomElements:n,onAction:a}),content:jsx(R,{component:r.properties.contentChild,processor:t,surfaceId:o,enableCustomElements:n,onAction:a})},r.id)}case "CheckBox":{let r=e;return jsx(Q,{component:r,processor:t,surfaceId:o,label:r.properties.label,value:r.properties.value},r.id)}case "TextField":{let r=e;return jsx(ee,{component:r,processor:t,surfaceId:o,label:r.properties.label,text:r.properties.text,usageHint:r.properties.usageHint,validationRegexp:r.properties.validationRegexp},r.id)}case "DateTimeInput":{let r=e;return jsx(te,{component:r,processor:t,surfaceId:o,value:r.properties.value,enableDate:r.properties.enableDate,enableTime:r.properties.enableTime},r.id)}case "MultipleChoice":{let r=e;return jsx(oe,{component:r,processor:t,surfaceId:o,value:r.properties.value,options:r.properties.options,label:r.properties.label,usageHint:r.properties.usageHint},r.id)}case "Slider":{let r=e;return jsx(re,{component:r,processor:t,surfaceId:o,value:r.properties.value,min:r.properties.min,max:r.properties.max,label:r.properties.label},r.id)}default:{if(n){let r=E.get(e.type);if(r)return jsx(r,{component:e,processor:t,surfaceId:o,...e.properties},e.id)}return jsxs("div",{className:"a2-br-2 a2-border a2-bc-e30 a2-p-2 a2-c-e50",children:["Unknown component type: ",e.type]},e.id)}}}function Ke({surfaceId:e,surface:t,processor:o,enableCustomElements:n=false,onAction:a,themeColors:r}){if(!t)return null;let s=()=>t.styles?.logoUrl?jsx("div",{className:"a2-mb-4 a2-dsp-flexhor a2-jc-center",children:jsx("img",{src:t.styles.logoUrl,alt:"Logo",className:"a2-w-50",style:{maxWidth:"220px"}})}):null,i=()=>jsx(j,{surfaceId:e,processor:o,childComponents:t.componentTree?[t.componentTree]:null,enableCustomElements:n,onAction:a}),l={paddingBottom:"80px",...r,...t.styles?.primaryColor&&!r?.["--p-50"]?{"--p-50":t.styles.primaryColor}:{}};return jsxs("div",{className:"a2ui-surface a2ui-root a2-dsp-flexvert a2-gap-8 a2-p-10",style:l,children:[s(),i()]})}function Ge({children:e,className:t}){let o=m();return jsx("div",{className:t,children:jsx(kt,{components:{p:({children:n})=>jsx("p",{className:o.markdown.p.join(" "),children:n}),h1:({children:n})=>jsx("h1",{className:o.markdown.h1.join(" "),children:n}),h2:({children:n})=>jsx("h2",{className:o.markdown.h2.join(" "),children:n}),h3:({children:n})=>jsx("h3",{className:o.markdown.h3.join(" "),children:n}),h4:({children:n})=>jsx("h4",{className:o.markdown.h4.join(" "),children:n}),h5:({children:n})=>jsx("h5",{className:o.markdown.h5.join(" "),children:n}),ul:({children:n})=>jsx("ul",{className:o.markdown.ul.join(" "),children:n}),ol:({children:n})=>jsx("ol",{className:o.markdown.ol.join(" "),children:n}),li:({children:n})=>jsx("li",{className:o.markdown.li.join(" "),children:n}),a:({children:n,href:a})=>jsx("a",{href:a,className:o.markdown.a.join(" "),children:n}),strong:({children:n})=>jsx("strong",{className:o.markdown.strong.join(" "),children:n}),em:({children:n})=>jsx("em",{className:o.markdown.em.join(" "),children:n})},children:e})})}function We(e){return jsx(kt,{children:e})}var St={};$(St,{DEFAULT_PATH_MAPPINGS:()=>DEFAULT_PATH_MAPPINGS,SURFACE_IDS:()=>SURFACE_IDS,audioPlayer:()=>audioPlayer,body:()=>body,button:()=>button,caption:()=>caption,card:()=>card,checkbox:()=>checkbox,choicePicker:()=>choicePicker,column:()=>column,createChatSurface:()=>createChatSurface,createInputFormSurface:()=>createInputFormSurface,createOrchestrationSurface:()=>createOrchestrationSurface,createRecommendationSurface:()=>createRecommendationSurface,createStatusSurface:()=>createStatusSurface,createSurface:()=>createSurface,createV09Messages:()=>createV09Messages,dateTimeInput:()=>dateTimeInput,deleteSurface:()=>deleteSurface,divider:()=>divider,flattenObjectToValueMap:()=>flattenObjectToValueMap,generateId:()=>generateId,h1:()=>h1,h2:()=>h2,h3:()=>h3,h4:()=>h4,h5:()=>h5,icon:()=>icon,image:()=>image,jsonlToMessages:()=>jsonlToMessages,list:()=>list,messagesToJsonl:()=>messagesToJsonl,modal:()=>modal,normalizePath:()=>normalizePath,objectToValueMap:()=>objectToValueMap,resetIdCounter:()=>resetIdCounter,row:()=>row,slider:()=>slider,tabs:()=>tabs,text:()=>text,textButton:()=>textButton,textField:()=>textField,updateComponents:()=>updateComponents,updateDataModel:()=>updateDataModel,updatesToValueMap:()=>updatesToValueMap,valueMapToObject:()=>valueMapToObject,valueToValueMap:()=>valueToValueMap,video:()=>video});var Je=createContext({processor:null,surfaceId:null});function lr({processor:e,surfaceId:t="@default",children:o}){return jsx(Je.Provider,{value:{processor:e,surfaceId:t},children:o})}function cr(){return useContext(Je)}var De=false;function ur(e){if(De)return;if(document.getElementById(e)){De=true;return}let t=document.createElement("style");t.id=e,t.textContent=A,document.head.appendChild(t),De=true;}function mr(e){let t=document.getElementById(e);t&&(t.remove(),De=false);}var Ro="a2ui-structural-styles";function fr({children:e,removeOnUnmount:t=false}){return useEffect(()=>(ur(Ro),()=>{t&&mr(Ro);}),[t]),jsx(Fragment,{children:e})}function hr(){return A}function gr(){let e=document.createElement("style");return e.textContent=A,e}export{j as A2UIRoot,et as A2UI_EVENT_NAME,y as A2uiMessageProcessor,H as Audio,St as Builders,Y as Button,J as Card,Q as Checkbox,G as Column,V as ComponentRegistry,R as ComponentRenderer,Qe as Data,te as DateTimeInput,q as Divider,tt as Events,L as Icon,O as Image,W as List,Ge as Markdown,Z as Modal,oe as MultipleChoice,Je as ProcessorContext,lr as ProcessorProvider,j as Root,K as Row,re as Slider,fr as StyleProvider,mt as Styles,Ke as Surface,X as Tabs,z as Text,ee as TextField,Ue as ThemeContext,Bo as ThemeProvider,ot as Types,Nt as UI,_ as Video,ct as appendToAll,pt as classesToString,lt as cloneDefaultTheme,p as cn,ut as cnStyles,E as componentRegistry,Ze as createMessageProcessor,gr as createStyleElement,st as createTheme,M as defaultTheme,F as extractNumberValue,g as extractStringValue,nt as getA2UIStyles,hr as getStylesCSS,k as isAnyComponentNode,Ve as isBooleanValue,ae as isComponentArrayReference,$e as isNumberValue,f as isObject,ne as isPath,se as isResolvedAudioPlayer,ie as isResolvedButton,le as isResolvedCard,ce as isResolvedCheckbox,pe as isResolvedColumn,de as isResolvedDateTimeInput,ue as isResolvedDivider,fe as isResolvedIcon,me as isResolvedImage,he as isResolvedList,ge as isResolvedModal,xe as isResolvedMultipleChoice,be as isResolvedRow,ye as isResolvedSlider,Ee as isResolvedTabItem,ve as isResolvedTabs,Ce as isResolvedText,Re as isResolvedTextField,we as isResolvedVideo,N as isStringValue,qe as isValueMap,T as merge,it as mergeStyles,We as renderMarkdown,A as structuralStyles,dt as stylesToCSS,cr as useProcessor,m as useTheme};
|
|
1072
|
+
`,A=[at,Me,ke,Ae,Ne,Se,Te].join(`
|
|
1073
|
+
`);function st(){return A}function U(){return {}}var D={additionalStyles:{Button:{},Card:{},Text:{h1:{},h2:{},h3:{},h4:{},h5:{},body:{},caption:{}}},components:{AudioPlayer:{"a2-w-full":true},Button:{"a2-dsp-iflex":true,"a2-al-center":true,"a2-jc-center":true,"a2-gap-2":true,"a2-px-6":true,"a2-py-3":true,"a2-br-2":true,"a2-bw-0":true,"a2-bs-solid":true,"a2-bg-primary":true,"a2-text-primary-foreground":true,"a2-font-sans":true,"a2-fw-500":true,"a2-text-bm":true,"a2-cursor-pointer":true,"a2-transition":true,"a2-ho-80":true,"a2-active-scale-95":true,"a2-select-none":true},Card:{"a2-pos-rel":true,"a2-br-2":true,"a2-p-4":true,"a2-bg-card":true,"a2-text-card-foreground":true,"a2-border":true,"a2-border-default":true,"a2-shadow-sm":true,"a2-transition":true,"a2-hover-shadow-md":true,"a2-overflow-hidden":true},Column:{"a2-dsp-flexvert":true,"a2-gap-2":true},CheckBox:{container:{"a2-dsp-iflex":true,"a2-al-center":true,"a2-gap-2":true,"a2-cursor-pointer":true},element:{"a2-wp-4":true,"a2-hp-4":true,"a2-br-1":true,"a2-border":true,"a2-bc-n60":true,"a2-bgc-n0":true,"a2-cursor-pointer":true},label:{"a2-font-sans":true,"a2-text-bm":true,"a2-fw-400":true,"a2-c-n70":true,"a2-flex-1":true}},DateTimeInput:{container:{"a2-dsp-flexhor":true,"a2-al-center":true,"a2-gap-2":true,"a2-w-full":true,"a2-text-bm":true,"a2-ws-nowrap":true},element:{"a2-px-3":true,"a2-py-2":true,"a2-br-2":true,"a2-border":true,"a2-bc-n60":true,"a2-bgc-n0":true,"a2-c-n70":true,"a2-transition-colors":true},label:{"a2-c-n70":true,"a2-text-bm":true,"a2-flex-0":true}},Divider:{"a2-bgc-n90":true,"a2-my-4":true},Image:{all:{"a2-br-2":true,"a2-media-cover":true,"a2-w-full":true,"a2-h-full":true},avatar:{"a2-br-50pc":true},header:U(),icon:U(),largeFeature:U(),mediumFeature:U(),smallFeature:U()},Icon:{"a2-icon":true,"a2-dsp-iflex":true,"a2-al-center":true,"a2-jc-center":true,"a2-c-inherit":true},List:{"a2-dsp-flexvert":true,"a2-gap-4":true,"a2-p-2":true},Modal:{backdrop:{"a2-pos-fixed":true,"a2-inset-0":true,"a2-dsp-flex":true,"a2-al-center":true,"a2-jc-center":true,"a2-bgc-n100_50":true,"a2-z-50":true,"a2-blur-sm":true},element:{"a2-br-4":true,"a2-bgc-n0":true,"a2-p-4":true,"a2-border":true,"a2-bc-n80":true,"a2-shadow-xl":true}},MultipleChoice:{container:{"a2-dsp-flexvert":true,"a2-gap-2":true},element:{"a2-px-3":true,"a2-py-2":true,"a2-br-2":true,"a2-border":true,"a2-bc-n60":true,"a2-bgc-n0":true,"a2-w-full":true},label:{"a2-text-bm":true,"a2-fw-500":true}},Row:{"a2-dsp-flexhor":true,"a2-gap-4":true},Slider:{container:{"a2-dsp-flexvert":true,"a2-gap-1":true},element:{"a2-w-full":true},label:{"a2-text-bm":true,"a2-fw-500":true}},Tabs:{container:{"a2-dsp-flexvert":true,"a2-gap-4":true},controls:{all:{"a2-px-4":true,"a2-py-2":true,"a2-text-bm":true,"a2-fw-500":true,"a2-cursor-pointer":true,"a2-transition-colors":true,"a2-br-t-2":true},selected:{"a2-bw-b-2":true,"a2-bc-p50":true,"a2-c-p50":true}},element:{"a2-dsp-flexhor":true,"a2-border-b":true,"a2-bc-n20":true}},Text:{all:{"a2-c-inherit":true},h1:{"a2-font-sans":true,"a2-fw-600":true,"a2-text-hs":true,"a2-m-0":true,"a2-p-0":true},h2:{"a2-font-sans":true,"a2-fw-600":true,"a2-text-tl":true,"a2-m-0":true,"a2-p-0":true},h3:{"a2-font-sans":true,"a2-fw-600":true,"a2-text-tm":true,"a2-m-0":true,"a2-p-0":true},h4:{"a2-font-sans":true,"a2-fw-500":true,"a2-text-bl":true,"a2-m-0":true,"a2-p-0":true},h5:{"a2-font-sans":true,"a2-fw-500":true,"a2-text-bm":true,"a2-m-0":true,"a2-p-0":true},h6:{"a2-font-sans":true,"a2-fw-500":true,"a2-text-bs":true,"a2-m-0":true,"a2-p-0":true},body:{"a2-font-sans":true,"a2-fw-400":true,"a2-text-bm":true,"a2-lh-relaxed":true},caption:{"a2-font-sans":true,"a2-fw-400":true,"a2-text-bs":true,"a2-text-muted-foreground":true},label:{"a2-font-sans":true,"a2-fw-500":true,"a2-text-bm":true}},TextField:{container:{"a2-dsp-flexhor":true,"a2-al-center":true,"a2-gap-2":true,"a2-w-full":true,"a2-text-bm":true,"a2-ws-nowrap":true},element:{"a2-text-bm":true,"a2-px-3":true,"a2-py-2":true,"a2-br-2":true,"a2-border":true,"a2-bc-n60":true,"a2-bgc-n0":true,"a2-c-n90":true,"a2-flex-1":true,"a2-transition-colors":true,"a2-focus-visible-ring":true},label:{"a2-flex-0":true,"a2-c-n70":true,"a2-fw-500":true}},Video:{"a2-br-2":true,"a2-media-cover":true}},elements:{a:{"a2-font-sans":true,"a2-fw-500":true,"a2-dsp-iflex":true,"a2-al-center":true,"a2-td-none":true,"a2-text-primary":true},audio:{"a2-w-full":true},body:{"a2-font-sans":true,"a2-fw-400":true,"a2-text-bm":true,"a2-mt-0":true,"a2-mb-2":true,"a2-text-foreground":true},button:{"a2-font-sans":true,"a2-fw-500":true,"a2-py-3":true,"a2-px-5":true,"a2-mb-1":true,"a2-br-2":true,"a2-bw-0":true,"a2-bs-solid":true,"a2-bg-primary":true,"a2-text-primary-foreground":true,"a2-ho-80":true},h1:{"a2-font-sans":true,"a2-fw-600":true,"a2-mt-0":true,"a2-mb-3":true,"a2-text-foreground":true},h2:{"a2-font-sans":true,"a2-fw-600":true,"a2-mt-0":true,"a2-mb-3":true,"a2-text-foreground":true},h3:{"a2-font-sans":true,"a2-fw-600":true,"a2-mt-0":true,"a2-mb-2":true,"a2-text-foreground":true},h4:{"a2-font-sans":true,"a2-fw-500":true,"a2-mt-0":true,"a2-mb-2":true,"a2-text-foreground":true},h5:{"a2-font-sans":true,"a2-fw-500":true,"a2-mt-0":true,"a2-mb-2":true,"a2-text-foreground":true},iframe:{"a2-scrollbar-none":true},input:{"a2-font-sans":true,"a2-fw-400":true,"a2-px-4":true,"a2-py-2":true,"a2-br-2":true,"a2-border":true,"a2-border-input":true,"a2-bs-solid":true,"a2-text-foreground":true},p:{"a2-font-sans":true,"a2-fw-400":true,"a2-m-0":true,"a2-text-bm":true,"a2-text-foreground":true},pre:{"a2-font-mono":true,"a2-fw-400":true,"a2-text-bm":true,"a2-ws-pre":true,"a2-text-foreground":true},textarea:{"a2-font-sans":true,"a2-fw-400":true,"a2-px-4":true,"a2-py-2":true,"a2-br-2":true,"a2-border":true,"a2-border-input":true,"a2-bs-solid":true,"a2-text-foreground":true,"a2-resize-y":true},video:{"a2-media-cover":true}},markdown:{p:["a2-md-p"],h1:["a2-md-h1"],h2:["a2-md-h2"],h3:["a2-md-h3"],h4:["a2-md-h4"],h5:["a2-md-h5"],ul:["a2-md-ul"],ol:["a2-md-ol"],li:["a2-md-li"],a:["a2-md-a"],strong:["a2-md-strong"],em:["a2-md-em"],code:["a2-md-code"],blockquote:["a2-md-blockquote"]}};function it(e,t){let o={...e};for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let a=o[n],r=t[n];typeof a=="object"&&a!==null&&typeof r=="object"&&r!==null&&!Array.isArray(a)&&!Array.isArray(r)?o[n]=it(a,r):o[n]=r;}return o}function lt(e){return it(D,e)}function dt(...e){let t={};for(let o of e)if(o)for(let[n,a]of Object.entries(o)){let r=n.split("-").slice(0,2).join("-")+"-",s=Object.keys(t).filter(i=>i.startsWith(r));for(let i of s)delete t[i];t[n]=a;}return t}function ct(){return JSON.parse(JSON.stringify(D))}var Bo={primary:"230 83% 60%",primaryForeground:"210 40% 98%",secondary:"210 40% 96%",secondaryForeground:"222 84% 5%",muted:"210 40% 96%",mutedForeground:"215 16% 47%",accent:"210 40% 96%",accentForeground:"222 84% 5%",destructive:"0 84% 60%",destructiveForeground:"210 40% 98%",background:"0 0% 100%",foreground:"222 84% 5%",card:"0 0% 100%",cardForeground:"222 84% 5%",popover:"0 0% 100%",popoverForeground:"222 84% 5%",border:"214 32% 91%",input:"214 32% 91%",ring:"230 83% 60%",success:"142 76% 36%",successForeground:"0 0% 98%",warning:"38 92% 50%",warningForeground:"0 0% 98%",info:"199 89% 48%",infoForeground:"0 0% 98%",radius:"0.5rem",radiusSm:"0.25rem",radiusLg:"0.75rem"},zo={primary:"230 85% 65%",primaryForeground:"0 0% 17%",secondary:"0 0% 22%",secondaryForeground:"0 0% 95%",muted:"0 0% 22%",mutedForeground:"0 0% 70%",accent:"0 0% 22%",accentForeground:"0 0% 95%",destructive:"0 63% 31%",destructiveForeground:"0 0% 95%",background:"0 0% 17%",foreground:"0 0% 95%",card:"0 0% 20%",cardForeground:"0 0% 95%",popover:"0 0% 17%",popoverForeground:"0 0% 95%",border:"0 0% 27%",input:"0 0% 30%",ring:"230 85% 65%",success:"142 70% 45%",warning:"38 92% 50%",info:"199 89% 48%",radius:"0.5rem",radiusSm:"0.25rem",radiusLg:"0.75rem"};function Lo(e,t=document.documentElement){let o={primary:"--a2-primary",primaryForeground:"--a2-primary-foreground",secondary:"--a2-secondary",secondaryForeground:"--a2-secondary-foreground",muted:"--a2-muted",mutedForeground:"--a2-muted-foreground",accent:"--a2-accent",accentForeground:"--a2-accent-foreground",destructive:"--a2-destructive",destructiveForeground:"--a2-destructive-foreground",background:"--a2-background",foreground:"--a2-foreground",card:"--a2-card",cardForeground:"--a2-card-foreground",popover:"--a2-popover",popoverForeground:"--a2-popover-foreground",border:"--a2-border",input:"--a2-input",ring:"--a2-ring",success:"--a2-success",successForeground:"--a2-success-foreground",warning:"--a2-warning",warningForeground:"--a2-warning-foreground",info:"--a2-info",infoForeground:"--a2-info-foreground",radius:"--a2-radius",radiusSm:"--a2-radius-sm",radiusLg:"--a2-radius-lg",fontSans:"--a2-font-sans",fontMono:"--a2-font-mono",shadowSm:"--a2-shadow-sm",shadow:"--a2-shadow",shadowMd:"--a2-shadow-md",shadowLg:"--a2-shadow-lg"};for(let[n,a]of Object.entries(e))if(a!==void 0){let r=o[n];r&&t.style.setProperty(r,a);}}function Oo(e,t=":root"){let o=[],n={primary:"--a2-primary",primaryForeground:"--a2-primary-foreground",secondary:"--a2-secondary",secondaryForeground:"--a2-secondary-foreground",muted:"--a2-muted",mutedForeground:"--a2-muted-foreground",accent:"--a2-accent",accentForeground:"--a2-accent-foreground",destructive:"--a2-destructive",destructiveForeground:"--a2-destructive-foreground",background:"--a2-background",foreground:"--a2-foreground",card:"--a2-card",cardForeground:"--a2-card-foreground",popover:"--a2-popover",popoverForeground:"--a2-popover-foreground",border:"--a2-border",input:"--a2-input",ring:"--a2-ring",success:"--a2-success",successForeground:"--a2-success-foreground",warning:"--a2-warning",warningForeground:"--a2-warning-foreground",info:"--a2-info",infoForeground:"--a2-info-foreground",radius:"--a2-radius",radiusSm:"--a2-radius-sm",radiusLg:"--a2-radius-lg",fontSans:"--a2-font-sans",fontMono:"--a2-font-mono",shadowSm:"--a2-shadow-sm",shadow:"--a2-shadow",shadowMd:"--a2-shadow-md",shadowLg:"--a2-shadow-lg"};for(let[a,r]of Object.entries(e))if(r!==void 0){let s=n[a];s&&o.push(` ${s}: ${r};`);}return `${t} {
|
|
1074
|
+
${o.join(`
|
|
1075
|
+
`)}
|
|
1076
|
+
}`}function M(...e){let t={};for(let o of e)if(o)for(let[n,a]of Object.entries(o)){let r=n.split("-"),s=r.length>=3?r.slice(0,2).join("-")+"-":n,i=Object.keys(t).filter(d=>d.startsWith(s));for(let d of i)delete t[d];t[n]=a;}return t}function pt(e,t,...o){let n=structuredClone(e);for(let a of o)for(let r of Object.keys(a)){let s=r.split("-").slice(0,2).join("-")+"-";for(let[i,d]of Object.entries(n)){if(t.includes(i))continue;let l=false;for(let u=0;u<d.length;u++)d[u]?.startsWith(s)&&(l=true,d[u]=r);l||d.push(r);}}return n}function ut(e){return Object.entries(e).filter(([,t])=>t).map(([t])=>t).join(" ")}function mt(e){let t={};for(let[o,n]of Object.entries(e)){let a=o.replace(/-([a-z])/g,(r,s)=>s.toUpperCase());t[a]=n;}return t}function ft(...e){let t=[];for(let o of e)if(o){if(typeof o=="string")t.push(o);else if(typeof o=="object")for(let[n,a]of Object.entries(o))a&&t.push(n);}return t.join(" ")}var kt={};$(kt,{Audio:()=>H,Button:()=>Y,Card:()=>q,Checkbox:()=>Q,Column:()=>G,ComponentRegistry:()=>F,ComponentRenderer:()=>w,DateTimeInput:()=>te,Divider:()=>X,Icon:()=>O,Image:()=>L,List:()=>W,Markdown:()=>Ge,Modal:()=>Z,MultipleChoice:()=>oe,Root:()=>E,Row:()=>K,Slider:()=>re,Surface:()=>Ke,Tabs:()=>J,Text:()=>z,TextField:()=>ee,Video:()=>_,cn:()=>p,componentRegistry:()=>V,extractNumberValue:()=>B,extractStringValue:()=>b,renderMarkdown:()=>We});var Ue=createContext(D);function Yo({theme:e=D,children:t}){return jsx(Ue.Provider,{value:e,children:t})}function m(){return useContext(Ue)}function b(e,t,o,n){if(e===null)return "";if(typeof e=="string")return e;if(typeof e=="object"&&"path"in e&&e.path){if(!o||!t)return console.warn("[A2UI] extractStringValue: no processor or component for path:",e.path),"(no model)";let a=o.getData(t,e.path,n??v.DEFAULT_SURFACE_ID);return a===null?(console.warn("[A2UI] extractStringValue: null value for path:",e.path),""):typeof a=="number"?String(a):typeof a!="string"?(console.warn("[A2UI] extractStringValue: non-string value for path:",e.path,typeof a),""):a}return ""}function B(e,t,o,n){if(e===null)return 0;if(typeof e=="number")return e;if(typeof e=="object"&&"path"in e&&e.path){if(!o||!t)return -1;let a=o.getData(t,e.path,n??v.DEFAULT_SURFACE_ID);return typeof a=="string"&&(a=Number.parseInt(a,10),Number.isNaN(a)&&(a=null)),a===null||typeof a!="number"?-1:a}return 0}function ht(e,t,o,n){if(e===null)return false;if(typeof e=="boolean")return e;if(typeof e=="object"&&"path"in e&&e.path){if(!o||!t)return false;let a=o.getData(t,e.path,n??v.DEFAULT_SURFACE_ID);return typeof a=="boolean"?a:typeof a=="string"?a.toLowerCase()==="true":false}return false}function p(...e){let t=[];for(let o of e)if(o){if(typeof o=="string")t.push(o);else if(typeof o=="object")for(let[n,a]of Object.entries(o))a&&t.push(n);}return t.join(" ")}function z({component:e,processor:t,surfaceId:o,text:n,usageHint:a="body",markdown:r=true}){let s=m(),i=b(n,e,t,o);if(!i)return jsx("span",{className:"a2-c-n50",children:"(empty)"});let l=(e.properties??{}).classes??[],u=M(s.components.Text.all,a?s.components.Text[a]:{},Object.fromEntries(l.map(c=>[c,true])));if(r){let c=()=>{switch(a){case "h1":return `# ${i}`;case "h2":return `## ${i}`;case "h3":return `### ${i}`;case "h4":return `#### ${i}`;case "h5":return `##### ${i}`;case "caption":return `*${i}*`;default:return i}};return jsx("section",{className:p(u),children:jsx(Nt,{components:{p:({children:f})=>jsx("p",{className:s.markdown.p.join(" "),children:f}),h1:({children:f})=>jsx("h1",{className:s.markdown.h1.join(" "),children:f}),h2:({children:f})=>jsx("h2",{className:s.markdown.h2.join(" "),children:f}),h3:({children:f})=>jsx("h3",{className:s.markdown.h3.join(" "),children:f}),h4:({children:f})=>jsx("h4",{className:s.markdown.h4.join(" "),children:f}),h5:({children:f})=>jsx("h5",{className:s.markdown.h5.join(" "),children:f}),ul:({children:f})=>jsx("ul",{className:s.markdown.ul.join(" "),children:f}),ol:({children:f})=>jsx("ol",{className:s.markdown.ol.join(" "),children:f}),li:({children:f})=>jsx("li",{className:s.markdown.li.join(" "),children:f}),a:({children:f,href:x})=>jsx("a",{href:x,className:s.markdown.a.join(" "),children:f}),strong:({children:f})=>jsx("strong",{className:s.markdown.strong.join(" "),children:f}),em:({children:f})=>jsx("em",{className:s.markdown.em.join(" "),children:f})},children:c()})})}switch(a){case "h1":return jsx("h1",{className:p(u),children:i});case "h2":return jsx("h2",{className:p(u),children:i});case "h3":return jsx("h3",{className:p(u),children:i});case "h4":return jsx("h4",{className:p(u),children:i});case "h5":return jsx("h5",{className:p(u),children:i});case "caption":return jsx("span",{className:p(u),children:i});default:return jsx("p",{className:p(u),children:i})}}function L({component:e,processor:t,surfaceId:o,url:n,usageHint:a,fit:r="cover"}){let s=m(),i=b(n,e,t,o);if(!i)return jsx("div",{className:"a2-c-n50",children:"(no image)"});let d=M(s.components.Image.all,a?s.components.Image[a]:{}),l={objectFit:r??"cover"};return jsx("img",{src:i,alt:"",className:p(d),style:l})}function O({component:e,processor:t,surfaceId:o,name:n,size:a=20,className:r,container:s,variant:i}){let d=m(),l=b(n,e,t,o);if(!l)return null;let u=l.split("-").map(Xe=>Xe.charAt(0).toUpperCase()+Xe.slice(1)).join(""),c=bt[u]??bt[l],f={blue:{backgroundColor:"oklch(95% 0.04 240)",color:"oklch(55% 0.15 240)"},green:{backgroundColor:"oklch(95% 0.04 160)",color:"oklch(55% 0.15 160)"},purple:{backgroundColor:"oklch(95% 0.04 285)",color:"oklch(55% 0.15 285)"},orange:{backgroundColor:"oklch(95% 0.04 60)",color:"oklch(55% 0.15 60)"},red:{backgroundColor:"oklch(95% 0.04 25)",color:"oklch(55% 0.15 25)"},primary:{backgroundColor:"light-dark(var(--p-5), var(--p-95))",color:"light-dark(var(--p-50), var(--p-40))"}},x=i?f[i]:f.primary,k=l==="loader-2"||l==="loader"?"a2-animate-spin":"",Je=()=>c?jsx(c,{size:a,className:p(d.components.Icon,k,r)}):jsx("span",{className:p(d.components.Icon,k,"material-icons",r),style:{fontSize:a},children:l});return s?jsx("div",{className:"a2-dsp-flex a2-flex-0 a2-al-center a2-jc-center a2-br-xl a2-transition",style:{width:40,height:40,...x},children:Je()}):Je()}function _({component:e,processor:t,surfaceId:o,url:n}){let a=m(),r=b(n,e,t,o);return r?jsx("section",{className:p(a.components.Video),children:jsx("video",{controls:true,src:r,className:"a2-w-full"})}):jsx("div",{className:"a2-c-n50",children:"(no video)"})}function H({component:e,processor:t,surfaceId:o,url:n,description:a}){let r=m(),s=b(n,e,t,o),i=a?b(a,e,t,o):void 0;return s?jsxs("section",{className:p(r.components.AudioPlayer),children:[i&&jsx("p",{className:"a2-mb-2 a2-text-bm",children:i}),jsx("audio",{controls:true,src:s,className:"a2-w-full"})]}):jsx("div",{className:"a2-c-n50",children:"(no audio)"})}function Y({component:e,action:t,children:o,onAction:n}){let a=m(),r=()=>{if(!t||!n)return;let s={eventType:"a2ui.action",action:t,dataContextPath:e.dataContextPath??"/",sourceComponentId:e.id,sourceComponent:e};n(s);};return jsx("button",{type:"button",className:p(a.components.Button),onClick:r,children:o})}var yt={start:"a2-al-start",center:"a2-al-center",end:"a2-al-end",stretch:"a2-al-stretch"},vt={start:"a2-jc-start",center:"a2-jc-center",end:"a2-jc-end",spaceBetween:"a2-jc-between",spaceAround:"a2-jc-around",spaceEvenly:"a2-jc-evenly"};function K({component:e,alignment:t="stretch",distribution:o="start",children:n}){let a=m(),r=yt[t]??yt.stretch,s=vt[o]??vt.start,d=(e.properties??{}).gap,l=d!==void 0?{gap:`${d*4}px`}:void 0;return jsx("section",{className:p(a.components.Row,r,s),style:l,children:n})}var Ct={start:"a2-al-start",center:"a2-al-center",end:"a2-al-end",stretch:"a2-al-stretch"},Rt={start:"a2-jc-start",center:"a2-jc-center",end:"a2-jc-end",spaceBetween:"a2-jc-between",spaceAround:"a2-jc-around",spaceEvenly:"a2-jc-evenly"};function G({component:e,alignment:t="stretch",distribution:o="start",children:n}){let a=m(),r=Ct[t]??Ct.stretch,s=Rt[o]??Rt.start,i=e.properties??{},d=i.classes??[],l=i.spaceY,u=l!==void 0?{gap:`${l*4}px`}:void 0;return jsx("section",{className:p(a.components.Column,r,s,...d),style:u,children:n})}function W({component:e,direction:t="vertical",columns:o=2,children:n}){let a=m(),s=(e?.properties??{}).columns??o,i,d,l=a.components.List;switch(t==="grid"&&typeof l=="object"&&(l=Object.fromEntries(Object.entries(l).filter(([u])=>!u.includes("flex")&&!u.includes("flexvert")&&!u.includes("flexhor")))),t){case "horizontal":i="a2-flex-row a2-overflow-x-auto";break;case "grid":i="a2-dsp-grid",d={gridTemplateColumns:`repeat(${s}, minmax(0, 1fr))`};break;default:i="a2-flex-col";}return jsx("section",{className:p(l,i),style:d,children:n})}function q({component:e,children:t}){let o=m(),n=e.properties??{},a=n.classes??[],r=n.padding,s=r!==void 0?{padding:`${r*.25}rem`}:void 0;return jsx("section",{className:p(o.components.Card,...a),style:s,children:t})}function J({component:e,processor:t,surfaceId:o,titles:n,children:a}){let r=m(),[s,i]=useState(0),d=()=>jsx("div",{className:p(r.components.Tabs.element),children:n.map((u,c)=>{let f=b(u,e,t,o),x=s===c?M(r.components.Tabs.controls.all,r.components.Tabs.controls.selected):{...r.components.Tabs.controls.all};return jsx("button",{disabled:s===c,className:p(x),onClick:()=>i(c),children:f},c)})}),l=a?.[s];return jsxs("section",{className:p(r.components.Tabs.container),children:[d(),jsx("div",{className:"a2-mt-4",children:l})]})}function X({axis:e="horizontal",thickness:t=1,color:o}){let n=m(),a={};o&&(a.borderColor=o),t&&(a.borderWidth=t);let r=e==="vertical"?"a2-border-l a2-h-full":"a2-border-t a2-w-full";return jsx("hr",{className:p(n.components.Divider,r),style:a})}function Z({entryPoint:e,content:t}){let o=m(),[n,a]=useState(false),r=useCallback(()=>{a(false);},[]);return useEffect(()=>{if(!n)return;let s=i=>{i.key==="Escape"&&r();};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[n,r]),n?jsx("dialog",{className:p(o.components.Modal.backdrop),open:true,role:"dialog","aria-modal":"true",onClick:s=>{s.target===s.currentTarget&&r();},children:jsxs("section",{className:p(o.components.Modal.element),children:[jsx("div",{className:"a2-mb-2 a2-dsp-flexhor a2-jc-end",children:jsx("button",{type:"button",className:"a2-br-2 a2-p-1 a2-ho-80 a2-transition-colors",onClick:r,"aria-label":"Close modal",children:"\u2715"})}),t]})}):jsx("button",{type:"button",onClick:()=>a(true),className:"a2-cursor-pointer",children:e})}function Q({component:e,processor:t,surfaceId:o,label:n,value:a}){let r=m(),s=b(n,e,t,o),i=ht(a,e,t,o),d=l=>{!a||!t||typeof a!="object"||!("path"in a)||!a.path||t.setData(e,a.path,l.target.checked,o??v.DEFAULT_SURFACE_ID);};return jsxs("section",{className:p(r.components.CheckBox.container),children:[jsx("input",{type:"checkbox",id:`checkbox-${e.id}`,className:p(r.components.CheckBox.element),checked:i,onChange:d}),jsx("label",{htmlFor:`checkbox-${e.id}`,className:p(r.components.CheckBox.label),children:s})]})}function ee({component:e,processor:t,surfaceId:o,label:n,text:a,usageHint:r="shortText"}){let s=m(),i=b(n,e,t,o),d=a?b(a,e,t,o):"",[l,u]=useState(d);useEffect(()=>{u(d);},[d]);let c=useCallback(P=>{let k=P.target.value;u(k),a&&t&&typeof a=="object"&&"path"in a&&a.path&&t.setData(e,a.path,k,o??v.DEFAULT_SURFACE_ID);},[a,t,e,o]),f=r==="number"?"number":r==="obscured"?"password":"text",x=r==="longText";return jsxs("section",{className:p(s.components.TextField.container),children:[i&&jsx("label",{htmlFor:`textfield-${e.id}`,className:p(s.components.TextField.label),children:i}),x?jsx("textarea",{id:`textfield-${e.id}`,className:p(s.components.TextField.element),value:l,onChange:c,placeholder:"Please enter a value",rows:4}):jsx("input",{id:`textfield-${e.id}`,type:f,className:p(s.components.TextField.element),value:l,onChange:c,placeholder:"Please enter a value",autoComplete:"off"})]})}function te({component:e,processor:t,surfaceId:o,value:n,enableDate:a=true,enableTime:r=true}){let s=m(),i=b(n,e,t,o),d=u=>{!n||!t||typeof n!="object"||!("path"in n)||!n.path||t.setData(e,n.path,u.target.value,o??v.DEFAULT_SURFACE_ID);},l="datetime-local";return a&&!r?l="date":!a&&r&&(l="time"),jsx("section",{className:p(s.components.DateTimeInput.container),children:jsx("input",{type:l,id:`datetime-${e.id}`,className:p(s.components.DateTimeInput.element),value:i,onChange:d})})}function oe({component:e,processor:t,surfaceId:o,value:n,options:a=[],label:r}){let s=m(),i=r?b(r,e,t,o):"Select an item",d=l=>{!n||!t||typeof n!="object"||!("path"in n)||!n.path||t.setData(e,n.path,[l.target.value],o??v.DEFAULT_SURFACE_ID);};return jsxs("section",{className:p(s.components.MultipleChoice.container),children:[jsx("label",{htmlFor:`multichoice-${e.id}`,className:p(s.components.MultipleChoice.label),children:i}),jsx("select",{id:`multichoice-${e.id}`,className:p(s.components.MultipleChoice.element),onChange:d,children:a?.map((l,u)=>{let c=b(l.label,e,t,o);return jsx("option",{value:l.value,children:c},u)})})]})}function re({component:e,processor:t,surfaceId:o,value:n,min:a=0,max:r=100}){let s=m(),i=B(n,e,t,o),d=l=>{!n||!t||typeof n!="object"||!("path"in n)||!n.path||t.setData(e,n.path,Number(l.target.value),o??v.DEFAULT_SURFACE_ID);};return jsxs("section",{className:p(s.components.Slider.container),children:[jsx("input",{type:"range",id:`slider-${e.id}`,className:p(s.components.Slider.element),value:i,min:a,max:r,onChange:d}),jsx("span",{className:p(s.components.Slider.label),children:i})]})}var F=class{constructor(){T(this,"registry",new Map);}register(t,o){if(!/^[a-zA-Z0-9]+$/.test(t))throw new Error(`[Registry] Invalid typeName '${t}'. Must be alphanumeric.`);this.registry.set(t,o);}get(t){return this.registry.get(t)}has(t){return this.registry.has(t)}unregister(t){return this.registry.delete(t)}getRegisteredTypes(){return Array.from(this.registry.keys())}},V=new F;function E({processor:e,surfaceId:t,childComponents:o,enableCustomElements:n=false,onAction:a}){return !o||!Array.isArray(o)?null:jsx(Fragment,{children:o.map(r=>jsx(w,{component:r,processor:e,surfaceId:t,enableCustomElements:n,onAction:a},r.id))})}function w({component:e,processor:t,surfaceId:o,enableCustomElements:n,onAction:a}){if(n){let r=V.get(e.type);if(r)return jsx(r,{component:e,processor:t,surfaceId:o,...e.properties},e.id)}switch(e.type){case "Text":{let r=e;return jsx(z,{component:r,processor:t,surfaceId:o,text:r.properties.text,usageHint:r.properties.usageHint},r.id)}case "Image":{let r=e;return jsx(L,{component:r,processor:t,surfaceId:o,url:r.properties.url,usageHint:r.properties.usageHint,fit:r.properties.fit},r.id)}case "Icon":{let r=e;return jsx(O,{component:r,processor:t,surfaceId:o,name:r.properties.name,container:r.properties.container,variant:r.properties.variant,size:r.properties.size},r.id)}case "Video":{let r=e;return jsx(_,{component:r,processor:t,surfaceId:o,url:r.properties.url},r.id)}case "AudioPlayer":{let r=e;return jsx(H,{component:r,processor:t,surfaceId:o,url:r.properties.url,description:r.properties.description},r.id)}case "Button":{let r=e;return jsx(Y,{component:r,processor:t,surfaceId:o,action:r.properties.action,onAction:a,children:r.properties.child&&jsx(w,{component:r.properties.child,processor:t,surfaceId:o,enableCustomElements:n,onAction:a})},r.id)}case "Row":{let r=e;return jsx(K,{component:r,processor:t,surfaceId:o,alignment:r.properties.alignment,distribution:r.properties.distribution,children:r.properties.children?.map(s=>jsx(w,{component:s,processor:t,surfaceId:o,enableCustomElements:n,onAction:a},s.id))},r.id)}case "Column":{let r=e;return jsx(G,{component:r,processor:t,surfaceId:o,alignment:r.properties.alignment,distribution:r.properties.distribution,children:r.properties.children?.map(s=>jsx(w,{component:s,processor:t,surfaceId:o,enableCustomElements:n,onAction:a},s.id))},r.id)}case "List":{let r=e;return jsx(W,{component:r,processor:t,surfaceId:o,direction:r.properties.direction,children:r.properties.children?.map(s=>jsx(w,{component:s,processor:t,surfaceId:o,enableCustomElements:n,onAction:a},s.id))},r.id)}case "Card":{let r=e,s=r.properties.children??(r.properties.child?[r.properties.child]:[]);return jsx(q,{component:r,processor:t,surfaceId:o,children:s.map(i=>jsx(w,{component:i,processor:t,surfaceId:o,enableCustomElements:n,onAction:a},i.id))},r.id)}case "Tabs":{let r=e,s=r.properties.tabItems?.map(d=>d.title)??[],i=r.properties.tabItems?.map(d=>jsx(w,{component:d.child,processor:t,surfaceId:o,enableCustomElements:n,onAction:a},d.child.id));return jsx(J,{component:r,processor:t,surfaceId:o,titles:s,children:i},r.id)}case "Divider":{let r=e;return jsx(X,{component:r,processor:t,surfaceId:o,axis:r.properties.axis,thickness:r.properties.thickness,color:r.properties.color},r.id)}case "Modal":{let r=e;return jsx(Z,{component:r,processor:t,surfaceId:o,entryPoint:jsx(w,{component:r.properties.entryPointChild,processor:t,surfaceId:o,enableCustomElements:n,onAction:a}),content:jsx(w,{component:r.properties.contentChild,processor:t,surfaceId:o,enableCustomElements:n,onAction:a})},r.id)}case "CheckBox":{let r=e;return jsx(Q,{component:r,processor:t,surfaceId:o,label:r.properties.label,value:r.properties.value},r.id)}case "TextField":{let r=e;return jsx(ee,{component:r,processor:t,surfaceId:o,label:r.properties.label,text:r.properties.text,usageHint:r.properties.usageHint,validationRegexp:r.properties.validationRegexp},r.id)}case "DateTimeInput":{let r=e;return jsx(te,{component:r,processor:t,surfaceId:o,value:r.properties.value,enableDate:r.properties.enableDate,enableTime:r.properties.enableTime},r.id)}case "MultipleChoice":{let r=e;return jsx(oe,{component:r,processor:t,surfaceId:o,value:r.properties.value,options:r.properties.options,label:r.properties.label,usageHint:r.properties.usageHint},r.id)}case "Slider":{let r=e;return jsx(re,{component:r,processor:t,surfaceId:o,value:r.properties.value,min:r.properties.min,max:r.properties.max,label:r.properties.label},r.id)}default:{if(n){let r=V.get(e.type);if(r)return jsx(r,{component:e,processor:t,surfaceId:o,...e.properties},e.id)}return jsxs("div",{className:"a2-br-2 a2-border a2-bc-e30 a2-p-2 a2-c-e50",children:["Unknown component type: ",e.type]},e.id)}}}function Ke({surfaceId:e,surface:t,processor:o,enableCustomElements:n=false,onAction:a,themeColors:r}){if(!t)return null;let s=()=>t.styles?.logoUrl?jsx("div",{className:"a2-mb-4 a2-dsp-flexhor a2-jc-center",children:jsx("img",{src:t.styles.logoUrl,alt:"Logo",className:"a2-w-50",style:{maxWidth:"220px"}})}):null,i=()=>jsx(E,{surfaceId:e,processor:o,childComponents:t.componentTree?[t.componentTree]:null,enableCustomElements:n,onAction:a}),d={paddingBottom:"80px",...r,...t.styles?.primaryColor&&!r?.["--p-50"]?{"--p-50":t.styles.primaryColor}:{}};return jsxs("div",{className:"a2ui-surface a2ui-root a2-dsp-flexvert a2-gap-8 a2-p-10",style:d,children:[s(),i()]})}function Ge({children:e,className:t}){let o=m();return jsx("div",{className:t,children:jsx(Nt,{components:{p:({children:n})=>jsx("p",{className:o.markdown.p.join(" "),children:n}),h1:({children:n})=>jsx("h1",{className:o.markdown.h1.join(" "),children:n}),h2:({children:n})=>jsx("h2",{className:o.markdown.h2.join(" "),children:n}),h3:({children:n})=>jsx("h3",{className:o.markdown.h3.join(" "),children:n}),h4:({children:n})=>jsx("h4",{className:o.markdown.h4.join(" "),children:n}),h5:({children:n})=>jsx("h5",{className:o.markdown.h5.join(" "),children:n}),ul:({children:n})=>jsx("ul",{className:o.markdown.ul.join(" "),children:n}),ol:({children:n})=>jsx("ol",{className:o.markdown.ol.join(" "),children:n}),li:({children:n})=>jsx("li",{className:o.markdown.li.join(" "),children:n}),a:({children:n,href:a})=>jsx("a",{href:a,className:o.markdown.a.join(" "),children:n}),strong:({children:n})=>jsx("strong",{className:o.markdown.strong.join(" "),children:n}),em:({children:n})=>jsx("em",{className:o.markdown.em.join(" "),children:n})},children:e})})}function We(e){return jsx(Nt,{children:e})}var Tt={};$(Tt,{DEFAULT_PATH_MAPPINGS:()=>DEFAULT_PATH_MAPPINGS,SURFACE_IDS:()=>SURFACE_IDS,audioPlayer:()=>audioPlayer,body:()=>body,button:()=>button,caption:()=>caption,card:()=>card,checkbox:()=>checkbox,choicePicker:()=>choicePicker,column:()=>column,createChatSurface:()=>createChatSurface,createInputFormSurface:()=>createInputFormSurface,createOrchestrationSurface:()=>createOrchestrationSurface,createRecommendationSurface:()=>createRecommendationSurface,createStatusSurface:()=>createStatusSurface,createSurface:()=>createSurface,createV09Messages:()=>createV09Messages,dateTimeInput:()=>dateTimeInput,deleteSurface:()=>deleteSurface,divider:()=>divider,flattenObjectToValueMap:()=>flattenObjectToValueMap,generateId:()=>generateId,h1:()=>h1,h2:()=>h2,h3:()=>h3,h4:()=>h4,h5:()=>h5,icon:()=>icon,image:()=>image,jsonlToMessages:()=>jsonlToMessages,list:()=>list,messagesToJsonl:()=>messagesToJsonl,modal:()=>modal,normalizePath:()=>normalizePath,objectToValueMap:()=>objectToValueMap,resetIdCounter:()=>resetIdCounter,row:()=>row,slider:()=>slider,tabs:()=>tabs,text:()=>text,textButton:()=>textButton,textField:()=>textField,updateComponents:()=>updateComponents,updateDataModel:()=>updateDataModel,updatesToValueMap:()=>updatesToValueMap,valueMapToObject:()=>valueMapToObject,valueToValueMap:()=>valueToValueMap,video:()=>video});var qe=createContext({processor:null,surfaceId:null});function yr({processor:e,surfaceId:t="@default",children:o}){return jsx(qe.Provider,{value:{processor:e,surfaceId:t},children:o})}function vr(){return useContext(qe)}var Pe=false;function wr(e){if(Pe)return;if(document.getElementById(e)){Pe=true;return}let t=document.createElement("style");t.id=e,t.textContent=A,document.head.appendChild(t),Pe=true;}function Sr(e){let t=document.getElementById(e);t&&(t.remove(),Pe=false);}var So="a2ui-structural-styles";function Ir({children:e,removeOnUnmount:t=false}){return useEffect(()=>(wr(So),()=>{t&&Sr(So);}),[t]),jsx(Fragment,{children:e})}function Nr(){return A}function kr(){let e=document.createElement("style");return e.textContent=A,e}export{E as A2UIRoot,ot as A2UI_EVENT_NAME,v as A2uiMessageProcessor,H as Audio,Tt as Builders,Y as Button,q as Card,Q as Checkbox,G as Column,F as ComponentRegistry,w as ComponentRenderer,tt as Data,te as DateTimeInput,X as Divider,rt as Events,O as Icon,L as Image,W as List,Ge as Markdown,Z as Modal,oe as MultipleChoice,qe as ProcessorContext,yr as ProcessorProvider,E as Root,K as Row,re as Slider,Ir as StyleProvider,gt as Styles,Ke as Surface,J as Tabs,z as Text,ee as TextField,Ue as ThemeContext,Yo as ThemeProvider,nt as Types,kt as UI,_ as Video,pt as appendToAll,ut as classesToString,ct as cloneDefaultTheme,p as cn,ft as cnStyles,V as componentRegistry,et as createMessageProcessor,kr as createStyleElement,lt as createTheme,D as defaultTheme,B as extractNumberValue,b as extractStringValue,st as getA2UIStyles,Nr as getStylesCSS,S as isAnyComponentNode,Fe as isBooleanValue,ae as isComponentArrayReference,$e as isNumberValue,g as isObject,ne as isPath,se as isResolvedAudioPlayer,ie as isResolvedButton,le as isResolvedCard,de as isResolvedCheckbox,ce as isResolvedColumn,pe as isResolvedDateTimeInput,ue as isResolvedDivider,fe as isResolvedIcon,me as isResolvedImage,ge as isResolvedList,he as isResolvedModal,xe as isResolvedMultipleChoice,be as isResolvedRow,ye as isResolvedSlider,Ve as isResolvedTabItem,ve as isResolvedTabs,Ce as isResolvedText,Re as isResolvedTextField,we as isResolvedVideo,I as isStringValue,Qe as isValueMap,M as merge,dt as mergeStyles,We as renderMarkdown,A as structuralStyles,mt as stylesToCSS,vr as useProcessor,m as useTheme};
|