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