@chatbi-v/xcml 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +13 -13
- package/dist/index.css +0 -190
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +14 -14
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
"use strict";var tn=Object.create;var je=Object.defineProperty;var rn=Object.getOwnPropertyDescriptor;var nn=Object.getOwnPropertyNames;var on=Object.getPrototypeOf,an=Object.prototype.hasOwnProperty;var sn=(t,e)=>{for(var r in e)je(t,r,{get:e[r],enumerable:!0})},Kt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of nn(e))!an.call(t,o)&&o!==r&&je(t,o,{get:()=>e[o],enumerable:!(n=rn(e,o))||n.enumerable});return t};var F=(t,e,r)=>(r=t!=null?tn(on(t)):{},Kt(e||!t||!t.__esModule?je(r,"default",{value:t,enumerable:!0}):r,t)),ln=t=>Kt(je({},"__esModule",{value:!0}),t);var lo={};sn(lo,{AntVChartLoader:()=>$e,COMMON_PROPS:()=>Ut,DefaultEmptyPlaceholder:()=>Et,DefaultErrorPlaceholder:()=>$t,ThemeProvider:()=>Ln,XCMLCardWrapper:()=>Oe,XCMLChart:()=>In,XCMLEventBus:()=>Qe,XCMLLayoutProvider:()=>wt,XCMLMarkdown:()=>nt,XCML_SCHEMAS:()=>fe,buildConfig:()=>Ot,chartSchema:()=>ge,cleanPropsBySchema:()=>_t,columnChartSchema:()=>Pe,columnStrategy:()=>Rt,createAntVRenderers:()=>jn,createBasicRenderers:()=>Jn,createExtendedRenderers:()=>so,createRenderersWithAliases:()=>me,deepMerge:()=>_e,dualAxesChartSchema:()=>Te,dualAxesStrategy:()=>Xt,extractBaseStyles:()=>dn,funnelChartSchema:()=>Xe,funnelStrategy:()=>Ft,getChartStrategy:()=>At,getTheme:()=>kt,lineChartSchema:()=>ke,lineStrategy:()=>Pt,mergePropsAndBody:()=>ht,normalizeNodeData:()=>ft,normalizeTagName:()=>et,parse:()=>tt.parse,parseArrayProp:()=>de,parseInlineData:()=>Zt,parseXCML:()=>hn,pieChartSchema:()=>Re,pieStrategy:()=>Tt,preprocessXCML:()=>bt,renderXCML:()=>mn,strategies:()=>hr,stringify:()=>tt.stringify,stringifyToXCML:()=>fn,themeDark:()=>dr,themeLight:()=>at,themeMap:()=>mr,toXCMLNodeFromElement:()=>be,toXCMLTag:()=>Fe,toXTag:()=>Yt,useTheme:()=>Ae,useXCMLComponent:()=>gt,useXCMLLayout:()=>St,useXCMLNode:()=>yt,validateDataSchema:()=>gn,validateXCMLNode:()=>pn,withXCMLCard:()=>w,xTagPlugin:()=>vn,xcmlBus:()=>he});module.exports=ln(lo);var Ze=require("yaml");var Be={tag:"x-metric",title:"\u6307\u6807\u5361\u7247",description:"\u7528\u4E8E\u5C55\u793A\u5355\u4E00\u6838\u5FC3\u6570\u503C\u53CA\u5176\u8D8B\u52BF\u6216\u5907\u6CE8\u4FE1\u606F\uFF0C\u652F\u6301\u591A\u79CD\u5E03\u5C40\u548C\u6837\u5F0F\u53D8\u4F53\u3002",props:[{name:"title",type:"string",description:"\u6307\u6807\u540D\u79F0/\u6807\u9898",category:"required",required:!0},{name:"variant",type:"enum",description:"\u5C55\u793A\u53D8\u4F53\u6837\u5F0F",category:"style",options:["card","plain","compact"],default:"card"},{name:"layout",type:"enum",description:"\u5E03\u5C40\u65B9\u5411",category:"layout",options:["horizontal","vertical"],default:"vertical"},{name:"icon",type:"string",description:"\u88C5\u9970\u56FE\u6807 (Emoji)",category:"style"},{name:"precision",type:"number",description:"\u6570\u503C\u4FDD\u7559\u5C0F\u6570\u4F4D\u6570",category:"style",default:0}],body:[{name:"value",type:"string",description:"\u6307\u6807\u6570\u503C",category:"required",required:!0},{name:"trend",type:"enum",description:"\u8D8B\u52BF\u65B9\u5411",category:"optional",options:["up","down","none"]},{name:"trendValue",type:"string",description:"\u8D8B\u52BF\u503C",category:"optional"},{name:"note",type:"string",description:"\u6307\u6807\u5907\u6CE8",category:"optional"},{name:"footer",type:"string",description:"\u5E95\u90E8\u8F85\u52A9\u4FE1\u606F",category:"optional"}],example:{props:{title:"\u6708\u5EA6\u51C0\u9500\u552E\u989D",variant:"card",layout:"vertical",precision:0,icon:"\u{1F4B0}"},body:{value:"1280000",trend:"up",trendValue:"+12.5%",note:"\u8F83\u4E0A\u6708\u589E\u957F 12.5%"},contentProp:"value"}};var De={tag:"xcml:table",title:"\u53EF\u89C6\u5316\u6570\u636E\u8868\u683C",description:"\u62A5\u8868\u7EA7\u6570\u636E\u8868\u683C\uFF0C\u652F\u6301\u8FDB\u5EA6\u6761\u3001\u8D8B\u52BF\u56FE\u7B49\u53EF\u89C6\u5316\u5217\u6E32\u67D3\uFF0C\u5168\u91CF\u5C55\u793A\u4E0D\u5206\u9875\u3002",props:[{name:"title",type:"string",description:"\u8868\u683C\u6807\u9898",category:"style"},{name:"bordered",type:"boolean",description:"\u662F\u5426\u663E\u793A\u8FB9\u6846",category:"style",default:!0},{name:"variant",type:"enum",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",category:"style",options:["card","plain"],default:"card"},{name:"size",type:"enum",description:"\u8868\u683C\u5C3A\u5BF8",category:"layout",options:["small","middle","large"],default:"middle"},{name:"summary",type:"boolean",description:"\u662F\u5426\u663E\u793A\u5408\u8BA1\u884C",category:"optional",default:!1}],body:[{name:"columns",type:"array",description:"\u5217\u5B9A\u4E49",category:"required",required:!0,items:[{name:"column",type:"object",description:"\u5217\u914D\u7F6E\u5BF9\u8C61",category:"required",properties:[{name:"title",type:"string",description:"\u5217\u6807\u9898",category:"required"},{name:"key",type:"string",description:"\u6570\u636E\u5B57\u6BB5\u952E\u540D",category:"required"},{name:"type",type:"enum",description:"\u6E32\u67D3\u7C7B\u578B",category:"style",options:["text","progress","trend","badge","image","link"]},{name:"align",type:"enum",description:"\u5BF9\u9F50\u65B9\u5F0F",category:"style",options:["left","center","right"]},{name:"width",type:"number",description:"\u5217\u5BBD",category:"layout"}]}]},{name:"rows",type:"array",description:"\u884C\u6570\u636E",category:"required",required:!0,items:[{name:"row",type:"object",description:"\u884C\u6570\u636E\u5BF9\u8C61",category:"required"}]}],example:{props:{title:"\u5404\u533A\u57DF\u9500\u552E\u8FBE\u6210\u62A5\u8868",bordered:!1,size:"middle",summary:!0},body:{columns:[{title:"\u533A\u57DF",key:"region",align:"left"},{title:"\u9500\u552E\u989D",key:"sales",align:"right",type:"text"},{title:"\u76EE\u6807\u8FBE\u6210\u7387",key:"rate",align:"center",type:"progress"},{title:"\u8FD1\u671F\u8D8B\u52BF",key:"trend",align:"center",type:"trend"},{title:"\u72B6\u6001",key:"status",align:"center",type:"badge"}],rows:[{region:"\u534E\u4E1C\u533A",sales:"\xA51,250,000",rate:.92,trend:[10,20,15,30,40],status:"normal"},{region:"\u534E\u5317\u533A",sales:"\xA5980,000",rate:.78,trend:[30,20,25,10,15],status:"warning"},{region:"\u534E\u5357\u533A",sales:"\xA51,560,000",rate:1.12,trend:[20,30,40,50,60],status:"success"},{region:"\u897F\u90E8\u533A",sales:"\xA5420,000",rate:.45,trend:[10,8,5,12,10],status:"error"}]}}};var We={tag:"xcml:list",title:"\u7F51\u683C/\u5217\u8868\u5E03\u5C40",description:"\u901A\u7528\u5E03\u5C40\u5BB9\u5668\uFF0C\u652F\u6301 Grid \u548C List \u4E24\u79CD\u6A21\u5F0F\uFF0C\u9002\u5408\u6392\u7248\u591A\u4E2A\u5361\u7247\u3002",props:[{name:"title",type:"string",description:"\u5217\u8868\u6807\u9898"},{name:"header",type:"string",description:"\u5217\u8868\u9875\u7709\u6587\u672C"},{name:"footer",type:"string",description:"\u5217\u8868\u9875\u811A\u6587\u672C"},{name:"layout",type:"enum",description:"\u5E03\u5C40\u6A21\u5F0F",options:["grid","list"],default:"grid"},{name:"columns",type:"number",description:"\u7F51\u683C\u5217\u6570 (Grid\u6A21\u5F0F\u6709\u6548)",default:3},{name:"gap",type:"number",description:"\u95F4\u8DDD",default:16},{name:"type",type:"enum",description:"\u5217\u8868\u9879\u9ED8\u8BA4\u7C7B\u578B",options:["text","metric"],default:"text"},{name:"stripe",type:"boolean",description:"\u662F\u5426\u5F00\u542F\u6591\u9A6C\u7EB9",default:!1}],body:[{name:"items",type:"array",description:"\u5217\u8868\u9879\u96C6\u5408",required:!0}],example:{props:{title:"\u7EDF\u8BA1\u6307\u6807",header:"\u6700\u8FD1\u4E00\u4E2A\u6708\u6570\u636E",footer:"\u6570\u636E\u6765\u6E90\uFF1A\u6570\u636E\u5E93",layout:"grid",columns:3,gap:16},body:{items:[{title:"\u7528\u6237\u589E\u957F",value:"+12%",type:"metric"},{title:"\u6D3B\u8DC3\u5EA6",value:"85%",type:"metric"},{title:"\u7559\u5B58\u7387",value:"42%",type:"metric"}]}}};var qe={tag:"xcml:card",title:"\u901A\u7528\u5361\u7247",description:"\u57FA\u7840\u5BB9\u5668\u5361\u7247\uFF0C\u652F\u6301\u6807\u9898\u3001\u63CF\u8FF0\u548C\u60AC\u6D6E\u6548\u679C\u3002",props:[{name:"title",type:"string",description:"\u5361\u7247\u6807\u9898",category:"optional"},{name:"type",type:"enum",description:"\u5361\u7247\u7C7B\u578B",category:"style",options:["inner","default"],default:"default"},{name:"hoverable",type:"boolean",description:"\u662F\u5426\u652F\u6301\u60AC\u505C\u6548\u679C",category:"interaction",default:!0},{name:"variant",type:"enum",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",category:"style",options:["card","plain"],default:"card"}],body:[{name:"description",type:"string",description:"\u5361\u7247\u63CF\u8FF0/\u6B63\u6587 (\u517C\u5BB9\u65E7\u5C5E\u6027)",category:"optional"},{name:"content",type:"string",description:"\u5361\u7247\u4E3B\u8981\u5185\u5BB9 (\u652F\u6301 Markdown)",category:"required",required:!0}],example:{props:{type:"default",hoverable:!0,variant:"card",title:"\u63D0\u793A\u4FE1\u606F",theme:"light"},body:{description:"\u8FD9\u662F\u4E00\u4E2A\u57FA\u7840\u5361\u7247\u793A\u4F8B",content:"\u8FD9\u662F\u4E00\u4E2A\u57FA\u7840\u5361\u7247\u5BB9\u5668\uFF0C\u53EF\u4EE5\u7528\u6765\u5305\u88F9\u7B80\u5355\u7684\u6587\u672C\u6216\u4F5C\u4E3A\u5176\u4ED6\u7EC4\u4EF6\u7684\u5360\u4F4D\u3002"},contentProp:"content"}};var ze={tag:"xcml:toc",title:"\u6587\u6863\u76EE\u5F55",description:"\u81EA\u52A8\u63D0\u53D6\u6587\u6863\u4E2D\u7684 H2-H6 \u6807\u9898\u751F\u6210\u53EF\u8DF3\u8F6C\u7684\u76EE\u5F55\u3002",props:[{name:"title",type:"string",description:"\u76EE\u5F55\u6807\u9898",default:"\u76EE\u5F55"}],example:{props:{title:"\u5185\u5BB9\u5927\u7EB2"}}};var ke={tag:"x-line-chart",title:"\u6298\u7EBF\u56FE",description:"\u7528\u4E8E\u5C55\u793A\u8FDE\u7EED\u65F6\u95F4\u8DE8\u5EA6\u4E0B\u7684\u6570\u636E\u8D8B\u52BF\u3002",props:[],body:[{name:"data",type:"array",description:"\u6298\u7EBF\u56FE\u6570\u636E",required:!0},{name:"xField",type:"string",description:"x\u8F74\u5B57\u6BB5",default:"category",required:!0},{name:"yField",type:"string",description:"y\u8F74\u5B57\u6BB5",default:"value",required:!0},{name:"seriesField",type:"string",description:"\u5206\u7EC4\u5B57\u6BB5",default:"type"}],example:{props:{title:"\u5404\u7C7B\u578B\u5546\u54C1\u9500\u552E\u8D8B\u52BF"},body:{title:"\u5404\u7C7B\u578B\u5546\u54C1\u9500\u552E\u8D8B\u52BF",xField:"category",yField:"value",seriesField:"type",data:[{category:"A",value:10,type:"T1"},{category:"B",value:20,type:"T1"}]}}};var Pe={tag:"x-column-chart",title:"\u67F1\u72B6\u56FE",description:"\u7528\u4E8E\u6BD4\u8F83\u4E0D\u540C\u5206\u7C7B\u4E4B\u95F4\u7684\u6570\u636E\u5DEE\u5F02\u3002",props:[],body:[{name:"xField",type:"string",description:"X\u8F74\u5B57\u6BB5 (\u5206\u7C7B)",category:"required",required:!0},{name:"yField",type:"string",description:"Y\u8F74\u5B57\u6BB5 (\u6570\u503C)",category:"required",required:!0},{name:"seriesField",type:"string",description:"\u7CFB\u5217\u5B57\u6BB5 (\u5206\u7EC4)",category:"optional"},{name:"colorField",type:"string",description:"\u989C\u8272\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"stack",type:"any",description:"\u662F\u5426\u5806\u53E0",category:"layout"},{name:"group",type:"any",description:"\u662F\u5426\u5206\u7EC4\u663E\u793A",category:"layout"},{name:"percent",type:"boolean",description:"\u662F\u5426\u767E\u5206\u6BD4\u5C55\u793A",category:"layout"},{name:"conversionTag",type:"object",description:"\u8F6C\u5316\u7387\u914D\u7F6E",category:"style"},{name:"markBackground",type:"object",description:"\u5143\u7D20\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6E90",category:"required",required:!0},{name:"title",type:"any",description:"\u56FE\u8868\u6807\u9898",category:"style",properties:[{name:"title",type:"string",description:"\u4E3B\u6807\u9898",category:"optional"},{name:"subtitle",type:"string",description:"\u526F\u6807\u9898",category:"optional"},{name:"align",type:"enum",description:"\u5BF9\u9F50\u65B9\u5F0F",category:"style",options:["left","center","right"]},{name:"titleFontSize",type:"number",description:"\u4E3B\u6807\u9898\u5B57\u53F7",category:"style"},{name:"titleFontWeight",type:"any",description:"\u4E3B\u6807\u9898\u5B57\u91CD",category:"style"},{name:"titleFill",type:"string",description:"\u4E3B\u6807\u9898\u989C\u8272",category:"style"}]},{name:"label",type:"any",description:"\u6807\u7B7E\u914D\u7F6E",category:"style",properties:[{name:"text",type:"string",description:"\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["top","bottom","inside","left","right"]},{name:"style",type:"object",description:"\u6837\u5F0F",category:"style"},{name:"background",type:"any",description:"\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"transform",type:"array",description:"\u5E03\u5C40\u53D8\u6362",category:"style"}]},{name:"axis",type:"object",description:"\u5750\u6807\u8F74\u914D\u7F6E",category:"style",properties:[{name:"x",type:"object",description:"X\u8F74\u914D\u7F6E",category:"style",properties:[{name:"title",type:"any",description:"\u8F74\u6807\u9898",category:"style"},{name:"line",type:"any",description:"\u8F74\u7EBF",category:"style"},{name:"tick",type:"any",description:"\u523B\u5EA6\u7EBF",category:"style"},{name:"label",type:"any",description:"\u523B\u5EA6\u503C",category:"style"},{name:"grid",type:"any",description:"\u7F51\u683C\u7EBF",category:"style"},{name:"labelFormatter",type:"any",description:"\u683C\u5F0F\u5316",category:"style"}]},{name:"y",type:"object",description:"Y\u8F74\u914D\u7F6E",category:"style",properties:[{name:"title",type:"any",description:"\u8F74\u6807\u9898",category:"style"},{name:"line",type:"any",description:"\u8F74\u7EBF",category:"style"},{name:"tick",type:"any",description:"\u523B\u5EA6\u7EBF",category:"style"},{name:"label",type:"any",description:"\u523B\u5EA6\u503C",category:"style"},{name:"grid",type:"any",description:"\u7F51\u683C\u7EBF",category:"style"},{name:"labelFormatter",type:"any",description:"\u683C\u5F0F\u5316",category:"style"}]}]},{name:"scale",type:"object",description:"\u6BD4\u4F8B\u5C3A\u914D\u7F6E",category:"style",properties:[{name:"type",type:"string",description:"\u7C7B\u578B",category:"style"},{name:"domain",type:"array",description:"\u5B9A\u4E49\u57DF",category:"style"},{name:"range",type:"array",description:"\u503C\u57DF",category:"style"},{name:"palette",type:"string",description:"\u8272\u677F",category:"style"}]},{name:"legend",type:"object",description:"\u56FE\u4F8B\u914D\u7F6E",category:"style"},{name:"tooltip",type:"object",description:"\u60AC\u6D6E\u63D0\u793A\u914D\u7F6E",category:"interaction"},{name:"style",type:"object",description:"\u56FE\u5F62\u6837\u5F0F\u914D\u7F6E",category:"style"},{name:"annotations",type:"array",description:"\u8F85\u52A9\u6807\u6CE8\u914D\u7F6E",category:"style"}],example:{props:{title:"\u5404\u533A\u57DF\u5E74\u5EA6\u9500\u552E\u5206\u6790"},body:{xField:"region",yField:"sales",seriesField:"year",stack:!0,label:{text:"sales",position:"inside"},data:[{region:"\u534E\u4E1C",year:"2022",sales:4500},{region:"\u534E\u4E1C",year:"2023",sales:5200},{region:"\u534E\u5317",year:"2022",sales:3800},{region:"\u534E\u5317",year:"2023",sales:4100},{region:"\u534E\u5357",year:"2022",sales:4200},{region:"\u534E\u5357",year:"2023",sales:4800}]}}};var Re={tag:"x-pie-chart",title:"\u997C\u56FE",description:"\u7528\u4E8E\u5C55\u793A\u5206\u7C7B\u6570\u636E\u7684\u5360\u6BD4\u60C5\u51B5\u3002",props:[],body:[{name:"colorField",type:"string",description:"\u5206\u7C7B\u5B57\u6BB5",category:"required",required:!0},{name:"angleField",type:"string",description:"\u6570\u503C\u5B57\u6BB5",category:"required",required:!0},{name:"radius",type:"number",description:"\u534A\u5F84",category:"layout"},{name:"innerRadius",type:"number",description:"\u5185\u534A\u5F84 (\u73AF\u56FE)",category:"layout"},{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6E90",category:"required",required:!0},{name:"title",type:"any",description:"\u56FE\u8868\u6807\u9898",category:"style",properties:[{name:"title",type:"string",description:"\u4E3B\u6807\u9898",category:"optional"},{name:"subtitle",type:"string",description:"\u526F\u6807\u9898",category:"optional"},{name:"align",type:"enum",description:"\u5BF9\u9F50\u65B9\u5F0F",category:"style",options:["left","center","right"]},{name:"titleFontSize",type:"number",description:"\u4E3B\u6807\u9898\u5B57\u53F7",category:"style"},{name:"titleFontWeight",type:"any",description:"\u4E3B\u6807\u9898\u5B57\u91CD",category:"style"},{name:"titleFill",type:"string",description:"\u4E3B\u6807\u9898\u989C\u8272",category:"style"}]},{name:"label",type:"any",description:"\u6807\u7B7E\u914D\u7F6E",category:"style",properties:[{name:"text",type:"string",description:"\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["outside","inside"]},{name:"style",type:"object",description:"\u6837\u5F0F",category:"style"},{name:"background",type:"any",description:"\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"connector",type:"any",description:"\u8FDE\u63A5\u7EBF\u914D\u7F6E",category:"style"},{name:"transform",type:"array",description:"\u5E03\u5C40\u53D8\u6362",category:"style"}]},{name:"legend",type:"object",description:"\u56FE\u4F8B\u914D\u7F6E",category:"style",properties:[{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]},{name:"title",type:"any",description:"\u6807\u9898",category:"style"},{name:"layout",type:"object",description:"\u5E03\u5C40",category:"style"},{name:"itemMarker",type:"any",description:"\u6807\u8BB0\u5F62\u72B6",category:"style"}]},{name:"scale",type:"object",description:"\u6BD4\u4F8B\u5C3A\u914D\u7F6E",category:"style",properties:[{name:"type",type:"string",description:"\u7C7B\u578B",category:"style"},{name:"domain",type:"array",description:"\u5B9A\u4E49\u57DF",category:"style"},{name:"range",type:"array",description:"\u503C\u57DF",category:"style"},{name:"palette",type:"string",description:"\u8272\u677F",category:"style"}]},{name:"tooltip",type:"object",description:"\u60AC\u6D6E\u63D0\u793A\u914D\u7F6E",category:"interaction"},{name:"style",type:"object",description:"\u56FE\u5F62\u6837\u5F0F\u914D\u7F6E",category:"style"},{name:"annotations",type:"array",description:"\u8F85\u52A9\u6807\u6CE8\u914D\u7F6E",category:"style"}],example:{props:{},body:{colorField:"type",angleField:"value",data:[{type:"A",value:40},{type:"B",value:60}]}}};var Te={tag:"x-dual-axes-chart",title:"\u53CC\u8F74\u56FE",description:"\u7528\u4E8E\u5728\u540C\u4E00\u56FE\u8868\u4E2D\u5C55\u793A\u4E24\u4E2A\u4E0D\u540C\u91CF\u7EB2\u7684\u6570\u636E\u7CFB\u5217\u3002",props:[],body:[{name:"xField",type:"string",description:"X\u8F74\u5B57\u6BB5",category:"required",required:!0},{name:"children",type:"array",description:"\u5B50\u56FE\u5C42\u914D\u7F6E\u6570\u7EC4",category:"required",required:!0,transform:(t,e)=>Array.isArray(t)?t.map(r=>{!r.xField&&e.xField&&(r.xField=e.xField);let n=r.xField||"x",o=r.scale||{},a=o[n]||{};return(r.type==="interval"||!a.type)&&(a.type="band"),{...r,scale:{...o,[n]:a}}}):t,items:[{name:"properties",type:"object",description:"\u5B50\u56FE\u5C42\u914D\u7F6E",category:"required",properties:[{name:"type",type:"enum",description:"\u56FE\u5C42\u7C7B\u578B",category:"required",options:["interval","line","area","point"],required:!0},{name:"yField",type:"string",description:"\u6570\u503C\u5B57\u6BB5",category:"required",required:!0},{name:"colorField",type:"string",description:"\u5206\u7EC4\u5B57\u6BB5",category:"optional"},{name:"seriesField",type:"string",description:"\u7CFB\u5217\u5B57\u6BB5 (\u522B\u540D)",category:"optional"},{name:"shapeField",type:"string",description:"\u5F62\u72B6\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"group",type:"boolean",description:"\u662F\u5426\u5206\u7EC4",category:"layout"},{name:"style",type:"object",description:"\u56FE\u5F62\u6837\u5F0F\u914D\u7F6E",category:"style"},{name:"interaction",type:"object",description:"\u4EA4\u4E92\u914D\u7F6E",category:"interaction"},{name:"data",type:"array",description:"\u5B50\u56FE\u5C42\u72EC\u7ACB\u6570\u636E\u6E90",category:"required"},{name:"axis",type:"object",description:"\u8BE5\u56FE\u5C42\u7684\u8F74\u914D\u7F6E",category:"style",properties:[{name:"y",type:"object",description:"Y\u8F74\u914D\u7F6E",category:"style"}]},{name:"label",type:"any",description:"\u6807\u7B7E\u914D\u7F6E",category:"style",properties:[{name:"text",type:"string",description:"\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["top","bottom","inside","left","right"]},{name:"style",type:"object",description:"\u6837\u5F0F",category:"style"},{name:"background",type:"any",description:"\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"transform",type:"array",description:"\u5E03\u5C40\u53D8\u6362",category:"style"}]},{name:"scale",type:"object",description:"\u6BD4\u4F8B\u5C3A\u914D\u7F6E",category:"style",properties:[{name:"type",type:"string",description:"\u7C7B\u578B",category:"style"},{name:"domain",type:"array",description:"\u5B9A\u4E49\u57DF",category:"style"},{name:"range",type:"array",description:"\u503C\u57DF",category:"style"},{name:"palette",type:"string",description:"\u8272\u677F",category:"style"}]}]}]},{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6E90",category:"required",required:!0},{name:"title",type:"any",description:"\u56FE\u8868\u6807\u9898",category:"style",properties:[{name:"title",type:"string",description:"\u4E3B\u6807\u9898",category:"optional"},{name:"subtitle",type:"string",description:"\u526F\u6807\u9898",category:"optional"},{name:"align",type:"enum",description:"\u5BF9\u9F50\u65B9\u5F0F",category:"style",options:["left","center","right"]},{name:"titleFontSize",type:"number",description:"\u4E3B\u6807\u9898\u5B57\u53F7",category:"style"},{name:"titleFontWeight",type:"any",description:"\u4E3B\u6807\u9898\u5B57\u91CD",category:"style"},{name:"titleFill",type:"string",description:"\u4E3B\u6807\u9898\u989C\u8272",category:"style"}]},{name:"label",type:"any",description:"\u6807\u7B7E\u914D\u7F6E",category:"style",properties:[{name:"text",type:"string",description:"\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["top","bottom","middle","left","right"]},{name:"style",type:"object",description:"\u6837\u5F0F",category:"style"},{name:"background",type:"any",description:"\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"transform",type:"array",description:"\u5E03\u5C40\u53D8\u6362",category:"style"}]},{name:"axis",type:"object",description:"\u5750\u6807\u8F74\u914D\u7F6E",category:"style",properties:[{name:"x",type:"object",description:"X\u8F74\u914D\u7F6E",category:"style",properties:[{name:"title",type:"any",description:"\u8F74\u6807\u9898",category:"style"},{name:"line",type:"any",description:"\u8F74\u7EBF",category:"style"},{name:"tick",type:"any",description:"\u523B\u5EA6\u7EBF",category:"style"},{name:"label",type:"any",description:"\u523B\u5EA6\u503C",category:"style"},{name:"grid",type:"any",description:"\u7F51\u683C\u7EBF",category:"style"},{name:"labelFormatter",type:"any",description:"\u683C\u5F0F\u5316",category:"style"}]},{name:"y",type:"object",description:"Y\u8F74\u914D\u7F6E",category:"style",properties:[{name:"title",type:"any",description:"\u8F74\u6807\u9898",category:"style"},{name:"line",type:"any",description:"\u8F74\u7EBF",category:"style"},{name:"tick",type:"any",description:"\u523B\u5EA6\u7EBF",category:"style"},{name:"label",type:"any",description:"\u523B\u5EA6\u503C",category:"style"},{name:"grid",type:"any",description:"\u7F51\u683C\u7EBF",category:"style"},{name:"labelFormatter",type:"any",description:"\u683C\u5F0F\u5316",category:"style"}]}]},{name:"scale",type:"object",description:"\u6BD4\u4F8B\u5C3A\u914D\u7F6E",category:"style",properties:[{name:"type",type:"string",description:"\u7C7B\u578B",category:"style"},{name:"domain",type:"array",description:"\u5B9A\u4E49\u57DF",category:"style"},{name:"range",type:"array",description:"\u503C\u57DF",category:"style"},{name:"palette",type:"string",description:"\u8272\u677F",category:"style"}]},{name:"legend",type:"object",description:"\u56FE\u4F8B\u914D\u7F6E",category:"style"},{name:"tooltip",type:"object",description:"\u60AC\u6D6E\u63D0\u793A\u914D\u7F6E",category:"interaction"},{name:"style",type:"object",description:"\u56FE\u5F62\u6837\u5F0F\u914D\u7F6E",category:"style"},{name:"annotations",type:"array",description:"\u8F85\u52A9\u6807\u6CE8\u914D\u7F6E",category:"style"}],example:{props:{xField:"month",children:[{type:"interval",yField:"sales",label:{position:"middle"}},{type:"line",yField:"rate",label:{position:"top"},style:{stroke:"#5AD8A6",lineWidth:2}}],axis:{y:[{title:{text:"\u9500\u552E\u989D"}},{title:{text:"\u5229\u6DA6\u7387"},position:"right"}]},data:[{month:"1\u6708",sales:450,rate:.12},{month:"2\u6708",sales:520,rate:.15},{month:"3\u6708",sales:480,rate:.14},{month:"4\u6708",sales:610,rate:.18},{month:"5\u6708",sales:580,rate:.16}]},body:{xField:"time",yField:["value","count"],data:[{time:"2021-01",value:10,count:5},{time:"2021-02",value:20,count:10}]}}};var Xe={tag:"x-funnel-chart",title:"\u6F0F\u6597\u56FE",description:"\u7528\u4E8E\u5C55\u793A\u4E1A\u52A1\u6D41\u7A0B\u4E2D\u5404\u9636\u6BB5\u7684\u6570\u636E\u8F6C\u5316\u60C5\u51B5\u3002",props:[],body:[{name:"data",type:"array",description:"\u6F0F\u6597\u56FE\u6570\u636E",required:!0},{name:"xField",type:"string",description:"\u7C7B\u522B\u5B57\u6BB5",default:"category",required:!0},{name:"yField",type:"string",description:"\u6570\u503C\u5B57\u6BB5",default:"value",required:!0}],example:{props:{},body:{xField:"category",yField:"value",data:[{category:"A",value:100},{category:"B",value:80}]}}};var Jt={line:ke,column:Pe,pie:Re,"dual-axes":Te,funnel:Xe};function Gt(t,e){let r=new Map;return Object.entries(t).forEach(([n,o])=>{(o[e]||[]).forEach(s=>{if(["type","data","xField","yField","colorField","seriesField","title","label","axis","legend","tooltip","scale","interaction","theme"].includes(s.name))return;let d=r.get(s.name);d?d.types.push(n):r.set(s.name,{def:s,types:[n]})})}),Array.from(r.values()).map(({def:n,types:o})=>({...n,visibleIf:a=>o.includes(a.type)?n.visibleIf?n.visibleIf(a):!0:!1}))}var ge={tag:"xcml:chart",title:"AntV \u901A\u7528\u56FE\u8868",description:"\u5168\u529F\u80FD\u56FE\u8868\u7EC4\u4EF6\u5BB9\u5668\uFF0C\u652F\u6301\u901A\u8FC7 type \u52A8\u6001\u5207\u6362\u6298\u7EBF\u56FE\u3001\u67F1\u72B6\u56FE\u3001\u997C\u56FE\u7B49\u3002",props:[{name:"type",type:"enum",description:"\u56FE\u8868\u7C7B\u578B",category:"required",required:!0,options:["line","column","pie","dual-axes","funnel"],default:"line"},...Gt(Jt,"props")],body:[{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6E90",category:"required",required:!0},{name:"xField",type:"string",description:"X\u8F74\u5B57\u6BB5",category:"required",required:!0},{name:"yField",type:"string",description:"Y\u8F74\u5B57\u6BB5",category:"required",required:!0},{name:"colorField",type:"string",description:"\u989C\u8272/\u5206\u7EC4\u5B57\u6BB5",category:"optional"},{name:"seriesField",type:"string",description:"\u7CFB\u5217\u5B57\u6BB5",category:"optional"},{name:"title",type:"object",description:"\u56FE\u8868\u6807\u9898",category:"style"},{name:"label",type:"object",description:"\u6570\u636E\u6807\u7B7E",category:"style"},{name:"axis",type:"object",description:"\u5750\u6807\u8F74\u914D\u7F6E",category:"style"},{name:"legend",type:"object",description:"\u56FE\u4F8B\u914D\u7F6E",category:"style"},{name:"tooltip",type:"object",description:"\u63D0\u793A\u4FE1\u606F",category:"interaction"},{name:"scale",type:"object",description:"\u5EA6\u91CF\u914D\u7F6E",category:"optional"},{name:"interaction",type:"object",description:"\u4EA4\u4E92\u914D\u7F6E",category:"interaction"},{name:"theme",type:"string",description:"\u56FE\u8868\u4E3B\u9898",category:"style"},...Gt(Jt,"body")],example:{props:{type:"line",theme:"light"},body:{xField:"year",yField:"value",seriesField:"category",data:[{year:"1991",value:3,category:"A"},{year:"1992",value:4,category:"A"},{year:"1993",value:3.5,category:"A"},{year:"1994",value:5,category:"A"},{year:"1995",value:4.9,category:"A"},{year:"1996",value:6,category:"A"},{year:"1997",value:7,category:"A"},{year:"1998",value:9,category:"A"},{year:"1999",value:13,category:"A"},{year:"1991",value:3,category:"B"},{year:"1992",value:4,category:"B"},{year:"1993",value:3.5,category:"B"},{year:"1994",value:5,category:"B"},{year:"1995",value:4.9,category:"B"},{year:"1996",value:6,category:"B"},{year:"1997",value:7,category:"B"},{year:"1998",value:9,category:"B"},{year:"1999",value:13,category:"B"}]}}};var Ve={tag:"xcml:insight-card",title:"\u6D1E\u5BDF\u5361\u7247 (Pro)",description:"\u5168\u91CF\u5C55\u793A\u7684\u6D1E\u5BDF\u5361\u7247\uFF0C\u652F\u6301\u5F15\u7528\u6765\u6E90\u4E0E\u884C\u52A8\u5EFA\u8BAE\u3002",props:[{name:"title",type:"string",description:"\u6D1E\u5BDF\u6807\u9898"},{name:"sentiment",type:"enum",description:"\u60C5\u611F\u503E\u5411",options:["positive","negative","neutral","insight","warning","success","error"],default:"insight"},{name:"icon",type:"string",description:"\u56FE\u6807 (Emoji \u6216 AntD Icon \u540D\u79F0)"},{name:"variant",type:"string",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",default:"card"}],body:[{name:"actions",type:"array",description:"\u5EFA\u8BAE\u884C\u52A8\u5217\u8868"},{name:"citations",type:"array",description:"\u5F15\u7528\u6765\u6E90\u5217\u8868"},{name:"highlights",type:"array",description:"\u9700\u8981\u9AD8\u4EAE\u7684\u5173\u952E\u8BCD\u5217\u8868"},{name:"content",type:"string",description:"\u6D1E\u5BDF\u6B63\u6587\u5185\u5BB9 (\u652F\u6301\u4ECE Body \u4F20\u5165)"}],example:{props:{title:"\u5E93\u5B58\u9884\u8B66\uFF1A\u70ED\u95E8\u5546\u54C1\u7F3A\u8D27\u98CE\u9669",sentiment:"warning"},body:{highlights:["3 \u5929\u5185\u552E\u7F44","\u7ACB\u5373\u542F\u52A8\u8865\u8D27"],citations:["\u5E93\u5B58\u7BA1\u7406\u7CFB\u7EDF","\u9500\u552E\u9884\u6D4B\u6A21\u578B"],actions:["\u751F\u6210\u8865\u8D27\u5355","\u6682\u505C\u5E7F\u544A\u6295\u653E"],content:"\u6839\u636E\u5F53\u524D\u9500\u552E\u901F\u7387\uFF0CiPhone 15 Pro Max \u5C06\u5728 3 \u5929\u5185\u552E\u7F44\u3002\u5EFA\u8BAE\u7ACB\u5373\u542F\u52A8\u8865\u8D27\u6D41\u7A0B\uFF0C\u5E76\u8C03\u6574\u5E7F\u544A\u6295\u653E\u7B56\u7565\u4EE5\u907F\u514D\u8D85\u5356\u3002"},contentProp:"content"}};var He={tag:"xcml:interactive-summary",title:"\u4EA4\u4E92\u5F0F\u6C47\u603B",description:"\u5E26\u64CD\u4F5C\u6309\u94AE\u7684\u6570\u503C\u6C47\u603B\u5361\u7247\uFF0C\u652F\u6301\u5B9E\u65F6\u8C03\u6574\u6570\u503C\u5E76\u89E6\u53D1\u4E1A\u52A1\u56DE\u8C03\u3002",props:[{name:"label",type:"string",description:"\u6307\u6807\u540D\u79F0",default:"\u8C03\u6574\u76EE\u6807"},{name:"value",type:"number",description:"\u521D\u59CB\u6570\u503C",default:0},{name:"step",type:"number",description:"\u8C03\u6574\u6B65\u957F",default:1},{name:"unit",type:"string",description:"\u6570\u503C\u5355\u4F4D"},{name:"actionId",type:"string",description:"\u89E6\u53D1\u56DE\u8C03\u7684\u4E8B\u4EF6 ID",default:"update_target"},{name:"variant",type:"string",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",default:"card"}],body:[{name:"content",type:"string",description:"\u6C47\u603B\u6587\u672C\u5185\u5BB9 (\u652F\u6301\u4ECE Body \u4F20\u5165)"},{name:"highlightKeywords",type:"array",description:"\u6587\u672C\u4E2D\u9700\u8981\u9AD8\u4EAE\u7684\u5173\u952E\u8BCD\u6570\u7EC4"},{name:"trendData",type:"array",itemType:"number",description:"\u80CC\u666F\u8D8B\u52BF\u56FE\u6570\u636E"}],example:{props:{label:"\u5B63\u5EA6\u9500\u552E\u76EE\u6807",value:5e3,unit:"k",step:100,actionId:"set_sales_target"},body:{trendData:[10,20,15,30,40,35,50],content:"\u6839\u636E\u5F53\u524D\u4E1A\u52A1\u589E\u957F\uFF0C\u5EFA\u8BAE\u5C06\u76EE\u6807\u8BBE\u5B9A\u5728 5000k \u4EE5\u4E0A\u3002"},contentProp:"content"}};var Ke={tag:"x-metric-card",title:"\u590D\u5408\u6307\u6807\u5361",description:"\u589E\u5F3A\u578B\u6307\u6807\u5C55\u793A\uFF0C\u652F\u6301\u6570\u503C\u52A8\u753B\u3001\u5355\u4F4D\u3001\u524D\u7F00\u4EE5\u53CA\u540C\u6BD4/\u73AF\u6BD4\u8D8B\u52BF\u3002",props:[{name:"title",type:"string",description:"\u5361\u7247\u6807\u9898"},{name:"label",type:"string",description:"\u6307\u6807\u540D\u79F0 (title \u7684\u522B\u540D)"},{name:"unit",type:"string",description:"\u6570\u503C\u5355\u4F4D"},{name:"prefix",type:"string",description:"\u6570\u503C\u524D\u7F00"},{name:"footer",type:"string",description:"\u5E95\u90E8\u8F85\u52A9\u4FE1\u606F"},{name:"precision",type:"number",description:"\u4FDD\u7559\u5C0F\u6570\u4F4D\u6570",default:2},{name:"variant",type:"string",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",default:"card"}],body:[{name:"value",type:"number",description:"\u6838\u5FC3\u6570\u503C",required:!0},{name:"wow",type:"number",description:"\u73AF\u6BD4\u589E\u957F\u7387 (%)"},{name:"yoy",type:"number",description:"\u540C\u6BD4\u589E\u957F\u7387 (%)"}],example:{props:{label:"\u6D3B\u8DC3\u7528\u6237",unit:"\u4EBA"},body:{value:84200,wow:12.5},contentProp:"value"}};var Je={tag:"xcml:mini-kpi-strip",title:"\u8FF7\u4F60\u6307\u6807\u6761",description:"\u7D27\u51D1\u7684\u6A2A\u5411\u6307\u6807\u6392\u5217\uFF0C\u652F\u6301\u8FF7\u4F60\u8D8B\u52BF\u56FE\uFF08Sparkline\uFF09\u548C\u73AF\u6BD4\u5C55\u793A\u3002",props:[],body:[{name:"items",type:"array",description:"\u6307\u6807\u9879\u5217\u8868",items:[{name:"label",type:"string",description:"\u6307\u6807\u540D\u79F0",required:!0},{name:"value",type:"string",description:"\u6307\u6807\u5F53\u524D\u6570\u503C",required:!0},{name:"wow",type:"number",description:"\u73AF\u6BD4\u589E\u957F\u7387 (%)"},{name:"trendData",type:"array",itemType:"number",description:"\u8FF7\u4F60\u8D8B\u52BF\u56FE\u6570\u636E\u70B9\u6570\u7EC4"}]}],example:{body:{items:[{label:"\u8425\u6536",value:"\xA51.2M",wow:12,trendData:[10,20,15,30,40]},{label:"\u7528\u6237",value:"85.2K",wow:-5,trendData:[50,40,45,35,30]},{label:"\u8F6C\u5316\u7387",value:"3.2%",wow:2,trendData:[2,3,2.5,3.1,3.2]},{label:"\u6D3B\u8DC3\u5EA6",value:"92%",wow:0,trendData:[90,91,92,90,92]}]}}};var Ge={tag:"xcml:poster-card",title:"\u6570\u636E\u6D77\u62A5",description:"\u7F8E\u89C2\u7684\u6570\u636E\u53EF\u89C6\u5316\u6D77\u62A5\uFF0C\u652F\u6301\u591A\u79CD\u56FE\u8868\u7EC4\u5408\u3001\u4E8C\u7EF4\u7801\u5C55\u793A\u53CA\u4E00\u952E\u4E0B\u8F7D\u56FE\u7247\u3002",props:[{name:"title",type:"string",description:"\u6D77\u62A5\u6807\u9898",default:"\u6570\u636E\u6D77\u62A5"},{name:"subTitle",type:"string",description:"\u6D77\u62A5\u526F\u6807\u9898",default:"Data Insight Poster"},{name:"themeColor",type:"string",description:"\u6D77\u62A5\u4E3B\u9898\u8272"},{name:"backgroundImage",type:"string",description:"\u80CC\u666F\u56FE\u7247 URL"},{name:"qrCode",type:"string",description:"\u4E8C\u7EF4\u7801\u5185\u5BB9",default:"https://ant.design"},{name:"author",type:"string",description:"\u4F5C\u8005",default:"ChatBI"},{name:"date",type:"string",description:"\u65E5\u671F"},{name:"variant",type:"string",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",default:"card"}],body:[{name:"charts",type:"array",description:"\u5305\u542B\u5728\u6D77\u62A5\u4E2D\u7684\u56FE\u8868\u5217\u8868",items:[{name:"type",type:"enum",description:"\u56FE\u8868\u7C7B\u578B",options:["column","line","pie"],required:!0},{name:"title",type:"string",description:"\u56FE\u8868\u6807\u9898"},{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6570\u7EC4",required:!0,items:[{name:"label",type:"string",description:"\u7EF4\u5EA6\u540D\u79F0",required:!0},{name:"value",type:"number",description:"\u6307\u6807\u6570\u503C",required:!0}]}]}],example:{props:{title:"\u53CC\u5341\u4E00\u9500\u552E\u6218\u62A5",subTitle:"2023 \u6838\u5FC3\u6307\u6807\u56DE\u987E",author:"\u6570\u636E\u5206\u6790\u56E2\u961F"},body:{charts:[{type:"pie",title:"\u5404\u6E20\u9053\u5360\u6BD4",data:[{label:"\u76F4\u64AD",value:45},{label:"\u641C\u7D22",value:30},{label:"\u5176\u4ED6",value:25}]},{type:"column",title:"\u8FD1 7 \u65E5\u8D8B\u52BF",data:[{label:"11.01",value:120},{label:"11.02",value:150},{label:"11.03",value:200}]}]}}};var Ue={tag:"xcml:snapshot-table",title:"\u5FEB\u7167\u8868\u683C",description:"\u8F7B\u91CF\u7EA7\u6570\u636E\u5FEB\u7167\uFF0C\u652F\u6301 CSV \u5BFC\u51FA\u548C\u6EDA\u52A8\u67E5\u770B\u3002",props:[{name:"title",type:"string",description:"\u8868\u683C\u6807\u9898\u3002\u6CE8\u610F\uFF1A\u5982\u679C SnapshotTable \u88AB\u5305\u88F9\u5728 Card \u4E2D\u4E14 Card \u5DF2\u8BBE\u7F6E\u6807\u9898\uFF0C\u6B64\u6807\u9898\u5C06\u81EA\u52A8\u9690\u85CF\u4EE5\u907F\u514D\u91CD\u590D\u3002"},{name:"description",type:"string",description:"\u8868\u683C\u63CF\u8FF0\uFF0C\u5C55\u793A\u5728\u6807\u9898\u4E0B\u65B9\u6216\u7EC4\u4EF6\u9876\u90E8\u3002"},{name:"bordered",type:"boolean",description:"\u662F\u5426\u663E\u793A\u8868\u683C\u5185\u90E8\u8FB9\u6846",default:!0}],body:[{name:"columns",type:"array",description:"\u8868\u683C\u5217\u5B9A\u4E49",items:[{name:"title",type:"string",description:"\u5217\u6807\u9898",required:!0},{name:"key",type:"string",description:"\u6570\u636E\u5BF9\u5E94\u5B57\u6BB5",required:!0},{name:"width",type:"number",description:"\u5217\u5BBD"},{name:"align",type:"enum",description:"\u5BF9\u9F50\u65B9\u5F0F",options:["left","center","right"]}]},{name:"rows",type:"array",description:"\u8868\u683C\u884C\u6570\u636E",items:[{name:"properties",type:"object",description:"\u884C\u6570\u636E\u5BF9\u8C61\uFF0C\u952E\u503C\u9700\u5BF9\u5E94 columns \u4E2D\u7684 key"}]}],example:{props:{title:"\u5B9E\u65F6\u5E93\u5B58\u5FEB\u7167"},body:{columns:[{title:"\u5546\u54C1\u540D",key:"name"},{title:"\u5E93\u5B58\u91CF",key:"stock"},{title:"\u9884\u8B66\u7EBF",key:"threshold"}],rows:[{name:"iPhone 15",stock:120,threshold:50},{name:"iPad Air",stock:45,threshold:30},{name:"MacBook Pro",stock:12,threshold:20}]}}};var Ye={tag:"xcml:thought-chain",title:"\u601D\u7EF4\u94FE (Timeline)",description:"\u5168\u5C55\u5F00\u7684\u65F6\u95F4\u8F74\u5F0F\u601D\u7EF4\u94FE\uFF0C\u5C55\u793A\u6267\u884C\u8017\u65F6\u4E0E\u8BE6\u7EC6\u7ED3\u679C\u3002",props:[{name:"title",type:"string",description:"\u601D\u7EF4\u94FE\u6807\u9898",default:"\u5206\u6790\u8FC7\u7A0B"},{name:"variant",type:"string",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",default:"card"}],body:[{name:"steps",type:"array",description:"\u6267\u884C\u6B65\u9AA4\u5217\u8868",items:[{name:"tool",type:"string",description:"\u4F7F\u7528\u7684\u5DE5\u5177\u540D\u79F0"},{name:"action",type:"string",description:"\u6267\u884C\u7684\u64CD\u4F5C\u63CF\u8FF0"},{name:"status",type:"enum",description:"\u6267\u884C\u72B6\u6001",options:["success","running","pending","error"]},{name:"duration",type:"string",description:"\u8017\u65F6\u63CF\u8FF0"},{name:"thought",type:"string",description:"\u601D\u8003\u8FC7\u7A0B/\u65E5\u5FD7"},{name:"result",type:"string",description:"\u6267\u884C\u7ED3\u679C\u6458\u8981"},{name:"error",type:"string",description:"\u9519\u8BEF\u4FE1\u606F"}]}],example:{props:{title:"\u667A\u80FD\u5206\u6790\u6267\u884C\u8DEF\u5F84"},body:{steps:[{tool:"SQL Generator",action:"\u751F\u6210\u67E5\u8BE2\u8BED\u53E5",duration:"120ms",status:"success",thought:"\u6839\u636E\u7528\u6237\u610F\u56FE\uFF0C\u9700\u8981\u67E5\u8BE2 2023 \u5E74\u540E\u7684\u9500\u552E\u6570\u636E\u3002",result:'SELECT * FROM sales WHERE date > "2023-01-01"'},{tool:"Data Query",action:"\u6267\u884C\u6570\u636E\u5E93\u67E5\u8BE2",duration:"1.2s",status:"success",thought:"\u6B63\u5728\u8FDE\u63A5\u751F\u4EA7\u5E93\u6267\u884C\u67E5\u8BE2...",result:"Total rows: 1250"},{tool:"Analysis",action:"\u8BA1\u7B97\u540C\u6BD4\u589E\u957F\u7387",duration:"45ms",status:"success",thought:"\u5BF9\u6BD4\u53BB\u5E74\u540C\u671F\u6570\u636E\u8FDB\u884C\u8BA1\u7B97\u3002",result:"YoY Growth: +15.2%"}]}}};var Ut=[{name:"theme",type:"enum",description:"\u7EC4\u4EF6\u89C6\u89C9\u4E3B\u9898\u98CE\u683C",category:"style",options:["light","dark","ocean","sunset","lavender","rose","amber","midnight","forest","slate","crimson","cyber"],default:void 0}],cn={"xcml:metric":Be,"xcml:table":De,"xcml:chart":ge,"xcml:list":We,"xcml:thought-chain":Ye,"xcml:insight-card":Ve,"xcml:metric-card":Ke,"xcml:card":qe,"xcml:toc":ze,"xcml:poster-card":Ge,"xcml:mini-kpi-strip":Je,"xcml:interactive-summary":He,"xcml:snapshot-table":Ue},fe=Object.fromEntries(Object.entries(cn).map(([t,e])=>[t,{...e,props:[...e.props||[],...Ut]}]));var tt=require("yaml");function dn(t){let{theme:e,variant:r,size:n,className:o,style:a}=t;return{theme:e,variant:r,size:n,className:o,style:a}}function yt(t,e){let r=t.props||{},n=t.body!==void 0?t.body:t.data,o=(t.props||{})["data-xcml-raw"];if(o)try{n=decodeURIComponent(escape(atob(o)))}catch(l){console.warn("[XCML] Failed to decode data-xcml-raw:",l)}if(typeof n=="string"){let l=n.trim();if(l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]"))try{n=JSON.parse(l)}catch{}}let a={};if(e&&((e.props||[]).forEach(l=>{l.default!==void 0&&(a[l.name]=l.default)}),(e.body||[]).forEach(l=>{l.default!==void 0&&(a[l.name]=l.default)})),n!=null)if(typeof n=="object"&&!Array.isArray(n))Object.assign(a,n),Array.isArray(n.data)&&(a.data=n.data);else if(Array.isArray(n)){let l=(e?.body||[]).find(d=>d.type==="array")?.name||"data";a[l]=n}else{let l=e?.example?.contentProp||(e?.body||[]).find(d=>d.name==="content"||d.name==="value")?.name||"content";a[l]=n}return Object.assign(a,r),["theme","variant","layout","size"].forEach(l=>{a[l]===void 0&&r[l]!==void 0&&(a[l]=r[l])}),a}var de=t=>{if(Array.isArray(t))return t;if(typeof t=="string"){let e=t.trim();if(!e)return[];if(e.startsWith("["))try{return JSON.parse(e)}catch{try{return JSON.parse(e.replace(/'/g,'"'))}catch{}}return e.split(/[,,]/).map(r=>r.trim()).filter(Boolean)}return[]};function me(t,e={}){let r={};return Object.entries(t).forEach(([n,o])=>{r[`xcml:${n}`]=o,e[n]&&e[n].forEach(a=>{r[`xcml:${a}`]=o})}),r}var mn=(t,e="xcml-node")=>{if(!t||!t.type||!fe[t.type])return null;let o=(globalThis.__XCML_RENDERERS__||{})[t.type];return o?o(t,e):null};function pn(t,e){let r=[],n=t.props||{};if(e.props.forEach(o=>{o.required&&(n[o.name]===void 0||n[o.name]===null||n[o.name]==="")&&r.push(`\u5C5E\u6027 '${o.name}' (${o.description}) \u662F\u5FC5\u586B\u9879`)}),e.props.forEach(o=>{let a=n[o.name];a!=null&&(o.type==="number"&&isNaN(Number(a))&&r.push(`\u5C5E\u6027 '${o.name}' \u5E94\u4E3A\u6570\u5B57\u7C7B\u578B`),o.type==="boolean"&&typeof a!="boolean"&&a!=="true"&&a!=="false"&&r.push(`\u5C5E\u6027 '${o.name}' \u5E94\u4E3A\u5E03\u5C14\u7C7B\u578B`),o.type==="enum"&&o.options&&!o.options.includes(a)&&r.push(`\u5C5E\u6027 '${o.name}' \u7684\u503C '${a}' \u4E0D\u5728\u53EF\u9009\u8303\u56F4\u5185: ${o.options.join(", ")}`))}),e.body&&e.body.length>0){let o=t.body!==void 0?t.body:t.data;e.body.forEach(a=>{a.required&&(o==null||o===""?r.push("\u6807\u7B7E\u4F53\u5185\u5BB9 (Body Data) \u662F\u5FC5\u586B\u9879"):typeof o=="object"&&!Array.isArray(o)&&(o[a.name]===void 0||o[a.name]===null||o[a.name]==="")&&r.push(`\u6807\u7B7E\u4F53\u5185\u5BB9\u5E94\u5305\u542B '${a.name}' (${a.description}) \u5B57\u6BB5`))})}return{valid:r.length===0,errors:r}}function gt(t,e){let{node:r,streamStatus:n}=t,o=yt(r,e),a=r?.streamStatus||n||o.streamStatus,s=a==="loading"||r?.body?.["data-xcml-loading"]==="true"||r?.data?.["data-xcml-loading"]==="true"||r?.props?.["data-xcml-loading"]==="true"||o?.["data-xcml-loading"]==="true"||t.loading,l={theme:o.theme,variant:o.variant,size:o.size,className:t.className,style:t.style,loading:s,streamStatus:a,error:t.error};return{merged:o,baseProps:l,isLoading:s,streamStatus:a}}function et(t){return t.startsWith("xcml:")?t.slice(5):t.startsWith("x-")?t.slice(2):t}function Yt(t){return`x-${et(t)}`}function Fe(t){return`xcml:${et(t)}`}var Qe=class{constructor(){this.listeners={}}on(e,r){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(r)}emit(e,r){(this.listeners[e]||[]).forEach(n=>n(r))}refresh(e){this.emit("refresh",{id:e})}update(e,r){this.emit("update",{id:e,payload:r})}resize(e){this.emit("resize",{id:e})}export(e,r){this.emit("export",{id:e,type:r})}},he=new Qe,un=/\/\/(.*)$/gm,yn=/\/\*[\s\S]*?\*\//g;function Zt(t,e="json"){let r=t.trim();if(!r)return null;if((e==="json"||e==="jsonc")&&!(r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]")))return r;try{if(e==="json"||e==="jsonc"){let n=e==="jsonc"?r.replace(un,"").replace(yn,""):r;try{return JSON.parse(n)}catch(o){try{let a=(0,Ze.parse)(n);if(typeof a=="string"&&(a.startsWith("{")||a.startsWith("[")))throw o;return a}catch{throw o}}}if(e==="yaml")return(0,Ze.parse)(r);if(e==="csv"||e==="tsv"){let n=e==="csv"?",":" ",o=r.split(/\r?\n/).filter(s=>s.trim());if(o.length===0)return[];let a=o[0].split(n).map(s=>s.trim());return o.slice(1).map(s=>{let l=s.split(n),d={};return a.forEach((m,p)=>{let c=l[p]?.trim();c==="true"?c=!0:c==="false"?c=!1:c!==""&&!isNaN(Number(c))&&(c=Number(c)),d[m]=c}),d})}return e==="ndjson"?r.split(/\r?\n/).filter(Boolean).map(n=>JSON.parse(n)):JSON.parse(r)}catch(n){throw n}}function gn(t,e){return e!=null}function ft(t,e){if(!e||typeof e!="object"||Array.isArray(e))return e;let r=Fe(t),n=fe[r];if(!n)return e;let o={...e};return[...n.props||[],...n.body||[]].forEach(s=>{let l=o[s.name];if((s.type==="object"||s.type==="array")&&typeof l=="string")try{let d=l.trim();if(d.startsWith("{")||d.startsWith("[")){let m=d,p=0;for(;typeof m=="string"&&p<2;){let c=JSON.parse(m);if(c===null||typeof c!="object")if(typeof c=="string"&&(c.startsWith("{")||c.startsWith("[")))m=c;else break;else{m=c;break}p++}o[s.name]=m}}catch{}}),o}function ht(t,e,r,n={}){let o=Fe(t),a=fe[o],s={},l={},{preferBody:d=!1}=n,m=Qt(r),p=m;a&&(typeof m=="string"?p={[a.example?.contentProp||(a.body||[]).find(x=>x.name==="content"||x.name==="value")?.name||"content"]:m}:m&&typeof m=="object"&&Array.isArray(m)),p&&typeof p=="object"&&!Array.isArray(p)&&Object.keys(p).forEach(y=>{/^\d+$/.test(y)||(l[y]=p[y])});let c={...p&&typeof p=="object"&&!Array.isArray(p)?p:{},...e};if(!a)return{props:e,body:r};let i=new Set((a.props||[]).map(y=>y.name)),u=new Set((a.body||[]).map(y=>y.name));for(let[y,x]of Object.entries(c))/^\d+$/.test(y)||(d?i.has(y)||u.has(y)?l[y]=x:y in e?s[y]=x:l[y]=x:i.has(y)?s[y]=x:u.has(y)?l[y]=x:y in e?s[y]=x:l[y]=x);let f=l;if(Array.isArray(m))if(Object.keys(l).length===0)f=m;else{let y=(a.body||[]).find(x=>x.type==="array")?.name||"data";l[y]=m,f=l}return{props:ft(o,s),body:ft(o,f)}}function Qt(t){if(Array.isArray(t))return t;if(t&&typeof t=="object"){let e=Object.keys(t).filter(r=>/^\d+$/.test(r)).sort((r,n)=>Number(r)-Number(n));if(e.length>0&&e.length===Object.keys(t).length&&e.every((r,n)=>Number(r)===n))return e.map(r=>t[r])}return t}function fn(t){let e=Fe(t.tag||t.type||"unknown"),r=Yt(e),n={...t.props||{}},o=Qt(t.body),{body:a}=ht(e,n,o,{preferBody:!0}),s=[],l=a,d=Object.keys(a||{});d.length===1&&d[0]==="data"&&Array.isArray(a.data)&&(l=a.data);let m=s.length>0?" "+s.join(" "):"",p=JSON.stringify(l,null,2);return`<${r}${m}>
|
|
1
|
+
"use strict";var an=Object.create;var De=Object.defineProperty;var sn=Object.getOwnPropertyDescriptor;var ln=Object.getOwnPropertyNames;var cn=Object.getPrototypeOf,dn=Object.prototype.hasOwnProperty;var mn=(t,e)=>{for(var r in e)De(t,r,{get:e[r],enumerable:!0})},Gt=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ln(e))!dn.call(t,n)&&n!==r&&De(t,n,{get:()=>e[n],enumerable:!(o=sn(e,n))||o.enumerable});return t};var X=(t,e,r)=>(r=t!=null?an(cn(t)):{},Gt(e||!t||!t.__esModule?De(r,"default",{value:t,enumerable:!0}):r,t)),pn=t=>Gt(De({},"__esModule",{value:!0}),t);var po={};mn(po,{AntVChartLoader:()=>Be,COMMON_PROPS:()=>Zt,DefaultEmptyPlaceholder:()=>Bt,DefaultErrorPlaceholder:()=>jt,ThemeProvider:()=>Rn,XCMLCardWrapper:()=>Ie,XCMLChart:()=>Dn,XCMLEventBus:()=>tt,XCMLLayoutProvider:()=>Nt,XCMLMarkdown:()=>at,XCML_SCHEMAS:()=>he,buildConfig:()=>$t,chartSchema:()=>fe,cleanPropsBySchema:()=>It,columnChartSchema:()=>Re,columnStrategy:()=>Ft,createAntVRenderers:()=>Wn,createBasicRenderers:()=>Yn,createExtendedRenderers:()=>mo,createRenderersWithAliases:()=>pe,deepMerge:()=>Oe,dualAxesChartSchema:()=>Xe,dualAxesStrategy:()=>_t,extractBaseStyles:()=>yn,funnelChartSchema:()=>Fe,funnelStrategy:()=>Et,getChartStrategy:()=>Ot,getTheme:()=>Tt,lineChartSchema:()=>Pe,lineStrategy:()=>Xt,mergePropsAndBody:()=>Ct,normalizeNodeData:()=>xt,normalizeTagName:()=>rt,parse:()=>nt.parse,parseArrayProp:()=>me,parseInlineData:()=>er,parseXCML:()=>vn,pieChartSchema:()=>Te,pieStrategy:()=>At,preprocessXCML:()=>vt,renderXCML:()=>gn,strategies:()=>vr,stringify:()=>nt.stringify,stringifyToXCML:()=>Cn,themeDark:()=>yr,themeLight:()=>lt,themeMap:()=>gr,toXCMLNodeFromElement:()=>xe,toXCMLTag:()=>Ae,toXTag:()=>Qt,useTheme:()=>Ee,useXCMLComponent:()=>bt,useXCMLLayout:()=>Lt,useXCMLNode:()=>ht,validateDataSchema:()=>xn,validateXCMLNode:()=>fn,withXCMLCard:()=>S,xTagPlugin:()=>Nn,xcmlBus:()=>be});module.exports=pn(po);var et=require("yaml");var We={tag:"x-metric",title:"\u6307\u6807\u5361\u7247",description:"\u7528\u4E8E\u5C55\u793A\u5355\u4E00\u6838\u5FC3\u6570\u503C\u53CA\u5176\u8D8B\u52BF\u6216\u5907\u6CE8\u4FE1\u606F\uFF0C\u652F\u6301\u591A\u79CD\u5E03\u5C40\u548C\u6837\u5F0F\u53D8\u4F53\u3002",props:[{name:"title",type:"string",description:"\u6307\u6807\u540D\u79F0/\u6807\u9898",category:"required",required:!0},{name:"variant",type:"enum",description:"\u5C55\u793A\u53D8\u4F53\u6837\u5F0F",category:"style",options:["card","plain","compact"],default:"card"},{name:"layout",type:"enum",description:"\u5E03\u5C40\u65B9\u5411",category:"layout",options:["horizontal","vertical"],default:"vertical"},{name:"icon",type:"string",description:"\u88C5\u9970\u56FE\u6807 (Emoji)",category:"style"},{name:"precision",type:"number",description:"\u6570\u503C\u4FDD\u7559\u5C0F\u6570\u4F4D\u6570",category:"style",default:0}],body:[{name:"value",type:"string",description:"\u6307\u6807\u6570\u503C",category:"required",required:!0},{name:"trend",type:"enum",description:"\u8D8B\u52BF\u65B9\u5411",category:"optional",options:["up","down","none"]},{name:"trendValue",type:"string",description:"\u8D8B\u52BF\u503C",category:"optional"},{name:"note",type:"string",description:"\u6307\u6807\u5907\u6CE8",category:"optional"},{name:"footer",type:"string",description:"\u5E95\u90E8\u8F85\u52A9\u4FE1\u606F",category:"optional"}],example:{props:{title:"\u6708\u5EA6\u51C0\u9500\u552E\u989D",variant:"card",layout:"vertical",precision:0,icon:"\u{1F4B0}"},body:{value:"1280000",trend:"up",trendValue:"+12.5%",note:"\u8F83\u4E0A\u6708\u589E\u957F 12.5%"},contentProp:"value"}};var qe={tag:"xcml:table",title:"\u53EF\u89C6\u5316\u6570\u636E\u8868\u683C",description:"\u62A5\u8868\u7EA7\u6570\u636E\u8868\u683C\uFF0C\u652F\u6301\u8FDB\u5EA6\u6761\u3001\u8D8B\u52BF\u56FE\u7B49\u53EF\u89C6\u5316\u5217\u6E32\u67D3\uFF0C\u5168\u91CF\u5C55\u793A\u4E0D\u5206\u9875\u3002",props:[{name:"title",type:"string",description:"\u8868\u683C\u6807\u9898",category:"style"},{name:"bordered",type:"boolean",description:"\u662F\u5426\u663E\u793A\u8FB9\u6846",category:"style",default:!0},{name:"variant",type:"enum",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",category:"style",options:["card","plain"],default:"card"},{name:"size",type:"enum",description:"\u8868\u683C\u5C3A\u5BF8",category:"layout",options:["small","middle","large"],default:"middle"},{name:"summary",type:"boolean",description:"\u662F\u5426\u663E\u793A\u5408\u8BA1\u884C",category:"optional",default:!1}],body:[{name:"columns",type:"array",description:"\u5217\u5B9A\u4E49",category:"required",required:!0,items:[{name:"column",type:"object",description:"\u5217\u914D\u7F6E\u5BF9\u8C61",category:"required",properties:[{name:"title",type:"string",description:"\u5217\u6807\u9898",category:"required"},{name:"key",type:"string",description:"\u6570\u636E\u5B57\u6BB5\u952E\u540D",category:"required"},{name:"type",type:"enum",description:"\u6E32\u67D3\u7C7B\u578B",category:"style",options:["text","progress","trend","badge","image","link"]},{name:"align",type:"enum",description:"\u5BF9\u9F50\u65B9\u5F0F",category:"style",options:["left","center","right"]},{name:"width",type:"number",description:"\u5217\u5BBD",category:"layout"}]}]},{name:"rows",type:"array",description:"\u884C\u6570\u636E",category:"required",required:!0,items:[{name:"row",type:"object",description:"\u884C\u6570\u636E\u5BF9\u8C61",category:"required"}]}],example:{props:{title:"\u5404\u533A\u57DF\u9500\u552E\u8FBE\u6210\u62A5\u8868",bordered:!1,size:"middle",summary:!0},body:{columns:[{title:"\u533A\u57DF",key:"region",align:"left"},{title:"\u9500\u552E\u989D",key:"sales",align:"right",type:"text"},{title:"\u76EE\u6807\u8FBE\u6210\u7387",key:"rate",align:"center",type:"progress"},{title:"\u8FD1\u671F\u8D8B\u52BF",key:"trend",align:"center",type:"trend"},{title:"\u72B6\u6001",key:"status",align:"center",type:"badge"}],rows:[{region:"\u534E\u4E1C\u533A",sales:"\xA51,250,000",rate:.92,trend:[10,20,15,30,40],status:"normal"},{region:"\u534E\u5317\u533A",sales:"\xA5980,000",rate:.78,trend:[30,20,25,10,15],status:"warning"},{region:"\u534E\u5357\u533A",sales:"\xA51,560,000",rate:1.12,trend:[20,30,40,50,60],status:"success"},{region:"\u897F\u90E8\u533A",sales:"\xA5420,000",rate:.45,trend:[10,8,5,12,10],status:"error"}]}}};var ze={tag:"xcml:list",title:"\u7F51\u683C/\u5217\u8868\u5E03\u5C40",description:"\u901A\u7528\u5E03\u5C40\u5BB9\u5668\uFF0C\u652F\u6301 Grid \u548C List \u4E24\u79CD\u6A21\u5F0F\uFF0C\u9002\u5408\u6392\u7248\u591A\u4E2A\u5361\u7247\u3002",props:[{name:"title",type:"string",description:"\u5217\u8868\u6807\u9898"},{name:"header",type:"string",description:"\u5217\u8868\u9875\u7709\u6587\u672C"},{name:"footer",type:"string",description:"\u5217\u8868\u9875\u811A\u6587\u672C"},{name:"layout",type:"enum",description:"\u5E03\u5C40\u6A21\u5F0F",options:["grid","list"],default:"grid"},{name:"columns",type:"number",description:"\u7F51\u683C\u5217\u6570 (Grid\u6A21\u5F0F\u6709\u6548)",default:3},{name:"gap",type:"number",description:"\u95F4\u8DDD",default:16},{name:"type",type:"enum",description:"\u5217\u8868\u9879\u9ED8\u8BA4\u7C7B\u578B",options:["text","metric"],default:"text"},{name:"stripe",type:"boolean",description:"\u662F\u5426\u5F00\u542F\u6591\u9A6C\u7EB9",default:!1}],body:[{name:"items",type:"array",description:"\u5217\u8868\u9879\u96C6\u5408",required:!0}],example:{props:{title:"\u7EDF\u8BA1\u6307\u6807",header:"\u6700\u8FD1\u4E00\u4E2A\u6708\u6570\u636E",footer:"\u6570\u636E\u6765\u6E90\uFF1A\u6570\u636E\u5E93",layout:"grid",columns:3,gap:16},body:{items:[{title:"\u7528\u6237\u589E\u957F",value:"+12%",type:"metric"},{title:"\u6D3B\u8DC3\u5EA6",value:"85%",type:"metric"},{title:"\u7559\u5B58\u7387",value:"42%",type:"metric"}]}}};var Ve={tag:"xcml:card",title:"\u901A\u7528\u5361\u7247",description:"\u57FA\u7840\u5BB9\u5668\u5361\u7247\uFF0C\u652F\u6301\u6807\u9898\u3001\u63CF\u8FF0\u548C\u60AC\u6D6E\u6548\u679C\u3002",props:[{name:"title",type:"string",description:"\u5361\u7247\u6807\u9898",category:"optional"},{name:"type",type:"enum",description:"\u5361\u7247\u7C7B\u578B",category:"style",options:["inner","default"],default:"default"},{name:"hoverable",type:"boolean",description:"\u662F\u5426\u652F\u6301\u60AC\u505C\u6548\u679C",category:"interaction",default:!0},{name:"variant",type:"enum",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",category:"style",options:["card","plain"],default:"card"}],body:[{name:"description",type:"string",description:"\u5361\u7247\u63CF\u8FF0/\u6B63\u6587 (\u517C\u5BB9\u65E7\u5C5E\u6027)",category:"optional"},{name:"content",type:"string",description:"\u5361\u7247\u4E3B\u8981\u5185\u5BB9 (\u652F\u6301 Markdown)",category:"required",required:!0}],example:{props:{type:"default",hoverable:!0,variant:"card",title:"\u63D0\u793A\u4FE1\u606F",theme:"light"},body:{description:"\u8FD9\u662F\u4E00\u4E2A\u57FA\u7840\u5361\u7247\u793A\u4F8B",content:"\u8FD9\u662F\u4E00\u4E2A\u57FA\u7840\u5361\u7247\u5BB9\u5668\uFF0C\u53EF\u4EE5\u7528\u6765\u5305\u88F9\u7B80\u5355\u7684\u6587\u672C\u6216\u4F5C\u4E3A\u5176\u4ED6\u7EC4\u4EF6\u7684\u5360\u4F4D\u3002"},contentProp:"content"}};var He={tag:"xcml:toc",title:"\u6587\u6863\u76EE\u5F55",description:"\u81EA\u52A8\u63D0\u53D6\u6587\u6863\u4E2D\u7684 H2-H6 \u6807\u9898\u751F\u6210\u53EF\u8DF3\u8F6C\u7684\u76EE\u5F55\u3002",props:[{name:"title",type:"string",description:"\u76EE\u5F55\u6807\u9898",default:"\u76EE\u5F55"}],example:{props:{title:"\u5185\u5BB9\u5927\u7EB2"}}};var Pe={tag:"x-line-chart",title:"\u6298\u7EBF\u56FE",description:"\u7528\u4E8E\u5C55\u793A\u8FDE\u7EED\u65F6\u95F4\u8DE8\u5EA6\u4E0B\u7684\u6570\u636E\u8D8B\u52BF\u3002",props:[],body:[{name:"data",type:"array",description:"\u6298\u7EBF\u56FE\u6570\u636E",required:!0},{name:"xField",type:"string",description:"x\u8F74\u5B57\u6BB5",default:"category",required:!0},{name:"yField",type:"string",description:"y\u8F74\u5B57\u6BB5",default:"value",required:!0},{name:"seriesField",type:"string",description:"\u5206\u7EC4\u5B57\u6BB5",default:"type"}],example:{props:{title:"\u5404\u7C7B\u578B\u5546\u54C1\u9500\u552E\u8D8B\u52BF"},body:{title:"\u5404\u7C7B\u578B\u5546\u54C1\u9500\u552E\u8D8B\u52BF",xField:"category",yField:"value",seriesField:"type",data:[{category:"A",value:10,type:"T1"},{category:"B",value:20,type:"T1"}]}}};var Re={tag:"x-column-chart",title:"\u67F1\u72B6\u56FE",description:"\u7528\u4E8E\u6BD4\u8F83\u4E0D\u540C\u5206\u7C7B\u4E4B\u95F4\u7684\u6570\u636E\u5DEE\u5F02\u3002",props:[],body:[{name:"xField",type:"string",description:"X\u8F74\u5B57\u6BB5 (\u5206\u7C7B)",category:"required",required:!0},{name:"yField",type:"string",description:"Y\u8F74\u5B57\u6BB5 (\u6570\u503C)",category:"required",required:!0},{name:"seriesField",type:"string",description:"\u7CFB\u5217\u5B57\u6BB5 (\u5206\u7EC4)",category:"optional"},{name:"colorField",type:"string",description:"\u989C\u8272\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"stack",type:"any",description:"\u662F\u5426\u5806\u53E0",category:"layout"},{name:"group",type:"any",description:"\u662F\u5426\u5206\u7EC4\u663E\u793A",category:"layout"},{name:"percent",type:"boolean",description:"\u662F\u5426\u767E\u5206\u6BD4\u5C55\u793A",category:"layout"},{name:"conversionTag",type:"object",description:"\u8F6C\u5316\u7387\u914D\u7F6E",category:"style"},{name:"markBackground",type:"object",description:"\u5143\u7D20\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6E90",category:"required",required:!0},{name:"title",type:"any",description:"\u56FE\u8868\u6807\u9898",category:"style",properties:[{name:"title",type:"string",description:"\u4E3B\u6807\u9898",category:"optional"},{name:"subtitle",type:"string",description:"\u526F\u6807\u9898",category:"optional"},{name:"align",type:"enum",description:"\u5BF9\u9F50\u65B9\u5F0F",category:"style",options:["left","center","right"]},{name:"titleFontSize",type:"number",description:"\u4E3B\u6807\u9898\u5B57\u53F7",category:"style"},{name:"titleFontWeight",type:"any",description:"\u4E3B\u6807\u9898\u5B57\u91CD",category:"style"},{name:"titleFill",type:"string",description:"\u4E3B\u6807\u9898\u989C\u8272",category:"style"}]},{name:"label",type:"any",description:"\u6807\u7B7E\u914D\u7F6E",category:"style",properties:[{name:"text",type:"string",description:"\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["top","bottom","inside","left","right"]},{name:"style",type:"object",description:"\u6837\u5F0F",category:"style"},{name:"background",type:"any",description:"\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"transform",type:"array",description:"\u5E03\u5C40\u53D8\u6362",category:"style"}]},{name:"axis",type:"object",description:"\u5750\u6807\u8F74\u914D\u7F6E",category:"style",properties:[{name:"x",type:"object",description:"X\u8F74\u914D\u7F6E",category:"style",properties:[{name:"title",type:"any",description:"\u8F74\u6807\u9898",category:"style"},{name:"line",type:"any",description:"\u8F74\u7EBF",category:"style"},{name:"tick",type:"any",description:"\u523B\u5EA6\u7EBF",category:"style"},{name:"label",type:"any",description:"\u523B\u5EA6\u503C",category:"style"},{name:"grid",type:"any",description:"\u7F51\u683C\u7EBF",category:"style"},{name:"labelFormatter",type:"any",description:"\u683C\u5F0F\u5316",category:"style"}]},{name:"y",type:"object",description:"Y\u8F74\u914D\u7F6E",category:"style",properties:[{name:"title",type:"any",description:"\u8F74\u6807\u9898",category:"style"},{name:"line",type:"any",description:"\u8F74\u7EBF",category:"style"},{name:"tick",type:"any",description:"\u523B\u5EA6\u7EBF",category:"style"},{name:"label",type:"any",description:"\u523B\u5EA6\u503C",category:"style"},{name:"grid",type:"any",description:"\u7F51\u683C\u7EBF",category:"style"},{name:"labelFormatter",type:"any",description:"\u683C\u5F0F\u5316",category:"style"}]}]},{name:"scale",type:"object",description:"\u6BD4\u4F8B\u5C3A\u914D\u7F6E",category:"style",properties:[{name:"type",type:"string",description:"\u7C7B\u578B",category:"style"},{name:"domain",type:"array",description:"\u5B9A\u4E49\u57DF",category:"style"},{name:"range",type:"array",description:"\u503C\u57DF",category:"style"},{name:"palette",type:"string",description:"\u8272\u677F",category:"style"}]},{name:"legend",type:"object",description:"\u56FE\u4F8B\u914D\u7F6E",category:"style"},{name:"tooltip",type:"object",description:"\u60AC\u6D6E\u63D0\u793A\u914D\u7F6E",category:"interaction"},{name:"style",type:"object",description:"\u56FE\u5F62\u6837\u5F0F\u914D\u7F6E",category:"style"},{name:"annotations",type:"array",description:"\u8F85\u52A9\u6807\u6CE8\u914D\u7F6E",category:"style"}],example:{props:{title:"\u5404\u533A\u57DF\u5E74\u5EA6\u9500\u552E\u5206\u6790"},body:{xField:"region",yField:"sales",seriesField:"year",stack:!0,label:[{text:"sales",position:"inside"}],data:[{region:"\u534E\u4E1C",year:"2022",sales:4500},{region:"\u534E\u4E1C",year:"2023",sales:5200},{region:"\u534E\u5317",year:"2022",sales:3800},{region:"\u534E\u5317",year:"2023",sales:4100},{region:"\u534E\u5357",year:"2022",sales:4200},{region:"\u534E\u5357",year:"2023",sales:4800}]}}};var Te={tag:"x-pie-chart",title:"\u997C\u56FE",description:"\u7528\u4E8E\u5C55\u793A\u5206\u7C7B\u6570\u636E\u7684\u5360\u6BD4\u60C5\u51B5\u3002",props:[],body:[{name:"colorField",type:"string",description:"\u5206\u7C7B\u5B57\u6BB5",category:"required",required:!0},{name:"angleField",type:"string",description:"\u6570\u503C\u5B57\u6BB5",category:"required",required:!0},{name:"radius",type:"number",description:"\u534A\u5F84",category:"layout"},{name:"innerRadius",type:"number",description:"\u5185\u534A\u5F84 (\u73AF\u56FE)",category:"layout"},{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6E90",category:"required",required:!0},{name:"title",type:"any",description:"\u56FE\u8868\u6807\u9898",category:"style",properties:[{name:"title",type:"string",description:"\u4E3B\u6807\u9898",category:"optional"},{name:"subtitle",type:"string",description:"\u526F\u6807\u9898",category:"optional"},{name:"align",type:"enum",description:"\u5BF9\u9F50\u65B9\u5F0F",category:"style",options:["left","center","right"]},{name:"titleFontSize",type:"number",description:"\u4E3B\u6807\u9898\u5B57\u53F7",category:"style"},{name:"titleFontWeight",type:"any",description:"\u4E3B\u6807\u9898\u5B57\u91CD",category:"style"},{name:"titleFill",type:"string",description:"\u4E3B\u6807\u9898\u989C\u8272",category:"style"}]},{name:"label",type:"any",description:"\u6807\u7B7E\u914D\u7F6E",category:"style",properties:[{name:"text",type:"string",description:"\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["outside","inside"]},{name:"style",type:"object",description:"\u6837\u5F0F",category:"style"},{name:"background",type:"any",description:"\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"connector",type:"any",description:"\u8FDE\u63A5\u7EBF\u914D\u7F6E",category:"style"},{name:"transform",type:"array",description:"\u5E03\u5C40\u53D8\u6362",category:"style"}]},{name:"legend",type:"object",description:"\u56FE\u4F8B\u914D\u7F6E",category:"style",properties:[{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]},{name:"title",type:"any",description:"\u6807\u9898",category:"style"},{name:"layout",type:"object",description:"\u5E03\u5C40",category:"style"},{name:"itemMarker",type:"any",description:"\u6807\u8BB0\u5F62\u72B6",category:"style"}]},{name:"scale",type:"object",description:"\u6BD4\u4F8B\u5C3A\u914D\u7F6E",category:"style",properties:[{name:"type",type:"string",description:"\u7C7B\u578B",category:"style"},{name:"domain",type:"array",description:"\u5B9A\u4E49\u57DF",category:"style"},{name:"range",type:"array",description:"\u503C\u57DF",category:"style"},{name:"palette",type:"string",description:"\u8272\u677F",category:"style"}]},{name:"tooltip",type:"object",description:"\u60AC\u6D6E\u63D0\u793A\u914D\u7F6E",category:"interaction"},{name:"style",type:"object",description:"\u56FE\u5F62\u6837\u5F0F\u914D\u7F6E",category:"style"},{name:"annotations",type:"array",description:"\u8F85\u52A9\u6807\u6CE8\u914D\u7F6E",category:"style"}],example:{props:{},body:{colorField:"type",angleField:"value",data:[{type:"A",value:40},{type:"B",value:60}]}}};var Xe={tag:"x-dual-axes-chart",title:"\u53CC\u8F74\u56FE",description:"\u7528\u4E8E\u5728\u540C\u4E00\u56FE\u8868\u4E2D\u5C55\u793A\u4E24\u4E2A\u4E0D\u540C\u91CF\u7EB2\u7684\u6570\u636E\u7CFB\u5217\u3002",props:[],body:[{name:"xField",type:"string",description:"X\u8F74\u5B57\u6BB5",category:"required",required:!0},{name:"children",type:"array",description:"\u5B50\u56FE\u5C42\u914D\u7F6E\u6570\u7EC4",category:"required",required:!0,transform:(t,e)=>Array.isArray(t)?t.map(r=>{!r.xField&&e.xField&&(r.xField=e.xField);let o=r.xField||"x",n=r.scale||{},a=n[o]||{};return(r.type==="interval"||!a.type)&&(a.type="band"),{...r,scale:{...n,[o]:a}}}):t,items:[{name:"properties",type:"object",description:"\u5B50\u56FE\u5C42\u914D\u7F6E",category:"required",properties:[{name:"type",type:"enum",description:"\u56FE\u5C42\u7C7B\u578B",category:"required",options:["interval","line","area","point"],required:!0},{name:"yField",type:"string",description:"\u6570\u503C\u5B57\u6BB5",category:"required",required:!0},{name:"colorField",type:"string",description:"\u5206\u7EC4\u5B57\u6BB5",category:"optional"},{name:"seriesField",type:"string",description:"\u7CFB\u5217\u5B57\u6BB5 (\u522B\u540D)",category:"optional"},{name:"shapeField",type:"string",description:"\u5F62\u72B6\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"group",type:"boolean",description:"\u662F\u5426\u5206\u7EC4",category:"layout"},{name:"style",type:"object",description:"\u56FE\u5F62\u6837\u5F0F\u914D\u7F6E",category:"style"},{name:"interaction",type:"object",description:"\u4EA4\u4E92\u914D\u7F6E",category:"interaction"},{name:"data",type:"array",description:"\u5B50\u56FE\u5C42\u72EC\u7ACB\u6570\u636E\u6E90",category:"required"},{name:"axis",type:"object",description:"\u8BE5\u56FE\u5C42\u7684\u8F74\u914D\u7F6E",category:"style",properties:[{name:"y",type:"object",description:"Y\u8F74\u914D\u7F6E",category:"style"}]},{name:"label",type:"any",description:"\u6807\u7B7E\u914D\u7F6E",category:"style",properties:[{name:"text",type:"string",description:"\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["top","bottom","inside","left","right"]},{name:"style",type:"object",description:"\u6837\u5F0F",category:"style"},{name:"background",type:"any",description:"\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"transform",type:"array",description:"\u5E03\u5C40\u53D8\u6362",category:"style"}]},{name:"scale",type:"object",description:"\u6BD4\u4F8B\u5C3A\u914D\u7F6E",category:"style",properties:[{name:"type",type:"string",description:"\u7C7B\u578B",category:"style"},{name:"domain",type:"array",description:"\u5B9A\u4E49\u57DF",category:"style"},{name:"range",type:"array",description:"\u503C\u57DF",category:"style"},{name:"palette",type:"string",description:"\u8272\u677F",category:"style"}]}]}]},{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6E90",category:"required",required:!0},{name:"title",type:"any",description:"\u56FE\u8868\u6807\u9898",category:"style",properties:[{name:"title",type:"string",description:"\u4E3B\u6807\u9898",category:"optional"},{name:"subtitle",type:"string",description:"\u526F\u6807\u9898",category:"optional"},{name:"align",type:"enum",description:"\u5BF9\u9F50\u65B9\u5F0F",category:"style",options:["left","center","right"]},{name:"titleFontSize",type:"number",description:"\u4E3B\u6807\u9898\u5B57\u53F7",category:"style"},{name:"titleFontWeight",type:"any",description:"\u4E3B\u6807\u9898\u5B57\u91CD",category:"style"},{name:"titleFill",type:"string",description:"\u4E3B\u6807\u9898\u989C\u8272",category:"style"}]},{name:"label",type:"any",description:"\u6807\u7B7E\u914D\u7F6E",category:"style",properties:[{name:"text",type:"string",description:"\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["top","bottom","middle","left","right"]},{name:"style",type:"object",description:"\u6837\u5F0F",category:"style"},{name:"background",type:"any",description:"\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"transform",type:"array",description:"\u5E03\u5C40\u53D8\u6362",category:"style"}]},{name:"axis",type:"object",description:"\u5750\u6807\u8F74\u914D\u7F6E",category:"style",properties:[{name:"x",type:"object",description:"X\u8F74\u914D\u7F6E",category:"style",properties:[{name:"title",type:"any",description:"\u8F74\u6807\u9898",category:"style"},{name:"line",type:"any",description:"\u8F74\u7EBF",category:"style"},{name:"tick",type:"any",description:"\u523B\u5EA6\u7EBF",category:"style"},{name:"label",type:"any",description:"\u523B\u5EA6\u503C",category:"style"},{name:"grid",type:"any",description:"\u7F51\u683C\u7EBF",category:"style"},{name:"labelFormatter",type:"any",description:"\u683C\u5F0F\u5316",category:"style"}]},{name:"y",type:"object",description:"Y\u8F74\u914D\u7F6E",category:"style",properties:[{name:"title",type:"any",description:"\u8F74\u6807\u9898",category:"style"},{name:"line",type:"any",description:"\u8F74\u7EBF",category:"style"},{name:"tick",type:"any",description:"\u523B\u5EA6\u7EBF",category:"style"},{name:"label",type:"any",description:"\u523B\u5EA6\u503C",category:"style"},{name:"grid",type:"any",description:"\u7F51\u683C\u7EBF",category:"style"},{name:"labelFormatter",type:"any",description:"\u683C\u5F0F\u5316",category:"style"}]}]},{name:"scale",type:"object",description:"\u6BD4\u4F8B\u5C3A\u914D\u7F6E",category:"style",properties:[{name:"type",type:"string",description:"\u7C7B\u578B",category:"style"},{name:"domain",type:"array",description:"\u5B9A\u4E49\u57DF",category:"style"},{name:"range",type:"array",description:"\u503C\u57DF",category:"style"},{name:"palette",type:"string",description:"\u8272\u677F",category:"style"}]},{name:"legend",type:"object",description:"\u56FE\u4F8B\u914D\u7F6E",category:"style"},{name:"tooltip",type:"object",description:"\u60AC\u6D6E\u63D0\u793A\u914D\u7F6E",category:"interaction"},{name:"style",type:"object",description:"\u56FE\u5F62\u6837\u5F0F\u914D\u7F6E",category:"style"},{name:"annotations",type:"array",description:"\u8F85\u52A9\u6807\u6CE8\u914D\u7F6E",category:"style"}],example:{props:{xField:"month",children:[{type:"interval",yField:"sales",label:[{position:"middle"}]},{type:"line",yField:"rate",label:[{position:"top"}],style:{stroke:"#5AD8A6",lineWidth:2}}],axis:{y:[{title:{text:"\u9500\u552E\u989D"}},{title:{text:"\u5229\u6DA6\u7387"},position:"right"}]},data:[{month:"1\u6708",sales:450,rate:.12},{month:"2\u6708",sales:520,rate:.15},{month:"3\u6708",sales:480,rate:.14},{month:"4\u6708",sales:610,rate:.18},{month:"5\u6708",sales:580,rate:.16}]},body:{xField:"time",yField:["value","count"],data:[{time:"2021-01",value:10,count:5},{time:"2021-02",value:20,count:10}]}}};var Fe={tag:"x-funnel-chart",title:"\u6F0F\u6597\u56FE",description:"\u7528\u4E8E\u5C55\u793A\u4E1A\u52A1\u6D41\u7A0B\u4E2D\u5404\u9636\u6BB5\u7684\u6570\u636E\u8F6C\u5316\u60C5\u51B5\u3002",props:[],body:[{name:"data",type:"array",description:"\u6F0F\u6597\u56FE\u6570\u636E",required:!0},{name:"xField",type:"string",description:"\u7C7B\u522B\u5B57\u6BB5",default:"category",required:!0},{name:"yField",type:"string",description:"\u6570\u503C\u5B57\u6BB5",default:"value",required:!0}],example:{props:{},body:{xField:"category",yField:"value",data:[{category:"A",value:100},{category:"B",value:80}]}}};var Ut={line:Pe,column:Re,pie:Te,"dual-axes":Xe,funnel:Fe};function Yt(t,e){let r=new Map;return Object.entries(t).forEach(([o,n])=>{(n[e]||[]).forEach(s=>{if(["type","data","xField","yField","colorField","seriesField","title","label","axis","legend","tooltip","scale","interaction","theme"].includes(s.name))return;let c=r.get(s.name);c?c.types.push(o):r.set(s.name,{def:s,types:[o]})})}),Array.from(r.values()).map(({def:o,types:n})=>({...o,visibleIf:a=>n.includes(a.type)?o.visibleIf?o.visibleIf(a):!0:!1}))}var fe={tag:"xcml:chart",title:"AntV \u901A\u7528\u56FE\u8868",description:"\u5168\u529F\u80FD\u56FE\u8868\u7EC4\u4EF6\u5BB9\u5668\uFF0C\u652F\u6301\u901A\u8FC7 type \u52A8\u6001\u5207\u6362\u6298\u7EBF\u56FE\u3001\u67F1\u72B6\u56FE\u3001\u997C\u56FE\u7B49\u3002",props:[{name:"type",type:"enum",description:"\u56FE\u8868\u7C7B\u578B",category:"required",required:!0,options:["line","column","pie","dual-axes","funnel"],default:"line"},...Yt(Ut,"props")],body:[{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6E90",category:"required",required:!0},{name:"xField",type:"string",description:"X\u8F74\u5B57\u6BB5",category:"required",required:!0},{name:"yField",type:"string",description:"Y\u8F74\u5B57\u6BB5",category:"required",required:!0},{name:"colorField",type:"string",description:"\u989C\u8272/\u5206\u7EC4\u5B57\u6BB5",category:"optional"},{name:"seriesField",type:"string",description:"\u7CFB\u5217\u5B57\u6BB5",category:"optional"},{name:"title",type:"object",description:"\u56FE\u8868\u6807\u9898",category:"style"},{name:"label",type:"object",description:"\u6570\u636E\u6807\u7B7E",category:"style"},{name:"axis",type:"object",description:"\u5750\u6807\u8F74\u914D\u7F6E",category:"style"},{name:"legend",type:"object",description:"\u56FE\u4F8B\u914D\u7F6E",category:"style"},{name:"tooltip",type:"object",description:"\u63D0\u793A\u4FE1\u606F",category:"interaction"},{name:"scale",type:"object",description:"\u5EA6\u91CF\u914D\u7F6E",category:"optional"},{name:"interaction",type:"object",description:"\u4EA4\u4E92\u914D\u7F6E",category:"interaction"},{name:"theme",type:"string",description:"\u56FE\u8868\u4E3B\u9898",category:"style"},...Yt(Ut,"body")],example:{props:{type:"line",theme:"light"},body:{xField:"year",yField:"value",seriesField:"category",data:[{year:"1991",value:3,category:"A"},{year:"1992",value:4,category:"A"},{year:"1993",value:3.5,category:"A"},{year:"1994",value:5,category:"A"},{year:"1995",value:4.9,category:"A"},{year:"1996",value:6,category:"A"},{year:"1997",value:7,category:"A"},{year:"1998",value:9,category:"A"},{year:"1999",value:13,category:"A"},{year:"1991",value:3,category:"B"},{year:"1992",value:4,category:"B"},{year:"1993",value:3.5,category:"B"},{year:"1994",value:5,category:"B"},{year:"1995",value:4.9,category:"B"},{year:"1996",value:6,category:"B"},{year:"1997",value:7,category:"B"},{year:"1998",value:9,category:"B"},{year:"1999",value:13,category:"B"}]}}};var Ke={tag:"xcml:insight-card",title:"\u6D1E\u5BDF\u5361\u7247 (Pro)",description:"\u5168\u91CF\u5C55\u793A\u7684\u6D1E\u5BDF\u5361\u7247\uFF0C\u652F\u6301\u5F15\u7528\u6765\u6E90\u4E0E\u884C\u52A8\u5EFA\u8BAE\u3002",props:[{name:"title",type:"string",description:"\u6D1E\u5BDF\u6807\u9898"},{name:"sentiment",type:"enum",description:"\u60C5\u611F\u503E\u5411",options:["positive","negative","neutral","insight","warning","success","error"],default:"insight"},{name:"icon",type:"string",description:"\u56FE\u6807 (Emoji \u6216 AntD Icon \u540D\u79F0)"},{name:"variant",type:"string",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",default:"card"}],body:[{name:"actions",type:"array",description:"\u5EFA\u8BAE\u884C\u52A8\u5217\u8868"},{name:"citations",type:"array",description:"\u5F15\u7528\u6765\u6E90\u5217\u8868"},{name:"highlights",type:"array",description:"\u9700\u8981\u9AD8\u4EAE\u7684\u5173\u952E\u8BCD\u5217\u8868"},{name:"content",type:"string",description:"\u6D1E\u5BDF\u6B63\u6587\u5185\u5BB9 (\u652F\u6301\u4ECE Body \u4F20\u5165)"}],example:{props:{title:"\u5E93\u5B58\u9884\u8B66\uFF1A\u70ED\u95E8\u5546\u54C1\u7F3A\u8D27\u98CE\u9669",sentiment:"warning"},body:{highlights:["3 \u5929\u5185\u552E\u7F44","\u7ACB\u5373\u542F\u52A8\u8865\u8D27"],citations:["\u5E93\u5B58\u7BA1\u7406\u7CFB\u7EDF","\u9500\u552E\u9884\u6D4B\u6A21\u578B"],actions:["\u751F\u6210\u8865\u8D27\u5355","\u6682\u505C\u5E7F\u544A\u6295\u653E"],content:"\u6839\u636E\u5F53\u524D\u9500\u552E\u901F\u7387\uFF0CiPhone 15 Pro Max \u5C06\u5728 3 \u5929\u5185\u552E\u7F44\u3002\u5EFA\u8BAE\u7ACB\u5373\u542F\u52A8\u8865\u8D27\u6D41\u7A0B\uFF0C\u5E76\u8C03\u6574\u5E7F\u544A\u6295\u653E\u7B56\u7565\u4EE5\u907F\u514D\u8D85\u5356\u3002"},contentProp:"content"}};var Je={tag:"xcml:interactive-summary",title:"\u4EA4\u4E92\u5F0F\u6C47\u603B",description:"\u5E26\u64CD\u4F5C\u6309\u94AE\u7684\u6570\u503C\u6C47\u603B\u5361\u7247\uFF0C\u652F\u6301\u5B9E\u65F6\u8C03\u6574\u6570\u503C\u5E76\u89E6\u53D1\u4E1A\u52A1\u56DE\u8C03\u3002",props:[{name:"label",type:"string",description:"\u6307\u6807\u540D\u79F0",default:"\u8C03\u6574\u76EE\u6807"},{name:"value",type:"number",description:"\u521D\u59CB\u6570\u503C",default:0},{name:"step",type:"number",description:"\u8C03\u6574\u6B65\u957F",default:1},{name:"unit",type:"string",description:"\u6570\u503C\u5355\u4F4D"},{name:"actionId",type:"string",description:"\u89E6\u53D1\u56DE\u8C03\u7684\u4E8B\u4EF6 ID",default:"update_target"},{name:"variant",type:"string",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",default:"card"}],body:[{name:"content",type:"string",description:"\u6C47\u603B\u6587\u672C\u5185\u5BB9 (\u652F\u6301\u4ECE Body \u4F20\u5165)"},{name:"highlightKeywords",type:"array",description:"\u6587\u672C\u4E2D\u9700\u8981\u9AD8\u4EAE\u7684\u5173\u952E\u8BCD\u6570\u7EC4"},{name:"trendData",type:"array",itemType:"number",description:"\u80CC\u666F\u8D8B\u52BF\u56FE\u6570\u636E"}],example:{props:{label:"\u5B63\u5EA6\u9500\u552E\u76EE\u6807",value:5e3,unit:"k",step:100,actionId:"set_sales_target"},body:{trendData:[10,20,15,30,40,35,50],content:"\u6839\u636E\u5F53\u524D\u4E1A\u52A1\u589E\u957F\uFF0C\u5EFA\u8BAE\u5C06\u76EE\u6807\u8BBE\u5B9A\u5728 5000k \u4EE5\u4E0A\u3002"},contentProp:"content"}};var Ge={tag:"x-metric-card",title:"\u590D\u5408\u6307\u6807\u5361",description:"\u589E\u5F3A\u578B\u6307\u6807\u5C55\u793A\uFF0C\u652F\u6301\u6570\u503C\u52A8\u753B\u3001\u5355\u4F4D\u3001\u524D\u7F00\u4EE5\u53CA\u540C\u6BD4/\u73AF\u6BD4\u8D8B\u52BF\u3002",props:[{name:"title",type:"string",description:"\u5361\u7247\u6807\u9898"},{name:"label",type:"string",description:"\u6307\u6807\u540D\u79F0 (title \u7684\u522B\u540D)"},{name:"unit",type:"string",description:"\u6570\u503C\u5355\u4F4D"},{name:"prefix",type:"string",description:"\u6570\u503C\u524D\u7F00"},{name:"footer",type:"string",description:"\u5E95\u90E8\u8F85\u52A9\u4FE1\u606F"},{name:"precision",type:"number",description:"\u4FDD\u7559\u5C0F\u6570\u4F4D\u6570",default:2},{name:"variant",type:"string",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",default:"card"}],body:[{name:"value",type:"number",description:"\u6838\u5FC3\u6570\u503C",required:!0},{name:"wow",type:"number",description:"\u73AF\u6BD4\u589E\u957F\u7387 (%)"},{name:"yoy",type:"number",description:"\u540C\u6BD4\u589E\u957F\u7387 (%)"}],example:{props:{label:"\u6D3B\u8DC3\u7528\u6237",unit:"\u4EBA"},body:{value:84200,wow:12.5},contentProp:"value"}};var Ue={tag:"xcml:mini-kpi-strip",title:"\u8FF7\u4F60\u6307\u6807\u6761",description:"\u7D27\u51D1\u7684\u6A2A\u5411\u6307\u6807\u6392\u5217\uFF0C\u652F\u6301\u8FF7\u4F60\u8D8B\u52BF\u56FE\uFF08Sparkline\uFF09\u548C\u73AF\u6BD4\u5C55\u793A\u3002",props:[],body:[{name:"items",type:"array",description:"\u6307\u6807\u9879\u5217\u8868",items:[{name:"label",type:"string",description:"\u6307\u6807\u540D\u79F0",required:!0},{name:"value",type:"string",description:"\u6307\u6807\u5F53\u524D\u6570\u503C",required:!0},{name:"wow",type:"number",description:"\u73AF\u6BD4\u589E\u957F\u7387 (%)"},{name:"trendData",type:"array",itemType:"number",description:"\u8FF7\u4F60\u8D8B\u52BF\u56FE\u6570\u636E\u70B9\u6570\u7EC4"}]}],example:{body:{items:[{label:"\u8425\u6536",value:"\xA51.2M",wow:12,trendData:[10,20,15,30,40]},{label:"\u7528\u6237",value:"85.2K",wow:-5,trendData:[50,40,45,35,30]},{label:"\u8F6C\u5316\u7387",value:"3.2%",wow:2,trendData:[2,3,2.5,3.1,3.2]},{label:"\u6D3B\u8DC3\u5EA6",value:"92%",wow:0,trendData:[90,91,92,90,92]}]}}};var Ye={tag:"xcml:poster-card",title:"\u6570\u636E\u6D77\u62A5",description:"\u7F8E\u89C2\u7684\u6570\u636E\u53EF\u89C6\u5316\u6D77\u62A5\uFF0C\u652F\u6301\u591A\u79CD\u56FE\u8868\u7EC4\u5408\u3001\u4E8C\u7EF4\u7801\u5C55\u793A\u53CA\u4E00\u952E\u4E0B\u8F7D\u56FE\u7247\u3002",props:[{name:"title",type:"string",description:"\u6D77\u62A5\u6807\u9898",default:"\u6570\u636E\u6D77\u62A5"},{name:"subTitle",type:"string",description:"\u6D77\u62A5\u526F\u6807\u9898",default:"Data Insight Poster"},{name:"themeColor",type:"string",description:"\u6D77\u62A5\u4E3B\u9898\u8272"},{name:"backgroundImage",type:"string",description:"\u80CC\u666F\u56FE\u7247 URL"},{name:"qrCode",type:"string",description:"\u4E8C\u7EF4\u7801\u5185\u5BB9",default:"https://ant.design"},{name:"author",type:"string",description:"\u4F5C\u8005",default:"ChatBI"},{name:"date",type:"string",description:"\u65E5\u671F"},{name:"variant",type:"string",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",default:"card"}],body:[{name:"charts",type:"array",description:"\u5305\u542B\u5728\u6D77\u62A5\u4E2D\u7684\u56FE\u8868\u5217\u8868",items:[{name:"type",type:"enum",description:"\u56FE\u8868\u7C7B\u578B",options:["column","line","pie"],required:!0},{name:"title",type:"string",description:"\u56FE\u8868\u6807\u9898"},{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6570\u7EC4",required:!0,items:[{name:"label",type:"string",description:"\u7EF4\u5EA6\u540D\u79F0",required:!0},{name:"value",type:"number",description:"\u6307\u6807\u6570\u503C",required:!0}]}]}],example:{props:{title:"\u53CC\u5341\u4E00\u9500\u552E\u6218\u62A5",subTitle:"2023 \u6838\u5FC3\u6307\u6807\u56DE\u987E",author:"\u6570\u636E\u5206\u6790\u56E2\u961F"},body:{charts:[{type:"pie",title:"\u5404\u6E20\u9053\u5360\u6BD4",data:[{label:"\u76F4\u64AD",value:45},{label:"\u641C\u7D22",value:30},{label:"\u5176\u4ED6",value:25}]},{type:"column",title:"\u8FD1 7 \u65E5\u8D8B\u52BF",data:[{label:"11.01",value:120},{label:"11.02",value:150},{label:"11.03",value:200}]}]}}};var Ze={tag:"xcml:snapshot-table",title:"\u5FEB\u7167\u8868\u683C",description:"\u8F7B\u91CF\u7EA7\u6570\u636E\u5FEB\u7167\uFF0C\u652F\u6301 CSV \u5BFC\u51FA\u548C\u6EDA\u52A8\u67E5\u770B\u3002",props:[{name:"title",type:"string",description:"\u8868\u683C\u6807\u9898\u3002\u6CE8\u610F\uFF1A\u5982\u679C SnapshotTable \u88AB\u5305\u88F9\u5728 Card \u4E2D\u4E14 Card \u5DF2\u8BBE\u7F6E\u6807\u9898\uFF0C\u6B64\u6807\u9898\u5C06\u81EA\u52A8\u9690\u85CF\u4EE5\u907F\u514D\u91CD\u590D\u3002"},{name:"description",type:"string",description:"\u8868\u683C\u63CF\u8FF0\uFF0C\u5C55\u793A\u5728\u6807\u9898\u4E0B\u65B9\u6216\u7EC4\u4EF6\u9876\u90E8\u3002"},{name:"bordered",type:"boolean",description:"\u662F\u5426\u663E\u793A\u8868\u683C\u5185\u90E8\u8FB9\u6846",default:!0}],body:[{name:"columns",type:"array",description:"\u8868\u683C\u5217\u5B9A\u4E49",items:[{name:"title",type:"string",description:"\u5217\u6807\u9898",required:!0},{name:"key",type:"string",description:"\u6570\u636E\u5BF9\u5E94\u5B57\u6BB5",required:!0},{name:"width",type:"number",description:"\u5217\u5BBD"},{name:"align",type:"enum",description:"\u5BF9\u9F50\u65B9\u5F0F",options:["left","center","right"]}]},{name:"rows",type:"array",description:"\u8868\u683C\u884C\u6570\u636E",items:[{name:"properties",type:"object",description:"\u884C\u6570\u636E\u5BF9\u8C61\uFF0C\u952E\u503C\u9700\u5BF9\u5E94 columns \u4E2D\u7684 key"}]}],example:{props:{title:"\u5B9E\u65F6\u5E93\u5B58\u5FEB\u7167"},body:{columns:[{title:"\u5546\u54C1\u540D",key:"name"},{title:"\u5E93\u5B58\u91CF",key:"stock"},{title:"\u9884\u8B66\u7EBF",key:"threshold"}],rows:[{name:"iPhone 15",stock:120,threshold:50},{name:"iPad Air",stock:45,threshold:30},{name:"MacBook Pro",stock:12,threshold:20}]}}};var Qe={tag:"xcml:thought-chain",title:"\u601D\u7EF4\u94FE (Timeline)",description:"\u5168\u5C55\u5F00\u7684\u65F6\u95F4\u8F74\u5F0F\u601D\u7EF4\u94FE\uFF0C\u5C55\u793A\u6267\u884C\u8017\u65F6\u4E0E\u8BE6\u7EC6\u7ED3\u679C\u3002",props:[{name:"title",type:"string",description:"\u601D\u7EF4\u94FE\u6807\u9898",default:"\u5206\u6790\u8FC7\u7A0B"},{name:"variant",type:"string",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",default:"card"}],body:[{name:"steps",type:"array",description:"\u6267\u884C\u6B65\u9AA4\u5217\u8868",items:[{name:"tool",type:"string",description:"\u4F7F\u7528\u7684\u5DE5\u5177\u540D\u79F0"},{name:"action",type:"string",description:"\u6267\u884C\u7684\u64CD\u4F5C\u63CF\u8FF0"},{name:"status",type:"enum",description:"\u6267\u884C\u72B6\u6001",options:["success","running","pending","error"]},{name:"duration",type:"string",description:"\u8017\u65F6\u63CF\u8FF0"},{name:"thought",type:"string",description:"\u601D\u8003\u8FC7\u7A0B/\u65E5\u5FD7"},{name:"result",type:"string",description:"\u6267\u884C\u7ED3\u679C\u6458\u8981"},{name:"error",type:"string",description:"\u9519\u8BEF\u4FE1\u606F"}]}],example:{props:{title:"\u667A\u80FD\u5206\u6790\u6267\u884C\u8DEF\u5F84"},body:{steps:[{tool:"SQL Generator",action:"\u751F\u6210\u67E5\u8BE2\u8BED\u53E5",duration:"120ms",status:"success",thought:"\u6839\u636E\u7528\u6237\u610F\u56FE\uFF0C\u9700\u8981\u67E5\u8BE2 2023 \u5E74\u540E\u7684\u9500\u552E\u6570\u636E\u3002",result:'SELECT * FROM sales WHERE date > "2023-01-01"'},{tool:"Data Query",action:"\u6267\u884C\u6570\u636E\u5E93\u67E5\u8BE2",duration:"1.2s",status:"success",thought:"\u6B63\u5728\u8FDE\u63A5\u751F\u4EA7\u5E93\u6267\u884C\u67E5\u8BE2...",result:"Total rows: 1250"},{tool:"Analysis",action:"\u8BA1\u7B97\u540C\u6BD4\u589E\u957F\u7387",duration:"45ms",status:"success",thought:"\u5BF9\u6BD4\u53BB\u5E74\u540C\u671F\u6570\u636E\u8FDB\u884C\u8BA1\u7B97\u3002",result:"YoY Growth: +15.2%"}]}}};var Zt=[{name:"theme",type:"enum",description:"\u7EC4\u4EF6\u89C6\u89C9\u4E3B\u9898\u98CE\u683C",category:"style",options:["light","dark","ocean","sunset"],default:void 0}],un={"xcml:metric":We,"xcml:table":qe,"xcml:chart":fe,"xcml:list":ze,"xcml:thought-chain":Qe,"xcml:insight-card":Ke,"xcml:metric-card":Ge,"xcml:card":Ve,"xcml:toc":He,"xcml:poster-card":Ye,"xcml:mini-kpi-strip":Ue,"xcml:interactive-summary":Je,"xcml:snapshot-table":Ze},he=Object.fromEntries(Object.entries(un).map(([t,e])=>[t,{...e,props:[...e.props||[],...Zt]}]));var nt=require("yaml");function yn(t){let{theme:e,variant:r,size:o,className:n,style:a}=t;return{theme:e,variant:r,size:o,className:n,style:a}}function ht(t,e){let r=t.props||{},o=t.body!==void 0?t.body:t.data,n=(t.props||{})["data-xcml-raw"];if(n)try{o=decodeURIComponent(escape(atob(n)))}catch(l){console.warn("[XCML] Failed to decode data-xcml-raw:",l)}if(typeof o=="string"){let l=o.trim();if(l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]"))try{o=JSON.parse(l)}catch{}}let a={};if(e&&((e.props||[]).forEach(l=>{l.default!==void 0&&(a[l.name]=l.default)}),(e.body||[]).forEach(l=>{l.default!==void 0&&(a[l.name]=l.default)})),o!=null)if(typeof o=="object"&&!Array.isArray(o))Object.assign(a,o),Array.isArray(o.data)&&(a.data=o.data);else if(Array.isArray(o)){let l=(e?.body||[]).find(c=>c.type==="array")?.name||"data";a[l]=o}else{let l=e?.example?.contentProp||(e?.body||[]).find(c=>c.name==="content"||c.name==="value")?.name||"content";a[l]=o}return Object.assign(a,r),["theme","variant","layout","size"].forEach(l=>{a[l]===void 0&&r[l]!==void 0&&(a[l]=r[l])}),a}var me=t=>{if(Array.isArray(t))return t;if(typeof t=="string"){let e=t.trim();if(!e)return[];if(e.startsWith("["))try{return JSON.parse(e)}catch{try{return JSON.parse(e.replace(/'/g,'"'))}catch{}}return e.split(/[,,]/).map(r=>r.trim()).filter(Boolean)}return[]};function pe(t,e={}){let r={};return Object.entries(t).forEach(([o,n])=>{r[`xcml:${o}`]=n,e[o]&&e[o].forEach(a=>{r[`xcml:${a}`]=n})}),r}var gn=(t,e="xcml-node")=>{if(!t||!t.type||!he[t.type])return null;let n=(globalThis.__XCML_RENDERERS__||{})[t.type];return n?n(t,e):null};function fn(t,e){let r=[],o=t.props||{};if(e.props.forEach(n=>{n.required&&(o[n.name]===void 0||o[n.name]===null||o[n.name]==="")&&r.push(`\u5C5E\u6027 '${n.name}' (${n.description}) \u662F\u5FC5\u586B\u9879`)}),e.props.forEach(n=>{let a=o[n.name];a!=null&&(n.type==="number"&&isNaN(Number(a))&&r.push(`\u5C5E\u6027 '${n.name}' \u5E94\u4E3A\u6570\u5B57\u7C7B\u578B`),n.type==="boolean"&&typeof a!="boolean"&&a!=="true"&&a!=="false"&&r.push(`\u5C5E\u6027 '${n.name}' \u5E94\u4E3A\u5E03\u5C14\u7C7B\u578B`),n.type==="enum"&&n.options&&!n.options.includes(a)&&r.push(`\u5C5E\u6027 '${n.name}' \u7684\u503C '${a}' \u4E0D\u5728\u53EF\u9009\u8303\u56F4\u5185: ${n.options.join(", ")}`))}),e.body&&e.body.length>0){let n=t.body!==void 0?t.body:t.data;e.body.forEach(a=>{a.required&&(n==null||n===""?r.push("\u6807\u7B7E\u4F53\u5185\u5BB9 (Body Data) \u662F\u5FC5\u586B\u9879"):typeof n=="object"&&!Array.isArray(n)&&(n[a.name]===void 0||n[a.name]===null||n[a.name]==="")&&r.push(`\u6807\u7B7E\u4F53\u5185\u5BB9\u5E94\u5305\u542B '${a.name}' (${a.description}) \u5B57\u6BB5`))})}return{valid:r.length===0,errors:r}}function bt(t,e){let{node:r,streamStatus:o}=t,n=ht(r,e),a=r?.streamStatus||o||n.streamStatus,s=a==="loading"||r?.body?.["data-xcml-loading"]==="true"||r?.data?.["data-xcml-loading"]==="true"||r?.props?.["data-xcml-loading"]==="true"||n?.["data-xcml-loading"]==="true"||t.loading,l={theme:n.theme,variant:n.variant,size:n.size,className:t.className,style:t.style,loading:s,streamStatus:a,error:t.error};return{merged:n,baseProps:l,isLoading:s,streamStatus:a}}function rt(t){return t.startsWith("xcml:")?t.slice(5):t.startsWith("x-")?t.slice(2):t}function Qt(t){return`x-${rt(t)}`}function Ae(t){return`xcml:${rt(t)}`}var tt=class{constructor(){this.listeners={}}on(e,r){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(r)}emit(e,r){(this.listeners[e]||[]).forEach(o=>o(r))}refresh(e){this.emit("refresh",{id:e})}update(e,r){this.emit("update",{id:e,payload:r})}resize(e){this.emit("resize",{id:e})}export(e,r){this.emit("export",{id:e,type:r})}},be=new tt,hn=/\/\/(.*)$/gm,bn=/\/\*[\s\S]*?\*\//g;function er(t,e="json"){let r=t.trim();if(!r)return null;if((e==="json"||e==="jsonc")&&!(r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]")))return r;try{if(e==="json"||e==="jsonc"){let o=e==="jsonc"?r.replace(hn,"").replace(bn,""):r;try{return JSON.parse(o)}catch(n){try{let a=(0,et.parse)(o);if(typeof a=="string"&&(a.startsWith("{")||a.startsWith("[")))throw n;return a}catch{throw n}}}if(e==="yaml")return(0,et.parse)(r);if(e==="csv"||e==="tsv"){let o=e==="csv"?",":" ",n=r.split(/\r?\n/).filter(s=>s.trim());if(n.length===0)return[];let a=n[0].split(o).map(s=>s.trim());return n.slice(1).map(s=>{let l=s.split(o),c={};return a.forEach((m,p)=>{let d=l[p]?.trim();d==="true"?d=!0:d==="false"?d=!1:d!==""&&!isNaN(Number(d))&&(d=Number(d)),c[m]=d}),c})}return e==="ndjson"?r.split(/\r?\n/).filter(Boolean).map(o=>JSON.parse(o)):JSON.parse(r)}catch(o){throw o}}function xn(t,e){return e!=null}function xt(t,e){if(!e||typeof e!="object"||Array.isArray(e))return e;let r=Ae(t),o=he[r];if(!o)return e;let n={...e};return[...o.props||[],...o.body||[]].forEach(s=>{let l=n[s.name];if((s.type==="object"||s.type==="array")&&typeof l=="string")try{let c=l.trim();if(c.startsWith("{")||c.startsWith("[")){let m=c,p=0;for(;typeof m=="string"&&p<2;){let d=JSON.parse(m);if(d===null||typeof d!="object")if(typeof d=="string"&&(d.startsWith("{")||d.startsWith("[")))m=d;else break;else{m=d;break}p++}n[s.name]=m}}catch{}}),n}function Ct(t,e,r,o={}){let n=Ae(t),a=he[n],s={},l={},{preferBody:c=!1}=o,m=tr(r),p=m;a&&(typeof m=="string"?p={[a.example?.contentProp||(a.body||[]).find(x=>x.name==="content"||x.name==="value")?.name||"content"]:m}:m&&typeof m=="object"&&Array.isArray(m)),p&&typeof p=="object"&&!Array.isArray(p)&&Object.keys(p).forEach(b=>{/^\d+$/.test(b)||(l[b]=p[b])});let d={...p&&typeof p=="object"&&!Array.isArray(p)?p:{},...e};if(!a)return{props:e,body:r};let i=new Set((a.props||[]).map(b=>b.name)),u=new Set((a.body||[]).map(b=>b.name));for(let[b,x]of Object.entries(d))/^\d+$/.test(b)||(c?i.has(b)||u.has(b)?l[b]=x:b in e?s[b]=x:l[b]=x:i.has(b)?s[b]=x:u.has(b)?l[b]=x:b in e?s[b]=x:l[b]=x);let g=l;if(Array.isArray(m))if(Object.keys(l).length===0)g=m;else{let b=(a.body||[]).find(x=>x.type==="array")?.name||"data";l[b]=m,g=l}return{props:xt(n,s),body:xt(n,g)}}function tr(t){if(Array.isArray(t))return t;if(t&&typeof t=="object"){let e=Object.keys(t).filter(r=>/^\d+$/.test(r)).sort((r,o)=>Number(r)-Number(o));if(e.length>0&&e.length===Object.keys(t).length&&e.every((r,o)=>Number(r)===o))return e.map(r=>t[r])}return t}function Cn(t){let e=Ae(t.tag||t.type||"unknown"),r=Qt(e),o={...t.props||{}},n=tr(t.body),{body:a}=Ct(e,o,n,{preferBody:!0}),s=[],l=a,c=Object.keys(a||{});c.length===1&&c[0]==="data"&&Array.isArray(a.data)&&(l=a.data);let m=s.length>0?" "+s.join(" "):"",p=JSON.stringify(l,null,2);return`<${r}${m}>
|
|
2
2
|
${p}
|
|
3
|
-
</${r}>`}function
|
|
3
|
+
</${r}>`}function vn(t){if(!t)return null;let e=t.trim();if(!e.startsWith("<"))try{let i=(0,et.parse)(e);if(i&&(i.tag||i.type))return{tag:i.tag||i.type,props:i.props||{},body:i.body||i.data||i.dataProps||{}}}catch{}let r=e.match(/^<((?:xcml:|x-)[^\s/>]+)\s*([\s\S]*?)(\/?>)([\s\S]*?)$/);if(!r)return null;let[,o,n,a]=r,s=a==="/>",l={},c=/([a-zA-Z0-9-]+)\s*=\s*(?:'([^']*)'|"([^"]*)"|`([^`]*)`|((?:(?!\s|\/|>).)+))/g,m;for(;(m=c.exec(n))!==null;){let i=m[1],u=m[2]||m[3]||m[4]||m[5];l[i]=u}let p="";if(!s){let i=`</${o}>`,u=e.lastIndexOf(i);if(u!==-1){let g=-1,b=null;for(let x=0;x<e.length;x++){let f=e[x];if((f==="'"||f==='"'||f==="`")&&(b?b===f&&(b=null):b=f),f===">"&&!b){g=x;break}}g!==-1&&(p=e.slice(g+1,u).trim())}}let d=xe(o,l,p);return{tag:d.type,props:d.props,body:d.body}}function xe(t,e,r){let o=rt(t),n=Ae(o),a=e["data-format"]||"json",s;try{s=er(r,a)}catch{if(o==="list")try{s=wn(r)}catch{}!s&&r.trim()&&(s=r.trim()),s||(s=null)}let l={...e};for(let p in l){let d=l[p];if(typeof d=="string"){let i=d.trim();for(;i.length>=2&&(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'")||i.startsWith("`")&&i.endsWith("`"));)i=i.slice(1,-1).trim();if(i==="true")l[p]=!0;else if(i==="false")l[p]=!1;else if(/^-?\d+(\.\d+)?$/.test(i)){let u=Number(i);isNaN(u)||(l[p]=u)}else if(i.startsWith("[")||i.startsWith("{"))try{l[p]=JSON.parse(i)}catch{try{l[p]=JSON.parse(i.replace(/'/g,'"'))}catch{l[p]=i}}else l[p]=i}}let{props:c,body:m}=Ct(n,l,s);return{type:n,props:c,body:m,__source:r}}function wn(t){let r=t.split(/\r?\n/).filter(o=>o.trim()).map(o=>{let n=o.match(/^\s*[-*+]\s*\[([ x-])\]\s*(.*)$/);if(n){let s=n[1],l=n[2].trim(),c="todo";return s==="x"?c="done":s==="-"&&(c="doing"),{title:l,status:c}}let a=o.match(/^\s*[-*+]\s*(.*)$/);return a?{title:a[1].trim(),status:"normal"}:null}).filter(Boolean);return r.length>0?{items:r}:null}function Sn(t){if(!t.startsWith("<x-")&&!t.startsWith("<xcml:"))return t;let e=t.match(/^(<(?:x-|xcml:)[^\s/>]+)\s*([\s\S]*?)(\/?>)$/);if(!e)return t;let[,r,o,n]=e;if(!o)return t;let a=/([a-zA-Z0-9-]+)\s*=\s*([\[\{])/g,s=0,l="",c;for(;(c=a.exec(o))!==null;){let m=c[1],p=c[2],d=p==="["?"]":"}",i=c.index,u=i+c[0].length-1;if((o.slice(0,i).match(/['"]/g)||[]).length%2!==0)continue;let x=0,f=-1;for(let y=u;y<o.length;y++)if(o[y]===p?x++:o[y]===d&&x--,x===0){f=y;break}if(f!==-1){let y=o[u-1];if(y==="'"||y==='"')continue;let h=o.slice(u,f+1);l+=o.slice(s,i),l+=`${m}='${h}'`,s=f+1,a.lastIndex=s}}return l+=o.slice(s),`${r} ${l}${n}`}function vt(t,e){if(!t)return"";let r=t.match(/<(xcml:|xcml|xcm|xc|x)$/);r&&(t=t.slice(0,r.index));let o=t.replace(/<(\/?)xcml:([a-zA-Z0-9-]+)/g,"<$1x-$2"),n=e?new Set(e):null,a=[],s=0,l=o.length;for(;s<l;){let c=o[s];if(c!=="<"&&c!=="`"){let m=o.indexOf("<",s+1),p=o.indexOf("`",s+1),d=-1;if(m!==-1&&p!==-1?d=Math.min(m,p):m!==-1?d=m:p!==-1&&(d=p),d===-1){a.push(o.slice(s));break}a.push(o.slice(s,d)),s=d;continue}if(o.startsWith("```",s)){let m=o.indexOf("```",s+3);if(m===-1){a.push(o.slice(s));break}a.push(o.slice(s,m+3)),s=m+3;continue}if(c==="`"){let m=o.indexOf("`",s+1);if(m===-1){a.push(o.slice(s));break}a.push(o.slice(s,m+1)),s=m+1;continue}if(c==="<"){let m=-1,p=null;for(let d=s+1;d<l;d++){let i=o[d];if((i==="'"||i==='"'||i==="`")&&(p?p===i&&(p=null):p=i),i===">"&&!p){m=d;break}}if(m===-1){if(s+1<l&&/[a-zA-Z\/]/.test(o[s+1])){let d=s+(o[s+1]==="/"?2:1);for(;d<l&&/[a-zA-Z0-9-]/.test(o[d]);)d++;let i=o.slice(s+(o[s+1]==="/"?2:1),d);if(i.startsWith("x-")){if(n&&!n.has(i))break;o[s+1]!=="/"?a.push(`
|
|
4
4
|
|
|
5
5
|
<${i} data-xcml-loading="true"></${i}>
|
|
6
6
|
|
|
7
7
|
`):a.push(`
|
|
8
8
|
|
|
9
|
-
${
|
|
9
|
+
${o.slice(s).trim()}>
|
|
10
10
|
|
|
11
|
-
`);break}}a.push(
|
|
11
|
+
`);break}}a.push(c),s++;continue}else{let d=o[s+1]==="/",i=s+(d?2:1),u=i;for(;u<m&&/[a-zA-Z0-9-]/.test(o[u]);)u++;let g=o.slice(i,u);if(g.startsWith("x-")){if(n&&!n.has(g)){let f=`</${g}>`,y=o.indexOf(f,s);s=y!==-1?y+f.length:m+1;continue}let b=o.slice(s,m+1);d||(b=Sn(b.replace(/\r?\n/g," ")));let x=b.replace(/\s+/g," ");if(d||x.endsWith("/>")){a.push(`
|
|
12
12
|
|
|
13
13
|
${x}
|
|
14
14
|
|
|
15
|
-
`),s=m+1;continue}else{let
|
|
15
|
+
`),s=m+1;continue}else{let f=`</${g}>`,y=o.indexOf(f,m+1);if(y===-1){let h=x;h.includes("data-xcml-loading")||(h=h.replace(">",' data-xcml-loading="true">')),a.push(`
|
|
16
16
|
|
|
17
17
|
${h}
|
|
18
|
-
</${
|
|
18
|
+
</${g}>
|
|
19
19
|
|
|
20
|
-
`);break}else{let h=
|
|
20
|
+
`);break}else{let h=o.slice(m+1,y),w=h.trim(),P=h;(w.startsWith("{")||w.startsWith("["))&&(P=h.replace(/\\/g,"\\\\"));let q=x,_=P;if(w){let E=btoa(unescape(encodeURIComponent(h)));q=x.replace(">",` data-xcml-raw="${E}">`),_=""}a.push(`
|
|
21
21
|
|
|
22
|
-
${
|
|
23
|
-
${
|
|
24
|
-
${
|
|
22
|
+
${q}
|
|
23
|
+
${_}
|
|
24
|
+
${f}
|
|
25
25
|
|
|
26
|
-
`),s=
|
|
26
|
+
`),s=y+f.length;continue}}}}}a.push(c),s++}return a.join("").replace(/\n{3,}/g,`
|
|
27
27
|
|
|
28
|
-
`).trim()}var $=
|
|
28
|
+
`).trim()}var $=X(require("react"),1),sr=require("@ant-design/x-markdown");var Ce=require("@chatbi-v/ui-shell"),lr=require("@ant-design/icons");var H=X(require("react"),1),wt=require("react/jsx-runtime"),rr=(0,H.createContext)([]),nr=(0,H.createContext)({register:()=>{},unregister:()=>{}}),Mn=()=>(0,H.useContext)(rr),St=()=>(0,H.useContext)(nr),or=()=>{let t=Mn(),{register:e,unregister:r}=St();return{items:t,register:e,unregister:r}},ar=({children:t})=>{let[e,r]=(0,H.useState)(new Map),o=H.default.useRef(0),n=(0,H.useCallback)(c=>{r(m=>{let p=new Map(m),d=p.get(c.id);return d&&d.title===c.title&&d.level===c.level?m:(p.set(c.id,{...c,index:d?d.index:o.current++}),p)})},[]),a=(0,H.useCallback)(c=>{r(m=>{let p=new Map(m);return p.delete(c)?p:m})},[]),s=H.default.useMemo(()=>Array.from(e.values()).sort((c,m)=>c.index-m.index),[e]),l=H.default.useMemo(()=>({register:n,unregister:a}),[n,a]);return(0,wt.jsx)(nr.Provider,{value:l,children:(0,wt.jsx)(rr.Provider,{value:s,children:t})})};var Y=require("react"),Mt=require("react/jsx-runtime"),ir=(0,Y.createContext)({containerWidth:0}),Nt=({children:t})=>{let[e,r]=(0,Y.useState)(0),o=(0,Y.useRef)(null),n=(0,Y.useRef)(0),a=(0,Y.useRef)(0);return(0,Y.useEffect)(()=>{let s=o.current;if(!s)return;let l=d=>{for(let i of d){let u=i.borderBoxSize?.[0]?.inlineSize??i.contentRect.width,g=Math.floor(u);Math.abs(g-n.current)>=1&&(cancelAnimationFrame(a.current),a.current=requestAnimationFrame(()=>{n.current=g,r(g)}))}},c=new ResizeObserver(l);c.observe(s);let p=s.getBoundingClientRect().width;return n.current=Math.floor(p),r(Math.floor(p)),()=>{c.disconnect(),cancelAnimationFrame(a.current)}},[]),(0,Mt.jsx)(ir.Provider,{value:{containerWidth:e},children:(0,Mt.jsx)("div",{ref:o,className:"xcml-layout-container w-full min-w-0 relative block","data-container-width":e,children:t})})},Lt=()=>(0,Y.useContext)(ir);function Nn(t={}){let r=`(${(t.tags||["chart","table","metric","list","card","toc"]).join("|")})`,o=new RegExp(`<x-${r}([^>]*)>`,"i");return{level:"block",name:"x-tag",start(n){return n.indexOf("<x-")},tokenizer(n){let a=n.match(o);if(!a)return;let s=a[1],l=a[2]||"",c=a.index||0,m=new RegExp(`</x-${s}>`,"i"),p=n.slice(c+a[0].length),d=p.match(m);if(!d)return;let i=p.slice(0,d.index),u=n.slice(c,c+a[0].length+i.length+d[0].length),g=Ln(l);return{type:"x-tag",raw:u,name:s,attrs:g,body:i}},renderer(n){let a=xe(n.name,n.attrs,n.body);return{type:a.type,props:a.props,body:a.body}}}}function Ln(t){let e={},r=/(\w[\w-]*)(=\"([^\"]*)\"|=\'([^\']*)\'|=([^\s"']+))?/g,o;for(;o=r.exec(t);){let n=o[1],a=o[3]??o[4]??o[5]??!0;e[n]=a}return e}var cr=require("clsx"),ot=require("tailwind-merge"),R=require("react/jsx-runtime");function at(t){let{content:e,stream:r,renderers:o,className:n,style:a,openLinksInNewTab:s,dompurifyConfig:l,enableHoverSource:c=!1,theme:m,onContentChange:p,onComponentRender:d}=t;$.default.useEffect(()=>{e&&p&&p(e)},[e,p]);let i=$.default.useDeferredValue(e),u=$.default.useMemo(()=>{let f=o?Object.keys(o).map(y=>y.startsWith("xcml:")?`x-${y.slice(5)}`:y):[];return i?vt(i,f):""},[i,o]),g=$.default.useMemo(()=>new WeakMap,[]),b=$.default.useMemo(()=>{let f={};if(o){let h=new Set;Object.keys(o).forEach(w=>{let P=w.startsWith("xcml:"),q=w.startsWith("x-");if(P||q){let _=P?`x-${w.slice(5)}`:w;h.add(_);let E=o[w];f[_]=V=>{let{domNode:N,className:j,streamStatus:z,node:Q,children:D,...O}=V,ee=g.get(N);if(!ee){let de="",ft=O["data-xcml-raw"];if(ft)try{de=decodeURIComponent(escape(atob(ft)))}catch(Jt){console.error("[XCML] Failed to decode raw body:",Jt),de=Pt(N?.children||[])}else de=Pt(N?.children||[]);let Kt=P?w.slice(5):w.slice(2);ee=xe(Kt,O,de),g.set(N,ee)}let I={...ee};O["data-xcml-loading"]==="true"?I.streamStatus="loading":I.streamStatus=z;let oe=E(I,O.key??_);return(0,R.jsx)(kn,{tag:_,node:I,className:j,enableHoverSource:c,onStatusChange:de=>d?.(_,de),children:oe})}}})}f.pre=h=>{let{domNode:w,streamStatus:P,node:q,..._}=h,E=(w?.children||[]).find(j=>j?.name==="code"),V=[E?.attribs?.class,E?.attribs?.classname,E?.attribs?.className].filter(Boolean).join(" ");if(/language-mermaid/.test(V)){let j=Pt(E?.children||[]),z=j.split("").reduce((D,O)=>(D=(D<<5)-D+O.charCodeAt(0),D&D),0),Q=`m-${Math.abs(z)}`;return(0,R.jsx)(Pn,{id:Q,code:j,theme:m},h.key)}return $.default.createElement("pre",_,h.children)},f.p=h=>{let{domNode:w,node:P,children:q,streamStatus:_,...E}=h;return w?.children?.some(N=>N.type==="tag"&&(["div","p","pre","blockquote","table","ul","ol","h1","h2","h3","h4","h5","h6","form","fieldset","address"].includes(N.name)||N.name&&N.name.startsWith("x-")))||P?.children?.some(N=>N.tagName==="div"||N.tagName&&N.tagName.startsWith("x-"))?(0,R.jsx)("div",{...E,className:(0,ot.twMerge)("mb-4 w-full",E.className),children:q}):(0,R.jsx)("p",{...E,children:q})};let y=$.default.memo(({level:h,children:w,domNode:P,streamStatus:q,node:_,...E})=>{let{register:V,unregister:N}=St(),j=$.default.useCallback(I=>typeof I=="string"?I:Array.isArray(I)?I.map(j).join(""):$.default.isValidElement(I)?j(I.props.children):"",[]),z=j(w),Q=$.default.useMemo(()=>z.trim().toLowerCase().replace(/\s+/g,"-"),[z]),D=E.id||Q||`h${h}-${Math.random().toString(36).slice(2,9)}`,O=$.default.useRef(null);$.default.useEffect(()=>{if(!V)return;let I={id:D,title:z,level:h};return(!O.current||O.current.id!==I.id||O.current.title!==I.title||O.current.level!==I.level)&&(O.current&&N?.(O.current.id),V(I),O.current=I),()=>{O.current&&(N?.(O.current.id),O.current=null)}},[D,z,h,V,N]);let ee=`h${h}`;return(0,R.jsxs)(ee,{id:D,className:"scroll-mt-20 group relative",...E,children:[w,c&&(0,R.jsx)("a",{href:`#${D}`,className:"ml-2 opacity-0 group-hover:opacity-100 text-muted-foreground transition-opacity no-underline",children:"#"})]})});return f.h1=h=>(0,R.jsx)(y,{level:1,...h}),f.h2=h=>(0,R.jsx)(y,{level:2,...h}),f.h3=h=>(0,R.jsx)(y,{level:3,...h}),f.h4=h=>(0,R.jsx)(y,{level:4,...h}),f.h5=h=>(0,R.jsx)(y,{level:5,...h}),f.h6=h=>(0,R.jsx)(y,{level:6,...h}),f},[o,c,m]);return(0,R.jsx)(Nt,{children:(0,R.jsx)(ar,{children:(0,R.jsx)(sr.XMarkdown,{content:u,streaming:r?{hasNextChunk:!0}:void 0,components:b,className:(0,ot.twMerge)((0,cr.clsx)("prose w-full max-w-none prose-headings:text-foreground prose-p:text-foreground prose-li:text-foreground prose-strong:text-foreground prose-code:text-foreground prose-th:text-foreground prose-td:text-foreground prose-a:text-primary prose-code:bg-muted/50 prose-code:rounded prose-code:px-1 prose-code:py-0.5 prose-pre:bg-muted/50 prose-pre:text-foreground",n)),style:a,openLinksInNewTab:s,dompurifyConfig:l})})})}function kn({children:t,tag:e,node:r,className:o,enableHoverSource:n,onStatusChange:a}){let[s,l]=$.default.useState(!1),[c,m]=$.default.useState(!1);$.default.useEffect(()=>{if(a){let i=r?.streamStatus||"success";a(i)}},[r?.streamStatus,a]);let p=i=>{i.stopPropagation(),m(!0)},d=$.default.useMemo(()=>{let i=Object.entries(r.attributes||{}).map(([u,g])=>`${u}="${g}"`).join(" ");return`<${e}${i?" "+i:""}>${r.children?`
|
|
29
29
|
`+r.children+`
|
|
30
|
-
`:""}</${e}>`},[e,r]);return(0,T.jsxs)("div",{className:(0,rt.twMerge)("not-prose w-full max-w-full overflow-x-hidden overflow-y-visible custom-scrollbar flex flex-col relative",n),onMouseEnter:()=>o&&l(!0),onMouseLeave:()=>o&&l(!1),children:[t,s&&o&&(0,T.jsx)(xe.Tooltip,{title:"\u67E5\u770B\u6E90\u7801",children:(0,T.jsx)(xe.Button,{icon:(0,T.jsx)(ir.CodeOutlined,{}),size:"small",className:"absolute top-1 right-1 z-10 opacity-80",onClick:p})}),(0,T.jsx)(xe.Modal,{open:d,onCancel:()=>m(!1),footer:null,width:800,centered:!0,title:`${e} \u6E90\u7801`,destroyOnHidden:!0,children:(0,T.jsx)("pre",{className:"bg-muted p-4 rounded-lg overflow-auto max-h-[500px] text-sm text-foreground",children:c})})]})}var Mt=new WeakMap;function Nt(t){if(!t)return"";if(Mt.has(t))return Mt.get(t);let e=[],r=o=>{o?.forEach(a=>{a&&(a.type==="text"&&typeof a.data=="string"&&e.push(a.data),Array.isArray(a.children)&&r(a.children))})};r(t);let n=e.join("");return Mt.set(t,n),n}var Mn=$.default.memo(({code:t,theme:e,id:r})=>{let n=$.default.useRef(null);return $.default.useEffect(()=>{!n.current||!t||import("mermaid").then(o=>{o.default.initialize({startOnLoad:!0,theme:e==="dark"?"dark":"default",securityLevel:"loose"});let a=r||`mermaid-${Math.random().toString(36).slice(2)}`;o.default.render(a,t).then(({svg:s})=>{n.current&&(n.current.innerHTML=s)})})},[t,e,r]),(0,T.jsx)("div",{ref:n,className:"mermaid w-full flex justify-center my-4"})});var W=F(require("react"),1),_n=F(require("@ant-design/plots"),1),Bt=require("@chatbi-v/ui-shell");var Y=require("react"),lr=require("@chatbi-v/ui-shell"),Lt=require("@chatbi-v/ui-shell"),ot=require("react/jsx-runtime"),Nn={theme:"light",setTheme:()=>null},cr=(0,Y.createContext)(Nn);function Ln({children:t,defaultTheme:e="sunset",theme:r,primaryColor:n="#ea580c",storageKey:o="xcml-ui-theme",scoped:a=!0,className:s,style:l,...d}){let[m,p]=(0,Y.useState)(()=>localStorage.getItem(o)||e),c=r??m,i=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{let y=a?i.current:window.document.documentElement;if(!y)return;if(n.startsWith("#")){let g=n.replace(/^#/,""),b=parseInt(g.substring(0,2),16),h=parseInt(g.substring(2,4),16),M=parseInt(g.substring(4,6),16);y.style.setProperty("--primary-rgb",`${b}, ${h}, ${M}`);let O=b/255,E=h/255,N=M/255,P=Math.max(O,E,N),q=Math.min(O,E,N),R=0,V=0,G=(P+q)/2;if(P!==q){let j=P-q;switch(V=G>.5?j/(2-P-q):j/(P+q),P){case O:R=(E-N)/j+(E<N?6:0);break;case E:R=(N-O)/j+2;break;case N:R=(O-E)/j+4;break}R/=6}let se=`${Math.round(R*360)} ${Math.round(V*100)}% ${Math.round(G*100)}%`;y.style.setProperty("--primary",se)}else y.style.setProperty("--primary",n);y.classList.remove("light","dark"),y.removeAttribute("data-theme");let x=["ocean","sunset","lavender","rose","amber","midnight","forest","slate","crimson","cyan"];if(c==="system"){let g=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";y.classList.add(g);return}if(c==="dark"){y.classList.add("dark");return}if(c==="light"){y.classList.add("light");return}if(x.includes(c)){y.setAttribute("data-theme",c);return}},[c,a]);let u={theme:c,setTheme:y=>{localStorage.setItem(o,y),p(y)}},f=(0,Y.useMemo)(()=>({algorithm:c==="dark"||c==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?Lt.theme.darkAlgorithm:Lt.theme.defaultAlgorithm,token:{colorPrimary:n,colorSuccess:"#10b981",colorWarning:"#f59e0b",colorError:"#e11d48",colorInfo:"#0ea5e9",borderRadius:8,fontFamily:'"Inter Variable", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'}}),[c,n]);return(0,ot.jsx)(cr.Provider,{value:u,...d,children:(0,ot.jsx)(lr.XProvider,{theme:f,children:(0,ot.jsx)("div",{ref:i,className:`xcml-scope text-inherit bg-inherit ${s||""}`,style:l,children:t})})})}var Ae=()=>{let t=(0,Y.useContext)(cr);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t};var kn={label:{style:{fillOpacity:.65,fontSize:12}},title:{style:{fontSize:12,fillOpacity:.85}},grid:{line:{style:{stroke:"#d0d0d0",lineWidth:1,lineDash:[4,4],strokeOpacity:.7}}}},Pn={label:{style:{fill:"rgba(255, 255, 255, 0.65)",fontSize:12}},title:{style:{fill:"rgba(255, 255, 255, 0.85)",fontSize:12}},grid:{line:{style:{stroke:"rgba(255, 255, 255, 0.15)",lineWidth:1,lineDash:[4,4]}}}},at={defaultColor:"#8b5cf6",colors10:["#8b5cf6","#f472b6","#0ea5e9","#fbbf24","#34d399","#f87171","#60a5fa","#a78bfa","#2dd4bf","#fb923c"],styleSheet:{backgroundColor:"transparent"},components:{axis:{common:kn},tooltip:{style:{backgroundColor:"rgba(255, 255, 255, 0.95)",boxShadow:"0 8px 24px -6px rgba(0, 0, 0, 0.12)",color:"#1e293b",borderRadius:"16px",padding:"12px 16px",border:"1px solid rgba(226, 232, 240, 0.8)",backdropFilter:"blur(4px)"}},legend:{common:{itemStates:{active:{labelStyle:{fontWeight:600,fill:"#8b5cf6"}}}}}}},dr={defaultColor:"#a78bfa",colors10:["#a78bfa","#f472b6","#38bdf8","#fbbf24","#34d399","#f87171","#60a5fa","#c4b5fd","#2dd4bf","#fb923c"],styleSheet:{backgroundColor:"transparent"},components:{axis:{common:Pn},tooltip:{style:{backgroundColor:"rgba(30, 41, 59, 0.95)",boxShadow:"0 8px 24px -6px rgba(0, 0, 0, 0.3)",color:"#f1f5f9",borderRadius:"16px",padding:"12px 16px",border:"1px solid rgba(51, 65, 85, 0.8)",backdropFilter:"blur(4px)"}},legend:{common:{labelStyle:{fill:"rgba(255, 255, 255, 0.65)"}}}}},mr={light:at,dark:dr,default:at};function kt(t){return mr[t||"default"]||at}var pr=F(require("react"),1);var Rn=pr.default.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Line}))),Pt={type:"line",schema:ke,getComponent:()=>Rn,transformProps:t=>{let e={...t};return e.seriesField&&!e.colorField&&(e.colorField=e.seriesField),e}};var ur=F(require("react"),1);var Tn=ur.default.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Column}))),Rt={type:"column",schema:Pe,getComponent:()=>Tn,transformProps:t=>{let e={...t};return e.seriesField&&!e.colorField&&(e.colorField=e.seriesField),e.scale?typeof e.scale=="object"&&!e.scale.x&&(e.scale.x={type:"band"}):e.scale={x:{type:"band"}},e}};var yr=F(require("react"),1);var Xn=yr.default.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Pie}))),Tt={type:"pie",schema:Re,getComponent:()=>Xn,transformProps:t=>{let e={...t};if(delete e.xField,delete e.yField,delete e.seriesField,!e.angleField){let r=(e.data||[])[0]||{},n=Object.keys(r).find(o=>typeof r[o]=="number");n&&(e.angleField=n)}if(!e.colorField){let r=(e.data||[])[0]||{},n=Object.keys(r).find(o=>typeof r[o]=="string");n&&(e.colorField=n)}return e}};var gr=F(require("react"),1);var Fn=gr.default.lazy(()=>import("@ant-design/plots").then(t=>({default:t.DualAxes}))),Xt={type:"dual-axes",schema:Te,getComponent:()=>Fn,transformProps:t=>{let e={...t};typeof e.width=="number"&&e.width<50&&delete e.width;let r=e.data||[],n=r.length>0?Object.keys(r[0]):[],o=!1;if(e.children&&e.children.length>0&&(o=e.children.every(l=>l.data&&l.data.length>0||n.length===0?!0:l.yField&&n.includes(l.yField)),!o&&n.length>0&&(e.children=[])),(!e.children||e.children.length===0)&&(Array.isArray(e.yField)&&e.yField.length>=2&&(n.length===0||e.yField.every(d=>n.includes(d)))&&(e.children=[{type:"interval",yField:e.yField[0]},{type:"line",yField:e.yField[1],style:{lineWidth:2}}]),(!e.children||e.children.length===0)&&r.length>0)){let l=e.xField,d=n.filter(m=>m!==l&&typeof r[0][m]=="number");d.length>=2?e.children=[{type:"interval",yField:d[0]},{type:"line",yField:d[1],style:{lineWidth:2}}]:d.length===1&&(e.children=[{type:"interval",yField:d[0]}])}let a=Array.isArray(e.data)&&e.data.length>0,s=Array.isArray(e.children)&&e.children.some(l=>l.data&&Array.isArray(l.data)&&l.data.length>0);if(!a&&s){let{data:l,...d}=e;return d}return e}};var fr=F(require("react"),1);var An=fr.default.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Funnel}))),Ft={type:"funnel",schema:Xe,getComponent:()=>An,transformProps:t=>{let e={...t};!e.xField&&e.categoryField&&(e.xField=e.categoryField),!e.yField&&e.valueField&&(e.yField=e.valueField);let r=e.data||[];if(r.length>0){let o=r[0],a=Object.keys(o);e.xField||(e.xField=a.find(s=>typeof o[s]=="string")||"type"),e.yField||(e.yField=a.find(s=>typeof o[s]=="number")||"value"),e.colorField&&!(e.colorField in o)&&(e.xField&&e.xField in o?e.colorField=e.xField:delete e.colorField),e.seriesField&&!(e.seriesField in o)&&delete e.seriesField}e.axis&&delete e.axis;let n=["light","dark","academy"];return e.theme&&!n.includes(e.theme)&&delete e.theme,typeof e.width=="number"&&e.width<100&&delete e.width,e}};var hr={line:Pt,column:Rt,pie:Tt,"dual-axes":Xt,funnel:Ft};function At(t){return t&&hr[t.toLowerCase()]||null}var br=F(require("react"),1),pe=require("@chatbi-v/ui-shell"),Ce=require("react/jsx-runtime");function _e(t,e){if(typeof t!="object"||t===null)return e;if(typeof e!="object"||e===null)return t;let r=Array.isArray(t)?[...t]:{...t};for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let o=e[n],a=r[n];typeof o=="object"&&o!==null&&typeof a=="object"&&a!==null&&!br.default.isValidElement(o)?r[n]=_e(a,o):r[n]=o}return r}function _t(t,e){if(!e)return t;let r={...t},n=[...e.props||[],...e.body||[]];return n.length===0?t:(n.forEach(o=>{let a=o.name;if(o.visibleIf&&!o.visibleIf(r)){delete r[a];return}if(o.default!==void 0&&r[a]===void 0?r[a]=o.default:o.default!==void 0&&typeof o.default=="object"&&o.default!==null&&(r[a]=_e(o.default,r[a])),o.transform){let s=r[a];r[a]=o.transform(s,r)}}),r)}function Ot(t){let{type:e,data:r,theme:n,title:o,__native__:a,...s}=t,l={data:r||[],height:t.height||300,theme:n||"light",autoFit:t.autoFit!==!1,padding:"auto",appendPadding:[20,30,30,20]},d=_e(_e(l,s),a||{});return d.seriesField&&!d.colorField&&(d.colorField=d.seriesField),d.__native__={...d},d}var Et=()=>(0,Ce.jsx)("div",{className:"w-full h-full flex items-center justify-center border border-dashed border-border rounded-lg bg-muted/30",children:(0,Ce.jsx)(pe.Empty,{image:pe.Empty.PRESENTED_IMAGE_SIMPLE,description:"\u6682\u65E0\u6570\u636E"})}),$t=({error:t,reset:e})=>(0,Ce.jsx)("div",{className:"w-full h-full flex items-center justify-center p-4 border border-dashed border-destructive/20 rounded bg-destructive/5",children:(0,Ce.jsx)(pe.Result,{status:"error",title:"\u56FE\u8868\u52A0\u8F7D\u5931\u8D25",subTitle:t.message,extra:[(0,Ce.jsx)(pe.Button,{type:"primary",onClick:e,children:"\u91CD\u8BD5"},"retry")]})});var Cr=F(require("react"),1),vr=require("@chatbi-v/ui-shell");var It=require("clsx"),xr=require("tailwind-merge");var Q=require("react/jsx-runtime"),Oe=({title:t,icon:e,children:r,source:n,summary:o,variant:a="card",theme:s,hoverable:l=!0,className:d,domNode:m,streamStatus:p,node:c,label:i,value:u,footer:f,precision:y,layout:x,note:g,trend:b,trendValue:h,unit:M,prefix:O,wow:E,yoy:N,sentiment:P,highlights:q,citations:R,actions:V,steps:G,columns:se,rows:j,charts:B,data:le,subTitle:D,themeColor:zt,backgroundImage:ce,qrCode:ut,author:Vt,date:Ht,...Yr})=>{let{theme:Zr}=Ae(),ye=a==="plain",Qr=s??c?.props?.theme??c?.data?.theme??Zr,en=(0,xr.twMerge)((0,It.clsx)("xcml-card not-prose max-w-full min-w-0 group",ye?"p-1":"rounded-md border border-border/80 bg-card shadow-sm p-card mb-6 overflow-hidden","relative transition-all duration-150 ease-out hover:ease-in-out",d,l&&!ye?"hover:shadow-card-hover hover:border-primary/50 hover:bg-card/80":""));return(0,Q.jsxs)("div",{className:en,"data-theme":Qr,...Yr,children:[t&&(0,Q.jsxs)("div",{className:"relative mb-3",children:[!ye&&(0,Q.jsx)("div",{className:"absolute -top-3 -inset-x-4 h-1 bg-gradient-to-r from-primary via-primary/60 to-primary/20 opacity-0 transition-all duration-150 group-hover:opacity-100 rounded-full scale-x-95 group-hover:scale-x-100"}),(0,Q.jsx)("div",{className:"flex items-center justify-between pb-2.5 border-b border-border/80",children:(0,Q.jsxs)("h3",{className:"text-lg font-bold text-foreground leading-snug tracking-tight flex items-center gap-3 whitespace-normal break-words flex-1",children:[!ye&&(0,Q.jsx)("span",{className:"w-1.5 h-6 rounded-full bg-primary/80 shadow-sm shrink-0"}),!ye&&e&&(0,Q.jsx)("span",{className:"flex items-center justify-center w-8 h-8 rounded-md bg-primary/10 text-primary border border-primary/20 shadow-sm",children:e}),t]})})]}),(0,Q.jsx)("div",{className:(0,It.clsx)("xcml-card-body",!ye&&"mt-0.5"),children:r})]})};var Ee=require("react/jsx-runtime");function w(t,e={}){let{schema:r,getTitle:n,getIcon:o,getVariant:a,renderLoading:s,skeleton:l=!0}=e,d=Cr.default.forwardRef((p,c)=>{let{merged:i,baseProps:u,isLoading:f,streamStatus:y}=gt(p,r);i.delta!==void 0&&i.trendValue===void 0&&(i.trendValue=i.delta);let{className:x,...g}=p,b=n?n(i):i.title,h;b&&(typeof b=="string"?h=b:typeof b=="object"&&(Array.isArray(b)?h=void 0:h=b.text||b.content||JSON.stringify(b)));let M=o?o(i):i.icon,O=a?a(i):u.variant||"card",E=i.hoverable!==void 0?i.hoverable:!0,N={title:h,icon:M,variant:O,hoverable:E,className:x,node:p.node,streamStatus:y,...g};return f?(0,Ee.jsx)(Oe,{...N,children:s?s(i):l?(0,Ee.jsx)(vr.Skeleton,{active:!0,paragraph:{rows:typeof l=="object"?l.rows:2}}):null}):(0,Ee.jsx)(Oe,{...N,children:(0,Ee.jsx)(t,{...i,ref:c})})}),m=t.displayName||t.name||"Component";return d.displayName=`withXCMLCard(${m})`,d}var K=require("react/jsx-runtime"),Sr=require("react"),On=t=>typeof t!="string"||!t?"":t.split(/[-_ ]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(""),wr={"dual-axes":"DualAxes",column:"Column",line:"Line",pie:"Pie",funnel:"Funnel"},En=t=>{if(!t)return null;let e=wr[t.toLowerCase()]||wr[t],r=_n;if(e&&e in r)return r[e];let n=On(t);return n&&n in r?r[n]:t in r?r[t]:null},jt=class extends W.default.Component{constructor(r){super(r);this.reset=()=>{this.setState({hasError:!1,error:null})};this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){console.error(`AntV Chart Error (${this.props.type}):`,r,n)}render(){return this.state.hasError&&this.state.error?this.props.errorPlaceholder?this.props.errorPlaceholder(this.state.error,this.reset):(0,K.jsx)($t,{error:this.state.error,reset:this.reset}):this.props.children}},$n=(0,W.forwardRef)((t,e)=>{let{type:r="line",node:n,theme:o,...a}=t,{theme:s}=Ae(),{containerWidth:l}=St(),d=(0,W.useRef)(null),m=(0,W.useRef)(null),p=(0,W.useMemo)(()=>At(r),[r]),c=(0,W.useMemo)(()=>p?.getComponent()||En(r),[p,r]),i=(0,W.useMemo)(()=>{let g=t.theme||o||s||"light",h=["dark","black","midnight","slate","crimson"].includes(g)?"dark":"light",M=kt(h),O=t.data,E={...t,theme:M,data:O},N=_t(E,p?.schema||ge),P=p?.transformProps?p.transformProps(N):N;return Ot(P)},[t,o,s,p]);(0,W.useEffect)(()=>{if(m.current&&i.autoFit!==!1)try{m.current.render()}catch(g){console.warn("[Chart] Resize failed:",g)}},[l,i.autoFit]),(0,W.useEffect)(()=>{if(!d.current)return;let g=new ResizeObserver(()=>{if(m.current&&i.autoFit!==!1)try{m.current.render()}catch{}});return g.observe(d.current),()=>{g.disconnect()}},[i.autoFit]);let u=(0,W.useCallback)(g=>{m.current=g,typeof e=="function"?e(g):e&&(e.current=g)},[e]);if(!c)return(0,K.jsxs)("div",{className:"w-full p-4 border border-dashed border-amber-200 text-amber-600 rounded bg-amber-50/50 text-xs",children:["\u672A\u627E\u5230\u56FE\u8868\u7C7B\u578B: ",r]});let f=i.data&&Array.isArray(i.data)&&i.data.length>0,y=Array.isArray(i.children)&&i.children.some(g=>g.data&&Array.isArray(g.data)&&g.data.length>0);return f||y?(0,K.jsx)(jt,{type:r,errorPlaceholder:i.errorPlaceholder,children:(0,K.jsx)(W.Suspense,{fallback:(0,K.jsx)(Bt.Skeleton,{active:!0}),children:(0,K.jsx)("div",{ref:d,className:"w-full h-full min-h-[100px]",children:(0,Sr.createElement)(c,{...i,ref:u,key:r})})})}):(0,K.jsx)(Et,{})}),$e=w($n,{schema:ge,renderLoading:t=>{let e=t.height||300;return(0,K.jsx)("div",{className:"w-full flex justify-center items-center bg-muted/10 rounded-lg animate-pulse",style:{height:e},children:(0,K.jsx)(Bt.Skeleton.Image,{active:!0})})}}),In=t=>{let{node:e,...r}=t;if(e)return(0,K.jsx)($e,{node:e});let n={props:{},body:{...r,data:t.data}};return(0,K.jsx)($e,{node:n})};var Mr=require("react/jsx-runtime");function jn(t){let e=t?.theme;return me({chart:(n,o)=>(0,Mr.jsx)($e,{node:n,theme:e,className:n.props?.className},o)})}var Dt=require("react");var it=require("@ant-design/icons");var L=require("react/jsx-runtime"),Nr=(t,e=1)=>Intl.NumberFormat("en",{notation:"compact",compactDisplay:"short",maximumFractionDigits:e}).format(t),Bn=({data:t,className:e})=>{if(!Array.isArray(t)||t.length<2)return null;let r=Math.min(...t),o=Math.max(...t)-r||1,a=80,s=32,l=t.map((c,i)=>({x:i/(t.length-1)*a,y:s-(c-r)/o*(s-8)-4})),d=l.reduce((c,i,u,f)=>{if(u===0)return`M ${i.x},${i.y}`;let y=f[u-1],x=(y.x+i.x)/2;return`${c} C ${x},${y.y} ${x},${i.y} ${i.x},${i.y}`},""),m=`${d} L ${a},${s} L 0,${s} Z`,p=`sparkline-gradient-${Math.random().toString(36).slice(2,9)}`;return(0,L.jsx)("div",{className:`relative group/sparkline ${e}`,children:(0,L.jsxs)("svg",{width:a,height:s,className:"overflow-visible",children:[(0,L.jsx)("defs",{children:(0,L.jsxs)("linearGradient",{id:p,x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,L.jsx)("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"0.25"}),(0,L.jsx)("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"0"})]})}),(0,L.jsx)("path",{d:m,fill:`url(#${p})`}),(0,L.jsx)("path",{d,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"transition-all duration-300"}),(0,L.jsx)("circle",{cx:l[l.length-1].x,cy:l[l.length-1].y,r:"3",fill:"currentColor",className:"animate-pulse shadow-sm"})]})})},Dn=t=>{let{precision:e=0,layout:r="vertical",footer:n,value:o,note:a,trend:s,trendValue:l}=t,d=(0,Dt.useMemo)(()=>{if(l==null)return null;if(typeof l=="number"){let f=Math.abs(l)>=1e4?Nr(l,1):l.toLocaleString(void 0,{minimumFractionDigits:e,maximumFractionDigits:e});return s==="up"&&!String(l).startsWith("+")?`+${f}`:s==="down"&&!String(l).startsWith("-")?`-${f}`:f}return String(l)},[l,e,s]),m=(0,Dt.useMemo)(()=>{if(o==null)return"-";let u=typeof o=="string"&&o!==""&&!isNaN(Number(o))?Number(o):o;return typeof u=="number"?Math.abs(u)>=1e6?Nr(u,1):u.toLocaleString(void 0,{minimumFractionDigits:e,maximumFractionDigits:e}):String(o)},[o,e]),p=s==="up",c=s==="down",i=Array.isArray(s);return(0,L.jsxs)("div",{className:"flex flex-col h-full justify-between",children:[(0,L.jsxs)("div",{className:`flex ${r==="horizontal"?"flex-row items-end justify-between":"flex-col"} gap-4`,children:[(0,L.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,L.jsxs)("div",{className:"flex items-baseline gap-2 mb-2 flex-wrap",children:[(0,L.jsx)("span",{className:"text-3xl font-bold text-foreground tracking-tight leading-none",children:m}),d&&(0,L.jsxs)("div",{className:`flex items-center text-xs font-semibold px-2 py-0.5 rounded-md border shadow-sm transition-all duration-150 ${p?"bg-success/5 text-success border-success/20":c?"bg-destructive/5 text-destructive border-destructive/20":"bg-muted/5 text-muted-foreground border-muted/20"}`,children:[p&&(0,L.jsx)(it.ArrowUpOutlined,{className:"mr-1 text-xs"}),c&&(0,L.jsx)(it.ArrowDownOutlined,{className:"mr-1 text-xs"}),(0,L.jsx)("span",{className:"tabular-nums",children:d})]})]}),a&&(0,L.jsx)("div",{className:"text-sm text-muted-foreground leading-relaxed font-medium line-clamp-2",title:a,children:a})]}),i&&(0,L.jsx)("div",{className:"shrink-0 mb-1",children:(0,L.jsx)(Bn,{data:s,className:p?"text-success":c?"text-destructive":"text-primary"})})]}),n&&(0,L.jsxs)("div",{className:"mt-4 pt-3 border-t border-border/50 flex items-center justify-between",children:[(0,L.jsx)("span",{className:"text-xs text-muted-foreground/70 font-medium tracking-wide",children:n}),(0,L.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-primary/20 animate-pulse"})]})]})},Lr=w(Dn,{schema:Be,skeleton:{rows:1}});var ee=require("react/jsx-runtime"),Wn=t=>{let{description:e,content:r,node:n}=t,o=!!e,a=!!n?.__source&&!(n?.body||n?.data),s=o&&e!==r,l=r||(o&&!s?"":e)||(a?n.__source:"");return(0,ee.jsxs)("div",{className:"flex flex-col gap-4",children:[s&&(0,ee.jsx)("div",{className:"text-foreground/80 text-sm font-medium leading-relaxed border-l-2 border-primary/30 pl-3 py-1 bg-primary/5 rounded-r-sm",children:(0,ee.jsx)(nt,{content:e})}),(0,ee.jsx)("div",{className:"text-muted-foreground leading-relaxed prose prose-sm max-w-none",children:l?(0,ee.jsx)(nt,{content:l}):!s&&(0,ee.jsx)("div",{className:"text-muted-foreground/50 text-xs italic flex items-center gap-2 py-4 justify-center border border-dashed border-border/50 rounded-md",children:(0,ee.jsx)("span",{children:"\u6682\u65E0\u5185\u5BB9"})})})]})},kr=w(Wn,{schema:qe,skeleton:{rows:2}});var ve=require("@ant-design/icons");var A=require("react/jsx-runtime"),qn=({item:t,layout:e,index:r,stripe:n})=>{let{title:o,desc:a,value:s,status:l,type:d="text"}=t;return d==="metric"?(0,A.jsxs)("div",{className:`bg-muted/30 rounded-lg p-card-half border border-border hover:border-primary/20 transition-colors group ${n?"bg-muted/50":""}`,children:[(0,A.jsx)("div",{className:"text-xs text-muted-foreground mb-1 font-medium",children:o}),(0,A.jsx)("div",{className:"text-xl font-bold text-card-foreground group-hover:text-primary transition-colors",children:s}),a&&(0,A.jsx)("div",{className:"text-xs text-muted-foreground/60 mt-1 whitespace-pre-wrap",children:a})]}):(0,A.jsxs)("div",{className:`flex items-start gap-3 p-card-half bg-muted/40 border border-border rounded-lg hover:shadow-card-hover hover:border-primary/30 transition-all group ${e==="list"?"w-full":""} ${n?"bg-muted/60":""}`,children:[(0,A.jsxs)("div",{className:"mt-1",children:[l==="done"&&(0,A.jsx)(ve.CheckCircleOutlined,{className:"text-success"}),l==="doing"&&(0,A.jsx)(ve.MinusCircleOutlined,{className:"text-primary animate-pulse"}),l==="todo"&&(0,A.jsx)(ve.BorderOutlined,{className:"text-muted-foreground/30"}),!l&&(0,A.jsx)("div",{className:"w-4 h-4 rounded-full bg-muted flex items-center justify-center text-xs text-muted-foreground font-bold group-hover:bg-primary/10 group-hover:text-primary transition-colors",children:r+1})]}),(0,A.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,A.jsx)("div",{className:"text-sm font-medium text-card-foreground whitespace-normal break-words group-hover:text-primary transition-colors",children:o}),a&&(0,A.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5 whitespace-normal break-words whitespace-pre-wrap",children:a})]})]})},zn=t=>{let{header:e,footer:r,layout:n="grid",columns:o=3,items:a=[],type:s="text",stripe:l=!1}=t,d=n==="grid",p={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-1 md:grid-cols-3",4:"grid-cols-2 md:grid-cols-4",5:"grid-cols-2 md:grid-cols-5",6:"grid-cols-3 md:grid-cols-6"}[o]||"grid-cols-1 md:grid-cols-3";return(0,A.jsxs)(A.Fragment,{children:[e&&(0,A.jsx)("div",{className:"mb-3 text-sm text-muted-foreground",children:e}),(0,A.jsxs)("div",{className:d?`grid ${p} gap-card-gap`:"flex flex-col space-y-card-gap",children:[a.map((c,i)=>(0,A.jsx)(qn,{item:{type:s,...c},layout:n,index:i,stripe:l&&i%2===1},i)),a.length===0&&(0,A.jsx)("div",{className:"text-center py-8 text-muted-foreground/50 text-xs italic",children:"\u6682\u65E0\u5217\u8868\u9879"})]}),r&&(0,A.jsx)("div",{className:"mt-card-gap pt-3 border-t border-border/40 text-xs text-muted-foreground text-right",children:r})]})},Pr=w(zn,{schema:We,skeleton:{rows:3}});var Rr=F(require("react"),1);var we=require("react/jsx-runtime"),Vn=()=>{let{items:t}=rr(),e=Rr.default.useMemo(()=>t.filter(o=>o.level>1),[t]),r=(o,a)=>{o.preventDefault();let s=document.getElementById(a);s&&s.scrollIntoView({behavior:"smooth"})},n=o=>{switch(o){case 2:return"pl-4";case 3:return"pl-8";case 4:return"pl-12";case 5:return"pl-16";case 6:return"pl-20";default:return"pl-4"}};return(0,we.jsx)("div",{className:"text-sm text-muted-foreground w-full",children:e.length===0?(0,we.jsx)("div",{className:"text-muted-foreground text-xs",children:"\u6682\u65E0\u76EE\u5F55"}):(0,we.jsx)("ul",{className:"list-none p-0 m-0 ml-2 border-l-2 border-border",children:e.map(o=>(0,we.jsx)("li",{className:`mb-2 text-sm leading-relaxed relative ${n(o.level)}`,children:(0,we.jsx)("a",{href:`#${o.id}`,onClick:a=>r(a,o.id),className:"text-foreground no-underline cursor-pointer transition-colors hover:text-primary hover:underline",children:o.title})},o.id))})})},Tr=w(Vn,{schema:ze,getTitle:t=>t.title||"\u76EE\u5F55",skeleton:{rows:4}});var Xr=require("react");var J=require("@chatbi-v/ui-shell"),Wt=require("@ant-design/icons");var v=require("react/jsx-runtime"),Hn=({data:t,className:e})=>{if(!Array.isArray(t)||t.length<2)return(0,v.jsx)("span",{className:"text-muted-foreground/30",children:"-"});let r=Math.min(...t),o=Math.max(...t)-r||1,a=60,s=24,l=t.map((m,p)=>({x:p/(t.length-1)*a,y:s-(m-r)/o*(s-4)-2})),d=l.reduce((m,p,c,i)=>{if(c===0)return`M ${p.x},${p.y}`;let u=i[c-1],f=(u.x+p.x)/2;return`${m} C ${f},${u.y} ${f},${p.y} ${p.x},${p.y}`},"");return(0,v.jsx)("div",{className:e||"text-primary",children:(0,v.jsxs)("svg",{width:a,height:s,className:"overflow-visible",children:[(0,v.jsx)("path",{d,fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,v.jsx)("circle",{cx:l[l.length-1].x,cy:l[l.length-1].y,r:"2",fill:"currentColor"})]})})},Kn=t=>{let{bordered:e=!0,size:r="middle",summary:n=!1,columns:o=[],rows:a=[],dataSource:s=[]}=t,l=s.length>0?s:a,d=o.length>0&&l.length>0,m=(0,Xr.useMemo)(()=>o.map(c=>({title:(0,v.jsxs)("div",{className:"flex items-center gap-1.5 whitespace-nowrap",children:[(0,v.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground/70",children:c.title}),c.desc&&(0,v.jsx)(J.Tooltip,{title:c.desc,children:(0,v.jsx)(Wt.InfoCircleOutlined,{className:"text-xs cursor-help opacity-40 hover:opacity-100 text-primary transition-opacity"})})]}),dataIndex:c.key,key:c.key,align:c.align||"left",flex:1,render:i=>{switch(c.type){case"progress":{let u=typeof i=="string"?parseFloat(i):i,f=u<=1?u*100:u,y="normal";return f>=100?y="success":f<60&&(y="exception"),(0,v.jsx)("div",{className:"flex items-center gap-2 min-w-24",children:(0,v.jsx)(J.Progress,{percent:Math.round(f),size:"small",status:y,showInfo:!0,strokeColor:f>=100?"var(--success)":f<60?"var(--destructive)":void 0,className:"mb-0"})})}case"trend":return(0,v.jsx)(Hn,{data:Array.isArray(i)?i:[]});case"badge":{let u="default",f=String(i).toLowerCase();return["success","\u5B8C\u6210","\u6B63\u5E38","ok","pass"].includes(f)?u="success":["error","fail","\u5931\u8D25","\u5F02\u5E38"].includes(f)?u="error":["warning","warn","\u8B66\u544A"].includes(f)?u="warning":["processing","running","\u8FDB\u884C\u4E2D"].includes(f)&&(u="processing"),(0,v.jsx)(J.Badge,{status:u,text:(0,v.jsx)("span",{className:"text-xs",children:i})})}case"image":return(0,v.jsx)("img",{src:i,alt:"",className:"h-8 w-8 rounded-sm object-cover border border-border/50 shadow-sm"});case"number":return(0,v.jsxs)("span",{className:"font-mono text-foreground/90 font-medium",children:[c.prefix,i?.toLocaleString?.()??i,c.suffix]});default:return(0,v.jsxs)("span",{className:"text-foreground/90",children:[c.prefix,i,c.suffix]})}}})),[o]);return(0,v.jsxs)("div",{className:"w-full xcml-table-container",children:[(0,v.jsx)(J.Table,{dataSource:l,columns:m,pagination:!1,size:r==="large"?"middle":"small",bordered:e,className:"xcml-custom-table [&_.ant-table]:!bg-transparent [&_.ant-table]:text-sm [&_.ant-table-thead_tr_th]:!bg-muted/40 [&_.ant-table-thead_tr_th]:border-b [&_.ant-table-thead_tr_th]:border-border/60 [&_.ant-table-thead_tr_th]:!py-3 [&_.ant-table-thead_tr_th]:!px-4 [&_.ant-table-tbody_tr_td]:border-b [&_.ant-table-tbody_tr_td]:border-border/30 [&_.ant-table-tbody_tr_td]:!py-2.5 [&_.ant-table-tbody_tr_td]:!px-4 [&_.ant-table-tbody_tr_td]:transition-all [&_.ant-table-tbody_tr_td]:duration-150 hover:[&_.ant-table-tbody_tr_td]:!bg-primary/5 [&_.ant-table-container]:rounded-md [&_.ant-table-container]:overflow-hidden",scroll:{x:"max-content"},rowKey:(c,i)=>i?.toString()??"",summary:n?c=>!n||!d?null:(0,v.jsx)(J.Table.Summary,{fixed:!0,children:(0,v.jsx)(J.Table.Summary.Row,{className:"bg-primary/5 font-bold",children:o.map((i,u)=>{if(u===0)return(0,v.jsx)(J.Table.Summary.Cell,{index:0,children:(0,v.jsx)("span",{className:"text-primary font-bold",children:"\u5408\u8BA1"})},"summary-label");if(!(i.type==="number"||["amount","value","sales","total"].includes(i.key)))return(0,v.jsx)(J.Table.Summary.Cell,{index:u},`summary-${i.key}`);let y=c.reduce((x,g)=>{let b=g[i.key],h=typeof b=="string"?parseFloat(b.replace(/[^0-9.-]/g,"")):b;return x+(typeof h=="number"&&!isNaN(h)?h:0)},0);return(0,v.jsx)(J.Table.Summary.Cell,{index:u,align:i.align,children:(0,v.jsxs)("span",{className:"text-primary font-mono",children:[i.prefix,Number.isInteger(y)?y:y.toFixed(2),i.suffix]})},`summary-${i.key}`)})})}):void 0,locale:{emptyText:(0,v.jsxs)("div",{className:"py-12 text-center text-muted-foreground/50 italic flex flex-col items-center gap-2",children:[(0,v.jsx)("div",{className:"w-12 h-12 rounded-full bg-muted/30 flex items-center justify-center",children:(0,v.jsx)(Wt.InfoCircleOutlined,{className:"text-xl opacity-20"})}),(0,v.jsx)("span",{children:"\u6682\u65E0\u6570\u636E"})]})}}),!n&&d&&(0,v.jsxs)("div",{className:"py-2 text-xs text-muted-foreground/40 italic text-right px-4",children:["Total ",l.length," rows"]})]})},Fr=w(Kn,{schema:De,skeleton:{rows:4}});var Se=require("react/jsx-runtime");function Jn(t){let e=t?.theme?{"data-theme":t.theme}:{};return me({metric:(n,o)=>(0,Se.jsx)(Lr,{node:n,...e},o),card:(n,o)=>(0,Se.jsx)(kr,{node:n,...e},o),list:(n,o)=>(0,Se.jsx)(Pr,{node:n,...e},o),toc:(n,o)=>(0,Se.jsx)(Tr,{node:n,...e},o),table:(n,o)=>(0,Se.jsx)(Fr,{node:n,...e},o)})}var Me=require("@ant-design/icons"),_r=F(require("react-countup"),1);var Z=require("react/jsx-runtime"),Ar=(t,e)=>{if(t==null)return null;let r=t>0,n=t===0,o=r?"text-success bg-success/5":n?"text-muted-foreground/40":"text-destructive bg-destructive/5",a=r?Me.ArrowUpOutlined:n?Me.MinusOutlined:Me.ArrowDownOutlined;return(0,Z.jsxs)("div",{className:`flex items-center px-2 py-0.5 rounded-full ${o} text-xs font-bold border border-current/10 transition-all shadow-sm`,children:[(0,Z.jsx)("span",{className:"opacity-70 mr-1",children:e}),(0,Z.jsx)(a,{className:"mr-0.5 text-xs"}),Math.abs(t),"%"]})},Gn=t=>{let{value:e,wow:r,yoy:n,unit:o="",prefix:a="",footer:s,precision:l}=t;return(0,Z.jsxs)("div",{className:"flex flex-col",children:[(0,Z.jsxs)("div",{className:"text-metric-lg font-black my-2 bg-clip-text text-transparent bg-gradient-to-br from-foreground via-foreground to-foreground/70 group-hover:from-primary group-hover:to-pink-500 transition-all duration-500 tracking-tighter",children:[(0,Z.jsx)("span",{className:"text-2xl mr-1 text-muted-foreground/60 font-bold align-baseline",children:a}),(0,Z.jsx)(_r.default,{end:Number(e)||0,decimals:l,separator:",",duration:2.5}),(0,Z.jsx)("span",{className:"text-base ml-1 font-semibold text-muted-foreground/50 align-baseline",children:o})]}),(0,Z.jsxs)("div",{className:"flex space-x-2 mt-2",children:[Ar(r,"\u73AF\u6BD4"),Ar(n,"\u540C\u6BD4")]}),s&&(0,Z.jsx)("div",{className:"mt-card-gap pt-2 border-t border-border/40 text-xs text-muted-foreground italic whitespace-pre-wrap leading-normal",children:s})]})},Or=w(Gn,{schema:Ke,getTitle:t=>t.title||t.label,skeleton:{rows:2}});var Er=require("react");var st=require("@chatbi-v/ui-shell"),$r=require("@ant-design/plots");var H=require("react/jsx-runtime"),Un=({item:t})=>{let[e,r]=(0,Er.useState)(!1),{label:n,value:o,wow:a,trendData:s=[]}=t,d={data:s.map((m,p)=>({index:p,value:m})),xField:"index",yField:"value",height:30,padding:0,axis:!1,legend:!1,tooltip:!1,smooth:!0,line:{style:{stroke:"hsl(var(--primary))",lineWidth:2}}};return(0,H.jsxs)("div",{className:"p-3 border border-border/60 rounded-lg hover:shadow-card hover:border-primary/30 transition-all relative bg-muted/40 text-card-foreground min-h-[6rem] flex flex-col justify-between group overflow-hidden",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[(0,H.jsx)("div",{className:"absolute left-0 top-0 bottom-0 w-1 bg-transparent group-hover:bg-primary/20 transition-colors"}),(0,H.jsxs)("div",{className:"relative z-10",children:[(0,H.jsx)("div",{className:"text-muted-foreground text-xs mb-1 font-medium whitespace-normal break-words",children:n}),(0,H.jsxs)("div",{className:"flex items-end justify-between flex-wrap",children:[(0,H.jsx)("span",{className:"text-xl font-bold tracking-tight whitespace-normal break-words",children:o}),a!==void 0&&(0,H.jsx)("div",{className:`w-2 h-2 rounded-full ${a>0?"bg-success":a<0?"bg-destructive":"bg-muted"} shadow-[0_0_6px_rgba(var(--primary),0.2)]`,title:`\u73AF\u6BD4: ${a}%`})]})]}),s.length>0&&(0,H.jsx)("div",{className:`absolute bottom-0 left-0 right-0 h-8 transition-opacity duration-300 ${e?"opacity-100":"opacity-40"}`,children:(0,H.jsx)($r.Line,{...d})})]})},Yn=t=>{let{items:e=[]}=t,r=e.length>0?Math.floor(24/Math.min(e.length,4)):6;return(0,H.jsx)(st.Row,{gutter:[16,16],children:e.map((n,o)=>(0,H.jsx)(st.Col,{span:r,children:(0,H.jsx)(Un,{item:n})},o))})},Ir=w(Yn,{schema:Je,skeleton:{rows:2}});var lt=require("react"),te=require("@chatbi-v/ui-shell"),jr=require("react-csv"),Ne=require("@ant-design/icons");var S=require("react/jsx-runtime"),Zn=t=>{let{title:e,description:r,bordered:n=!0,columns:o=[],rows:a=[],dataSource:s=[]}=t,l=s.length>0?s:a,d=(0,lt.useMemo)(()=>l.map((i,u)=>({...i,__xcml_row_key:i.__xcml_key||i.id||`row-${u}`})),[l]),m=(0,lt.useMemo)(()=>o.map(i=>({...i,dataIndex:i.key||i.dataIndex,title:(0,S.jsxs)("div",{className:"flex items-center gap-1.5 whitespace-nowrap",children:[(0,S.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground/70",children:i.title}),i.desc&&(0,S.jsx)(te.Tooltip,{title:i.desc,children:(0,S.jsx)(Ne.InfoCircleOutlined,{className:"text-xs cursor-help opacity-40 hover:opacity-100 text-primary transition-opacity"})})]}),ellipsis:!0,align:i.align||"left",width:i.width,flex:1,render:u=>{if(u==null||u==="")return(0,S.jsx)("span",{className:"text-muted-foreground/30 italic",children:"-"});let f=typeof u=="number"||!isNaN(Number(u))&&String(u).trim()!=="";return(0,S.jsx)("div",{className:`whitespace-normal break-words ${f?"font-mono":""}`,children:f?u.toLocaleString():u})}})),[o]),p=(0,lt.useMemo)(()=>o.map(i=>({label:i.title,key:i.key||i.dataIndex})),[o]),c=d.length>0;return(0,S.jsxs)("div",{className:"flex flex-col gap-4 xcml-snapshot-table-container",children:[(r||c)&&(0,S.jsxs)("div",{className:"flex items-center justify-between px-1",children:[(0,S.jsxs)("div",{className:"flex flex-col gap-0.5",children:[!t.title&&e&&(0,S.jsxs)("div",{className:"flex items-center gap-2",children:[(0,S.jsx)("div",{className:"w-7 h-7 rounded-md bg-primary/10 flex items-center justify-center text-primary shadow-sm border border-primary/10",children:(0,S.jsx)(Ne.TableOutlined,{className:"text-sm"})}),(0,S.jsx)("h4",{className:"text-sm font-bold text-foreground/90 m-0 leading-none",children:e})]}),r&&(0,S.jsx)("p",{className:`text-xs text-muted-foreground m-0 leading-relaxed ${!t.title&&e?"mt-1 pl-9":"pl-1"}`,children:r})]}),c&&(0,S.jsx)(jr.CSVLink,{data:d,headers:p,filename:`${e||"snapshot"}.csv`,children:(0,S.jsx)(te.Button,{size:"small",icon:(0,S.jsx)(Ne.DownloadOutlined,{}),className:"flex items-center gap-1.5 text-xs h-8 px-3 rounded-md border-border/60 hover:border-primary/50 hover:text-primary bg-card/50 transition-all duration-150",children:"\u5BFC\u51FA CSV"})})]}),(0,S.jsxs)("div",{className:"relative group",children:[(0,S.jsx)(te.Table,{columns:m,dataSource:d,rowKey:"__xcml_row_key",pagination:d.length>10?{pageSize:10,size:"small",showSizeChanger:!1,className:"mt-4 px-2"}:!1,scroll:{x:"max-content"},className:"xcml-custom-snapshot-table [&_.ant-table]:!bg-transparent [&_.ant-table]:!text-xs [&_.ant-table-thead_tr_th]:!bg-muted/30 [&_.ant-table-thead_tr_th]:!border-b [&_.ant-table-thead_tr_th]:!border-border/60 [&_.ant-table-thead_tr_th]:!py-2.5 [&_.ant-table-thead_tr_th]:!px-3 [&_.ant-table-thead_tr_th]:!text-foreground/70 [&_.ant-table-tbody_tr_td]:!border-b [&_.ant-table-tbody_tr_td]:!border-border/30 [&_.ant-table-tbody_tr_td]:!py-2 [&_.ant-table-tbody_tr_td]:!px-3 hover:[&_.ant-table-tbody_tr_td]:!bg-primary/5 [&_.ant-table-container]:!rounded-md [&_.ant-table-container]:!overflow-hidden [&_.ant-table-bordered_.ant-table-container]:!border-border/50 [&_.ant-pagination-item-active]:!border-primary [&_.ant-pagination-item-active]:!bg-primary/5 [&_.ant-pagination-item-active_a]:!text-primary",bordered:n,size:"small",locale:{emptyText:(0,S.jsx)(te.Empty,{image:te.Empty.PRESENTED_IMAGE_SIMPLE,description:(0,S.jsx)("span",{className:"text-muted-foreground/50 italic",children:"\u6682\u65E0\u5FEB\u7167\u6570\u636E"}),className:"py-8"})}}),(0,S.jsx)("div",{className:"absolute top-0 right-0 bottom-0 w-8 bg-gradient-to-l from-background/50 to-transparent pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity"})]}),c&&(0,S.jsxs)("div",{className:"flex items-center justify-between px-1 mt-1",children:[(0,S.jsxs)("span",{className:"text-xs text-muted-foreground/50 italic flex items-center gap-1.5",children:[(0,S.jsx)("span",{className:"w-1 h-1 rounded-full bg-primary/40"}),"\u5171 ",d.length," \u6761\u8BB0\u5F55"]}),(0,S.jsxs)("span",{className:"text-xs text-muted-foreground/30",children:["Last updated: ",new Date().toLocaleTimeString()]})]})]})},Br=w(Zn,{schema:Ue,skeleton:{rows:5}});var Wr=F(require("react"),1),ue=require("@chatbi-v/ui-shell"),qt=require("clsx"),qr=require("tailwind-merge"),zr=F(require("react-highlight-words"),1),X=require("@ant-design/icons");var C=require("react/jsx-runtime"),Dr={positive:{icon:(0,C.jsx)(X.RiseOutlined,{}),color:"text-success",bg:"bg-success/5",border:"border-success/20",label:"\u589E\u957F"},negative:{icon:(0,C.jsx)(X.FallOutlined,{}),color:"text-destructive",bg:"bg-destructive/5",border:"border-destructive/20",label:"\u98CE\u9669"},warning:{icon:(0,C.jsx)(X.WarningOutlined,{}),color:"text-warning",bg:"bg-warning/5",border:"border-warning/20",label:"\u8B66\u544A"},error:{icon:(0,C.jsx)(X.CloseCircleOutlined,{}),color:"text-destructive",bg:"bg-destructive/5",border:"border-destructive/20",label:"\u5F02\u5E38"},success:{icon:(0,C.jsx)(X.CheckCircleOutlined,{}),color:"text-success",bg:"bg-success/5",border:"border-success/20",label:"\u6210\u529F"},insight:{icon:(0,C.jsx)(X.BulbOutlined,{}),color:"text-primary",bg:"bg-primary/5",border:"border-primary/20",label:"\u53D1\u73B0"},neutral:{icon:(0,C.jsx)(X.InfoCircleOutlined,{}),color:"text-muted-foreground",bg:"bg-muted/5",border:"border-muted/20",label:"\u63D0\u793A"}},Qn=t=>{let{content:e="",highlights:r=[],sentiment:n="insight",citations:o=[],actions:a=[]}=t,s=de(r),l=de(o),d=de(a),m=Dr[n]||Dr.insight,p=i=>{he.emit("action_click",{action:i,source:"insight_card"})},c=i=>{he.emit("feedback",{type:i,source:"insight_card",content:e})};return(0,C.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,C.jsxs)("div",{className:(0,qr.twMerge)("relative overflow-hidden rounded-2xl border transition-all duration-300",m.bg,m.border,"p-5 shadow-sm hover:shadow-md"),children:[(0,C.jsx)("div",{className:"absolute -right-4 -top-4 w-24 h-24 blur-3xl opacity-20 bg-current pointer-events-none"}),(0,C.jsxs)("div",{className:"relative flex gap-4",children:[(0,C.jsx)("div",{className:(0,qt.clsx)("flex items-center justify-center w-10 h-10 rounded-xl shadow-sm border shrink-0","bg-background/80 backdrop-blur-sm",m.color,m.border),children:Wr.default.cloneElement(m.icon,{className:"text-lg"})}),(0,C.jsxs)("div",{className:"flex-1 space-y-3",children:[(0,C.jsxs)("div",{className:"flex items-center justify-between",children:[(0,C.jsx)("span",{className:(0,qt.clsx)("text-xs font-bold uppercase tracking-[0.15em]",m.color),children:m.label}),(0,C.jsxs)("div",{className:"flex items-center gap-1",children:[(0,C.jsx)(ue.Tooltip,{title:"\u6709\u5E2E\u52A9",children:(0,C.jsx)(ue.Button,{type:"text",size:"small",icon:(0,C.jsx)(X.LikeOutlined,{}),className:"text-muted-foreground/40 hover:text-primary transition-colors h-6 w-6 flex items-center justify-center",onClick:()=>c("up")})}),(0,C.jsx)(ue.Tooltip,{title:"\u65E0\u5E2E\u52A9",children:(0,C.jsx)(ue.Button,{type:"text",size:"small",icon:(0,C.jsx)(X.DislikeOutlined,{}),className:"text-muted-foreground/40 hover:text-destructive transition-colors h-6 w-6 flex items-center justify-center",onClick:()=>c("down")})})]})]}),(0,C.jsx)("div",{className:"text-sm leading-relaxed font-medium text-foreground/90",children:(0,C.jsx)(zr.default,{highlightClassName:"bg-primary/10 text-primary border-b-2 border-primary/30 font-bold px-0.5 mx-0.5",searchWords:s,autoEscape:!0,textToHighlight:e})}),l.length>0&&(0,C.jsx)("div",{className:"flex flex-wrap gap-2 pt-2",children:l.map((i,u)=>(0,C.jsxs)("button",{className:"flex items-center gap-1 px-2 py-0.5 rounded-full bg-muted/20 border border-border/50 text-xs text-muted-foreground hover:text-primary hover:border-primary/30 transition-all cursor-pointer",children:[(0,C.jsx)(X.LinkOutlined,{className:"text-xs"}),i]},u))})]})]})]}),d.length>0&&(0,C.jsxs)("div",{className:"space-y-3 px-1",children:[(0,C.jsxs)("div",{className:"flex items-center gap-2 text-xs font-bold text-foreground/40 uppercase tracking-widest",children:[(0,C.jsx)("div",{className:"h-px flex-1 bg-gradient-to-r from-transparent to-border/50"}),(0,C.jsx)(X.ThunderboltOutlined,{className:"text-amber-500"}),(0,C.jsx)("span",{children:"\u4E0B\u4E00\u6B65\u884C\u52A8\u5EFA\u8BAE"}),(0,C.jsx)("div",{className:"h-px flex-1 bg-gradient-to-l from-transparent to-border/50"})]}),(0,C.jsx)("div",{className:"flex flex-wrap gap-2.5",children:d.map((i,u)=>(0,C.jsx)(ue.Button,{type:"default",className:"group relative h-9 px-4 rounded-xl border-dashed border-primary/30 hover:border-primary hover:bg-primary/5 transition-all overflow-hidden",onClick:()=>p(i),children:(0,C.jsxs)("div",{className:"flex items-center gap-2",children:[(0,C.jsx)("span",{className:"text-xs font-semibold text-foreground/80 group-hover:text-primary transition-colors",children:i}),(0,C.jsx)(X.ThunderboltOutlined,{className:"text-amber-400 opacity-0 -translate-x-2 group-hover:opacity-100 group-hover:translate-x-0 transition-all"})]})},u))})]})]})},Vr=w(Qn,{schema:Ve,getTitle:t=>t.title||"\u6570\u636E\u6D1E\u5BDF",getIcon:t=>(0,C.jsx)(X.BulbOutlined,{}),getVariant:()=>"plain",skeleton:{rows:4}});var dt=require("react"),re=require("@chatbi-v/ui-shell"),mt=require("@ant-design/icons"),Hr=F(require("html2canvas"),1),Le=require("@ant-design/plots");var k=require("react/jsx-runtime"),ct=[{label:"\u79D1\u6280\u84DD",value:"#1890ff",bg:"#f0f5ff"},{label:"\u6D3B\u529B\u6A59",value:"#fa8c16",bg:"#fff7e6"},{label:"\u6E05\u65B0\u7EFF",value:"#52c41a",bg:"#f6ffed"},{label:"\u6697\u591C\u7D2B",value:"#722ed1",bg:"#f9f0ff"},{label:"\u5546\u52A1\u7070",value:"#595959",bg:"#f5f5f5"}],eo=t=>{let{title:e="\u6570\u636E\u6D77\u62A5",subTitle:r="Data Insight Poster",charts:n=[],qrCode:o="https://ant.design",author:a="ChatBI",date:s=new Date().toLocaleDateString(),backgroundImage:l,themeColor:d}=t,m=typeof l=="string"?l.trim().replace(/^[`'" ]|[`'" ]$/g,"").trim().replace(/^[`'" ]|[`'" ]$/g,""):void 0,p=(0,dt.useRef)(null),[c,i]=(0,dt.useState)(ct[0]),u=d||c.value,f=d?`${d}10`:c.bg,y=async()=>{if(p.current)try{let b=(await(0,Hr.default)(p.current,{useCORS:!0,scale:2,backgroundColor:c.bg})).toDataURL("image/png"),h=document.createElement("a");h.href=b,h.download=`poster-${Date.now()}.png`,h.click()}catch(g){console.error("Poster generation failed",g)}},x=(g,b)=>{let h={data:g.data,height:200,autoFit:!0};return g.type==="column"||g.type==="bar"?(0,k.jsx)(Le.Column,{...h,xField:"label",yField:"value"},b):g.type==="line"?(0,k.jsx)(Le.Line,{...h,xField:"label",yField:"value"},b):g.type==="pie"?(0,k.jsx)(Le.Pie,{...h,angleField:"value",colorField:"label"},b):null};return(0,k.jsxs)("div",{className:"flex flex-col",children:[(0,k.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,k.jsx)(re.Space,{children:(0,k.jsx)(re.Select,{value:c.value,onChange:g=>i(ct.find(b=>b.value===g)||ct[0]),options:ct,className:"w-32",suffixIcon:(0,k.jsx)(mt.BgColorsOutlined,{})})}),(0,k.jsx)(re.Button,{type:"primary",icon:(0,k.jsx)(mt.DownloadOutlined,{}),onClick:y,children:"\u751F\u6210\u6D77\u62A5"})]}),(0,k.jsx)("div",{className:"flex-1 overflow-auto border border-border rounded-lg shadow-sm bg-muted/10 min-h-0 flex flex-col",children:(0,k.jsxs)("div",{ref:p,className:"p-8 w-full mx-auto transition-colors duration-300 flex flex-col shrink-0 bg-cover bg-center text-zinc-800 min-h-full",style:{backgroundColor:f,backgroundImage:m?`url(${m})`:void 0},children:[(0,k.jsxs)("div",{className:"mb-6 text-center",children:[(0,k.jsx)("h1",{className:"text-2xl font-bold mb-2",style:{color:u},children:e}),(0,k.jsx)("p",{className:"text-sm opacity-70",children:r})]}),(0,k.jsx)("div",{className:"space-y-6 mb-8",children:n.map((g,b)=>(0,k.jsxs)("div",{className:"bg-white p-4 rounded-lg shadow-sm opacity-90",children:[(0,k.jsx)("h4",{className:"font-medium mb-2 text-center",children:g.title}),x(g,b)]},b))}),(0,k.jsxs)("div",{className:"flex items-center justify-between mt-auto pt-8 border-t border-border/40 border-dashed",children:[(0,k.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,k.jsxs)("p",{children:["Created by ",a]}),(0,k.jsx)("p",{children:s})]}),(0,k.jsx)("div",{className:"bg-white p-1 rounded",children:(0,k.jsx)(re.QRCode,{value:o,size:64,bordered:!1})})]})]})})]})},Kr=w(eo,{schema:Ge,skeleton:{rows:4}});var pt=require("@chatbi-v/ui-shell"),ne=require("@ant-design/icons");var _=require("react/jsx-runtime"),{Text:to}=pt.Typography,ro=t=>{switch(t){case"success":return(0,_.jsx)(ne.CheckCircleFilled,{className:"text-success bg-card rounded-full relative z-10 shadow-sm"});case"failure":return(0,_.jsx)(ne.CloseCircleFilled,{className:"text-destructive bg-card rounded-full relative z-10 shadow-sm"});case"running":return(0,_.jsx)(ne.LoadingOutlined,{className:"text-primary bg-card rounded-full relative z-10"});default:return(0,_.jsx)(ne.ClockCircleFilled,{className:"text-muted-foreground/40 bg-card rounded-full relative z-10"})}},no=t=>{switch(t){case"success":return"\u6210\u529F";case"failure":return"\u5931\u8D25";case"running":return"\u6267\u884C\u4E2D";default:return t}},oo=t=>{switch(t){case"success":return"success";case"failure":return"error";case"running":return"processing";default:return"default"}},ao=t=>{let{steps:e=[]}=t;return(0,_.jsxs)("div",{className:"relative pl-2 py-2",children:[(0,_.jsx)("div",{className:"absolute top-4 bottom-4 left-[15px] w-0.5 bg-gradient-to-b from-primary/10 via-primary/30 to-primary/10"}),e.map((r,n)=>(0,_.jsxs)("div",{className:"relative flex mb-6 last:mb-0 group",children:[(0,_.jsx)("div",{className:"mr-4 mt-0.5 text-lg transition-transform duration-300 group-hover:scale-110",children:ro(r.status)}),(0,_.jsxs)("div",{className:"flex-1 min-w-0 bg-card rounded-xl p-3 border border-border/50 hover:border-primary/30 hover:shadow-md transition-all duration-300 group-hover:-translate-y-0.5",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("span",{className:"font-bold text-sm text-foreground",children:r.tool||`\u6B65\u9AA4 ${n+1}`}),(0,_.jsx)(to,{type:"secondary",className:"text-xs text-muted-foreground",children:r.action})]}),(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[r.duration&&(0,_.jsx)("span",{className:"text-xs font-mono text-muted-foreground/60 bg-muted px-1.5 py-0.5 rounded-md",children:r.duration}),(0,_.jsx)(pt.Tag,{color:oo(r.status),bordered:!1,className:"mr-0 text-xs px-1.5 rounded-full",children:no(r.status)})]})]}),r.thought&&(0,_.jsx)("div",{className:"mb-2 text-xs text-muted-foreground italic border-l-2 border-primary/30 pl-2 py-1 bg-primary/5 rounded-r-md whitespace-pre-wrap leading-normal",children:r.thought}),r.result&&(0,_.jsx)("div",{className:"mt-2 text-xs",children:(0,_.jsx)("div",{className:"bg-muted/30 border border-border/40 rounded-lg p-2 overflow-x-auto custom-scrollbar",children:(0,_.jsx)("pre",{className:"m-0 whitespace-pre-wrap font-mono text-xs text-muted-foreground leading-relaxed",children:typeof r.result=="string"?r.result:JSON.stringify(r.result,null,2)})})}),r.error&&(0,_.jsxs)("div",{className:"mt-2 text-xs text-destructive bg-destructive/5 p-2 rounded-lg border border-destructive/20 whitespace-pre-wrap",children:["\u9519\u8BEF: ",r.error]})]})]},n))]})},Jr=w(ao,{schema:Ye,getTitle:t=>t.title||"\u601D\u7EF4\u94FE",skeleton:!0});var Ie=require("react"),oe=require("@chatbi-v/ui-shell"),ae=require("@ant-design/icons");var Gr=F(require("react-highlight-words"),1);var I=require("react/jsx-runtime"),io=t=>{let{message:e}=oe.App.useApp(),{label:r="\u62A5\u544A\u6458\u8981",value:n=0,step:o=1,unit:a="",actionId:s="update_summary",content:l="",highlightKeywords:d=[]}=t,[m,p]=(0,Ie.useState)(Number(n)||0),[c,i]=(0,Ie.useState)(!1);(0,Ie.useEffect)(()=>{p(Number(n)||0)},[n]);let u=de(d),f=x=>{p(x)};return(0,I.jsxs)("div",{className:"flex flex-col",children:[l&&(0,I.jsx)("div",{className:"mb-4 text-muted-foreground leading-normal whitespace-pre-wrap",children:(0,I.jsx)(Gr.default,{highlightClassName:"bg-primary/20 text-primary rounded px-1 font-medium",searchWords:u,autoEscape:!0,textToHighlight:l})}),(0,I.jsxs)("div",{className:"flex items-center justify-between",children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("div",{className:"text-muted-foreground mb-1 text-xs font-medium uppercase tracking-wider",children:r}),(0,I.jsxs)("div",{className:"text-3xl font-black text-foreground flex items-baseline tracking-tight",children:[m,(0,I.jsx)("span",{className:"text-sm font-semibold text-muted-foreground/60 ml-1.5",children:a})]})]}),(0,I.jsxs)("div",{className:"flex items-center space-x-1 bg-muted/40 p-1.5 rounded-xl border border-border/30 shadow-inner",children:[(0,I.jsx)(oe.Button,{icon:(0,I.jsx)(ae.MinusOutlined,{}),size:"small",shape:"circle",type:"text",className:"hover:bg-background hover:text-primary hover:shadow-sm",onClick:()=>f(m-Number(o)),disabled:c}),(0,I.jsx)(oe.InputNumber,{value:m,onChange:x=>f(Number(x)),variant:"borderless",className:"w-20 text-center bg-transparent font-bold text-foreground",controls:!1,disabled:c}),(0,I.jsx)(oe.Button,{icon:(0,I.jsx)(ae.PlusOutlined,{}),size:"small",shape:"circle",type:"text",className:"hover:bg-background hover:text-primary hover:shadow-sm",onClick:()=>f(m+Number(o)),disabled:c}),(0,I.jsx)("div",{className:"w-px h-4 bg-border/50 mx-1"}),(0,I.jsx)(oe.Button,{type:"primary",size:"small",shape:"round",icon:c?(0,I.jsx)(ae.LoadingOutlined,{}):(0,I.jsx)(ae.SaveOutlined,{}),onClick:async()=>{i(!0);try{he.emit("action",{type:s,payload:{value:m,label:r,...t}}),await new Promise(x=>setTimeout(x,800)),e.success(`\u5DF2\u66F4\u65B0 ${r} \u8BBE\u5B9A\u503C`)}catch{e.error("\u63D0\u4EA4\u5931\u8D25")}finally{i(!1)}},loading:c,className:"ml-1 px-3 shadow-md shadow-primary/20 hover:shadow-primary/40 transition-all",children:"\u4FDD\u5B58"})]})]})]})},Ur=w(io,{schema:He,getTitle:t=>t.label,skeleton:{rows:2}});var ie=require("react/jsx-runtime");function so(t){let e=t?.theme?{"data-theme":t.theme}:{};return me({"metric-card":(o,a)=>(0,ie.jsx)(Or,{node:o,...e},a),"mini-kpi-strip":(o,a)=>(0,ie.jsx)(Ir,{node:o,...e},a),"snapshot-table":(o,a)=>(0,ie.jsx)(Br,{node:o,...e},a),"insight-card":(o,a)=>(0,ie.jsx)(Vr,{node:o,...e},a),"poster-card":(o,a)=>(0,ie.jsx)(Kr,{node:o,...e},a),"thought-chain":(o,a)=>(0,ie.jsx)(Jr,{node:o,...e},a),"interactive-summary":(o,a)=>(0,ie.jsx)(Ur,{node:o,...e},a)},{})}0&&(module.exports={AntVChartLoader,COMMON_PROPS,DefaultEmptyPlaceholder,DefaultErrorPlaceholder,ThemeProvider,XCMLCardWrapper,XCMLChart,XCMLEventBus,XCMLLayoutProvider,XCMLMarkdown,XCML_SCHEMAS,buildConfig,chartSchema,cleanPropsBySchema,columnChartSchema,columnStrategy,createAntVRenderers,createBasicRenderers,createExtendedRenderers,createRenderersWithAliases,deepMerge,dualAxesChartSchema,dualAxesStrategy,extractBaseStyles,funnelChartSchema,funnelStrategy,getChartStrategy,getTheme,lineChartSchema,lineStrategy,mergePropsAndBody,normalizeNodeData,normalizeTagName,parse,parseArrayProp,parseInlineData,parseXCML,pieChartSchema,pieStrategy,preprocessXCML,renderXCML,strategies,stringify,stringifyToXCML,themeDark,themeLight,themeMap,toXCMLNodeFromElement,toXCMLTag,toXTag,useTheme,useXCMLComponent,useXCMLLayout,useXCMLNode,validateDataSchema,validateXCMLNode,withXCMLCard,xTagPlugin,xcmlBus});
|
|
30
|
+
`:""}</${e}>`},[e,r]);return(0,R.jsxs)("div",{className:(0,ot.twMerge)("not-prose w-full max-w-full overflow-x-hidden overflow-y-visible custom-scrollbar flex flex-col relative",o),onMouseEnter:()=>n&&l(!0),onMouseLeave:()=>n&&l(!1),children:[t,s&&n&&(0,R.jsx)(Ce.Tooltip,{title:"\u67E5\u770B\u6E90\u7801",children:(0,R.jsx)(Ce.Button,{icon:(0,R.jsx)(lr.CodeOutlined,{}),size:"small",className:"absolute top-1 right-1 z-10 opacity-80",onClick:p})}),(0,R.jsx)(Ce.Modal,{open:c,onCancel:()=>m(!1),footer:null,width:800,centered:!0,title:`${e} \u6E90\u7801`,destroyOnHidden:!0,children:(0,R.jsx)("pre",{className:"bg-muted p-4 rounded-lg overflow-auto max-h-[500px] text-sm text-foreground",children:d})})]})}var kt=new WeakMap;function Pt(t){if(!t)return"";if(kt.has(t))return kt.get(t);let e=[],r=n=>{n?.forEach(a=>{a&&(a.type==="text"&&typeof a.data=="string"&&e.push(a.data),Array.isArray(a.children)&&r(a.children))})};r(t);let o=e.join("");return kt.set(t,o),o}var Pn=$.default.memo(({code:t,theme:e,id:r})=>{let o=$.default.useRef(null);return $.default.useEffect(()=>{!o.current||!t||import("mermaid").then(n=>{n.default.initialize({startOnLoad:!0,theme:e==="dark"?"dark":"default",securityLevel:"loose"});let a=r||`mermaid-${Math.random().toString(36).slice(2)}`;n.default.render(a,t).then(({svg:s})=>{o.current&&(o.current.innerHTML=s)})})},[t,e,r]),(0,R.jsx)("div",{ref:o,className:"mermaid w-full flex justify-center my-4"})});var W=X(require("react"),1),In=X(require("@ant-design/plots"),1),qt=require("@chatbi-v/ui-shell");var K=require("react"),pr=require("@chatbi-v/ui-shell"),_e=require("@chatbi-v/ui-shell"),st=require("react/jsx-runtime"),ur={theme:void 0,setTheme:()=>null,primaryColor:"#6366f1"},Rt=(0,K.createContext)(ur);function dr(t){if(!t)return;let e=t;for(;e;){if(e.classList.contains("dark"))return"dark";if(e.classList.contains("light"))return"light";let r=e.getAttribute("data-theme");if(r)return r;e=e.parentElement}}var it={fontFamily:'"Inter Variable", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',borderRadius:8,wireframe:!1},mr={light:{algorithm:_e.theme.defaultAlgorithm,token:{...it,colorPrimary:"#6366f1",colorSuccess:"#10b981",colorWarning:"#f59e0b",colorError:"#e11d48",colorInfo:"#0ea5e9"}},dark:{algorithm:_e.theme.darkAlgorithm,token:{...it,colorPrimary:"#6366f1",colorBgContainer:"#0f0f11",colorBgLayout:"#0a0a0c"}},ocean:{algorithm:_e.theme.defaultAlgorithm,token:{...it,colorPrimary:"#3b82f6",colorBgContainer:"#f0f9ff",colorBgLayout:"#e0f2fe",colorTextBase:"#0f172a"}},sunset:{algorithm:_e.theme.defaultAlgorithm,token:{...it,colorPrimary:"#f97316",colorBgContainer:"#fff7ed",colorBgLayout:"#ffedd5",colorTextBase:"#431407"}}};function Rn({children:t,defaultTheme:e,theme:r,primaryColor:o,storageKey:n="xcml-ui-theme",scoped:a=!0,className:s,style:l,...c}){let m=(0,K.useContext)(Rt),p=m.setTheme!==ur.setTheme,[d,i]=(0,K.useState)(()=>{if(typeof window>"u")return;let y=localStorage.getItem(n);return y||e||(p?m.theme:void 0)}),u=r??d,g=o??(p&&!r&&!e?m.primaryColor:u==="sunset"?"#ea580c":u==="ocean"?"#3b82f6":"#6366f1"),b=(0,K.useRef)(null);(0,K.useEffect)(()=>{let y=a?b.current:window.document.documentElement;if(!y)return;let h=u;if(a&&(u==="system"||u===void 0)&&!r&&!e&&!p){let P=dr(y.parentElement);P&&(h=P)}if(g.startsWith("#")){let P=g.replace(/^#/,""),q=parseInt(P.substring(0,2),16),_=parseInt(P.substring(2,4),16),E=parseInt(P.substring(4,6),16);y.style.setProperty("--primary-rgb",`${q}, ${_}, ${E}`);let V=q/255,N=_/255,j=E/255,z=Math.max(V,N,j),Q=Math.min(V,N,j),D=0,O=0,ee=(z+Q)/2;if(z!==Q){let oe=z-Q;switch(O=ee>.5?oe/(2-z-Q):oe/(z+Q),z){case V:D=(N-j)/oe+(N<j?6:0);break;case N:D=(j-V)/oe+2;break;case j:D=(V-N)/oe+4;break}D/=6}let I=`${Math.round(D*360)} ${Math.round(O*100)}% ${Math.round(ee*100)}%`;y.style.setProperty("--primary",I)}else y.style.setProperty("--primary",g);if(y.classList.remove("light","dark"),y.removeAttribute("data-theme"),!h||h==="inherit")return;let w=["ocean","sunset"];if(h==="system"){let P=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";y.classList.add(P);return}if(h==="dark"){y.classList.add("dark");return}if(h==="light"){y.classList.add("light");return}if(w.includes(h)){y.setAttribute("data-theme",h);return}},[u,a,g,r,e,p]);let x=(0,K.useMemo)(()=>({theme:u,setTheme:y=>{localStorage.setItem(n,y),i(y)},primaryColor:g}),[u,g,n]),f=(0,K.useMemo)(()=>{let y=u;if((!y||y==="system")&&(typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?y="dark":y="light",a&&!r&&!e&&!p)){let w=dr(b.current?.parentElement||null);w&&(y=w)}(!y||y==="inherit"||!mr[y])&&(y="light");let h=mr[y];return{...h,token:{...h.token,colorPrimary:g}}},[u,g,a,r,e,p]);return(0,st.jsx)(Rt.Provider,{value:x,...c,children:(0,st.jsx)(pr.XProvider,{theme:f,children:(0,st.jsx)("div",{ref:b,className:`xcml-scope text-inherit bg-inherit ${s||""}`,style:l,children:t})})})}var Ee=()=>{let t=(0,K.useContext)(Rt);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t};var Tn={label:{style:{fillOpacity:.65,fontSize:12}},title:{style:{fontSize:12,fillOpacity:.85}},grid:{line:{style:{stroke:"#d0d0d0",lineWidth:1,lineDash:[4,4],strokeOpacity:.7}}}},Xn={label:{style:{fill:"rgba(255, 255, 255, 0.65)",fontSize:12}},title:{style:{fill:"rgba(255, 255, 255, 0.85)",fontSize:12}},grid:{line:{style:{stroke:"rgba(255, 255, 255, 0.15)",lineWidth:1,lineDash:[4,4]}}}},lt={defaultColor:"#6366f1",colors10:["#6366f1","#ec4899","#0ea5e9","#f59e0b","#10b981","#ef4444","#3b82f6","#8b5cf6","#14b8a6","#f97316"],styleSheet:{backgroundColor:"transparent"},components:{axis:{common:Tn},tooltip:{style:{backgroundColor:"rgba(255, 255, 255, 0.95)",boxShadow:"0 8px 24px -6px rgba(0, 0, 0, 0.12)",color:"#1e293b",borderRadius:"16px",padding:"12px 16px",border:"1px solid rgba(226, 232, 240, 0.8)",backdropFilter:"blur(4px)"}},legend:{common:{itemStates:{active:{labelStyle:{fontWeight:600,fill:"#8b5cf6"}}}}}}},yr={defaultColor:"#818cf8",colors10:["#818cf8","#f472b6","#38bdf8","#fbbf24","#34d399","#f87171","#60a5fa","#a78bfa","#2dd4bf","#fb923c"],styleSheet:{backgroundColor:"transparent"},components:{axis:{common:Xn},tooltip:{style:{backgroundColor:"rgba(30, 41, 59, 0.95)",boxShadow:"0 8px 24px -6px rgba(0, 0, 0, 0.3)",color:"#f1f5f9",borderRadius:"16px",padding:"12px 16px",border:"1px solid rgba(51, 65, 85, 0.8)",backdropFilter:"blur(4px)"}},legend:{common:{labelStyle:{fill:"rgba(255, 255, 255, 0.65)"}}}}},gr={light:lt,dark:yr,default:lt};function Tt(t){return gr[t||"default"]||lt}var fr=X(require("react"),1);var Fn=fr.default.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Line}))),Xt={type:"line",schema:Pe,getComponent:()=>Fn,transformProps:t=>{let e={...t};return e.seriesField&&!e.colorField&&(e.colorField=e.seriesField),e}};var hr=X(require("react"),1);var An=hr.default.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Column}))),Ft={type:"column",schema:Re,getComponent:()=>An,transformProps:t=>{let e={...t};return e.seriesField&&!e.colorField&&(e.colorField=e.seriesField),e.scale?typeof e.scale=="object"&&!e.scale.x&&(e.scale.x={type:"band"}):e.scale={x:{type:"band"}},e}};var br=X(require("react"),1);var _n=br.default.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Pie}))),At={type:"pie",schema:Te,getComponent:()=>_n,transformProps:t=>({...t})};var xr=X(require("react"),1);var En=xr.default.lazy(()=>import("@ant-design/plots").then(t=>({default:t.DualAxes}))),_t={type:"dual-axes",schema:Xe,getComponent:()=>En,transformProps:t=>{let e={...t};typeof e.width=="number"&&e.width<50&&delete e.width;let r=e.data||[],o=r.length>0?Object.keys(r[0]):[],n=!1;if(e.children&&e.children.length>0&&(n=e.children.every(l=>l.data&&l.data.length>0||o.length===0?!0:l.yField&&o.includes(l.yField)),!n&&o.length>0&&(e.children=[])),(!e.children||e.children.length===0)&&(Array.isArray(e.yField)&&e.yField.length>=2&&(o.length===0||e.yField.every(c=>o.includes(c)))&&(e.children=[{type:"interval",yField:e.yField[0]},{type:"line",yField:e.yField[1],style:{lineWidth:2}}]),(!e.children||e.children.length===0)&&r.length>0)){let l=e.xField,c=o.filter(m=>m!==l&&typeof r[0][m]=="number");c.length>=2?e.children=[{type:"interval",yField:c[0]},{type:"line",yField:c[1],style:{lineWidth:2}}]:c.length===1&&(e.children=[{type:"interval",yField:c[0]}])}let a=Array.isArray(e.data)&&e.data.length>0,s=Array.isArray(e.children)&&e.children.some(l=>l.data&&Array.isArray(l.data)&&l.data.length>0);if(!a&&s){let{data:l,...c}=e;return c}return e}};var Cr=X(require("react"),1);var On=Cr.default.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Funnel}))),Et={type:"funnel",schema:Fe,getComponent:()=>On,transformProps:t=>{let e={...t};!e.xField&&e.categoryField&&(e.xField=e.categoryField),!e.yField&&e.valueField&&(e.yField=e.valueField);let r=e.data||[];if(r.length>0){let n=r[0],a=Object.keys(n);e.xField||(e.xField=a.find(s=>typeof n[s]=="string")||"type"),e.yField||(e.yField=a.find(s=>typeof n[s]=="number")||"value"),e.colorField&&!(e.colorField in n)&&(e.xField&&e.xField in n?e.colorField=e.xField:delete e.colorField),e.seriesField&&!(e.seriesField in n)&&delete e.seriesField}e.axis&&delete e.axis;let o=["light","dark","academy"];return e.theme&&!o.includes(e.theme)&&delete e.theme,typeof e.width=="number"&&e.width<100&&delete e.width,e}};var vr={line:Xt,column:Ft,pie:At,"dual-axes":_t,funnel:Et};function Ot(t){return t&&vr[t.toLowerCase()]||null}var wr=X(require("react"),1),ue=require("@chatbi-v/ui-shell"),ve=require("react/jsx-runtime");function Oe(t,e){if(typeof t!="object"||t===null)return e;if(typeof e!="object"||e===null)return t;let r=Array.isArray(t)?[...t]:{...t};for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o)){let n=e[o],a=r[o];typeof n=="object"&&n!==null&&typeof a=="object"&&a!==null&&!wr.default.isValidElement(n)?r[o]=Oe(a,n):r[o]=n}return r}function It(t,e){if(!e)return t;let r={...t},o=[...e.props||[],...e.body||[]];return o.length===0?t:(o.forEach(n=>{let a=n.name;if(n.visibleIf&&!n.visibleIf(r)){delete r[a];return}if(n.default!==void 0&&r[a]===void 0?r[a]=n.default:n.default!==void 0&&typeof n.default=="object"&&n.default!==null&&(r[a]=Oe(n.default,r[a])),n.transform){let s=r[a];r[a]=n.transform(s,r)}}),r)}function $t(t){let{type:e,data:r,theme:o,title:n,__native__:a,...s}=t,l={data:r||[],height:t.height||300,theme:o||"light",autoFit:t.autoFit!==!1,padding:"auto",appendPadding:[20,30,30,20]},c=Oe(Oe(l,s),a||{});return c.seriesField&&!c.colorField&&(c.colorField=c.seriesField),c.__native__={...c},c}var Bt=()=>(0,ve.jsx)("div",{className:"w-full h-full flex items-center justify-center border border-dashed border-border rounded-lg bg-muted/30",children:(0,ve.jsx)(ue.Empty,{image:ue.Empty.PRESENTED_IMAGE_SIMPLE,description:"\u6682\u65E0\u6570\u636E"})}),jt=({error:t,reset:e})=>(0,ve.jsx)("div",{className:"w-full h-full flex items-center justify-center p-4 border border-dashed border-destructive/20 rounded bg-destructive/5",children:(0,ve.jsx)(ue.Result,{status:"error",title:"\u56FE\u8868\u52A0\u8F7D\u5931\u8D25",subTitle:t.message,extra:[(0,ve.jsx)(ue.Button,{type:"primary",onClick:e,children:"\u91CD\u8BD5"},"retry")]})});var Mr=X(require("react"),1),Nr=require("@chatbi-v/ui-shell");var Dt=require("clsx"),Sr=require("tailwind-merge");var te=require("react/jsx-runtime"),Ie=({title:t,icon:e,children:r,source:o,summary:n,variant:a="card",theme:s,hoverable:l=!0,className:c,domNode:m,streamStatus:p,node:d,label:i,value:u,footer:g,precision:b,layout:x,note:f,trend:y,trendValue:h,unit:w,prefix:P,wow:q,yoy:_,sentiment:E,highlights:V,citations:N,actions:j,steps:z,columns:Q,rows:D,charts:O,data:ee,subTitle:I,themeColor:oe,backgroundImage:de,qrCode:ft,author:Kt,date:Jt,...tn})=>{let{theme:rn}=Ee(),ge=a==="plain",nn=s??d?.props?.theme??d?.data?.theme??rn,on=(0,Sr.twMerge)((0,Dt.clsx)("xcml-card not-prose max-w-full min-w-0 group",ge?"p-1":"rounded-md border border-border/80 bg-card shadow-sm p-card mb-6 overflow-hidden","relative transition-all duration-150 ease-out hover:ease-in-out",c,l&&!ge?"hover:shadow-card-hover hover:border-primary/50 hover:bg-card/80":""));return(0,te.jsxs)("div",{className:on,"data-theme":nn,...tn,children:[t&&(0,te.jsxs)("div",{className:"relative mb-3",children:[!ge&&(0,te.jsx)("div",{className:"absolute -top-3 -inset-x-4 h-1 bg-gradient-to-r from-primary via-primary/60 to-primary/20 opacity-0 transition-all duration-150 group-hover:opacity-100 rounded-full scale-x-95 group-hover:scale-x-100"}),(0,te.jsx)("div",{className:"flex items-center justify-between pb-2.5 border-b border-border/80",children:(0,te.jsxs)("h3",{className:"text-lg font-bold text-foreground leading-snug tracking-tight flex items-center gap-3 whitespace-normal break-words flex-1",children:[!ge&&(0,te.jsx)("span",{className:"w-1.5 h-6 rounded-full bg-primary/80 shadow-sm shrink-0"}),!ge&&e&&(0,te.jsx)("span",{className:"flex items-center justify-center w-8 h-8 rounded-md bg-primary/10 text-primary border border-primary/20 shadow-sm",children:e}),t]})})]}),(0,te.jsx)("div",{className:(0,Dt.clsx)("xcml-card-body",!ge&&"mt-0.5"),children:r})]})};var $e=require("react/jsx-runtime");function S(t,e={}){let{schema:r,getTitle:o,getIcon:n,getVariant:a,renderLoading:s,skeleton:l=!0}=e,c=Mr.default.forwardRef((p,d)=>{let{merged:i,baseProps:u,isLoading:g,streamStatus:b}=bt(p,r);i.delta!==void 0&&i.trendValue===void 0&&(i.trendValue=i.delta);let{className:x,...f}=p,y=o?o(i):i.title,h;y&&(typeof y=="string"?h=y:typeof y=="object"&&(Array.isArray(y)?h=void 0:h=y.text||y.content||JSON.stringify(y)));let w=n?n(i):i.icon,P=a?a(i):u.variant||"card",q=i.hoverable!==void 0?i.hoverable:!0,_={title:h,icon:w,variant:P,hoverable:q,className:x,node:p.node,streamStatus:b,...f};return g?(0,$e.jsx)(Ie,{..._,children:s?s(i):l?(0,$e.jsx)(Nr.Skeleton,{active:!0,paragraph:{rows:typeof l=="object"?l.rows:2}}):null}):(0,$e.jsx)(Ie,{..._,children:(0,$e.jsx)(t,{...i,ref:d})})}),m=t.displayName||t.name||"Component";return c.displayName=`withXCMLCard(${m})`,c}var G=require("react/jsx-runtime"),kr=require("react"),$n=t=>typeof t!="string"||!t?"":t.split(/[-_ ]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(""),Lr={"dual-axes":"DualAxes",column:"Column",line:"Line",pie:"Pie",funnel:"Funnel"},Bn=t=>{if(!t)return null;let e=Lr[t.toLowerCase()]||Lr[t],r=In;if(e&&e in r)return r[e];let o=$n(t);return o&&o in r?r[o]:t in r?r[t]:null},Wt=class extends W.default.Component{constructor(r){super(r);this.reset=()=>{this.setState({hasError:!1,error:null})};this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,o){console.error(`AntV Chart Error (${this.props.type}):`,r,o)}render(){return this.state.hasError&&this.state.error?this.props.errorPlaceholder?this.props.errorPlaceholder(this.state.error,this.reset):(0,G.jsx)(jt,{error:this.state.error,reset:this.reset}):this.props.children}},jn=(0,W.forwardRef)((t,e)=>{let{type:r="line",node:o,theme:n,...a}=t,{theme:s}=Ee(),{containerWidth:l}=Lt(),c=(0,W.useRef)(null),m=(0,W.useRef)(null),p=(0,W.useMemo)(()=>Ot(r),[r]),d=(0,W.useMemo)(()=>p?.getComponent()||Bn(r),[p,r]),i=(0,W.useMemo)(()=>{let f=t.theme||n||s||"light",h=f==="dark"||f==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",w=Tt(h),P=t.data,q={...t,theme:w,data:P},_=It(q,p?.schema||fe),E=p?.transformProps?p.transformProps(_):_;return $t(E)},[t,n,s,p]);(0,W.useEffect)(()=>{if(m.current&&i.autoFit!==!1)try{m.current.render()}catch(f){console.warn("[Chart] Resize failed:",f)}},[l,i.autoFit]),(0,W.useEffect)(()=>{if(!c.current)return;let f=new ResizeObserver(()=>{if(m.current&&i.autoFit!==!1)try{m.current.render()}catch{}});return f.observe(c.current),()=>{f.disconnect()}},[i.autoFit]);let u=(0,W.useCallback)(f=>{m.current=f,typeof e=="function"?e(f):e&&(e.current=f)},[e]);if(!d)return(0,G.jsxs)("div",{className:"w-full p-4 border border-dashed border-amber-200 text-amber-600 rounded bg-amber-50/50 text-xs",children:["\u672A\u627E\u5230\u56FE\u8868\u7C7B\u578B: ",r]});let g=i.data&&Array.isArray(i.data)&&i.data.length>0,b=Array.isArray(i.children)&&i.children.some(f=>f.data&&Array.isArray(f.data)&&f.data.length>0);return g||b?(delete i["data-xcml-raw"],delete i.__native__,(0,G.jsx)(Wt,{type:r,errorPlaceholder:i.errorPlaceholder,children:(0,G.jsx)(W.Suspense,{fallback:(0,G.jsx)(qt.Skeleton,{active:!0}),children:(0,G.jsx)("div",{ref:c,className:"w-full h-full min-h-[100px]",children:(0,kr.createElement)(d,{...i,ref:u,key:r})})})})):(0,G.jsx)(Bt,{})}),Be=S(jn,{schema:fe,renderLoading:t=>{let e=t.height||300;return(0,G.jsx)("div",{className:"w-full flex justify-center items-center bg-muted/10 rounded-lg animate-pulse",style:{height:e},children:(0,G.jsx)(qt.Skeleton.Image,{active:!0})})}}),Dn=t=>{let{node:e,...r}=t;if(e)return(0,G.jsx)(Be,{node:e});let o={props:{},body:{...r,data:t.data}};return(0,G.jsx)(Be,{node:o})};var Pr=require("react/jsx-runtime");function Wn(t){let e=t?.theme;return pe({chart:(o,n)=>(0,Pr.jsx)(Be,{node:o,theme:e,className:o.props?.className},n)})}var zt=require("react");var ct=require("@ant-design/icons");var L=require("react/jsx-runtime"),Rr=(t,e=1)=>Intl.NumberFormat("en",{notation:"compact",compactDisplay:"short",maximumFractionDigits:e}).format(t),qn=({data:t,className:e})=>{if(!Array.isArray(t)||t.length<2)return null;let r=Math.min(...t),n=Math.max(...t)-r||1,a=80,s=32,l=t.map((d,i)=>({x:i/(t.length-1)*a,y:s-(d-r)/n*(s-8)-4})),c=l.reduce((d,i,u,g)=>{if(u===0)return`M ${i.x},${i.y}`;let b=g[u-1],x=(b.x+i.x)/2;return`${d} C ${x},${b.y} ${x},${i.y} ${i.x},${i.y}`},""),m=`${c} L ${a},${s} L 0,${s} Z`,p=`sparkline-gradient-${Math.random().toString(36).slice(2,9)}`;return(0,L.jsx)("div",{className:`relative group/sparkline ${e}`,children:(0,L.jsxs)("svg",{width:a,height:s,className:"overflow-visible",children:[(0,L.jsx)("defs",{children:(0,L.jsxs)("linearGradient",{id:p,x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,L.jsx)("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"0.25"}),(0,L.jsx)("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"0"})]})}),(0,L.jsx)("path",{d:m,fill:`url(#${p})`}),(0,L.jsx)("path",{d:c,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"transition-all duration-300"}),(0,L.jsx)("circle",{cx:l[l.length-1].x,cy:l[l.length-1].y,r:"3",fill:"currentColor",className:"animate-pulse shadow-sm"})]})})},zn=t=>{let{precision:e=0,layout:r="vertical",footer:o,value:n,note:a,trend:s,trendValue:l}=t,c=(0,zt.useMemo)(()=>{if(l==null)return null;if(typeof l=="number"){let g=Math.abs(l)>=1e4?Rr(l,1):l.toLocaleString(void 0,{minimumFractionDigits:e,maximumFractionDigits:e});return s==="up"&&!String(l).startsWith("+")?`+${g}`:s==="down"&&!String(l).startsWith("-")?`-${g}`:g}return String(l)},[l,e,s]),m=(0,zt.useMemo)(()=>{if(n==null)return"-";let u=typeof n=="string"&&n!==""&&!isNaN(Number(n))?Number(n):n;return typeof u=="number"?Math.abs(u)>=1e6?Rr(u,1):u.toLocaleString(void 0,{minimumFractionDigits:e,maximumFractionDigits:e}):String(n)},[n,e]),p=s==="up",d=s==="down",i=Array.isArray(s);return(0,L.jsxs)("div",{className:"flex flex-col h-full justify-between",children:[(0,L.jsxs)("div",{className:`flex ${r==="horizontal"?"flex-row items-end justify-between":"flex-col"} gap-4`,children:[(0,L.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,L.jsxs)("div",{className:"flex items-baseline gap-2 mb-2 flex-wrap",children:[(0,L.jsx)("span",{className:"text-3xl font-bold text-foreground tracking-tight leading-none",children:m}),c&&(0,L.jsxs)("div",{className:`flex items-center text-xs font-semibold px-2 py-0.5 rounded-md border shadow-sm transition-all duration-150 ${p?"bg-success/5 text-success border-success/20":d?"bg-destructive/5 text-destructive border-destructive/20":"bg-muted/5 text-muted-foreground border-muted/20"}`,children:[p&&(0,L.jsx)(ct.ArrowUpOutlined,{className:"mr-1 text-xs"}),d&&(0,L.jsx)(ct.ArrowDownOutlined,{className:"mr-1 text-xs"}),(0,L.jsx)("span",{className:"tabular-nums",children:c})]})]}),a&&(0,L.jsx)("div",{className:"text-sm text-muted-foreground leading-relaxed font-medium line-clamp-2",title:a,children:a})]}),i&&(0,L.jsx)("div",{className:"shrink-0 mb-1",children:(0,L.jsx)(qn,{data:s,className:p?"text-success":d?"text-destructive":"text-primary"})})]}),o&&(0,L.jsxs)("div",{className:"mt-4 pt-3 border-t border-border/50 flex items-center justify-between",children:[(0,L.jsx)("span",{className:"text-xs text-muted-foreground/70 font-medium tracking-wide",children:o}),(0,L.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-primary/20 animate-pulse"})]})]})},Tr=S(zn,{schema:We,skeleton:{rows:1}});var re=require("react/jsx-runtime"),Vn=t=>{let{description:e,content:r,node:o}=t,n=!!e,a=!!o?.__source&&!(o?.body||o?.data),s=n&&e!==r,l=r||(n&&!s?"":e)||(a?o.__source:"");return(0,re.jsxs)("div",{className:"flex flex-col gap-4",children:[s&&(0,re.jsx)("div",{className:"text-foreground/80 text-sm font-medium leading-relaxed border-l-2 border-primary/30 pl-3 py-1 bg-primary/5 rounded-r-sm",children:(0,re.jsx)(at,{content:e})}),(0,re.jsx)("div",{className:"text-muted-foreground leading-relaxed prose prose-sm max-w-none",children:l?(0,re.jsx)(at,{content:l}):!s&&(0,re.jsx)("div",{className:"text-muted-foreground/50 text-xs italic flex items-center gap-2 py-4 justify-center border border-dashed border-border/50 rounded-md",children:(0,re.jsx)("span",{children:"\u6682\u65E0\u5185\u5BB9"})})})]})},Xr=S(Vn,{schema:Ve,skeleton:{rows:2}});var we=require("@ant-design/icons");var F=require("react/jsx-runtime"),Hn=({item:t,layout:e,index:r,stripe:o})=>{let{title:n,desc:a,value:s,status:l,type:c="text"}=t;return c==="metric"?(0,F.jsxs)("div",{className:`bg-muted/30 rounded-lg p-card-half border border-border hover:border-primary/20 transition-colors group ${o?"bg-muted/50":""}`,children:[(0,F.jsx)("div",{className:"text-xs text-muted-foreground mb-1 font-medium",children:n}),(0,F.jsx)("div",{className:"text-xl font-bold text-card-foreground group-hover:text-primary transition-colors",children:s}),a&&(0,F.jsx)("div",{className:"text-xs text-muted-foreground/60 mt-1 whitespace-pre-wrap",children:a})]}):(0,F.jsxs)("div",{className:`flex items-start gap-3 p-card-half bg-muted/40 border border-border rounded-lg hover:shadow-card-hover hover:border-primary/30 transition-all group ${e==="list"?"w-full":""} ${o?"bg-muted/60":""}`,children:[(0,F.jsxs)("div",{className:"mt-1",children:[l==="done"&&(0,F.jsx)(we.CheckCircleOutlined,{className:"text-success"}),l==="doing"&&(0,F.jsx)(we.MinusCircleOutlined,{className:"text-primary animate-pulse"}),l==="todo"&&(0,F.jsx)(we.BorderOutlined,{className:"text-muted-foreground/30"}),!l&&(0,F.jsx)("div",{className:"w-4 h-4 rounded-full bg-muted flex items-center justify-center text-xs text-muted-foreground font-bold group-hover:bg-primary/10 group-hover:text-primary transition-colors",children:r+1})]}),(0,F.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,F.jsx)("div",{className:"text-sm font-medium text-card-foreground whitespace-normal break-words group-hover:text-primary transition-colors",children:n}),a&&(0,F.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5 whitespace-normal break-words whitespace-pre-wrap",children:a})]})]})},Kn=t=>{let{header:e,footer:r,layout:o="grid",columns:n=3,items:a=[],type:s="text",stripe:l=!1}=t,c=o==="grid",p={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-1 md:grid-cols-3",4:"grid-cols-2 md:grid-cols-4",5:"grid-cols-2 md:grid-cols-5",6:"grid-cols-3 md:grid-cols-6"}[n]||"grid-cols-1 md:grid-cols-3";return(0,F.jsxs)(F.Fragment,{children:[e&&(0,F.jsx)("div",{className:"mb-3 text-sm text-muted-foreground",children:e}),(0,F.jsxs)("div",{className:c?`grid ${p} gap-card-gap`:"flex flex-col space-y-card-gap",children:[a.map((d,i)=>(0,F.jsx)(Hn,{item:{type:s,...d},layout:o,index:i,stripe:l&&i%2===1},i)),a.length===0&&(0,F.jsx)("div",{className:"text-center py-8 text-muted-foreground/50 text-xs italic",children:"\u6682\u65E0\u5217\u8868\u9879"})]}),r&&(0,F.jsx)("div",{className:"mt-card-gap pt-3 border-t border-border/40 text-xs text-muted-foreground text-right",children:r})]})},Fr=S(Kn,{schema:ze,skeleton:{rows:3}});var Ar=X(require("react"),1);var Se=require("react/jsx-runtime"),Jn=()=>{let{items:t}=or(),e=Ar.default.useMemo(()=>t.filter(n=>n.level>1),[t]),r=(n,a)=>{n.preventDefault();let s=document.getElementById(a);s&&s.scrollIntoView({behavior:"smooth"})},o=n=>{switch(n){case 2:return"pl-4";case 3:return"pl-8";case 4:return"pl-12";case 5:return"pl-16";case 6:return"pl-20";default:return"pl-4"}};return(0,Se.jsx)("div",{className:"text-sm text-muted-foreground w-full",children:e.length===0?(0,Se.jsx)("div",{className:"text-muted-foreground text-xs",children:"\u6682\u65E0\u76EE\u5F55"}):(0,Se.jsx)("ul",{className:"list-none p-0 m-0 ml-2 border-l-2 border-border",children:e.map(n=>(0,Se.jsx)("li",{className:`mb-2 text-sm leading-relaxed relative ${o(n.level)}`,children:(0,Se.jsx)("a",{href:`#${n.id}`,onClick:a=>r(a,n.id),className:"text-foreground no-underline cursor-pointer transition-colors hover:text-primary hover:underline",children:n.title})},n.id))})})},_r=S(Jn,{schema:He,getTitle:t=>t.title||"\u76EE\u5F55",skeleton:{rows:4}});var Er=require("react");var U=require("@chatbi-v/ui-shell"),Vt=require("@ant-design/icons");var v=require("react/jsx-runtime"),Gn=({data:t,className:e})=>{if(!Array.isArray(t)||t.length<2)return(0,v.jsx)("span",{className:"text-muted-foreground/30",children:"-"});let r=Math.min(...t),n=Math.max(...t)-r||1,a=60,s=24,l=t.map((m,p)=>({x:p/(t.length-1)*a,y:s-(m-r)/n*(s-4)-2})),c=l.reduce((m,p,d,i)=>{if(d===0)return`M ${p.x},${p.y}`;let u=i[d-1],g=(u.x+p.x)/2;return`${m} C ${g},${u.y} ${g},${p.y} ${p.x},${p.y}`},"");return(0,v.jsx)("div",{className:e||"text-primary",children:(0,v.jsxs)("svg",{width:a,height:s,className:"overflow-visible",children:[(0,v.jsx)("path",{d:c,fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,v.jsx)("circle",{cx:l[l.length-1].x,cy:l[l.length-1].y,r:"2",fill:"currentColor"})]})})},Un=t=>{let{bordered:e=!0,size:r="middle",summary:o=!1,columns:n=[],rows:a=[],dataSource:s=[]}=t,l=s.length>0?s:a,c=n.length>0&&l.length>0,m=(0,Er.useMemo)(()=>n.map(d=>({title:(0,v.jsxs)("div",{className:"flex items-center gap-1.5 whitespace-nowrap",children:[(0,v.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground/70",children:d.title}),d.desc&&(0,v.jsx)(U.Tooltip,{title:d.desc,children:(0,v.jsx)(Vt.InfoCircleOutlined,{className:"text-xs cursor-help opacity-40 hover:opacity-100 text-primary transition-opacity"})})]}),dataIndex:d.key,key:d.key,align:d.align||"left",flex:1,render:i=>{switch(d.type){case"progress":{let u=typeof i=="string"?parseFloat(i):i,g=u<=1?u*100:u,b="normal";return g>=100?b="success":g<60&&(b="exception"),(0,v.jsx)("div",{className:"flex items-center gap-2 min-w-24",children:(0,v.jsx)(U.Progress,{percent:Math.round(g),size:"small",status:b,showInfo:!0,strokeColor:g>=100?"var(--success)":g<60?"var(--destructive)":void 0,className:"mb-0"})})}case"trend":return(0,v.jsx)(Gn,{data:Array.isArray(i)?i:[]});case"badge":{let u="default",g=String(i).toLowerCase();return["success","\u5B8C\u6210","\u6B63\u5E38","ok","pass"].includes(g)?u="success":["error","fail","\u5931\u8D25","\u5F02\u5E38"].includes(g)?u="error":["warning","warn","\u8B66\u544A"].includes(g)?u="warning":["processing","running","\u8FDB\u884C\u4E2D"].includes(g)&&(u="processing"),(0,v.jsx)(U.Badge,{status:u,text:(0,v.jsx)("span",{className:"text-xs",children:i})})}case"image":return(0,v.jsx)("img",{src:i,alt:"",className:"h-8 w-8 rounded-sm object-cover border border-border/50 shadow-sm"});case"number":return(0,v.jsxs)("span",{className:"font-mono text-foreground/90 font-medium",children:[d.prefix,i?.toLocaleString?.()??i,d.suffix]});default:return(0,v.jsxs)("span",{className:"text-foreground/90",children:[d.prefix,i,d.suffix]})}}})),[n]);return(0,v.jsxs)("div",{className:"w-full xcml-table-container",children:[(0,v.jsx)(U.Table,{dataSource:l,columns:m,pagination:!1,size:r==="large"?"middle":"small",bordered:e,className:"xcml-custom-table [&_.ant-table]:!bg-transparent [&_.ant-table]:text-sm [&_.ant-table-thead_tr_th]:!bg-muted/40 [&_.ant-table-thead_tr_th]:border-b [&_.ant-table-thead_tr_th]:border-border/60 [&_.ant-table-thead_tr_th]:!py-3 [&_.ant-table-thead_tr_th]:!px-4 [&_.ant-table-tbody_tr_td]:border-b [&_.ant-table-tbody_tr_td]:border-border/30 [&_.ant-table-tbody_tr_td]:!py-2.5 [&_.ant-table-tbody_tr_td]:!px-4 [&_.ant-table-tbody_tr_td]:transition-all [&_.ant-table-tbody_tr_td]:duration-150 hover:[&_.ant-table-tbody_tr_td]:!bg-primary/5 [&_.ant-table-container]:rounded-md [&_.ant-table-container]:overflow-hidden",scroll:{x:"max-content"},rowKey:(d,i)=>i?.toString()??"",summary:o?d=>!o||!c?null:(0,v.jsx)(U.Table.Summary,{fixed:!0,children:(0,v.jsx)(U.Table.Summary.Row,{className:"bg-primary/5 font-bold",children:n.map((i,u)=>{if(u===0)return(0,v.jsx)(U.Table.Summary.Cell,{index:0,children:(0,v.jsx)("span",{className:"text-primary font-bold",children:"\u5408\u8BA1"})},"summary-label");if(!(i.type==="number"||["amount","value","sales","total"].includes(i.key)))return(0,v.jsx)(U.Table.Summary.Cell,{index:u},`summary-${i.key}`);let b=d.reduce((x,f)=>{let y=f[i.key],h=typeof y=="string"?parseFloat(y.replace(/[^0-9.-]/g,"")):y;return x+(typeof h=="number"&&!isNaN(h)?h:0)},0);return(0,v.jsx)(U.Table.Summary.Cell,{index:u,align:i.align,children:(0,v.jsxs)("span",{className:"text-primary font-mono",children:[i.prefix,Number.isInteger(b)?b:b.toFixed(2),i.suffix]})},`summary-${i.key}`)})})}):void 0,locale:{emptyText:(0,v.jsxs)("div",{className:"py-12 text-center text-muted-foreground/50 italic flex flex-col items-center gap-2",children:[(0,v.jsx)("div",{className:"w-12 h-12 rounded-full bg-muted/30 flex items-center justify-center",children:(0,v.jsx)(Vt.InfoCircleOutlined,{className:"text-xl opacity-20"})}),(0,v.jsx)("span",{children:"\u6682\u65E0\u6570\u636E"})]})}}),!o&&c&&(0,v.jsxs)("div",{className:"py-2 text-xs text-muted-foreground/40 italic text-right px-4",children:["Total ",l.length," rows"]})]})},Or=S(Un,{schema:qe,skeleton:{rows:4}});var Me=require("react/jsx-runtime");function Yn(t){let e=t?.theme?{"data-theme":t.theme}:{};return pe({metric:(o,n)=>(0,Me.jsx)(Tr,{node:o,...e},n),card:(o,n)=>(0,Me.jsx)(Xr,{node:o,...e},n),list:(o,n)=>(0,Me.jsx)(Fr,{node:o,...e},n),toc:(o,n)=>(0,Me.jsx)(_r,{node:o,...e},n),table:(o,n)=>(0,Me.jsx)(Or,{node:o,...e},n)})}var Ne=require("@ant-design/icons"),$r=X(require("react-countup"),1);var Z=require("react/jsx-runtime"),Ir=(t,e)=>{if(t==null)return null;let r=t>0,o=t===0,n=r?"text-success bg-success/5":o?"text-muted-foreground/40":"text-destructive bg-destructive/5",a=r?Ne.ArrowUpOutlined:o?Ne.MinusOutlined:Ne.ArrowDownOutlined;return(0,Z.jsxs)("div",{className:`flex items-center px-2 py-0.5 rounded-full ${n} text-xs font-bold border border-current/10 transition-all shadow-sm`,children:[(0,Z.jsx)("span",{className:"opacity-70 mr-1",children:e}),(0,Z.jsx)(a,{className:"mr-0.5 text-xs"}),Math.abs(t),"%"]})},Zn=t=>{let{value:e,wow:r,yoy:o,unit:n="",prefix:a="",footer:s,precision:l}=t;return(0,Z.jsxs)("div",{className:"flex flex-col",children:[(0,Z.jsxs)("div",{className:"text-metric-lg font-black my-2 bg-clip-text text-transparent bg-gradient-to-br from-foreground via-foreground to-foreground/70 group-hover:from-primary group-hover:to-pink-500 transition-all duration-500 tracking-tighter",children:[(0,Z.jsx)("span",{className:"text-2xl mr-1 text-muted-foreground/60 font-bold align-baseline",children:a}),(0,Z.jsx)($r.default,{end:Number(e)||0,decimals:l,separator:",",duration:2.5}),(0,Z.jsx)("span",{className:"text-base ml-1 font-semibold text-muted-foreground/50 align-baseline",children:n})]}),(0,Z.jsxs)("div",{className:"flex space-x-2 mt-2",children:[Ir(r,"\u73AF\u6BD4"),Ir(o,"\u540C\u6BD4")]}),s&&(0,Z.jsx)("div",{className:"mt-card-gap pt-2 border-t border-border/40 text-xs text-muted-foreground italic whitespace-pre-wrap leading-normal",children:s})]})},Br=S(Zn,{schema:Ge,getTitle:t=>t.title||t.label,skeleton:{rows:2}});var jr=require("react");var dt=require("@chatbi-v/ui-shell"),Dr=require("@ant-design/plots");var J=require("react/jsx-runtime"),Qn=({item:t})=>{let[e,r]=(0,jr.useState)(!1),{label:o,value:n,wow:a,trendData:s=[]}=t,c={data:s.map((m,p)=>({index:p,value:m})),xField:"index",yField:"value",height:30,padding:0,axis:!1,legend:!1,tooltip:!1,smooth:!0,line:{style:{stroke:"hsl(var(--primary))",lineWidth:2}}};return(0,J.jsxs)("div",{className:"p-3 border border-border/60 rounded-lg hover:shadow-card hover:border-primary/30 transition-all relative bg-muted/40 text-card-foreground min-h-[6rem] flex flex-col justify-between group overflow-hidden",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[(0,J.jsx)("div",{className:"absolute left-0 top-0 bottom-0 w-1 bg-transparent group-hover:bg-primary/20 transition-colors"}),(0,J.jsxs)("div",{className:"relative z-10",children:[(0,J.jsx)("div",{className:"text-muted-foreground text-xs mb-1 font-medium whitespace-normal break-words",children:o}),(0,J.jsxs)("div",{className:"flex items-end justify-between flex-wrap",children:[(0,J.jsx)("span",{className:"text-xl font-bold tracking-tight whitespace-normal break-words",children:n}),a!==void 0&&(0,J.jsx)("div",{className:`w-2 h-2 rounded-full ${a>0?"bg-success":a<0?"bg-destructive":"bg-muted"} shadow-[0_0_6px_rgba(var(--primary),0.2)]`,title:`\u73AF\u6BD4: ${a}%`})]})]}),s.length>0&&(0,J.jsx)("div",{className:`absolute bottom-0 left-0 right-0 h-8 transition-opacity duration-300 ${e?"opacity-100":"opacity-40"}`,children:(0,J.jsx)(Dr.Line,{...c})})]})},eo=t=>{let{items:e=[]}=t,r=e.length>0?Math.floor(24/Math.min(e.length,4)):6;return(0,J.jsx)(dt.Row,{gutter:[16,16],children:e.map((o,n)=>(0,J.jsx)(dt.Col,{span:r,children:(0,J.jsx)(Qn,{item:o})},n))})},Wr=S(eo,{schema:Ue,skeleton:{rows:2}});var mt=require("react"),ne=require("@chatbi-v/ui-shell"),qr=require("react-csv"),Le=require("@ant-design/icons");var M=require("react/jsx-runtime"),to=t=>{let{title:e,description:r,bordered:o=!0,columns:n=[],rows:a=[],dataSource:s=[]}=t,l=s.length>0?s:a,c=(0,mt.useMemo)(()=>l.map((i,u)=>({...i,__xcml_row_key:i.__xcml_key||i.id||`row-${u}`})),[l]),m=(0,mt.useMemo)(()=>n.map(i=>({...i,dataIndex:i.key||i.dataIndex,title:(0,M.jsxs)("div",{className:"flex items-center gap-1.5 whitespace-nowrap",children:[(0,M.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground/70",children:i.title}),i.desc&&(0,M.jsx)(ne.Tooltip,{title:i.desc,children:(0,M.jsx)(Le.InfoCircleOutlined,{className:"text-xs cursor-help opacity-40 hover:opacity-100 text-primary transition-opacity"})})]}),ellipsis:!0,align:i.align||"left",width:i.width,flex:1,render:u=>{if(u==null||u==="")return(0,M.jsx)("span",{className:"text-muted-foreground/30 italic",children:"-"});let g=typeof u=="number"||!isNaN(Number(u))&&String(u).trim()!=="";return(0,M.jsx)("div",{className:`whitespace-normal break-words ${g?"font-mono":""}`,children:g?u.toLocaleString():u})}})),[n]),p=(0,mt.useMemo)(()=>n.map(i=>({label:i.title,key:i.key||i.dataIndex})),[n]),d=c.length>0;return(0,M.jsxs)("div",{className:"flex flex-col gap-4 xcml-snapshot-table-container",children:[(r||d)&&(0,M.jsxs)("div",{className:"flex items-center justify-between px-1",children:[(0,M.jsxs)("div",{className:"flex flex-col gap-0.5",children:[!t.title&&e&&(0,M.jsxs)("div",{className:"flex items-center gap-2",children:[(0,M.jsx)("div",{className:"w-7 h-7 rounded-md bg-primary/10 flex items-center justify-center text-primary shadow-sm border border-primary/10",children:(0,M.jsx)(Le.TableOutlined,{className:"text-sm"})}),(0,M.jsx)("h4",{className:"text-sm font-bold text-foreground/90 m-0 leading-none",children:e})]}),r&&(0,M.jsx)("p",{className:`text-xs text-muted-foreground m-0 leading-relaxed ${!t.title&&e?"mt-1 pl-9":"pl-1"}`,children:r})]}),d&&(0,M.jsx)(qr.CSVLink,{data:c,headers:p,filename:`${e||"snapshot"}.csv`,children:(0,M.jsx)(ne.Button,{size:"small",icon:(0,M.jsx)(Le.DownloadOutlined,{}),className:"flex items-center gap-1.5 text-xs h-8 px-3 rounded-md border-border/60 hover:border-primary/50 hover:text-primary bg-card/50 transition-all duration-150",children:"\u5BFC\u51FA CSV"})})]}),(0,M.jsxs)("div",{className:"relative group",children:[(0,M.jsx)(ne.Table,{columns:m,dataSource:c,rowKey:"__xcml_row_key",pagination:c.length>10?{pageSize:10,size:"small",showSizeChanger:!1,className:"mt-4 px-2"}:!1,scroll:{x:"max-content"},className:"xcml-custom-snapshot-table [&_.ant-table]:!bg-transparent [&_.ant-table]:!text-xs [&_.ant-table-thead_tr_th]:!bg-muted/30 [&_.ant-table-thead_tr_th]:!border-b [&_.ant-table-thead_tr_th]:!border-border/60 [&_.ant-table-thead_tr_th]:!py-2.5 [&_.ant-table-thead_tr_th]:!px-3 [&_.ant-table-thead_tr_th]:!text-foreground/70 [&_.ant-table-tbody_tr_td]:!border-b [&_.ant-table-tbody_tr_td]:!border-border/30 [&_.ant-table-tbody_tr_td]:!py-2 [&_.ant-table-tbody_tr_td]:!px-3 hover:[&_.ant-table-tbody_tr_td]:!bg-primary/5 [&_.ant-table-container]:!rounded-md [&_.ant-table-container]:!overflow-hidden [&_.ant-table-bordered_.ant-table-container]:!border-border/50 [&_.ant-pagination-item-active]:!border-primary [&_.ant-pagination-item-active]:!bg-primary/5 [&_.ant-pagination-item-active_a]:!text-primary",bordered:o,size:"small",locale:{emptyText:(0,M.jsx)(ne.Empty,{image:ne.Empty.PRESENTED_IMAGE_SIMPLE,description:(0,M.jsx)("span",{className:"text-muted-foreground/50 italic",children:"\u6682\u65E0\u5FEB\u7167\u6570\u636E"}),className:"py-8"})}}),(0,M.jsx)("div",{className:"absolute top-0 right-0 bottom-0 w-8 bg-gradient-to-l from-background/50 to-transparent pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity"})]}),d&&(0,M.jsxs)("div",{className:"flex items-center justify-between px-1 mt-1",children:[(0,M.jsxs)("span",{className:"text-xs text-muted-foreground/50 italic flex items-center gap-1.5",children:[(0,M.jsx)("span",{className:"w-1 h-1 rounded-full bg-primary/40"}),"\u5171 ",c.length," \u6761\u8BB0\u5F55"]}),(0,M.jsxs)("span",{className:"text-xs text-muted-foreground/30",children:["Last updated: ",new Date().toLocaleTimeString()]})]})]})},zr=S(to,{schema:Ze,skeleton:{rows:5}});var Hr=X(require("react"),1),ye=require("@chatbi-v/ui-shell"),Ht=require("clsx"),Kr=require("tailwind-merge"),Jr=X(require("react-highlight-words"),1),T=require("@ant-design/icons");var C=require("react/jsx-runtime"),Vr={positive:{icon:(0,C.jsx)(T.RiseOutlined,{}),color:"text-success",bg:"bg-success/5",border:"border-success/20",label:"\u589E\u957F"},negative:{icon:(0,C.jsx)(T.FallOutlined,{}),color:"text-destructive",bg:"bg-destructive/5",border:"border-destructive/20",label:"\u98CE\u9669"},warning:{icon:(0,C.jsx)(T.WarningOutlined,{}),color:"text-warning",bg:"bg-warning/5",border:"border-warning/20",label:"\u8B66\u544A"},error:{icon:(0,C.jsx)(T.CloseCircleOutlined,{}),color:"text-destructive",bg:"bg-destructive/5",border:"border-destructive/20",label:"\u5F02\u5E38"},success:{icon:(0,C.jsx)(T.CheckCircleOutlined,{}),color:"text-success",bg:"bg-success/5",border:"border-success/20",label:"\u6210\u529F"},insight:{icon:(0,C.jsx)(T.BulbOutlined,{}),color:"text-primary",bg:"bg-primary/5",border:"border-primary/20",label:"\u53D1\u73B0"},neutral:{icon:(0,C.jsx)(T.InfoCircleOutlined,{}),color:"text-muted-foreground",bg:"bg-muted/5",border:"border-muted/20",label:"\u63D0\u793A"}},ro=t=>{let{content:e="",highlights:r=[],sentiment:o="insight",citations:n=[],actions:a=[]}=t,s=me(r),l=me(n),c=me(a),m=Vr[o]||Vr.insight,p=i=>{be.emit("action_click",{action:i,source:"insight_card"})},d=i=>{be.emit("feedback",{type:i,source:"insight_card",content:e})};return(0,C.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,C.jsxs)("div",{className:(0,Kr.twMerge)("relative overflow-hidden rounded-2xl border transition-all duration-300",m.bg,m.border,"p-5 shadow-sm hover:shadow-md"),children:[(0,C.jsx)("div",{className:"absolute -right-4 -top-4 w-24 h-24 blur-3xl opacity-20 bg-current pointer-events-none"}),(0,C.jsxs)("div",{className:"relative flex gap-4",children:[(0,C.jsx)("div",{className:(0,Ht.clsx)("flex items-center justify-center w-10 h-10 rounded-xl shadow-sm border shrink-0","bg-background/80 backdrop-blur-sm",m.color,m.border),children:Hr.default.cloneElement(m.icon,{className:"text-lg"})}),(0,C.jsxs)("div",{className:"flex-1 space-y-3",children:[(0,C.jsxs)("div",{className:"flex items-center justify-between",children:[(0,C.jsx)("span",{className:(0,Ht.clsx)("text-xs font-bold uppercase tracking-[0.15em]",m.color),children:m.label}),(0,C.jsxs)("div",{className:"flex items-center gap-1",children:[(0,C.jsx)(ye.Tooltip,{title:"\u6709\u5E2E\u52A9",children:(0,C.jsx)(ye.Button,{type:"text",size:"small",icon:(0,C.jsx)(T.LikeOutlined,{}),className:"text-muted-foreground/40 hover:text-primary transition-colors h-6 w-6 flex items-center justify-center",onClick:()=>d("up")})}),(0,C.jsx)(ye.Tooltip,{title:"\u65E0\u5E2E\u52A9",children:(0,C.jsx)(ye.Button,{type:"text",size:"small",icon:(0,C.jsx)(T.DislikeOutlined,{}),className:"text-muted-foreground/40 hover:text-destructive transition-colors h-6 w-6 flex items-center justify-center",onClick:()=>d("down")})})]})]}),(0,C.jsx)("div",{className:"text-sm leading-relaxed font-medium text-foreground/90",children:(0,C.jsx)(Jr.default,{highlightClassName:"bg-primary/10 text-primary border-b-2 border-primary/30 font-bold px-0.5 mx-0.5",searchWords:s,autoEscape:!0,textToHighlight:e})}),l.length>0&&(0,C.jsx)("div",{className:"flex flex-wrap gap-2 pt-2",children:l.map((i,u)=>(0,C.jsxs)("button",{className:"flex items-center gap-1 px-2 py-0.5 rounded-full bg-muted/20 border border-border/50 text-xs text-muted-foreground hover:text-primary hover:border-primary/30 transition-all cursor-pointer",children:[(0,C.jsx)(T.LinkOutlined,{className:"text-xs"}),i]},u))})]})]})]}),c.length>0&&(0,C.jsxs)("div",{className:"space-y-3 px-1",children:[(0,C.jsxs)("div",{className:"flex items-center gap-2 text-xs font-bold text-foreground/40 uppercase tracking-widest",children:[(0,C.jsx)("div",{className:"h-px flex-1 bg-gradient-to-r from-transparent to-border/50"}),(0,C.jsx)(T.ThunderboltOutlined,{className:"text-amber-500"}),(0,C.jsx)("span",{children:"\u4E0B\u4E00\u6B65\u884C\u52A8\u5EFA\u8BAE"}),(0,C.jsx)("div",{className:"h-px flex-1 bg-gradient-to-l from-transparent to-border/50"})]}),(0,C.jsx)("div",{className:"flex flex-wrap gap-2.5",children:c.map((i,u)=>(0,C.jsx)(ye.Button,{type:"default",className:"group relative h-9 px-4 rounded-xl border-dashed border-primary/30 hover:border-primary hover:bg-primary/5 transition-all overflow-hidden",onClick:()=>p(i),children:(0,C.jsxs)("div",{className:"flex items-center gap-2",children:[(0,C.jsx)("span",{className:"text-xs font-semibold text-foreground/80 group-hover:text-primary transition-colors",children:i}),(0,C.jsx)(T.ThunderboltOutlined,{className:"text-amber-400 opacity-0 -translate-x-2 group-hover:opacity-100 group-hover:translate-x-0 transition-all"})]})},u))})]})]})},Gr=S(ro,{schema:Ke,getTitle:t=>t.title||"\u6570\u636E\u6D1E\u5BDF",getIcon:t=>(0,C.jsx)(T.BulbOutlined,{}),getVariant:()=>"plain",skeleton:{rows:4}});var ut=require("react"),ae=require("@chatbi-v/ui-shell"),yt=require("@ant-design/icons"),Ur=X(require("html2canvas"),1),ke=require("@ant-design/plots");var k=require("react/jsx-runtime"),pt=[{label:"\u79D1\u6280\u84DD",value:"#1890ff",bg:"#f0f5ff"},{label:"\u6D3B\u529B\u6A59",value:"#fa8c16",bg:"#fff7e6"},{label:"\u6E05\u65B0\u7EFF",value:"#52c41a",bg:"#f6ffed"},{label:"\u6697\u591C\u7D2B",value:"#722ed1",bg:"#f9f0ff"},{label:"\u5546\u52A1\u7070",value:"#595959",bg:"#f5f5f5"}],no=t=>{let{title:e="\u6570\u636E\u6D77\u62A5",subTitle:r="Data Insight Poster",charts:o=[],qrCode:n="https://ant.design",author:a="ChatBI",date:s=new Date().toLocaleDateString(),backgroundImage:l,themeColor:c}=t,m=typeof l=="string"?l.trim().replace(/^[`'" ]|[`'" ]$/g,"").trim().replace(/^[`'" ]|[`'" ]$/g,""):void 0,p=(0,ut.useRef)(null),[d,i]=(0,ut.useState)(pt[0]),u=c||d.value,g=c?`${c}10`:d.bg,b=async()=>{if(p.current)try{let y=(await(0,Ur.default)(p.current,{useCORS:!0,scale:2,backgroundColor:d.bg})).toDataURL("image/png"),h=document.createElement("a");h.href=y,h.download=`poster-${Date.now()}.png`,h.click()}catch(f){console.error("Poster generation failed",f)}},x=(f,y)=>{let h={data:f.data,height:200,autoFit:!0};return f.type==="column"||f.type==="bar"?(0,k.jsx)(ke.Column,{...h,xField:"label",yField:"value"},y):f.type==="line"?(0,k.jsx)(ke.Line,{...h,xField:"label",yField:"value"},y):f.type==="pie"?(0,k.jsx)(ke.Pie,{...h,angleField:"value",colorField:"label"},y):null};return(0,k.jsxs)("div",{className:"flex flex-col",children:[(0,k.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,k.jsx)(ae.Space,{children:(0,k.jsx)(ae.Select,{value:d.value,onChange:f=>i(pt.find(y=>y.value===f)||pt[0]),options:pt,className:"w-32",suffixIcon:(0,k.jsx)(yt.BgColorsOutlined,{})})}),(0,k.jsx)(ae.Button,{type:"primary",icon:(0,k.jsx)(yt.DownloadOutlined,{}),onClick:b,children:"\u751F\u6210\u6D77\u62A5"})]}),(0,k.jsx)("div",{className:"flex-1 overflow-auto border border-border rounded-lg shadow-sm bg-muted/10 min-h-0 flex flex-col",children:(0,k.jsxs)("div",{ref:p,className:"p-8 w-full mx-auto transition-colors duration-300 flex flex-col shrink-0 bg-cover bg-center text-zinc-800 min-h-full",style:{backgroundColor:g,backgroundImage:m?`url(${m})`:void 0},children:[(0,k.jsxs)("div",{className:"mb-6 text-center",children:[(0,k.jsx)("h1",{className:"text-2xl font-bold mb-2",style:{color:u},children:e}),(0,k.jsx)("p",{className:"text-sm opacity-70",children:r})]}),(0,k.jsx)("div",{className:"space-y-6 mb-8",children:o.map((f,y)=>(0,k.jsxs)("div",{className:"bg-white p-4 rounded-lg shadow-sm opacity-90",children:[(0,k.jsx)("h4",{className:"font-medium mb-2 text-center",children:f.title}),x(f,y)]},y))}),(0,k.jsxs)("div",{className:"flex items-center justify-between mt-auto pt-8 border-t border-border/40 border-dashed",children:[(0,k.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,k.jsxs)("p",{children:["Created by ",a]}),(0,k.jsx)("p",{children:s})]}),(0,k.jsx)("div",{className:"bg-white p-1 rounded",children:(0,k.jsx)(ae.QRCode,{value:n,size:64,bordered:!1})})]})]})})]})},Yr=S(no,{schema:Ye,skeleton:{rows:4}});var gt=require("@chatbi-v/ui-shell"),ie=require("@ant-design/icons");var A=require("react/jsx-runtime"),{Text:oo}=gt.Typography,ao=t=>{switch(t){case"success":return(0,A.jsx)(ie.CheckCircleFilled,{className:"text-success bg-card rounded-full relative z-10 shadow-sm"});case"failure":return(0,A.jsx)(ie.CloseCircleFilled,{className:"text-destructive bg-card rounded-full relative z-10 shadow-sm"});case"running":return(0,A.jsx)(ie.LoadingOutlined,{className:"text-primary bg-card rounded-full relative z-10"});default:return(0,A.jsx)(ie.ClockCircleFilled,{className:"text-muted-foreground/40 bg-card rounded-full relative z-10"})}},io=t=>{switch(t){case"success":return"\u6210\u529F";case"failure":return"\u5931\u8D25";case"running":return"\u6267\u884C\u4E2D";default:return t}},so=t=>{switch(t){case"success":return"success";case"failure":return"error";case"running":return"processing";default:return"default"}},lo=t=>{let{steps:e=[]}=t;return(0,A.jsxs)("div",{className:"relative pl-2 py-2",children:[(0,A.jsx)("div",{className:"absolute top-4 bottom-4 left-[15px] w-0.5 bg-gradient-to-b from-primary/10 via-primary/30 to-primary/10"}),e.map((r,o)=>(0,A.jsxs)("div",{className:"relative flex mb-6 last:mb-0 group",children:[(0,A.jsx)("div",{className:"mr-4 mt-0.5 text-lg transition-transform duration-300 group-hover:scale-110",children:ao(r.status)}),(0,A.jsxs)("div",{className:"flex-1 min-w-0 bg-card rounded-xl p-3 border border-border/50 hover:border-primary/30 hover:shadow-md transition-all duration-300 group-hover:-translate-y-0.5",children:[(0,A.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,A.jsxs)("div",{className:"flex items-center gap-2",children:[(0,A.jsx)("span",{className:"font-bold text-sm text-foreground",children:r.tool||`\u6B65\u9AA4 ${o+1}`}),(0,A.jsx)(oo,{type:"secondary",className:"text-xs text-muted-foreground",children:r.action})]}),(0,A.jsxs)("div",{className:"flex items-center gap-2",children:[r.duration&&(0,A.jsx)("span",{className:"text-xs font-mono text-muted-foreground/60 bg-muted px-1.5 py-0.5 rounded-md",children:r.duration}),(0,A.jsx)(gt.Tag,{color:so(r.status),bordered:!1,className:"mr-0 text-xs px-1.5 rounded-full",children:io(r.status)})]})]}),r.thought&&(0,A.jsx)("div",{className:"mb-2 text-xs text-muted-foreground italic border-l-2 border-primary/30 pl-2 py-1 bg-primary/5 rounded-r-md whitespace-pre-wrap leading-normal",children:r.thought}),r.result&&(0,A.jsx)("div",{className:"mt-2 text-xs",children:(0,A.jsx)("div",{className:"bg-muted/30 border border-border/40 rounded-lg p-2 overflow-x-auto custom-scrollbar",children:(0,A.jsx)("pre",{className:"m-0 whitespace-pre-wrap font-mono text-xs text-muted-foreground leading-relaxed",children:typeof r.result=="string"?r.result:JSON.stringify(r.result,null,2)})})}),r.error&&(0,A.jsxs)("div",{className:"mt-2 text-xs text-destructive bg-destructive/5 p-2 rounded-lg border border-destructive/20 whitespace-pre-wrap",children:["\u9519\u8BEF: ",r.error]})]})]},o))]})},Zr=S(lo,{schema:Qe,getTitle:t=>t.title||"\u601D\u7EF4\u94FE",skeleton:!0});var je=require("react"),se=require("@chatbi-v/ui-shell"),le=require("@ant-design/icons");var Qr=X(require("react-highlight-words"),1);var B=require("react/jsx-runtime"),co=t=>{let{message:e}=se.App.useApp(),{label:r="\u62A5\u544A\u6458\u8981",value:o=0,step:n=1,unit:a="",actionId:s="update_summary",content:l="",highlightKeywords:c=[]}=t,[m,p]=(0,je.useState)(Number(o)||0),[d,i]=(0,je.useState)(!1);(0,je.useEffect)(()=>{p(Number(o)||0)},[o]);let u=me(c),g=x=>{p(x)};return(0,B.jsxs)("div",{className:"flex flex-col",children:[l&&(0,B.jsx)("div",{className:"mb-4 text-muted-foreground leading-normal whitespace-pre-wrap",children:(0,B.jsx)(Qr.default,{highlightClassName:"bg-primary/20 text-primary rounded px-1 font-medium",searchWords:u,autoEscape:!0,textToHighlight:l})}),(0,B.jsxs)("div",{className:"flex items-center justify-between",children:[(0,B.jsxs)("div",{children:[(0,B.jsx)("div",{className:"text-muted-foreground mb-1 text-xs font-medium uppercase tracking-wider",children:r}),(0,B.jsxs)("div",{className:"text-3xl font-black text-foreground flex items-baseline tracking-tight",children:[m,(0,B.jsx)("span",{className:"text-sm font-semibold text-muted-foreground/60 ml-1.5",children:a})]})]}),(0,B.jsxs)("div",{className:"flex items-center space-x-1 bg-muted/40 p-1.5 rounded-xl border border-border/30 shadow-inner",children:[(0,B.jsx)(se.Button,{icon:(0,B.jsx)(le.MinusOutlined,{}),size:"small",shape:"circle",type:"text",className:"hover:bg-background hover:text-primary hover:shadow-sm",onClick:()=>g(m-Number(n)),disabled:d}),(0,B.jsx)(se.InputNumber,{value:m,onChange:x=>g(Number(x)),variant:"borderless",className:"w-20 text-center bg-transparent font-bold text-foreground",controls:!1,disabled:d}),(0,B.jsx)(se.Button,{icon:(0,B.jsx)(le.PlusOutlined,{}),size:"small",shape:"circle",type:"text",className:"hover:bg-background hover:text-primary hover:shadow-sm",onClick:()=>g(m+Number(n)),disabled:d}),(0,B.jsx)("div",{className:"w-px h-4 bg-border/50 mx-1"}),(0,B.jsx)(se.Button,{type:"primary",size:"small",shape:"round",icon:d?(0,B.jsx)(le.LoadingOutlined,{}):(0,B.jsx)(le.SaveOutlined,{}),onClick:async()=>{i(!0);try{be.emit("action",{type:s,payload:{value:m,label:r,...t}}),await new Promise(x=>setTimeout(x,800)),e.success(`\u5DF2\u66F4\u65B0 ${r} \u8BBE\u5B9A\u503C`)}catch{e.error("\u63D0\u4EA4\u5931\u8D25")}finally{i(!1)}},loading:d,className:"ml-1 px-3 shadow-md shadow-primary/20 hover:shadow-primary/40 transition-all",children:"\u4FDD\u5B58"})]})]})]})},en=S(co,{schema:Je,getTitle:t=>t.label,skeleton:{rows:2}});var ce=require("react/jsx-runtime");function mo(t){let e=t?.theme?{"data-theme":t.theme}:{};return pe({"metric-card":(n,a)=>(0,ce.jsx)(Br,{node:n,...e},a),"mini-kpi-strip":(n,a)=>(0,ce.jsx)(Wr,{node:n,...e},a),"snapshot-table":(n,a)=>(0,ce.jsx)(zr,{node:n,...e},a),"insight-card":(n,a)=>(0,ce.jsx)(Gr,{node:n,...e},a),"poster-card":(n,a)=>(0,ce.jsx)(Yr,{node:n,...e},a),"thought-chain":(n,a)=>(0,ce.jsx)(Zr,{node:n,...e},a),"interactive-summary":(n,a)=>(0,ce.jsx)(en,{node:n,...e},a)},{})}0&&(module.exports={AntVChartLoader,COMMON_PROPS,DefaultEmptyPlaceholder,DefaultErrorPlaceholder,ThemeProvider,XCMLCardWrapper,XCMLChart,XCMLEventBus,XCMLLayoutProvider,XCMLMarkdown,XCML_SCHEMAS,buildConfig,chartSchema,cleanPropsBySchema,columnChartSchema,columnStrategy,createAntVRenderers,createBasicRenderers,createExtendedRenderers,createRenderersWithAliases,deepMerge,dualAxesChartSchema,dualAxesStrategy,extractBaseStyles,funnelChartSchema,funnelStrategy,getChartStrategy,getTheme,lineChartSchema,lineStrategy,mergePropsAndBody,normalizeNodeData,normalizeTagName,parse,parseArrayProp,parseInlineData,parseXCML,pieChartSchema,pieStrategy,preprocessXCML,renderXCML,strategies,stringify,stringifyToXCML,themeDark,themeLight,themeMap,toXCMLNodeFromElement,toXCMLTag,toXTag,useTheme,useXCMLComponent,useXCMLLayout,useXCMLNode,validateDataSchema,validateXCMLNode,withXCMLCard,xTagPlugin,xcmlBus});
|