bi-components-library 1.0.10 → 1.0.12

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