@gientech/modual 1.8.5 → 1.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{GientechStreamReader-C7an1QrK.js → GientechStreamReader-BafFiNMI.js} +1 -1
- package/assets/{index-tplNfcnA.js → index-BH8au9G9.js} +2 -2
- package/assets/{index-OjluyvX1.js → index-BbHMAb8g.js} +2 -2
- package/assets/{index-CFqsgVcx.js → index-BbpyNfEd.js} +35 -35
- package/assets/{index-8usKJjKH.js → index-CCjG4bD0.js} +15 -15
- package/assets/{index-Di5Ga230.js → index-CPOAXITM.js} +2 -2
- package/assets/index-CuySCBtZ.js +576 -0
- package/assets/{index-BmVOh6oe.js → index-Dkwp9YpO.js} +1 -1
- package/assets/{index-6Ox5f3GI.js → index-DnJqVq9Q.js} +1 -1
- package/assets/{index-B0fJUyM7.js → index-Wjs4Vb6x.js} +1 -1
- package/assets/{index-DhczpnL_.js → index-fhKUis2J.js} +128 -129
- package/assets/{plus-Dbo_i_9Z.js → plus-Dmpl3gd8.js} +2 -2
- package/assets/{style-bUXwVVWZ.js → style-CNIDlcUL.js} +5 -5
- package/assets/{x-C7NWGGXn.js → x-BjRa5XLp.js} +2 -2
- package/assistantConfig.js +1 -1
- package/chat.js +1 -1
- package/database.js +2 -2
- package/databaseId.js +1 -1
- package/databaseTable.js +2 -2
- package/index.js +1 -1
- package/modelManage.js +1 -1
- package/package.json +1 -1
- package/sensitive.js +1 -1
- package/streamFilesReader.js +1 -1
- package/assets/index-D4NnOWbo.js +0 -576
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as i,jsx as e,Fragment as Me}from"react/jsx-runtime";import
|
|
1
|
+
import{jsxs as i,jsx as e,Fragment as Me}from"react/jsx-runtime";import qe,{useState as x,forwardRef as He,useEffect as W,useMemo as ie,useImperativeHandle as Ve,useRef as se}from"react";import{a as ge,a7 as ve,b as Ke,B as re,d as q,c as We,h as ke,i as O,F as de,a8 as _e,I as fe,a9 as Q,aa as Ze,ab as Ue,q as ne,R as ae,a6 as oe}from"./index-BbHMAb8g.js";import{X as Xe}from"./x-BjRa5XLp.js";import{P as Fe}from"./plus-Dmpl3gd8.js";import{M as Ee,s as Be}from"./style-CNIDlcUL.js";import{S as Ge}from"./index-Wjs4Vb6x.js";/**
|
|
2
2
|
* @license lucide-react v0.456.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -18,7 +18,7 @@ import{jsxs as i,jsx as e,Fragment as Me}from"react/jsx-runtime";import He,{useS
|
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const Ye=ge("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),ye=({title:n,defaultExpanded:s=!0,className:a,children:u})=>{const[h,F]=x(s);return i("div",{className:a,children:[i("div",{className:"flex items-center justify-between",style:{marginBottom:"10px"},children:[i("div",{className:"flex items-center",children:[e("div",{style:{width:"3px",height:"12px",backgroundColor:"#4E6EF2",borderRadius:"6px",marginRight:"6px"}}),e("div",{className:"font-bold",children:n})]}),h?e(De,{onClick:()=>F(b=>!b),color:"#4E6EF2",size:18}):e(ve,{onClick:()=>F(b=>!b),color:"#4E5969",size:18})]}),u?e("div",{style:{display:h?"block":"none"},children:u}):null]})},ce=()=>i("div",{className:"w-full h-[80px] rounded-md flex flex-col justify-center items-center",children:[e("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg",children:i("g",{transform:"translate(0 1)",fill:"none","fill-rule":"evenodd",children:[e("ellipse",{fill:"#f5f5f5",cx:"32",cy:"33",rx:"32",ry:"7"}),i("g",{"fill-rule":"nonzero",stroke:"#d9d9d9",children:[e("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),e("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:"#fafafa"})]})]})}),e("div",{children:"\u6682\u65E0\u53EF\u7528\u6A21\u578B"})]}),Qe="\u63D0\u793A\u8BCD\u7528\u4E8E\u6307\u5B9A\u804A\u5929\u7684\u80CC\u666F\u548C\u4E0A\u4E0B\u6587\uFF0C\u6216\u8005\u8BA9\u52A9\u624B\u91C7\u53D6\u67D0\u4E2A\u4EBA\u683C\u6765\u56DE\u7B54\u4F60\u7684\u95EE\u9898\uFF1B",eu="\u5F00\u5173\u5F00\u542F\uFF0C\u5219\u82E5\u7CFB\u7EDF\u672A\u5728\u77E5\u8BC6\u5E93\u3001\u6570\u636E\u5E93\u7B49\u4F01\u4E1A\u77E5\u8BC6\u6570\u636E\u8303\u56F4\u5185\u68C0\u7D22\u5230\u7B54\u6848\uFF0C\u5219\u76F4\u63A5\u62D2\u7EDD\u56DE\u7B54\u76F8\u5173\u95EE\u9898\uFF1B",uu='\u4F60\u662F\u4E00\u4E2A\u667A\u80FD\u52A9\u624B\uFF0C\u8BF7\u603B\u7ED3\u77E5\u8BC6\u5E93\u7684\u5185\u5BB9\u6765\u56DE\u7B54\u95EE\u9898,\u8BF7\u5217\u4E3E\u77E5\u8BC6\u5E93\u4E2D\u7684\u6570\u636E\u8BE6\u7EC6\u56DE\u7B54\u3002\u5F53\u6240\u6709\u77E5\u8BC6\u5E93\u5185\u5BB9\u90FD\u4E0E\u95EE\u9898\u65E0\u5173\u65F6\uFF0C\u4F60\u7684\u56DE\u7B54\u5FC5\u987B\u5305\u62EC"\u77E5\u8BC6\u5E93\u4E2D\u672A\u627E\u5230\u60A8\u8981\u7684\u7B54\u6848!"',tu="\u60A8\u597D\uFF01\u6211\u6CE8\u610F\u5230\u60A8\u7684\u6D88\u606F\u4E2D\u53EF\u80FD\u5305\u542B\u4E86\u4E00\u4E9B\u654F\u611F\u7684\u5185\u5BB9\u3002\u4E3A\u4E86\u4FDD\u8BC1\u793E\u533A\u7684\u53CB\u597D\u6C1B\u56F4\uFF0C\u6211\u4EEC\u65E0\u6CD5\u7EE7\u7EED\u5C31\u6B64\u8BDD\u9898\u8FDB\u884C\u8BA8\u8BBA\u3002\u5982\u679C\u60A8\u6709\u5176\u4ED6\u95EE\u9898\u6216\u9700\u8981\u5E2E\u52A9\uFF0C\u6211\u5F88\u4E50\u610F\u7EE7\u7EED\u4E3A\u60A8\u670D\u52A1\uFF01\u8C22\u8C22\u60A8\u7684\u7406\u89E3\u548C\u652F\u6301\u3002",te={top_k:{default:10,min:1,max:15,step:1,tooltip:"top_k\u4EE3\u8868\u6A21\u578B\u6700\u7EC8\u53D6\u4FE1\u7684\u6587\u672C\u5757\u6570\uFF0C\u4F8B\u5982\u95E8\u69DBtop_p = 0.8\uFF0Ctop_k = 3\uFF0C\u610F\u5473\u7740\u6A21\u578B\u4F1A\u4F9D\u636E\u76F8\u4F3C\u5EA6\u9AD8\u4F4E\u53D6\u524D3\u4E2A\u5927\u4E8E0.8\u7684\u6587\u672C\u5757\uFF0C\u5373\u4F7F\u5F53\u524D\u53EF\u80FD\u6709\u5927\u4E8E3\u4E2A\u6587\u672C\u5757\u7684\u76F8\u4F3C\u5EA6\u5927\u4E8E0.8\uFF1B"},max_tokens:{default:4096,min:0,max:1e4,step:64,tooltip:"max_tokens\u4EE3\u8868\u6A21\u578B\u7A97\u53E3\u5927\u5C0F\uFF0C\u5373\u4E00\u6B21\u95EE\u7B54\u5927\u6A21\u578B\u4E00\u6B21\u80FD\u591F\u63A5\u53D7\u7684\u5B57\u7B26\u4E32\u6700\u5927\u957F\u5EA6\uFF0C\u5305\u62EC\u7528\u6237\u7684\u63D0\u95EE\u548C\u6A21\u578B\u7684\u56DE\u7B54\uFF1B\u591A\u8F6E\u5BF9\u8BDD\u4E2D\u5386\u53F2\u5BF9\u8BDD\u5185\u5BB9\u4E5F\u5305\u62EC\u5728\u5185\uFF1B\u6700\u5927\u503C\u53D6\u51B3\u4E8E\u5927\u6A21\u578B\u672C\u8EAB\u662F\u5426\u652F\u6301\uFF1B"},max_round:{default:5,min:0,max:32,step:1,tooltip:"\u4EA4\u4E92\u5BF9\u8BDD\u573A\u666F\u91CC\uFF0C\u7CFB\u7EDF\u80FD\u591F\u8BB0\u5FC6\u5E76\u6709\u6548\u5173\u8054\u7684\u7528\u6237\u4E0E\u6A21\u578B\u4E4B\u95F4\u6765\u56DE\u4EA4\u6D41\u7684\u6700\u5927\u6B21\u6570\uFF1B"},temperature:{default:.3,min:.1,max:1,step:.1,tooltip:"\u6E29\u5EA6\u662F\u6A21\u578B\u56DE\u7B54\u7684\u503E\u5411\u6027\uFF0C\u53D6\u503C\u8303\u56F4\u4E00\u822C\u662F0\uFF5E1; \u53D6\u503C\u8D8B\u8FD10\u4EE3\u8868\u7740\u6A21\u578B\u56DE\u7B54\u4F1A\u66F4\u4E25\u8C28\uFF0C\u9002\u5408\u56DE\u7B54\u68C0\u7D22\u7C7B\u95EE\u9898; \u53D6\u503C\u8D8B\u8FD11\u5219\u4EE3\u8868\u56DE\u7B54\u66F4\u53D1\u6563\uFF0C\u9002\u5408\u56DE\u7B54\u521B\u65B0\u6027\u7684\u95EE\u9898\uFF1B"},top_p:{default:.8,min:.1,max:1,step:.1,tooltip:"top_p \u7528\u4E8E\u63A7\u5236\u5927\u6A21\u578B\u751F\u6210\u7B56\u7565\uFF0C\u51B3\u5B9A\u4E86\u6A21\u578B\u5728\u751F\u6210\u4E0B\u4E00\u4E2A\u8BCD\u65F6\uFF0C\u4ECE\u7D2F\u79EF\u6982\u7387\u8FBE\u5230 p \u7684\u6700\u5C0F\u8BCD\u96C6\u5408\u4E2D\u8FDB\u884C\u91C7\u6837\u3002\u901A\u5E38\u8BBE\u7F6E\u57280.8 - 0.95\u4E4B\u95F4\uFF0Ctop_p\u8D8A\u4F4E\u6A21\u578B\u7528\u8BCD\u8D8A\u4FDD\u5B88\uFF0C\u8D8A\u9AD8\u8D8A\u6D3B\u8DC3\u3002"},score_threshold:{default:.1,min:.1,max:1,step:.1,tooltip:"score_threshold\u53C2\u6570\u662F\u6A21\u578B\u8FDB\u884C\u91CD\u6392\u5E8F\u65F6\uFF0C\u5BF9\u4E8E\u6587\u672C\u5757\u53D6\u820D\u7684\u95E8\u69DB\u503C\uFF1B"}},nu={search_policy:1,enabled_rerank:!0,need_trace_source:!0,trace_by_llm:!0,is_download:!1,dependOnKb:0,enabled_faq:!1,enabled_graph:!1,enabled_question_rewrite:!1,isDefault:0},su=[{label:"\u6DF7\u5408\u68C0\u7D22",value:1},{label:"\u5168\u6587\u68C0\u7D22",value:2},{label:"\u8BED\u4E49\u68C0\u7D22",value:3}],ru=[{label:"\u89C4\u5219\u6EAF\u6E90",value:!1},{label:"\u5927\u6A21\u578B\u6EAF\u6E90",value:!0}],he=({url:n,token:s,role:a,eventsEmit:u})=>{const h=Ke.create({baseURL:n,timeout:1e6});return h.interceptors.request.use(l=>{let t=s;return!t&&!["user/login","user/kaptcha","user/regist"].some(d=>l.url.includes(d))?(u&&u("request:error_auth",{errorMsg:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F",redirect:"/login"}),Promise.reject(new Error("\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"))):(l.headers.Authorization=t||"",l.headers.userName=a==="\u672A\u767B\u5F55\u7528\u6237"?"":a,l)}),h.interceptors.response.use(l=>{const t=["user/kaptcha"],r=l.data;if(t.some(_=>l.config.url&&l.config.url.includes(_))||r.size&&r.type)return r;const{success:d,errorMsg:E,errorCode:m}=r;if(d)return r;u&&u("request:error_business",{errorCode:m,errorMsg:E||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",response:r})},l=>{var t,r,d,E,m,_,v,I,Z;if(l.message==="canceled")return Promise.reject(l);if(u){let g="request:error_network",A={errorMsg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:l};((t=l==null?void 0:l.response)==null?void 0:t.status)===401?(g="request:error_auth",A={errorMsg:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",error:l,redirect:"/login"}):(((d=(r=l==null?void 0:l.response)==null?void 0:r.data)==null?void 0:d.errorCode)==="30013"||((m=(E=l==null?void 0:l.response)==null?void 0:E.data)==null?void 0:m.errorCode)==="30023")&&(g="request:error_business",A={errorCode:(v=(_=l==null?void 0:l.response)==null?void 0:_.data)==null?void 0:v.errorCode,errorMsg:((Z=(I=l==null?void 0:l.response)==null?void 0:I.data)==null?void 0:Z.errorMsg)||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",error:l}),u(g,A)}return Promise.reject(l)}),{getConfigById:async l=>{try{const t=await h.get(`/qa/search/config/getById?configId=${l}`),{success:r,data:d}=t;return r?d:!1}catch(t){console.error("getConfigById",t)}},fetchDatabases:async()=>{try{const l=await h.get("/index/database/queryAllDBList"),{success:t,data:r}=l;return t?r:!1}catch(l){console.error("fetchDatabases",l)}},fetchModels:async l=>{try{const t=await h.get(`/index/modelInfo/allPage?${new URLSearchParams(l).toString()}`),{success:r,data:d}=t;return r?d:!1}catch(t){return console.log("fetchModels error",t),!1}},fetchSensitiveLibrary:async l=>{try{const t=await h.get(`/sensitive/library?${new URLSearchParams(l).toString()}`),{success:r,data:d}=t;return r?d:!1}catch(t){return console.log("fetchSensitiveLibrary error",t),!1}},fetchConfigItemLimit:async()=>{try{const l=await h.get("/qa/search/config/configItemLimit"),{success:t,data:r}=l;return t?r:!1}catch(l){console.error("fetchConfigItemLimit error",l)}},fetchKnowledgeBase:async l=>{try{const t=l?`?userName=${l}`:"";console.log("+++",t);const r=await h.get(`/index/knowledgeBase/searchList${t}`),{success:d,data:E}=r;return d?E:!1}catch(t){console.log("e",t)}},fetchGraphs:async()=>{try{const l=await h.get("/index/graph/platform/querySnapshotList?pageSize=999&pageNo=1"),{success:t,data:r}=l;return t?r:!1}catch(l){console.error("fetchGraphs",l)}},checkName:async(l,t)=>{try{const r=await h.get(`/qa/search/config/checkName?configName=${l}${t?`&configId=${t}`:""}`),{success:d,data:E}=r;if(d)return E}catch(r){return console.log("updateConversationAssistant error:",r),!1}},getBizLabelLabels:async l=>{try{const t=await h.post("/index/bizLabel/labels",l),{success:r,data:d}=t;if(r)return d}catch(t){return console.log("updateConversationAssistant error:",t),!1}},addConversationAssistant:async l=>{try{const t=await h.post("/qa/search/config/add",{...l}),{success:r,data:d}=t;if(r)return d}catch(t){return console.log("addConversationAssistant error:",t),!1}},updateConversationAssistant:async(l,t)=>{try{const r=await h.put("/qa/search/config/update",{id:l,...t}),{success:d,data:E}=r;if(d)return E}catch(r){return console.log("updateConversationAssistant error:",r),!1}}}},Ce=({countText:n,eventsEmit:s,data:a})=>{const[u,h]=x(!0);return i("div",{style:{marginTop:8},children:[n&&i("div",{className:"flex items-center gap-2",children:[e("span",{style:{color:u?"#4E6EF2":"#4E5969"},children:n}),u?e(De,{onClick:()=>h(F=>!F),color:"#4E6EF2",size:14}):e(ve,{onClick:()=>h(F=>!F),color:"#4E5969",size:14})]}),e("div",{style:{display:u?"block":"none"},children:a.map(F=>e(au,{item:F,eventsEmit:s},F.key))})]})},au=({item:n,eventsEmit:s})=>{var h,F,b;const[a,u]=x(!0);return i("div",{className:"flex items-center justify-between",style:{padding:"8px 12px",borderRadius:6},children:[i("div",{children:[i("div",{style:{color:"#1D2129"},className:"flex items-center",children:[n.label,((h=n==null?void 0:n.tags)==null?void 0:h.length)>0&&i(Me,{children:[i("span",{style:{color:"#4E5969",marginLeft:"6px",marginRight:6},children:["(",(F=n==null?void 0:n.tags)==null?void 0:F.length,"\u4E2A\u6807\u7B7E)"]}),a?e(De,{onClick:()=>u(p=>!p),color:"#4E6EF2",size:14}):e(ve,{onClick:()=>u(p=>!p),color:"#4E5969",size:14})]})]}),((b=n==null?void 0:n.tags)==null?void 0:b.length)>0&&e("div",{className:"flex flex-wrap gap-4",style:{display:a?"block":"none",marginTop:8},children:((n==null?void 0:n.tags)||[]).map(p=>e(re,{iconPosition:"end",type:"text",style:{backgroundColor:"#F0F0F0",padding:"2px 6px",height:22,borderRadius:2,color:"#1D2129",margin:5},icon:e(Xe,{size:14,color:"#86909C",onClick:()=>{const c={...n,tags:n.tags.filter(B=>B!==p)};s("removeTag",c)}}),children:p},p))})]}),e(re,{type:"text",icon:e(Oe,{size:14}),onClick:()=>s("removeItem",n)})]},n.key)},lu=H.div`
|
|
21
|
+
*/const Ye=ge("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),ye=({title:n,defaultExpanded:s=!0,className:a,children:u})=>{const[h,F]=x(s);return i("div",{className:a,children:[i("div",{className:"flex items-center justify-between",style:{marginBottom:"10px"},children:[i("div",{className:"flex items-center",children:[e("div",{style:{width:"3px",height:"12px",backgroundColor:"#4E6EF2",borderRadius:"6px",marginRight:"6px"}}),e("div",{className:"font-bold",children:n})]}),h?e(De,{onClick:()=>F(b=>!b),color:"#4E6EF2",size:18}):e(ve,{onClick:()=>F(b=>!b),color:"#4E5969",size:18})]}),u?e("div",{style:{display:h?"block":"none"},children:u}):null]})},ce=()=>i("div",{className:"w-full h-[80px] rounded-md flex flex-col justify-center items-center",children:[e("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg",children:i("g",{transform:"translate(0 1)",fill:"none","fill-rule":"evenodd",children:[e("ellipse",{fill:"#f5f5f5",cx:"32",cy:"33",rx:"32",ry:"7"}),i("g",{"fill-rule":"nonzero",stroke:"#d9d9d9",children:[e("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),e("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:"#fafafa"})]})]})}),e("div",{children:"\u6682\u65E0\u53EF\u7528\u6A21\u578B"})]}),Qe="\u63D0\u793A\u8BCD\u7528\u4E8E\u6307\u5B9A\u804A\u5929\u7684\u80CC\u666F\u548C\u4E0A\u4E0B\u6587\uFF0C\u6216\u8005\u8BA9\u52A9\u624B\u91C7\u53D6\u67D0\u4E2A\u4EBA\u683C\u6765\u56DE\u7B54\u4F60\u7684\u95EE\u9898\uFF1B",eu="\u5F00\u5173\u5F00\u542F\uFF0C\u5219\u82E5\u7CFB\u7EDF\u672A\u5728\u77E5\u8BC6\u5E93\u3001\u6570\u636E\u5E93\u7B49\u4F01\u4E1A\u77E5\u8BC6\u6570\u636E\u8303\u56F4\u5185\u68C0\u7D22\u5230\u7B54\u6848\uFF0C\u5219\u76F4\u63A5\u62D2\u7EDD\u56DE\u7B54\u76F8\u5173\u95EE\u9898\uFF1B",uu='\u4F60\u662F\u4E00\u4E2A\u667A\u80FD\u52A9\u624B\uFF0C\u8BF7\u603B\u7ED3\u77E5\u8BC6\u5E93\u7684\u5185\u5BB9\u6765\u56DE\u7B54\u95EE\u9898,\u8BF7\u5217\u4E3E\u77E5\u8BC6\u5E93\u4E2D\u7684\u6570\u636E\u8BE6\u7EC6\u56DE\u7B54\u3002\u5F53\u6240\u6709\u77E5\u8BC6\u5E93\u5185\u5BB9\u90FD\u4E0E\u95EE\u9898\u65E0\u5173\u65F6\uFF0C\u4F60\u7684\u56DE\u7B54\u5FC5\u987B\u5305\u62EC"\u77E5\u8BC6\u5E93\u4E2D\u672A\u627E\u5230\u60A8\u8981\u7684\u7B54\u6848!"',tu="\u60A8\u597D\uFF01\u6211\u6CE8\u610F\u5230\u60A8\u7684\u6D88\u606F\u4E2D\u53EF\u80FD\u5305\u542B\u4E86\u4E00\u4E9B\u654F\u611F\u7684\u5185\u5BB9\u3002\u4E3A\u4E86\u4FDD\u8BC1\u793E\u533A\u7684\u53CB\u597D\u6C1B\u56F4\uFF0C\u6211\u4EEC\u65E0\u6CD5\u7EE7\u7EED\u5C31\u6B64\u8BDD\u9898\u8FDB\u884C\u8BA8\u8BBA\u3002\u5982\u679C\u60A8\u6709\u5176\u4ED6\u95EE\u9898\u6216\u9700\u8981\u5E2E\u52A9\uFF0C\u6211\u5F88\u4E50\u610F\u7EE7\u7EED\u4E3A\u60A8\u670D\u52A1\uFF01\u8C22\u8C22\u60A8\u7684\u7406\u89E3\u548C\u652F\u6301\u3002",te={top_k:{default:10,min:1,max:15,step:1,tooltip:"top_k\u4EE3\u8868\u6A21\u578B\u6700\u7EC8\u53D6\u4FE1\u7684\u6587\u672C\u5757\u6570\uFF0C\u4F8B\u5982\u95E8\u69DBtop_p = 0.8\uFF0Ctop_k = 3\uFF0C\u610F\u5473\u7740\u6A21\u578B\u4F1A\u4F9D\u636E\u76F8\u4F3C\u5EA6\u9AD8\u4F4E\u53D6\u524D3\u4E2A\u5927\u4E8E0.8\u7684\u6587\u672C\u5757\uFF0C\u5373\u4F7F\u5F53\u524D\u53EF\u80FD\u6709\u5927\u4E8E3\u4E2A\u6587\u672C\u5757\u7684\u76F8\u4F3C\u5EA6\u5927\u4E8E0.8\uFF1B"},max_tokens:{default:4096,min:0,max:1e4,step:64,tooltip:"max_tokens\u4EE3\u8868\u6A21\u578B\u7A97\u53E3\u5927\u5C0F\uFF0C\u5373\u4E00\u6B21\u95EE\u7B54\u5927\u6A21\u578B\u4E00\u6B21\u80FD\u591F\u63A5\u53D7\u7684\u5B57\u7B26\u4E32\u6700\u5927\u957F\u5EA6\uFF0C\u5305\u62EC\u7528\u6237\u7684\u63D0\u95EE\u548C\u6A21\u578B\u7684\u56DE\u7B54\uFF1B\u591A\u8F6E\u5BF9\u8BDD\u4E2D\u5386\u53F2\u5BF9\u8BDD\u5185\u5BB9\u4E5F\u5305\u62EC\u5728\u5185\uFF1B\u6700\u5927\u503C\u53D6\u51B3\u4E8E\u5927\u6A21\u578B\u672C\u8EAB\u662F\u5426\u652F\u6301\uFF1B"},max_round:{default:5,min:0,max:32,step:1,tooltip:"\u4EA4\u4E92\u5BF9\u8BDD\u573A\u666F\u91CC\uFF0C\u7CFB\u7EDF\u80FD\u591F\u8BB0\u5FC6\u5E76\u6709\u6548\u5173\u8054\u7684\u7528\u6237\u4E0E\u6A21\u578B\u4E4B\u95F4\u6765\u56DE\u4EA4\u6D41\u7684\u6700\u5927\u6B21\u6570\uFF1B"},temperature:{default:.3,min:.1,max:1,step:.1,tooltip:"\u6E29\u5EA6\u662F\u6A21\u578B\u56DE\u7B54\u7684\u503E\u5411\u6027\uFF0C\u53D6\u503C\u8303\u56F4\u4E00\u822C\u662F0\uFF5E1; \u53D6\u503C\u8D8B\u8FD10\u4EE3\u8868\u7740\u6A21\u578B\u56DE\u7B54\u4F1A\u66F4\u4E25\u8C28\uFF0C\u9002\u5408\u56DE\u7B54\u68C0\u7D22\u7C7B\u95EE\u9898; \u53D6\u503C\u8D8B\u8FD11\u5219\u4EE3\u8868\u56DE\u7B54\u66F4\u53D1\u6563\uFF0C\u9002\u5408\u56DE\u7B54\u521B\u65B0\u6027\u7684\u95EE\u9898\uFF1B"},top_p:{default:.8,min:.1,max:1,step:.1,tooltip:"top_p \u7528\u4E8E\u63A7\u5236\u5927\u6A21\u578B\u751F\u6210\u7B56\u7565\uFF0C\u51B3\u5B9A\u4E86\u6A21\u578B\u5728\u751F\u6210\u4E0B\u4E00\u4E2A\u8BCD\u65F6\uFF0C\u4ECE\u7D2F\u79EF\u6982\u7387\u8FBE\u5230 p \u7684\u6700\u5C0F\u8BCD\u96C6\u5408\u4E2D\u8FDB\u884C\u91C7\u6837\u3002\u901A\u5E38\u8BBE\u7F6E\u57280.8 - 0.95\u4E4B\u95F4\uFF0Ctop_p\u8D8A\u4F4E\u6A21\u578B\u7528\u8BCD\u8D8A\u4FDD\u5B88\uFF0C\u8D8A\u9AD8\u8D8A\u6D3B\u8DC3\u3002"},score_threshold:{default:.1,min:.1,max:1,step:.1,tooltip:"score_threshold\u53C2\u6570\u662F\u6A21\u578B\u8FDB\u884C\u91CD\u6392\u5E8F\u65F6\uFF0C\u5BF9\u4E8E\u6587\u672C\u5757\u53D6\u820D\u7684\u95E8\u69DB\u503C\uFF1B"}},nu={search_policy:1,enabled_rerank:!0,need_trace_source:!0,trace_by_llm:!0,is_download:!1,dependOnKb:0,enabled_faq:!1,enabled_graph:!1,enabled_question_rewrite:!1,isDefault:0},su=[{label:"\u6DF7\u5408\u68C0\u7D22",value:1},{label:"\u5168\u6587\u68C0\u7D22",value:2},{label:"\u8BED\u4E49\u68C0\u7D22",value:3}],ru=[{label:"\u89C4\u5219\u6EAF\u6E90",value:!1},{label:"\u5927\u6A21\u578B\u6EAF\u6E90",value:!0}],he=({url:n,token:s,role:a,eventsEmit:u})=>{const h=Ke.create({baseURL:n,timeout:1e6});return h.interceptors.request.use(l=>{let t=s;return!t&&!["user/login","user/kaptcha","user/regist"].some(d=>l.url.includes(d))?(u&&u("request:error_auth",{errorMsg:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F",redirect:"/login"}),Promise.reject(new Error("\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"))):(l.headers.Authorization=t||"",l.headers.userName=a==="\u672A\u767B\u5F55\u7528\u6237"?"":a,l)}),h.interceptors.response.use(l=>{const t=["user/kaptcha"],r=l.data;if(t.some(_=>l.config.url&&l.config.url.includes(_))||r.size&&r.type)return r;const{success:d,errorMsg:E,errorCode:m}=r;if(d)return r;u&&u("request:error_business",{errorCode:m,errorMsg:E||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",response:r})},l=>{var t,r,d,E,m,_,v,I,Z;if(l.message==="canceled")return Promise.reject(l);if(u){let g="request:error_network",A={errorMsg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:l};((t=l==null?void 0:l.response)==null?void 0:t.status)===401?(g="request:error_auth",A={errorMsg:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",error:l,redirect:"/login"}):(((d=(r=l==null?void 0:l.response)==null?void 0:r.data)==null?void 0:d.errorCode)==="30013"||((m=(E=l==null?void 0:l.response)==null?void 0:E.data)==null?void 0:m.errorCode)==="30023")&&(g="request:error_business",A={errorCode:(v=(_=l==null?void 0:l.response)==null?void 0:_.data)==null?void 0:v.errorCode,errorMsg:((Z=(I=l==null?void 0:l.response)==null?void 0:I.data)==null?void 0:Z.errorMsg)||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",error:l}),u(g,A)}return Promise.reject(l)}),{getConfigById:async l=>{try{const t=await h.get(`/qa/search/config/getById?configId=${l}`),{success:r,data:d}=t;return r?d:!1}catch(t){console.error("getConfigById",t)}},fetchDatabases:async()=>{try{const l=await h.get("/index/database/queryAllDBList"),{success:t,data:r}=l;return t?r:!1}catch(l){console.error("fetchDatabases",l)}},fetchModels:async l=>{try{const t=await h.get(`/index/modelInfo/allPage?${new URLSearchParams(l).toString()}`),{success:r,data:d}=t;return r?d:!1}catch(t){return console.log("fetchModels error",t),!1}},fetchSensitiveLibrary:async l=>{try{const t=await h.get(`/sensitive/library?${new URLSearchParams(l).toString()}`),{success:r,data:d}=t;return r?d:!1}catch(t){return console.log("fetchSensitiveLibrary error",t),!1}},fetchConfigItemLimit:async()=>{try{const l=await h.get("/qa/search/config/configItemLimit"),{success:t,data:r}=l;return t?r:!1}catch(l){console.error("fetchConfigItemLimit error",l)}},fetchKnowledgeBase:async l=>{try{const t=l?`?userName=${l}`:"";console.log("+++",t);const r=await h.get(`/index/knowledgeBase/searchList${t}`),{success:d,data:E}=r;return d?E:!1}catch(t){console.log("e",t)}},fetchGraphs:async()=>{try{const l=await h.get("/index/graph/platform/querySnapshotList?pageSize=999&pageNo=1"),{success:t,data:r}=l;return t?r:!1}catch(l){console.error("fetchGraphs",l)}},checkName:async(l,t)=>{try{const r=await h.get(`/qa/search/config/checkName?configName=${l}${t?`&configId=${t}`:""}`),{success:d,data:E}=r;if(d)return E}catch(r){return console.log("updateConversationAssistant error:",r),!1}},getBizLabelLabels:async l=>{try{const t=await h.post("/index/bizLabel/labels",l),{success:r,data:d}=t;if(r)return d}catch(t){return console.log("updateConversationAssistant error:",t),!1}},addConversationAssistant:async l=>{try{const t=await h.post("/qa/search/config/add",{...l}),{success:r,data:d}=t;if(r)return d}catch(t){return console.log("addConversationAssistant error:",t),!1}},updateConversationAssistant:async(l,t)=>{try{const r=await h.put("/qa/search/config/update",{id:l,...t}),{success:d,data:E}=r;if(d)return E}catch(r){return console.log("updateConversationAssistant error:",r),!1}}}},Ce=({countText:n,eventsEmit:s,data:a})=>{const[u,h]=x(!0);return i("div",{style:{marginTop:8},children:[n&&i("div",{className:"flex items-center gap-2",children:[e("span",{style:{color:u?"#4E6EF2":"#4E5969"},children:n}),u?e(De,{onClick:()=>h(F=>!F),color:"#4E6EF2",size:14}):e(ve,{onClick:()=>h(F=>!F),color:"#4E5969",size:14})]}),e("div",{style:{display:u?"block":"none"},children:a.map(F=>e(au,{item:F,eventsEmit:s},F.key))})]})},au=({item:n,eventsEmit:s})=>{var h,F,b;const[a,u]=x(!0);return i("div",{className:"flex items-center justify-between",style:{padding:"8px 12px",borderRadius:6},children:[i("div",{children:[i("div",{style:{color:"#1D2129"},className:"flex items-center",children:[n.label,((h=n==null?void 0:n.tags)==null?void 0:h.length)>0&&i(Me,{children:[i("span",{style:{color:"#4E5969",marginLeft:"6px",marginRight:6},children:["(",(F=n==null?void 0:n.tags)==null?void 0:F.length,"\u4E2A\u6807\u7B7E)"]}),a?e(De,{onClick:()=>u(p=>!p),color:"#4E6EF2",size:14}):e(ve,{onClick:()=>u(p=>!p),color:"#4E5969",size:14})]})]}),((b=n==null?void 0:n.tags)==null?void 0:b.length)>0&&e("div",{className:"flex flex-wrap gap-4",style:{display:a?"block":"none",marginTop:8},children:((n==null?void 0:n.tags)||[]).map(p=>e(re,{iconPosition:"end",type:"text",style:{backgroundColor:"#F0F0F0",padding:"2px 6px",height:22,borderRadius:2,color:"#1D2129",margin:5},icon:e(Xe,{size:14,color:"#86909C",onClick:()=>{const c={...n,tags:n.tags.filter(B=>B!==p)};s("removeTag",c)}}),children:p},p))})]}),e(re,{type:"text",icon:e(Oe,{size:14}),onClick:()=>s("removeItem",n)})]},n.key)},lu=q.div`
|
|
22
22
|
display: flex;
|
|
23
23
|
background-color: #ffffff;
|
|
24
24
|
border: 1px solid ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.border)==null?void 0:u.default)||"#e5e7eb"}};
|
|
@@ -27,7 +27,7 @@ import{jsxs as i,jsx as e,Fragment as Me}from"react/jsx-runtime";import He,{useS
|
|
|
27
27
|
width: ${n=>n.$width||"600px"};
|
|
28
28
|
height: ${n=>n.$height||"400px"};
|
|
29
29
|
position: relative;
|
|
30
|
-
`,Se=
|
|
30
|
+
`,Se=q.div`
|
|
31
31
|
display: flex;
|
|
32
32
|
flex-direction: column;
|
|
33
33
|
border-right: 1px solid ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.border)==null?void 0:u.default)||"#e5e7eb"}};
|
|
@@ -36,7 +36,7 @@ import{jsxs as i,jsx as e,Fragment as Me}from"react/jsx-runtime";import He,{useS
|
|
|
36
36
|
&:last-child {
|
|
37
37
|
border-right: none;
|
|
38
38
|
}
|
|
39
|
-
`,ou=
|
|
39
|
+
`,ou=q.div`
|
|
40
40
|
padding: 12px 16px;
|
|
41
41
|
font-weight: 400;
|
|
42
42
|
font-size: 14px;
|
|
@@ -44,14 +44,14 @@ import{jsxs as i,jsx as e,Fragment as Me}from"react/jsx-runtime";import He,{useS
|
|
|
44
44
|
align-items: center;
|
|
45
45
|
justify-content: space-between;
|
|
46
46
|
color: ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.text)==null?void 0:u.primary)||"#4E5969"}};
|
|
47
|
-
`,cu=
|
|
47
|
+
`,cu=q.div`
|
|
48
48
|
font-weight: 400;
|
|
49
49
|
font-size: 14px;
|
|
50
50
|
color: ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.text)==null?void 0:u.primary)||"#4E6EF2"}};
|
|
51
|
-
`,iu=
|
|
51
|
+
`,iu=q.div`
|
|
52
52
|
padding: 12px;
|
|
53
53
|
background-color: ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.background)==null?void 0:u.default)||"#ffffff"}};
|
|
54
|
-
`,du=
|
|
54
|
+
`,du=q.input`
|
|
55
55
|
width: 100%;
|
|
56
56
|
padding: 8px 12px 8px 12px;
|
|
57
57
|
border: 1px solid ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.border)==null?void 0:u.default)||"#e5e7eb"}};
|
|
@@ -68,14 +68,14 @@ import{jsxs as i,jsx as e,Fragment as Me}from"react/jsx-runtime";import He,{useS
|
|
|
68
68
|
&::placeholder {
|
|
69
69
|
color: ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.text)==null?void 0:u.tertiary)||"#9ca3af"}};
|
|
70
70
|
}
|
|
71
|
-
`,hu=
|
|
71
|
+
`,hu=q.div`
|
|
72
72
|
position: absolute;
|
|
73
73
|
right: 20px;
|
|
74
74
|
top: 50%;
|
|
75
75
|
transform: translateY(-50%);
|
|
76
76
|
color: #9ca3af;
|
|
77
77
|
pointer-events: none;
|
|
78
|
-
`,Ne=
|
|
78
|
+
`,Ne=q.div`
|
|
79
79
|
flex: 1;
|
|
80
80
|
overflow-y: auto;
|
|
81
81
|
overflow-x: hidden;
|
|
@@ -96,7 +96,7 @@ import{jsxs as i,jsx as e,Fragment as Me}from"react/jsx-runtime";import He,{useS
|
|
|
96
96
|
background: #a8a8a8;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
`,$e=
|
|
99
|
+
`,$e=q.div`
|
|
100
100
|
padding: 10px 16px;
|
|
101
101
|
cursor: ${n=>n.$disabled?"not-allowed":"pointer"};
|
|
102
102
|
transition: all 0.2s;
|
|
@@ -112,14 +112,14 @@ import{jsxs as i,jsx as e,Fragment as Me}from"react/jsx-runtime";import He,{useS
|
|
|
112
112
|
&:last-child {
|
|
113
113
|
border-bottom: none;
|
|
114
114
|
}
|
|
115
|
-
`,Ie=
|
|
115
|
+
`,Ie=q.span`
|
|
116
116
|
flex: 1;
|
|
117
117
|
font-size: 14px;
|
|
118
118
|
color: ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.text)==null?void 0:u.primary)||"#111827"}};
|
|
119
119
|
overflow: hidden;
|
|
120
120
|
text-overflow: ellipsis;
|
|
121
121
|
white-space: nowrap;
|
|
122
|
-
`,Le=
|
|
122
|
+
`,Le=q.button`
|
|
123
123
|
display: flex;
|
|
124
124
|
align-items: center;
|
|
125
125
|
justify-content: center;
|
|
@@ -136,12 +136,12 @@ import{jsxs as i,jsx as e,Fragment as Me}from"react/jsx-runtime";import He,{useS
|
|
|
136
136
|
cursor: not-allowed;
|
|
137
137
|
color: ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.text)==null?void 0:u.secondary)||"#C9CDD4"}};
|
|
138
138
|
}
|
|
139
|
-
`,ze=
|
|
139
|
+
`,ze=q.div`
|
|
140
140
|
padding: 40px 20px;
|
|
141
141
|
text-align: center;
|
|
142
142
|
color: ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.text)==null?void 0:u.tertiary)||"#9ca3af"}};
|
|
143
143
|
font-size: 14px;
|
|
144
|
-
`;
|
|
144
|
+
`;q.span`
|
|
145
145
|
display: inline-flex;
|
|
146
146
|
align-items: center;
|
|
147
147
|
justify-content: center;
|
|
@@ -154,4 +154,4 @@ import{jsxs as i,jsx as e,Fragment as Me}from"react/jsx-runtime";import He,{useS
|
|
|
154
154
|
font-size: 12px;
|
|
155
155
|
font-weight: 500;
|
|
156
156
|
margin-left: 8px;
|
|
157
|
-
`;const me=qe(({dataSource:n,value:s=[],onConfirm:a,maxCount:u=0,searchPlaceholder:h="\u641C\u7D22...",title:F="",showSearch:b=!0,filterOption:p,renderItem:c,renderSelectedItem:B,className:z,style:y,styles:f,height:R,width:w},j)=>{const l=We(),t=ke(ke({theme:O,mode:"light"},l),f),[r,d]=x(s),[E,m]=x("");W(()=>{d(s)},[s]),ie(()=>new Set(s.map(o=>o.key)),[s]);const _=ie(()=>new Set(r.map(o=>o.key)),[r]);Ve(j,()=>({getSelectedItems:()=>r,confirm:()=>{a==null||a(r)}}),[r,a]);const I=p||((o,D)=>{var q;if(!o)return!0;const k=o.toLowerCase();return D.label.toLowerCase().includes(k)||((q=D.tags)==null?void 0:q.some(V=>V.toLowerCase().includes(k)))||!1}),Z=ie(()=>(n||[]).filter(o=>I(E,o)),[n,E,I]),g=o=>{const D=_.has(o.key);let k;if(D)k=(r||[]).filter(q=>q.key!==o.key);else{if(u>0&&r.length>=u)return;k=[...r,o]}d(k)},A=(o,D)=>{d(k=>k.map(V=>V.key==o?{...V,tags:D}:V))},N=o=>{const D=(r||[]).filter(k=>k.key!==o.key);d(D)},$=o=>_.has(o);return u>0&&r.length>=u,i(lu,{$theme:t.theme||O,$width:w,$height:R,className:z,style:y,children:[i(Se,{$theme:t.theme||O,style:{flex:1},children:[b&&e(iu,{$theme:t.theme||O,children:i("div",{style:{position:"relative"},children:[e(hu,{children:e(Ye,{size:16})}),e(du,{$theme:t.theme||O,type:"text",placeholder:h,value:E,onChange:o=>m(o.target.value)})]})}),e(Ne,{children:Z.length===0?e(ze,{$theme:t.theme||O,children:E?"\u672A\u627E\u5230\u5339\u914D\u9879":"\u6682\u65E0\u6570\u636E"}):Z.map(o=>{const D=$(o.key);return i($e,{$theme:t.theme||O,$selected:D,children:[e(Ie,{$theme:t.theme||O,children:c?c(o):o.label}),D&&e(Le,{$theme:t.theme||O,onClick:k=>{k.stopPropagation(),N(o)},disabled:!0,children:"\u5DF2\u6DFB\u52A0"}),!D&&e(Le,{$theme:t.theme||O,onClick:k=>{k.stopPropagation(),g(o)},children:"\u6DFB\u52A0"})]},o.key)})})]}),i(Se,{$theme:t.theme||O,style:{flex:1},children:[i(ou,{$theme:t.theme||O,children:[u>0?`\u5DF2\u9009\uFF1A${r.length}/${u}\u4E2A${F}`:`\u5DF2\u9009\uFF1A${r.length}\u4E2A${F}`,e(cu,{$theme:t.theme||O,onClick:o=>{o.stopPropagation(),d([])},children:"\u6E05\u7A7A"})]}),e(Ne,{children:r.length===0?e(ze,{$theme:t.theme||O,children:"\u6682\u65E0\u5DF2\u9009\u9879"}):r.map(o=>{var k,q,V;const D=ee=>A(o.key,ee);return i($e,{$theme:t.theme||O,children:[e(Ie,{$theme:t.theme||O,children:B?B(o,D):o.label}),e(Oe,{size:14,color:((V=(q=(k=t.theme)==null?void 0:k.colors)==null?void 0:q.text)==null?void 0:V.secondary)||"#86909C",style:{cursor:"pointer"},onClick:ee=>{ee.stopPropagation(),N(o)}})]},o.key)})})]})]})});me.displayName="SearchableSelector";const be="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='20'%20height='20'%20rx='2.22222'%20fill='%23FFCC3C'/%3e%3cpath%20d='M13.3263%2012.7917H7.53763C7.33426%2012.8116%207.17923%2012.9825%207.17923%2013.1867C7.17923%2013.3909%207.33426%2013.5618%207.53763%2013.5817H13.3277C13.3828%2013.5871%2013.4384%2013.5809%2013.4909%2013.5634C13.5435%2013.546%2013.5918%2013.5178%2013.6328%2013.4806C13.6738%2013.4434%2013.7066%2013.3981%2013.729%2013.3474C13.7514%2013.2968%2013.763%2013.2421%2013.763%2013.1867C13.763%2013.1313%2013.7514%2013.0766%2013.729%2013.026C13.7066%2012.9753%2013.6738%2012.93%2013.6328%2012.8928C13.5918%2012.8556%2013.5435%2012.8274%2013.4909%2012.8099C13.4384%2012.7925%2013.3828%2012.7863%2013.3277%2012.7917H13.3263ZM9.19742%207.60418L8.84232%208.55193H9.57339L9.19742%207.60418Z'%20fill='white'/%3e%3cpath%20d='M15.3211%2014.7707V6.9692H14.4704V14.3543H6.70511C6.06668%2014.3392%205.55704%2013.8173%205.55704%2013.1788C5.55704%2012.5402%206.06668%2012.0184%206.70511%2012.0033H13.352C13.4644%2012.0075%2013.5735%2011.9648%2013.653%2011.8852C13.6923%2011.8459%2013.7231%2011.7988%2013.7434%2011.747C13.7638%2011.6952%2013.7731%2011.6398%2013.771%2011.5842V5.20102C13.7736%205.14526%2013.7646%205.08958%2013.7445%205.03752C13.7244%204.98546%2013.6936%204.93816%2013.6542%204.89865C13.6148%204.85915%2013.5675%204.82832%2013.5155%204.80812C13.4634%204.78792%2013.4077%204.7788%2013.352%204.78134H6.70511C5.60281%204.80136%204.71609%205.69369%204.70291%206.79599V13.1759C4.71609%2014.283%205.61038%2015.1773%206.71756%2015.1905H14.8893C15.0042%2015.1994%2015.1173%2015.1585%2015.1999%2015.0782C15.2407%2015.0385%2015.2727%2014.9905%2015.2936%2014.9375C15.3145%2014.8845%2015.3239%2014.8276%2015.3211%2014.7707ZM8.98782%206.78585H9.44888L10.7213%209.92562H10.2475L9.9075%209.06759H8.51871L8.19742%209.92562H7.72354L8.98782%206.78585Z'%20fill='white'/%3e%3c/svg%3e",{Item:mu}=de,pu=({url:n,token:s,role:a,eventsEmit:u,sectionData:h,defaultAnswer:F,form:b})=>{const[p,c]=x([]),[B,z]=x([]),[y,f]=x(!1),[R,w]=x(!1),j=se(null),{fetchSensitiveLibrary:l}=he({url:n,token:s,role:a,eventsEmit:u});W(()=>{t()},[]),W(()=>{if(h&&(p==null?void 0:p.length)>0){let m=h?Array.isArray(h)?h:h.split(","):[],_=[];m.forEach(v=>{const I=(p||[]).find(Z=>Z.key===v);I&&_.push({key:I.key,label:I.label})}),z(_)}},[h,p]),W(()=>{F&&w(!0)},[F]);const t=async()=>{try{const m=await l({pageNo:1,pageSize:9999});if(m!=null&&m.records){const _=((m==null?void 0:m.records)||[]).map(v=>({key:v.id+"",label:v.name}));c(_)}}catch(m){console.error(m)}},r=(m,_)=>{switch(m){case"removeItem":const v=B.filter(I=>I.key!==_.key);z([...v]),d(v);break}},d=m=>{const _=m.map(v=>(v==null?void 0:v.key)||"").filter(v=>v).join(",");u&&u("sensitive_selected",_)},E=()=>{var _;const m=((_=j.current)==null?void 0:_.getSelectedItems())||[];z(m),f(!1),d(m)};return i("div",{style:{borderBottom:"1px solid #E5E6EB",padding:"12px 0 "},children:[i("div",{className:"flex items-center justify-between",children:[i("div",{className:"flex items-center",children:[e("img",{src:be}),e("span",{className:"font-medium ",style:{marginLeft:"10px"},children:"\u654F\u611F\u8BCD"})]}),e(re,{color:"primary",variant:"outlined",size:"small",icon:e(Fe,{size:14}),onClick:()=>f(!0),children:"\u6DFB\u52A0"})]}),e(_e,{checked:R,onChange:m=>{w(m.target.checked),m.target.checked?b.setFieldsValue({defaultAnswer:tu}):b.setFieldsValue({defaultAnswer:""})},style:{marginBottom:8,marginTop:8},children:"\u81EA\u5B9A\u4E49\u56DE\u590D"}),R&&e(mu,{label:"\u81EA\u5B9A\u4E49\u56DE\u590D\u5185\u5BB9",name:"defaultAnswer",layout:"vertical",children:e(fe.TextArea,{style:{height:"55px",resize:"none"}})}),(B==null?void 0:B.length)>0&&e(Ce,{countText:(B==null?void 0:B.length)>0?`\u5DF2\u9009\uFF1A${B==null?void 0:B.length}\u4E2A\u654F\u611F\u8BCD\u5E93`:void 0,eventsEmit:r,data:B}),e(Ee,{width:740,title:"\u9009\u62E9\u654F\u611F\u8BCD",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",open:y,onOk:E,onCancel:()=>f(!1),destroyOnHidden:!0,className:"assistant-config-resource-bind-modal",children:e(me,{ref:j,dataSource:p,value:B,searchPlaceholder:"\u641C\u7D22\u540D\u79F0...",width:"700px",height:"500px",title:"\u654F\u611F\u8BCD\u5E93",renderItem:m=>i("div",{className:"flex ",children:[e("img",{src:be,alt:"add"}),e("span",{style:{marginLeft:8,marginRight:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:m.label,children:m.label})]}),renderSelectedItem:(m,_)=>i("div",{className:"flex items-center",children:[e("img",{src:be,alt:"add"}),e("div",{style:{marginLeft:"12px"},children:e("div",{style:{fontWeight:500},children:m.label})})]})})})]})},Ae="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='20'%20height='20'%20rx='2.22222'%20fill='%2300B2F9'/%3e%3cpath%20d='M5.3125%2013.9672V13.975C5.32812%2014.6938%205.89922%2015.2734%206.61875%2015.2734H13.9062C14.3375%2015.2734%2014.6875%2014.9289%2014.6875%2014.4977V5.50703C14.6875%205.40447%2014.6673%205.30292%2014.628%205.20818C14.5887%205.11344%2014.5312%205.02736%2014.4586%204.95488C14.3861%204.8824%2014.2999%204.82492%2014.2052%204.78575C14.1104%204.74657%2014.0088%204.72646%2013.9062%204.72656H6.875C6.01172%204.72656%205.3125%205.42031%205.3125%206.28359V13.9672ZM7.5%209.24531V6.25C7.5%206.07813%207.64062%205.9375%207.8125%205.9375H9.6875C9.86016%205.9375%2010%206.07813%2010%206.25V9.24531C10%209.30716%209.98175%209.36762%209.94741%209.41906C9.91308%209.47049%209.86425%209.51058%209.80712%209.53426C9.74999%209.55793%209.68712%209.56412%209.62647%209.55204C9.56581%209.53996%209.51011%209.51016%209.46641%209.46641L8.97109%208.97109C8.94207%208.94204%208.90761%208.91899%208.86967%208.90326C8.83173%208.88754%208.79107%208.87944%208.75%208.87944C8.70893%208.87944%208.66827%208.88754%208.63033%208.90326C8.59239%208.91899%208.55793%208.94204%208.52891%208.97109L8.03359%209.46641C7.98989%209.51016%207.93418%209.53996%207.87353%209.55204C7.81288%209.56412%207.75001%209.55793%207.69288%209.53426C7.63575%209.51058%207.58692%209.47049%207.55259%209.41906C7.51825%209.36762%207.49995%209.30716%207.5%209.24531ZM6.54375%2014.2063C6.45208%2014.1156%206.40625%2014.0052%206.40625%2013.875C6.40625%2013.7458%206.45208%2013.6354%206.54375%2013.5438C6.6349%2013.4521%206.74531%2013.4062%206.875%2013.4062H13.5938V14.3438H6.875C6.74531%2014.3438%206.6349%2014.2979%206.54375%2014.2063Z'%20fill='white'/%3e%3c/svg%3e",fu=({url:n,token:s,role:a,sectionData:u,createBy:h,eventsEmit:F})=>{const[b,p]=x(),[c,B]=x([]),[z,y]=x(!1),f=se(null),[R,w]=x(!1),[j,l]=x([]),t=se(new Map).current,{fetchKnowledgeBase:r,getBizLabelLabels:d}=he({url:n,token:s,role:a,eventsEmit:F}),E=se(!1);W(()=>{E.current||(h?(m(h),E.current=!0):(m(),E.current=!0))},[h]),W(()=>{if(u&&(b==null?void 0:b.length)>0){const g=u==null?void 0:u.knowledge_base_name_source,A=g&&(Array.isArray(g)?g:g.split(";"));let N=[];(A||[]).forEach($=>{const o=((u==null?void 0:u.selectedKnowledgeBase)||[]).find(X=>X.name==$),D=(b||[]).find(X=>X.knowledge_base_name_source===$),{key:k,label:q,knowledge_base_name:V,knowledge_base_name_source:ee}=D;N.push({key:k,label:q,knowledge_base_name:V,knowledge_base_name_source:ee,tags:o==null?void 0:o.labels})}),B(N)}},[u,b]);const m=async g=>{try{const A=await r(g);if(A){const N=(A||[]).map($=>({key:$.id,label:$.kbName,knowledge_base_name:$.primitiveName,knowledge_base_name_source:$.kbName}));p(N)}}catch(A){console.error(A)}},_=(g,A)=>{switch(g){case"removeItem":const N=c.filter(o=>o.key!==A.key);B([...N]),v(N);break;case"removeTag":const $=c.findIndex(o=>o.key==A.key);$!==-1&&(c[$]=A),B([...c]),v(c);break}},v=g=>{const A=(g||[]).map(o=>(o==null?void 0:o.knowledge_base_name)||"").filter(o=>o).join(";"),N=(g||[]).map(o=>(o==null?void 0:o.knowledge_base_name_source)||"").filter(o=>o).join(";"),$=(g||[]).filter(o=>{var D;return Array.isArray(o==null?void 0:o.tags)&&((D=o.tags)==null?void 0:D.length)>0}).map(o=>({id:o.key,name:o.label,knowledge_base_name_source:o.knowledge_base_name_source,labels:o.tags}));F&&F("knowledge_selected",{knowledge_base_name:A,knowledge_base_name_source:N,selectedKnowledgeBase:$})},I=()=>{var A;const g=((A=f.current)==null?void 0:A.getSelectedItems())||[];B(g),y(!1),v(g)},Z=async(g,A)=>{if(g){const N=t.get(A);if(N){l(N);return}if(!R)try{w(!0);const $=await d({kbNames:[A]});if(Array.isArray($)){const o=$.length?$[0].label:"",D=o?(o||"").split(",").map(k=>({label:k,value:k})):[];t.set(A,D),l(D)}w(!1)}catch($){console.error("Error fetching data:",$),w(!1)}}};return i("div",{style:{borderBottom:"1px solid #E5E6EB",padding:"12px 0 "},children:[i("div",{className:"flex items-center justify-between",children:[i("div",{className:"flex items-center",children:[e("img",{src:Ae}),e("span",{className:"font-medium ",style:{marginLeft:"10px"},children:"\u77E5\u8BC6\u5E93"})]}),e("div",{className:"flex items-center gap-2",children:e(re,{color:"primary",variant:"outlined",size:"small",icon:e(Fe,{size:14}),onClick:()=>y(!0),children:"\u6DFB\u52A0"})})]}),(c==null?void 0:c.length)>0&&e(Ce,{countText:(c==null?void 0:c.length)>0?`\u5DF2\u9009\uFF1A${c==null?void 0:c.length}\u4E2A\u77E5\u8BC6\u5E93`:void 0,eventsEmit:_,data:c}),e(Ee,{width:740,className:"assistant-config-resource-bind-modal",title:"\u9009\u62E9\u77E5\u8BC6\u5E93",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",open:z,onOk:I,onCancel:()=>y(!1),destroyOnHidden:!0,children:e(me,{ref:f,dataSource:b,value:c,searchPlaceholder:"\u641C\u7D22\u540D\u79F0...",width:"700px",height:"500px",title:"\u77E5\u8BC6\u5E93",renderItem:g=>i("div",{className:"flex ",children:[e("img",{src:Ae,alt:"add"}),e("span",{style:{marginLeft:8,marginRight:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:g.label,children:g.label})]}),renderSelectedItem:(g,A)=>i("div",{className:"flex ",children:[e("img",{src:Ae,alt:"add"}),i("div",{style:{marginLeft:"12px"},children:[e("div",{style:{marginBottom:"8px",fontWeight:500},children:g.label}),e(Q,{mode:"tags",placeholder:"\u9009\u62E9\u6807\u7B7E...",maxTagCount:1,value:g.tags||[],onChange:N=>{A(N)},style:{width:250},options:j,loading:R,onOpenChange:N=>{Z(N,g.knowledge_base_name)}})]})]})})})]})},gu=He.memo(fu),we="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='24'%20height='24'%20rx='3.55556'%20fill='%23925BFF'/%3e%3cpath%20d='M11.9971%2011.265C15.249%2011.265%2017.8891%2010.443%2017.8891%209.423V7.95288C17.8891%206.93291%2015.2492%206.11084%2011.9971%206.11084C8.74513%206.11084%206.10504%206.93276%206.10504%207.95288V9.42285C6.10504%2010.437%208.73898%2011.265%2011.9971%2011.265Z'%20fill='white'/%3e%3cpath%20d='M11.9971%2014.577C15.249%2014.577%2017.8891%2013.7551%2017.8891%2012.7349V10.527C17.8891%2011.5469%2015.2492%2012.369%2011.9971%2012.369C8.74513%2012.369%206.10504%2011.5471%206.10504%2010.527V12.7349C6.10504%2013.749%208.73898%2014.577%2011.9971%2014.577Z'%20fill='white'/%3e%3cpath%20d='M11.9971%2015.681C8.7451%2015.681%206.11102%2014.859%206.11102%2013.839V16.0469C6.11102%2017.0609%208.74496%2017.889%2012.0031%2017.889C15.255%2017.889%2017.8951%2017.0671%2017.8951%2016.0469V13.8391C17.889%2014.859%2015.249%2015.681%2011.9971%2015.681Z'%20fill='white'/%3e%3c/svg%3e",Pe=10,Fu=({url:n,token:s,role:a,eventsEmit:u,sectionData:h,disabled:F})=>{const[b,p]=x([]),[c,B]=x([]),[z,y]=x(!1),f=se(null),{fetchDatabases:R}=he({url:n,token:s,role:a,eventsEmit:u});W(()=>{w()},[]),W(()=>{if(h){let t=[];(h||[]).map(r=>{const d=(b||[]).find(E=>E.key===r.key);if(d){const{key:E,label:m}=d;t.push({key:E,label:m})}}),B(t)}},[h,b]);const w=async()=>{try{const t=await R();if(t){const r=(t||[]).map(d=>({key:d.primitiveName,label:d.name}));p(r)}}catch(t){console.error(t)}},j=(t,r)=>{switch(t){case"removeItem":const d=c.filter(E=>E.key!==r.key);B([...d]),u&&u("database_selected",d);break}},l=()=>{var r;const t=((r=f.current)==null?void 0:r.getSelectedItems())||[];B(t),y(!1),u&&u("database_selected",t)};return i("div",{style:{borderBottom:"1px solid #E5E6EB",padding:"12px 0 "},children:[i("div",{className:"flex items-center justify-between",children:[i("div",{className:"flex items-center",children:[e("img",{src:we}),e("span",{className:"font-medium ",style:{marginLeft:"10px"},children:"\u6570\u636E\u5E93"})]}),e("div",{className:"flex items-center gap-2",children:e(re,{color:"primary",variant:"outlined",size:"small",icon:e(Fe,{size:14}),onClick:()=>y(!0),disabled:c.length>=Pe||F,children:"\u6DFB\u52A0"})})]}),(c==null?void 0:c.length)>0&&e(Ce,{countText:(c==null?void 0:c.length)>0?`\u5DF2\u9009\uFF1A${c==null?void 0:c.length}\u4E2A\u6570\u636E\u5E93`:void 0,eventsEmit:j,data:c}),e(Ee,{width:740,title:"\u9009\u62E9\u6570\u636E\u5E93",className:"assistant-config-resource-bind-modal",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",open:z,onOk:l,onCancel:()=>y(!1),destroyOnHidden:!0,children:e(me,{ref:f,dataSource:b,value:c,searchPlaceholder:"\u641C\u7D22\u540D\u79F0...",width:"700px",height:"500px",title:"\u6570\u636E\u5E93",maxCount:Pe,renderItem:t=>i("div",{className:"flex ",children:[e("img",{src:we,alt:"add"}),e("span",{style:{marginLeft:8,marginRight:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:t.label,children:t.label})]}),renderSelectedItem:(t,r)=>i("div",{className:"flex items-center",children:[e("img",{src:we,alt:"add"}),e("div",{style:{marginLeft:"12px"},children:e("div",{style:{fontWeight:500},children:t.label})})]})})})]})},xe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='24'%20height='24'%20rx='3.55556'%20fill='%2300C1B8'/%3e%3cpath%20d='M17.9887%2012.582C18.1207%2013.6621%2017.2267%2014.5801%2016.1526%2014.4901C15.3306%2014.4181%2014.6645%2013.7521%2014.6045%2012.924C14.5745%2012.558%2014.6645%2012.21%2014.8445%2011.9159C14.9285%2011.7779%2014.9045%2011.6039%2014.8025%2011.4899L14.3885%2011.0339C14.2805%2010.9139%2014.1005%2010.8839%2013.9565%2010.9559C13.6144%2011.1239%2013.2304%2011.2199%2012.8224%2011.2199C12.6244%2011.2199%2012.4324%2011.1959%2012.2464%2011.1539C12.0963%2011.1179%2011.9463%2011.1779%2011.8563%2011.3039L11.2803%2012.1259C11.1783%2012.276%2011.1963%2012.474%2011.3223%2012.606C11.8983%2013.188%2012.2464%2013.9921%2012.2284%2014.8741C12.1924%2016.4702%2010.9203%2017.7963%209.32417%2017.9043C7.45804%2018.0243%205.90994%2016.4942%206.00595%2014.6281C6.08995%2013.038%207.38604%2011.7599%208.97614%2011.6879C9.42017%2011.6699%209.8402%2011.7419%2010.2302%2011.8919C10.3922%2011.9519%2010.5722%2011.8979%2010.6743%2011.7599L11.1663%2011.0579C11.2743%2010.9019%2011.2503%2010.6919%2011.1123%2010.5658C10.5302%2010.0498%2010.1882%209.26976%2010.2662%208.4177C10.3742%207.18162%2011.3823%206.18556%2012.6244%206.09555C14.1245%205.98154%2015.3846%207.17562%2015.3846%208.65172C15.3846%209.20376%2015.2106%209.70779%2014.9105%2010.1278C14.8085%2010.2658%2014.8205%2010.4578%2014.9345%2010.5898L15.3786%2011.0819C15.4746%2011.1899%2015.6306%2011.2259%2015.7626%2011.1779C16.0086%2011.0939%2016.2786%2011.0639%2016.5606%2011.1119C17.3047%2011.2259%2017.8987%2011.8319%2017.9887%2012.582Z'%20fill='white'/%3e%3c/svg%3e",Eu=({url:n,token:s,role:a,eventsEmit:u,sectionData:h})=>{const[F,b]=x([]),[p,c]=x([]),[B,z]=x(!1),y=se(null),{fetchGraphs:f}=he({url:n,token:s,role:a,eventsEmit:u});W(()=>{R()},[]),W(()=>{if(h){let t=[];(h||[]).map(r=>{const d=(F||[]).find(E=>E.key===r.index_name);if(d){const{key:E,label:m}=d;t.push({key:E,label:m})}}),c(t)}},[h,F]);const R=async()=>{try{const t=await f();if(t!=null&&t.dataList){const r=((t==null?void 0:t.dataList)||[]).map(d=>({key:d.schemaId,label:d.name}));b(r)}}catch(t){console.error(t)}},w=(t,r)=>{switch(t){case"removeItem":const d=p.filter(E=>E.key!==r.key);c([...d]),j(d);break}},j=t=>{const r=(t||[]).map(d=>({graph_name:d.label,index_name:d.key}));u&&u("graph_selected",r)},l=()=>{var r;const t=((r=y.current)==null?void 0:r.getSelectedItems())||[];c(t),z(!1),j(t)};return i("div",{style:{borderBottom:"1px solid #E5E6EB",padding:"12px 0 "},children:[i("div",{className:"flex items-center justify-between",children:[i("div",{className:"flex items-center",children:[e("img",{src:xe}),e("span",{className:"font-medium ",style:{marginLeft:"10px"},children:"\u56FE\u8C31\u5E93"})]}),e("div",{className:"flex items-center gap-2",children:e(re,{color:"primary",variant:"outlined",size:"small",icon:e(Fe,{size:14}),onClick:()=>z(!0),children:"\u6DFB\u52A0"})})]}),(p==null?void 0:p.length)>0&&e(Ce,{countText:(p==null?void 0:p.length)>0?`\u5DF2\u9009\uFF1A${p==null?void 0:p.length}\u4E2A\u56FE\u8C31`:void 0,eventsEmit:w,data:p}),e(Ee,{width:740,title:"\u9009\u62E9\u56FE\u8C31",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",className:"assistant-config-resource-bind-modal",open:B,onOk:l,destroyOnHidden:!0,onCancel:()=>z(!1),children:e(me,{ref:y,dataSource:F,value:p,searchPlaceholder:"\u641C\u7D22\u540D\u79F0...",width:"700px",height:"500px",title:"\u56FE\u8C31",renderItem:t=>i("div",{className:"flex ",children:[e("img",{src:xe,alt:"add"}),e("span",{style:{marginLeft:8,marginRight:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:t.label,children:t.label})]}),renderSelectedItem:t=>i("div",{className:"flex items-center",children:[e("img",{src:xe,alt:"add"}),e("div",{style:{marginLeft:"12px"},children:e("div",{style:{fontWeight:500},children:t.label})})]})})})]})},Cu=({value:n,onChange:s,min:a,max:u,step:h,disabled:F,sliderStyle:b,inputStyle:p,inputWidth:c=90})=>{const B=y=>{const f=Array.isArray(y)?y[0]:y;s==null||s(f)},z=y=>{s==null||s(y)};return i(Ge,{style:{width:"100%"},children:[e(Ze,{min:a,max:u,step:h,disabled:F,value:n,onChange:B,style:{width:"200px",flex:1,...b}}),e(Ue,{min:a,max:u,step:h,disabled:F,controls:!1,value:n,onChange:z,style:{width:c,...p}})]})},{Item:Bu}=de,le=({label:n,name:s,configScale:a})=>{const u=ie(()=>a[s],[a]),h=(F,b)=>({validator(p,c){return c==null?Promise.reject("\u8BF7\u8F93\u5165\u6709\u6548\u6570\u5B57"):typeof+c!="number"||isNaN(+c)?Promise.reject("\u53EA\u80FD\u8F93\u5165\u6570\u5B57"):c<F||c>b?Promise.reject(`\u8BF7\u8F93\u5165${F}\u5230${b}\u4E4B\u95F4\u7684\u6570\u5B57`):Promise.resolve()}});return e(ne,{span:12,children:e(Bu,{label:n,name:s,tooltip:u.tooltip,rules:[{required:!0,message:""},h(u.min,u.max)],children:e(Cu,{min:u.min,max:u.max,step:u.step})})})},{Item:M}=de,Du=({url:n,token:s,role:a,id:u,showDatabase:h,showGraph:F,isShare:b,disabled:p,eventsEmit:c,CustomComponents:B})=>{const{ContentLoading:z}=B,[y]=de.useForm(),[f,R]=x(),[w,j]=x(),[l,t]=x(),[r,d]=x(),[E,m]=x(!0),[_,v]=x(!1),[I,Z]=x(te),g=se({}),{getConfigById:A,fetchModels:N,fetchConfigItemLimit:$,checkName:o,addConversationAssistant:D,updateConversationAssistant:k}=he({url:n,token:s,role:a,eventsEmit:c});W(()=>{q()},[u]),W(()=>{u?(Array.isArray(w)&&Array.isArray(l)&&y.validateFields(["model_name","plan_model_name","recommend_model_name","rerank_model_name","multi_model_name"]),Array.isArray(r)&&y.validateFields(["multi_model_name"])):(Array.isArray(w)&&(w==null?void 0:w.length)==0&&y.validateFields(["model_name","plan_model_name","recommend_model_name"]),Array.isArray(l)&&(l==null?void 0:l.length)==0&&y.validateFields(["rerank_model_name"]),Array.isArray(r)&&(r==null?void 0:r.length)==0&&y.validateFields(["multi_model_name"]))},[l,w,r,u]);const q=async()=>{let C;if(u){E||m(!0);try{const S=await A(u);if(S){const{configJson:L,...G}=S,K=L&&JSON.parse(L),{knowledge_base_name:ue,knowledge_base_name_source:J,selectedKnowledgeBase:Y,sensitiveWordIds:T,database_name:P,graph_nb_name:U}=K;C={...G,...K},g.current={knowledge_base_name:ue,knowledge_base_name_source:J,selectedKnowledgeBase:Y,sensitiveWordIds:T,database_name:P,graph_nb_name:U},R(C),console.log("_configData--->",C),y.setFieldsValue(C),m(!1)}}catch{}}else m(!1);await V(C)},V=async C=>{var S,L,G;try{const[K,ue,J,Y]=await Promise.allSettled([N({pageNum:1,pageSize:9999,status:1,type:1}),N({pageNum:1,pageSize:9999,status:1,type:3}),N({pageNum:1,pageSize:9999,status:1,type:4}),$()]);if(K.status==="fulfilled"&&K.value){const P=(((S=K.value)==null?void 0:S.records)||[]).map(U=>({...U,label:U.modelName,value:U.modelName}));j(P)}if(ue.status==="fulfilled"&&ue.value){const T=(((L=ue.value)==null?void 0:L.records)||[]).map(P=>({label:P.modelName||P.name,value:P.modelName||P.name}));t(T),T.length>0&&!(C!=null&&C.rerank_model_name)&&y.setFieldsValue({rerank_model_name:T[0].value})}if(J.status==="fulfilled"&&J.value){const T=(((G=J.value)==null?void 0:G.records)||[]).map(P=>({label:P.modelName||P.name,value:P.modelName||P.name}));d(T),T.length>0&&!(C!=null&&C.multi_model_name)&&y.setFieldsValue({multi_model_name:T[0].value})}if(Y.status==="fulfilled"&&Y.value&&Y.value){const T=Y.value;Object.keys(te).forEach(P=>{if(T.hasOwnProperty(P)){const{max:U,min:je}=T[P];te[P]={...te[P],min:je,max:U}}}),Z(te)}}catch(K){console.error("\u83B7\u53D6\u5217\u8868\u5931\u8D25:",K)}},ee=async(C,S)=>await o(S,u)?(Be.warning("\u540D\u79F0\u91CD\u590D\uFF01",2),Promise.reject("\u540D\u79F0\u91CD\u590D")):Promise.resolve(),X=(C,S)=>({validator(L,G){return G?Array.isArray(C)&&C.length===0||!C.find(K=>K.value==G)?Promise.reject("\u6A21\u578B\u65E0\u6CD5\u4F7F\u7528\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458"):Promise.resolve():Array.isArray(C)&&C.length===0?Promise.reject("\u6682\u65E0\u53EF\u7528\u6A21\u578B\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458"):Promise.reject(S)}}),pe=(C,S)=>{switch(console.log("++++\u52A9\u624B\u914D\u7F6E",C,S),C){case"knowledge_selected":g.current={...g.current,...S};break;case"sensitive_selected":g.current={...g.current,sensitiveWordIds:S};break;case"database_selected":g.current={...g.current,database_name:S};break;case"graph_selected":g.current={...g.current,graph_nb_name:S};break}},Te=async()=>{var S;let C={};try{v(!0);const L=await y.validateFields(),{knowledge_base_name:G,knowledge_base_name_source:K,selectedKnowledgeBase:ue,sensitiveWordIds:J,database_name:Y,graph_nb_name:T}=g.current;L.thinking=((S=w.find(U=>U.modelName==L.model_name))==null?void 0:S.thinking)||!1,C={configJson:JSON.stringify({...L,knowledge_base_name:G,knowledge_base_name_source:K,selectedKnowledgeBase:ue,sensitiveWordIds:J,...h?{database_name:Y}:{},...F?{graph_nb_name:T}:{}}),name:L.config_name,isDefault:L.isDefault,defaultAnswer:L.defaultAnswer,dependOnKb:L.dependOnKb,sensitiveWordIds:J},u?await k(u,C)&&(Be.success("\u66F4\u65B0\u52A9\u624B\u914D\u7F6E\u6210\u529F"),c&&c("go_back")):await D(C)&&(Be.success("\u65B0\u589E\u52A9\u624B\u914D\u7F6E\u6210\u529F"),c&&c("go_back"))}catch(L){console.error("submit error",L)}finally{v(!1)}},Re=ie(()=>{const C={};return Object.keys(te).forEach(S=>{var L;C[S]=(L=te[S])==null?void 0:L.default}),{...nu,...C}},[]);return i("div",{style:{height:"100%",width:"100%"},children:[i("div",{className:"flex items-center justify-between",style:{width:"100%",padding:"4px 10px 16px 10px"},children:[i("div",{className:"flex items-center",children:[e(Je,{color:"#2468F2",onClick:()=>c&&c("go_back")}),e("div",{className:"text-[16px] text-[#1D2129] bold",style:{marginLeft:20},children:u?"\u7F16\u8F91\u4F1A\u8BDD\u52A9\u624B":"\u65B0\u5EFA\u4F1A\u8BDD\u52A9\u624B"})]}),!E&&e(re,{type:"primary",onClick:()=>Te(),loading:_,disabled:p,children:"\u786E\u5B9A"})]}),E?z&&e(z,{}):e(de,{style:{padding:20,height:"calc(100vh - 150px)",backgroundColor:"#fff"},form:y,layout:"vertical",initialValues:Re,disabled:p,colon:!1,children:i(ae,{gutter:24,style:{height:"100%"},children:[i(ne,{span:12,style:{borderRight:"1px solid #E5E6EB",padding:"10px 32px",height:"100%",overflowY:"auto"},children:[e(M,{label:"\u52A9\u624B\u540D\u79F0",name:"config_name",validateTrigger:"onBlur",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u52A9\u624B\u540D\u79F0"},{validator:ee}],children:e(fe,{placeholder:"\u8BF7\u8F93\u5165"})}),i(ae,{gutter:16,children:[e(ne,{span:12,children:e(M,{label:"\u95EE\u7B54\u6A21\u578B",name:"model_name",rules:[{required:!0,message:""},X(w,"\u8BF7\u9009\u62E9\u95EE\u7B54\u6A21\u578B")],children:e(Q,{placeholder:"\u8BF7\u9009\u62E9",options:w,notFoundContent:e(ce,{})})})}),e(ne,{span:12,children:e(M,{label:"\u89C4\u5212\u6A21\u578B",name:"plan_model_name",rules:[{required:!0,message:""},X(w,"\u8BF7\u9009\u62E9\u89C4\u5212\u6A21\u578B")],children:e(Q,{placeholder:"\u8BF7\u9009\u62E9",options:w,notFoundContent:e(ce,{})})})})]}),i(ae,{gutter:16,children:[e(ne,{span:12,children:e(M,{label:"\u4E0A\u4F20\u6587\u6863\u95EE\u7B54\u591A\u6A21\u6001\u6A21\u578B",name:"multi_model_name",rules:[{required:!0,message:""},X(r,"\u8BF7\u9009\u62E9\u4E0A\u4F20\u6587\u6863\u95EE\u7B54\u591A\u6A21\u6001\u6A21\u578B\u6A21\u578B")],children:e(Q,{placeholder:"\u8BF7\u9009\u62E9",options:r,notFoundContent:e(ce,{})})})}),e(ne,{span:12,children:e(M,{label:"Rerank\u6A21\u578B",name:"rerank_model_name",rules:[{required:!0,message:""},X(l,"\u8BF7\u9009\u62E9Rerank\u6A21\u578B")],children:e(Q,{placeholder:"\u8BF7\u9009\u62E9",options:l,notFoundContent:e(ce,{})})})})]}),e(M,{label:"\u5F00\u573A\u767D",name:"prologue",children:e(fe.TextArea,{maxLength:50,showCount:!0,placeholder:"\u8BF7\u8F93\u5165\u5F00\u573A\u767D",autoSize:{minRows:2}})}),e(M,{label:"\u63D0\u793A\u8BCD",name:"system_prompt",tooltip:Qe,children:e(fe.TextArea,{showCount:!0,rows:8,maxLength:3e3,autoSize:{minRows:10},placeholder:`\u4F8B\u5982\uFF1A${uu}`})}),e(M,{name:"isDefault",valuePropName:"checked",normalize:C=>C===!0?1:0,children:e(_e,{children:"\u9009\u62E9\u4E3A\u9ED8\u8BA4\u52A9\u624B"})})]}),i(ne,{span:12,style:{height:"100%",padding:"10px 32px",overflowY:"auto"},children:[i(ye,{title:"\u68C0\u7D22\u4E0E\u751F\u6210\u53C2\u6570",children:[e(M,{label:"\u95EE\u9898\u63A8\u8350\u6A21\u578B",name:"recommend_model_name",rules:[{required:!0,message:""},X(w,"\u8BF7\u9009\u62E9\u95EE\u9898\u63A8\u8350\u6A21\u578B")],children:e(Q,{placeholder:"\u8BF7\u9009\u62E9",options:w,notFoundContent:e(ce,{})})}),e(M,{label:"\u68C0\u7D22\u7B56\u7565",name:"search_policy",children:e(Q,{options:su,placeholder:"\u8BF7\u9009\u62E9"})}),i(ae,{gutter:16,children:[e(le,{label:"\u6E29\u5EA6",name:"temperature",configScale:I}),e(le,{label:"\u591A\u6837\u6027",name:"top_p",configScale:I})]}),i(ae,{gutter:16,children:[e(le,{label:"\u53EC\u56DE\u6570",name:"top_k",configScale:I}),e(le,{label:"\u76F8\u4F3C\u5EA6\u9608\u503C",name:"score_threshold",configScale:I})]}),i(ae,{gutter:16,children:[e(le,{label:"\u6700\u5927\u4EE4\u724C\u6570",name:"max_tokens",configScale:I}),e(le,{label:"\u4E0A\u4E0B\u6587\u6700\u5927\u8F6E\u6570",name:"max_round",configScale:I})]})]}),i(ye,{title:"\u529F\u80FD\u5F00\u5173",children:[e(M,{label:"\u5F00\u542FFAQ\u4F18\u5148",name:"enabled_faq",valuePropName:"checked",layout:"horizontal",children:e(oe,{})}),e(M,{label:"\u542F\u7528\u56FE\u8C31\u589E\u5F3A",name:"enabled_graph",valuePropName:"checked",layout:"horizontal",children:e(oe,{})}),e(M,{label:"\u5F00\u542F\u5F3A\u4F01\u4E1A\u77E5\u8BC6\u4F9D\u8D56",name:"dependOnKb",valuePropName:"checked",layout:"horizontal",tooltip:eu,normalize:C=>C===!0?1:0,children:e(oe,{})}),e(M,{label:"\u5F00\u542F\u95EE\u9898\u6539\u5199",name:"enabled_question_rewrite",valuePropName:"checked",layout:"horizontal",children:e(oe,{})}),e(M,{label:"\u5F00\u542F\u6EAF\u6E90",name:"need_trace_source",valuePropName:"checked",layout:"horizontal",children:e(oe,{})}),e(M,{noStyle:!0,shouldUpdate:(C,S)=>C.need_trace_source!==S.need_trace_source,children:({getFieldValue:C})=>C("need_trace_source")?i(Me,{children:[e(M,{label:"\u6EAF\u6E90\u7B56\u7565",name:"trace_by_llm",layout:"horizontal",children:e(Q,{placeholder:"\u8BF7\u9009\u62E9",options:ru})}),e(M,{name:"is_download",valuePropName:"checked",layout:"horizontal",children:e(_e,{children:"\u5141\u8BB8\u4E0B\u8F7D\u6EAF\u6E90\u6587\u4EF6"})})]}):null})]}),i(ye,{title:"\u8D44\u6E90\u7ED1\u5B9A",children:[e(pu,{url:n,token:s,role:a,sectionData:f==null?void 0:f.sensitiveWordIds,eventsEmit:pe,defaultAnswer:f==null?void 0:f.defaultAnswer,form:y}),e(gu,{url:n,token:s,role:a,sectionData:{knowledge_base_name:f==null?void 0:f.knowledge_base_name,knowledge_base_name_source:f==null?void 0:f.knowledge_base_name_source,selectedKnowledgeBase:f==null?void 0:f.selectedKnowledgeBase},createBy:b?f==null?void 0:f.createBy:void 0,eventsEmit:pe}),h&&e(Fu,{url:n,token:s,role:a,disabled:p,sectionData:f==null?void 0:f.database_name,eventsEmit:pe}),F&&e(Eu,{url:n,token:s,role:a,sectionData:f==null?void 0:f.graph_nb_name,eventsEmit:pe})]})]})]})})]})};export{Du as C,Ye as S};
|
|
157
|
+
`;const me=He(({dataSource:n,value:s=[],onConfirm:a,maxCount:u=0,searchPlaceholder:h="\u641C\u7D22...",title:F="",showSearch:b=!0,filterOption:p,renderItem:c,renderSelectedItem:B,className:z,style:y,styles:f,height:R,width:w},j)=>{const l=We(),t=ke(ke({theme:O,mode:"light"},l),f),[r,d]=x(s),[E,m]=x("");W(()=>{d(s)},[s]),ie(()=>new Set(s.map(o=>o.key)),[s]);const _=ie(()=>new Set(r.map(o=>o.key)),[r]);Ve(j,()=>({getSelectedItems:()=>r,confirm:()=>{a==null||a(r)}}),[r,a]);const I=p||((o,D)=>{var H;if(!o)return!0;const k=o.toLowerCase();return D.label.toLowerCase().includes(k)||((H=D.tags)==null?void 0:H.some(V=>V.toLowerCase().includes(k)))||!1}),Z=ie(()=>(n||[]).filter(o=>I(E,o)),[n,E,I]),g=o=>{const D=_.has(o.key);let k;if(D)k=(r||[]).filter(H=>H.key!==o.key);else{if(u>0&&r.length>=u)return;k=[...r,o]}d(k)},A=(o,D)=>{d(k=>k.map(V=>V.key==o?{...V,tags:D}:V))},N=o=>{const D=(r||[]).filter(k=>k.key!==o.key);d(D)},$=o=>_.has(o);return u>0&&r.length>=u,i(lu,{$theme:t.theme||O,$width:w,$height:R,className:z,style:y,children:[i(Se,{$theme:t.theme||O,style:{flex:1},children:[b&&e(iu,{$theme:t.theme||O,children:i("div",{style:{position:"relative"},children:[e(hu,{children:e(Ye,{size:16})}),e(du,{$theme:t.theme||O,type:"text",placeholder:h,value:E,onChange:o=>m(o.target.value)})]})}),e(Ne,{children:Z.length===0?e(ze,{$theme:t.theme||O,children:E?"\u672A\u627E\u5230\u5339\u914D\u9879":"\u6682\u65E0\u6570\u636E"}):Z.map(o=>{const D=$(o.key);return i($e,{$theme:t.theme||O,$selected:D,children:[e(Ie,{$theme:t.theme||O,children:c?c(o):o.label}),D&&e(Le,{$theme:t.theme||O,onClick:k=>{k.stopPropagation(),N(o)},disabled:!0,children:"\u5DF2\u6DFB\u52A0"}),!D&&e(Le,{$theme:t.theme||O,onClick:k=>{k.stopPropagation(),g(o)},children:"\u6DFB\u52A0"})]},o.key)})})]}),i(Se,{$theme:t.theme||O,style:{flex:1},children:[i(ou,{$theme:t.theme||O,children:[u>0?`\u5DF2\u9009\uFF1A${r.length}/${u}\u4E2A${F}`:`\u5DF2\u9009\uFF1A${r.length}\u4E2A${F}`,e(cu,{$theme:t.theme||O,onClick:o=>{o.stopPropagation(),d([])},children:"\u6E05\u7A7A"})]}),e(Ne,{children:r.length===0?e(ze,{$theme:t.theme||O,children:"\u6682\u65E0\u5DF2\u9009\u9879"}):r.map(o=>{var k,H,V;const D=ee=>A(o.key,ee);return i($e,{$theme:t.theme||O,children:[e(Ie,{$theme:t.theme||O,children:B?B(o,D):o.label}),e(Oe,{size:14,color:((V=(H=(k=t.theme)==null?void 0:k.colors)==null?void 0:H.text)==null?void 0:V.secondary)||"#86909C",style:{cursor:"pointer"},onClick:ee=>{ee.stopPropagation(),N(o)}})]},o.key)})})]})]})});me.displayName="SearchableSelector";const be="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='20'%20height='20'%20rx='2.22222'%20fill='%23FFCC3C'/%3e%3cpath%20d='M13.3263%2012.7917H7.53763C7.33426%2012.8116%207.17923%2012.9825%207.17923%2013.1867C7.17923%2013.3909%207.33426%2013.5618%207.53763%2013.5817H13.3277C13.3828%2013.5871%2013.4384%2013.5809%2013.4909%2013.5634C13.5435%2013.546%2013.5918%2013.5178%2013.6328%2013.4806C13.6738%2013.4434%2013.7066%2013.3981%2013.729%2013.3474C13.7514%2013.2968%2013.763%2013.2421%2013.763%2013.1867C13.763%2013.1313%2013.7514%2013.0766%2013.729%2013.026C13.7066%2012.9753%2013.6738%2012.93%2013.6328%2012.8928C13.5918%2012.8556%2013.5435%2012.8274%2013.4909%2012.8099C13.4384%2012.7925%2013.3828%2012.7863%2013.3277%2012.7917H13.3263ZM9.19742%207.60418L8.84232%208.55193H9.57339L9.19742%207.60418Z'%20fill='white'/%3e%3cpath%20d='M15.3211%2014.7707V6.9692H14.4704V14.3543H6.70511C6.06668%2014.3392%205.55704%2013.8173%205.55704%2013.1788C5.55704%2012.5402%206.06668%2012.0184%206.70511%2012.0033H13.352C13.4644%2012.0075%2013.5735%2011.9648%2013.653%2011.8852C13.6923%2011.8459%2013.7231%2011.7988%2013.7434%2011.747C13.7638%2011.6952%2013.7731%2011.6398%2013.771%2011.5842V5.20102C13.7736%205.14526%2013.7646%205.08958%2013.7445%205.03752C13.7244%204.98546%2013.6936%204.93816%2013.6542%204.89865C13.6148%204.85915%2013.5675%204.82832%2013.5155%204.80812C13.4634%204.78792%2013.4077%204.7788%2013.352%204.78134H6.70511C5.60281%204.80136%204.71609%205.69369%204.70291%206.79599V13.1759C4.71609%2014.283%205.61038%2015.1773%206.71756%2015.1905H14.8893C15.0042%2015.1994%2015.1173%2015.1585%2015.1999%2015.0782C15.2407%2015.0385%2015.2727%2014.9905%2015.2936%2014.9375C15.3145%2014.8845%2015.3239%2014.8276%2015.3211%2014.7707ZM8.98782%206.78585H9.44888L10.7213%209.92562H10.2475L9.9075%209.06759H8.51871L8.19742%209.92562H7.72354L8.98782%206.78585Z'%20fill='white'/%3e%3c/svg%3e",{Item:mu}=de,pu=({url:n,token:s,role:a,eventsEmit:u,sectionData:h,defaultAnswer:F,form:b})=>{const[p,c]=x([]),[B,z]=x([]),[y,f]=x(!1),[R,w]=x(!1),j=se(null),{fetchSensitiveLibrary:l}=he({url:n,token:s,role:a,eventsEmit:u});W(()=>{t()},[]),W(()=>{if(h&&(p==null?void 0:p.length)>0){let m=h?Array.isArray(h)?h:h.split(","):[],_=[];m.forEach(v=>{const I=(p||[]).find(Z=>Z.key===v);I&&_.push({key:I.key,label:I.label})}),z(_)}},[h,p]),W(()=>{F&&w(!0)},[F]);const t=async()=>{try{const m=await l({pageNo:1,pageSize:9999});if(m!=null&&m.records){const _=((m==null?void 0:m.records)||[]).map(v=>({key:v.id+"",label:v.name}));c(_)}}catch(m){console.error(m)}},r=(m,_)=>{switch(m){case"removeItem":const v=B.filter(I=>I.key!==_.key);z([...v]),d(v);break}},d=m=>{const _=m.map(v=>(v==null?void 0:v.key)||"").filter(v=>v).join(",");u&&u("sensitive_selected",_)},E=()=>{var _;const m=((_=j.current)==null?void 0:_.getSelectedItems())||[];z(m),f(!1),d(m)};return i("div",{style:{borderBottom:"1px solid #E5E6EB",padding:"12px 0 "},children:[i("div",{className:"flex items-center justify-between",children:[i("div",{className:"flex items-center",children:[e("img",{src:be}),e("span",{className:"font-medium ",style:{marginLeft:"10px"},children:"\u654F\u611F\u8BCD"})]}),e(re,{color:"primary",variant:"outlined",size:"small",icon:e(Fe,{size:14}),onClick:()=>f(!0),children:"\u6DFB\u52A0"})]}),e(_e,{checked:R,onChange:m=>{w(m.target.checked),m.target.checked?b.setFieldsValue({defaultAnswer:tu}):b.setFieldsValue({defaultAnswer:""})},style:{marginBottom:8,marginTop:8},children:"\u81EA\u5B9A\u4E49\u56DE\u590D"}),R&&e(mu,{label:"\u81EA\u5B9A\u4E49\u56DE\u590D\u5185\u5BB9",name:"defaultAnswer",layout:"vertical",children:e(fe.TextArea,{style:{height:"55px",resize:"none"}})}),(B==null?void 0:B.length)>0&&e(Ce,{countText:(B==null?void 0:B.length)>0?`\u5DF2\u9009\uFF1A${B==null?void 0:B.length}\u4E2A\u654F\u611F\u8BCD\u5E93`:void 0,eventsEmit:r,data:B}),e(Ee,{width:740,title:"\u9009\u62E9\u654F\u611F\u8BCD",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",open:y,onOk:E,onCancel:()=>f(!1),destroyOnHidden:!0,className:"assistant-config-resource-bind-modal",children:e(me,{ref:j,dataSource:p,value:B,searchPlaceholder:"\u641C\u7D22\u540D\u79F0...",width:"700px",height:"500px",title:"\u654F\u611F\u8BCD\u5E93",renderItem:m=>i("div",{className:"flex ",children:[e("img",{src:be,alt:"add"}),e("span",{style:{marginLeft:8,marginRight:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:m.label,children:m.label})]}),renderSelectedItem:(m,_)=>i("div",{className:"flex items-center",children:[e("img",{src:be,alt:"add"}),e("div",{style:{marginLeft:"12px"},children:e("div",{style:{fontWeight:500},children:m.label})})]})})})]})},Ae="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='20'%20height='20'%20rx='2.22222'%20fill='%2300B2F9'/%3e%3cpath%20d='M5.3125%2013.9672V13.975C5.32812%2014.6938%205.89922%2015.2734%206.61875%2015.2734H13.9062C14.3375%2015.2734%2014.6875%2014.9289%2014.6875%2014.4977V5.50703C14.6875%205.40447%2014.6673%205.30292%2014.628%205.20818C14.5887%205.11344%2014.5312%205.02736%2014.4586%204.95488C14.3861%204.8824%2014.2999%204.82492%2014.2052%204.78575C14.1104%204.74657%2014.0088%204.72646%2013.9062%204.72656H6.875C6.01172%204.72656%205.3125%205.42031%205.3125%206.28359V13.9672ZM7.5%209.24531V6.25C7.5%206.07813%207.64062%205.9375%207.8125%205.9375H9.6875C9.86016%205.9375%2010%206.07813%2010%206.25V9.24531C10%209.30716%209.98175%209.36762%209.94741%209.41906C9.91308%209.47049%209.86425%209.51058%209.80712%209.53426C9.74999%209.55793%209.68712%209.56412%209.62647%209.55204C9.56581%209.53996%209.51011%209.51016%209.46641%209.46641L8.97109%208.97109C8.94207%208.94204%208.90761%208.91899%208.86967%208.90326C8.83173%208.88754%208.79107%208.87944%208.75%208.87944C8.70893%208.87944%208.66827%208.88754%208.63033%208.90326C8.59239%208.91899%208.55793%208.94204%208.52891%208.97109L8.03359%209.46641C7.98989%209.51016%207.93418%209.53996%207.87353%209.55204C7.81288%209.56412%207.75001%209.55793%207.69288%209.53426C7.63575%209.51058%207.58692%209.47049%207.55259%209.41906C7.51825%209.36762%207.49995%209.30716%207.5%209.24531ZM6.54375%2014.2063C6.45208%2014.1156%206.40625%2014.0052%206.40625%2013.875C6.40625%2013.7458%206.45208%2013.6354%206.54375%2013.5438C6.6349%2013.4521%206.74531%2013.4062%206.875%2013.4062H13.5938V14.3438H6.875C6.74531%2014.3438%206.6349%2014.2979%206.54375%2014.2063Z'%20fill='white'/%3e%3c/svg%3e",fu=({url:n,token:s,role:a,sectionData:u,createBy:h,eventsEmit:F})=>{const[b,p]=x(),[c,B]=x([]),[z,y]=x(!1),f=se(null),[R,w]=x(!1),[j,l]=x([]),t=se(new Map).current,{fetchKnowledgeBase:r,getBizLabelLabels:d}=he({url:n,token:s,role:a,eventsEmit:F}),E=se(!1);W(()=>{E.current||(h?(m(h),E.current=!0):(m(),E.current=!0))},[h]),W(()=>{if(u&&(b==null?void 0:b.length)>0){const g=u==null?void 0:u.knowledge_base_name_source,A=g&&(Array.isArray(g)?g:g.split(";"));let N=[];(A||[]).forEach($=>{const o=((u==null?void 0:u.selectedKnowledgeBase)||[]).find(X=>X.name==$),D=(b||[]).find(X=>X.knowledge_base_name_source===$),{key:k,label:H,knowledge_base_name:V,knowledge_base_name_source:ee}=D;N.push({key:k,label:H,knowledge_base_name:V,knowledge_base_name_source:ee,tags:o==null?void 0:o.labels})}),B(N)}},[u,b]);const m=async g=>{try{const A=await r(g);if(A){const N=(A||[]).map($=>({key:$.id,label:$.kbName,knowledge_base_name:$.primitiveName,knowledge_base_name_source:$.kbName}));p(N)}}catch(A){console.error(A)}},_=(g,A)=>{switch(g){case"removeItem":const N=c.filter(o=>o.key!==A.key);B([...N]),v(N);break;case"removeTag":const $=c.findIndex(o=>o.key==A.key);$!==-1&&(c[$]=A),B([...c]),v(c);break}},v=g=>{const A=(g||[]).map(o=>(o==null?void 0:o.knowledge_base_name)||"").filter(o=>o).join(";"),N=(g||[]).map(o=>(o==null?void 0:o.knowledge_base_name_source)||"").filter(o=>o).join(";"),$=(g||[]).filter(o=>{var D;return Array.isArray(o==null?void 0:o.tags)&&((D=o.tags)==null?void 0:D.length)>0}).map(o=>({id:o.key,name:o.label,knowledge_base_name_source:o.knowledge_base_name_source,labels:o.tags}));F&&F("knowledge_selected",{knowledge_base_name:A,knowledge_base_name_source:N,selectedKnowledgeBase:$})},I=()=>{var A;const g=((A=f.current)==null?void 0:A.getSelectedItems())||[];B(g),y(!1),v(g)},Z=async(g,A)=>{if(g){const N=t.get(A);if(N){l(N);return}if(!R)try{w(!0);const $=await d({kbNames:[A]});if(Array.isArray($)){const o=$.length?$[0].label:"",D=o?(o||"").split(",").map(k=>({label:k,value:k})):[];t.set(A,D),l(D)}w(!1)}catch($){console.error("Error fetching data:",$),w(!1)}}};return i("div",{style:{borderBottom:"1px solid #E5E6EB",padding:"12px 0 "},children:[i("div",{className:"flex items-center justify-between",children:[i("div",{className:"flex items-center",children:[e("img",{src:Ae}),e("span",{className:"font-medium ",style:{marginLeft:"10px"},children:"\u77E5\u8BC6\u5E93"})]}),e("div",{className:"flex items-center gap-2",children:e(re,{color:"primary",variant:"outlined",size:"small",icon:e(Fe,{size:14}),onClick:()=>y(!0),children:"\u6DFB\u52A0"})})]}),(c==null?void 0:c.length)>0&&e(Ce,{countText:(c==null?void 0:c.length)>0?`\u5DF2\u9009\uFF1A${c==null?void 0:c.length}\u4E2A\u77E5\u8BC6\u5E93`:void 0,eventsEmit:_,data:c}),e(Ee,{width:740,className:"assistant-config-resource-bind-modal",title:"\u9009\u62E9\u77E5\u8BC6\u5E93",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",open:z,onOk:I,onCancel:()=>y(!1),destroyOnHidden:!0,children:e(me,{ref:f,dataSource:b,value:c,searchPlaceholder:"\u641C\u7D22\u540D\u79F0...",width:"700px",height:"500px",title:"\u77E5\u8BC6\u5E93",renderItem:g=>i("div",{className:"flex ",children:[e("img",{src:Ae,alt:"add"}),e("span",{style:{marginLeft:8,marginRight:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:g.label,children:g.label})]}),renderSelectedItem:(g,A)=>i("div",{className:"flex ",children:[e("img",{src:Ae,alt:"add"}),i("div",{style:{marginLeft:"12px"},children:[e("div",{style:{marginBottom:"8px",fontWeight:500},children:g.label}),e(Q,{mode:"tags",placeholder:"\u9009\u62E9\u6807\u7B7E...",maxTagCount:1,value:g.tags||[],onChange:N=>{A(N)},style:{width:250},options:j,loading:R,onOpenChange:N=>{Z(N,g.knowledge_base_name)}})]})]})})})]})},gu=qe.memo(fu),we="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='24'%20height='24'%20rx='3.55556'%20fill='%23925BFF'/%3e%3cpath%20d='M11.9971%2011.265C15.249%2011.265%2017.8891%2010.443%2017.8891%209.423V7.95288C17.8891%206.93291%2015.2492%206.11084%2011.9971%206.11084C8.74513%206.11084%206.10504%206.93276%206.10504%207.95288V9.42285C6.10504%2010.437%208.73898%2011.265%2011.9971%2011.265Z'%20fill='white'/%3e%3cpath%20d='M11.9971%2014.577C15.249%2014.577%2017.8891%2013.7551%2017.8891%2012.7349V10.527C17.8891%2011.5469%2015.2492%2012.369%2011.9971%2012.369C8.74513%2012.369%206.10504%2011.5471%206.10504%2010.527V12.7349C6.10504%2013.749%208.73898%2014.577%2011.9971%2014.577Z'%20fill='white'/%3e%3cpath%20d='M11.9971%2015.681C8.7451%2015.681%206.11102%2014.859%206.11102%2013.839V16.0469C6.11102%2017.0609%208.74496%2017.889%2012.0031%2017.889C15.255%2017.889%2017.8951%2017.0671%2017.8951%2016.0469V13.8391C17.889%2014.859%2015.249%2015.681%2011.9971%2015.681Z'%20fill='white'/%3e%3c/svg%3e",Pe=10,Fu=({url:n,token:s,role:a,eventsEmit:u,sectionData:h,disabled:F})=>{const[b,p]=x([]),[c,B]=x([]),[z,y]=x(!1),f=se(null),{fetchDatabases:R}=he({url:n,token:s,role:a,eventsEmit:u});W(()=>{w()},[]),W(()=>{if(h){let t=[];(h||[]).map(r=>{const d=(b||[]).find(E=>E.key===r.key);if(d){const{key:E,label:m}=d;t.push({key:E,label:m})}}),B(t)}},[h,b]);const w=async()=>{try{const t=await R();if(t){const r=(t||[]).map(d=>({key:d.primitiveName,label:d.name}));p(r)}}catch(t){console.error(t)}},j=(t,r)=>{switch(t){case"removeItem":const d=c.filter(E=>E.key!==r.key);B([...d]),u&&u("database_selected",d);break}},l=()=>{var r;const t=((r=f.current)==null?void 0:r.getSelectedItems())||[];B(t),y(!1),u&&u("database_selected",t)};return i("div",{style:{borderBottom:"1px solid #E5E6EB",padding:"12px 0 "},children:[i("div",{className:"flex items-center justify-between",children:[i("div",{className:"flex items-center",children:[e("img",{src:we}),e("span",{className:"font-medium ",style:{marginLeft:"10px"},children:"\u6570\u636E\u5E93"})]}),e("div",{className:"flex items-center gap-2",children:e(re,{color:"primary",variant:"outlined",size:"small",icon:e(Fe,{size:14}),onClick:()=>y(!0),disabled:c.length>=Pe||F,children:"\u6DFB\u52A0"})})]}),(c==null?void 0:c.length)>0&&e(Ce,{countText:(c==null?void 0:c.length)>0?`\u5DF2\u9009\uFF1A${c==null?void 0:c.length}\u4E2A\u6570\u636E\u5E93`:void 0,eventsEmit:j,data:c}),e(Ee,{width:740,title:"\u9009\u62E9\u6570\u636E\u5E93",className:"assistant-config-resource-bind-modal",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",open:z,onOk:l,onCancel:()=>y(!1),destroyOnHidden:!0,children:e(me,{ref:f,dataSource:b,value:c,searchPlaceholder:"\u641C\u7D22\u540D\u79F0...",width:"700px",height:"500px",title:"\u6570\u636E\u5E93",maxCount:Pe,renderItem:t=>i("div",{className:"flex ",children:[e("img",{src:we,alt:"add"}),e("span",{style:{marginLeft:8,marginRight:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:t.label,children:t.label})]}),renderSelectedItem:(t,r)=>i("div",{className:"flex items-center",children:[e("img",{src:we,alt:"add"}),e("div",{style:{marginLeft:"12px"},children:e("div",{style:{fontWeight:500},children:t.label})})]})})})]})},xe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='24'%20height='24'%20rx='3.55556'%20fill='%2300C1B8'/%3e%3cpath%20d='M17.9887%2012.582C18.1207%2013.6621%2017.2267%2014.5801%2016.1526%2014.4901C15.3306%2014.4181%2014.6645%2013.7521%2014.6045%2012.924C14.5745%2012.558%2014.6645%2012.21%2014.8445%2011.9159C14.9285%2011.7779%2014.9045%2011.6039%2014.8025%2011.4899L14.3885%2011.0339C14.2805%2010.9139%2014.1005%2010.8839%2013.9565%2010.9559C13.6144%2011.1239%2013.2304%2011.2199%2012.8224%2011.2199C12.6244%2011.2199%2012.4324%2011.1959%2012.2464%2011.1539C12.0963%2011.1179%2011.9463%2011.1779%2011.8563%2011.3039L11.2803%2012.1259C11.1783%2012.276%2011.1963%2012.474%2011.3223%2012.606C11.8983%2013.188%2012.2464%2013.9921%2012.2284%2014.8741C12.1924%2016.4702%2010.9203%2017.7963%209.32417%2017.9043C7.45804%2018.0243%205.90994%2016.4942%206.00595%2014.6281C6.08995%2013.038%207.38604%2011.7599%208.97614%2011.6879C9.42017%2011.6699%209.8402%2011.7419%2010.2302%2011.8919C10.3922%2011.9519%2010.5722%2011.8979%2010.6743%2011.7599L11.1663%2011.0579C11.2743%2010.9019%2011.2503%2010.6919%2011.1123%2010.5658C10.5302%2010.0498%2010.1882%209.26976%2010.2662%208.4177C10.3742%207.18162%2011.3823%206.18556%2012.6244%206.09555C14.1245%205.98154%2015.3846%207.17562%2015.3846%208.65172C15.3846%209.20376%2015.2106%209.70779%2014.9105%2010.1278C14.8085%2010.2658%2014.8205%2010.4578%2014.9345%2010.5898L15.3786%2011.0819C15.4746%2011.1899%2015.6306%2011.2259%2015.7626%2011.1779C16.0086%2011.0939%2016.2786%2011.0639%2016.5606%2011.1119C17.3047%2011.2259%2017.8987%2011.8319%2017.9887%2012.582Z'%20fill='white'/%3e%3c/svg%3e",Eu=({url:n,token:s,role:a,eventsEmit:u,sectionData:h})=>{const[F,b]=x([]),[p,c]=x([]),[B,z]=x(!1),y=se(null),{fetchGraphs:f}=he({url:n,token:s,role:a,eventsEmit:u});W(()=>{R()},[]),W(()=>{if(h){let t=[];(h||[]).map(r=>{const d=(F||[]).find(E=>E.key===r.index_name);if(d){const{key:E,label:m}=d;t.push({key:E,label:m})}}),c(t)}},[h,F]);const R=async()=>{try{const t=await f();if(t!=null&&t.dataList){const r=((t==null?void 0:t.dataList)||[]).map(d=>({key:d.schemaId,label:d.name}));b(r)}}catch(t){console.error(t)}},w=(t,r)=>{switch(t){case"removeItem":const d=p.filter(E=>E.key!==r.key);c([...d]),j(d);break}},j=t=>{const r=(t||[]).map(d=>({graph_name:d.label,index_name:d.key}));u&&u("graph_selected",r)},l=()=>{var r;const t=((r=y.current)==null?void 0:r.getSelectedItems())||[];c(t),z(!1),j(t)};return i("div",{style:{borderBottom:"1px solid #E5E6EB",padding:"12px 0 "},children:[i("div",{className:"flex items-center justify-between",children:[i("div",{className:"flex items-center",children:[e("img",{src:xe}),e("span",{className:"font-medium ",style:{marginLeft:"10px"},children:"\u56FE\u8C31\u5E93"})]}),e("div",{className:"flex items-center gap-2",children:e(re,{color:"primary",variant:"outlined",size:"small",icon:e(Fe,{size:14}),onClick:()=>z(!0),children:"\u6DFB\u52A0"})})]}),(p==null?void 0:p.length)>0&&e(Ce,{countText:(p==null?void 0:p.length)>0?`\u5DF2\u9009\uFF1A${p==null?void 0:p.length}\u4E2A\u56FE\u8C31`:void 0,eventsEmit:w,data:p}),e(Ee,{width:740,title:"\u9009\u62E9\u56FE\u8C31",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",className:"assistant-config-resource-bind-modal",open:B,onOk:l,destroyOnHidden:!0,onCancel:()=>z(!1),children:e(me,{ref:y,dataSource:F,value:p,searchPlaceholder:"\u641C\u7D22\u540D\u79F0...",width:"700px",height:"500px",title:"\u56FE\u8C31",renderItem:t=>i("div",{className:"flex ",children:[e("img",{src:xe,alt:"add"}),e("span",{style:{marginLeft:8,marginRight:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:t.label,children:t.label})]}),renderSelectedItem:t=>i("div",{className:"flex items-center",children:[e("img",{src:xe,alt:"add"}),e("div",{style:{marginLeft:"12px"},children:e("div",{style:{fontWeight:500},children:t.label})})]})})})]})},Cu=({value:n,onChange:s,min:a,max:u,step:h,disabled:F,sliderStyle:b,inputStyle:p,inputWidth:c=90})=>{const B=y=>{const f=Array.isArray(y)?y[0]:y;s==null||s(f)},z=y=>{s==null||s(y)};return i(Ge,{style:{width:"100%"},children:[e(Ze,{min:a,max:u,step:h,disabled:F,value:n,onChange:B,style:{width:"200px",flex:1,...b}}),e(Ue,{min:a,max:u,step:h,disabled:F,controls:!1,value:n,onChange:z,style:{width:c,...p}})]})},{Item:Bu}=de,le=({label:n,name:s,configScale:a})=>{const u=ie(()=>a[s],[a]),h=(F,b)=>({validator(p,c){return c==null?Promise.reject("\u8BF7\u8F93\u5165\u6709\u6548\u6570\u5B57"):typeof+c!="number"||isNaN(+c)?Promise.reject("\u53EA\u80FD\u8F93\u5165\u6570\u5B57"):c<F||c>b?Promise.reject(`\u8BF7\u8F93\u5165${F}\u5230${b}\u4E4B\u95F4\u7684\u6570\u5B57`):Promise.resolve()}});return e(ne,{span:12,children:e(Bu,{label:n,name:s,tooltip:u.tooltip,rules:[{required:!0,message:""},h(u.min,u.max)],children:e(Cu,{min:u.min,max:u.max,step:u.step})})})},{Item:M}=de,Du=({url:n,token:s,role:a,id:u,showDatabase:h,showGraph:F,isShare:b,disabled:p,eventsEmit:c,CustomComponents:B})=>{const{ContentLoading:z}=B,[y]=de.useForm(),[f,R]=x(),[w,j]=x(),[l,t]=x(),[r,d]=x(),[E,m]=x(!0),[_,v]=x(!1),[I,Z]=x(te),g=se({}),{getConfigById:A,fetchModels:N,fetchConfigItemLimit:$,checkName:o,addConversationAssistant:D,updateConversationAssistant:k}=he({url:n,token:s,role:a,eventsEmit:c});W(()=>{H()},[u]),W(()=>{u?(Array.isArray(w)&&Array.isArray(l)&&y.validateFields(["model_name","plan_model_name","recommend_model_name","rerank_model_name","multi_model_name"]),Array.isArray(r)&&y.validateFields(["multi_model_name"])):(Array.isArray(w)&&(w==null?void 0:w.length)==0&&y.validateFields(["model_name","plan_model_name","recommend_model_name"]),Array.isArray(l)&&(l==null?void 0:l.length)==0&&y.validateFields(["rerank_model_name"]),Array.isArray(r)&&(r==null?void 0:r.length)==0&&y.validateFields(["multi_model_name"]))},[l,w,r,u]);const H=async()=>{let C;if(u){E||m(!0);try{const S=await A(u);if(S){const{configJson:L,...G}=S,K=L&&JSON.parse(L),{knowledge_base_name:ue,knowledge_base_name_source:J,selectedKnowledgeBase:Y,sensitiveWordIds:T,database_name:P,graph_nb_name:U}=K;C={...G,...K},g.current={knowledge_base_name:ue,knowledge_base_name_source:J,selectedKnowledgeBase:Y,sensitiveWordIds:T,database_name:P,graph_nb_name:U},R(C),console.log("_configData--->",C),y.setFieldsValue(C),m(!1)}}catch{}}else m(!1);await V(C)},V=async C=>{var S,L,G;try{const[K,ue,J,Y]=await Promise.allSettled([N({pageNum:1,pageSize:9999,status:1,type:1}),N({pageNum:1,pageSize:9999,status:1,type:3}),N({pageNum:1,pageSize:9999,status:1,type:4}),$()]);if(K.status==="fulfilled"&&K.value){const P=(((S=K.value)==null?void 0:S.records)||[]).map(U=>({...U,label:U.modelName,value:U.modelName}));j(P)}if(ue.status==="fulfilled"&&ue.value){const T=(((L=ue.value)==null?void 0:L.records)||[]).map(P=>({label:P.modelName||P.name,value:P.modelName||P.name}));t(T),T.length>0&&!(C!=null&&C.rerank_model_name)&&y.setFieldsValue({rerank_model_name:T[0].value})}if(J.status==="fulfilled"&&J.value){const T=(((G=J.value)==null?void 0:G.records)||[]).map(P=>({label:P.modelName||P.name,value:P.modelName||P.name}));d(T),T.length>0&&!(C!=null&&C.multi_model_name)&&y.setFieldsValue({multi_model_name:T[0].value})}if(Y.status==="fulfilled"&&Y.value&&Y.value){const T=Y.value;Object.keys(te).forEach(P=>{if(T.hasOwnProperty(P)){const{max:U,min:je}=T[P];te[P]={...te[P],min:je,max:U}}}),Z(te)}}catch(K){console.error("\u83B7\u53D6\u5217\u8868\u5931\u8D25:",K)}},ee=async(C,S)=>await o(S,u)?(Be.warning("\u540D\u79F0\u91CD\u590D\uFF01",2),Promise.reject("\u540D\u79F0\u91CD\u590D")):Promise.resolve(),X=(C,S)=>({validator(L,G){return G?Array.isArray(C)&&C.length===0||!C.find(K=>K.value==G)?Promise.reject("\u6A21\u578B\u65E0\u6CD5\u4F7F\u7528\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458"):Promise.resolve():Array.isArray(C)&&C.length===0?Promise.reject("\u6682\u65E0\u53EF\u7528\u6A21\u578B\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458"):Promise.reject(S)}}),pe=(C,S)=>{switch(console.log("++++\u52A9\u624B\u914D\u7F6E",C,S),C){case"knowledge_selected":g.current={...g.current,...S};break;case"sensitive_selected":g.current={...g.current,sensitiveWordIds:S};break;case"database_selected":g.current={...g.current,database_name:S};break;case"graph_selected":g.current={...g.current,graph_nb_name:S};break}},Te=async()=>{var S;let C={};try{v(!0);const L=await y.validateFields(),{knowledge_base_name:G,knowledge_base_name_source:K,selectedKnowledgeBase:ue,sensitiveWordIds:J,database_name:Y,graph_nb_name:T}=g.current;L.thinking=((S=w.find(U=>U.modelName==L.model_name))==null?void 0:S.thinking)||!1,C={configJson:JSON.stringify({...L,knowledge_base_name:G,knowledge_base_name_source:K,selectedKnowledgeBase:ue,sensitiveWordIds:J,...h?{database_name:Y}:{},...F?{graph_nb_name:T}:{}}),name:L.config_name,isDefault:L.isDefault,defaultAnswer:L.defaultAnswer,dependOnKb:L.dependOnKb,sensitiveWordIds:J},u?await k(u,C)&&(Be.success("\u66F4\u65B0\u52A9\u624B\u914D\u7F6E\u6210\u529F"),c&&c("go_back")):await D(C)&&(Be.success("\u65B0\u589E\u52A9\u624B\u914D\u7F6E\u6210\u529F"),c&&c("go_back"))}catch(L){console.error("submit error",L)}finally{v(!1)}},Re=ie(()=>{const C={};return Object.keys(te).forEach(S=>{var L;C[S]=(L=te[S])==null?void 0:L.default}),{...nu,...C}},[]);return i("div",{style:{height:"100%",width:"100%"},children:[i("div",{className:"flex items-center justify-between",style:{width:"100%",padding:"4px 10px 16px 10px"},children:[i("div",{className:"flex items-center",children:[e(Je,{color:"#2468F2",onClick:()=>c&&c("go_back")}),e("div",{className:"text-[16px] text-[#1D2129] bold",style:{marginLeft:20},children:u?"\u7F16\u8F91\u4F1A\u8BDD\u52A9\u624B":"\u65B0\u5EFA\u4F1A\u8BDD\u52A9\u624B"})]}),!E&&e(re,{type:"primary",onClick:()=>Te(),loading:_,disabled:p,children:"\u786E\u5B9A"})]}),E?z&&e(z,{}):e(de,{style:{padding:20,height:"calc(100vh - 150px)",backgroundColor:"#fff"},form:y,layout:"vertical",initialValues:Re,disabled:p,colon:!1,children:i(ae,{gutter:24,style:{height:"100%"},children:[i(ne,{span:12,style:{borderRight:"1px solid #E5E6EB",padding:"10px 32px",height:"100%",overflowY:"auto"},children:[e(M,{label:"\u52A9\u624B\u540D\u79F0",name:"config_name",validateTrigger:"onBlur",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u52A9\u624B\u540D\u79F0"},{validator:ee}],children:e(fe,{placeholder:"\u8BF7\u8F93\u5165"})}),i(ae,{gutter:16,children:[e(ne,{span:12,children:e(M,{label:"\u95EE\u7B54\u6A21\u578B",name:"model_name",rules:[{required:!0,message:""},X(w,"\u8BF7\u9009\u62E9\u95EE\u7B54\u6A21\u578B")],children:e(Q,{placeholder:"\u8BF7\u9009\u62E9",options:w,notFoundContent:e(ce,{})})})}),e(ne,{span:12,children:e(M,{label:"\u89C4\u5212\u6A21\u578B",name:"plan_model_name",rules:[{required:!0,message:""},X(w,"\u8BF7\u9009\u62E9\u89C4\u5212\u6A21\u578B")],children:e(Q,{placeholder:"\u8BF7\u9009\u62E9",options:w,notFoundContent:e(ce,{})})})})]}),i(ae,{gutter:16,children:[e(ne,{span:12,children:e(M,{label:"\u4E0A\u4F20\u6587\u6863\u95EE\u7B54\u591A\u6A21\u6001\u6A21\u578B",name:"multi_model_name",rules:[{required:!0,message:""},X(r,"\u8BF7\u9009\u62E9\u4E0A\u4F20\u6587\u6863\u95EE\u7B54\u591A\u6A21\u6001\u6A21\u578B\u6A21\u578B")],children:e(Q,{placeholder:"\u8BF7\u9009\u62E9",options:r,notFoundContent:e(ce,{})})})}),e(ne,{span:12,children:e(M,{label:"Rerank\u6A21\u578B",name:"rerank_model_name",rules:[{required:!0,message:""},X(l,"\u8BF7\u9009\u62E9Rerank\u6A21\u578B")],children:e(Q,{placeholder:"\u8BF7\u9009\u62E9",options:l,notFoundContent:e(ce,{})})})})]}),e(M,{label:"\u5F00\u573A\u767D",name:"prologue",children:e(fe.TextArea,{maxLength:50,showCount:!0,placeholder:"\u8BF7\u8F93\u5165\u5F00\u573A\u767D",autoSize:{minRows:2}})}),e(M,{label:"\u63D0\u793A\u8BCD",name:"system_prompt",tooltip:Qe,children:e(fe.TextArea,{showCount:!0,rows:8,maxLength:3e3,autoSize:{minRows:10},placeholder:`\u4F8B\u5982\uFF1A${uu}`})}),e(M,{name:"isDefault",valuePropName:"checked",normalize:C=>C===!0?1:0,children:e(_e,{children:"\u9009\u62E9\u4E3A\u9ED8\u8BA4\u52A9\u624B"})})]}),i(ne,{span:12,style:{height:"100%",padding:"10px 32px",overflowY:"auto"},children:[i(ye,{title:"\u68C0\u7D22\u4E0E\u751F\u6210\u53C2\u6570",children:[e(M,{label:"\u95EE\u9898\u63A8\u8350\u6A21\u578B",name:"recommend_model_name",rules:[{required:!0,message:""},X(w,"\u8BF7\u9009\u62E9\u95EE\u9898\u63A8\u8350\u6A21\u578B")],children:e(Q,{placeholder:"\u8BF7\u9009\u62E9",options:w,notFoundContent:e(ce,{})})}),e(M,{label:"\u68C0\u7D22\u7B56\u7565",name:"search_policy",children:e(Q,{options:su,placeholder:"\u8BF7\u9009\u62E9"})}),i(ae,{gutter:16,children:[e(le,{label:"\u6E29\u5EA6",name:"temperature",configScale:I}),e(le,{label:"\u591A\u6837\u6027",name:"top_p",configScale:I})]}),i(ae,{gutter:16,children:[e(le,{label:"\u53EC\u56DE\u6570",name:"top_k",configScale:I}),e(le,{label:"\u76F8\u4F3C\u5EA6\u9608\u503C",name:"score_threshold",configScale:I})]}),i(ae,{gutter:16,children:[e(le,{label:"\u6700\u5927\u4EE4\u724C\u6570",name:"max_tokens",configScale:I}),e(le,{label:"\u4E0A\u4E0B\u6587\u6700\u5927\u8F6E\u6570",name:"max_round",configScale:I})]})]}),i(ye,{title:"\u529F\u80FD\u5F00\u5173",children:[e(M,{label:"\u5F00\u542FFAQ\u4F18\u5148",name:"enabled_faq",valuePropName:"checked",layout:"horizontal",children:e(oe,{})}),e(M,{label:"\u542F\u7528\u56FE\u8C31\u589E\u5F3A",name:"enabled_graph",valuePropName:"checked",layout:"horizontal",children:e(oe,{})}),e(M,{label:"\u5F00\u542F\u5F3A\u4F01\u4E1A\u77E5\u8BC6\u4F9D\u8D56",name:"dependOnKb",valuePropName:"checked",layout:"horizontal",tooltip:eu,normalize:C=>C===!0?1:0,children:e(oe,{})}),e(M,{label:"\u5F00\u542F\u95EE\u9898\u6539\u5199",name:"enabled_question_rewrite",valuePropName:"checked",layout:"horizontal",children:e(oe,{})}),e(M,{label:"\u5F00\u542F\u6EAF\u6E90",name:"need_trace_source",valuePropName:"checked",layout:"horizontal",children:e(oe,{})}),e(M,{noStyle:!0,shouldUpdate:(C,S)=>C.need_trace_source!==S.need_trace_source,children:({getFieldValue:C})=>C("need_trace_source")?i(Me,{children:[e(M,{label:"\u6EAF\u6E90\u7B56\u7565",name:"trace_by_llm",layout:"horizontal",children:e(Q,{placeholder:"\u8BF7\u9009\u62E9",options:ru})}),e(M,{name:"is_download",valuePropName:"checked",layout:"horizontal",children:e(_e,{children:"\u5141\u8BB8\u4E0B\u8F7D\u6EAF\u6E90\u6587\u4EF6"})})]}):null})]}),i(ye,{title:"\u8D44\u6E90\u7ED1\u5B9A",children:[e(pu,{url:n,token:s,role:a,sectionData:f==null?void 0:f.sensitiveWordIds,eventsEmit:pe,defaultAnswer:f==null?void 0:f.defaultAnswer,form:y}),e(gu,{url:n,token:s,role:a,sectionData:{knowledge_base_name:f==null?void 0:f.knowledge_base_name,knowledge_base_name_source:f==null?void 0:f.knowledge_base_name_source,selectedKnowledgeBase:f==null?void 0:f.selectedKnowledgeBase},createBy:b?f==null?void 0:f.createBy:void 0,eventsEmit:pe}),h&&e(Fu,{url:n,token:s,role:a,disabled:p,sectionData:f==null?void 0:f.database_name,eventsEmit:pe}),F&&e(Eu,{url:n,token:s,role:a,sectionData:f==null?void 0:f.graph_nb_name,eventsEmit:pe})]})]})]})})]})};export{Du as C,Ye as S};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as a from"react";import c,{useEffect as Kt,useMemo as Vt}from"react";import{ac as je,y as G,E as Pe,J as Y,e as E,H as X,a3 as nt,z as Gt,ad as Jt,G as Ft,g as vt,m as ht,ae as Ut,r as ft,h as $,af as at,O as Qt,ag as Yt,ah as Zt,ai as kt,aj as ei,ak as ti,al as ii,s as ni,am as ai,u as St,p as ri,an as oi,ao as li,a9 as ci,L as si,l as ui,K as bt}from"./index-OjluyvX1.js";var di={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},mi=function(t,n){return a.createElement(je,G({},t,{ref:n,icon:di}))},rt=a.forwardRef(mi),gi={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},pi=function(t,n){return a.createElement(je,G({},t,{ref:n,icon:gi}))},ot=a.forwardRef(pi);function vi(e,t,n){var i=n||{},r=i.noTrailing,g=r===void 0?!1:r,h=i.noLeading,f=h===void 0?!1:h,m=i.debounceMode,y=m===void 0?void 0:m,S,d=!1,x=0;function O(){S&&clearTimeout(S)}function _(v){var N=v||{},I=N.upcomingOnly,R=I===void 0?!1:I;O(),d=!R}function j(){for(var v=arguments.length,N=new Array(v),I=0;I<v;I++)N[I]=arguments[I];var R=this,W=Date.now()-x;if(d)return;function l(){x=Date.now(),t.apply(R,N)}function z(){S=void 0}!f&&y&&!S&&l(),O(),y===void 0&&W>e?f?(x=Date.now(),g||(S=setTimeout(y?z:l,e))):l():g!==!0&&(S=setTimeout(y?z:l,y===void 0?e-W:e))}return j.cancel=_,j}function hi(e,t,n){var i={},r=i.atBegin,g=r===void 0?!1:r;return vi(e,t,{debounceMode:g!==!1})}var fi={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"},Si=function(t,n){return a.createElement(je,G({},t,{ref:n,icon:fi}))},lt=a.forwardRef(Si),bi={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"},$i=function(t,n){return a.createElement(je,G({},t,{ref:n,icon:bi}))},ct=a.forwardRef($i),Ci={items_per_page:"\u6761/\u9875",jump_to:"\u8DF3\u81F3",jump_to_confirm:"\u786E\u5B9A",page:"\u9875",prev_page:"\u4E0A\u4E00\u9875",next_page:"\u4E0B\u4E00\u9875",prev_5:"\u5411\u524D 5 \u9875",next_5:"\u5411\u540E 5 \u9875",prev_3:"\u5411\u524D 3 \u9875",next_3:"\u5411\u540E 3 \u9875",page_size:"\u9875\u7801"},yi=[10,20,50,100],xi=function(t){var n=t.pageSizeOptions,i=n===void 0?yi:n,r=t.locale,g=t.changeSize,h=t.pageSize,f=t.goButton,m=t.quickGo,y=t.rootPrefixCls,S=t.disabled,d=t.buildOptionText,x=t.showSizeChanger,O=t.sizeChangerRender,_=c.useState(""),j=Pe(_,2),v=j[0],N=j[1],I=function(){return!v||Number.isNaN(v)?void 0:Number(v)},R=typeof d=="function"?d:function(p){return"".concat(p," ").concat(r.items_per_page)},W=function(b){N(b.target.value)},l=function(b){f||v===""||(N(""),!(b.relatedTarget&&(b.relatedTarget.className.indexOf("".concat(y,"-item-link"))>=0||b.relatedTarget.className.indexOf("".concat(y,"-item"))>=0))&&(m==null||m(I())))},z=function(b){v!==""&&(b.keyCode===Y.ENTER||b.type==="click")&&(N(""),m==null||m(I()))},K=function(){return i.some(function(b){return b.toString()===h.toString()})?i:i.concat([h]).sort(function(b,L){var ee=Number.isNaN(Number(b))?0:Number(b),V=Number.isNaN(Number(L))?0:Number(L);return ee-V})},w="".concat(y,"-options");if(!x&&!m)return null;var M=null,H=null,J=null;return x&&O&&(M=O({disabled:S,size:h,onSizeChange:function(b){g==null||g(Number(b))},"aria-label":r.page_size,className:"".concat(w,"-size-changer"),options:K().map(function(p){return{label:R(p),value:p}})})),m&&(f&&(J=typeof f=="boolean"?c.createElement("button",{type:"button",onClick:z,onKeyUp:z,disabled:S,className:"".concat(w,"-quick-jumper-button")},r.jump_to_confirm):c.createElement("span",{onClick:z,onKeyUp:z},f)),H=c.createElement("div",{className:"".concat(w,"-quick-jumper")},r.jump_to,c.createElement("input",{disabled:S,type:"text",value:v,onChange:W,onKeyUp:z,onBlur:l,"aria-label":r.page}),r.page,J)),c.createElement("li",{className:w},M,H)},ve=function(t){var n=t.rootPrefixCls,i=t.page,r=t.active,g=t.className,h=t.showTitle,f=t.onClick,m=t.onKeyPress,y=t.itemRender,S="".concat(n,"-item"),d=E(S,"".concat(S,"-").concat(i),X(X({},"".concat(S,"-active"),r),"".concat(S,"-disabled"),!i),g),x=function(){f(i)},O=function(v){m(v,f,i)},_=y(i,"page",c.createElement("a",{rel:"nofollow"},i));return _?c.createElement("li",{title:h?String(i):null,className:d,onClick:x,onKeyDown:O,tabIndex:0},_):null},zi=function(t,n,i){return i};function st(){}function ut(e){var t=Number(e);return typeof t=="number"&&!Number.isNaN(t)&&isFinite(t)&&Math.floor(t)===t}function ae(e,t,n){var i=typeof e>"u"?t:e;return Math.floor((n-1)/i)+1}var Ni=function(t){var n=t.prefixCls,i=n===void 0?"rc-pagination":n,r=t.selectPrefixCls,g=r===void 0?"rc-select":r,h=t.className,f=t.current,m=t.defaultCurrent,y=m===void 0?1:m,S=t.total,d=S===void 0?0:S,x=t.pageSize,O=t.defaultPageSize,_=O===void 0?10:O,j=t.onChange,v=j===void 0?st:j,N=t.hideOnSinglePage,I=t.align,R=t.showPrevNextJumpers,W=R===void 0?!0:R,l=t.showQuickJumper,z=t.showLessItems,K=t.showTitle,w=K===void 0?!0:K,M=t.onShowSizeChange,H=M===void 0?st:M,J=t.locale,p=J===void 0?Ci:J,b=t.style,L=t.totalBoundaryShowSizeChanger,ee=L===void 0?50:L,V=t.disabled,D=t.simple,A=t.showTotal,Z=t.showSizeChanger,Be=Z===void 0?d>ee:Z,Me=t.sizeChangerRender,Te=t.pageSizeOptions,he=t.itemRender,te=he===void 0?zi:he,fe=t.jumpPrevIcon,F=t.jumpNextIcon,ie=t.prevIcon,le=t.nextIcon,ce=c.useRef(null),ne=nt(10,{value:x,defaultValue:_}),Se=Pe(ne,2),B=Se[0],be=Se[1],De=nt(1,{value:f,defaultValue:y,postState:function(u){return Math.max(1,Math.min(u,ae(void 0,B,d)))}}),re=Pe(De,2),s=re[0],U=re[1],_e=c.useState(s),Xe=Pe(_e,2),oe=Xe[0],$e=Xe[1];Kt(function(){$e(s)},[s]);var We=Math.max(1,s-(z?3:5)),Ke=Math.min(ae(void 0,B,d),s+(z?3:5));function Ce(o,u){var C=o||c.createElement("button",{type:"button","aria-label":u,className:"".concat(i,"-item-link")});return typeof o=="function"&&(C=c.createElement(o,Ft({},t))),C}function Ve(o){var u=o.target.value,C=ae(void 0,B,d),k;return u===""?k=u:Number.isNaN(Number(u))?k=oe:u>=C?k=C:k=Number(u),k}function Nt(o){return ut(o)&&o!==s&&ut(d)&&d>0}var Et=d>B?l:!1;function It(o){(o.keyCode===Y.UP||o.keyCode===Y.DOWN)&&o.preventDefault()}function Ge(o){var u=Ve(o);switch(u!==oe&&$e(u),o.keyCode){case Y.ENTER:q(u);break;case Y.UP:q(u-1);break;case Y.DOWN:q(u+1);break}}function wt(o){q(Ve(o))}function Pt(o){var u=ae(o,B,d),C=s>u&&u!==0?u:s;be(o),$e(C),H==null||H(s,o),U(C),v==null||v(C,o)}function q(o){if(Nt(o)&&!V){var u=ae(void 0,B,d),C=o;return o>u?C=u:o<1&&(C=1),C!==oe&&$e(C),U(C),v==null||v(C,B),C}return s}var ye=s>1,xe=s<ae(void 0,B,d);function Je(){ye&&q(s-1)}function Fe(){xe&&q(s+1)}function Ue(){q(We)}function Qe(){q(Ke)}function se(o,u){if(o.key==="Enter"||o.charCode===Y.ENTER||o.keyCode===Y.ENTER){for(var C=arguments.length,k=new Array(C>2?C-2:0),we=2;we<C;we++)k[we-2]=arguments[we];u.apply(void 0,k)}}function Ot(o){se(o,Je)}function jt(o){se(o,Fe)}function Bt(o){se(o,Ue)}function Mt(o){se(o,Qe)}function Tt(o){var u=te(o,"prev",Ce(ie,"prev page"));return c.isValidElement(u)?c.cloneElement(u,{disabled:!ye}):u}function Dt(o){var u=te(o,"next",Ce(le,"next page"));return c.isValidElement(u)?c.cloneElement(u,{disabled:!xe}):u}function ze(o){(o.type==="click"||o.keyCode===Y.ENTER)&&q(oe)}var Ye=null,_t=Gt(t,{aria:!0,data:!0}),Rt=A&&c.createElement("li",{className:"".concat(i,"-total-text")},A(d,[d===0?0:(s-1)*B+1,s*B>d?d:s*B])),Ze=null,P=ae(void 0,B,d);if(N&&d<=B)return null;var T=[],ue={rootPrefixCls:i,onClick:q,onKeyPress:se,showTitle:w,itemRender:te,page:-1},Ht=s-1>0?s-1:0,Lt=s+1<P?s+1:P,Ne=l&&l.goButton,At=Jt(D)==="object"?D.readOnly:!D,de=Ne,ke=null;D&&(Ne&&(typeof Ne=="boolean"?de=c.createElement("button",{type:"button",onClick:ze,onKeyUp:ze},p.jump_to_confirm):de=c.createElement("span",{onClick:ze,onKeyUp:ze},Ne),de=c.createElement("li",{title:w?"".concat(p.jump_to).concat(s,"/").concat(P):null,className:"".concat(i,"-simple-pager")},de)),ke=c.createElement("li",{title:w?"".concat(s,"/").concat(P):null,className:"".concat(i,"-simple-pager")},At?oe:c.createElement("input",{type:"text","aria-label":p.jump_to,value:oe,disabled:V,onKeyDown:It,onKeyUp:Ge,onChange:Ge,onBlur:wt,size:3}),c.createElement("span",{className:"".concat(i,"-slash")},"/"),P));var Q=z?1:2;if(P<=3+Q*2){P||T.push(c.createElement(ve,G({},ue,{key:"noPager",page:1,className:"".concat(i,"-item-disabled")})));for(var me=1;me<=P;me+=1)T.push(c.createElement(ve,G({},ue,{key:me,page:me,active:s===me})))}else{var qt=z?p.prev_3:p.prev_5,Xt=z?p.next_3:p.next_5,et=te(We,"jump-prev",Ce(fe,"prev page")),tt=te(Ke,"jump-next",Ce(F,"next page"));W&&(Ye=et?c.createElement("li",{title:w?qt:null,key:"prev",onClick:Ue,tabIndex:0,onKeyDown:Bt,className:E("".concat(i,"-jump-prev"),X({},"".concat(i,"-jump-prev-custom-icon"),!!fe))},et):null,Ze=tt?c.createElement("li",{title:w?Xt:null,key:"next",onClick:Qe,tabIndex:0,onKeyDown:Mt,className:E("".concat(i,"-jump-next"),X({},"".concat(i,"-jump-next-custom-icon"),!!F))},tt):null);var Re=Math.max(1,s-Q),He=Math.min(s+Q,P);s-1<=Q&&(He=1+Q*2),P-s<=Q&&(Re=P-Q*2);for(var ge=Re;ge<=He;ge+=1)T.push(c.createElement(ve,G({},ue,{key:ge,page:ge,active:s===ge})));if(s-1>=Q*2&&s!==3&&(T[0]=c.cloneElement(T[0],{className:E("".concat(i,"-item-after-jump-prev"),T[0].props.className)}),T.unshift(Ye)),P-s>=Q*2&&s!==P-2){var it=T[T.length-1];T[T.length-1]=c.cloneElement(it,{className:E("".concat(i,"-item-before-jump-next"),it.props.className)}),T.push(Ze)}Re!==1&&T.unshift(c.createElement(ve,G({},ue,{key:1,page:1}))),He!==P&&T.push(c.createElement(ve,G({},ue,{key:P,page:P})))}var Ee=Tt(Ht);if(Ee){var Le=!ye||!P;Ee=c.createElement("li",{title:w?p.prev_page:null,onClick:Je,tabIndex:Le?null:0,onKeyDown:Ot,className:E("".concat(i,"-prev"),X({},"".concat(i,"-disabled"),Le)),"aria-disabled":Le},Ee)}var Ie=Dt(Lt);if(Ie){var pe,Ae;D?(pe=!xe,Ae=ye?0:null):(pe=!xe||!P,Ae=pe?null:0),Ie=c.createElement("li",{title:w?p.next_page:null,onClick:Fe,tabIndex:Ae,onKeyDown:jt,className:E("".concat(i,"-next"),X({},"".concat(i,"-disabled"),pe)),"aria-disabled":pe},Ie)}var Wt=E(i,h,X(X(X(X(X({},"".concat(i,"-start"),I==="start"),"".concat(i,"-center"),I==="center"),"".concat(i,"-end"),I==="end"),"".concat(i,"-simple"),D),"".concat(i,"-disabled"),V));return c.createElement("ul",G({className:Wt,style:b,ref:ce},_t),Rt,Ee,D?ke:T,Ie,c.createElement(xi,{locale:p,rootPrefixCls:i,disabled:V,selectPrefixCls:g,changeSize:Pt,pageSize:B,pageSizeOptions:Te,quickGo:Et?q:null,goButton:de,showSizeChanger:Be,sizeChangerRender:Me}))};const Ei=e=>{const{componentCls:t}=e;return{[`${t}-disabled`]:{"&, &:hover":{cursor:"not-allowed",[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed"}}},[`&${t}-disabled`]:{cursor:"not-allowed",[`${t}-item`]:{cursor:"not-allowed",backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"},a:{color:e.colorTextDisabled,backgroundColor:"transparent",border:"none",cursor:"not-allowed"},"&-active":{borderColor:e.colorBorder,backgroundColor:e.itemActiveBgDisabled,"&:hover, &:active":{backgroundColor:e.itemActiveBgDisabled},a:{color:e.itemActiveColorDisabled}}},[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},[`${t}-simple&`]:{backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"}}},[`${t}-simple-pager`]:{color:e.colorTextDisabled},[`${t}-jump-prev, ${t}-jump-next`]:{[`${t}-item-link-icon`]:{opacity:0},[`${t}-item-ellipsis`]:{opacity:1}}}}},Ii=e=>{const{componentCls:t}=e;return{[`&${t}-mini ${t}-total-text, &${t}-mini ${t}-simple-pager`]:{height:e.itemSizeSM,lineHeight:$(e.itemSizeSM)},[`&${t}-mini ${t}-item`]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:$(e.calc(e.itemSizeSM).sub(2).equal())},[`&${t}-mini ${t}-prev, &${t}-mini ${t}-next`]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:$(e.itemSizeSM)},[`&${t}-mini:not(${t}-disabled)`]:{[`${t}-prev, ${t}-next`]:{[`&:hover ${t}-item-link`]:{backgroundColor:e.colorBgTextHover},[`&:active ${t}-item-link`]:{backgroundColor:e.colorBgTextActive},[`&${t}-disabled:hover ${t}-item-link`]:{backgroundColor:"transparent"}}},[`
|
|
1
|
+
import*as a from"react";import c,{useEffect as Kt,useMemo as Vt}from"react";import{ac as je,A as G,H as Pe,M as Y,f as E,L as X,a5 as nt,E as Gt,ad as Jt,J as Ft,g as vt,m as ft,ae as Ut,r as ht,k as $,af as at,S as Qt,ag as Yt,ah as Zt,ai as kt,aj as ei,ak as ti,al as ii,w as ni,am as ai,u as St,s as ri,an as oi,ao as li,a9 as ci,N as si,o as ui,K as bt}from"./index-BbHMAb8g.js";var di={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},mi=function(t,n){return a.createElement(je,G({},t,{ref:n,icon:di}))},rt=a.forwardRef(mi),gi={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},pi=function(t,n){return a.createElement(je,G({},t,{ref:n,icon:gi}))},ot=a.forwardRef(pi);function vi(e,t,n){var i=n||{},r=i.noTrailing,g=r===void 0?!1:r,f=i.noLeading,h=f===void 0?!1:f,m=i.debounceMode,y=m===void 0?void 0:m,S,d=!1,x=0;function O(){S&&clearTimeout(S)}function _(v){var N=v||{},I=N.upcomingOnly,R=I===void 0?!1:I;O(),d=!R}function j(){for(var v=arguments.length,N=new Array(v),I=0;I<v;I++)N[I]=arguments[I];var R=this,W=Date.now()-x;if(d)return;function l(){x=Date.now(),t.apply(R,N)}function z(){S=void 0}!h&&y&&!S&&l(),O(),y===void 0&&W>e?h?(x=Date.now(),g||(S=setTimeout(y?z:l,e))):l():g!==!0&&(S=setTimeout(y?z:l,y===void 0?e-W:e))}return j.cancel=_,j}function fi(e,t,n){var i={},r=i.atBegin,g=r===void 0?!1:r;return vi(e,t,{debounceMode:g!==!1})}var hi={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"},Si=function(t,n){return a.createElement(je,G({},t,{ref:n,icon:hi}))},lt=a.forwardRef(Si),bi={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"},$i=function(t,n){return a.createElement(je,G({},t,{ref:n,icon:bi}))},ct=a.forwardRef($i),Ci={items_per_page:"\u6761/\u9875",jump_to:"\u8DF3\u81F3",jump_to_confirm:"\u786E\u5B9A",page:"\u9875",prev_page:"\u4E0A\u4E00\u9875",next_page:"\u4E0B\u4E00\u9875",prev_5:"\u5411\u524D 5 \u9875",next_5:"\u5411\u540E 5 \u9875",prev_3:"\u5411\u524D 3 \u9875",next_3:"\u5411\u540E 3 \u9875",page_size:"\u9875\u7801"},yi=[10,20,50,100],xi=function(t){var n=t.pageSizeOptions,i=n===void 0?yi:n,r=t.locale,g=t.changeSize,f=t.pageSize,h=t.goButton,m=t.quickGo,y=t.rootPrefixCls,S=t.disabled,d=t.buildOptionText,x=t.showSizeChanger,O=t.sizeChangerRender,_=c.useState(""),j=Pe(_,2),v=j[0],N=j[1],I=function(){return!v||Number.isNaN(v)?void 0:Number(v)},R=typeof d=="function"?d:function(p){return"".concat(p," ").concat(r.items_per_page)},W=function(b){N(b.target.value)},l=function(b){h||v===""||(N(""),!(b.relatedTarget&&(b.relatedTarget.className.indexOf("".concat(y,"-item-link"))>=0||b.relatedTarget.className.indexOf("".concat(y,"-item"))>=0))&&(m==null||m(I())))},z=function(b){v!==""&&(b.keyCode===Y.ENTER||b.type==="click")&&(N(""),m==null||m(I()))},K=function(){return i.some(function(b){return b.toString()===f.toString()})?i:i.concat([f]).sort(function(b,L){var ee=Number.isNaN(Number(b))?0:Number(b),V=Number.isNaN(Number(L))?0:Number(L);return ee-V})},w="".concat(y,"-options");if(!x&&!m)return null;var B=null,H=null,J=null;return x&&O&&(B=O({disabled:S,size:f,onSizeChange:function(b){g==null||g(Number(b))},"aria-label":r.page_size,className:"".concat(w,"-size-changer"),options:K().map(function(p){return{label:R(p),value:p}})})),m&&(h&&(J=typeof h=="boolean"?c.createElement("button",{type:"button",onClick:z,onKeyUp:z,disabled:S,className:"".concat(w,"-quick-jumper-button")},r.jump_to_confirm):c.createElement("span",{onClick:z,onKeyUp:z},h)),H=c.createElement("div",{className:"".concat(w,"-quick-jumper")},r.jump_to,c.createElement("input",{disabled:S,type:"text",value:v,onChange:W,onKeyUp:z,onBlur:l,"aria-label":r.page}),r.page,J)),c.createElement("li",{className:w},B,H)},ve=function(t){var n=t.rootPrefixCls,i=t.page,r=t.active,g=t.className,f=t.showTitle,h=t.onClick,m=t.onKeyPress,y=t.itemRender,S="".concat(n,"-item"),d=E(S,"".concat(S,"-").concat(i),X(X({},"".concat(S,"-active"),r),"".concat(S,"-disabled"),!i),g),x=function(){h(i)},O=function(v){m(v,h,i)},_=y(i,"page",c.createElement("a",{rel:"nofollow"},i));return _?c.createElement("li",{title:f?String(i):null,className:d,onClick:x,onKeyDown:O,tabIndex:0},_):null},zi=function(t,n,i){return i};function st(){}function ut(e){var t=Number(e);return typeof t=="number"&&!Number.isNaN(t)&&isFinite(t)&&Math.floor(t)===t}function ae(e,t,n){var i=typeof e>"u"?t:e;return Math.floor((n-1)/i)+1}var Ni=function(t){var n=t.prefixCls,i=n===void 0?"rc-pagination":n,r=t.selectPrefixCls,g=r===void 0?"rc-select":r,f=t.className,h=t.current,m=t.defaultCurrent,y=m===void 0?1:m,S=t.total,d=S===void 0?0:S,x=t.pageSize,O=t.defaultPageSize,_=O===void 0?10:O,j=t.onChange,v=j===void 0?st:j,N=t.hideOnSinglePage,I=t.align,R=t.showPrevNextJumpers,W=R===void 0?!0:R,l=t.showQuickJumper,z=t.showLessItems,K=t.showTitle,w=K===void 0?!0:K,B=t.onShowSizeChange,H=B===void 0?st:B,J=t.locale,p=J===void 0?Ci:J,b=t.style,L=t.totalBoundaryShowSizeChanger,ee=L===void 0?50:L,V=t.disabled,D=t.simple,A=t.showTotal,Z=t.showSizeChanger,Me=Z===void 0?d>ee:Z,Be=t.sizeChangerRender,Te=t.pageSizeOptions,fe=t.itemRender,te=fe===void 0?zi:fe,he=t.jumpPrevIcon,F=t.jumpNextIcon,ie=t.prevIcon,le=t.nextIcon,ce=c.useRef(null),ne=nt(10,{value:x,defaultValue:_}),Se=Pe(ne,2),M=Se[0],be=Se[1],De=nt(1,{value:h,defaultValue:y,postState:function(u){return Math.max(1,Math.min(u,ae(void 0,M,d)))}}),re=Pe(De,2),s=re[0],U=re[1],_e=c.useState(s),Xe=Pe(_e,2),oe=Xe[0],$e=Xe[1];Kt(function(){$e(s)},[s]);var We=Math.max(1,s-(z?3:5)),Ke=Math.min(ae(void 0,M,d),s+(z?3:5));function Ce(o,u){var C=o||c.createElement("button",{type:"button","aria-label":u,className:"".concat(i,"-item-link")});return typeof o=="function"&&(C=c.createElement(o,Ft({},t))),C}function Ve(o){var u=o.target.value,C=ae(void 0,M,d),k;return u===""?k=u:Number.isNaN(Number(u))?k=oe:u>=C?k=C:k=Number(u),k}function Nt(o){return ut(o)&&o!==s&&ut(d)&&d>0}var Et=d>M?l:!1;function It(o){(o.keyCode===Y.UP||o.keyCode===Y.DOWN)&&o.preventDefault()}function Ge(o){var u=Ve(o);switch(u!==oe&&$e(u),o.keyCode){case Y.ENTER:q(u);break;case Y.UP:q(u-1);break;case Y.DOWN:q(u+1);break}}function wt(o){q(Ve(o))}function Pt(o){var u=ae(o,M,d),C=s>u&&u!==0?u:s;be(o),$e(C),H==null||H(s,o),U(C),v==null||v(C,o)}function q(o){if(Nt(o)&&!V){var u=ae(void 0,M,d),C=o;return o>u?C=u:o<1&&(C=1),C!==oe&&$e(C),U(C),v==null||v(C,M),C}return s}var ye=s>1,xe=s<ae(void 0,M,d);function Je(){ye&&q(s-1)}function Fe(){xe&&q(s+1)}function Ue(){q(We)}function Qe(){q(Ke)}function se(o,u){if(o.key==="Enter"||o.charCode===Y.ENTER||o.keyCode===Y.ENTER){for(var C=arguments.length,k=new Array(C>2?C-2:0),we=2;we<C;we++)k[we-2]=arguments[we];u.apply(void 0,k)}}function Ot(o){se(o,Je)}function jt(o){se(o,Fe)}function Mt(o){se(o,Ue)}function Bt(o){se(o,Qe)}function Tt(o){var u=te(o,"prev",Ce(ie,"prev page"));return c.isValidElement(u)?c.cloneElement(u,{disabled:!ye}):u}function Dt(o){var u=te(o,"next",Ce(le,"next page"));return c.isValidElement(u)?c.cloneElement(u,{disabled:!xe}):u}function ze(o){(o.type==="click"||o.keyCode===Y.ENTER)&&q(oe)}var Ye=null,_t=Gt(t,{aria:!0,data:!0}),Rt=A&&c.createElement("li",{className:"".concat(i,"-total-text")},A(d,[d===0?0:(s-1)*M+1,s*M>d?d:s*M])),Ze=null,P=ae(void 0,M,d);if(N&&d<=M)return null;var T=[],ue={rootPrefixCls:i,onClick:q,onKeyPress:se,showTitle:w,itemRender:te,page:-1},Ht=s-1>0?s-1:0,Lt=s+1<P?s+1:P,Ne=l&&l.goButton,At=Jt(D)==="object"?D.readOnly:!D,de=Ne,ke=null;D&&(Ne&&(typeof Ne=="boolean"?de=c.createElement("button",{type:"button",onClick:ze,onKeyUp:ze},p.jump_to_confirm):de=c.createElement("span",{onClick:ze,onKeyUp:ze},Ne),de=c.createElement("li",{title:w?"".concat(p.jump_to).concat(s,"/").concat(P):null,className:"".concat(i,"-simple-pager")},de)),ke=c.createElement("li",{title:w?"".concat(s,"/").concat(P):null,className:"".concat(i,"-simple-pager")},At?oe:c.createElement("input",{type:"text","aria-label":p.jump_to,value:oe,disabled:V,onKeyDown:It,onKeyUp:Ge,onChange:Ge,onBlur:wt,size:3}),c.createElement("span",{className:"".concat(i,"-slash")},"/"),P));var Q=z?1:2;if(P<=3+Q*2){P||T.push(c.createElement(ve,G({},ue,{key:"noPager",page:1,className:"".concat(i,"-item-disabled")})));for(var me=1;me<=P;me+=1)T.push(c.createElement(ve,G({},ue,{key:me,page:me,active:s===me})))}else{var qt=z?p.prev_3:p.prev_5,Xt=z?p.next_3:p.next_5,et=te(We,"jump-prev",Ce(he,"prev page")),tt=te(Ke,"jump-next",Ce(F,"next page"));W&&(Ye=et?c.createElement("li",{title:w?qt:null,key:"prev",onClick:Ue,tabIndex:0,onKeyDown:Mt,className:E("".concat(i,"-jump-prev"),X({},"".concat(i,"-jump-prev-custom-icon"),!!he))},et):null,Ze=tt?c.createElement("li",{title:w?Xt:null,key:"next",onClick:Qe,tabIndex:0,onKeyDown:Bt,className:E("".concat(i,"-jump-next"),X({},"".concat(i,"-jump-next-custom-icon"),!!F))},tt):null);var Re=Math.max(1,s-Q),He=Math.min(s+Q,P);s-1<=Q&&(He=1+Q*2),P-s<=Q&&(Re=P-Q*2);for(var ge=Re;ge<=He;ge+=1)T.push(c.createElement(ve,G({},ue,{key:ge,page:ge,active:s===ge})));if(s-1>=Q*2&&s!==3&&(T[0]=c.cloneElement(T[0],{className:E("".concat(i,"-item-after-jump-prev"),T[0].props.className)}),T.unshift(Ye)),P-s>=Q*2&&s!==P-2){var it=T[T.length-1];T[T.length-1]=c.cloneElement(it,{className:E("".concat(i,"-item-before-jump-next"),it.props.className)}),T.push(Ze)}Re!==1&&T.unshift(c.createElement(ve,G({},ue,{key:1,page:1}))),He!==P&&T.push(c.createElement(ve,G({},ue,{key:P,page:P})))}var Ee=Tt(Ht);if(Ee){var Le=!ye||!P;Ee=c.createElement("li",{title:w?p.prev_page:null,onClick:Je,tabIndex:Le?null:0,onKeyDown:Ot,className:E("".concat(i,"-prev"),X({},"".concat(i,"-disabled"),Le)),"aria-disabled":Le},Ee)}var Ie=Dt(Lt);if(Ie){var pe,Ae;D?(pe=!xe,Ae=ye?0:null):(pe=!xe||!P,Ae=pe?null:0),Ie=c.createElement("li",{title:w?p.next_page:null,onClick:Fe,tabIndex:Ae,onKeyDown:jt,className:E("".concat(i,"-next"),X({},"".concat(i,"-disabled"),pe)),"aria-disabled":pe},Ie)}var Wt=E(i,f,X(X(X(X(X({},"".concat(i,"-start"),I==="start"),"".concat(i,"-center"),I==="center"),"".concat(i,"-end"),I==="end"),"".concat(i,"-simple"),D),"".concat(i,"-disabled"),V));return c.createElement("ul",G({className:Wt,style:b,ref:ce},_t),Rt,Ee,D?ke:T,Ie,c.createElement(xi,{locale:p,rootPrefixCls:i,disabled:V,selectPrefixCls:g,changeSize:Pt,pageSize:M,pageSizeOptions:Te,quickGo:Et?q:null,goButton:de,showSizeChanger:Me,sizeChangerRender:Be}))};const Ei=e=>{const{componentCls:t}=e;return{[`${t}-disabled`]:{"&, &:hover":{cursor:"not-allowed",[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed"}}},[`&${t}-disabled`]:{cursor:"not-allowed",[`${t}-item`]:{cursor:"not-allowed",backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"},a:{color:e.colorTextDisabled,backgroundColor:"transparent",border:"none",cursor:"not-allowed"},"&-active":{borderColor:e.colorBorder,backgroundColor:e.itemActiveBgDisabled,"&:hover, &:active":{backgroundColor:e.itemActiveBgDisabled},a:{color:e.itemActiveColorDisabled}}},[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},[`${t}-simple&`]:{backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"}}},[`${t}-simple-pager`]:{color:e.colorTextDisabled},[`${t}-jump-prev, ${t}-jump-next`]:{[`${t}-item-link-icon`]:{opacity:0},[`${t}-item-ellipsis`]:{opacity:1}}}}},Ii=e=>{const{componentCls:t}=e;return{[`&${t}-mini ${t}-total-text, &${t}-mini ${t}-simple-pager`]:{height:e.itemSizeSM,lineHeight:$(e.itemSizeSM)},[`&${t}-mini ${t}-item`]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:$(e.calc(e.itemSizeSM).sub(2).equal())},[`&${t}-mini ${t}-prev, &${t}-mini ${t}-next`]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:$(e.itemSizeSM)},[`&${t}-mini:not(${t}-disabled)`]:{[`${t}-prev, ${t}-next`]:{[`&:hover ${t}-item-link`]:{backgroundColor:e.colorBgTextHover},[`&:active ${t}-item-link`]:{backgroundColor:e.colorBgTextActive},[`&${t}-disabled:hover ${t}-item-link`]:{backgroundColor:"transparent"}}},[`
|
|
2
2
|
&${t}-mini ${t}-prev ${t}-item-link,
|
|
3
3
|
&${t}-mini ${t}-next ${t}-item-link
|
|
4
4
|
`]:{backgroundColor:"transparent",borderColor:"transparent","&::after":{height:e.itemSizeSM,lineHeight:$(e.itemSizeSM)}},[`&${t}-mini ${t}-jump-prev, &${t}-mini ${t}-jump-next`]:{height:e.itemSizeSM,marginInlineEnd:0,lineHeight:$(e.itemSizeSM)},[`&${t}-mini ${t}-options`]:{marginInlineStart:e.paginationMiniOptionsMarginInlineStart,"&-size-changer":{top:e.miniOptionsSizeChangerTop},"&-quick-jumper":{height:e.itemSizeSM,lineHeight:$(e.itemSizeSM),input:Object.assign(Object.assign({},ti(e)),{width:e.paginationMiniQuickJumperInputWidth,height:e.controlHeightSM})}}}},wi=e=>{const{componentCls:t}=e;return{[`&${t}-simple`]:{[`${t}-prev, ${t}-next`]:{height:e.itemSize,lineHeight:$(e.itemSize),verticalAlign:"top",[`${t}-item-link`]:{height:e.itemSize,backgroundColor:"transparent",border:0,"&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive},"&::after":{height:e.itemSize,lineHeight:$(e.itemSize)}}},[`${t}-simple-pager`]:{display:"inline-flex",alignItems:"center",height:e.itemSize,marginInlineEnd:e.marginXS,input:{boxSizing:"border-box",height:"100%",width:e.quickJumperInputWidth,padding:`0 ${$(e.paginationItemPaddingInline)}`,textAlign:"center",backgroundColor:e.itemInputBg,border:`${$(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadius,outline:"none",transition:`border-color ${e.motionDurationMid}`,color:"inherit","&:hover":{borderColor:e.colorPrimary},"&:focus":{borderColor:e.colorPrimaryHover,boxShadow:`${$(e.inputOutlineOffset)} 0 ${$(e.controlOutlineWidth)} ${e.controlOutline}`},"&[disabled]":{color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,cursor:"not-allowed"}}},[`&${t}-disabled`]:{[`${t}-prev, ${t}-next`]:{[`${t}-item-link`]:{"&:hover, &:active":{backgroundColor:"transparent"}}}},[`&${t}-mini`]:{[`${t}-prev, ${t}-next`]:{height:e.itemSizeSM,lineHeight:$(e.itemSizeSM),[`${t}-item-link`]:{height:e.itemSizeSM,"&::after":{height:e.itemSizeSM,lineHeight:$(e.itemSizeSM)}}},[`${t}-simple-pager`]:{height:e.itemSizeSM,input:{width:e.paginationMiniQuickJumperInputWidth}}}}}},Pi=e=>{const{componentCls:t}=e;return{[`${t}-jump-prev, ${t}-jump-next`]:{outline:0,[`${t}-item-container`]:{position:"relative",[`${t}-item-link-icon`]:{color:e.colorPrimary,fontSize:e.fontSizeSM,opacity:0,transition:`all ${e.motionDurationMid}`,"&-svg":{top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,margin:"auto"}},[`${t}-item-ellipsis`]:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,display:"block",margin:"auto",color:e.colorTextDisabled,letterSpacing:e.paginationEllipsisLetterSpacing,textAlign:"center",textIndent:e.paginationEllipsisTextIndent,opacity:1,transition:`all ${e.motionDurationMid}`}},"&:hover":{[`${t}-item-link-icon`]:{opacity:1},[`${t}-item-ellipsis`]:{opacity:0}}},[`
|
|
@@ -10,4 +10,4 @@ import*as a from"react";import c,{useEffect as Kt,useMemo as Vt}from"react";impo
|
|
|
10
10
|
${t}-next,
|
|
11
11
|
${t}-jump-prev,
|
|
12
12
|
${t}-jump-next
|
|
13
|
-
`]:{display:"inline-block",minWidth:e.itemSize,height:e.itemSize,color:e.colorText,fontFamily:e.fontFamily,lineHeight:$(e.itemSize),textAlign:"center",verticalAlign:"middle",listStyle:"none",borderRadius:e.borderRadius,cursor:"pointer",transition:`all ${e.motionDurationMid}`},[`${t}-prev, ${t}-next`]:{outline:0,button:{color:e.colorText,cursor:"pointer",userSelect:"none"},[`${t}-item-link`]:{display:"block",width:"100%",height:"100%",padding:0,fontSize:e.fontSizeSM,textAlign:"center",backgroundColor:"transparent",border:`${$(e.lineWidth)} ${e.lineType} transparent`,borderRadius:e.borderRadius,outline:"none",transition:`all ${e.motionDurationMid}`},[`&:hover ${t}-item-link`]:{backgroundColor:e.colorBgTextHover},[`&:active ${t}-item-link`]:{backgroundColor:e.colorBgTextActive},[`&${t}-disabled:hover`]:{[`${t}-item-link`]:{backgroundColor:"transparent"}}},[`${t}-slash`]:{marginInlineEnd:e.paginationSlashMarginInlineEnd,marginInlineStart:e.paginationSlashMarginInlineStart},[`${t}-options`]:{display:"inline-block",marginInlineStart:e.margin,verticalAlign:"middle","&-size-changer":{display:"inline-block",width:"auto"},"&-quick-jumper":{display:"inline-block",height:e.controlHeight,marginInlineStart:e.marginXS,lineHeight:$(e.controlHeight),verticalAlign:"top",input:Object.assign(Object.assign(Object.assign({},Zt(e)),kt(e,{borderColor:e.colorBorder,hoverBorderColor:e.colorPrimaryHover,activeBorderColor:e.colorPrimary,activeShadow:e.activeShadow})),{"&[disabled]":Object.assign({},ei(e)),width:e.quickJumperInputWidth,height:e.controlHeight,boxSizing:"border-box",margin:0,marginInlineStart:e.marginXS,marginInlineEnd:e.marginXS})}}}},Oi=e=>{const{componentCls:t}=e;return{[`${t}-item`]:{display:"inline-block",minWidth:e.itemSize,height:e.itemSize,marginInlineEnd:e.marginXS,fontFamily:e.fontFamily,lineHeight:$(e.calc(e.itemSize).sub(2).equal()),textAlign:"center",verticalAlign:"middle",listStyle:"none",backgroundColor:e.itemBg,border:`${$(e.lineWidth)} ${e.lineType} transparent`,borderRadius:e.borderRadius,outline:0,cursor:"pointer",userSelect:"none",a:{display:"block",padding:`0 ${$(e.paginationItemPaddingInline)}`,color:e.colorText,"&:hover":{textDecoration:"none"}},[`&:not(${t}-item-active)`]:{"&:hover":{transition:`all ${e.motionDurationMid}`,backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},"&-active":{fontWeight:e.fontWeightStrong,backgroundColor:e.itemActiveBg,borderColor:e.colorPrimary,a:{color:e.itemActiveColor},"&:hover":{borderColor:e.colorPrimaryHover},"&:hover a":{color:e.itemActiveColorHover}}}}},ji=e=>{const{componentCls:t}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ft(e)),{display:"flex",flexWrap:"wrap",rowGap:e.paddingXS,"&-start":{justifyContent:"start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"end"},"ul, ol":{margin:0,padding:0,listStyle:"none"},"&::after":{display:"block",clear:"both",height:0,overflow:"hidden",visibility:"hidden",content:'""'},[`${t}-total-text`]:{display:"inline-block",height:e.itemSize,marginInlineEnd:e.marginXS,lineHeight:$(e.calc(e.itemSize).sub(2).equal()),verticalAlign:"middle"}}),Oi(e)),Pi(e)),wi(e)),Ii(e)),Ei(e)),{[`@media only screen and (max-width: ${e.screenLG}px)`]:{[`${t}-item`]:{"&-after-jump-prev, &-before-jump-next":{display:"none"}}},[`@media only screen and (max-width: ${e.screenSM}px)`]:{[`${t}-options`]:{display:"none"}}}),[`&${e.componentCls}-rtl`]:{direction:"rtl"}}},Bi=e=>{const{componentCls:t}=e;return{[`${t}:not(${t}-disabled)`]:{[`${t}-item`]:Object.assign({},Qt(e)),[`${t}-jump-prev, ${t}-jump-next`]:{"&:focus-visible":Object.assign({[`${t}-item-link-icon`]:{opacity:1},[`${t}-item-ellipsis`]:{opacity:0}},at(e))},[`${t}-prev, ${t}-next`]:{[`&:focus-visible ${t}-item-link`]:at(e)}}}},$t=e=>Object.assign({itemBg:e.colorBgContainer,itemSize:e.controlHeight,itemSizeSM:e.controlHeightSM,itemActiveBg:e.colorBgContainer,itemActiveColor:e.colorPrimary,itemActiveColorHover:e.colorPrimaryHover,itemLinkBg:e.colorBgContainer,itemActiveColorDisabled:e.colorTextDisabled,itemActiveBgDisabled:e.controlItemBgActiveDisabled,itemInputBg:e.colorBgContainer,miniOptionsSizeChangerTop:0},Yt(e)),Ct=e=>ht(e,{inputOutlineOffset:0,quickJumperInputWidth:e.calc(e.controlHeightLG).mul(1.25).equal(),paginationMiniOptionsMarginInlineStart:e.calc(e.marginXXS).div(2).equal(),paginationMiniQuickJumperInputWidth:e.calc(e.controlHeightLG).mul(1.1).equal(),paginationItemPaddingInline:e.calc(e.marginXXS).mul(1.5).equal(),paginationEllipsisLetterSpacing:e.calc(e.marginXXS).div(2).equal(),paginationSlashMarginInlineStart:e.marginSM,paginationSlashMarginInlineEnd:e.marginSM,paginationEllipsisTextIndent:"0.13em"},Ut(e)),Mi=vt("Pagination",e=>{const t=Ct(e);return[ji(t),Bi(t)]},$t),Ti=e=>{const{componentCls:t}=e;return{[`${t}${t}-bordered${t}-disabled:not(${t}-mini)`]:{"&, &:hover":{[`${t}-item-link`]:{borderColor:e.colorBorder}},"&:focus-visible":{[`${t}-item-link`]:{borderColor:e.colorBorder}},[`${t}-item, ${t}-item-link`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,[`&:hover:not(${t}-item-active)`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,a:{color:e.colorTextDisabled}},[`&${t}-item-active`]:{backgroundColor:e.itemActiveBgDisabled}},[`${t}-prev, ${t}-next`]:{"&:hover button":{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,color:e.colorTextDisabled},[`${t}-item-link`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder}}},[`${t}${t}-bordered:not(${t}-mini)`]:{[`${t}-prev, ${t}-next`]:{"&:hover button":{borderColor:e.colorPrimaryHover,backgroundColor:e.itemBg},[`${t}-item-link`]:{backgroundColor:e.itemLinkBg,borderColor:e.colorBorder},[`&:hover ${t}-item-link`]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,color:e.colorPrimary},[`&${t}-disabled`]:{[`${t}-item-link`]:{borderColor:e.colorBorder,color:e.colorTextDisabled}}},[`${t}-item`]:{backgroundColor:e.itemBg,border:`${$(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,[`&:hover:not(${t}-item-active)`]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,a:{color:e.colorPrimary}},"&-active":{borderColor:e.colorPrimary}}}}},Di=ii(["Pagination","bordered"],e=>{const t=Ct(e);return Ti(t)},$t);function dt(e){return Vt(()=>typeof e=="boolean"?[e,{}]:e&&typeof e=="object"?[!0,e]:[void 0,void 0],[e])}var _i=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n};const Zi=e=>{const{align:t,prefixCls:n,selectPrefixCls:i,className:r,rootClassName:g,style:h,size:f,locale:m,responsive:y,showSizeChanger:S,selectComponentClass:d,pageSizeOptions:x}=e,O=_i(e,["align","prefixCls","selectPrefixCls","className","rootClassName","style","size","locale","responsive","showSizeChanger","selectComponentClass","pageSizeOptions"]),{xs:_}=ni(y),[,j]=ai(),{getPrefixCls:v,direction:N,showSizeChanger:I,className:R,style:W}=St("pagination"),l=v("pagination",n),[z,K,w]=Mi(l),M=ri(f),H=M==="small"||!!(_&&!M&&y),[J]=oi("Pagination",li),p=Object.assign(Object.assign({},J),m),[b,L]=dt(S),[ee,V]=dt(I),D=b??ee,A=L??V,Z=d||ci,Be=a.useMemo(()=>x?x.map(F=>Number(F)):void 0,[x]),Me=F=>{var ie;const{disabled:le,size:ce,onSizeChange:ne,"aria-label":Se,className:B,options:be}=F,{className:De,onChange:re}=A||{},s=(ie=be.find(U=>String(U.value)===String(ce)))===null||ie===void 0?void 0:ie.value;return a.createElement(Z,Object.assign({disabled:le,showSearch:!0,popupMatchSelectWidth:!1,getPopupContainer:U=>U.parentNode,"aria-label":Se,options:be},A,{value:s,onChange:(U,_e)=>{ne==null||ne(U),re==null||re(U,_e)},size:H?"small":"middle",className:E(B,De)}))},Te=a.useMemo(()=>{const F=a.createElement("span",{className:`${l}-item-ellipsis`},"\u2022\u2022\u2022"),ie=a.createElement("button",{className:`${l}-item-link`,type:"button",tabIndex:-1},N==="rtl"?a.createElement(rt,null):a.createElement(ot,null)),le=a.createElement("button",{className:`${l}-item-link`,type:"button",tabIndex:-1},N==="rtl"?a.createElement(ot,null):a.createElement(rt,null)),ce=a.createElement("a",{className:`${l}-item-link`},a.createElement("div",{className:`${l}-item-container`},N==="rtl"?a.createElement(ct,{className:`${l}-item-link-icon`}):a.createElement(lt,{className:`${l}-item-link-icon`}),F)),ne=a.createElement("a",{className:`${l}-item-link`},a.createElement("div",{className:`${l}-item-container`},N==="rtl"?a.createElement(lt,{className:`${l}-item-link-icon`}):a.createElement(ct,{className:`${l}-item-link-icon`}),F));return{prevIcon:ie,nextIcon:le,jumpPrevIcon:ce,jumpNextIcon:ne}},[N,l]),he=v("select",i),te=E({[`${l}-${t}`]:!!t,[`${l}-mini`]:H,[`${l}-rtl`]:N==="rtl",[`${l}-bordered`]:j.wireframe},R,r,g,K,w),fe=Object.assign(Object.assign({},W),h);return z(a.createElement(a.Fragment,null,j.wireframe&&a.createElement(Di,{prefixCls:l}),a.createElement(Ni,Object.assign({},Te,O,{style:fe,prefixCls:l,selectPrefixCls:he,className:te,locale:p,pageSizeOptions:Be,showSizeChanger:D,sizeChangerRender:Me}))))},Oe=100,yt=Oe/5,xt=Oe/2-yt/2,qe=xt*2*Math.PI,mt=50,gt=e=>{const{dotClassName:t,style:n,hasCircleCls:i}=e;return a.createElement("circle",{className:E(`${t}-circle`,{[`${t}-circle-bg`]:i}),r:xt,cx:mt,cy:mt,strokeWidth:yt,style:n})},Ri=({percent:e,prefixCls:t})=>{const n=`${t}-dot`,i=`${n}-holder`,r=`${i}-hidden`,[g,h]=a.useState(!1);si(()=>{e!==0&&h(!0)},[e!==0]);const f=Math.max(Math.min(e,100),0);if(!g)return null;const m={strokeDashoffset:`${qe/4}`,strokeDasharray:`${qe*f/100} ${qe*(100-f)/100}`};return a.createElement("span",{className:E(i,`${n}-progress`,f<=0&&r)},a.createElement("svg",{viewBox:`0 0 ${Oe} ${Oe}`,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":f},a.createElement(gt,{dotClassName:n,hasCircleCls:!0}),a.createElement(gt,{dotClassName:n,style:m})))};function Hi(e){const{prefixCls:t,percent:n=0}=e,i=`${t}-dot`,r=`${i}-holder`,g=`${r}-hidden`;return a.createElement(a.Fragment,null,a.createElement("span",{className:E(r,n>0&&g)},a.createElement("span",{className:E(i,`${t}-dot-spin`)},[1,2,3,4].map(h=>a.createElement("i",{className:`${t}-dot-item`,key:h})))),a.createElement(Ri,{prefixCls:t,percent:n}))}function Li(e){var t;const{prefixCls:n,indicator:i,percent:r}=e,g=`${n}-dot`;return i&&a.isValidElement(i)?ui(i,{className:E((t=i.props)===null||t===void 0?void 0:t.className,g),percent:r}):a.createElement(Hi,{prefixCls:n,percent:r})}const Ai=new bt("antSpinMove",{to:{opacity:1}}),qi=new bt("antRotate",{to:{transform:"rotate(405deg)"}}),Xi=e=>{const{componentCls:t,calc:n}=e;return{[t]:Object.assign(Object.assign({},ft(e)),{position:"absolute",display:"none",color:e.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`,"&-spinning":{position:"relative",display:"inline-block",opacity:1},[`${t}-text`]:{fontSize:e.fontSize,paddingTop:n(n(e.dotSize).sub(e.fontSize)).div(2).add(2).equal()},"&-fullscreen":{position:"fixed",width:"100vw",height:"100vh",backgroundColor:e.colorBgMask,zIndex:e.zIndexPopupBase,inset:0,display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:0,visibility:"hidden",transition:`all ${e.motionDurationMid}`,"&-show":{opacity:1,visibility:"visible"},[t]:{[`${t}-dot-holder`]:{color:e.colorWhite},[`${t}-text`]:{color:e.colorTextLightSolid}}},"&-nested-loading":{position:"relative",[`> div > ${t}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:e.contentHeight,[`${t}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:n(e.dotSize).mul(-1).div(2).equal()},[`${t}-text`]:{position:"absolute",top:"50%",width:"100%",textShadow:`0 1px 2px ${e.colorBgContainer}`},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSize).div(2).mul(-1).sub(10).equal()},"&-sm":{[`${t}-dot`]:{margin:n(e.dotSizeSM).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:n(n(e.dotSizeSM).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSizeSM).div(2).mul(-1).sub(10).equal()}},"&-lg":{[`${t}-dot`]:{margin:n(e.dotSizeLG).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:n(n(e.dotSizeLG).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSizeLG).div(2).mul(-1).sub(10).equal()}}},[`${t}-container`]:{position:"relative",transition:`opacity ${e.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:e.colorBgContainer,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${t}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-tip":{color:e.spinDotDefault},[`${t}-dot-holder`]:{width:"1em",height:"1em",fontSize:e.dotSize,display:"inline-block",transition:`transform ${e.motionDurationSlow} ease, opacity ${e.motionDurationSlow} ease`,transformOrigin:"50% 50%",lineHeight:1,color:e.colorPrimary,"&-hidden":{transform:"scale(0.3)",opacity:0}},[`${t}-dot-progress`]:{position:"absolute",inset:0},[`${t}-dot`]:{position:"relative",display:"inline-block",fontSize:e.dotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),height:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),background:"currentColor",borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:Ai,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:qi,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"},"&-circle":{strokeLinecap:"round",transition:["stroke-dashoffset","stroke-dasharray","stroke","stroke-width","opacity"].map(i=>`${i} ${e.motionDurationSlow} ease`).join(","),fillOpacity:0,stroke:"currentcolor"},"&-circle-bg":{stroke:e.colorFillSecondary}},[`&-sm ${t}-dot`]:{"&, &-holder":{fontSize:e.dotSizeSM}},[`&-sm ${t}-dot-holder`]:{i:{width:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal(),height:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal()}},[`&-lg ${t}-dot`]:{"&, &-holder":{fontSize:e.dotSizeLG}},[`&-lg ${t}-dot-holder`]:{i:{width:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal(),height:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal()}},[`&${t}-show-text ${t}-text`]:{display:"block"}})}},Wi=e=>{const{controlHeightLG:t,controlHeight:n}=e;return{contentHeight:400,dotSize:t/2,dotSizeSM:t*.35,dotSizeLG:n}},Ki=vt("Spin",e=>{const t=ht(e,{spinDotDefault:e.colorTextDescription});return Xi(t)},Wi),Vi=200,pt=[[30,.05],[70,.03],[96,.01]];function Gi(e,t){const[n,i]=a.useState(0),r=a.useRef(null),g=t==="auto";return a.useEffect(()=>(g&&e&&(i(0),r.current=setInterval(()=>{i(h=>{const f=100-h;for(let m=0;m<pt.length;m+=1){const[y,S]=pt[m];if(h<=y)return h+f*S}return h})},Vi)),()=>{r.current&&(clearInterval(r.current),r.current=null)}),[g,e]),g?n:t}var Ji=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n};let zt;function Fi(e,t){return!!e&&!!t&&!Number.isNaN(Number(t))}const Ui=e=>{var t;const{prefixCls:n,spinning:i=!0,delay:r=0,className:g,rootClassName:h,size:f="default",tip:m,wrapperClassName:y,style:S,children:d,fullscreen:x=!1,indicator:O,percent:_}=e,j=Ji(e,["prefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","fullscreen","indicator","percent"]),{getPrefixCls:v,direction:N,className:I,style:R,indicator:W}=St("spin"),l=v("spin",n),[z,K,w]=Ki(l),[M,H]=a.useState(()=>i&&!Fi(i,r)),J=Gi(M,_);a.useEffect(()=>{if(i){const A=hi(r,()=>{H(!0)});return A(),()=>{var Z;(Z=A==null?void 0:A.cancel)===null||Z===void 0||Z.call(A)}}H(!1)},[r,i]);const p=a.useMemo(()=>typeof d<"u"&&!x,[d,x]),b=E(l,I,{[`${l}-sm`]:f==="small",[`${l}-lg`]:f==="large",[`${l}-spinning`]:M,[`${l}-show-text`]:!!m,[`${l}-rtl`]:N==="rtl"},g,!x&&h,K,w),L=E(`${l}-container`,{[`${l}-blur`]:M}),ee=(t=O??W)!==null&&t!==void 0?t:zt,V=Object.assign(Object.assign({},R),S),D=a.createElement("div",Object.assign({},j,{style:V,className:b,"aria-live":"polite","aria-busy":M}),a.createElement(Li,{prefixCls:l,indicator:ee,percent:J}),m&&(p||x)?a.createElement("div",{className:`${l}-text`},m):null);return z(p?a.createElement("div",Object.assign({},j,{className:E(`${l}-nested-loading`,y,K,w)}),M&&a.createElement("div",{key:"loading"},D),a.createElement("div",{className:L,key:"container"},d)):x?a.createElement("div",{className:E(`${l}-fullscreen`,{[`${l}-fullscreen-show`]:M},h,K,w)},D):D)};Ui.setDefaultIndicator=e=>{zt=e};export{Zi as P,ot as R,Ui as S,rt as a};
|
|
13
|
+
`]:{display:"inline-block",minWidth:e.itemSize,height:e.itemSize,color:e.colorText,fontFamily:e.fontFamily,lineHeight:$(e.itemSize),textAlign:"center",verticalAlign:"middle",listStyle:"none",borderRadius:e.borderRadius,cursor:"pointer",transition:`all ${e.motionDurationMid}`},[`${t}-prev, ${t}-next`]:{outline:0,button:{color:e.colorText,cursor:"pointer",userSelect:"none"},[`${t}-item-link`]:{display:"block",width:"100%",height:"100%",padding:0,fontSize:e.fontSizeSM,textAlign:"center",backgroundColor:"transparent",border:`${$(e.lineWidth)} ${e.lineType} transparent`,borderRadius:e.borderRadius,outline:"none",transition:`all ${e.motionDurationMid}`},[`&:hover ${t}-item-link`]:{backgroundColor:e.colorBgTextHover},[`&:active ${t}-item-link`]:{backgroundColor:e.colorBgTextActive},[`&${t}-disabled:hover`]:{[`${t}-item-link`]:{backgroundColor:"transparent"}}},[`${t}-slash`]:{marginInlineEnd:e.paginationSlashMarginInlineEnd,marginInlineStart:e.paginationSlashMarginInlineStart},[`${t}-options`]:{display:"inline-block",marginInlineStart:e.margin,verticalAlign:"middle","&-size-changer":{display:"inline-block",width:"auto"},"&-quick-jumper":{display:"inline-block",height:e.controlHeight,marginInlineStart:e.marginXS,lineHeight:$(e.controlHeight),verticalAlign:"top",input:Object.assign(Object.assign(Object.assign({},Zt(e)),kt(e,{borderColor:e.colorBorder,hoverBorderColor:e.colorPrimaryHover,activeBorderColor:e.colorPrimary,activeShadow:e.activeShadow})),{"&[disabled]":Object.assign({},ei(e)),width:e.quickJumperInputWidth,height:e.controlHeight,boxSizing:"border-box",margin:0,marginInlineStart:e.marginXS,marginInlineEnd:e.marginXS})}}}},Oi=e=>{const{componentCls:t}=e;return{[`${t}-item`]:{display:"inline-block",minWidth:e.itemSize,height:e.itemSize,marginInlineEnd:e.marginXS,fontFamily:e.fontFamily,lineHeight:$(e.calc(e.itemSize).sub(2).equal()),textAlign:"center",verticalAlign:"middle",listStyle:"none",backgroundColor:e.itemBg,border:`${$(e.lineWidth)} ${e.lineType} transparent`,borderRadius:e.borderRadius,outline:0,cursor:"pointer",userSelect:"none",a:{display:"block",padding:`0 ${$(e.paginationItemPaddingInline)}`,color:e.colorText,"&:hover":{textDecoration:"none"}},[`&:not(${t}-item-active)`]:{"&:hover":{transition:`all ${e.motionDurationMid}`,backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},"&-active":{fontWeight:e.fontWeightStrong,backgroundColor:e.itemActiveBg,borderColor:e.colorPrimary,a:{color:e.itemActiveColor},"&:hover":{borderColor:e.colorPrimaryHover},"&:hover a":{color:e.itemActiveColorHover}}}}},ji=e=>{const{componentCls:t}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ht(e)),{display:"flex",flexWrap:"wrap",rowGap:e.paddingXS,"&-start":{justifyContent:"start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"end"},"ul, ol":{margin:0,padding:0,listStyle:"none"},"&::after":{display:"block",clear:"both",height:0,overflow:"hidden",visibility:"hidden",content:'""'},[`${t}-total-text`]:{display:"inline-block",height:e.itemSize,marginInlineEnd:e.marginXS,lineHeight:$(e.calc(e.itemSize).sub(2).equal()),verticalAlign:"middle"}}),Oi(e)),Pi(e)),wi(e)),Ii(e)),Ei(e)),{[`@media only screen and (max-width: ${e.screenLG}px)`]:{[`${t}-item`]:{"&-after-jump-prev, &-before-jump-next":{display:"none"}}},[`@media only screen and (max-width: ${e.screenSM}px)`]:{[`${t}-options`]:{display:"none"}}}),[`&${e.componentCls}-rtl`]:{direction:"rtl"}}},Mi=e=>{const{componentCls:t}=e;return{[`${t}:not(${t}-disabled)`]:{[`${t}-item`]:Object.assign({},Qt(e)),[`${t}-jump-prev, ${t}-jump-next`]:{"&:focus-visible":Object.assign({[`${t}-item-link-icon`]:{opacity:1},[`${t}-item-ellipsis`]:{opacity:0}},at(e))},[`${t}-prev, ${t}-next`]:{[`&:focus-visible ${t}-item-link`]:at(e)}}}},$t=e=>Object.assign({itemBg:e.colorBgContainer,itemSize:e.controlHeight,itemSizeSM:e.controlHeightSM,itemActiveBg:e.colorBgContainer,itemActiveColor:e.colorPrimary,itemActiveColorHover:e.colorPrimaryHover,itemLinkBg:e.colorBgContainer,itemActiveColorDisabled:e.colorTextDisabled,itemActiveBgDisabled:e.controlItemBgActiveDisabled,itemInputBg:e.colorBgContainer,miniOptionsSizeChangerTop:0},Yt(e)),Ct=e=>ft(e,{inputOutlineOffset:0,quickJumperInputWidth:e.calc(e.controlHeightLG).mul(1.25).equal(),paginationMiniOptionsMarginInlineStart:e.calc(e.marginXXS).div(2).equal(),paginationMiniQuickJumperInputWidth:e.calc(e.controlHeightLG).mul(1.1).equal(),paginationItemPaddingInline:e.calc(e.marginXXS).mul(1.5).equal(),paginationEllipsisLetterSpacing:e.calc(e.marginXXS).div(2).equal(),paginationSlashMarginInlineStart:e.marginSM,paginationSlashMarginInlineEnd:e.marginSM,paginationEllipsisTextIndent:"0.13em"},Ut(e)),Bi=vt("Pagination",e=>{const t=Ct(e);return[ji(t),Mi(t)]},$t),Ti=e=>{const{componentCls:t}=e;return{[`${t}${t}-bordered${t}-disabled:not(${t}-mini)`]:{"&, &:hover":{[`${t}-item-link`]:{borderColor:e.colorBorder}},"&:focus-visible":{[`${t}-item-link`]:{borderColor:e.colorBorder}},[`${t}-item, ${t}-item-link`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,[`&:hover:not(${t}-item-active)`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,a:{color:e.colorTextDisabled}},[`&${t}-item-active`]:{backgroundColor:e.itemActiveBgDisabled}},[`${t}-prev, ${t}-next`]:{"&:hover button":{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,color:e.colorTextDisabled},[`${t}-item-link`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder}}},[`${t}${t}-bordered:not(${t}-mini)`]:{[`${t}-prev, ${t}-next`]:{"&:hover button":{borderColor:e.colorPrimaryHover,backgroundColor:e.itemBg},[`${t}-item-link`]:{backgroundColor:e.itemLinkBg,borderColor:e.colorBorder},[`&:hover ${t}-item-link`]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,color:e.colorPrimary},[`&${t}-disabled`]:{[`${t}-item-link`]:{borderColor:e.colorBorder,color:e.colorTextDisabled}}},[`${t}-item`]:{backgroundColor:e.itemBg,border:`${$(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,[`&:hover:not(${t}-item-active)`]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,a:{color:e.colorPrimary}},"&-active":{borderColor:e.colorPrimary}}}}},Di=ii(["Pagination","bordered"],e=>{const t=Ct(e);return Ti(t)},$t);function dt(e){return Vt(()=>typeof e=="boolean"?[e,{}]:e&&typeof e=="object"?[!0,e]:[void 0,void 0],[e])}var _i=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n};const Zi=e=>{const{align:t,prefixCls:n,selectPrefixCls:i,className:r,rootClassName:g,style:f,size:h,locale:m,responsive:y,showSizeChanger:S,selectComponentClass:d,pageSizeOptions:x}=e,O=_i(e,["align","prefixCls","selectPrefixCls","className","rootClassName","style","size","locale","responsive","showSizeChanger","selectComponentClass","pageSizeOptions"]),{xs:_}=ni(y),[,j]=ai(),{getPrefixCls:v,direction:N,showSizeChanger:I,className:R,style:W}=St("pagination"),l=v("pagination",n),[z,K,w]=Bi(l),B=ri(h),H=B==="small"||!!(_&&!B&&y),[J]=oi("Pagination",li),p=Object.assign(Object.assign({},J),m),[b,L]=dt(S),[ee,V]=dt(I),D=b??ee,A=L??V,Z=d||ci,Me=a.useMemo(()=>x?x.map(F=>Number(F)):void 0,[x]),Be=F=>{var ie;const{disabled:le,size:ce,onSizeChange:ne,"aria-label":Se,className:M,options:be}=F,{className:De,onChange:re}=A||{},s=(ie=be.find(U=>String(U.value)===String(ce)))===null||ie===void 0?void 0:ie.value;return a.createElement(Z,Object.assign({disabled:le,showSearch:!0,popupMatchSelectWidth:!1,getPopupContainer:U=>U.parentNode,"aria-label":Se,options:be},A,{value:s,onChange:(U,_e)=>{ne==null||ne(U),re==null||re(U,_e)},size:H?"small":"middle",className:E(M,De)}))},Te=a.useMemo(()=>{const F=a.createElement("span",{className:`${l}-item-ellipsis`},"\u2022\u2022\u2022"),ie=a.createElement("button",{className:`${l}-item-link`,type:"button",tabIndex:-1},N==="rtl"?a.createElement(rt,null):a.createElement(ot,null)),le=a.createElement("button",{className:`${l}-item-link`,type:"button",tabIndex:-1},N==="rtl"?a.createElement(ot,null):a.createElement(rt,null)),ce=a.createElement("a",{className:`${l}-item-link`},a.createElement("div",{className:`${l}-item-container`},N==="rtl"?a.createElement(ct,{className:`${l}-item-link-icon`}):a.createElement(lt,{className:`${l}-item-link-icon`}),F)),ne=a.createElement("a",{className:`${l}-item-link`},a.createElement("div",{className:`${l}-item-container`},N==="rtl"?a.createElement(lt,{className:`${l}-item-link-icon`}):a.createElement(ct,{className:`${l}-item-link-icon`}),F));return{prevIcon:ie,nextIcon:le,jumpPrevIcon:ce,jumpNextIcon:ne}},[N,l]),fe=v("select",i),te=E({[`${l}-${t}`]:!!t,[`${l}-mini`]:H,[`${l}-rtl`]:N==="rtl",[`${l}-bordered`]:j.wireframe},R,r,g,K,w),he=Object.assign(Object.assign({},W),f);return z(a.createElement(a.Fragment,null,j.wireframe&&a.createElement(Di,{prefixCls:l}),a.createElement(Ni,Object.assign({},Te,O,{style:he,prefixCls:l,selectPrefixCls:fe,className:te,locale:p,pageSizeOptions:Me,showSizeChanger:D,sizeChangerRender:Be}))))},Oe=100,yt=Oe/5,xt=Oe/2-yt/2,qe=xt*2*Math.PI,mt=50,gt=e=>{const{dotClassName:t,style:n,hasCircleCls:i}=e;return a.createElement("circle",{className:E(`${t}-circle`,{[`${t}-circle-bg`]:i}),r:xt,cx:mt,cy:mt,strokeWidth:yt,style:n})},Ri=({percent:e,prefixCls:t})=>{const n=`${t}-dot`,i=`${n}-holder`,r=`${i}-hidden`,[g,f]=a.useState(!1);si(()=>{e!==0&&f(!0)},[e!==0]);const h=Math.max(Math.min(e,100),0);if(!g)return null;const m={strokeDashoffset:`${qe/4}`,strokeDasharray:`${qe*h/100} ${qe*(100-h)/100}`};return a.createElement("span",{className:E(i,`${n}-progress`,h<=0&&r)},a.createElement("svg",{viewBox:`0 0 ${Oe} ${Oe}`,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":h},a.createElement(gt,{dotClassName:n,hasCircleCls:!0}),a.createElement(gt,{dotClassName:n,style:m})))};function Hi(e){const{prefixCls:t,percent:n=0}=e,i=`${t}-dot`,r=`${i}-holder`,g=`${r}-hidden`;return a.createElement(a.Fragment,null,a.createElement("span",{className:E(r,n>0&&g)},a.createElement("span",{className:E(i,`${t}-dot-spin`)},[1,2,3,4].map(f=>a.createElement("i",{className:`${t}-dot-item`,key:f})))),a.createElement(Ri,{prefixCls:t,percent:n}))}function Li(e){var t;const{prefixCls:n,indicator:i,percent:r}=e,g=`${n}-dot`;return i&&a.isValidElement(i)?ui(i,{className:E((t=i.props)===null||t===void 0?void 0:t.className,g),percent:r}):a.createElement(Hi,{prefixCls:n,percent:r})}const Ai=new bt("antSpinMove",{to:{opacity:1}}),qi=new bt("antRotate",{to:{transform:"rotate(405deg)"}}),Xi=e=>{const{componentCls:t,calc:n}=e;return{[t]:Object.assign(Object.assign({},ht(e)),{position:"absolute",display:"none",color:e.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`,"&-spinning":{position:"relative",display:"inline-block",opacity:1},[`${t}-text`]:{fontSize:e.fontSize,paddingTop:n(n(e.dotSize).sub(e.fontSize)).div(2).add(2).equal()},"&-fullscreen":{position:"fixed",width:"100vw",height:"100vh",backgroundColor:e.colorBgMask,zIndex:e.zIndexPopupBase,inset:0,display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:0,visibility:"hidden",transition:`all ${e.motionDurationMid}`,"&-show":{opacity:1,visibility:"visible"},[t]:{[`${t}-dot-holder`]:{color:e.colorWhite},[`${t}-text`]:{color:e.colorTextLightSolid}}},"&-nested-loading":{position:"relative",[`> div > ${t}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:e.contentHeight,[`${t}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:n(e.dotSize).mul(-1).div(2).equal()},[`${t}-text`]:{position:"absolute",top:"50%",width:"100%",textShadow:`0 1px 2px ${e.colorBgContainer}`},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSize).div(2).mul(-1).sub(10).equal()},"&-sm":{[`${t}-dot`]:{margin:n(e.dotSizeSM).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:n(n(e.dotSizeSM).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSizeSM).div(2).mul(-1).sub(10).equal()}},"&-lg":{[`${t}-dot`]:{margin:n(e.dotSizeLG).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:n(n(e.dotSizeLG).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSizeLG).div(2).mul(-1).sub(10).equal()}}},[`${t}-container`]:{position:"relative",transition:`opacity ${e.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:e.colorBgContainer,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${t}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-tip":{color:e.spinDotDefault},[`${t}-dot-holder`]:{width:"1em",height:"1em",fontSize:e.dotSize,display:"inline-block",transition:`transform ${e.motionDurationSlow} ease, opacity ${e.motionDurationSlow} ease`,transformOrigin:"50% 50%",lineHeight:1,color:e.colorPrimary,"&-hidden":{transform:"scale(0.3)",opacity:0}},[`${t}-dot-progress`]:{position:"absolute",inset:0},[`${t}-dot`]:{position:"relative",display:"inline-block",fontSize:e.dotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),height:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),background:"currentColor",borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:Ai,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:qi,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"},"&-circle":{strokeLinecap:"round",transition:["stroke-dashoffset","stroke-dasharray","stroke","stroke-width","opacity"].map(i=>`${i} ${e.motionDurationSlow} ease`).join(","),fillOpacity:0,stroke:"currentcolor"},"&-circle-bg":{stroke:e.colorFillSecondary}},[`&-sm ${t}-dot`]:{"&, &-holder":{fontSize:e.dotSizeSM}},[`&-sm ${t}-dot-holder`]:{i:{width:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal(),height:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal()}},[`&-lg ${t}-dot`]:{"&, &-holder":{fontSize:e.dotSizeLG}},[`&-lg ${t}-dot-holder`]:{i:{width:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal(),height:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal()}},[`&${t}-show-text ${t}-text`]:{display:"block"}})}},Wi=e=>{const{controlHeightLG:t,controlHeight:n}=e;return{contentHeight:400,dotSize:t/2,dotSizeSM:t*.35,dotSizeLG:n}},Ki=vt("Spin",e=>{const t=ft(e,{spinDotDefault:e.colorTextDescription});return Xi(t)},Wi),Vi=200,pt=[[30,.05],[70,.03],[96,.01]];function Gi(e,t){const[n,i]=a.useState(0),r=a.useRef(null),g=t==="auto";return a.useEffect(()=>(g&&e&&(i(0),r.current=setInterval(()=>{i(f=>{const h=100-f;for(let m=0;m<pt.length;m+=1){const[y,S]=pt[m];if(f<=y)return f+h*S}return f})},Vi)),()=>{r.current&&(clearInterval(r.current),r.current=null)}),[g,e]),g?n:t}var Ji=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n};let zt;function Fi(e,t){return!!e&&!!t&&!Number.isNaN(Number(t))}const Ui=e=>{var t;const{prefixCls:n,spinning:i=!0,delay:r=0,className:g,rootClassName:f,size:h="default",tip:m,wrapperClassName:y,style:S,children:d,fullscreen:x=!1,indicator:O,percent:_}=e,j=Ji(e,["prefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","fullscreen","indicator","percent"]),{getPrefixCls:v,direction:N,className:I,style:R,indicator:W}=St("spin"),l=v("spin",n),[z,K,w]=Ki(l),[B,H]=a.useState(()=>i&&!Fi(i,r)),J=Gi(B,_);a.useEffect(()=>{if(i){const A=fi(r,()=>{H(!0)});return A(),()=>{var Z;(Z=A==null?void 0:A.cancel)===null||Z===void 0||Z.call(A)}}H(!1)},[r,i]);const p=a.useMemo(()=>typeof d<"u"&&!x,[d,x]),b=E(l,I,{[`${l}-sm`]:h==="small",[`${l}-lg`]:h==="large",[`${l}-spinning`]:B,[`${l}-show-text`]:!!m,[`${l}-rtl`]:N==="rtl"},g,!x&&f,K,w),L=E(`${l}-container`,{[`${l}-blur`]:B}),ee=(t=O??W)!==null&&t!==void 0?t:zt,V=Object.assign(Object.assign({},R),S),D=a.createElement("div",Object.assign({},j,{style:V,className:b,"aria-live":"polite","aria-busy":B}),a.createElement(Li,{prefixCls:l,indicator:ee,percent:J}),m&&(p||x)?a.createElement("div",{className:`${l}-text`},m):null);return z(p?a.createElement("div",Object.assign({},j,{className:E(`${l}-nested-loading`,y,K,w)}),B&&a.createElement("div",{key:"loading"},D),a.createElement("div",{className:L,key:"container"},d)):x?a.createElement("div",{className:E(`${l}-fullscreen`,{[`${l}-fullscreen-show`]:B},f,K,w)},D):D)};Ui.setDefaultIndicator=e=>{zt=e};export{Zi as P,ot as R,Ui as S,rt as a};
|