bi-components-library 1.0.10 → 1.0.11

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(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={};/**
1
+ (function(J,n){typeof exports=="object"&&typeof module<"u"?n(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"],n):(J=typeof globalThis<"u"?globalThis:J||self,n(J.SealSeekBIComponents={},J.React,J.antd,J.AntdIcons,J.ReactDOM))})(this,function(J,n,G,pe,He){"use strict";var ve={exports:{}},he={};/**
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 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={};/**
9
+ */var Ne;function Ue(){if(Ne)return he;Ne=1;var t=Symbol.for("react.transitional.element"),f=Symbol.for("react.fragment");function s(r,o,y){var S=null;if(y!==void 0&&(S=""+y),o.key!==void 0&&(S=""+o.key),"key"in o){y={};for(var h in o)h!=="key"&&(y[h]=o[h])}else y=o;return o=y.ref,{$$typeof:t,type:r,key:S,ref:o!==void 0?o:null,props:y}}return he.Fragment=f,he.jsx=s,he.jsxs=s,he}var be={};/**
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 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:
17
+ */var Se;function Xe(){return Se||(Se=1,process.env.NODE_ENV!=="production"&&function(){function t(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===U?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case C:return"Fragment";case w:return"Profiler";case u:return"StrictMode";case V:return"Suspense";case R:return"SuspenseList";case q:return"Activity"}if(typeof l=="object")switch(typeof l.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),l.$$typeof){case c:return"Portal";case A:return(l.displayName||"Context")+".Provider";case E:return(l._context.displayName||"Context")+".Consumer";case b:var P=l.render;return l=l.displayName,l||(l=P.displayName||P.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case B:return P=l.displayName||null,P!==null?P:t(l.type)||"Memo";case F:P=l._payload,l=l._init;try{return t(l(P))}catch{}}return null}function f(l){return""+l}function s(l){try{f(l);var P=!1}catch{P=!0}if(P){P=console;var Y=P.error,ee=typeof Symbol=="function"&&Symbol.toStringTag&&l[Symbol.toStringTag]||l.constructor.name||"Object";return Y.call(P,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",ee),f(l)}}function r(l){if(l===C)return"<>";if(typeof l=="object"&&l!==null&&l.$$typeof===F)return"<...>";try{var P=t(l);return P?"<"+P+">":"<...>"}catch{return"<...>"}}function o(){var l=W.A;return l===null?null:l.getOwner()}function y(){return Error("react-stack-top-frame")}function S(l){if(X.call(l,"key")){var P=Object.getOwnPropertyDescriptor(l,"key").get;if(P&&P.isReactWarning)return!1}return l.key!==void 0}function h(l,P){function Y(){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)",P))}Y.isReactWarning=!0,Object.defineProperty(l,"key",{get:Y,configurable:!0})}function i(){var l=t(this.type);return K[l]||(K[l]=!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.")),l=this.props.ref,l!==void 0?l:null}function e(l,P,Y,ee,ce,ne,ye,D){return Y=ne.ref,l={$$typeof:p,type:l,key:P,props:ne,_owner:ce},(Y!==void 0?Y:null)!==null?Object.defineProperty(l,"ref",{enumerable:!1,get:i}):Object.defineProperty(l,"ref",{enumerable:!1,value:null}),l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(l,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(l,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ye}),Object.defineProperty(l,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:D}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}function x(l,P,Y,ee,ce,ne,ye,D){var z=P.children;if(z!==void 0)if(ee)if($(z)){for(ee=0;ee<z.length;ee++)d(z[ee]);Object.freeze&&Object.freeze(z)}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 d(z);if(X.call(P,"key")){z=t(l);var ae=Object.keys(P).filter(function(Te){return Te!=="key"});ee=0<ae.length?"{key: someKey, "+ae.join(": ..., ")+": ...}":"{key: someKey}",ue[z+ee]||(ae=0<ae.length?"{"+ae.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,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:`
22
+ <%s key={someKey} {...props} />`,ee,z,ae,z),ue[z+ee]=!0)}if(z=null,Y!==void 0&&(s(Y),z=""+Y),S(P)&&(s(P.key),z=""+P.key),"key"in P){Y={};for(var fe in P)fe!=="key"&&(Y[fe]=P[fe])}else Y=P;return z&&h(Y,typeof l=="function"?l.displayName||l.name||"Unknown":l),e(l,z,ne,ce,o(),Y,ye,D)}function d(l){typeof l=="object"&&l!==null&&l.$$typeof===p&&l._store&&(l._store.validated=1)}var N=n,p=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),A=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),U=Symbol.for("react.client.reference"),W=N.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=Object.prototype.hasOwnProperty,$=Array.isArray,T=console.createTask?console.createTask:function(){return null};N={react_stack_bottom_frame:function(l){return l()}};var L,K={},Z=N.react_stack_bottom_frame.bind(N,y)(),le=T(r(y)),ue={};be.Fragment=C,be.jsx=function(l,P,Y,ee,ce){var ne=1e4>W.recentlyCreatedOwnerStacks++;return x(l,P,Y,!1,ee,ce,ne?Error("react-stack-top-frame"):Z,ne?T(r(l)):le)},be.jsxs=function(l,P,Y,ee,ce){var ne=1e4>W.recentlyCreatedOwnerStacks++;return x(l,P,Y,!0,ee,ce,ne?Error("react-stack-top-frame"):Z,ne?T(r(l)):le)}}()),be}var Ae;function Ye(){return Ae||(Ae=1,process.env.NODE_ENV==="production"?ve.exports=Ue():ve.exports=Xe()),ve.exports}var a=Ye();const Re=({variant:t="primary",loading:f=!1,children:s,...r})=>{const o=y=>{switch(y){case"primary":return"primary";case"ghost":return"default";case"dashed":return"dashed";case"link":return"link";case"text":return"text";default:return"primary"}};return a.jsx(G.Button,{...r,type:o(t),loading:f,ghost:t==="ghost",children:s})};Re.__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 je=({title:t,children:f,bordered:s=!0,hoverable:r=!1,size:o="default",...y})=>a.jsx(G.Card,{...y,title:t,bordered:s,hoverable:r,size:o,children:f});je.__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 _e=({showDefaultFooter:t=!0,...f})=>{const s=f.footer!==void 0?f.footer:t?(r,{OkBtn:o,CancelBtn:y})=>a.jsxs(a.Fragment,{children:[a.jsx(o,{}),a.jsx(y,{})]}):null;return a.jsx(G.Modal,{...f,footer:s})};_e.__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 Ie=({scrollX:t,showPagination:f=!0,defaultPageSize:s=10,...r})=>a.jsx(G.Table,{...r,scroll:{x:t||"max-content",y:"50vh"},pagination:f?{hideOnSinglePage:!0,showSizeChanger:!0,showQuickJumper:!0,defaultPageSize:s,...r.pagination}:!1});Ie.__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 Je=pe.createFromIconfontCN({scriptUrl:["https://at.alicdn.com/t/c/font_4968458_eh91gfr4j9e.js"]}),Le=({name:t,size:f,color:s,style:r,...o})=>{const y={fontSize:f,color:s,...r};return a.jsx(Je,{...o,type:t,style:y})};Le.__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 Ve=({loading:t,description:f="暂无数据",className:s,emptyChildren:r,loadingText:o,emptyImage:y})=>t?a.jsxs(G.Flex,{className:`pt-10 w-full ${s||""}`,align:"center",justify:"center",vertical:!0,children:[a.jsx(G.Spin,{size:"large"}),o&&a.jsx("div",{className:"mt-4 text-gray-500",children:o})]}):a.jsx(G.Flex,{className:`pt-10 w-full ${s||""}`,align:"center",justify:"center",children:a.jsx(G.Empty,{image:y,description:f,imageStyle:{height:180},children:r})});Ve.__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 Pe=({onClick:t,showText:f=!1,className:s,size:r="small",type:o="default"})=>a.jsx(G.Button,{size:r,type:o,icon:a.jsx(pe.LeftOutlined,{}),className:`cursor-pointer ${s||""}`,onClick:t,children:f&&"返回"});Pe.__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 Be=({removePadding:t=!0,className:f,...s})=>{const r=t?`px-0 h-auto ${f||""}`:f;return a.jsx(G.Button,{type:"link",...s,className:r,children:s.children})};Be.__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:Ke}=G.Select,Oe=({columns:t,request:f,searchFields:s=[],showSearch:r=!0,showRefresh:o=!0,defaultPageSize:y=10,pageSizeOptions:S=["10","20","50","100"],autoLoad:h=!0,externalParams:i={},...e})=>{const[x,d]=n.useState([]),[N,p]=n.useState(!1),[c,C]=n.useState({current:1,pageSize:y,total:0}),[u,w]=n.useState({}),[E,A]=n.useState({}),[b]=G.Form.useForm(),V=n.useRef(c);V.current=c;const R=n.useRef(i);R.current=i;const B=n.useRef(!1),F=n.useMemo(()=>t.map(T=>{const{sortable:L,render:K,...Z}=T;return{...Z,sorter:L?!0:void 0,render:K||(le=>le)}}),[t]),q=n.useCallback(async(T={})=>{if(f){p(!0);try{const L={page:V.current.current,pageSize:V.current.pageSize,sortField:E.field,sortOrder:E.order,searchParams:{...u,...R.current},...T},K=await f(L);K.success&&(d(K.data),C(Z=>({...Z,total:K.total,current:L.page||Z.current})))}catch(L){console.error("加载数据失败:",L)}finally{p(!1)}}},[f,E,u]),U=n.useCallback(T=>{w(T),C(L=>({...L,current:1}))},[]),W=n.useCallback(()=>{b.resetFields(),w({}),C(T=>({...T,current:1}))},[b]),X=n.useCallback(()=>{q()},[q]),$=n.useCallback((T,L,K)=>{const Z={current:T.current||1,pageSize:T.pageSize||y,total:T.total||0},le={field:K?.field,order:K?.order};C(Z),A(le)},[y]);return n.useEffect(()=>{const T=Object.keys(i).length>0;(h&&!B.current||T)&&(q(),B.current=!0)},[h,i,q]),a.jsxs("div",{children:[r&&s.length>0&&a.jsx(G.Card,{size:"small",style:{marginBottom:16},children:a.jsxs(G.Form,{form:b,layout:"inline",onFinish:U,initialValues:s.reduce((T,L)=>(L.defaultValue!==void 0&&(T[L.key]=L.defaultValue),T),{}),children:[s.map(T=>a.jsx(G.Form.Item,{name:T.key,label:T.label,children:T.type==="input"?a.jsx(G.Input,{placeholder:T.placeholder||`请输入${T.label}`,style:{width:200}}):a.jsx(G.Select,{placeholder:T.placeholder||`请选择${T.label}`,style:{width:200},allowClear:!0,children:T.options?.map(L=>a.jsx(Ke,{value:L.value,children:L.label},L.value))})},T.key)),a.jsx(G.Form.Item,{children:a.jsxs(G.Space,{children:[a.jsx(G.Button,{type:"primary",htmlType:"submit",icon:a.jsx(pe.SearchOutlined,{}),children:"查询"}),a.jsx(G.Button,{onClick:W,children:"重置"}),o&&a.jsx(G.Button,{icon:a.jsx(pe.ReloadOutlined,{}),onClick:X,children:"刷新"})]})})]})}),a.jsx(G.Table,{...e,columns:F,dataSource:x,loading:N,pagination:{...c,showSizeChanger:!0,showQuickJumper:!0,showTotal:(T,L)=>`第 ${L[0]}-${L[1]} 条/共 ${T} 条`,pageSizeOptions:S},onChange:$,scroll:{x:"max-content",y:"50vh"}})]})};Oe.__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 xe(t,f,s){if(!t.current)return;const r=new Set,o={};for(const d of f)d.exclusionGroup&&d.exclusionGroup!=="separator"&&(r.add(d.exclusionGroup),o[d.exclusionGroup]||(o[d.exclusionGroup]=[]),o[d.exclusionGroup].push({type:d.type,key:d.key,exclusionGroup:d.exclusionGroup}));const y={};for(const d of r){y[d]=!1;for(const N of o[d])if(N.type==="upload"&&N.key){if(s[N.key]!==null&&s[N.key]!==void 0){y[d]=!0;break}}else if(N.type==="variable"&&N.key){const p=t.current.querySelector(`[data-type="variable"][data-key="${N.key}"]`);if(p&&p.innerText.replace(/[\u200B\n]/g,"").trim().length>0){y[d]=!0;break}}}const S=f.some(d=>d.exclusionGroup==="separator"),i=Object.keys(y).filter(d=>y[d]).length>0;let e=null;if(i&&S){for(const d of f)if(d.exclusionGroup&&d.exclusionGroup!=="separator"&&y[d.exclusionGroup]){e=d.exclusionGroup;break}}for(const d of r){const N=t.current.querySelectorAll(`[data-group="${d}"]`);S&&i&&e?d===e?N.forEach(p=>{p.classList.contains("required-upload-group")?p.style.setProperty("display","inline-flex","important"):(p.classList.contains("exclusion-wrapper"),p.style.setProperty("display","inline-block","important"))}):N.forEach(p=>{p.style.display="none",p.style.setProperty("display","none","important")}):N.forEach(p=>{p.classList.contains("required-upload-group")?p.style.setProperty("display","inline-flex","important"):(p.classList.contains("exclusion-wrapper"),p.style.setProperty("display","inline-block","important"))})}t.current.querySelectorAll('[data-group="separator"]').forEach(d=>{d.style.display=i?"none":"inline"})}function we(t,f,s,r){if(!t.current){r(!1);return}const o=[];for(let i=0;i<f.length;i++){const e=f[i];if((e.type==="variable"||e.type==="upload"||e.type==="multi-variable")&&e.required&&e.key){o.push({exclusionGroup:e.exclusionGroup||"",key:e.key,type:e.type==="multi-variable"?"variable":e.type,isMultiVariable:e.type==="multi-variable"});continue}if(e.type==="text"&&e.className?.includes("rte-text-required")&&e.exclusionGroup)for(let x=i+1;x<f.length;x++){const d=f[x];if(d.exclusionGroup===e.exclusionGroup&&(d.type==="variable"||d.type==="upload")&&d.key){o.push({exclusionGroup:e.exclusionGroup,key:d.key,type:d.type});break}}}const y=f.some(i=>i.exclusionGroup==="separator");let S=!1;if(y&&o.length>1){const i=f.findIndex(d=>d.exclusionGroup==="separator"),e=o.filter(d=>f.findIndex(p=>(p.type==="variable"||p.type==="upload")&&p.key===d.key&&p.exclusionGroup===d.exclusionGroup)<i),x=o.filter(d=>f.findIndex(p=>(p.type==="variable"||p.type==="upload")&&p.key===d.key&&p.exclusionGroup===d.exclusionGroup)>i);S=e.length>0&&x.length>0}if(o.length===0){if(f.length===0){if(!t.current){r(!1);return}const i=t.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";r(i.length>0);return}r(!0);return}const h=o.filter(i=>{if(!t.current)return!1;const e=t.current.querySelectorAll(`[data-group="${i.exclusionGroup}"]`);return e.length===0?!1:e[0].style.display!=="none"});if(h.length===0){r(!0);return}if(S){let i=!1;for(const e of h)if(e.type==="upload"&&e.key){if(s[e.key]!==null&&s[e.key]!==void 0){i=!0;break}}else if(e.type==="variable"&&e.key)if(e.isMultiVariable){const x=t.current.querySelectorAll(`[data-type="variable"][data-multi-key="${e.key}"]`);let d=!1;for(const N of Array.from(x))if(N.innerText.replace(/[\u200B\n]/g,"").trim().length>0){d=!0;break}if(d){i=!0;break}}else{const x=t.current.querySelector(`[data-type="variable"][data-key="${e.key}"]`);if(x&&x.innerText.replace(/[\u200B\n]/g,"").trim().length>0){i=!0;break}}r(i)}else{let i=!0;for(const e of h)if(e.type==="upload"&&e.key){if(s[e.key]===null||s[e.key]===void 0){i=!1;break}}else if(e.type==="variable"&&e.key)if(e.isMultiVariable){const x=t.current.querySelectorAll(`[data-type="variable"][data-multi-key="${e.key}"]`);let d=!1;for(const N of Array.from(x))if(N.innerText.replace(/[\u200B\n]/g,"").trim().length>0){d=!0;break}if(!d){i=!1;break}}else{const x=t.current.querySelector(`[data-type="variable"][data-key="${e.key}"]`);if(!x){i=!1;break}if(x.innerText.replace(/[\u200B\n]/g,"").trim().length===0){i=!1;break}}r(i)}}function Ee(t,f){if(!t.current)return;t.current.querySelectorAll('[data-type="variable"]').forEach(r=>{const o=r.innerText.replace(/\n/g,"");o.replace(/\u200B/g,"")?r.classList.remove("show-placeholder"):(o!=="​"&&(r.innerText="​"),r.classList.add("show-placeholder"))})}function Qe(t,f,s,r,o,y={},S){if(!t.current)return;let h="",i=0;for(;i<f.length;){const e=f[i],x=i+1<f.length?f[i+1]:null;if(e.type==="text"&&(e.text?.includes("icon-bitian")||e.className==="rte-text-required")&&x){const u=x.type==="upload"&&x.exclusionGroup==="fileInput"&&e.exclusionGroup==="fileInput"&&e.exclusionGroup===x.exclusionGroup,w=x.type==="variable"&&x.exclusionGroup==="textInput"&&e.exclusionGroup==="textInput"&&e.exclusionGroup===x.exclusionGroup;if(u){const A=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group">`,b="</span>";let V="";e.className?V=`<span class="${e.className}">${e.text??""}</span>`:V=e.text??"";const R=x,B=s[R.key]!==null&&s[R.key]!==void 0,F=B?s[R.key]?.name:R.text,q=B?"":"hidden",U=R.tooltip&&!B?"":"hidden",W=B?"has-file":"",X=B&&F?` data-file-name="${F.replace(/"/g,"&quot;")}"`:"",$=`<span contenteditable="false" data-type="upload" data-key="${R.key}" class="upload-chip"><span class="upload-inner-wrapper ${W}"><span class="upload-icon">${B?"<i class='iconfont icon-exlwenjian'></i>":"<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${X}>${F||R.text}</span>${R.tooltip?`<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${U}" data-upload-key="${R.key}" data-tooltip="${R.tooltip}" title="提示"></i>`:""}<span class="file-remove-btn ${q}" title="移除文件">×</span></span></span>`;h+=A+V+$+b,i+=2;continue}if(w){const A=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group">`,b="</span>";let V="";e.className?V=`<span class="${e.className}">${e.text??""}</span>`:V=e.text??"";const R=x,F=(R.key?o[R.key]:void 0)||R.text||"",q=!F,U=q?"​":F,W=q?"show-placeholder":"",X=R.exclusionGroup?` data-group="${R.exclusionGroup}"`:"",$=R.tooltip?` data-tooltip="${R.tooltip.replace(/"/g,"&quot;")}" data-variable-key="${R.key||""}"`:"",T=R.tooltip&&q?"":"hidden",L=`<span contenteditable="true" data-type="variable" data-key="${R.key}" data-placeholder="${R.placeholder||""}"${X}${$} class="variable-chip ${W}">${U}${R.tooltip?`<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${T}" data-variable-key="${R.key}" data-tooltip="${R.tooltip.replace(/"/g,"&quot;")}" title="提示"></i>`:""}</span>`;h+=A+V+L+b,i+=2;continue}}const N=e.exclusionGroup?`data-group="${e.exclusionGroup}"`:"",p=e.exclusionGroup?`<span ${N} class="exclusion-wrapper">`:"",c=e.exclusionGroup?"</span>":"";let C="";if(e.type==="tag"){const w=r||S==="hideTagClose"?"":'<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>',E=r?' data-locked="true"':"",A=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" data-tag-key="${e.key||""}"`:"";C=`<span contenteditable="false" class="tag-node group"${E}${A}><span class="tag-label">${e.text}</span>${w}</span>`}else if(e.type==="text"){const u=r?' data-locked="true" contenteditable="false"':' contenteditable="false"';e.className?C=`<span class="${e.className}"${u}>${e.text??""}</span>`:C=r?`<span${u}>${e.text??""}</span>`:`<span contenteditable="false">${e.text??""}</span>`}else if(e.type==="variable"&&e.key){const w=o[e.key]||e.text||"",E=!w,A=E?"​":w,b=E?"show-placeholder":"",V=e.exclusionGroup?` data-group="${e.exclusionGroup}"`:"",R=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" data-variable-key="${e.key||""}"`:"",B=e.tooltip&&E?"":"hidden",F=`<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder||""}"${V}${R} class="variable-chip ${b}">${A}${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?C=`<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>${F}</span>`:C=F}else if(e.type==="upload"&&e.key){const u=s[e.key]!==null&&s[e.key]!==void 0,w=u?s[e.key]?.name:e.text,E=u?"":"hidden",A=e.tooltip&&!u?"":"hidden",b=u?"has-file":"",V=u&&w?` data-file-name="${w.replace(/"/g,"&quot;")}"`:"",R=`<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${b}"><span class="upload-icon">${u?"<i class='iconfont icon-exlwenjian'></i>":"<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${V}>${w||e.text}</span>${e.tooltip?`<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${A}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" title="提示"></i>`:""}<span class="file-remove-btn ${E}" title="移除文件">×</span></span></span>`;e.required?C=`<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>${R}</span>`:C=R}else if(e.type==="multi-variable"&&e.key){const u=e.maxCount||9,w=y[e.key]||1,E=Math.min(w,u);let A="";for(let b=0;b<E;b++){const V=`${e.key}_${b}`,R=o[V]||"",B=!R,F=B?"​":R,q=B?"show-placeholder":"",U=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" data-variable-key="${e.key||""}"`:"",W=e.tooltip&&B?"":"hidden",X=`<span contenteditable="true" data-type="variable" data-key="${V}" data-multi-key="${e.key}" data-index="${b}" data-placeholder="${e.placeholder||""}"${U} class="variable-chip ${q}">${F}${e.tooltip?`<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${W}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" title="提示"></i>`:""}</span>`;A+=X}e.required?C=`<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>${A}</span>`:C=A}h+=p+C+c,i++}t.current&&(t.current.innerHTML=h,setTimeout(()=>{if(!t.current)return;t.current.querySelectorAll('[data-type="variable"]').forEach(x=>{const d=x.innerText.replace(/\n/g,"");d.replace(/\u200B/g,"")?x.classList.remove("show-placeholder"):(d!=="​"&&(x.innerText="​"),x.classList.add("show-placeholder"))})},0))}function Ze(t,f,s,r,o={},y,S,h){const i=n.useCallback(()=>{if(!t.current)return;if(f.length===0){t.current.innerHTML="";return}let e={};const d=t.current.__tempVariableValues;if(d?(e=d,setTimeout(()=>{if(t.current){const N=t.current;N.__tempVariableValues===d&&delete N.__tempVariableValues}},100)):t.current.querySelectorAll('[data-type="variable"]').forEach(p=>{const c=p.dataset.key;if(c){const C=p.innerText.replace(/[\u200B\n]/g,"").trim();C&&(e[c]=C)}}),Qe(t,f,s,r,e,o,h),y?.current){const{key:N,offset:p}=y.current;setTimeout(()=>{if(!t.current)return;const c=t.current.querySelector(`[data-type="variable"][data-key="${N}"]`);if(c){try{const C=document.createRange(),u=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let w=0,E=null,A=0;for(;u.nextNode();){const b=u.currentNode,V=b.textContent?.length||0;if(w+V>=p){E=b,A=p-w;break}w+=V}if(E){C.setStart(E,Math.min(A,E.textContent?.length||0)),C.collapse(!0);const b=window.getSelection();b&&(b.removeAllRanges(),b.addRange(C),c.focus())}else{C.selectNodeContents(c),C.collapse(!1);const b=window.getSelection();b&&(b.removeAllRanges(),b.addRange(C),c.focus())}}catch{const C=document.createRange();C.selectNodeContents(c),C.collapse(!1);const u=window.getSelection();u&&(u.removeAllRanges(),u.addRange(C),c.focus())}y.current=null}},0)}},[f,s,r,t,o,y,S,h]);n.useEffect(()=>{i()},[i])}function $e(t,f,s,r){n.useEffect(()=>{const o=t.current;if(!o)return;const y=h=>{const i=h.target?.closest(".upload-info-icon");if(i&&i.classList.contains("upload-info-icon")){const e=i.dataset.uploadKey;e&&r({key:e,anchorEl:i,type:"upload"})}},S=h=>{const i=h.target?.closest(".upload-info-icon"),e=h.relatedTarget;i&&i.classList.contains("upload-info-icon")&&(!e||!o.contains(e)?r(null):e.closest(".upload-info-icon")||r(null))};return o.addEventListener("mouseover",y,!0),o.addEventListener("mouseout",S,!0),()=>{o.removeEventListener("mouseover",y,!0),o.removeEventListener("mouseout",S,!0)}},[f,s,t,r])}function et(t,f,s,r){n.useEffect(()=>{if(!t.current)return;const o=i=>{if(r==="hideTagClose")return;const e=i.currentTarget,x=e.dataset.tooltip,d=e.dataset.tagKey||"";x&&s({key:d,anchorEl:e,type:"tag"})},y=()=>{s(null)};let S;const h=()=>{if(!t.current)return;t.current.querySelectorAll(".tag-node[data-tooltip]").forEach(e=>{e.addEventListener("mouseenter",o),e.addEventListener("mouseleave",y)})};return S=requestAnimationFrame(()=>{S=requestAnimationFrame(h)}),()=>{cancelAnimationFrame(S),t.current&&t.current.querySelectorAll(".tag-node[data-tooltip]").forEach(e=>{e.removeEventListener("mouseenter",o),e.removeEventListener("mouseleave",y)})}},[f,t,s,r])}function tt(t,f,s){n.useEffect(()=>{const r=t.current;if(!r)return;const o=S=>{const h=S.target?.closest(".variable-info-icon");if(h&&h.classList.contains("variable-info-icon")){const i=h.dataset.variableKey;i&&s({key:i,anchorEl:h,type:"variable"})}},y=S=>{const h=S.target?.closest(".variable-info-icon"),i=S.relatedTarget;h&&h.classList.contains("variable-info-icon")&&(!i||!r.contains(i)?s(null):i.closest(".variable-info-icon")||s(null))};return r.addEventListener("mouseover",o,!0),r.addEventListener("mouseout",y,!0),()=>{r.removeEventListener("mouseover",o,!0),r.removeEventListener("mouseout",y,!0)}},[f,t,s])}function nt(t,f,s,r){n.useEffect(()=>{if(!t.current)return;const o=i=>{const e=i.currentTarget;e.dataset.fileName&&r({key:"",anchorEl:e,type:"upload-label"})},y=()=>{r(null)};let S;const h=()=>{if(!t.current)return;t.current.querySelectorAll(".upload-label[data-file-name]").forEach(e=>{e.addEventListener("mouseenter",o),e.addEventListener("mouseleave",y)})};return S=requestAnimationFrame(()=>{S=requestAnimationFrame(h)}),()=>{cancelAnimationFrame(S),t.current&&t.current.querySelectorAll(".upload-label[data-file-name]").forEach(e=>{e.removeEventListener("mouseenter",o),e.removeEventListener("mouseleave",y)})}},[f,s,t,r])}function at(t,f,s,r){n.useEffect(()=>{xe(t,f,s),we(t,f,s,r)},[s,f,t,r])}function rt(t,f){n.useEffect(()=>{if(!t.current)return;let s=!1,r=0;const o=()=>{s=!0},y=()=>{s=!1,r=Date.now()};let S=!1,h=0;const i=()=>{S=!0},e=()=>{S=!1,h=Date.now()},x=()=>{h=Date.now()},d=()=>{if(!t.current)return;const p=window.getSelection();if(!p||p.rangeCount===0||f.current||s||S||Date.now()-h<500)return;const c=p.getRangeAt(0);if(!c.collapsed){t.current.contains(c.commonAncestorContainer)||p.removeAllRanges();return}const C=p.anchorNode;if(!C)return;if(!t.current.contains(C)){p.removeAllRanges();return}let u=null;if(C.nodeType===Node.ELEMENT_NODE?u=C.closest('[data-type="variable"]'):C.nodeType===Node.TEXT_NODE&&C.parentElement&&(u=C.parentElement.closest('[data-type="variable"]')),!u){if(Date.now()-r>500)return;const w=t.current.querySelectorAll('[data-type="variable"]');if(w.length>0){let E=null;for(const A of Array.from(w))if(A.style.display!=="none"){E=A;break}if(!E&&w.length>0&&(E=w[0]),E){const A=document.createRange();A.selectNodeContents(E),A.collapse(!1),p.removeAllRanges(),p.addRange(A),E.focus()}else p.removeAllRanges()}else p.removeAllRanges()}},N=t.current;return N&&(N.addEventListener("compositionstart",i),N.addEventListener("compositionend",e),N.addEventListener("input",x)),document.addEventListener("mousedown",o),document.addEventListener("mouseup",y),document.addEventListener("selectionchange",d),()=>{const p=t.current;p&&(p.removeEventListener("compositionstart",i),p.removeEventListener("compositionend",e),p.removeEventListener("input",x)),document.removeEventListener("mousedown",o),document.removeEventListener("mouseup",y),document.removeEventListener("selectionchange",d)}},[t,f])}const qe=({config:t,onSend:f,isProcessing:s=!1,disabled:r=!1,width:o,lockStructure:y=!1,agentOptions:S=[],onAgentSelect:h,onAgentExit:i,loading:e=!1,placeholder:x,border:d,background:N="transparent",hideButtons:p})=>{const c=n.useRef(null),C=n.useRef(null),[u,w]=n.useState({}),[E,A]=n.useState(null),[b,V]=n.useState(null),R=n.useRef(!1),B=n.useRef(null),[F,q]=n.useState(!1),U=n.useRef(null),[W,X]=n.useState(!0),[$,T]=n.useState(()=>{const m={};return t.forEach(g=>{g.type==="multi-variable"&&g.key&&(m[g.key]=1)}),m}),L=n.useRef({}),K=n.useRef({}),Z=n.useRef({});n.useEffect(()=>{K.current=u},[u]),n.useEffect(()=>{Z.current=$},[$]);const le=n.useCallback(m=>m.find(v=>v.type==="tag")?.text||null,[]),ue=n.useRef(t),l=n.useRef(null);n.useEffect(()=>{const m=le(ue.current),g=le(t);if(m&&m!==g&&c.current){const v={};c.current.querySelectorAll('[data-type="variable"]').forEach(k=>{const j=k.dataset.key;if(j){const _=k.innerText.replace(/[\u200B\n]/g,"").trim();_&&(v[j]=_)}}),L.current[m]={variableValues:v,files:{...K.current},multiVariableCounts:{...Z.current}}}if(g&&L.current[g]){const v=L.current[g];l.current=v,w(v.files),T(v.multiVariableCounts)}else if(g){l.current=null;const v={};t.forEach(I=>{I.type==="multi-variable"&&I.key&&(v[I.key]=1)}),T(v),w({})}else l.current=null,T({}),w({});ue.current=t},[t,le]),n.useLayoutEffect(()=>{l.current&&c.current&&(c.current.__tempVariableValues=l.current.variableValues,setTimeout(()=>{l.current&&(l.current=null)},0))}),Ze(c,t,u,y,$,U,void 0,p),$e(c,t,u,V),et(c,t,V,p),nt(c,t,u,V),tt(c,t,V),at(c,t,u,q),rt(c,R),n.useEffect(()=>{if(t.length>0){X(!1);return}const m=()=>{if(!c.current){X(!0);return}const v=c.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"",I=c.current.querySelectorAll('[data-type="variable"]'),k=c.current.querySelectorAll('[data-type="upload"]');let j=!1;I.forEach(M=>{(M.textContent?.replace(/[\u200B\n]/g,"").trim()||"")&&(j=!0)}),k.forEach(M=>{M.querySelector(".upload-inner-wrapper.has-file")&&(j=!0)});const _=!v&&!j;X(_),t.length===0&&q(!_)};m();const g=new MutationObserver(m);return c.current&&g.observe(c.current,{childList:!0,subtree:!0,characterData:!0}),()=>{g.disconnect()}},[t]);const P=m=>{if(r){m.preventDefault();return}m.preventDefault();const g=m.clipboardData.getData("text/plain"),v=window.getSelection();if(v&&v.rangeCount>0){const I=v.anchorNode;if(I){let k=null;if(I.nodeType===Node.ELEMENT_NODE?k=I.closest('[data-type="variable"]'):I.nodeType===Node.TEXT_NODE&&I.parentElement&&(k=I.parentElement.closest('[data-type="variable"]')),k){const j=k.dataset.multiKey;if(j){const _=g.split(/[,\n\r\t]+/).map(M=>M.trim()).filter(M=>M.length>0);if(_.length>1){const M=parseInt(k.dataset.index||"0",10),O=t.find(oe=>oe.type==="multi-variable"&&oe.key===j)?.maxCount||9,H=$[j]||1,re=Math.min(M+_.length,O);re>H&&T(te=>({...te,[j]:re})),setTimeout(()=>{c.current&&(_.forEach((te,oe)=>{const ie=M+oe;if(ie>=O)return;const Q=`${j}_${ie}`,se=c.current.querySelector(`[data-type="variable"][data-key="${Q}"]`);se&&(se.innerText=te,se.classList.remove("show-placeholder"))}),ae())},0);return}}}}}document.execCommand("insertText",!1,g),ae()},Y=m=>{if(m.target.files&&m.target.files[0]&&E){const g=m.target.files[0],v=E;w(I=>({...I,[v]:g}))}m.target&&(m.target.value=""),A(null)},ee=m=>{w(g=>{const v={...g};return delete v[m],v})},ce=m=>{const g=m.target;if(g.closest(".tag-close-btn")){if(m.preventDefault(),m.stopPropagation(),y)return;V(null),i?i():c.current&&(c.current.innerHTML="",c.current.focus());return}if(y){const k=g.closest(".tag-node"),j=g.closest('[data-type="text"]');if(k||j){m.preventDefault(),m.stopPropagation();const _=window.getSelection();_&&_.removeAllRanges();return}}g.closest('[data-type="variable"]')||(B.current={x:m.clientX,y:m.clientY},R.current=!1,g.closest(".file-remove-btn")&&(m.preventDefault(),m.stopPropagation()))},ne=m=>{if(!m.target.closest('[data-type="variable"]')&&B.current){const I=Math.abs(m.clientX-B.current.x),k=Math.abs(m.clientY-B.current.y);(I>3||k>3)&&(R.current=!0)}},ye=m=>{if(m.target.closest('[data-type="variable"]')){B.current=null,R.current=!1;return}B.current=null,R.current=!1},D=m=>{if(r)return;const g=m.target;if(g.closest(".tag-close-btn")){m.preventDefault(),m.stopPropagation();return}if(t.length===0)return;if(g.closest('[data-type="text"]')){m.preventDefault(),m.stopPropagation();const M=window.getSelection();M&&M.removeAllRanges();return}if(y&&g.closest(".tag-node")){m.preventDefault(),m.stopPropagation();const O=window.getSelection();O&&O.removeAllRanges();return}if(g.closest('[data-type="variable"]')){if(R.current)return;setTimeout(()=>{const M=window.getSelection();M&&!M.isCollapsed||Ee(c)},10);return}const j=g.closest(".file-remove-btn");if(j){m.preventDefault(),m.stopPropagation();const O=j.closest('[data-type="upload"]')?.dataset.key;O&&ee(O);return}const _=g.closest('[data-type="upload"]');if(_){const M=_.dataset.key;M&&(A(M),C.current?.click());return}},z=m=>{const v=m.target.closest('[data-type="variable"]');if(v){const I=window.getSelection();if(I){const k=document.createRange(),j=v.textContent||"";if(j.replace(/\u200B/g,"")){let M=0,O=j.length;j.startsWith("​")&&(M=1),j.endsWith("​")&&j.length>1&&(O=j.length-1);const H=v.firstChild;H&&H.nodeType===Node.TEXT_NODE?(k.setStart(H,M),k.setEnd(H,O)):k.selectNodeContents(v)}else k.selectNodeContents(v),k.collapse(!0);I.removeAllRanges(),I.addRange(k)}}},ae=()=>{if(t.length===0){if(c.current){const v=!(c.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"");X(v),q(!v)}return}if(Ee(c),c.current&&c.current.querySelectorAll('[data-type="variable"]').forEach(v=>{const I=v.querySelector(".variable-info-icon");if(I){let k=!1;const j=document.createTreeWalker(v,NodeFilter.SHOW_TEXT,{acceptNode:_=>I.contains(_)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(;j.nextNode();)if(j.currentNode.textContent?.replace(/[\u200B\n]/g,"").trim()){k=!0;break}k?I.classList.add("hidden"):I.classList.remove("hidden")}}),xe(c,t,u),we(c,t,u,q),!c.current)return;t.filter(g=>g.type==="multi-variable"&&g.key).forEach(g=>{if(!g.key)return;const v=g.maxCount||9,I=$[g.key]||1,k=[];for(let H=0;H<I;H++){const re=`${g.key}_${H}`,te=c.current.querySelector(`[data-type="variable"][data-key="${re}"][data-multi-key="${g.key}"]`);if(te){const oe=te.innerText.replace(/[\u200B\n]/g,"").trim();k.push(oe)}}const _=(k[k.length-1]||"")==="";let M=!1,O=-1;for(let H=0;H<k.length-1;H++)if(k[H]===""){M=!0,O=H;break}if(M&&O>=0){const H=window.getSelection();if(H&&H.rangeCount>0){const Q=H.getRangeAt(0),se=Q.startContainer,de=se.nodeType===Node.ELEMENT_NODE?se.closest('[data-type="variable"][data-multi-key]'):se.parentElement?.closest('[data-type="variable"][data-multi-key]');if(de){const me=de.dataset.key;if(me){const ge=document.createRange();ge.setStartBefore(de),ge.setEnd(Q.startContainer,Q.startOffset);const Ce=ge.toString().length;U.current={key:me,offset:Ce}}}}const re=[...k];for(let Q=O;Q<re.length-1;Q++)re[Q]=re[Q+1];re.pop();const te={};re.forEach((Q,se)=>{Q&&(te[`${g.key}_${se}`]=Q)});const oe=Math.max(_?re.length:re.length+1,1);c.current.querySelectorAll('[data-type="variable"]').forEach(Q=>{const se=Q.dataset.key,de=Q.dataset.multiKey;if(se&&de!==g.key){const me=Q.innerText.replace(/[\u200B\n]/g,"").trim();me&&(te[se]=me)}}),c.current.__tempVariableValues=te,T(Q=>({...Q,[g.key]:oe}));return}if(!_){const H=I-1,re=`${g.key}_${H}`,te=c.current.querySelector(`[data-type="variable"][data-key="${re}"][data-multi-key="${g.key}"]`);if(te&&te.innerText.replace(/[\u200B\n]/g,"").trim().length>0&&I<v){const ie=window.getSelection();if(ie&&ie.rangeCount>0){const Q=ie.getRangeAt(0),se=Q.startContainer,de=se.nodeType===Node.ELEMENT_NODE?se.closest('[data-type="variable"][data-multi-key]'):se.parentElement?.closest('[data-type="variable"][data-multi-key]');if(de){const me=de.dataset.key;if(me){const ge=document.createRange();ge.setStartBefore(de),ge.setEnd(Q.startContainer,Q.startOffset);const Ce=ge.toString().length;U.current={key:me,offset:Ce}}}}T(Q=>({...Q,[g.key]:I+1}))}}})},fe=()=>{if(c.current){if(t.length===0){const m=c.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";q(m.length>0);return}Ee(c),xe(c,t,u),we(c,t,u,q)}},Te=m=>{if(r){m.preventDefault();return}const g=window.getSelection();if(g&&g.rangeCount>0){const v=g.anchorNode;let I=null;if(v&&(v.nodeType===Node.ELEMENT_NODE?I=v.closest('[data-type="text"]'):v.nodeType===Node.TEXT_NODE&&v.parentElement&&(I=v.parentElement.closest('[data-type="text"]'))),I){if(m.preventDefault(),m.stopPropagation(),c.current){const k=c.current.querySelector('[data-type="variable"], [data-type="upload"]');k&&k.focus()}return}}if(y&&g&&g.rangeCount>0){const v=g.anchorNode;let I=null;if(v&&(v.nodeType===Node.ELEMENT_NODE?I=v.closest(".tag-node"):v.nodeType===Node.TEXT_NODE&&v.parentElement&&(I=v.parentElement.closest(".tag-node"))),I){if(m.preventDefault(),m.stopPropagation(),c.current){const k=c.current.querySelector('[data-type="variable"], [data-type="upload"]');k&&k.focus()}return}}if(m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),We()),m.key==="Escape"&&c.current){if(y){m.preventDefault();return}c.current.innerHTML="",c.current.focus()}if(m.key==="Backspace"){const v=window.getSelection();if(v&&v.rangeCount>0){const I=v.getRangeAt(0),k=v.anchorNode;if(y){let _=null,M=null;if(k&&(k.nodeType===Node.ELEMENT_NODE?(_=k.closest(".tag-node"),M=k.closest('[data-type="text"]')):k.nodeType===Node.TEXT_NODE&&k.parentElement&&(_=k.parentElement.closest(".tag-node"),M=k.parentElement.closest('[data-type="text"]'))),(_||M)&&I.collapsed&&I.startOffset===0){m.preventDefault();return}}let j=null;if(k&&(k.nodeType===Node.ELEMENT_NODE?j=k.closest('[data-type="variable"]'):k.nodeType===Node.TEXT_NODE&&k.parentElement&&(j=k.parentElement.closest('[data-type="variable"]'))),j){if(!I.collapsed)return;const _=j.innerText;if(_==="​"||_===""){m.preventDefault();return}if(I.startOffset===0){m.preventDefault();return}if(_.startsWith("​")&&I.startOffset===1){m.preventDefault();return}}}}},We=()=>{if(s||r||e||!F||!c.current)return;if(t.length===0){const j=c.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";if(!j)return;f(j,j);return}const m=c.current;let g="";const v={},I=j=>{if(!(j.nodeType===Node.ELEMENT_NODE&&j.style.display==="none")){if(j.nodeType===Node.TEXT_NODE)g+=(j.textContent||"").replace(/\u200B/g,"");else if(j.nodeType===Node.ELEMENT_NODE){const _=j,M=_.dataset.type,O=_.dataset.key;if(M==="variable"&&O){let H="";const re=document.createTreeWalker(_,NodeFilter.SHOW_TEXT,{acceptNode:oe=>{const ie=_.querySelector(".variable-info-icon");return ie&&ie.contains(oe)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;re.nextNode();)H+=re.currentNode.textContent||"";const te=H.replace(/[\u200B\n]/g,"").trim();if(te){const oe=_.dataset.multiKey;if(oe){(!v[oe]||!Array.isArray(v[oe]))&&(v[oe]=[]);const ie=v[oe];ie.push(te),ie.length>1&&(g+=" "),g+=te}else v[O]=te,g+=te}}else if(M==="upload"&&O)v[O]=u[O]??null,u[O]&&(g+=` [附带文件: ${u[O]?.name}] `);else{if(_.classList.contains("tag-close-btn")||_.classList.contains("file-remove-btn"))return;_.getAttribute("contenteditable")==="false"&&!M&&_.classList.contains("tag-node")?g+=_.innerText:_.childNodes.forEach(I)}}}};if(m.childNodes.forEach(I),g=g.trim(),!g)return;const k=new FormData;k.append("fullPrompt",g),Object.keys(v).forEach(j=>{const _=v[j];_!=null&&(_ instanceof File?k.append(j,_):Array.isArray(_)?t.some(O=>O.type==="multi-variable"&&O.key===j)?_.forEach(O=>{O!=null&&O!==""&&k.append(j,String(O))}):_.forEach((O,H)=>{O!=null&&(O instanceof File?k.append(`${j}[${H}]`,O):typeof O=="string"?k.append(`${j}[${H}]`,O):k.append(`${j}[${H}]`,String(O)))}):typeof _=="string"?k.append(j,_):k.append(j,String(_)))}),f(k,g)},dt={...o?{width:typeof o=="number"?`${o}px`:o}:{},...d?{border:d}:{},...N?{background:N}:{}};return a.jsxs("div",{className:"rich-text-editor",style:dt,"data-disabled":r,children:[a.jsx("div",{ref:c,className:`rte-editor ${t.length===0?"rte-editor-default":""} ${W&&x?"rte-editor-empty":""}`,contentEditable:t.length===0,suppressContentEditableWarning:!0,"data-placeholder":x,onMouseDown:ce,onMouseMove:ne,onMouseUp:ye,onClick:D,onDoubleClick:z,onInput:ae,onKeyDown:Te,onPaste:P,onBlur:fe}),a.jsx("input",{type:"file",ref:C,className:"rte-file-input",accept:".csv,.xlsx,.xls,.txt,.pdf,image/*",onChange:Y}),a.jsxs("div",{className:"rich-text-editor-footer",children:[a.jsx("div",{className:"rich-text-editor-footer-left",children:a.jsxs("div",{className:"rich-text-editor-brand",children:[a.jsxs("div",{className:"rte-brand-badge",children:[a.jsx("img",{src:"https://oospublic.sealseek.cn/file/website/ball.png",alt:""}),a.jsx("span",{className:"rte-brand-text",children:"SealSeek 1.0"})]}),p!=="hideAgent"&&a.jsx(G.Dropdown,{placement:"top",menu:{items:S.map(m=>({key:m.key,label:a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[m.icon&&a.jsx("i",{className:m.icon}),a.jsx("span",{children:m.label})]}),onClick:()=>{h?.(m)}}))},trigger:["click"],disabled:r||s,children:a.jsxs("div",{className:"rte-agent-badge",style:{cursor:S.length>0?"pointer":"default"},children:[a.jsx("i",{className:"iconfont icon-zhinengti"}),a.jsx("span",{className:"rte-agent-text",children:"智能体"})]})})]})}),a.jsx("button",{type:"button",onClick:We,disabled:s||r||e||!F,className:"rich-text-editor-send-button",children:s||e?a.jsx("span",{className:"rte-send-spinner"}):a.jsx("i",{className:"iconfont icon-fasong"})})]}),b?.anchorEl&&(()=>{if(!document.body.contains(b.anchorEl))return null;let m="";return b.type==="upload"?m=t.find(v=>v.type==="upload"&&v.key===b.key)?.tooltip||"":b.type==="tag"?m=b.anchorEl.dataset.tooltip||"":b.type==="upload-label"?m=b.anchorEl.dataset.fileName||"":b.type==="variable"&&(m=b.anchorEl.dataset.tooltip||""),He.createPortal(a.jsx(G.Tooltip,{arrow:!1,title:a.jsx("div",{style:{maxWidth:"200px",fontSize:"12px",color:"#fff"},children:m}),open:!0,placement:"top",getPopupContainer:()=>document.body,overlayInnerStyle:{background:"var(--neutral-800, #262626)"},children:a.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)})()]})};qe.__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 De="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFSSURBVHgB3ZTtccIwDIaVXv83I2SDZgSP0BHMBG0naEZhA2boBGQDswHdQJUOGRxjO0Z8HPDe6eJzJD2W4gjgEYSIn2xwK6EIFHqBGysJpMP3ZB0oRbEtmal1NtIxl4OWWsoxEsvqofJ0rgTNASOYq+7SXKDsuYvAcgkq/PWwBLQWqIfdjeRStaBUc4qzgLi9/BzJNmS/sh6bpvmrTfSFacU3scWy1mQryWdSnXiFE8QVUJINLTuyhWzzz/1OZmTN9hEckqtfUOwIGlGCpVRjE+94JFqpMtTeVzO8/UmPxpZU8Qa7aln8Tb9pfwla4WHWrjPvvbbnTBsX7PmLs83EDAH0BxSw1G31+/1FoDg/vPcXR+wocQS1apj4+P92FfhOoLyuBfYlmPgYnGoCjWADzAkzUyJ430awLmphPaxWQVU22BuuApPkHaanjcXSN3t6/QNjTMSJWDcs1QAAAABJRU5ErkJggg==",ot=[{label:"5页",value:5},{label:"10页",value:10},{label:"15页",value:15},{label:"30页",value:30}],st=({autoLoading:t,batchSize:f,loadingProgress:s,loadIcon:r,onBatchSizeChange:o,onLoadNextPage:y,onStartAutoLoad:S,onStopLoad:h})=>t&&s?a.jsxs("div",{className:"auto_load_progress",children:[r||a.jsx("img",{src:De,alt:"自动加载",width:14,height:14}),a.jsxs("span",{children:["正在加载第",s.currentPage,"/",s.totalPages,"页"]}),a.jsx(G.Progress,{percent:s.percentage,type:"line",size:[160,8]}),a.jsx("span",{onClick:h,className:"auto_load_stop_btn",children:"停止加载"})]}):a.jsxs("div",{className:"auto_load_container",children:[a.jsx("div",{onClick:y,className:"auto_load_next_btn",style:{backgroundColor:t?"#f5f5f5":"#2563eb"},children:"加载下一页"}),a.jsxs("div",{className:"right_control_wrap",style:{backgroundColor:t?"#f5f5f5":"#2563eb"},children:[a.jsxs("div",{className:"auto_load_btn",onClick:t?void 0:S,children:[r||a.jsx("img",{src:De,alt:"自动加载",width:14,height:14}),a.jsx("span",{children:"自动加载"})]}),a.jsx(G.Select,{value:f,onChange:o,options:ot,disabled:t,size:"small",className:"auto_load_select",popupMatchSelectWidth:84})]})]}),lt=({current:t,loadIcon:f,pageSize:s,total:r,cachedPages:o,loadedCount:y,autoLoading:S=!1,loadingProgress:h,onChange:i,onLoadNextPage:e,onStartAutoLoad:x,onStopLoading:d})=>{const[N,p]=n.useState(5),c=Math.ceil(r/s),C=n.useMemo(()=>o.length>=c,[o,c]),u=()=>Array.from({length:c},(A,b)=>b+1).filter(A=>!o.includes(A)).slice(0,N),w=(E,A,b)=>{const V=o.includes(E);return A==="prev"||A==="next"||A==="jump-prev"||A==="jump-next"?a.jsx("div",{className:"pageBox",children:b}):a.jsxs("div",{className:"pageBox",style:{backgroundColor:t===E?"#2563EB":"#f5f5f5",color:t===E?"#fff":V?"#171717":"#a3a3a3"},children:[E,!V&&a.jsx("span",{className:"unload_spot"})]})};return a.jsxs("div",{className:"pagination_footer",children:[a.jsxs("div",{className:"pagination_leftWrap",children:[a.jsxs("span",{className:"pagination_total",children:[a.jsx(pe.InfoCircleOutlined,{style:{color:"#2563EB",marginRight:"4px"}}),"已加载: ",y,"/",r,"条数据"]}),!C&&a.jsx(st,{loadIcon:f||void 0,autoLoading:S,batchSize:N,loadingProgress:h,disabled:!e||!x,onBatchSizeChange:p,onLoadNextPage:()=>e?.(),onStartAutoLoad:()=>{const E=u();x?.(E)},onStopLoad:()=>d?.()})]}),a.jsx(G.Pagination,{current:t,pageSize:s,total:r,onChange:E=>i(E),showSizeChanger:!1,showQuickJumper:!1,showTotal:(E,A)=>"",itemRender:w})]})},Me=t=>{const{loading:f,autoLoading:s,loadingProgress:r,columns:o=[],dataSource:y=[],total:S,current:h,pageSize:i,cachedPages:e,onChangePage:x,onLoadNextPage:d,onStartAutoLoad:N,onStopLoading:p,...c}=t,C=n.useRef(null),u=n.useCallback(w=>{x(w),e.includes(w)&&C.current?.scrollTo({key:`${(w-1)*i+1}`})},[h]);return a.jsxs("div",{className:"flex flex-col",children:[a.jsx(G.Table,{ref:C,...c,columns:o,dataSource:y,pagination:!1,virtual:!0}),a.jsx(lt,{loading:f,autoLoading:s,loadingProgress:r,current:h,pageSize:i,total:S,loadedCount:y.length,cachedPages:e,onChange:u,onLoadNextPage:d,onStartAutoLoad:N,onStopLoading:p})]})};Me.__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 Fe=({texts:t=[],placeholder:f="请输入内容",animationSpeed:s=100,autoPlay:r=!0,value:o,onChange:y,...S})=>{const[h,i]=n.useState(""),[e,x]=n.useState(0),[d,N]=n.useState(!1),[p,c]=n.useState(!1),[C,u]=n.useState(!1),w=n.useRef(void 0),E=n.useRef(void 0),A=n.useRef(t),b=n.useRef(e),V=n.useRef(p),R=n.useRef(h);n.useEffect(()=>{A.current=t,b.current=e,V.current=p,R.current=h});const B=n.useCallback((T,L)=>{let K=0;u(!0);const Z=()=>{K<T.length?(i(T.slice(0,K+1)),K++,E.current=window.setTimeout(Z,s)):(u(!1),L?.())};Z()},[s]),F=n.useCallback(T=>{let L=R.current.length;const K=()=>{L>0?(i(R.current.slice(0,L-1)),L--,E.current=window.setTimeout(K,s/2)):T?.()};K()},[s]),q=n.useCallback(()=>{if(A.current.length===0||V.current)return;N(!0);const T=A.current[b.current];R.current?F(()=>{B(T,()=>{w.current=window.setTimeout(()=>{x(L=>(L+1)%A.current.length),N(!1)},2e3)})}):B(T,()=>{w.current=window.setTimeout(()=>{x(L=>(L+1)%A.current.length),N(!1)},2e3)})},[F,B]);n.useEffect(()=>(r&&t.length>0&&!p&&q(),()=>{w.current&&window.clearTimeout(w.current),E.current&&window.clearTimeout(E.current)}),[e,p,r,t.length,q]),n.useEffect(()=>{!d&&r&&t.length>0&&!p&&q()},[e,d,r,t.length,p,q]);const U=T=>{c(!0),w.current&&window.clearTimeout(w.current),E.current&&window.clearTimeout(E.current),N(!1),u(!1),S.onFocus?.(T)},W=T=>{c(!1),!o&&t.length>0&&(i(""),x(0)),S.onBlur?.(T)},X=T=>{y?.(T.target.value),S.onChange?.(T)},$=()=>p||o?f:h||f;return a.jsxs("div",{style:{position:"relative"},children:[a.jsx(G.Input,{...S,value:o,onChange:X,onFocus:U,onBlur:W,placeholder:$(),style:{...S.style,position:"relative",zIndex:1}}),!p&&!o&&h&&a.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:[a.jsx("span",{children:h}),C&&a.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),a.jsx("style",{children:`
23
23
  @keyframes blink {
24
24
  0%, 50% { opacity: 1; }
25
25
  51%, 100% { opacity: 0; }
26
26
  }
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:`
27
+ `})]})};Fe.__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 Ge=({texts:t=[],placeholder:f="请输入内容",animationSpeed:s=100,autoPlay:r=!0,value:o="",onChange:y,onSubmit:S,maxLength:h=500,showCount:i=!0,submitText:e="发送",disabled:x=!1,rows:d=4,style:N,...p})=>{const[c,C]=n.useState(""),[u,w]=n.useState(0),[E,A]=n.useState(!1),[b,V]=n.useState(!1),[R,B]=n.useState(!1),[F,q]=n.useState(o||""),U=n.useRef(void 0),W=n.useRef(void 0),X=n.useRef(t),$=n.useRef(u),T=n.useRef(b),L=n.useRef(c),K=n.useRef(null);n.useEffect(()=>{X.current=t,$.current=u,T.current=b,L.current=c});const Z=n.useCallback((D,z)=>{let ae=0;B(!0);const fe=()=>{ae<D.length?(C(D.slice(0,ae+1)),ae++,W.current=window.setTimeout(fe,s)):(B(!1),z?.())};fe()},[s]),le=n.useCallback(D=>{let z=L.current.length;const ae=()=>{z>0?(C(L.current.slice(0,z-1)),z--,W.current=window.setTimeout(ae,s/2)):D?.()};ae()},[s]),ue=n.useCallback(()=>{if(X.current.length===0||T.current)return;A(!0);const D=X.current[$.current];L.current?le(()=>{Z(D,()=>{U.current=window.setTimeout(()=>{w(z=>(z+1)%X.current.length),A(!1)},2e3)})}):Z(D,()=>{U.current=window.setTimeout(()=>{w(z=>(z+1)%X.current.length),A(!1)},2e3)})},[le,Z]);n.useEffect(()=>(r&&t.length>0&&!b&&ue(),()=>{U.current&&window.clearTimeout(U.current),W.current&&window.clearTimeout(W.current)}),[u,b,r,t.length,ue]),n.useEffect(()=>{!E&&r&&t.length>0&&!b&&ue()},[u,E,r,t.length,b,ue]);const l=D=>{V(!0),U.current&&window.clearTimeout(U.current),W.current&&window.clearTimeout(W.current),A(!1),B(!1),p.onFocus?.(D)},P=D=>{V(!1),!o&&t.length>0&&(C(""),w(0)),p.onBlur?.(D)},Y=D=>{const z=D.target.value;h&&z.length>h||(y?y(z):q(z),p.onChange?.(D))},ee=()=>{const D=y?o:F;D.trim()&&!x&&(S?.(D),y||q(""))},ce=D=>{(D.ctrlKey||D.metaKey)&&D.key==="Enter"&&(D.preventDefault(),ee()),p.onKeyDown?.(D)},ne=y?o:F,ye=x||!ne.trim()||(h?ne.length>h:!1);return a.jsxs("div",{style:{position:"relative",...N},children:[a.jsxs("div",{style:{position:"relative"},children:[a.jsx("textarea",{ref:K,value:y?o:F,onChange:Y,onFocus:D=>{D.target.style.borderColor="#1890ff",D.target.style.boxShadow="0 0 0 2px rgba(24, 144, 255, 0.2)",l(D)},onBlur:D=>{D.target.style.borderColor="#d9d9d9",D.target.style.boxShadow="none",P(D)},onKeyDown:ce,placeholder:b||ne?f:"",maxLength:h,rows:d,disabled:x,style:{width:"100%",minHeight:`${d*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",...p.style},...p}),!b&&!ne&&c&&a.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:[a.jsx("span",{children:c}),R&&a.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),a.jsx("div",{style:{position:"absolute",bottom:8,right:8,zIndex:3},children:a.jsx(G.Button,{type:"primary",size:"small",icon:a.jsx(pe.SendOutlined,{}),onClick:ee,disabled:ye,style:{borderRadius:6,minWidth:32,height:32,display:"flex",alignItems:"center",justifyContent:"center"},children:e})})]}),i&&a.jsxs("div",{style:{marginTop:4,textAlign:"right",fontSize:"12px",color:"#999"},children:[ne.length,"/",h]}),a.jsx("style",{children:`
28
28
  @keyframes blink {
29
29
  0%, 50% { opacity: 1; }
30
30
  51%, 100% { opacity: 0; }
31
31
  }
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"})});
32
+ `})]})};Ge.__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 ke=({src:t,poster:f,width:s=300,height:r,videoWidth:o,videoHeight:y,showPlayButton:S=!0,autoPlayOnHover:h=!0,onClick:i,onVideoLoaded:e,onVideoPlay:x,onVideoPause:d,onVideoEnded:N,className:p,style:c,...C})=>{const u=n.useRef(null),[w,E]=n.useState(!1),[A,b]=n.useState(!1),[V,R]=n.useState(!1),B=n.useCallback(()=>{u.current&&(u.current.play(),E(!0),x?.())},[x]),F=n.useCallback(()=>{u.current&&(u.current.pause(),E(!1),d?.())},[d]),q=n.useCallback(Z=>{Z.stopPropagation(),w?F():B()},[w,B,F]),U=n.useCallback(()=>{b(!0),h&&!w&&B()},[h,w,B]),W=n.useCallback(()=>{b(!1),h&&w&&F()},[h,w,F]),X=n.useCallback(()=>{R(!0),e?.()},[e]),$=n.useCallback(()=>{E(!0),x?.()},[x]),T=n.useCallback(()=>{E(!1),d?.()},[d]),L=n.useCallback(()=>{E(!1),N?.()},[N]),K=n.useCallback(Z=>{i?.(Z)},[i]);return a.jsx(G.Card,{...C,className:`video-card ${p||""}`,style:{width:s,height:r,padding:0,overflow:"hidden",cursor:i?"pointer":"default",border:"none",borderRadius:0,...c},bordered:!1,onMouseEnter:U,onMouseLeave:W,onClick:K,children:a.jsxs("div",{className:"video-card-container",children:[a.jsx("video",{ref:u,src:t,poster:f,preload:"metadata",onLoadedData:X,onPlay:$,onPause:T,onEnded:L,muted:!0,loop:!0}),S&&a.jsx("div",{className:`video-play-button ${A?"hovered":""}`,onClick:q,children:w?a.jsx(pe.PauseCircleOutlined,{className:"play-icon"}):a.jsx(pe.PlayCircleOutlined,{className:"play-icon"})}),!V&&a.jsx("div",{className:"video-loading-mask",children:a.jsx("div",{className:"loading-spinner"})})]})})};ke.__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 it=t=>[".mp4",".webm",".ogg",".mov",".avi",".wmv",".flv",".mkv"].some(s=>t.toLowerCase().includes(s)),ct=t=>t.type?t.type:it(t.url)?"video":"image",ze=({items:t,columns:f,gap:s=0,responsive:r=!0,breakpoints:o={xs:1,sm:2,md:3,lg:4,xl:5,xxl:6},className:y,style:S,onClick:h})=>{const i=n.useRef(null),[e,x]=n.useState(f||o.md||3),d=n.useRef(new Map),N=n.useCallback(()=>{if(!r||f)return f||o.md||3;const u=window.innerWidth;return u<576?o.xs||1:u<768?o.sm||2:u<992?o.md||3:u<1200?o.lg||4:u<1600?o.xl||5:o.xxl||6},[r,f,o]),p=n.useCallback(()=>{if(!i.current)return;const u=e,w=i.current,A=(w.offsetWidth-s*(u-1))/u,b=new Array(u).fill(0);t.forEach((R,B)=>{const F=R.id||B,q=d.current.get(F);if(!q)return;const U=Math.min(...b),W=b.indexOf(U),X=W*(A+s),$=b[W];q.style.position="absolute",q.style.left=`${X}px`,q.style.top=`${$}px`,q.style.width=`${A}px`,b[W]+=q.offsetHeight+s});const V=Math.max(...b);w.style.height=`${V}px`},[t,e,s]);n.useEffect(()=>{const u=()=>{const w=N();w!==e&&x(w)};if(r)return window.addEventListener("resize",u),u(),()=>window.removeEventListener("resize",u)},[r,N,e]),n.useEffect(()=>{const u=setTimeout(()=>{p()},100);return()=>clearTimeout(u)},[t,e,p]);const c=n.useCallback(()=>{p()},[p]),C=n.useCallback(u=>{h&&h(u),u.onClick?.(u)},[h]);return a.jsx("div",{ref:i,className:`waterfall-container ${y||""}`,style:{position:"relative",width:"100%",...S},children:t.map((u,w)=>{const E=u.id||w,A=ct(u);return a.jsx("div",{ref:b=>{b?d.current.set(E,b):d.current.delete(E)},className:"waterfall-item",children:A==="video"?a.jsx("div",{style:{width:"100%",position:"relative",paddingBottom:"56.25%",cursor:h||u.onClick?"pointer":"default"},children:a.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},children:a.jsx(ke,{src:u.url,poster:u.poster,width:"100%",height:"100%",onClick:()=>C(u),onVideoLoaded:c,autoPlayOnHover:!0,showPlayButton:!1})})}):a.jsx("div",{className:"waterfall-image-wrapper",onClick:()=>C(u),style:{cursor:h||u.onClick?"pointer":"default"},children:a.jsx("img",{src:u.url,alt:`瀑布流图片 ${w+1}`,className:"waterfall-image",onLoad:c,onError:c,style:{display:"block",width:"100%",height:"auto"}})})},E)})})};ze.__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 ut={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"}}};J.AdvancedTable=Oe,J.AppModal=_e,J.BackButton=Pe,J.Button=Re,J.Card=je,J.DynamicInput=Fe,J.DynamicTextArea=Ge,J.EmptyAndSpin=Ve,J.LinkButton=Be,J.PageTable=Ie,J.RichTextEditor=qe,J.VideoCard=ke,J.VirtualTable=Me,J.Waterfall=ze,J.XcIcon=Le,J.lightTheme=ut,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});
33
33
  //# sourceMappingURL=index.umd.js.map