bi-components-library 1.0.5 → 1.0.6

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