bi-components-library 1.0.8 → 1.0.10

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.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(X,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("react"),require("antd"),require("@ant-design/icons"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","antd","@ant-design/icons","react-dom"],s):(X=typeof globalThis<"u"?globalThis:X||self,s(X.SealSeekBIComponents={},X.React,X.antd,X.AntdIcons,X.ReactDOM))})(this,function(X,s,G,ue,Me){"use strict";var ye={exports:{}},fe={};/**
1
+ (function(H,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react"),require("antd"),require("@ant-design/icons"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","antd","@ant-design/icons","react-dom"],l):(H=typeof globalThis<"u"?globalThis:H||self,l(H.SealSeekBIComponents={},H.React,H.antd,H.AntdIcons,H.ReactDOM))})(this,function(H,l,F,ce,De){"use strict";var ye={exports:{}},fe={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var we;function Be(){if(we)return fe;we=1;var t=Symbol.for("react.transitional.element"),f=Symbol.for("react.fragment");function u(l,i,m){var C=null;if(m!==void 0&&(C=""+m),i.key!==void 0&&(C=""+i.key),"key"in i){m={};for(var h in i)h!=="key"&&(m[h]=i[h])}else m=i;return i=m.ref,{$$typeof:t,type:l,key:C,ref:i!==void 0?i:null,props:m}}return fe.Fragment=f,fe.jsx=u,fe.jsxs=u,fe}var me={};/**
9
+ */var we;function Me(){if(we)return fe;we=1;var t=Symbol.for("react.transitional.element"),p=Symbol.for("react.fragment");function u(s,i,m){var k=null;if(m!==void 0&&(k=""+m),i.key!==void 0&&(k=""+i.key),"key"in i){m={};for(var y in i)y!=="key"&&(m[y]=i[y])}else m=i;return i=m.ref,{$$typeof:t,type:s,key:k,ref:i!==void 0?i:null,props:m}}return fe.Fragment=p,fe.jsx=u,fe.jsxs=u,fe}var me={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,20 +14,20 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Ee;function De(){return Ee||(Ee=1,process.env.NODE_ENV!=="production"&&function(){function t(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===K?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case v:return"Fragment";case w:return"Profiler";case g:return"StrictMode";case E:return"Suspense";case q:return"SuspenseList";case P:return"Activity"}if(typeof c=="object")switch(typeof c.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),c.$$typeof){case A:return"Portal";case b:return(c.displayName||"Context")+".Provider";case I:return(c._context.displayName||"Context")+".Consumer";case T:var V=c.render;return c=c.displayName,c||(c=V.displayName||V.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case B:return V=c.displayName||null,V!==null?V:t(c.type)||"Memo";case D:V=c._payload,c=c._init;try{return t(c(V))}catch{}}return null}function f(c){return""+c}function u(c){try{f(c);var V=!1}catch{V=!0}if(V){V=console;var z=V.error,Q=typeof Symbol=="function"&&Symbol.toStringTag&&c[Symbol.toStringTag]||c.constructor.name||"Object";return z.call(V,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Q),f(c)}}function l(c){if(c===v)return"<>";if(typeof c=="object"&&c!==null&&c.$$typeof===D)return"<...>";try{var V=t(c);return V?"<"+V+">":"<...>"}catch{return"<...>"}}function i(){var c=F.A;return c===null?null:c.getOwner()}function m(){return Error("react-stack-top-frame")}function C(c){if(Y.call(c,"key")){var V=Object.getOwnPropertyDescriptor(c,"key").get;if(V&&V.isReactWarning)return!1}return c.key!==void 0}function h(c,V){function z(){L||(L=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",V))}z.isReactWarning=!0,Object.defineProperty(c,"key",{get:z,configurable:!0})}function e(){var c=t(this.type);return U[c]||(U[c]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),c=this.props.ref,c!==void 0?c:null}function r(c,V,z,Q,oe,ee,de,a){return z=ee.ref,c={$$typeof:n,type:c,key:V,props:ee,_owner:oe},(z!==void 0?z:null)!==null?Object.defineProperty(c,"ref",{enumerable:!1,get:e}):Object.defineProperty(c,"ref",{enumerable:!1,value:null}),c._store={},Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(c,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(c,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:de}),Object.defineProperty(c,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c}function N(c,V,z,Q,oe,ee,de,a){var o=V.children;if(o!==void 0)if(Q)if($(o)){for(Q=0;Q<o.length;Q++)p(o[Q]);Object.freeze&&Object.freeze(o)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else p(o);if(Y.call(V,"key")){o=t(c);var y=Object.keys(V).filter(function(x){return x!=="key"});Q=0<y.length?"{key: someKey, "+y.join(": ..., ")+": ...}":"{key: someKey}",le[o+Q]||(y=0<y.length?"{"+y.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var Ee;function Fe(){return Ee||(Ee=1,process.env.NODE_ENV!=="production"&&function(){function t(d){if(d==null)return null;if(typeof d=="function")return d.$$typeof===X?null:d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case v:return"Fragment";case x:return"Profiler";case g:return"StrictMode";case T:return"Suspense";case B:return"SuspenseList";case M:return"Activity"}if(typeof d=="object")switch(typeof d.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),d.$$typeof){case A:return"Portal";case b:return(d.displayName||"Context")+".Provider";case w:return(d._context.displayName||"Context")+".Consumer";case S:var V=d.render;return d=d.displayName,d||(d=V.displayName||V.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case O:return V=d.displayName||null,V!==null?V:t(d.type)||"Memo";case D:V=d._payload,d=d._init;try{return t(d(V))}catch{}}return null}function p(d){return""+d}function u(d){try{p(d);var V=!1}catch{V=!0}if(V){V=console;var z=V.error,Q=typeof Symbol=="function"&&Symbol.toStringTag&&d[Symbol.toStringTag]||d.constructor.name||"Object";return z.call(V,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Q),p(d)}}function s(d){if(d===v)return"<>";if(typeof d=="object"&&d!==null&&d.$$typeof===D)return"<...>";try{var V=t(d);return V?"<"+V+">":"<...>"}catch{return"<...>"}}function i(){var d=G.A;return d===null?null:d.getOwner()}function m(){return Error("react-stack-top-frame")}function k(d){if(Y.call(d,"key")){var V=Object.getOwnPropertyDescriptor(d,"key").get;if(V&&V.isReactWarning)return!1}return d.key!==void 0}function y(d,V){function z(){L||(L=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",V))}z.isReactWarning=!0,Object.defineProperty(d,"key",{get:z,configurable:!0})}function e(){var d=t(this.type);return J[d]||(J[d]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),d=this.props.ref,d!==void 0?d:null}function r(d,V,z,Q,oe,ee,de,a){return z=ee.ref,d={$$typeof:n,type:d,key:V,props:ee,_owner:oe},(z!==void 0?z:null)!==null?Object.defineProperty(d,"ref",{enumerable:!1,get:e}):Object.defineProperty(d,"ref",{enumerable:!1,value:null}),d._store={},Object.defineProperty(d._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(d,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(d,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:de}),Object.defineProperty(d,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(d.props),Object.freeze(d)),d}function C(d,V,z,Q,oe,ee,de,a){var c=V.children;if(c!==void 0)if(Q)if($(c)){for(Q=0;Q<c.length;Q++)f(c[Q]);Object.freeze&&Object.freeze(c)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else f(c);if(Y.call(V,"key")){c=t(d);var h=Object.keys(V).filter(function(E){return E!=="key"});Q=0<h.length?"{key: someKey, "+h.join(": ..., ")+": ...}":"{key: someKey}",le[c+Q]||(h=0<h.length?"{"+h.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,Q,o,y,o),le[o+Q]=!0)}if(o=null,z!==void 0&&(u(z),o=""+z),C(V)&&(u(V.key),o=""+V.key),"key"in V){z={};for(var R in V)R!=="key"&&(z[R]=V[R])}else z=V;return o&&h(z,typeof c=="function"?c.displayName||c.name||"Unknown":c),r(c,o,ee,oe,i(),z,de,a)}function p(c){typeof c=="object"&&c!==null&&c.$$typeof===n&&c._store&&(c._store.validated=1)}var S=s,n=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),b=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),K=Symbol.for("react.client.reference"),F=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=Object.prototype.hasOwnProperty,$=Array.isArray,k=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(c){return c()}};var L,U={},J=S.react_stack_bottom_frame.bind(S,m)(),se=k(l(m)),le={};me.Fragment=v,me.jsx=function(c,V,z,Q,oe){var ee=1e4>F.recentlyCreatedOwnerStacks++;return N(c,V,z,!1,Q,oe,ee?Error("react-stack-top-frame"):J,ee?k(l(c)):se)},me.jsxs=function(c,V,z,Q,oe){var ee=1e4>F.recentlyCreatedOwnerStacks++;return N(c,V,z,!0,Q,oe,ee?Error("react-stack-top-frame"):J,ee?k(l(c)):se)}}()),me}var ke;function Pe(){return ke||(ke=1,process.env.NODE_ENV==="production"?ye.exports=Be():ye.exports=De()),ye.exports}var d=Pe();const Te=({variant:t="primary",loading:f=!1,children:u,...l})=>{const i=m=>{switch(m){case"primary":return"primary";case"ghost":return"default";case"dashed":return"dashed";case"link":return"link";case"text":return"text";default:return"primary"}};return d.jsx(G.Button,{...l,type:i(t),loading:f,ghost:t==="ghost",children:u})};Te.__docgenInfo={displayName:"Button",description:"基础按钮,用于触发操作",props:{variant:{name:"variant",required:!1,description:"视觉风格",type:{name:"ButtonVariant",raw:'"primary" | "ghost" | "dashed" | "link" | "text"'},defaultValue:{value:'"primary"'}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},children:{name:"children",required:!1,description:"按钮内容",type:{name:"ReactNode",raw:"React.ReactNode"}},size:{name:"size",required:!1,description:"按钮大小",type:{name:"ButtonSize",raw:'"small" | "middle" | "large"'}},disabled:{name:"disabled",required:!1,description:"是否禁用",type:{name:"boolean",raw:"boolean"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: MouseEvent) => void"}}}};const Ce=({title:t,children:f,bordered:u=!0,hoverable:l=!1,size:i="default",...m})=>d.jsx(G.Card,{...m,title:t,bordered:u,hoverable:l,size:i,children:f});Ce.__docgenInfo={displayName:"Card",description:"卡片容器,用于分组内容",props:{title:{name:"title",required:!1,description:"标题",type:{name:"ReactNode",raw:"React.ReactNode"}},children:{name:"children",required:!1,description:"内容区域",type:{name:"ReactNode",raw:"React.ReactNode"}},bordered:{name:"bordered",required:!1,description:"是否显示边框",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},hoverable:{name:"hoverable",required:!1,description:"是否可悬停",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},size:{name:"size",required:!1,description:"卡片大小",type:{name:"CardSize",raw:'"default" | "small"'},defaultValue:{value:'"default"'}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},actions:{name:"actions",required:!1,description:"卡片操作组",type:{name:"ReactNode[]",raw:"React.ReactNode[]"}}}};const Ne=({showDefaultFooter:t=!0,...f})=>{const u=f.footer!==void 0?f.footer:t?(l,{OkBtn:i,CancelBtn:m})=>d.jsxs(d.Fragment,{children:[d.jsx(i,{}),d.jsx(m,{})]}):null;return d.jsx(G.Modal,{...f,footer:u})};Ne.__docgenInfo={displayName:"AppModal",description:"应用级模态框组件,基于 Ant Design Modal 封装",props:{showDefaultFooter:{name:"showDefaultFooter",required:!1,description:"是否显示默认的确定和取消按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},title:{name:"title",required:!1,description:"模态框标题",type:{name:"ReactNode",raw:"React.ReactNode"}},open:{name:"open",required:!1,description:"是否显示模态框",type:{name:"boolean",raw:"boolean"}},onCancel:{name:"onCancel",required:!1,description:"取消按钮点击事件",type:{name:"function",raw:"(e: React.MouseEvent<HTMLElement>) => void"}},onOk:{name:"onOk",required:!1,description:"确定按钮点击事件",type:{name:"function",raw:"(e: React.MouseEvent<HTMLElement>) => void"}},children:{name:"children",required:!1,description:"模态框内容",type:{name:"ReactNode",raw:"React.ReactNode"}},width:{name:"width",required:!1,description:"模态框宽度",type:{name:"string | number",raw:"string | number"}},centered:{name:"centered",required:!1,description:"是否居中显示",type:{name:"boolean",raw:"boolean"}},maskClosable:{name:"maskClosable",required:!1,description:"点击蒙层是否允许关闭",type:{name:"boolean",raw:"boolean"}}}};const Se=({scrollX:t,showPagination:f=!0,defaultPageSize:u=10,...l})=>d.jsx(G.Table,{...l,scroll:{x:t||"max-content",y:"50vh"},pagination:f?{hideOnSinglePage:!0,showSizeChanger:!0,showQuickJumper:!0,defaultPageSize:u,...l.pagination}:!1});Se.__docgenInfo={displayName:"PageTable",description:"页面级表格组件,高度铺满容器,自动滚动",props:{scrollX:{name:"scrollX",required:!1,description:"水平滚动宽度",type:{name:"number",raw:"number"}},showPagination:{name:"showPagination",required:!1,description:"是否显示分页器",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},defaultPageSize:{name:"defaultPageSize",required:!1,description:"默认页面大小",type:{name:"number",raw:"number"},defaultValue:{value:"10"}},columns:{name:"columns",required:!1,description:"表格列配置",type:{name:"ColumnType[]",raw:"ColumnType<any>[]"}},dataSource:{name:"dataSource",required:!1,description:"数据源",type:{name:"any[]",raw:"any[]"}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},rowKey:{name:"rowKey",required:!1,description:"行数据的 Key",type:{name:"string | function",raw:"string | ((record: any) => string)"}}}};const Fe=ue.createFromIconfontCN({scriptUrl:["https://at.alicdn.com/t/c/font_4968458_eh91gfr4j9e.js"]}),Re=({name:t,size:f,color:u,style:l,...i})=>{const m={fontSize:f,color:u,...l};return d.jsx(Fe,{...i,type:t,style:m})};Re.__docgenInfo={displayName:"XcIcon",description:"自定义图标组件,基于 iconfont",props:{name:{name:"name",required:!0,description:"图标名称",type:{name:"string",raw:"string"}},size:{name:"size",required:!1,description:"图标大小",type:{name:"number | string",raw:"number | string"}},color:{name:"color",required:!1,description:"图标颜色",type:{name:"string",raw:"string"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}}}};const Ae=({loading:t,description:f="暂无数据",className:u,emptyChildren:l,loadingText:i,emptyImage:m})=>t?d.jsxs(G.Flex,{className:`pt-10 w-full ${u||""}`,align:"center",justify:"center",vertical:!0,children:[d.jsx(G.Spin,{size:"large"}),i&&d.jsx("div",{className:"mt-4 text-gray-500",children:i})]}):d.jsx(G.Flex,{className:`pt-10 w-full ${u||""}`,align:"center",justify:"center",children:d.jsx(G.Empty,{image:m,description:f,imageStyle:{height:180},children:l})});Ae.__docgenInfo={displayName:"EmptyAndSpin",description:"空状态和加载状态组合组件",props:{loading:{name:"loading",required:!0,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},description:{name:"description",required:!1,description:"空状态描述",type:{name:"ReactNode",raw:"React.ReactNode"},defaultValue:{value:'"暂无数据"'}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},emptyChildren:{name:"emptyChildren",required:!1,description:"空状态额外内容",type:{name:"ReactNode",raw:"React.ReactNode"}},loadingText:{name:"loadingText",required:!1,description:"加载中提示文字",type:{name:"string",raw:"string"}},emptyImage:{name:"emptyImage",required:!1,description:"空状态图片",type:{name:"string",raw:"string"}}}};const Ie=({onClick:t,showText:f=!1,className:u,size:l="small",type:i="default"})=>d.jsx(G.Button,{size:l,type:i,icon:d.jsx(ue.LeftOutlined,{}),className:`cursor-pointer ${u||""}`,onClick:t,children:f&&"返回"});Ie.__docgenInfo={displayName:"BackButton",description:"返回按钮组件",props:{onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"() => void"}},showText:{name:"showText",required:!1,description:"是否显示文字",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},size:{name:"size",required:!1,description:"按钮大小",type:{name:"ButtonSize",raw:'"small" | "middle" | "large"'},defaultValue:{value:'"small"'}},type:{name:"type",required:!1,description:"按钮类型",type:{name:"ButtonType",raw:'"primary" | "default" | "dashed" | "link" | "text"'},defaultValue:{value:'"default"'}}}};const _e=({removePadding:t=!0,className:f,...u})=>{const l=t?`px-0 h-auto ${f||""}`:f;return d.jsx(G.Button,{type:"link",...u,className:l,children:u.children})};_e.__docgenInfo={displayName:"LinkButton",description:"链接样式按钮组件,适用于表格操作列",props:{removePadding:{name:"removePadding",required:!1,description:"是否去除默认内边距",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},children:{name:"children",required:!1,description:"按钮内容",type:{name:"ReactNode",raw:"React.ReactNode"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: React.MouseEvent<HTMLButtonElement>) => void"}},disabled:{name:"disabled",required:!1,description:"是否禁用",type:{name:"boolean",raw:"boolean"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}}}};const{Option:Ge}=G.Select,je=({columns:t,request:f,searchFields:u=[],showSearch:l=!0,showRefresh:i=!0,defaultPageSize:m=10,pageSizeOptions:C=["10","20","50","100"],autoLoad:h=!0,externalParams:e={},...r})=>{const[N,p]=s.useState([]),[S,n]=s.useState(!1),[A,v]=s.useState({current:1,pageSize:m,total:0}),[g,w]=s.useState({}),[I,b]=s.useState({}),[T]=G.Form.useForm(),E=s.useRef(A);E.current=A;const q=s.useRef(e);q.current=e;const B=s.useRef(!1),D=s.useMemo(()=>t.map(k=>{const{sortable:L,render:U,...J}=k;return{...J,sorter:L?!0:void 0,render:U||(se=>se)}}),[t]),P=s.useCallback(async(k={})=>{if(f){n(!0);try{const L={page:E.current.current,pageSize:E.current.pageSize,sortField:I.field,sortOrder:I.order,searchParams:{...g,...q.current},...k},U=await f(L);U.success&&(p(U.data),v(J=>({...J,total:U.total,current:L.page||J.current})))}catch(L){console.error("加载数据失败:",L)}finally{n(!1)}}},[f,I,g]),K=s.useCallback(k=>{w(k),v(L=>({...L,current:1}))},[]),F=s.useCallback(()=>{T.resetFields(),w({}),v(k=>({...k,current:1}))},[T]),Y=s.useCallback(()=>{P()},[P]),$=s.useCallback((k,L,U)=>{const J={current:k.current||1,pageSize:k.pageSize||m,total:k.total||0},se={field:U?.field,order:U?.order};v(J),b(se)},[m]);return s.useEffect(()=>{const k=Object.keys(e).length>0;(h&&!B.current||k)&&(P(),B.current=!0)},[h,e,P]),d.jsxs("div",{children:[l&&u.length>0&&d.jsx(G.Card,{size:"small",style:{marginBottom:16},children:d.jsxs(G.Form,{form:T,layout:"inline",onFinish:K,initialValues:u.reduce((k,L)=>(L.defaultValue!==void 0&&(k[L.key]=L.defaultValue),k),{}),children:[u.map(k=>d.jsx(G.Form.Item,{name:k.key,label:k.label,children:k.type==="input"?d.jsx(G.Input,{placeholder:k.placeholder||`请输入${k.label}`,style:{width:200}}):d.jsx(G.Select,{placeholder:k.placeholder||`请选择${k.label}`,style:{width:200},allowClear:!0,children:k.options?.map(L=>d.jsx(Ge,{value:L.value,children:L.label},L.value))})},k.key)),d.jsx(G.Form.Item,{children:d.jsxs(G.Space,{children:[d.jsx(G.Button,{type:"primary",htmlType:"submit",icon:d.jsx(ue.SearchOutlined,{}),children:"查询"}),d.jsx(G.Button,{onClick:F,children:"重置"}),i&&d.jsx(G.Button,{icon:d.jsx(ue.ReloadOutlined,{}),onClick:Y,children:"刷新"})]})})]})}),d.jsx(G.Table,{...r,columns:D,dataSource:N,loading:S,pagination:{...A,showSizeChanger:!0,showQuickJumper:!0,showTotal:(k,L)=>`第 ${L[0]}-${L[1]} 条/共 ${k} 条`,pageSizeOptions:C},onChange:$,scroll:{x:"max-content",y:"50vh"}})]})};je.__docgenInfo={displayName:"AdvancedTable",description:"高阶表格组件,支持异步请求、搜索、排序等功能",props:{columns:{name:"columns",required:!0,description:"列配置",type:{name:"AdvancedColumnType[]",raw:"AdvancedColumnType<any>[]"}},request:{name:"request",required:!1,description:"异步请求函数",type:{name:"function",raw:"(params: RequestParams) => Promise<RequestResponse>"}},searchFields:{name:"searchFields",required:!1,description:"搜索字段配置",type:{name:"SearchFieldConfig[]",raw:"SearchFieldConfig[]"},defaultValue:{value:"[]"}},showSearch:{name:"showSearch",required:!1,description:"是否显示搜索区域",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},showRefresh:{name:"showRefresh",required:!1,description:"是否显示刷新按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},defaultPageSize:{name:"defaultPageSize",required:!1,description:"默认页面大小",type:{name:"number",raw:"number"},defaultValue:{value:"10"}},pageSizeOptions:{name:"pageSizeOptions",required:!1,description:"页面大小选项",type:{name:"string[]",raw:"string[]"},defaultValue:{value:'["10", "20", "50", "100"]'}},autoLoad:{name:"autoLoad",required:!1,description:"是否自动加载",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},externalParams:{name:"externalParams",required:!1,description:"外部请求参数",type:{name:"Record<string, any>",raw:"Record<string, any>"},defaultValue:{value:"{}"}}}};function he(t,f,u){if(!t.current)return;const l=new Set,i={};for(const p of f)p.exclusionGroup&&p.exclusionGroup!=="separator"&&(l.add(p.exclusionGroup),i[p.exclusionGroup]||(i[p.exclusionGroup]=[]),i[p.exclusionGroup].push({type:p.type,key:p.key,exclusionGroup:p.exclusionGroup}));const m={};for(const p of l){m[p]=!1;for(const S of i[p])if(S.type==="upload"&&S.key){if(u[S.key]!==null&&u[S.key]!==void 0){m[p]=!0;break}}else if(S.type==="variable"&&S.key){const n=t.current.querySelector(`[data-type="variable"][data-key="${S.key}"]`);if(n&&n.innerText.replace(/[\u200B\n]/g,"").trim().length>0){m[p]=!0;break}}}const C=f.some(p=>p.exclusionGroup==="separator"),e=Object.keys(m).filter(p=>m[p]).length>0;let r=null;if(e&&C){for(const p of f)if(p.exclusionGroup&&p.exclusionGroup!=="separator"&&m[p.exclusionGroup]){r=p.exclusionGroup;break}}for(const p of l){const S=t.current.querySelectorAll(`[data-group="${p}"]`);C&&e&&r?p===r?S.forEach(n=>{n.classList.contains("required-upload-group")?n.style.setProperty("display","inline-flex","important"):(n.classList.contains("exclusion-wrapper"),n.style.setProperty("display","inline-block","important"))}):S.forEach(n=>{n.style.display="none",n.style.setProperty("display","none","important")}):S.forEach(n=>{n.classList.contains("required-upload-group")?n.style.setProperty("display","inline-flex","important"):(n.classList.contains("exclusion-wrapper"),n.style.setProperty("display","inline-block","important"))})}t.current.querySelectorAll('[data-group="separator"]').forEach(p=>{p.style.display=e?"none":"inline"})}function ge(t,f,u,l){if(!t.current){l(!1);return}const i=[];for(let e=0;e<f.length;e++){const r=f[e];if((r.type==="variable"||r.type==="upload"||r.type==="multi-variable")&&r.required&&r.key){i.push({exclusionGroup:r.exclusionGroup||"",key:r.key,type:r.type==="multi-variable"?"variable":r.type,isMultiVariable:r.type==="multi-variable"});continue}if(r.type==="text"&&r.className?.includes("rte-text-required")&&r.exclusionGroup)for(let N=e+1;N<f.length;N++){const p=f[N];if(p.exclusionGroup===r.exclusionGroup&&(p.type==="variable"||p.type==="upload")&&p.key){i.push({exclusionGroup:r.exclusionGroup,key:p.key,type:p.type});break}}}const m=f.some(e=>e.exclusionGroup==="separator");let C=!1;if(m&&i.length>1){const e=f.findIndex(p=>p.exclusionGroup==="separator"),r=i.filter(p=>f.findIndex(n=>(n.type==="variable"||n.type==="upload")&&n.key===p.key&&n.exclusionGroup===p.exclusionGroup)<e),N=i.filter(p=>f.findIndex(n=>(n.type==="variable"||n.type==="upload")&&n.key===p.key&&n.exclusionGroup===p.exclusionGroup)>e);C=r.length>0&&N.length>0}if(i.length===0){if(f.length===0){if(!t.current){l(!1);return}const e=t.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";l(e.length>0);return}l(!0);return}const h=i.filter(e=>{if(!t.current)return!1;const r=t.current.querySelectorAll(`[data-group="${e.exclusionGroup}"]`);return r.length===0?!1:r[0].style.display!=="none"});if(h.length===0){l(!0);return}if(C){let e=!1;for(const r of h)if(r.type==="upload"&&r.key){if(u[r.key]!==null&&u[r.key]!==void 0){e=!0;break}}else if(r.type==="variable"&&r.key)if(r.isMultiVariable){const N=t.current.querySelectorAll(`[data-type="variable"][data-multi-key="${r.key}"]`);let p=!1;for(const S of Array.from(N))if(S.innerText.replace(/[\u200B\n]/g,"").trim().length>0){p=!0;break}if(p){e=!0;break}}else{const N=t.current.querySelector(`[data-type="variable"][data-key="${r.key}"]`);if(N&&N.innerText.replace(/[\u200B\n]/g,"").trim().length>0){e=!0;break}}l(e)}else{let e=!0;for(const r of h)if(r.type==="upload"&&r.key){if(u[r.key]===null||u[r.key]===void 0){e=!1;break}}else if(r.type==="variable"&&r.key)if(r.isMultiVariable){const N=t.current.querySelectorAll(`[data-type="variable"][data-multi-key="${r.key}"]`);let p=!1;for(const S of Array.from(N))if(S.innerText.replace(/[\u200B\n]/g,"").trim().length>0){p=!0;break}if(!p){e=!1;break}}else{const N=t.current.querySelector(`[data-type="variable"][data-key="${r.key}"]`);if(!N){e=!1;break}if(N.innerText.replace(/[\u200B\n]/g,"").trim().length===0){e=!1;break}}l(e)}}function be(t,f){if(!t.current)return;t.current.querySelectorAll('[data-type="variable"]').forEach(l=>{const i=l.innerText.replace(/\n/g,"");i.replace(/\u200B/g,"")?l.classList.remove("show-placeholder"):(i!=="​"&&(l.innerText="​"),l.classList.add("show-placeholder"))})}function ze(t,f,u,l,i,m={}){if(!t.current)return;let C="",h=0;for(;h<f.length;){const e=f[h],r=h+1<f.length?f[h+1]:null;if(e.type==="text"&&(e.text?.includes("icon-bitian")||e.className==="rte-text-required")&&r){const v=r.type==="upload"&&r.exclusionGroup==="fileInput"&&e.exclusionGroup==="fileInput"&&e.exclusionGroup===r.exclusionGroup,g=r.type==="variable"&&r.exclusionGroup==="textInput"&&e.exclusionGroup==="textInput"&&e.exclusionGroup===r.exclusionGroup;if(v){const I=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group">`,b="</span>";let T="";e.className?T=`<span class="${e.className}">${e.text??""}</span>`:T=e.text??"";const E=r,q=u[E.key]!==null&&u[E.key]!==void 0,B=q?u[E.key]?.name:E.text,D=q?"":"hidden",P=E.tooltip&&!q?"":"hidden",K=q?"has-file":"",F=q&&B?` data-file-name="${B.replace(/"/g,"&quot;")}"`:"",Y=`<span contenteditable="false" data-type="upload" data-key="${E.key}" class="upload-chip"><span class="upload-inner-wrapper ${K}"><span class="upload-icon">${q?"<i class='iconfont icon-exlwenjian'></i>":"<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${F}>${B||E.text}</span>${E.tooltip?`<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${P}" data-upload-key="${E.key}" data-tooltip="${E.tooltip}" title="提示"></i>`:""}<span class="file-remove-btn ${D}" title="移除文件">×</span></span></span>`;C+=I+T+Y+b,h+=2;continue}if(g){const I=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group">`,b="</span>";let T="";e.className?T=`<span class="${e.className}">${e.text??""}</span>`:T=e.text??"";const E=r,B=(E.key?i[E.key]:void 0)||E.text||"",D=!B,P=D?"​":B,K=D?"show-placeholder":"",F=E.exclusionGroup?` data-group="${E.exclusionGroup}"`:"",Y=E.tooltip?` data-tooltip="${E.tooltip.replace(/"/g,"&quot;")}" data-variable-key="${E.key||""}"`:"",$=E.tooltip&&D?"":"hidden",k=`<span contenteditable="true" data-type="variable" data-key="${E.key}" data-placeholder="${E.placeholder||""}"${F}${Y} class="variable-chip ${K}">${P}${E.tooltip?`<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${$}" data-variable-key="${E.key}" data-tooltip="${E.tooltip.replace(/"/g,"&quot;")}" title="提示"></i>`:""}</span>`;C+=I+T+k+b,h+=2;continue}}const p=e.exclusionGroup?`data-group="${e.exclusionGroup}"`:"",S=e.exclusionGroup?`<span ${p} class="exclusion-wrapper">`:"",n=e.exclusionGroup?"</span>":"";let A="";if(e.type==="tag"){const v=l?"":'<span class="tag-close-btn" title="Clear (ESC)"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg></span>',g=l?' data-locked="true"':"",w=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" data-tag-key="${e.key||""}"`:"";A=`<span contenteditable="false" class="tag-node group"${g}${w}><span class="tag-label">${e.text}</span>${v}</span>`}else if(e.type==="text"){const v=l?' data-locked="true" contenteditable="false"':' contenteditable="false"';e.className?A=`<span class="${e.className}"${v}>${e.text??""}</span>`:A=l?`<span${v}>${e.text??""}</span>`:`<span contenteditable="false">${e.text??""}</span>`}else if(e.type==="variable"&&e.key){const g=i[e.key]||e.text||"",w=!g,I=w?"​":g,b=w?"show-placeholder":"",T=e.exclusionGroup?` data-group="${e.exclusionGroup}"`:"",E=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" data-variable-key="${e.key||""}"`:"",q=e.tooltip&&w?"":"hidden",B=`<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder||""}"${T}${E} class="variable-chip ${b}">${I}${e.tooltip?`<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${q}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" title="提示"></i>`:""}</span>`;e.required?A=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${B}</span>`:A=B}else if(e.type==="upload"&&e.key){const v=u[e.key]!==null&&u[e.key]!==void 0,g=v?u[e.key]?.name:e.text,w=v?"":"hidden",I=e.tooltip&&!v?"":"hidden",b=v?"has-file":"",T=v&&g?` data-file-name="${g.replace(/"/g,"&quot;")}"`:"",E=`<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${b}"><span class="upload-icon">${v?"<i class='iconfont icon-exlwenjian'></i>":"<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${T}>${g||e.text}</span>${e.tooltip?`<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${I}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" title="提示"></i>`:""}<span class="file-remove-btn ${w}" title="移除文件">×</span></span></span>`;e.required?A=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${E}</span>`:A=E}else if(e.type==="multi-variable"&&e.key){const v=e.maxCount||9,g=m[e.key]||1,w=Math.min(g,v);let I="";for(let b=0;b<w;b++){const T=`${e.key}_${b}`,E=i[T]||"",q=!E,B=q?"​":E,D=q?"show-placeholder":"",P=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" data-variable-key="${e.key||""}"`:"",K=e.tooltip&&q?"":"hidden",F=`<span contenteditable="true" data-type="variable" data-key="${T}" data-multi-key="${e.key}" data-index="${b}" data-placeholder="${e.placeholder||""}"${P} class="variable-chip ${D}">${B}${e.tooltip?`<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${K}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" title="提示"></i>`:""}</span>`;I+=F}e.required?A=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${I}</span>`:A=I}C+=S+A+n,h++}t.current&&(t.current.innerHTML=C,setTimeout(()=>{if(!t.current)return;t.current.querySelectorAll('[data-type="variable"]').forEach(r=>{const N=r.innerText.replace(/\n/g,"");N.replace(/\u200B/g,"")?r.classList.remove("show-placeholder"):(N!=="​"&&(r.innerText="​"),r.classList.add("show-placeholder"))})},0))}function He(t,f,u,l,i={},m,C){const h=s.useCallback(()=>{if(!t.current)return;if(f.length===0){t.current.innerHTML="";return}let e={};const r=t.current,N=r.__tempVariableValues;if(N?(e=N,delete r.__tempVariableValues):t.current.querySelectorAll('[data-type="variable"]').forEach(S=>{const n=S.dataset.key;if(n){const A=S.innerText.replace(/[\u200B\n]/g,"").trim();A&&(e[n]=A)}}),ze(t,f,u,l,e,i),m?.current){const{key:p,offset:S}=m.current;setTimeout(()=>{if(!t.current)return;const n=t.current.querySelector(`[data-type="variable"][data-key="${p}"]`);if(n){try{const A=document.createRange(),v=document.createTreeWalker(n,NodeFilter.SHOW_TEXT,null);let g=0,w=null,I=0;for(;v.nextNode();){const b=v.currentNode,T=b.textContent?.length||0;if(g+T>=S){w=b,I=S-g;break}g+=T}if(w){A.setStart(w,Math.min(I,w.textContent?.length||0)),A.collapse(!0);const b=window.getSelection();b&&(b.removeAllRanges(),b.addRange(A),n.focus())}else{A.selectNodeContents(n),A.collapse(!1);const b=window.getSelection();b&&(b.removeAllRanges(),b.addRange(A),n.focus())}}catch{const A=document.createRange();A.selectNodeContents(n),A.collapse(!1);const v=window.getSelection();v&&(v.removeAllRanges(),v.addRange(A),n.focus())}m.current=null}},0)}},[f,u,l,t,i,m,C]);s.useEffect(()=>{h()},[h])}function We(t,f,u,l){s.useEffect(()=>{const i=t.current;if(!i)return;const m=h=>{const e=h.target?.closest(".upload-info-icon");if(e&&e.classList.contains("upload-info-icon")){const r=e.dataset.uploadKey;r&&l({key:r,anchorEl:e,type:"upload"})}},C=h=>{const e=h.target?.closest(".upload-info-icon"),r=h.relatedTarget;e&&e.classList.contains("upload-info-icon")&&(!r||!i.contains(r)?l(null):r.closest(".upload-info-icon")||l(null))};return i.addEventListener("mouseover",m,!0),i.addEventListener("mouseout",C,!0),()=>{i.removeEventListener("mouseover",m,!0),i.removeEventListener("mouseout",C,!0)}},[f,u,t,l])}function Xe(t,f,u){s.useEffect(()=>{if(!t.current)return;const l=h=>{const e=h.currentTarget,r=e.dataset.tooltip,N=e.dataset.tagKey||"";r&&u({key:N,anchorEl:e,type:"tag"})},i=()=>{u(null)};let m;const C=()=>{if(!t.current)return;t.current.querySelectorAll(".tag-node[data-tooltip]").forEach(e=>{e.addEventListener("mouseenter",l),e.addEventListener("mouseleave",i)})};return m=requestAnimationFrame(()=>{m=requestAnimationFrame(C)}),()=>{cancelAnimationFrame(m),t.current&&t.current.querySelectorAll(".tag-node[data-tooltip]").forEach(e=>{e.removeEventListener("mouseenter",l),e.removeEventListener("mouseleave",i)})}},[f,t,u])}function Ke(t,f,u){s.useEffect(()=>{const l=t.current;if(!l)return;const i=C=>{const h=C.target?.closest(".variable-info-icon");if(h&&h.classList.contains("variable-info-icon")){const e=h.dataset.variableKey;e&&u({key:e,anchorEl:h,type:"variable"})}},m=C=>{const h=C.target?.closest(".variable-info-icon"),e=C.relatedTarget;h&&h.classList.contains("variable-info-icon")&&(!e||!l.contains(e)?u(null):e.closest(".variable-info-icon")||u(null))};return l.addEventListener("mouseover",i,!0),l.addEventListener("mouseout",m,!0),()=>{l.removeEventListener("mouseover",i,!0),l.removeEventListener("mouseout",m,!0)}},[f,t,u])}function Ye(t,f,u,l){s.useEffect(()=>{if(!t.current)return;const i=e=>{const r=e.currentTarget;r.dataset.fileName&&l({key:"",anchorEl:r,type:"upload-label"})},m=()=>{l(null)};let C;const h=()=>{if(!t.current)return;t.current.querySelectorAll(".upload-label[data-file-name]").forEach(r=>{r.addEventListener("mouseenter",i),r.addEventListener("mouseleave",m)})};return C=requestAnimationFrame(()=>{C=requestAnimationFrame(h)}),()=>{cancelAnimationFrame(C),t.current&&t.current.querySelectorAll(".upload-label[data-file-name]").forEach(r=>{r.removeEventListener("mouseenter",i),r.removeEventListener("mouseleave",m)})}},[f,u,t,l])}function Ue(t,f,u,l){s.useEffect(()=>{he(t,f,u),ge(t,f,u,l)},[u,f,t,l])}function Je(t,f){s.useEffect(()=>{if(!t.current)return;let u=!1,l=0;const i=()=>{u=!0},m=()=>{u=!1,l=Date.now()};let C=!1,h=0;const e=()=>{C=!0},r=()=>{C=!1,h=Date.now()},N=()=>{h=Date.now()},p=()=>{if(!t.current)return;const n=window.getSelection();if(!n||n.rangeCount===0||f.current||u||C||Date.now()-h<500)return;const A=n.getRangeAt(0);if(!A.collapsed){t.current.contains(A.commonAncestorContainer)||n.removeAllRanges();return}const v=n.anchorNode;if(!v)return;if(!t.current.contains(v)){n.removeAllRanges();return}let g=null;if(v.nodeType===Node.ELEMENT_NODE?g=v.closest('[data-type="variable"]'):v.nodeType===Node.TEXT_NODE&&v.parentElement&&(g=v.parentElement.closest('[data-type="variable"]')),!g){if(Date.now()-l>500)return;const w=t.current.querySelectorAll('[data-type="variable"]');if(w.length>0){let I=null;for(const b of Array.from(w))if(b.style.display!=="none"){I=b;break}if(!I&&w.length>0&&(I=w[0]),I){const b=document.createRange();b.selectNodeContents(I),b.collapse(!1),n.removeAllRanges(),n.addRange(b),I.focus()}else n.removeAllRanges()}else n.removeAllRanges()}},S=t.current;return S&&(S.addEventListener("compositionstart",e),S.addEventListener("compositionend",r),S.addEventListener("input",N)),document.addEventListener("mousedown",i),document.addEventListener("mouseup",m),document.addEventListener("selectionchange",p),()=>{const n=t.current;n&&(n.removeEventListener("compositionstart",e),n.removeEventListener("compositionend",r),n.removeEventListener("input",N)),document.removeEventListener("mousedown",i),document.removeEventListener("mouseup",m),document.removeEventListener("selectionchange",p)}},[t,f])}const Le=({config:t,onSend:f,isProcessing:u=!1,disabled:l=!1,width:i,lockStructure:m=!1,agentOptions:C=[],onAgentSelect:h,onAgentExit:e,loading:r=!1,placeholder:N,border:p,background:S="transparent"})=>{const n=s.useRef(null),A=s.useRef(null),[v,g]=s.useState({}),[w,I]=s.useState(null),[b,T]=s.useState(null),E=s.useRef(!1),q=s.useRef(null),[B,D]=s.useState(!1),P=s.useRef(null),[K,F]=s.useState(!0),[Y,$]=s.useState(()=>{const a={};return t.forEach(o=>{o.type==="multi-variable"&&o.key&&(a[o.key]=1)}),a});s.useEffect(()=>{$(a=>{const o={};return t.forEach(y=>{y.type==="multi-variable"&&y.key&&(o[y.key]=a[y.key]||1)}),o})},[t]),He(n,t,v,m,Y,P),We(n,t,v,T),Xe(n,t,T),Ye(n,t,v,T),Ke(n,t,T),Ue(n,t,v,D),Je(n,E),s.useEffect(()=>{if(t.length>0){F(!1);return}const a=()=>{if(!n.current){F(!0);return}const y=n.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"",R=n.current.querySelectorAll('[data-type="variable"]'),x=n.current.querySelectorAll('[data-type="upload"]');let _=!1;R.forEach(M=>{(M.textContent?.replace(/[\u200B\n]/g,"").trim()||"")&&(_=!0)}),x.forEach(M=>{M.querySelector(".upload-inner-wrapper.has-file")&&(_=!0)});const j=!y&&!_;F(j),t.length===0&&D(!j)};a();const o=new MutationObserver(a);return n.current&&o.observe(n.current,{childList:!0,subtree:!0,characterData:!0}),()=>{o.disconnect()}},[t]);const k=a=>{if(l){a.preventDefault();return}a.preventDefault();const o=a.clipboardData.getData("text/plain"),y=window.getSelection();if(y&&y.rangeCount>0){const R=y.anchorNode;if(R){let x=null;if(R.nodeType===Node.ELEMENT_NODE?x=R.closest('[data-type="variable"]'):R.nodeType===Node.TEXT_NODE&&R.parentElement&&(x=R.parentElement.closest('[data-type="variable"]')),x){const _=x.dataset.multiKey;if(_){const j=o.split(/[,\n\r\t]+/).map(M=>M.trim()).filter(M=>M.length>0);if(j.length>1){const M=parseInt(x.dataset.index||"0",10),O=t.find(ne=>ne.type==="multi-variable"&&ne.key===_)?.maxCount||9,H=Y[_]||1,te=Math.min(M+j.length,O);te>H&&$(Z=>({...Z,[_]:te})),setTimeout(()=>{n.current&&(j.forEach((Z,ne)=>{const re=M+ne;if(re>=O)return;const W=`${_}_${re}`,ae=n.current.querySelector(`[data-type="variable"][data-key="${W}"]`);ae&&(ae.innerText=Z,ae.classList.remove("show-placeholder"))}),z())},0);return}}}}}document.execCommand("insertText",!1,o),z()},L=a=>{if(a.target.files&&a.target.files[0]&&w){const o=a.target.files[0],y=w;g(R=>({...R,[y]:o}))}a.target&&(a.target.value=""),I(null)},U=a=>{g(o=>{const y={...o};return delete y[a],y})},J=a=>{const o=a.target;if(o.closest(".tag-close-btn")){if(a.preventDefault(),a.stopPropagation(),m)return;T(null),e?e():n.current&&(n.current.innerHTML="",n.current.focus());return}if(m){const x=o.closest(".tag-node"),_=o.closest('[data-type="text"]');if(x||_){a.preventDefault(),a.stopPropagation();const j=window.getSelection();j&&j.removeAllRanges();return}}o.closest('[data-type="variable"]')||(q.current={x:a.clientX,y:a.clientY},E.current=!1,o.closest(".file-remove-btn")&&(a.preventDefault(),a.stopPropagation()))},se=a=>{if(!a.target.closest('[data-type="variable"]')&&q.current){const R=Math.abs(a.clientX-q.current.x),x=Math.abs(a.clientY-q.current.y);(R>3||x>3)&&(E.current=!0)}},le=a=>{if(a.target.closest('[data-type="variable"]')){q.current=null,E.current=!1;return}q.current=null,E.current=!1},c=a=>{if(l)return;const o=a.target;if(o.closest(".tag-close-btn")){a.preventDefault(),a.stopPropagation();return}if(t.length===0)return;if(o.closest('[data-type="text"]')){a.preventDefault(),a.stopPropagation();const M=window.getSelection();M&&M.removeAllRanges();return}if(m&&o.closest(".tag-node")){a.preventDefault(),a.stopPropagation();const O=window.getSelection();O&&O.removeAllRanges();return}if(o.closest('[data-type="variable"]')){if(E.current)return;setTimeout(()=>{const M=window.getSelection();M&&!M.isCollapsed||be(n)},10);return}const _=o.closest(".file-remove-btn");if(_){a.preventDefault(),a.stopPropagation();const O=_.closest('[data-type="upload"]')?.dataset.key;O&&U(O);return}const j=o.closest('[data-type="upload"]');if(j){const M=j.dataset.key;M&&(I(M),A.current?.click());return}},V=a=>{const y=a.target.closest('[data-type="variable"]');if(y){const R=window.getSelection();if(R){const x=document.createRange(),_=y.textContent||"";if(_.replace(/\u200B/g,"")){let M=0,O=_.length;_.startsWith("​")&&(M=1),_.endsWith("​")&&_.length>1&&(O=_.length-1);const H=y.firstChild;H&&H.nodeType===Node.TEXT_NODE?(x.setStart(H,M),x.setEnd(H,O)):x.selectNodeContents(y)}else x.selectNodeContents(y),x.collapse(!0);R.removeAllRanges(),R.addRange(x)}}},z=()=>{if(t.length===0){if(n.current){const y=!(n.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"");F(y),D(!y)}return}if(be(n),n.current&&n.current.querySelectorAll('[data-type="variable"]').forEach(y=>{const R=y.querySelector(".variable-info-icon");if(R){let x=!1;const _=document.createTreeWalker(y,NodeFilter.SHOW_TEXT,{acceptNode:j=>R.contains(j)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(;_.nextNode();)if(_.currentNode.textContent?.replace(/[\u200B\n]/g,"").trim()){x=!0;break}x?R.classList.add("hidden"):R.classList.remove("hidden")}}),he(n,t,v),ge(n,t,v,D),!n.current)return;t.filter(o=>o.type==="multi-variable"&&o.key).forEach(o=>{if(!o.key)return;const y=o.maxCount||9,R=Y[o.key]||1,x=[];for(let H=0;H<R;H++){const te=`${o.key}_${H}`,Z=n.current.querySelector(`[data-type="variable"][data-key="${te}"][data-multi-key="${o.key}"]`);if(Z){const ne=Z.innerText.replace(/[\u200B\n]/g,"").trim();x.push(ne)}}const j=(x[x.length-1]||"")==="";let M=!1,O=-1;for(let H=0;H<x.length-1;H++)if(x[H]===""){M=!0,O=H;break}if(M&&O>=0){const H=window.getSelection();if(H&&H.rangeCount>0){const W=H.getRangeAt(0),ae=W.startContainer,ie=ae.nodeType===Node.ELEMENT_NODE?ae.closest('[data-type="variable"][data-multi-key]'):ae.parentElement?.closest('[data-type="variable"][data-multi-key]');if(ie){const ce=ie.dataset.key;if(ce){const pe=document.createRange();pe.setStartBefore(ie),pe.setEnd(W.startContainer,W.startOffset);const xe=pe.toString().length;P.current={key:ce,offset:xe}}}}const te=[...x];for(let W=O;W<te.length-1;W++)te[W]=te[W+1];te.pop();const Z={};te.forEach((W,ae)=>{W&&(Z[`${o.key}_${ae}`]=W)});const ne=Math.max(j?te.length:te.length+1,1);n.current.querySelectorAll('[data-type="variable"]').forEach(W=>{const ae=W.dataset.key,ie=W.dataset.multiKey;if(ae&&ie!==o.key){const ce=W.innerText.replace(/[\u200B\n]/g,"").trim();ce&&(Z[ae]=ce)}}),n.current.__tempVariableValues=Z,$(W=>({...W,[o.key]:ne}));return}if(!j){const H=R-1,te=`${o.key}_${H}`,Z=n.current.querySelector(`[data-type="variable"][data-key="${te}"][data-multi-key="${o.key}"]`);if(Z&&Z.innerText.replace(/[\u200B\n]/g,"").trim().length>0&&R<y){const re=window.getSelection();if(re&&re.rangeCount>0){const W=re.getRangeAt(0),ae=W.startContainer,ie=ae.nodeType===Node.ELEMENT_NODE?ae.closest('[data-type="variable"][data-multi-key]'):ae.parentElement?.closest('[data-type="variable"][data-multi-key]');if(ie){const ce=ie.dataset.key;if(ce){const pe=document.createRange();pe.setStartBefore(ie),pe.setEnd(W.startContainer,W.startOffset);const xe=pe.toString().length;P.current={key:ce,offset:xe}}}}$(W=>({...W,[o.key]:R+1}))}}})},Q=()=>{if(n.current){if(t.length===0){const a=n.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";D(a.length>0);return}be(n),he(n,t,v),ge(n,t,v,D)}},oe=a=>{if(l){a.preventDefault();return}const o=window.getSelection();if(o&&o.rangeCount>0){const y=o.anchorNode;let R=null;if(y&&(y.nodeType===Node.ELEMENT_NODE?R=y.closest('[data-type="text"]'):y.nodeType===Node.TEXT_NODE&&y.parentElement&&(R=y.parentElement.closest('[data-type="text"]'))),R){if(a.preventDefault(),a.stopPropagation(),n.current){const x=n.current.querySelector('[data-type="variable"], [data-type="upload"]');x&&x.focus()}return}}if(m&&o&&o.rangeCount>0){const y=o.anchorNode;let R=null;if(y&&(y.nodeType===Node.ELEMENT_NODE?R=y.closest(".tag-node"):y.nodeType===Node.TEXT_NODE&&y.parentElement&&(R=y.parentElement.closest(".tag-node"))),R){if(a.preventDefault(),a.stopPropagation(),n.current){const x=n.current.querySelector('[data-type="variable"], [data-type="upload"]');x&&x.focus()}return}}if(a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),ee()),a.key==="Escape"&&n.current){if(m){a.preventDefault();return}n.current.innerHTML="",n.current.focus()}if(a.key==="Backspace"){const y=window.getSelection();if(y&&y.rangeCount>0){const R=y.getRangeAt(0),x=y.anchorNode;if(m){let j=null,M=null;if(x&&(x.nodeType===Node.ELEMENT_NODE?(j=x.closest(".tag-node"),M=x.closest('[data-type="text"]')):x.nodeType===Node.TEXT_NODE&&x.parentElement&&(j=x.parentElement.closest(".tag-node"),M=x.parentElement.closest('[data-type="text"]'))),(j||M)&&R.collapsed&&R.startOffset===0){a.preventDefault();return}}let _=null;if(x&&(x.nodeType===Node.ELEMENT_NODE?_=x.closest('[data-type="variable"]'):x.nodeType===Node.TEXT_NODE&&x.parentElement&&(_=x.parentElement.closest('[data-type="variable"]'))),_){if(!R.collapsed)return;const j=_.innerText;if(j==="​"||j===""){a.preventDefault();return}if(R.startOffset===0){a.preventDefault();return}if(j.startsWith("​")&&R.startOffset===1){a.preventDefault();return}}}}},ee=()=>{if(u||l||r||!B||!n.current)return;if(t.length===0){const _=n.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";if(!_)return;f(_,_);return}const a=n.current;let o="";const y={},R=_=>{if(!(_.nodeType===Node.ELEMENT_NODE&&_.style.display==="none")){if(_.nodeType===Node.TEXT_NODE)o+=(_.textContent||"").replace(/\u200B/g,"");else if(_.nodeType===Node.ELEMENT_NODE){const j=_,M=j.dataset.type,O=j.dataset.key;if(M==="variable"&&O){let H="";const te=document.createTreeWalker(j,NodeFilter.SHOW_TEXT,{acceptNode:ne=>{const re=j.querySelector(".variable-info-icon");return re&&re.contains(ne)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;te.nextNode();)H+=te.currentNode.textContent||"";const Z=H.replace(/[\u200B\n]/g,"").trim();if(Z){const ne=j.dataset.multiKey;if(ne){y[ne]||(y[ne]=[]);const re=y[ne];re.push(Z),re.length>1&&(o+=" "),o+=Z}else y[O]=Z,o+=Z}}else if(M==="upload"&&O)y[O]=v[O]??null,v[O]&&(o+=` [附带文件: ${v[O]?.name}] `);else{if(j.classList.contains("tag-close-btn")||j.classList.contains("file-remove-btn"))return;j.getAttribute("contenteditable")==="false"&&!M&&j.classList.contains("tag-node")?o+=j.innerText:j.childNodes.forEach(R)}}}};if(a.childNodes.forEach(R),o=o.trim(),!o)return;const x=new FormData;x.append("fullPrompt",o),Object.keys(y).forEach(_=>{const j=y[_];j!=null&&(j instanceof File?x.append(_,j):Array.isArray(j)?t.some(O=>O.type==="multi-variable"&&O.key===_)?j.forEach(O=>{O!=null&&O!==""&&x.append(_,String(O))}):j.forEach((O,H)=>{O!=null&&(O instanceof File?x.append(`${_}[${H}]`,O):typeof O=="string"?x.append(`${_}[${H}]`,O):x.append(`${_}[${H}]`,String(O)))}):typeof j=="string"?x.append(_,j):x.append(_,String(j)))}),f(x,o)},de={...i?{width:typeof i=="number"?`${i}px`:i}:{},...p?{border:p}:{},...S?{background:S}:{}};return d.jsxs("div",{className:"rich-text-editor",style:de,"data-disabled":l,children:[d.jsx("div",{ref:n,className:`rte-editor ${t.length===0?"rte-editor-default":""} ${K&&N?"rte-editor-empty":""}`,contentEditable:t.length===0,suppressContentEditableWarning:!0,"data-placeholder":N,onMouseDown:J,onMouseMove:se,onMouseUp:le,onClick:c,onDoubleClick:V,onInput:z,onKeyDown:oe,onPaste:k,onBlur:Q}),d.jsx("input",{type:"file",ref:A,className:"rte-file-input",accept:".csv,.xlsx,.xls,.txt,.pdf,image/*",onChange:L}),d.jsxs("div",{className:"rich-text-editor-footer",children:[d.jsx("div",{className:"rich-text-editor-footer-left",children:d.jsxs("div",{className:"rich-text-editor-brand",children:[d.jsxs("div",{className:"rte-brand-badge",children:[d.jsx("img",{src:"https://oospublic.sealseek.cn/file/website/ball.png",alt:""}),d.jsx("span",{className:"rte-brand-text",children:"SealSeek 1.0"})]}),d.jsx(G.Dropdown,{placement:"top",menu:{items:C.map(a=>({key:a.key,label:d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[a.icon&&d.jsx("i",{className:a.icon}),d.jsx("span",{children:a.label})]}),onClick:()=>{h?.(a)}}))},trigger:["click"],disabled:l||u,children:d.jsxs("div",{className:"rte-agent-badge",style:{cursor:C.length>0?"pointer":"default"},children:[d.jsx("i",{className:"iconfont icon-zhinengti"}),d.jsx("span",{className:"rte-agent-text",children:"智能体"})]})})]})}),d.jsx("button",{type:"button",onClick:ee,disabled:u||l||r||!B,className:"rich-text-editor-send-button",children:u||r?d.jsx("span",{className:"rte-send-spinner"}):d.jsx("i",{className:"iconfont icon-fasong"})})]}),b?.anchorEl&&(()=>{if(!document.body.contains(b.anchorEl))return null;let a="";return b.type==="upload"?a=t.find(y=>y.type==="upload"&&y.key===b.key)?.tooltip||"":b.type==="tag"?a=b.anchorEl.dataset.tooltip||"":b.type==="upload-label"?a=b.anchorEl.dataset.fileName||"":b.type==="variable"&&(a=b.anchorEl.dataset.tooltip||""),Me.createPortal(d.jsx(G.Tooltip,{arrow:!1,title:d.jsx("div",{style:{maxWidth:"200px",fontSize:"12px",color:"#fff"},children:a}),open:!0,placement:"top",getPopupContainer:()=>document.body,overlayInnerStyle:{background:"var(--neutral-800, #262626)"},children:d.jsx("div",{style:{position:"fixed",left:`${b.anchorEl.getBoundingClientRect().left}px`,top:`${b.anchorEl.getBoundingClientRect().top}px`,width:`${b.anchorEl.offsetWidth}px`,height:`${b.anchorEl.offsetHeight}px`,pointerEvents:"none"}})}),document.body)})()]})};Le.__docgenInfo={displayName:"RichTextEditor",description:"结构化富文本输入组件,支持标签、变量输入块、文件上传以及互斥显示逻辑。",props:{config:{name:"config",required:!0,description:"结构化输入配置节点数组",type:{name:"InputNode[]",raw:"InputNode[]"}},onSend:{name:"onSend",required:!0,description:"点击发送按钮时的回调,返回数据与拼接后的 Prompt",type:{name:"function",raw:"(data: Record<string, any>, fullPrompt: string) => void"}},isProcessing:{name:"isProcessing",required:!1,description:"是否处于处理状态(禁用输入与发送)",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}}}};const Ve=({texts:t=[],placeholder:f="请输入内容",animationSpeed:u=100,autoPlay:l=!0,value:i,onChange:m,...C})=>{const[h,e]=s.useState(""),[r,N]=s.useState(0),[p,S]=s.useState(!1),[n,A]=s.useState(!1),[v,g]=s.useState(!1),w=s.useRef(void 0),I=s.useRef(void 0),b=s.useRef(t),T=s.useRef(r),E=s.useRef(n),q=s.useRef(h);s.useEffect(()=>{b.current=t,T.current=r,E.current=n,q.current=h});const B=s.useCallback((k,L)=>{let U=0;g(!0);const J=()=>{U<k.length?(e(k.slice(0,U+1)),U++,I.current=window.setTimeout(J,u)):(g(!1),L?.())};J()},[u]),D=s.useCallback(k=>{let L=q.current.length;const U=()=>{L>0?(e(q.current.slice(0,L-1)),L--,I.current=window.setTimeout(U,u/2)):k?.()};U()},[u]),P=s.useCallback(()=>{if(b.current.length===0||E.current)return;S(!0);const k=b.current[T.current];q.current?D(()=>{B(k,()=>{w.current=window.setTimeout(()=>{N(L=>(L+1)%b.current.length),S(!1)},2e3)})}):B(k,()=>{w.current=window.setTimeout(()=>{N(L=>(L+1)%b.current.length),S(!1)},2e3)})},[D,B]);s.useEffect(()=>(l&&t.length>0&&!n&&P(),()=>{w.current&&window.clearTimeout(w.current),I.current&&window.clearTimeout(I.current)}),[r,n,l,t.length,P]),s.useEffect(()=>{!p&&l&&t.length>0&&!n&&P()},[r,p,l,t.length,n,P]);const K=k=>{A(!0),w.current&&window.clearTimeout(w.current),I.current&&window.clearTimeout(I.current),S(!1),g(!1),C.onFocus?.(k)},F=k=>{A(!1),!i&&t.length>0&&(e(""),N(0)),C.onBlur?.(k)},Y=k=>{m?.(k.target.value),C.onChange?.(k)},$=()=>n||i?f:h||f;return d.jsxs("div",{style:{position:"relative"},children:[d.jsx(G.Input,{...C,value:i,onChange:Y,onFocus:K,onBlur:F,placeholder:$(),style:{...C.style,position:"relative",zIndex:1}}),!n&&!i&&h&&d.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",paddingLeft:11,paddingRight:11,color:"#bfbfbf",pointerEvents:"none",zIndex:2,fontSize:14,fontFamily:"inherit"},children:[d.jsx("span",{children:h}),v&&d.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),d.jsx("style",{children:`
22
+ <%s key={someKey} {...props} />`,Q,c,h,c),le[c+Q]=!0)}if(c=null,z!==void 0&&(u(z),c=""+z),k(V)&&(u(V.key),c=""+V.key),"key"in V){z={};for(var j in V)j!=="key"&&(z[j]=V[j])}else z=V;return c&&y(z,typeof d=="function"?d.displayName||d.name||"Unknown":d),r(d,c,ee,oe,i(),z,de,a)}function f(d){typeof d=="object"&&d!==null&&d.$$typeof===n&&d._store&&(d._store.validated=1)}var N=l,n=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),b=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),X=Symbol.for("react.client.reference"),G=N.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=Object.prototype.hasOwnProperty,$=Array.isArray,R=console.createTask?console.createTask:function(){return null};N={react_stack_bottom_frame:function(d){return d()}};var L,J={},K=N.react_stack_bottom_frame.bind(N,m)(),se=R(s(m)),le={};me.Fragment=v,me.jsx=function(d,V,z,Q,oe){var ee=1e4>G.recentlyCreatedOwnerStacks++;return C(d,V,z,!1,Q,oe,ee?Error("react-stack-top-frame"):K,ee?R(s(d)):se)},me.jsxs=function(d,V,z,Q,oe){var ee=1e4>G.recentlyCreatedOwnerStacks++;return C(d,V,z,!0,Q,oe,ee?Error("react-stack-top-frame"):K,ee?R(s(d)):se)}}()),me}var ke;function Ge(){return ke||(ke=1,process.env.NODE_ENV==="production"?ye.exports=Me():ye.exports=Fe()),ye.exports}var o=Ge();const Te=({variant:t="primary",loading:p=!1,children:u,...s})=>{const i=m=>{switch(m){case"primary":return"primary";case"ghost":return"default";case"dashed":return"dashed";case"link":return"link";case"text":return"text";default:return"primary"}};return o.jsx(F.Button,{...s,type:i(t),loading:p,ghost:t==="ghost",children:u})};Te.__docgenInfo={displayName:"Button",description:"基础按钮,用于触发操作",props:{variant:{name:"variant",required:!1,description:"视觉风格",type:{name:"ButtonVariant",raw:'"primary" | "ghost" | "dashed" | "link" | "text"'},defaultValue:{value:'"primary"'}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},children:{name:"children",required:!1,description:"按钮内容",type:{name:"ReactNode",raw:"React.ReactNode"}},size:{name:"size",required:!1,description:"按钮大小",type:{name:"ButtonSize",raw:'"small" | "middle" | "large"'}},disabled:{name:"disabled",required:!1,description:"是否禁用",type:{name:"boolean",raw:"boolean"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: MouseEvent) => void"}}}};const Ce=({title:t,children:p,bordered:u=!0,hoverable:s=!1,size:i="default",...m})=>o.jsx(F.Card,{...m,title:t,bordered:u,hoverable:s,size:i,children:p});Ce.__docgenInfo={displayName:"Card",description:"卡片容器,用于分组内容",props:{title:{name:"title",required:!1,description:"标题",type:{name:"ReactNode",raw:"React.ReactNode"}},children:{name:"children",required:!1,description:"内容区域",type:{name:"ReactNode",raw:"React.ReactNode"}},bordered:{name:"bordered",required:!1,description:"是否显示边框",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},hoverable:{name:"hoverable",required:!1,description:"是否可悬停",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},size:{name:"size",required:!1,description:"卡片大小",type:{name:"CardSize",raw:'"default" | "small"'},defaultValue:{value:'"default"'}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},actions:{name:"actions",required:!1,description:"卡片操作组",type:{name:"ReactNode[]",raw:"React.ReactNode[]"}}}};const Ne=({showDefaultFooter:t=!0,...p})=>{const u=p.footer!==void 0?p.footer:t?(s,{OkBtn:i,CancelBtn:m})=>o.jsxs(o.Fragment,{children:[o.jsx(i,{}),o.jsx(m,{})]}):null;return o.jsx(F.Modal,{...p,footer:u})};Ne.__docgenInfo={displayName:"AppModal",description:"应用级模态框组件,基于 Ant Design Modal 封装",props:{showDefaultFooter:{name:"showDefaultFooter",required:!1,description:"是否显示默认的确定和取消按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},title:{name:"title",required:!1,description:"模态框标题",type:{name:"ReactNode",raw:"React.ReactNode"}},open:{name:"open",required:!1,description:"是否显示模态框",type:{name:"boolean",raw:"boolean"}},onCancel:{name:"onCancel",required:!1,description:"取消按钮点击事件",type:{name:"function",raw:"(e: React.MouseEvent<HTMLElement>) => void"}},onOk:{name:"onOk",required:!1,description:"确定按钮点击事件",type:{name:"function",raw:"(e: React.MouseEvent<HTMLElement>) => void"}},children:{name:"children",required:!1,description:"模态框内容",type:{name:"ReactNode",raw:"React.ReactNode"}},width:{name:"width",required:!1,description:"模态框宽度",type:{name:"string | number",raw:"string | number"}},centered:{name:"centered",required:!1,description:"是否居中显示",type:{name:"boolean",raw:"boolean"}},maskClosable:{name:"maskClosable",required:!1,description:"点击蒙层是否允许关闭",type:{name:"boolean",raw:"boolean"}}}};const Se=({scrollX:t,showPagination:p=!0,defaultPageSize:u=10,...s})=>o.jsx(F.Table,{...s,scroll:{x:t||"max-content",y:"50vh"},pagination:p?{hideOnSinglePage:!0,showSizeChanger:!0,showQuickJumper:!0,defaultPageSize:u,...s.pagination}:!1});Se.__docgenInfo={displayName:"PageTable",description:"页面级表格组件,高度铺满容器,自动滚动",props:{scrollX:{name:"scrollX",required:!1,description:"水平滚动宽度",type:{name:"number",raw:"number"}},showPagination:{name:"showPagination",required:!1,description:"是否显示分页器",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},defaultPageSize:{name:"defaultPageSize",required:!1,description:"默认页面大小",type:{name:"number",raw:"number"},defaultValue:{value:"10"}},columns:{name:"columns",required:!1,description:"表格列配置",type:{name:"ColumnType[]",raw:"ColumnType<any>[]"}},dataSource:{name:"dataSource",required:!1,description:"数据源",type:{name:"any[]",raw:"any[]"}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},rowKey:{name:"rowKey",required:!1,description:"行数据的 Key",type:{name:"string | function",raw:"string | ((record: any) => string)"}}}};const ze=ce.createFromIconfontCN({scriptUrl:["https://at.alicdn.com/t/c/font_4968458_eh91gfr4j9e.js"]}),Ae=({name:t,size:p,color:u,style:s,...i})=>{const m={fontSize:p,color:u,...s};return o.jsx(ze,{...i,type:t,style:m})};Ae.__docgenInfo={displayName:"XcIcon",description:"自定义图标组件,基于 iconfont",props:{name:{name:"name",required:!0,description:"图标名称",type:{name:"string",raw:"string"}},size:{name:"size",required:!1,description:"图标大小",type:{name:"number | string",raw:"number | string"}},color:{name:"color",required:!1,description:"图标颜色",type:{name:"string",raw:"string"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}}}};const Re=({loading:t,description:p="暂无数据",className:u,emptyChildren:s,loadingText:i,emptyImage:m})=>t?o.jsxs(F.Flex,{className:`pt-10 w-full ${u||""}`,align:"center",justify:"center",vertical:!0,children:[o.jsx(F.Spin,{size:"large"}),i&&o.jsx("div",{className:"mt-4 text-gray-500",children:i})]}):o.jsx(F.Flex,{className:`pt-10 w-full ${u||""}`,align:"center",justify:"center",children:o.jsx(F.Empty,{image:m,description:p,imageStyle:{height:180},children:s})});Re.__docgenInfo={displayName:"EmptyAndSpin",description:"空状态和加载状态组合组件",props:{loading:{name:"loading",required:!0,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},description:{name:"description",required:!1,description:"空状态描述",type:{name:"ReactNode",raw:"React.ReactNode"},defaultValue:{value:'"暂无数据"'}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},emptyChildren:{name:"emptyChildren",required:!1,description:"空状态额外内容",type:{name:"ReactNode",raw:"React.ReactNode"}},loadingText:{name:"loadingText",required:!1,description:"加载中提示文字",type:{name:"string",raw:"string"}},emptyImage:{name:"emptyImage",required:!1,description:"空状态图片",type:{name:"string",raw:"string"}}}};const je=({onClick:t,showText:p=!1,className:u,size:s="small",type:i="default"})=>o.jsx(F.Button,{size:s,type:i,icon:o.jsx(ce.LeftOutlined,{}),className:`cursor-pointer ${u||""}`,onClick:t,children:p&&"返回"});je.__docgenInfo={displayName:"BackButton",description:"返回按钮组件",props:{onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"() => void"}},showText:{name:"showText",required:!1,description:"是否显示文字",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},size:{name:"size",required:!1,description:"按钮大小",type:{name:"ButtonSize",raw:'"small" | "middle" | "large"'},defaultValue:{value:'"small"'}},type:{name:"type",required:!1,description:"按钮类型",type:{name:"ButtonType",raw:'"primary" | "default" | "dashed" | "link" | "text"'},defaultValue:{value:'"default"'}}}};const _e=({removePadding:t=!0,className:p,...u})=>{const s=t?`px-0 h-auto ${p||""}`:p;return o.jsx(F.Button,{type:"link",...u,className:s,children:u.children})};_e.__docgenInfo={displayName:"LinkButton",description:"链接样式按钮组件,适用于表格操作列",props:{removePadding:{name:"removePadding",required:!1,description:"是否去除默认内边距",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},children:{name:"children",required:!1,description:"按钮内容",type:{name:"ReactNode",raw:"React.ReactNode"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: React.MouseEvent<HTMLButtonElement>) => void"}},disabled:{name:"disabled",required:!1,description:"是否禁用",type:{name:"boolean",raw:"boolean"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}}}};const{Option:We}=F.Select,Ie=({columns:t,request:p,searchFields:u=[],showSearch:s=!0,showRefresh:i=!0,defaultPageSize:m=10,pageSizeOptions:k=["10","20","50","100"],autoLoad:y=!0,externalParams:e={},...r})=>{const[C,f]=l.useState([]),[N,n]=l.useState(!1),[A,v]=l.useState({current:1,pageSize:m,total:0}),[g,x]=l.useState({}),[w,b]=l.useState({}),[S]=F.Form.useForm(),T=l.useRef(A);T.current=A;const B=l.useRef(e);B.current=e;const O=l.useRef(!1),D=l.useMemo(()=>t.map(R=>{const{sortable:L,render:J,...K}=R;return{...K,sorter:L?!0:void 0,render:J||(se=>se)}}),[t]),M=l.useCallback(async(R={})=>{if(p){n(!0);try{const L={page:T.current.current,pageSize:T.current.pageSize,sortField:w.field,sortOrder:w.order,searchParams:{...g,...B.current},...R},J=await p(L);J.success&&(f(J.data),v(K=>({...K,total:J.total,current:L.page||K.current})))}catch(L){console.error("加载数据失败:",L)}finally{n(!1)}}},[p,w,g]),X=l.useCallback(R=>{x(R),v(L=>({...L,current:1}))},[]),G=l.useCallback(()=>{S.resetFields(),x({}),v(R=>({...R,current:1}))},[S]),Y=l.useCallback(()=>{M()},[M]),$=l.useCallback((R,L,J)=>{const K={current:R.current||1,pageSize:R.pageSize||m,total:R.total||0},se={field:J?.field,order:J?.order};v(K),b(se)},[m]);return l.useEffect(()=>{const R=Object.keys(e).length>0;(y&&!O.current||R)&&(M(),O.current=!0)},[y,e,M]),o.jsxs("div",{children:[s&&u.length>0&&o.jsx(F.Card,{size:"small",style:{marginBottom:16},children:o.jsxs(F.Form,{form:S,layout:"inline",onFinish:X,initialValues:u.reduce((R,L)=>(L.defaultValue!==void 0&&(R[L.key]=L.defaultValue),R),{}),children:[u.map(R=>o.jsx(F.Form.Item,{name:R.key,label:R.label,children:R.type==="input"?o.jsx(F.Input,{placeholder:R.placeholder||`请输入${R.label}`,style:{width:200}}):o.jsx(F.Select,{placeholder:R.placeholder||`请选择${R.label}`,style:{width:200},allowClear:!0,children:R.options?.map(L=>o.jsx(We,{value:L.value,children:L.label},L.value))})},R.key)),o.jsx(F.Form.Item,{children:o.jsxs(F.Space,{children:[o.jsx(F.Button,{type:"primary",htmlType:"submit",icon:o.jsx(ce.SearchOutlined,{}),children:"查询"}),o.jsx(F.Button,{onClick:G,children:"重置"}),i&&o.jsx(F.Button,{icon:o.jsx(ce.ReloadOutlined,{}),onClick:Y,children:"刷新"})]})})]})}),o.jsx(F.Table,{...r,columns:D,dataSource:C,loading:N,pagination:{...A,showSizeChanger:!0,showQuickJumper:!0,showTotal:(R,L)=>`第 ${L[0]}-${L[1]} 条/共 ${R} 条`,pageSizeOptions:k},onChange:$,scroll:{x:"max-content",y:"50vh"}})]})};Ie.__docgenInfo={displayName:"AdvancedTable",description:"高阶表格组件,支持异步请求、搜索、排序等功能",props:{columns:{name:"columns",required:!0,description:"列配置",type:{name:"AdvancedColumnType[]",raw:"AdvancedColumnType<any>[]"}},request:{name:"request",required:!1,description:"异步请求函数",type:{name:"function",raw:"(params: RequestParams) => Promise<RequestResponse>"}},searchFields:{name:"searchFields",required:!1,description:"搜索字段配置",type:{name:"SearchFieldConfig[]",raw:"SearchFieldConfig[]"},defaultValue:{value:"[]"}},showSearch:{name:"showSearch",required:!1,description:"是否显示搜索区域",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},showRefresh:{name:"showRefresh",required:!1,description:"是否显示刷新按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},defaultPageSize:{name:"defaultPageSize",required:!1,description:"默认页面大小",type:{name:"number",raw:"number"},defaultValue:{value:"10"}},pageSizeOptions:{name:"pageSizeOptions",required:!1,description:"页面大小选项",type:{name:"string[]",raw:"string[]"},defaultValue:{value:'["10", "20", "50", "100"]'}},autoLoad:{name:"autoLoad",required:!1,description:"是否自动加载",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},externalParams:{name:"externalParams",required:!1,description:"外部请求参数",type:{name:"Record<string, any>",raw:"Record<string, any>"},defaultValue:{value:"{}"}}}};function he(t,p,u){if(!t.current)return;const s=new Set,i={};for(const f of p)f.exclusionGroup&&f.exclusionGroup!=="separator"&&(s.add(f.exclusionGroup),i[f.exclusionGroup]||(i[f.exclusionGroup]=[]),i[f.exclusionGroup].push({type:f.type,key:f.key,exclusionGroup:f.exclusionGroup}));const m={};for(const f of s){m[f]=!1;for(const N of i[f])if(N.type==="upload"&&N.key){if(u[N.key]!==null&&u[N.key]!==void 0){m[f]=!0;break}}else if(N.type==="variable"&&N.key){const n=t.current.querySelector(`[data-type="variable"][data-key="${N.key}"]`);if(n&&n.innerText.replace(/[\u200B\n]/g,"").trim().length>0){m[f]=!0;break}}}const k=p.some(f=>f.exclusionGroup==="separator"),e=Object.keys(m).filter(f=>m[f]).length>0;let r=null;if(e&&k){for(const f of p)if(f.exclusionGroup&&f.exclusionGroup!=="separator"&&m[f.exclusionGroup]){r=f.exclusionGroup;break}}for(const f of s){const N=t.current.querySelectorAll(`[data-group="${f}"]`);k&&e&&r?f===r?N.forEach(n=>{n.classList.contains("required-upload-group")?n.style.setProperty("display","inline-flex","important"):(n.classList.contains("exclusion-wrapper"),n.style.setProperty("display","inline-block","important"))}):N.forEach(n=>{n.style.display="none",n.style.setProperty("display","none","important")}):N.forEach(n=>{n.classList.contains("required-upload-group")?n.style.setProperty("display","inline-flex","important"):(n.classList.contains("exclusion-wrapper"),n.style.setProperty("display","inline-block","important"))})}t.current.querySelectorAll('[data-group="separator"]').forEach(f=>{f.style.display=e?"none":"inline"})}function ge(t,p,u,s){if(!t.current){s(!1);return}const i=[];for(let e=0;e<p.length;e++){const r=p[e];if((r.type==="variable"||r.type==="upload"||r.type==="multi-variable")&&r.required&&r.key){i.push({exclusionGroup:r.exclusionGroup||"",key:r.key,type:r.type==="multi-variable"?"variable":r.type,isMultiVariable:r.type==="multi-variable"});continue}if(r.type==="text"&&r.className?.includes("rte-text-required")&&r.exclusionGroup)for(let C=e+1;C<p.length;C++){const f=p[C];if(f.exclusionGroup===r.exclusionGroup&&(f.type==="variable"||f.type==="upload")&&f.key){i.push({exclusionGroup:r.exclusionGroup,key:f.key,type:f.type});break}}}const m=p.some(e=>e.exclusionGroup==="separator");let k=!1;if(m&&i.length>1){const e=p.findIndex(f=>f.exclusionGroup==="separator"),r=i.filter(f=>p.findIndex(n=>(n.type==="variable"||n.type==="upload")&&n.key===f.key&&n.exclusionGroup===f.exclusionGroup)<e),C=i.filter(f=>p.findIndex(n=>(n.type==="variable"||n.type==="upload")&&n.key===f.key&&n.exclusionGroup===f.exclusionGroup)>e);k=r.length>0&&C.length>0}if(i.length===0){if(p.length===0){if(!t.current){s(!1);return}const e=t.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";s(e.length>0);return}s(!0);return}const y=i.filter(e=>{if(!t.current)return!1;const r=t.current.querySelectorAll(`[data-group="${e.exclusionGroup}"]`);return r.length===0?!1:r[0].style.display!=="none"});if(y.length===0){s(!0);return}if(k){let e=!1;for(const r of y)if(r.type==="upload"&&r.key){if(u[r.key]!==null&&u[r.key]!==void 0){e=!0;break}}else if(r.type==="variable"&&r.key)if(r.isMultiVariable){const C=t.current.querySelectorAll(`[data-type="variable"][data-multi-key="${r.key}"]`);let f=!1;for(const N of Array.from(C))if(N.innerText.replace(/[\u200B\n]/g,"").trim().length>0){f=!0;break}if(f){e=!0;break}}else{const C=t.current.querySelector(`[data-type="variable"][data-key="${r.key}"]`);if(C&&C.innerText.replace(/[\u200B\n]/g,"").trim().length>0){e=!0;break}}s(e)}else{let e=!0;for(const r of y)if(r.type==="upload"&&r.key){if(u[r.key]===null||u[r.key]===void 0){e=!1;break}}else if(r.type==="variable"&&r.key)if(r.isMultiVariable){const C=t.current.querySelectorAll(`[data-type="variable"][data-multi-key="${r.key}"]`);let f=!1;for(const N of Array.from(C))if(N.innerText.replace(/[\u200B\n]/g,"").trim().length>0){f=!0;break}if(!f){e=!1;break}}else{const C=t.current.querySelector(`[data-type="variable"][data-key="${r.key}"]`);if(!C){e=!1;break}if(C.innerText.replace(/[\u200B\n]/g,"").trim().length===0){e=!1;break}}s(e)}}function be(t,p){if(!t.current)return;t.current.querySelectorAll('[data-type="variable"]').forEach(s=>{const i=s.innerText.replace(/\n/g,"");i.replace(/\u200B/g,"")?s.classList.remove("show-placeholder"):(i!=="​"&&(s.innerText="​"),s.classList.add("show-placeholder"))})}function He(t,p,u,s,i,m={}){if(!t.current)return;let k="",y=0;for(;y<p.length;){const e=p[y],r=y+1<p.length?p[y+1]:null;if(e.type==="text"&&(e.text?.includes("icon-bitian")||e.className==="rte-text-required")&&r){const v=r.type==="upload"&&r.exclusionGroup==="fileInput"&&e.exclusionGroup==="fileInput"&&e.exclusionGroup===r.exclusionGroup,g=r.type==="variable"&&r.exclusionGroup==="textInput"&&e.exclusionGroup==="textInput"&&e.exclusionGroup===r.exclusionGroup;if(v){const w=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group">`,b="</span>";let S="";e.className?S=`<span class="${e.className}">${e.text??""}</span>`:S=e.text??"";const T=r,B=u[T.key]!==null&&u[T.key]!==void 0,O=B?u[T.key]?.name:T.text,D=B?"":"hidden",M=T.tooltip&&!B?"":"hidden",X=B?"has-file":"",G=B&&O?` data-file-name="${O.replace(/"/g,"&quot;")}"`:"",Y=`<span contenteditable="false" data-type="upload" data-key="${T.key}" class="upload-chip"><span class="upload-inner-wrapper ${X}"><span class="upload-icon">${B?"<i class='iconfont icon-exlwenjian'></i>":"<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${G}>${O||T.text}</span>${T.tooltip?`<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${M}" data-upload-key="${T.key}" data-tooltip="${T.tooltip}" title="提示"></i>`:""}<span class="file-remove-btn ${D}" title="移除文件">×</span></span></span>`;k+=w+S+Y+b,y+=2;continue}if(g){const w=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group">`,b="</span>";let S="";e.className?S=`<span class="${e.className}">${e.text??""}</span>`:S=e.text??"";const T=r,O=(T.key?i[T.key]:void 0)||T.text||"",D=!O,M=D?"​":O,X=D?"show-placeholder":"",G=T.exclusionGroup?` data-group="${T.exclusionGroup}"`:"",Y=T.tooltip?` data-tooltip="${T.tooltip.replace(/"/g,"&quot;")}" data-variable-key="${T.key||""}"`:"",$=T.tooltip&&D?"":"hidden",R=`<span contenteditable="true" data-type="variable" data-key="${T.key}" data-placeholder="${T.placeholder||""}"${G}${Y} class="variable-chip ${X}">${M}${T.tooltip?`<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${$}" data-variable-key="${T.key}" data-tooltip="${T.tooltip.replace(/"/g,"&quot;")}" title="提示"></i>`:""}</span>`;k+=w+S+R+b,y+=2;continue}}const f=e.exclusionGroup?`data-group="${e.exclusionGroup}"`:"",N=e.exclusionGroup?`<span ${f} class="exclusion-wrapper">`:"",n=e.exclusionGroup?"</span>":"";let A="";if(e.type==="tag"){const v=s?"":'<span class="tag-close-btn" title="Clear (ESC)"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg></span>',g=s?' data-locked="true"':"",x=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" data-tag-key="${e.key||""}"`:"";A=`<span contenteditable="false" class="tag-node group"${g}${x}><span class="tag-label">${e.text}</span>${v}</span>`}else if(e.type==="text"){const v=s?' data-locked="true" contenteditable="false"':' contenteditable="false"';e.className?A=`<span class="${e.className}"${v}>${e.text??""}</span>`:A=s?`<span${v}>${e.text??""}</span>`:`<span contenteditable="false">${e.text??""}</span>`}else if(e.type==="variable"&&e.key){const g=i[e.key]||e.text||"",x=!g,w=x?"​":g,b=x?"show-placeholder":"",S=e.exclusionGroup?` data-group="${e.exclusionGroup}"`:"",T=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" data-variable-key="${e.key||""}"`:"",B=e.tooltip&&x?"":"hidden",O=`<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder||""}"${S}${T} class="variable-chip ${b}">${w}${e.tooltip?`<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${B}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" title="提示"></i>`:""}</span>`;e.required?A=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${O}</span>`:A=O}else if(e.type==="upload"&&e.key){const v=u[e.key]!==null&&u[e.key]!==void 0,g=v?u[e.key]?.name:e.text,x=v?"":"hidden",w=e.tooltip&&!v?"":"hidden",b=v?"has-file":"",S=v&&g?` data-file-name="${g.replace(/"/g,"&quot;")}"`:"",T=`<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${b}"><span class="upload-icon">${v?"<i class='iconfont icon-exlwenjian'></i>":"<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${S}>${g||e.text}</span>${e.tooltip?`<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${w}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" title="提示"></i>`:""}<span class="file-remove-btn ${x}" title="移除文件">×</span></span></span>`;e.required?A=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${T}</span>`:A=T}else if(e.type==="multi-variable"&&e.key){const v=e.maxCount||9,g=m[e.key]||1,x=Math.min(g,v);let w="";for(let b=0;b<x;b++){const S=`${e.key}_${b}`,T=i[S]||"",B=!T,O=B?"​":T,D=B?"show-placeholder":"",M=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" data-variable-key="${e.key||""}"`:"",X=e.tooltip&&B?"":"hidden",G=`<span contenteditable="true" data-type="variable" data-key="${S}" data-multi-key="${e.key}" data-index="${b}" data-placeholder="${e.placeholder||""}"${M} class="variable-chip ${D}">${O}${e.tooltip?`<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${X}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" title="提示"></i>`:""}</span>`;w+=G}e.required?A=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${w}</span>`:A=w}k+=N+A+n,y++}t.current&&(t.current.innerHTML=k,setTimeout(()=>{if(!t.current)return;t.current.querySelectorAll('[data-type="variable"]').forEach(r=>{const C=r.innerText.replace(/\n/g,"");C.replace(/\u200B/g,"")?r.classList.remove("show-placeholder"):(C!=="​"&&(r.innerText="​"),r.classList.add("show-placeholder"))})},0))}function Ue(t,p,u,s,i={},m,k){const y=l.useCallback(()=>{if(!t.current)return;if(p.length===0){t.current.innerHTML="";return}let e={};const r=t.current,C=r.__tempVariableValues;if(C?(e=C,delete r.__tempVariableValues):t.current.querySelectorAll('[data-type="variable"]').forEach(N=>{const n=N.dataset.key;if(n){const A=N.innerText.replace(/[\u200B\n]/g,"").trim();A&&(e[n]=A)}}),He(t,p,u,s,e,i),m?.current){const{key:f,offset:N}=m.current;setTimeout(()=>{if(!t.current)return;const n=t.current.querySelector(`[data-type="variable"][data-key="${f}"]`);if(n){try{const A=document.createRange(),v=document.createTreeWalker(n,NodeFilter.SHOW_TEXT,null);let g=0,x=null,w=0;for(;v.nextNode();){const b=v.currentNode,S=b.textContent?.length||0;if(g+S>=N){x=b,w=N-g;break}g+=S}if(x){A.setStart(x,Math.min(w,x.textContent?.length||0)),A.collapse(!0);const b=window.getSelection();b&&(b.removeAllRanges(),b.addRange(A),n.focus())}else{A.selectNodeContents(n),A.collapse(!1);const b=window.getSelection();b&&(b.removeAllRanges(),b.addRange(A),n.focus())}}catch{const A=document.createRange();A.selectNodeContents(n),A.collapse(!1);const v=window.getSelection();v&&(v.removeAllRanges(),v.addRange(A),n.focus())}m.current=null}},0)}},[p,u,s,t,i,m,k]);l.useEffect(()=>{y()},[y])}function Xe(t,p,u,s){l.useEffect(()=>{const i=t.current;if(!i)return;const m=y=>{const e=y.target?.closest(".upload-info-icon");if(e&&e.classList.contains("upload-info-icon")){const r=e.dataset.uploadKey;r&&s({key:r,anchorEl:e,type:"upload"})}},k=y=>{const e=y.target?.closest(".upload-info-icon"),r=y.relatedTarget;e&&e.classList.contains("upload-info-icon")&&(!r||!i.contains(r)?s(null):r.closest(".upload-info-icon")||s(null))};return i.addEventListener("mouseover",m,!0),i.addEventListener("mouseout",k,!0),()=>{i.removeEventListener("mouseover",m,!0),i.removeEventListener("mouseout",k,!0)}},[p,u,t,s])}function Ye(t,p,u){l.useEffect(()=>{if(!t.current)return;const s=y=>{const e=y.currentTarget,r=e.dataset.tooltip,C=e.dataset.tagKey||"";r&&u({key:C,anchorEl:e,type:"tag"})},i=()=>{u(null)};let m;const k=()=>{if(!t.current)return;t.current.querySelectorAll(".tag-node[data-tooltip]").forEach(e=>{e.addEventListener("mouseenter",s),e.addEventListener("mouseleave",i)})};return m=requestAnimationFrame(()=>{m=requestAnimationFrame(k)}),()=>{cancelAnimationFrame(m),t.current&&t.current.querySelectorAll(".tag-node[data-tooltip]").forEach(e=>{e.removeEventListener("mouseenter",s),e.removeEventListener("mouseleave",i)})}},[p,t,u])}function Je(t,p,u){l.useEffect(()=>{const s=t.current;if(!s)return;const i=k=>{const y=k.target?.closest(".variable-info-icon");if(y&&y.classList.contains("variable-info-icon")){const e=y.dataset.variableKey;e&&u({key:e,anchorEl:y,type:"variable"})}},m=k=>{const y=k.target?.closest(".variable-info-icon"),e=k.relatedTarget;y&&y.classList.contains("variable-info-icon")&&(!e||!s.contains(e)?u(null):e.closest(".variable-info-icon")||u(null))};return s.addEventListener("mouseover",i,!0),s.addEventListener("mouseout",m,!0),()=>{s.removeEventListener("mouseover",i,!0),s.removeEventListener("mouseout",m,!0)}},[p,t,u])}function Ke(t,p,u,s){l.useEffect(()=>{if(!t.current)return;const i=e=>{const r=e.currentTarget;r.dataset.fileName&&s({key:"",anchorEl:r,type:"upload-label"})},m=()=>{s(null)};let k;const y=()=>{if(!t.current)return;t.current.querySelectorAll(".upload-label[data-file-name]").forEach(r=>{r.addEventListener("mouseenter",i),r.addEventListener("mouseleave",m)})};return k=requestAnimationFrame(()=>{k=requestAnimationFrame(y)}),()=>{cancelAnimationFrame(k),t.current&&t.current.querySelectorAll(".upload-label[data-file-name]").forEach(r=>{r.removeEventListener("mouseenter",i),r.removeEventListener("mouseleave",m)})}},[p,u,t,s])}function Qe(t,p,u,s){l.useEffect(()=>{he(t,p,u),ge(t,p,u,s)},[u,p,t,s])}function Ze(t,p){l.useEffect(()=>{if(!t.current)return;let u=!1,s=0;const i=()=>{u=!0},m=()=>{u=!1,s=Date.now()};let k=!1,y=0;const e=()=>{k=!0},r=()=>{k=!1,y=Date.now()},C=()=>{y=Date.now()},f=()=>{if(!t.current)return;const n=window.getSelection();if(!n||n.rangeCount===0||p.current||u||k||Date.now()-y<500)return;const A=n.getRangeAt(0);if(!A.collapsed){t.current.contains(A.commonAncestorContainer)||n.removeAllRanges();return}const v=n.anchorNode;if(!v)return;if(!t.current.contains(v)){n.removeAllRanges();return}let g=null;if(v.nodeType===Node.ELEMENT_NODE?g=v.closest('[data-type="variable"]'):v.nodeType===Node.TEXT_NODE&&v.parentElement&&(g=v.parentElement.closest('[data-type="variable"]')),!g){if(Date.now()-s>500)return;const x=t.current.querySelectorAll('[data-type="variable"]');if(x.length>0){let w=null;for(const b of Array.from(x))if(b.style.display!=="none"){w=b;break}if(!w&&x.length>0&&(w=x[0]),w){const b=document.createRange();b.selectNodeContents(w),b.collapse(!1),n.removeAllRanges(),n.addRange(b),w.focus()}else n.removeAllRanges()}else n.removeAllRanges()}},N=t.current;return N&&(N.addEventListener("compositionstart",e),N.addEventListener("compositionend",r),N.addEventListener("input",C)),document.addEventListener("mousedown",i),document.addEventListener("mouseup",m),document.addEventListener("selectionchange",f),()=>{const n=t.current;n&&(n.removeEventListener("compositionstart",e),n.removeEventListener("compositionend",r),n.removeEventListener("input",C)),document.removeEventListener("mousedown",i),document.removeEventListener("mouseup",m),document.removeEventListener("selectionchange",f)}},[t,p])}const Le=({config:t,onSend:p,isProcessing:u=!1,disabled:s=!1,width:i,lockStructure:m=!1,agentOptions:k=[],onAgentSelect:y,onAgentExit:e,loading:r=!1,placeholder:C,border:f,background:N="transparent"})=>{const n=l.useRef(null),A=l.useRef(null),[v,g]=l.useState({}),[x,w]=l.useState(null),[b,S]=l.useState(null),T=l.useRef(!1),B=l.useRef(null),[O,D]=l.useState(!1),M=l.useRef(null),[X,G]=l.useState(!0),[Y,$]=l.useState(()=>{const a={};return t.forEach(c=>{c.type==="multi-variable"&&c.key&&(a[c.key]=1)}),a});l.useEffect(()=>{$(a=>{const c={};return t.forEach(h=>{h.type==="multi-variable"&&h.key&&(c[h.key]=a[h.key]||1)}),c})},[t]),Ue(n,t,v,m,Y,M),Xe(n,t,v,S),Ye(n,t,S),Ke(n,t,v,S),Je(n,t,S),Qe(n,t,v,D),Ze(n,T),l.useEffect(()=>{if(t.length>0){G(!1);return}const a=()=>{if(!n.current){G(!0);return}const h=n.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"",j=n.current.querySelectorAll('[data-type="variable"]'),E=n.current.querySelectorAll('[data-type="upload"]');let _=!1;j.forEach(q=>{(q.textContent?.replace(/[\u200B\n]/g,"").trim()||"")&&(_=!0)}),E.forEach(q=>{q.querySelector(".upload-inner-wrapper.has-file")&&(_=!0)});const I=!h&&!_;G(I),t.length===0&&D(!I)};a();const c=new MutationObserver(a);return n.current&&c.observe(n.current,{childList:!0,subtree:!0,characterData:!0}),()=>{c.disconnect()}},[t]);const R=a=>{if(s){a.preventDefault();return}a.preventDefault();const c=a.clipboardData.getData("text/plain"),h=window.getSelection();if(h&&h.rangeCount>0){const j=h.anchorNode;if(j){let E=null;if(j.nodeType===Node.ELEMENT_NODE?E=j.closest('[data-type="variable"]'):j.nodeType===Node.TEXT_NODE&&j.parentElement&&(E=j.parentElement.closest('[data-type="variable"]')),E){const _=E.dataset.multiKey;if(_){const I=c.split(/[,\n\r\t]+/).map(q=>q.trim()).filter(q=>q.length>0);if(I.length>1){const q=parseInt(E.dataset.index||"0",10),P=t.find(ne=>ne.type==="multi-variable"&&ne.key===_)?.maxCount||9,W=Y[_]||1,te=Math.min(q+I.length,P);te>W&&$(Z=>({...Z,[_]:te})),setTimeout(()=>{n.current&&(I.forEach((Z,ne)=>{const re=q+ne;if(re>=P)return;const U=`${_}_${re}`,ae=n.current.querySelector(`[data-type="variable"][data-key="${U}"]`);ae&&(ae.innerText=Z,ae.classList.remove("show-placeholder"))}),z())},0);return}}}}}document.execCommand("insertText",!1,c),z()},L=a=>{if(a.target.files&&a.target.files[0]&&x){const c=a.target.files[0],h=x;g(j=>({...j,[h]:c}))}a.target&&(a.target.value=""),w(null)},J=a=>{g(c=>{const h={...c};return delete h[a],h})},K=a=>{const c=a.target;if(c.closest(".tag-close-btn")){if(a.preventDefault(),a.stopPropagation(),m)return;S(null),e?e():n.current&&(n.current.innerHTML="",n.current.focus());return}if(m){const E=c.closest(".tag-node"),_=c.closest('[data-type="text"]');if(E||_){a.preventDefault(),a.stopPropagation();const I=window.getSelection();I&&I.removeAllRanges();return}}c.closest('[data-type="variable"]')||(B.current={x:a.clientX,y:a.clientY},T.current=!1,c.closest(".file-remove-btn")&&(a.preventDefault(),a.stopPropagation()))},se=a=>{if(!a.target.closest('[data-type="variable"]')&&B.current){const j=Math.abs(a.clientX-B.current.x),E=Math.abs(a.clientY-B.current.y);(j>3||E>3)&&(T.current=!0)}},le=a=>{if(a.target.closest('[data-type="variable"]')){B.current=null,T.current=!1;return}B.current=null,T.current=!1},d=a=>{if(s)return;const c=a.target;if(c.closest(".tag-close-btn")){a.preventDefault(),a.stopPropagation();return}if(t.length===0)return;if(c.closest('[data-type="text"]')){a.preventDefault(),a.stopPropagation();const q=window.getSelection();q&&q.removeAllRanges();return}if(m&&c.closest(".tag-node")){a.preventDefault(),a.stopPropagation();const P=window.getSelection();P&&P.removeAllRanges();return}if(c.closest('[data-type="variable"]')){if(T.current)return;setTimeout(()=>{const q=window.getSelection();q&&!q.isCollapsed||be(n)},10);return}const _=c.closest(".file-remove-btn");if(_){a.preventDefault(),a.stopPropagation();const P=_.closest('[data-type="upload"]')?.dataset.key;P&&J(P);return}const I=c.closest('[data-type="upload"]');if(I){const q=I.dataset.key;q&&(w(q),A.current?.click());return}},V=a=>{const h=a.target.closest('[data-type="variable"]');if(h){const j=window.getSelection();if(j){const E=document.createRange(),_=h.textContent||"";if(_.replace(/\u200B/g,"")){let q=0,P=_.length;_.startsWith("​")&&(q=1),_.endsWith("​")&&_.length>1&&(P=_.length-1);const W=h.firstChild;W&&W.nodeType===Node.TEXT_NODE?(E.setStart(W,q),E.setEnd(W,P)):E.selectNodeContents(h)}else E.selectNodeContents(h),E.collapse(!0);j.removeAllRanges(),j.addRange(E)}}},z=()=>{if(t.length===0){if(n.current){const h=!(n.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"");G(h),D(!h)}return}if(be(n),n.current&&n.current.querySelectorAll('[data-type="variable"]').forEach(h=>{const j=h.querySelector(".variable-info-icon");if(j){let E=!1;const _=document.createTreeWalker(h,NodeFilter.SHOW_TEXT,{acceptNode:I=>j.contains(I)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(;_.nextNode();)if(_.currentNode.textContent?.replace(/[\u200B\n]/g,"").trim()){E=!0;break}E?j.classList.add("hidden"):j.classList.remove("hidden")}}),he(n,t,v),ge(n,t,v,D),!n.current)return;t.filter(c=>c.type==="multi-variable"&&c.key).forEach(c=>{if(!c.key)return;const h=c.maxCount||9,j=Y[c.key]||1,E=[];for(let W=0;W<j;W++){const te=`${c.key}_${W}`,Z=n.current.querySelector(`[data-type="variable"][data-key="${te}"][data-multi-key="${c.key}"]`);if(Z){const ne=Z.innerText.replace(/[\u200B\n]/g,"").trim();E.push(ne)}}const I=(E[E.length-1]||"")==="";let q=!1,P=-1;for(let W=0;W<E.length-1;W++)if(E[W]===""){q=!0,P=W;break}if(q&&P>=0){const W=window.getSelection();if(W&&W.rangeCount>0){const U=W.getRangeAt(0),ae=U.startContainer,ie=ae.nodeType===Node.ELEMENT_NODE?ae.closest('[data-type="variable"][data-multi-key]'):ae.parentElement?.closest('[data-type="variable"][data-multi-key]');if(ie){const ue=ie.dataset.key;if(ue){const pe=document.createRange();pe.setStartBefore(ie),pe.setEnd(U.startContainer,U.startOffset);const xe=pe.toString().length;M.current={key:ue,offset:xe}}}}const te=[...E];for(let U=P;U<te.length-1;U++)te[U]=te[U+1];te.pop();const Z={};te.forEach((U,ae)=>{U&&(Z[`${c.key}_${ae}`]=U)});const ne=Math.max(I?te.length:te.length+1,1);n.current.querySelectorAll('[data-type="variable"]').forEach(U=>{const ae=U.dataset.key,ie=U.dataset.multiKey;if(ae&&ie!==c.key){const ue=U.innerText.replace(/[\u200B\n]/g,"").trim();ue&&(Z[ae]=ue)}}),n.current.__tempVariableValues=Z,$(U=>({...U,[c.key]:ne}));return}if(!I){const W=j-1,te=`${c.key}_${W}`,Z=n.current.querySelector(`[data-type="variable"][data-key="${te}"][data-multi-key="${c.key}"]`);if(Z&&Z.innerText.replace(/[\u200B\n]/g,"").trim().length>0&&j<h){const re=window.getSelection();if(re&&re.rangeCount>0){const U=re.getRangeAt(0),ae=U.startContainer,ie=ae.nodeType===Node.ELEMENT_NODE?ae.closest('[data-type="variable"][data-multi-key]'):ae.parentElement?.closest('[data-type="variable"][data-multi-key]');if(ie){const ue=ie.dataset.key;if(ue){const pe=document.createRange();pe.setStartBefore(ie),pe.setEnd(U.startContainer,U.startOffset);const xe=pe.toString().length;M.current={key:ue,offset:xe}}}}$(U=>({...U,[c.key]:j+1}))}}})},Q=()=>{if(n.current){if(t.length===0){const a=n.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";D(a.length>0);return}be(n),he(n,t,v),ge(n,t,v,D)}},oe=a=>{if(s){a.preventDefault();return}const c=window.getSelection();if(c&&c.rangeCount>0){const h=c.anchorNode;let j=null;if(h&&(h.nodeType===Node.ELEMENT_NODE?j=h.closest('[data-type="text"]'):h.nodeType===Node.TEXT_NODE&&h.parentElement&&(j=h.parentElement.closest('[data-type="text"]'))),j){if(a.preventDefault(),a.stopPropagation(),n.current){const E=n.current.querySelector('[data-type="variable"], [data-type="upload"]');E&&E.focus()}return}}if(m&&c&&c.rangeCount>0){const h=c.anchorNode;let j=null;if(h&&(h.nodeType===Node.ELEMENT_NODE?j=h.closest(".tag-node"):h.nodeType===Node.TEXT_NODE&&h.parentElement&&(j=h.parentElement.closest(".tag-node"))),j){if(a.preventDefault(),a.stopPropagation(),n.current){const E=n.current.querySelector('[data-type="variable"], [data-type="upload"]');E&&E.focus()}return}}if(a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),ee()),a.key==="Escape"&&n.current){if(m){a.preventDefault();return}n.current.innerHTML="",n.current.focus()}if(a.key==="Backspace"){const h=window.getSelection();if(h&&h.rangeCount>0){const j=h.getRangeAt(0),E=h.anchorNode;if(m){let I=null,q=null;if(E&&(E.nodeType===Node.ELEMENT_NODE?(I=E.closest(".tag-node"),q=E.closest('[data-type="text"]')):E.nodeType===Node.TEXT_NODE&&E.parentElement&&(I=E.parentElement.closest(".tag-node"),q=E.parentElement.closest('[data-type="text"]'))),(I||q)&&j.collapsed&&j.startOffset===0){a.preventDefault();return}}let _=null;if(E&&(E.nodeType===Node.ELEMENT_NODE?_=E.closest('[data-type="variable"]'):E.nodeType===Node.TEXT_NODE&&E.parentElement&&(_=E.parentElement.closest('[data-type="variable"]'))),_){if(!j.collapsed)return;const I=_.innerText;if(I==="​"||I===""){a.preventDefault();return}if(j.startOffset===0){a.preventDefault();return}if(I.startsWith("​")&&j.startOffset===1){a.preventDefault();return}}}}},ee=()=>{if(u||s||r||!O||!n.current)return;if(t.length===0){const _=n.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";if(!_)return;p(_,_);return}const a=n.current;let c="";const h={},j=_=>{if(!(_.nodeType===Node.ELEMENT_NODE&&_.style.display==="none")){if(_.nodeType===Node.TEXT_NODE)c+=(_.textContent||"").replace(/\u200B/g,"");else if(_.nodeType===Node.ELEMENT_NODE){const I=_,q=I.dataset.type,P=I.dataset.key;if(q==="variable"&&P){let W="";const te=document.createTreeWalker(I,NodeFilter.SHOW_TEXT,{acceptNode:ne=>{const re=I.querySelector(".variable-info-icon");return re&&re.contains(ne)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;te.nextNode();)W+=te.currentNode.textContent||"";const Z=W.replace(/[\u200B\n]/g,"").trim();if(Z){const ne=I.dataset.multiKey;if(ne){(!h[ne]||!Array.isArray(h[ne]))&&(h[ne]=[]);const re=h[ne];re.push(Z),re.length>1&&(c+=" "),c+=Z}else h[P]=Z,c+=Z}}else if(q==="upload"&&P)h[P]=v[P]??null,v[P]&&(c+=` [附带文件: ${v[P]?.name}] `);else{if(I.classList.contains("tag-close-btn")||I.classList.contains("file-remove-btn"))return;I.getAttribute("contenteditable")==="false"&&!q&&I.classList.contains("tag-node")?c+=I.innerText:I.childNodes.forEach(j)}}}};if(a.childNodes.forEach(j),c=c.trim(),!c)return;const E=new FormData;E.append("fullPrompt",c),Object.keys(h).forEach(_=>{const I=h[_];I!=null&&(I instanceof File?E.append(_,I):Array.isArray(I)?t.some(P=>P.type==="multi-variable"&&P.key===_)?I.forEach(P=>{P!=null&&P!==""&&E.append(_,String(P))}):I.forEach((P,W)=>{P!=null&&(P instanceof File?E.append(`${_}[${W}]`,P):typeof P=="string"?E.append(`${_}[${W}]`,P):E.append(`${_}[${W}]`,String(P)))}):typeof I=="string"?E.append(_,I):E.append(_,String(I)))}),p(E,c)},de={...i?{width:typeof i=="number"?`${i}px`:i}:{},...f?{border:f}:{},...N?{background:N}:{}};return o.jsxs("div",{className:"rich-text-editor",style:de,"data-disabled":s,children:[o.jsx("div",{ref:n,className:`rte-editor ${t.length===0?"rte-editor-default":""} ${X&&C?"rte-editor-empty":""}`,contentEditable:t.length===0,suppressContentEditableWarning:!0,"data-placeholder":C,onMouseDown:K,onMouseMove:se,onMouseUp:le,onClick:d,onDoubleClick:V,onInput:z,onKeyDown:oe,onPaste:R,onBlur:Q}),o.jsx("input",{type:"file",ref:A,className:"rte-file-input",accept:".csv,.xlsx,.xls,.txt,.pdf,image/*",onChange:L}),o.jsxs("div",{className:"rich-text-editor-footer",children:[o.jsx("div",{className:"rich-text-editor-footer-left",children:o.jsxs("div",{className:"rich-text-editor-brand",children:[o.jsxs("div",{className:"rte-brand-badge",children:[o.jsx("img",{src:"https://oospublic.sealseek.cn/file/website/ball.png",alt:""}),o.jsx("span",{className:"rte-brand-text",children:"SealSeek 1.0"})]}),o.jsx(F.Dropdown,{placement:"top",menu:{items:k.map(a=>({key:a.key,label:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[a.icon&&o.jsx("i",{className:a.icon}),o.jsx("span",{children:a.label})]}),onClick:()=>{y?.(a)}}))},trigger:["click"],disabled:s||u,children:o.jsxs("div",{className:"rte-agent-badge",style:{cursor:k.length>0?"pointer":"default"},children:[o.jsx("i",{className:"iconfont icon-zhinengti"}),o.jsx("span",{className:"rte-agent-text",children:"智能体"})]})})]})}),o.jsx("button",{type:"button",onClick:ee,disabled:u||s||r||!O,className:"rich-text-editor-send-button",children:u||r?o.jsx("span",{className:"rte-send-spinner"}):o.jsx("i",{className:"iconfont icon-fasong"})})]}),b?.anchorEl&&(()=>{if(!document.body.contains(b.anchorEl))return null;let a="";return b.type==="upload"?a=t.find(h=>h.type==="upload"&&h.key===b.key)?.tooltip||"":b.type==="tag"?a=b.anchorEl.dataset.tooltip||"":b.type==="upload-label"?a=b.anchorEl.dataset.fileName||"":b.type==="variable"&&(a=b.anchorEl.dataset.tooltip||""),De.createPortal(o.jsx(F.Tooltip,{arrow:!1,title:o.jsx("div",{style:{maxWidth:"200px",fontSize:"12px",color:"#fff"},children:a}),open:!0,placement:"top",getPopupContainer:()=>document.body,overlayInnerStyle:{background:"var(--neutral-800, #262626)"},children:o.jsx("div",{style:{position:"fixed",left:`${b.anchorEl.getBoundingClientRect().left}px`,top:`${b.anchorEl.getBoundingClientRect().top}px`,width:`${b.anchorEl.offsetWidth}px`,height:`${b.anchorEl.offsetHeight}px`,pointerEvents:"none"}})}),document.body)})()]})};Le.__docgenInfo={displayName:"RichTextEditor",description:"结构化富文本输入组件,支持标签、变量输入块、文件上传以及互斥显示逻辑。",props:{config:{name:"config",required:!0,description:"结构化输入配置节点数组",type:{name:"InputNode[]",raw:"InputNode[]"}},onSend:{name:"onSend",required:!0,description:"点击发送按钮时的回调,返回数据与拼接后的 Prompt",type:{name:"function",raw:"(data: Record<string, any>, fullPrompt: string) => void"}},isProcessing:{name:"isProcessing",required:!1,description:"是否处于处理状态(禁用输入与发送)",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}}}};const Ve="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFSSURBVHgB3ZTtccIwDIaVXv83I2SDZgSP0BHMBG0naEZhA2boBGQDswHdQJUOGRxjO0Z8HPDe6eJzJD2W4gjgEYSIn2xwK6EIFHqBGysJpMP3ZB0oRbEtmal1NtIxl4OWWsoxEsvqofJ0rgTNASOYq+7SXKDsuYvAcgkq/PWwBLQWqIfdjeRStaBUc4qzgLi9/BzJNmS/sh6bpvmrTfSFacU3scWy1mQryWdSnXiFE8QVUJINLTuyhWzzz/1OZmTN9hEckqtfUOwIGlGCpVRjE+94JFqpMtTeVzO8/UmPxpZU8Qa7aln8Tb9pfwla4WHWrjPvvbbnTBsX7PmLs83EDAH0BxSw1G31+/1FoDg/vPcXR+wocQS1apj4+P92FfhOoLyuBfYlmPgYnGoCjWADzAkzUyJ430awLmphPaxWQVU22BuuApPkHaanjcXSN3t6/QNjTMSJWDcs1QAAAABJRU5ErkJggg==",$e=[{label:"5页",value:5},{label:"10页",value:10},{label:"15页",value:15},{label:"30页",value:30}],et=({autoLoading:t,batchSize:p,loadingProgress:u,loadIcon:s,onBatchSizeChange:i,onLoadNextPage:m,onStartAutoLoad:k,onStopLoad:y})=>t&&u?o.jsxs("div",{className:"auto_load_progress",children:[s||o.jsx("img",{src:Ve,alt:"自动加载",width:14,height:14}),o.jsxs("span",{children:["正在加载第",u.currentPage,"/",u.totalPages,"页"]}),o.jsx(F.Progress,{percent:u.percentage,type:"line",size:[160,8]}),o.jsx("span",{onClick:y,className:"auto_load_stop_btn",children:"停止加载"})]}):o.jsxs("div",{className:"auto_load_container",children:[o.jsx("div",{onClick:m,className:"auto_load_next_btn",style:{backgroundColor:t?"#f5f5f5":"#2563eb"},children:"加载下一页"}),o.jsxs("div",{className:"right_control_wrap",style:{backgroundColor:t?"#f5f5f5":"#2563eb"},children:[o.jsxs("div",{className:"auto_load_btn",onClick:t?void 0:k,children:[s||o.jsx("img",{src:Ve,alt:"自动加载",width:14,height:14}),o.jsx("span",{children:"自动加载"})]}),o.jsx(F.Select,{value:p,onChange:i,options:$e,disabled:t,size:"small",className:"auto_load_select",popupMatchSelectWidth:84})]})]}),tt=({current:t,loadIcon:p,pageSize:u,total:s,cachedPages:i,loadedCount:m,autoLoading:k=!1,loadingProgress:y,onChange:e,onLoadNextPage:r,onStartAutoLoad:C,onStopLoading:f})=>{const[N,n]=l.useState(5),A=Math.ceil(s/u),v=l.useMemo(()=>i.length>=A,[i,A]),g=()=>Array.from({length:A},(b,S)=>S+1).filter(b=>!i.includes(b)).slice(0,N),x=(w,b,S)=>{const T=i.includes(w);return b==="prev"||b==="next"||b==="jump-prev"||b==="jump-next"?o.jsx("div",{className:"pageBox",children:S}):o.jsxs("div",{className:"pageBox",style:{backgroundColor:t===w?"#2563EB":"#f5f5f5",color:t===w?"#fff":T?"#171717":"#a3a3a3"},children:[w,!T&&o.jsx("span",{className:"unload_spot"})]})};return o.jsxs("div",{className:"pagination_footer",children:[o.jsxs("div",{className:"pagination_leftWrap",children:[o.jsxs("span",{className:"pagination_total",children:[o.jsx(ce.InfoCircleOutlined,{style:{color:"#2563EB",marginRight:"4px"}}),"已加载: ",m,"/",s,"条数据"]}),!v&&o.jsx(et,{loadIcon:p||void 0,autoLoading:k,batchSize:N,loadingProgress:y,disabled:!r||!C,onBatchSizeChange:n,onLoadNextPage:()=>r?.(),onStartAutoLoad:()=>{const w=g();C?.(w)},onStopLoad:()=>f?.()})]}),o.jsx(F.Pagination,{current:t,pageSize:u,total:s,onChange:w=>e(w),showSizeChanger:!1,showQuickJumper:!1,showTotal:(w,b)=>"",itemRender:x})]})},Pe=t=>{const{loading:p,autoLoading:u,loadingProgress:s,columns:i=[],dataSource:m=[],total:k,current:y,pageSize:e,cachedPages:r,onChangePage:C,onLoadNextPage:f,onStartAutoLoad:N,onStopLoading:n,...A}=t,v=l.useRef(null),g=l.useCallback(x=>{C(x),r.includes(x)&&v.current?.scrollTo({key:`${(x-1)*e+1}`})},[y]);return o.jsxs("div",{className:"flex flex-col",children:[o.jsx(F.Table,{ref:v,...A,columns:i,dataSource:m,pagination:!1,virtual:!0}),o.jsx(tt,{loading:p,autoLoading:u,loadingProgress:s,current:y,pageSize:e,total:k,loadedCount:m.length,cachedPages:r,onChange:g,onLoadNextPage:f,onStartAutoLoad:N,onStopLoading:n})]})};Pe.__docgenInfo={displayName:"VirtualTable",description:"虚拟滚动表格组件,支持分页、数据缓存和自动加载功能。",props:{loading:{description:"加载状态",name:"loading",required:!0,type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},total:{description:"总数据条数",name:"total",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"0"}},current:{description:"当前页码",name:"current",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"1"}},pageSize:{description:"每页数据条数",name:"pageSize",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"10"}},cachedPages:{description:"已缓存的页码数组",name:"cachedPages",required:!0,type:{name:"number[]",raw:"number[]"},defaultValue:{value:"[]"}},dataSource:{description:"数据源",name:"dataSource",required:!0,type:{name:"Array<T>",raw:"Array<T>"},defaultValue:{value:"[]"}},onChangePage:{description:"页码变更回调函数",name:"onChangePage",required:!0,type:{name:"function",raw:"function(page: number): void"},defaultValue:{value:"-"}},autoLoading:{description:"是否正在自动加载",name:"autoLoading",required:!0,type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},loadingProgress:{description:"加载进度信息",name:"loadingProgress",required:!0,type:{name:"object",raw:"{percentage: 0, currentPage: 1, totalPages: 5}"},defaultValue:{value:"-"}},onLoadNextPage:{description:"加载下一页回调函数",name:"onLoadNextPage",required:!1,type:{name:"function",raw:"function(page: number): void"},defaultValue:{value:"-"}},onStartAutoLoad:{description:"开始自动加载回调函数",name:"onStartAutoLoad",required:!1,type:{name:"function",raw:"function(loadNextPages: number[]): void"},defaultValue:{value:"-"}},onStopLoading:{description:"停止加载回调函数",name:"onStopLoading",required:!1,type:{name:"function",raw:"function(): void"},defaultValue:{value:"-"}},columns:{description:"表格列配置",name:"columns",required:!0,type:{name:"Array<object>",raw:"Array<object>"},defaultValue:{value:"[]"}}}};const Be=({texts:t=[],placeholder:p="请输入内容",animationSpeed:u=100,autoPlay:s=!0,value:i,onChange:m,...k})=>{const[y,e]=l.useState(""),[r,C]=l.useState(0),[f,N]=l.useState(!1),[n,A]=l.useState(!1),[v,g]=l.useState(!1),x=l.useRef(void 0),w=l.useRef(void 0),b=l.useRef(t),S=l.useRef(r),T=l.useRef(n),B=l.useRef(y);l.useEffect(()=>{b.current=t,S.current=r,T.current=n,B.current=y});const O=l.useCallback((R,L)=>{let J=0;g(!0);const K=()=>{J<R.length?(e(R.slice(0,J+1)),J++,w.current=window.setTimeout(K,u)):(g(!1),L?.())};K()},[u]),D=l.useCallback(R=>{let L=B.current.length;const J=()=>{L>0?(e(B.current.slice(0,L-1)),L--,w.current=window.setTimeout(J,u/2)):R?.()};J()},[u]),M=l.useCallback(()=>{if(b.current.length===0||T.current)return;N(!0);const R=b.current[S.current];B.current?D(()=>{O(R,()=>{x.current=window.setTimeout(()=>{C(L=>(L+1)%b.current.length),N(!1)},2e3)})}):O(R,()=>{x.current=window.setTimeout(()=>{C(L=>(L+1)%b.current.length),N(!1)},2e3)})},[D,O]);l.useEffect(()=>(s&&t.length>0&&!n&&M(),()=>{x.current&&window.clearTimeout(x.current),w.current&&window.clearTimeout(w.current)}),[r,n,s,t.length,M]),l.useEffect(()=>{!f&&s&&t.length>0&&!n&&M()},[r,f,s,t.length,n,M]);const X=R=>{A(!0),x.current&&window.clearTimeout(x.current),w.current&&window.clearTimeout(w.current),N(!1),g(!1),k.onFocus?.(R)},G=R=>{A(!1),!i&&t.length>0&&(e(""),C(0)),k.onBlur?.(R)},Y=R=>{m?.(R.target.value),k.onChange?.(R)},$=()=>n||i?p:y||p;return o.jsxs("div",{style:{position:"relative"},children:[o.jsx(F.Input,{...k,value:i,onChange:Y,onFocus:X,onBlur:G,placeholder:$(),style:{...k.style,position:"relative",zIndex:1}}),!n&&!i&&y&&o.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",paddingLeft:11,paddingRight:11,color:"#bfbfbf",pointerEvents:"none",zIndex:2,fontSize:14,fontFamily:"inherit"},children:[o.jsx("span",{children:y}),v&&o.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),o.jsx("style",{children:`
23
23
  @keyframes blink {
24
24
  0%, 50% { opacity: 1; }
25
25
  51%, 100% { opacity: 0; }
26
26
  }
27
- `})]})};Ve.__docgenInfo={displayName:"DynamicInput",description:"动态文案输入框组件,支持流式文字动画效果",props:{texts:{name:"texts",required:!0,description:"动态展示的文案数组",type:{name:"string[]",raw:"string[]"}},placeholder:{name:"placeholder",required:!1,description:"输入框占位符",type:{name:"string",raw:"string"},defaultValue:{value:'"请输入内容"'}},animationSpeed:{name:"animationSpeed",required:!1,description:"动画速度(毫秒)",type:{name:"number",raw:"number"},defaultValue:{value:"100"}},autoPlay:{name:"autoPlay",required:!1,description:"是否自动播放动画",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},value:{name:"value",required:!1,description:"输入框值",type:{name:"string",raw:"string"}},onChange:{name:"onChange",required:!1,description:"输入框变化回调",type:{name:"function",raw:"(value: string) => void"}}}};const Oe=({texts:t=[],placeholder:f="请输入内容",animationSpeed:u=100,autoPlay:l=!0,value:i="",onChange:m,onSubmit:C,maxLength:h=500,showCount:e=!0,submitText:r="发送",disabled:N=!1,rows:p=4,style:S,...n})=>{const[A,v]=s.useState(""),[g,w]=s.useState(0),[I,b]=s.useState(!1),[T,E]=s.useState(!1),[q,B]=s.useState(!1),[D,P]=s.useState(i||""),K=s.useRef(void 0),F=s.useRef(void 0),Y=s.useRef(t),$=s.useRef(g),k=s.useRef(T),L=s.useRef(A),U=s.useRef(null);s.useEffect(()=>{Y.current=t,$.current=g,k.current=T,L.current=A});const J=s.useCallback((a,o)=>{let y=0;B(!0);const R=()=>{y<a.length?(v(a.slice(0,y+1)),y++,F.current=window.setTimeout(R,u)):(B(!1),o?.())};R()},[u]),se=s.useCallback(a=>{let o=L.current.length;const y=()=>{o>0?(v(L.current.slice(0,o-1)),o--,F.current=window.setTimeout(y,u/2)):a?.()};y()},[u]),le=s.useCallback(()=>{if(Y.current.length===0||k.current)return;b(!0);const a=Y.current[$.current];L.current?se(()=>{J(a,()=>{K.current=window.setTimeout(()=>{w(o=>(o+1)%Y.current.length),b(!1)},2e3)})}):J(a,()=>{K.current=window.setTimeout(()=>{w(o=>(o+1)%Y.current.length),b(!1)},2e3)})},[se,J]);s.useEffect(()=>(l&&t.length>0&&!T&&le(),()=>{K.current&&window.clearTimeout(K.current),F.current&&window.clearTimeout(F.current)}),[g,T,l,t.length,le]),s.useEffect(()=>{!I&&l&&t.length>0&&!T&&le()},[g,I,l,t.length,T,le]);const c=a=>{E(!0),K.current&&window.clearTimeout(K.current),F.current&&window.clearTimeout(F.current),b(!1),B(!1),n.onFocus?.(a)},V=a=>{E(!1),!i&&t.length>0&&(v(""),w(0)),n.onBlur?.(a)},z=a=>{const o=a.target.value;h&&o.length>h||(m?m(o):P(o),n.onChange?.(a))},Q=()=>{const a=m?i:D;a.trim()&&!N&&(C?.(a),m||P(""))},oe=a=>{(a.ctrlKey||a.metaKey)&&a.key==="Enter"&&(a.preventDefault(),Q()),n.onKeyDown?.(a)},ee=m?i:D,de=N||!ee.trim()||(h?ee.length>h:!1);return d.jsxs("div",{style:{position:"relative",...S},children:[d.jsxs("div",{style:{position:"relative"},children:[d.jsx("textarea",{ref:U,value:m?i:D,onChange:z,onFocus:a=>{a.target.style.borderColor="#1890ff",a.target.style.boxShadow="0 0 0 2px rgba(24, 144, 255, 0.2)",c(a)},onBlur:a=>{a.target.style.borderColor="#d9d9d9",a.target.style.boxShadow="none",V(a)},onKeyDown:oe,placeholder:T||ee?f:"",maxLength:h,rows:p,disabled:N,style:{width:"100%",minHeight:`${p*24+16}px`,padding:"8px 60px 8px 12px",border:"1px solid #d9d9d9",borderRadius:"6px",fontSize:"14px",lineHeight:"1.5",fontFamily:"inherit",resize:"vertical",outline:"none",transition:"border-color 0.3s, box-shadow 0.3s",backgroundColor:"#fff",...n.style},...n}),!T&&!ee&&A&&d.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"flex-start",paddingTop:8,paddingLeft:12,paddingRight:12,color:"#bfbfbf",pointerEvents:"none",zIndex:2,fontSize:14,fontFamily:"inherit",lineHeight:"1.5"},children:[d.jsx("span",{children:A}),q&&d.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),d.jsx("div",{style:{position:"absolute",bottom:8,right:8,zIndex:3},children:d.jsx(G.Button,{type:"primary",size:"small",icon:d.jsx(ue.SendOutlined,{}),onClick:Q,disabled:de,style:{borderRadius:6,minWidth:32,height:32,display:"flex",alignItems:"center",justifyContent:"center"},children:r})})]}),e&&d.jsxs("div",{style:{marginTop:4,textAlign:"right",fontSize:"12px",color:"#999"},children:[ee.length,"/",h]}),d.jsx("style",{children:`
27
+ `})]})};Be.__docgenInfo={displayName:"DynamicInput",description:"动态文案输入框组件,支持流式文字动画效果",props:{texts:{name:"texts",required:!0,description:"动态展示的文案数组",type:{name:"string[]",raw:"string[]"}},placeholder:{name:"placeholder",required:!1,description:"输入框占位符",type:{name:"string",raw:"string"},defaultValue:{value:'"请输入内容"'}},animationSpeed:{name:"animationSpeed",required:!1,description:"动画速度(毫秒)",type:{name:"number",raw:"number"},defaultValue:{value:"100"}},autoPlay:{name:"autoPlay",required:!1,description:"是否自动播放动画",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},value:{name:"value",required:!1,description:"输入框值",type:{name:"string",raw:"string"}},onChange:{name:"onChange",required:!1,description:"输入框变化回调",type:{name:"function",raw:"(value: string) => void"}}}};const qe=({texts:t=[],placeholder:p="请输入内容",animationSpeed:u=100,autoPlay:s=!0,value:i="",onChange:m,onSubmit:k,maxLength:y=500,showCount:e=!0,submitText:r="发送",disabled:C=!1,rows:f=4,style:N,...n})=>{const[A,v]=l.useState(""),[g,x]=l.useState(0),[w,b]=l.useState(!1),[S,T]=l.useState(!1),[B,O]=l.useState(!1),[D,M]=l.useState(i||""),X=l.useRef(void 0),G=l.useRef(void 0),Y=l.useRef(t),$=l.useRef(g),R=l.useRef(S),L=l.useRef(A),J=l.useRef(null);l.useEffect(()=>{Y.current=t,$.current=g,R.current=S,L.current=A});const K=l.useCallback((a,c)=>{let h=0;O(!0);const j=()=>{h<a.length?(v(a.slice(0,h+1)),h++,G.current=window.setTimeout(j,u)):(O(!1),c?.())};j()},[u]),se=l.useCallback(a=>{let c=L.current.length;const h=()=>{c>0?(v(L.current.slice(0,c-1)),c--,G.current=window.setTimeout(h,u/2)):a?.()};h()},[u]),le=l.useCallback(()=>{if(Y.current.length===0||R.current)return;b(!0);const a=Y.current[$.current];L.current?se(()=>{K(a,()=>{X.current=window.setTimeout(()=>{x(c=>(c+1)%Y.current.length),b(!1)},2e3)})}):K(a,()=>{X.current=window.setTimeout(()=>{x(c=>(c+1)%Y.current.length),b(!1)},2e3)})},[se,K]);l.useEffect(()=>(s&&t.length>0&&!S&&le(),()=>{X.current&&window.clearTimeout(X.current),G.current&&window.clearTimeout(G.current)}),[g,S,s,t.length,le]),l.useEffect(()=>{!w&&s&&t.length>0&&!S&&le()},[g,w,s,t.length,S,le]);const d=a=>{T(!0),X.current&&window.clearTimeout(X.current),G.current&&window.clearTimeout(G.current),b(!1),O(!1),n.onFocus?.(a)},V=a=>{T(!1),!i&&t.length>0&&(v(""),x(0)),n.onBlur?.(a)},z=a=>{const c=a.target.value;y&&c.length>y||(m?m(c):M(c),n.onChange?.(a))},Q=()=>{const a=m?i:D;a.trim()&&!C&&(k?.(a),m||M(""))},oe=a=>{(a.ctrlKey||a.metaKey)&&a.key==="Enter"&&(a.preventDefault(),Q()),n.onKeyDown?.(a)},ee=m?i:D,de=C||!ee.trim()||(y?ee.length>y:!1);return o.jsxs("div",{style:{position:"relative",...N},children:[o.jsxs("div",{style:{position:"relative"},children:[o.jsx("textarea",{ref:J,value:m?i:D,onChange:z,onFocus:a=>{a.target.style.borderColor="#1890ff",a.target.style.boxShadow="0 0 0 2px rgba(24, 144, 255, 0.2)",d(a)},onBlur:a=>{a.target.style.borderColor="#d9d9d9",a.target.style.boxShadow="none",V(a)},onKeyDown:oe,placeholder:S||ee?p:"",maxLength:y,rows:f,disabled:C,style:{width:"100%",minHeight:`${f*24+16}px`,padding:"8px 60px 8px 12px",border:"1px solid #d9d9d9",borderRadius:"6px",fontSize:"14px",lineHeight:"1.5",fontFamily:"inherit",resize:"vertical",outline:"none",transition:"border-color 0.3s, box-shadow 0.3s",backgroundColor:"#fff",...n.style},...n}),!S&&!ee&&A&&o.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"flex-start",paddingTop:8,paddingLeft:12,paddingRight:12,color:"#bfbfbf",pointerEvents:"none",zIndex:2,fontSize:14,fontFamily:"inherit",lineHeight:"1.5"},children:[o.jsx("span",{children:A}),B&&o.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),o.jsx("div",{style:{position:"absolute",bottom:8,right:8,zIndex:3},children:o.jsx(F.Button,{type:"primary",size:"small",icon:o.jsx(ce.SendOutlined,{}),onClick:Q,disabled:de,style:{borderRadius:6,minWidth:32,height:32,display:"flex",alignItems:"center",justifyContent:"center"},children:r})})]}),e&&o.jsxs("div",{style:{marginTop:4,textAlign:"right",fontSize:"12px",color:"#999"},children:[ee.length,"/",y]}),o.jsx("style",{children:`
28
28
  @keyframes blink {
29
29
  0%, 50% { opacity: 1; }
30
30
  51%, 100% { opacity: 0; }
31
31
  }
32
- `})]})};Oe.__docgenInfo={displayName:"DynamicTextArea",description:"动态文案文本域组件,支持流式文字动画效果",props:{texts:{name:"texts",required:!0,description:"动态展示的文案数组",type:{name:"string[]",raw:"string[]"}},placeholder:{name:"placeholder",required:!1,description:"输入框占位符",type:{name:"string",raw:"string"},defaultValue:{value:'"请输入内容"'}},animationSpeed:{name:"animationSpeed",required:!1,description:"动画速度(毫秒)",type:{name:"number",raw:"number"},defaultValue:{value:"100"}},autoPlay:{name:"autoPlay",required:!1,description:"是否自动播放动画",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},value:{name:"value",required:!1,description:"输入框值",type:{name:"string",raw:"string"}},onChange:{name:"onChange",required:!1,description:"输入框变化回调",type:{name:"function",raw:"(value: string) => void"}},onSubmit:{name:"onSubmit",required:!1,description:"提交回调",type:{name:"function",raw:"(value: string) => void"}},maxLength:{name:"maxLength",required:!1,description:"最大输入字数",type:{name:"number",raw:"number"},defaultValue:{value:"500"}},showCount:{name:"showCount",required:!1,description:"是否显示字数统计",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},submitText:{name:"submitText",required:!1,description:"提交按钮文本",type:{name:"string",raw:"string"},defaultValue:{value:'"发送"'}},disabled:{name:"disabled",required:!1,description:"是否禁用提交按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},rows:{name:"rows",required:!1,description:"文本域行数",type:{name:"number",raw:"number"},defaultValue:{value:"4"}}}};const ve=({src:t,poster:f,width:u=300,height:l,videoWidth:i,videoHeight:m,showPlayButton:C=!0,autoPlayOnHover:h=!0,onClick:e,onVideoLoaded:r,onVideoPlay:N,onVideoPause:p,onVideoEnded:S,className:n,style:A,...v})=>{const g=s.useRef(null),[w,I]=s.useState(!1),[b,T]=s.useState(!1),[E,q]=s.useState(!1),B=s.useCallback(()=>{g.current&&(g.current.play(),I(!0),N?.())},[N]),D=s.useCallback(()=>{g.current&&(g.current.pause(),I(!1),p?.())},[p]),P=s.useCallback(J=>{J.stopPropagation(),w?D():B()},[w,B,D]),K=s.useCallback(()=>{T(!0),h&&!w&&B()},[h,w,B]),F=s.useCallback(()=>{T(!1),h&&w&&D()},[h,w,D]),Y=s.useCallback(()=>{q(!0),r?.()},[r]),$=s.useCallback(()=>{I(!0),N?.()},[N]),k=s.useCallback(()=>{I(!1),p?.()},[p]),L=s.useCallback(()=>{I(!1),S?.()},[S]),U=s.useCallback(J=>{e?.(J)},[e]);return d.jsx(G.Card,{...v,className:`video-card ${n||""}`,style:{width:u,height:l,padding:0,overflow:"hidden",cursor:e?"pointer":"default",border:"none",borderRadius:0,...A},bordered:!1,onMouseEnter:K,onMouseLeave:F,onClick:U,children:d.jsxs("div",{className:"video-card-container",children:[d.jsx("video",{ref:g,src:t,poster:f,preload:"metadata",onLoadedData:Y,onPlay:$,onPause:k,onEnded:L,muted:!0,loop:!0}),C&&d.jsx("div",{className:`video-play-button ${b?"hovered":""}`,onClick:P,children:w?d.jsx(ue.PauseCircleOutlined,{className:"play-icon"}):d.jsx(ue.PlayCircleOutlined,{className:"play-icon"})}),!E&&d.jsx("div",{className:"video-loading-mask",children:d.jsx("div",{className:"loading-spinner"})})]})})};ve.__docgenInfo={displayName:"VideoCard",description:"视频卡片组件,支持鼠标悬浮播放控制",props:{src:{name:"src",required:!0,description:"视频源地址",type:{name:"string",raw:"string"}},poster:{name:"poster",required:!1,description:"视频海报图片",type:{name:"string",raw:"string"}},width:{name:"width",required:!1,description:"卡片宽度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:"300"}},height:{name:"height",required:!1,description:"卡片高度",type:{name:"number | string",raw:"number | string"}},videoWidth:{name:"videoWidth",required:!1,description:"视频宽度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:'"100%"'}},videoHeight:{name:"videoHeight",required:!1,description:"视频高度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:'"100%"'}},showPlayButton:{name:"showPlayButton",required:!1,description:"是否显示播放按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},autoPlayOnHover:{name:"autoPlayOnHover",required:!1,description:"是否自动播放(鼠标悬浮时)",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: React.MouseEvent<HTMLDivElement>) => void"}},onVideoLoaded:{name:"onVideoLoaded",required:!1,description:"视频加载完成事件",type:{name:"function",raw:"() => void"}},onVideoPlay:{name:"onVideoPlay",required:!1,description:"视频播放事件",type:{name:"function",raw:"() => void"}},onVideoPause:{name:"onVideoPause",required:!1,description:"视频暂停事件",type:{name:"function",raw:"() => void"}},onVideoEnded:{name:"onVideoEnded",required:!1,description:"视频结束事件",type:{name:"function",raw:"() => void"}},className:{name:"className",required:!1,description:"自定义样式类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}}}};const Qe=t=>[".mp4",".webm",".ogg",".mov",".avi",".wmv",".flv",".mkv"].some(u=>t.toLowerCase().includes(u)),Ze=t=>t.type?t.type:Qe(t.url)?"video":"image",qe=({items:t,columns:f,gap:u=0,responsive:l=!0,breakpoints:i={xs:1,sm:2,md:3,lg:4,xl:5,xxl:6},className:m,style:C,onClick:h})=>{const e=s.useRef(null),[r,N]=s.useState(f||i.md||3),p=s.useRef(new Map),S=s.useCallback(()=>{if(!l||f)return f||i.md||3;const g=window.innerWidth;return g<576?i.xs||1:g<768?i.sm||2:g<992?i.md||3:g<1200?i.lg||4:g<1600?i.xl||5:i.xxl||6},[l,f,i]),n=s.useCallback(()=>{if(!e.current)return;const g=r,w=e.current,b=(w.offsetWidth-u*(g-1))/g,T=new Array(g).fill(0);t.forEach((q,B)=>{const D=q.id||B,P=p.current.get(D);if(!P)return;const K=Math.min(...T),F=T.indexOf(K),Y=F*(b+u),$=T[F];P.style.position="absolute",P.style.left=`${Y}px`,P.style.top=`${$}px`,P.style.width=`${b}px`,T[F]+=P.offsetHeight+u});const E=Math.max(...T);w.style.height=`${E}px`},[t,r,u]);s.useEffect(()=>{const g=()=>{const w=S();w!==r&&N(w)};if(l)return window.addEventListener("resize",g),g(),()=>window.removeEventListener("resize",g)},[l,S,r]),s.useEffect(()=>{const g=setTimeout(()=>{n()},100);return()=>clearTimeout(g)},[t,r,n]);const A=s.useCallback(()=>{n()},[n]),v=s.useCallback(g=>{h&&h(g),g.onClick?.(g)},[h]);return d.jsx("div",{ref:e,className:`waterfall-container ${m||""}`,style:{position:"relative",width:"100%",...C},children:t.map((g,w)=>{const I=g.id||w,b=Ze(g);return d.jsx("div",{ref:T=>{T?p.current.set(I,T):p.current.delete(I)},className:"waterfall-item",children:b==="video"?d.jsx("div",{style:{width:"100%",position:"relative",paddingBottom:"56.25%",cursor:h||g.onClick?"pointer":"default"},children:d.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},children:d.jsx(ve,{src:g.url,poster:g.poster,width:"100%",height:"100%",onClick:()=>v(g),onVideoLoaded:A,autoPlayOnHover:!0,showPlayButton:!1})})}):d.jsx("div",{className:"waterfall-image-wrapper",onClick:()=>v(g),style:{cursor:h||g.onClick?"pointer":"default"},children:d.jsx("img",{src:g.url,alt:`瀑布流图片 ${w+1}`,className:"waterfall-image",onLoad:A,onError:A,style:{display:"block",width:"100%",height:"auto"}})})},I)})})};qe.__docgenInfo={displayName:"Waterfall",description:"瀑布流布局组件,支持图片和视频混合展示",props:{items:{name:"items",required:!0,description:"媒体资源数组",type:{name:"WaterfallItem[]",raw:"WaterfallItem[]"}},columns:{name:"columns",required:!1,description:"列数(默认会根据屏幕宽度自动响应)",type:{name:"number",raw:"number"}},gap:{name:"gap",required:!1,description:"间隔大小",type:{name:"number",raw:"number"},defaultValue:{value:"0"}},responsive:{name:"responsive",required:!1,description:"是否启用响应式布局",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},breakpoints:{name:"breakpoints",required:!1,description:"响应式断点配置",type:{name:"object",raw:"{ xs?: number; sm?: number; md?: number; lg?: number; xl?: number; xxl?: number; }"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}},onClick:{name:"onClick",required:!1,description:"点击回调",type:{name:"function",raw:"(item: any) => void"}}}};const $e={algorithm:G.theme.defaultAlgorithm,token:{colorPrimary:"#3b82f6",colorSuccess:"#10b981",colorWarning:"#f59e0b",colorError:"#ef4444",colorInfo:"#3b82f6",colorBgBase:"#ffffff",colorBgContainer:"#ffffff",colorBgElevated:"#ffffff",colorBgLayout:"#f8fafc",colorTextBase:"#1e293b",colorText:"#1e293b",colorTextSecondary:"#64748b",colorTextTertiary:"#94a3b8",colorTextQuaternary:"#cbd5e1",colorBorder:"#e2e8f0",colorBorderSecondary:"#f1f5f9",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",boxShadowSecondary:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",borderRadius:8,borderRadiusLG:12,borderRadiusSM:6,fontFamily:"Inter, system-ui, Arial, sans-serif",fontSize:14,fontSizeLG:16,fontSizeSM:12,padding:16,paddingLG:24,paddingSM:12,paddingXS:8,controlHeight:32,controlHeightLG:40,controlHeightSM:24},components:{Button:{borderRadius:8,controlHeight:32,fontWeight:500},Card:{borderRadiusLG:12,boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"},Input:{borderRadius:8,controlHeight:32},Table:{borderRadiusLG:8,headerBg:"#f8fafc",headerColor:"#374151"}}};X.AdvancedTable=je,X.AppModal=Ne,X.BackButton=Ie,X.Button=Te,X.Card=Ce,X.DynamicInput=Ve,X.DynamicTextArea=Oe,X.EmptyAndSpin=Ae,X.LinkButton=_e,X.PageTable=Se,X.RichTextEditor=Le,X.VideoCard=ve,X.Waterfall=qe,X.XcIcon=Re,X.lightTheme=$e,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})});
32
+ `})]})};qe.__docgenInfo={displayName:"DynamicTextArea",description:"动态文案文本域组件,支持流式文字动画效果",props:{texts:{name:"texts",required:!0,description:"动态展示的文案数组",type:{name:"string[]",raw:"string[]"}},placeholder:{name:"placeholder",required:!1,description:"输入框占位符",type:{name:"string",raw:"string"},defaultValue:{value:'"请输入内容"'}},animationSpeed:{name:"animationSpeed",required:!1,description:"动画速度(毫秒)",type:{name:"number",raw:"number"},defaultValue:{value:"100"}},autoPlay:{name:"autoPlay",required:!1,description:"是否自动播放动画",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},value:{name:"value",required:!1,description:"输入框值",type:{name:"string",raw:"string"}},onChange:{name:"onChange",required:!1,description:"输入框变化回调",type:{name:"function",raw:"(value: string) => void"}},onSubmit:{name:"onSubmit",required:!1,description:"提交回调",type:{name:"function",raw:"(value: string) => void"}},maxLength:{name:"maxLength",required:!1,description:"最大输入字数",type:{name:"number",raw:"number"},defaultValue:{value:"500"}},showCount:{name:"showCount",required:!1,description:"是否显示字数统计",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},submitText:{name:"submitText",required:!1,description:"提交按钮文本",type:{name:"string",raw:"string"},defaultValue:{value:'"发送"'}},disabled:{name:"disabled",required:!1,description:"是否禁用提交按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},rows:{name:"rows",required:!1,description:"文本域行数",type:{name:"number",raw:"number"},defaultValue:{value:"4"}}}};const ve=({src:t,poster:p,width:u=300,height:s,videoWidth:i,videoHeight:m,showPlayButton:k=!0,autoPlayOnHover:y=!0,onClick:e,onVideoLoaded:r,onVideoPlay:C,onVideoPause:f,onVideoEnded:N,className:n,style:A,...v})=>{const g=l.useRef(null),[x,w]=l.useState(!1),[b,S]=l.useState(!1),[T,B]=l.useState(!1),O=l.useCallback(()=>{g.current&&(g.current.play(),w(!0),C?.())},[C]),D=l.useCallback(()=>{g.current&&(g.current.pause(),w(!1),f?.())},[f]),M=l.useCallback(K=>{K.stopPropagation(),x?D():O()},[x,O,D]),X=l.useCallback(()=>{S(!0),y&&!x&&O()},[y,x,O]),G=l.useCallback(()=>{S(!1),y&&x&&D()},[y,x,D]),Y=l.useCallback(()=>{B(!0),r?.()},[r]),$=l.useCallback(()=>{w(!0),C?.()},[C]),R=l.useCallback(()=>{w(!1),f?.()},[f]),L=l.useCallback(()=>{w(!1),N?.()},[N]),J=l.useCallback(K=>{e?.(K)},[e]);return o.jsx(F.Card,{...v,className:`video-card ${n||""}`,style:{width:u,height:s,padding:0,overflow:"hidden",cursor:e?"pointer":"default",border:"none",borderRadius:0,...A},bordered:!1,onMouseEnter:X,onMouseLeave:G,onClick:J,children:o.jsxs("div",{className:"video-card-container",children:[o.jsx("video",{ref:g,src:t,poster:p,preload:"metadata",onLoadedData:Y,onPlay:$,onPause:R,onEnded:L,muted:!0,loop:!0}),k&&o.jsx("div",{className:`video-play-button ${b?"hovered":""}`,onClick:M,children:x?o.jsx(ce.PauseCircleOutlined,{className:"play-icon"}):o.jsx(ce.PlayCircleOutlined,{className:"play-icon"})}),!T&&o.jsx("div",{className:"video-loading-mask",children:o.jsx("div",{className:"loading-spinner"})})]})})};ve.__docgenInfo={displayName:"VideoCard",description:"视频卡片组件,支持鼠标悬浮播放控制",props:{src:{name:"src",required:!0,description:"视频源地址",type:{name:"string",raw:"string"}},poster:{name:"poster",required:!1,description:"视频海报图片",type:{name:"string",raw:"string"}},width:{name:"width",required:!1,description:"卡片宽度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:"300"}},height:{name:"height",required:!1,description:"卡片高度",type:{name:"number | string",raw:"number | string"}},videoWidth:{name:"videoWidth",required:!1,description:"视频宽度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:'"100%"'}},videoHeight:{name:"videoHeight",required:!1,description:"视频高度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:'"100%"'}},showPlayButton:{name:"showPlayButton",required:!1,description:"是否显示播放按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},autoPlayOnHover:{name:"autoPlayOnHover",required:!1,description:"是否自动播放(鼠标悬浮时)",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: React.MouseEvent<HTMLDivElement>) => void"}},onVideoLoaded:{name:"onVideoLoaded",required:!1,description:"视频加载完成事件",type:{name:"function",raw:"() => void"}},onVideoPlay:{name:"onVideoPlay",required:!1,description:"视频播放事件",type:{name:"function",raw:"() => void"}},onVideoPause:{name:"onVideoPause",required:!1,description:"视频暂停事件",type:{name:"function",raw:"() => void"}},onVideoEnded:{name:"onVideoEnded",required:!1,description:"视频结束事件",type:{name:"function",raw:"() => void"}},className:{name:"className",required:!1,description:"自定义样式类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}}}};const nt=t=>[".mp4",".webm",".ogg",".mov",".avi",".wmv",".flv",".mkv"].some(u=>t.toLowerCase().includes(u)),at=t=>t.type?t.type:nt(t.url)?"video":"image",Oe=({items:t,columns:p,gap:u=0,responsive:s=!0,breakpoints:i={xs:1,sm:2,md:3,lg:4,xl:5,xxl:6},className:m,style:k,onClick:y})=>{const e=l.useRef(null),[r,C]=l.useState(p||i.md||3),f=l.useRef(new Map),N=l.useCallback(()=>{if(!s||p)return p||i.md||3;const g=window.innerWidth;return g<576?i.xs||1:g<768?i.sm||2:g<992?i.md||3:g<1200?i.lg||4:g<1600?i.xl||5:i.xxl||6},[s,p,i]),n=l.useCallback(()=>{if(!e.current)return;const g=r,x=e.current,b=(x.offsetWidth-u*(g-1))/g,S=new Array(g).fill(0);t.forEach((B,O)=>{const D=B.id||O,M=f.current.get(D);if(!M)return;const X=Math.min(...S),G=S.indexOf(X),Y=G*(b+u),$=S[G];M.style.position="absolute",M.style.left=`${Y}px`,M.style.top=`${$}px`,M.style.width=`${b}px`,S[G]+=M.offsetHeight+u});const T=Math.max(...S);x.style.height=`${T}px`},[t,r,u]);l.useEffect(()=>{const g=()=>{const x=N();x!==r&&C(x)};if(s)return window.addEventListener("resize",g),g(),()=>window.removeEventListener("resize",g)},[s,N,r]),l.useEffect(()=>{const g=setTimeout(()=>{n()},100);return()=>clearTimeout(g)},[t,r,n]);const A=l.useCallback(()=>{n()},[n]),v=l.useCallback(g=>{y&&y(g),g.onClick?.(g)},[y]);return o.jsx("div",{ref:e,className:`waterfall-container ${m||""}`,style:{position:"relative",width:"100%",...k},children:t.map((g,x)=>{const w=g.id||x,b=at(g);return o.jsx("div",{ref:S=>{S?f.current.set(w,S):f.current.delete(w)},className:"waterfall-item",children:b==="video"?o.jsx("div",{style:{width:"100%",position:"relative",paddingBottom:"56.25%",cursor:y||g.onClick?"pointer":"default"},children:o.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},children:o.jsx(ve,{src:g.url,poster:g.poster,width:"100%",height:"100%",onClick:()=>v(g),onVideoLoaded:A,autoPlayOnHover:!0,showPlayButton:!1})})}):o.jsx("div",{className:"waterfall-image-wrapper",onClick:()=>v(g),style:{cursor:y||g.onClick?"pointer":"default"},children:o.jsx("img",{src:g.url,alt:`瀑布流图片 ${x+1}`,className:"waterfall-image",onLoad:A,onError:A,style:{display:"block",width:"100%",height:"auto"}})})},w)})})};Oe.__docgenInfo={displayName:"Waterfall",description:"瀑布流布局组件,支持图片和视频混合展示",props:{items:{name:"items",required:!0,description:"媒体资源数组",type:{name:"WaterfallItem[]",raw:"WaterfallItem[]"}},columns:{name:"columns",required:!1,description:"列数(默认会根据屏幕宽度自动响应)",type:{name:"number",raw:"number"}},gap:{name:"gap",required:!1,description:"间隔大小",type:{name:"number",raw:"number"},defaultValue:{value:"0"}},responsive:{name:"responsive",required:!1,description:"是否启用响应式布局",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},breakpoints:{name:"breakpoints",required:!1,description:"响应式断点配置",type:{name:"object",raw:"{ xs?: number; sm?: number; md?: number; lg?: number; xl?: number; xxl?: number; }"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}},onClick:{name:"onClick",required:!1,description:"点击回调",type:{name:"function",raw:"(item: any) => void"}}}};const rt={algorithm:F.theme.defaultAlgorithm,token:{colorPrimary:"#3b82f6",colorSuccess:"#10b981",colorWarning:"#f59e0b",colorError:"#ef4444",colorInfo:"#3b82f6",colorBgBase:"#ffffff",colorBgContainer:"#ffffff",colorBgElevated:"#ffffff",colorBgLayout:"#f8fafc",colorTextBase:"#1e293b",colorText:"#1e293b",colorTextSecondary:"#64748b",colorTextTertiary:"#94a3b8",colorTextQuaternary:"#cbd5e1",colorBorder:"#e2e8f0",colorBorderSecondary:"#f1f5f9",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",boxShadowSecondary:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",borderRadius:8,borderRadiusLG:12,borderRadiusSM:6,fontFamily:"Inter, system-ui, Arial, sans-serif",fontSize:14,fontSizeLG:16,fontSizeSM:12,padding:16,paddingLG:24,paddingSM:12,paddingXS:8,controlHeight:32,controlHeightLG:40,controlHeightSM:24},components:{Button:{borderRadius:8,controlHeight:32,fontWeight:500},Card:{borderRadiusLG:12,boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"},Input:{borderRadius:8,controlHeight:32},Table:{borderRadiusLG:8,headerBg:"#f8fafc",headerColor:"#374151"}}};H.AdvancedTable=Ie,H.AppModal=Ne,H.BackButton=je,H.Button=Te,H.Card=Ce,H.DynamicInput=Be,H.DynamicTextArea=qe,H.EmptyAndSpin=Re,H.LinkButton=_e,H.PageTable=Se,H.RichTextEditor=Le,H.VideoCard=ve,H.VirtualTable=Pe,H.Waterfall=Oe,H.XcIcon=Ae,H.lightTheme=rt,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});
33
33
  //# sourceMappingURL=index.umd.js.map