1import{r,j as e,R as T}from"./index-CJQpyVoF.js";import{a as $,b as z,l as E}from"./knowledge-B6Xt4n06.js";import{d as B}from"./icon_dialog_del-CuIQ4TrY.js";import{u as k}from"./useTranslation-CZJVCIH1.js";import{B as y}from"./button-COlcySkY.js";import{c as D}from"./useUrlParam-CZ4aw4md.js";import{F as R}from"./index-ByGsukvN.js";import{I as M}from"./index-CS8YAtyi.js";import{u as K}from"./useOrderIsExpired-C3lj0fcm.js";import{e as P,d as H,C as O}from"./delete-outline-CwgcH8rH.js";import{f as Z}from"./folder_icon-DpDsGXMs.js";import{u as Q,j as W}from"./inviteCode-D9rgtvJs.js";import{R as q}from"./index-IM4B5Mz9.js";import{useHeaderOperations as J}from"./BasicLayout-CfXAwUTk.js";import"./Compact-BviLumD4.js";import"./reactNode-CvZomqk2.js";import"./compact-item-5orumCwJ.js";import"./context-DKhv_b6t.js";import"./motion-BwoXtl0z.js";import"./collapse-BbEVqHco.js";import"./zoom-DpNIHBsI.js";import"./row-BXqHUWkn.js";import"./responsiveObserver-DyJXlrPc.js";import"./index-34CVpSRX.js";import"./index-DnoH8i83.js";import"./index-Cb4CfQq0.js";import"./ContextIsolator-hwtSycux.js";import"./useLocale-Dmo9Agcu.js";import"./SearchOutlined-D1PhykWn.js";import"./AppEntry-yGjZDq3c.js";import"./index-CiW30IE2.js";import"./tslib.es6-BO7bUXQ_.js";import"./dayjs.min-MSV7X6E-.js";import"./userAuth-Bzc-YaEz.js";import"./base64-Cs2W2fcZ.js";import"./traceAndOrder-Ckos_Swc.js";import"./index-xBPjzTPJ.js";import"./utils-DBy4YQWF.js";import"./v4-CtRu48qb.js";import"./SpaceButton-Du44tacF.js";import"./useUserStore-CzLMwWtH.js";import"./arrow-down-white-JDA--J6P.js";import"./index-ayMRKBUl.js";import"./index-CJrGXcrc.js";import"./useChat-IqLBEL3U.js";import"./chatStore-Di0cwpKa.js";import"./sparkutils-CzrLAKyB.js";import"./compressor.esm-C46f8uP2.js";import"./chat-BUHNDq8n.js";import"./fetch-IOhmRd8d.js";import"./order-C7PlMRgK.js";import"./avator-Bof9bOU9.js";import"./index-_IUeYJiy.js";import"./Icon-RcghnO3P.js";import"./utils-BAxb0YWC.js";import"./index-Bpsi5fUJ.js";import"./index-CSwuRCeV.js";import"./ActionButton-DJ1XBOXE.js";import"./index-Cbb5YXZ-.js";import"./fade-DU7Y_kU8.js";import"./Skeleton-CRGI6EI_.js";import"./PurePanel-CKKM5xpM.js";import"./index-Bzc9CXj1.js";import"./RightOutlined-DlN6rwzX.js";import"./EllipsisOutlined-DtZ6Tilt.js";import"./Overflow-Dh_HYkSz.js";import"./index-BQyCNz27.js";import"./CheckOutlined-DczzTUs8.js";import"./DownOutlined-Bedvisqk.js";import"./index-ad3S-Ulj.js";import"./CaretDownOutlined-Dv3U9ShB.js";import"./AntdIcon-BKgxT62r.js";import"./index-VAO7k5M2.js";import"./index-CzF7my_k.js";import"./agentLogoText-DKKhhTxa.js";import"./index-BzmJop0n.js";import"./agentSquare-GbXD7O6h.js";import"./folderCreateAgent-Jv5uS4Ny.js";import"./index-Ykp696o3.js";import"./flow-CtnwUseI.js";import"./modal-close-QVlieQPY.js";import"./icon_zhishi_upload_act-D7BMkVq5.js";import"./index-IS3faKyI.js";import"./useForceUpdate-DvJ9yelE.js";import"./progress-BRPegRc4.js";import"./workflow-template-hot-DC83vsj9.js";import"./globalStore-DBkxQF3u.js";import"./common-BC0booSG.js";import"./plugin-C0dpnJ-K.js";import"./uuid-Q0OBPXtL.js";import"./PlusOutlined-djwHV0M3.js";import"./PlusOutlined-ByZyTB3m.js";import"./index-CP7t51lm.js";import"./icon_nav_dropdown-B-gtXUyP.js";import"./iconModal-BXgPOuGI.js";import"./useTranslation-Bz6LaZTW.js";import"./index.module-Bi0Dxxte.js";import"./ai_chat_placeholder-ChZYJ5lQ.js";import"./flowId-copy-icon-oUh8DYIQ.js";import"./index-DMzkuvYL.js";import"./index-CY7Gl-0U.js";import"./vcn-GDTDQbYd.js";import"./pcm-C_Z7Lwvr.js";import"./agentLogoTextEn-CC1FLgV-.js";import"./index-D5wV5giV.js";import"./index-B0_gkfMG.js";import"./PulseLoader-BEbjbXk8.js";import"./useImageCropUpload-C40w0BUQ.js";import"./index-bS47I6pO.js";import"./index-DlDbTapt.js";import"./utils-COfvzxEc.js";import"./github_opacity_0-CxQa6oab.js";import"./back-Dxl-djPv.js";import"./lodash-DQpAQgZ8.js";import"./person-space-icon-BkLkzb60.js";import"./ExclamationCircleOutlined-BmG531TA.js";import"./DeleteOutlined-Bwal24vT.js";import"./useLogout-sUgRZBFD.js";import"./auth-BQIBcS1H.js";import"./enterprise-auth-api-DWIXIwYb.js";import"./index-Dzy0ZfGG.js";import"./useSpaceI18n-BZqoDJzs.js";import"./index-B491JDAL.js";import"./icon_zhishi_search-VMy98n1a.js";const X="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='30'%20height='30'%20viewBox='0%200%2030%2030'%3e%3cg%3e%3cg%3e%3cpath%20d='M0,0L30,30L30,8C30,3.58172,26.4183,0,22,0L0,0Z'%20fill='%236356EA'%20fill-opacity='1'/%3e%3cpath%20d='M0,0L30,30L30,8C30,3.58172,26.4183,0,22,0L0,0ZM29,27.5858L2.41421,1L22,1Q24.8995,1,26.9497,3.05025Q29,5.1005,29,8L29,27.5858Z'%20fill-rule='evenodd'%20fill='%236356EA'%20fill-opacity='1'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M25.4628,5.633267C25.76413,5.951616,25.76409,6.44997,25.46271,6.76827L19.56234,13L16.579882,10.16978C16.25951,9.86576,16.245951,9.35969,16.549585,9.03896C16.865734,8.705,17.39762,8.70551,17.71312,9.04008L19.372230000000002,10.799430000000001L24.26388,5.633
117C24.58953,5.28923,25.1372,5.289275,25.4628,5.633267'%20fill='%23FFFFFF'%20fill-opacity='1'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",{TextArea:Y}=M;function ee({setDeleteModal:t,currentKnowledge:o,getKnowledges:i}){const{t:a}=k(),[n,p]=r.useState(!1);function f(){p(!0),$(o.id,o.tag).then(g=>{t(!1),i()}).finally(()=>{p(!1)})}return e.jsx("div",{className:"mask",children:e.jsxs("div",{className:"p-6 absolute bg-[#fff] rounded-2xl top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-50 text-second font-medium text-md w-[310px]",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"bg-[#fff5f4] w-10 h-10 flex justify-center items-center rounded-lg",children:e.jsx("img",{src:B,className:"w-7 h-7",alt:""})}),e.jsx("p",{className:"ml-2.5",children:a("knowledge.confirmDeleteKnowledge")})]}),e.jsx("div",{className:"w-full h-10 bg-[#F9FAFB] text-center mt-7 py-2 px-5 text-overflow",title:o.name,children:o.name}),e.jsx("p",{className:"mt-6 text-desc",children:a("knowledge.deleteKnowledgeWarning")}),e.jsxs("div",{className:"flex flex-row-reverse gap-3 mt-7",children:[e.jsx(y,{type:"text",loading:n,className:"delete-btn",style:{paddingLeft:24,paddingRight:24},onClick:f,children:a("common.delete")}),e.jsx(y,{type:"text",className:"origin-btn",onClick:()=>t(!1),style:{paddingLeft:24,paddingRight:24},children:a("common.cancel")})]})]})})}function te({setCreateModal:t}){const{t:o}=k(),i=r.useRef(null),a=D(),[n]=R.useForm(),[p,f]=r.useState(!0),[g,w]=r.useState(""),[c,m]=r.useState("AIUI-RAG2"),[v,I]=r.useState(!1);function _(){I(!0);const x={name:n.getFieldsValue().name,desc:g,tag:c};z(x).then(d=>{a(`/resource/knowledge/upload?parentId=-1&repoId=${d.id}&tag=${c}`)}).finally(()=>{I(!1)})}function C(){var d;let u=!1;const x=n.getFieldsValue();for(const b in x)(d=x[b])!=null&&d.trim()||(u=!0);f(u)}return e.jsx("div",{className:"mask",children:e.jsxs("div",{className:"absolute rounded-2xl p-6 top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-50 bg-[#fff] w-[448px]",ref:i,children:[e.jsx("div",{className:"font-semibold text-base",children:o("knowledge.createKnowledge")}),e.jsx("div",{className:"mt-[26px]",children:e.jsx(R,{form:n,layout:"vertical",onFieldsChange:C,children:e.jsx(R.Item,{label:o("knowledge.knowledgeName"),rules:[{required:!0}],name:"name",children:e.jsx(M,{type:"text",maxLength:20,showCount:!0,className:"global-input",placeholder:o("knowledge.pleaseEnter")})})})}),e.jsxs("div",{className:"mt-6",children:[e.jsx("h3",{className:"text-second font-medium text-sm",children:o("knowledge.knowledgeDescription")}),e.jsxs("div",{className:"relative",children:[e.jsx(Y,{value:g,onChange:u=>w(u.target.value),placeholder:o("knowledge.pleaseEnter"),maxLength:200,className:"global-input mt-2 shrink-0 w-full",style:{height:90,resize:"none"}}),e.jsxs("div",{className:"absolute bottom-3 right-3 ant-input-limit ",children:[g.length," / 200"]})]})]}),e.jsxs("div",{className:"mt-6 flex flex-col gap-2",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"text-second font-medium text-sm",children:[e.jsx("span",{className:"text-[#F74E43]",children:"*"})," ",o("knowledge.knowledgeVersion")]})}),e.jsx("div",{className:"flex flex-col gap-2",children:e.jsxs("div",{className:"w-full rounded-lg p-3.5 flex flex-col cursor-pointer relative",style:{border:c==="AIUI-RAG2"?"1px solid #6356EA":"1px solid #E2E8FF"},onClick:()=>m("AIUI-RAG2"),children:[e.jsx("div",{className:"text-sm",style:{fontWeight:c==="AIUI-RAG2"?500:400,color:c==="AIUI-RAG2"?"#6356EA":""},children:o("knowledge.xingchenKnowledge")}),e.jsx("p",{className:"text-desc",children:o("knowledge.xingchenDescription")}),c==="AIUI-RAG2"&&e.jsx("img",{src:X,className:"absolute top-[-1px] right-[-1px] w-[30px] h-[30px]",alt:""})]})})]}),e.jsxs("div",{className:"flex flex-row-reverse gap-3 mt-7",children:[e.jsx(y,{type:"primary",disabled:p,loading:v,className:"px-6",onClick:_,children:o("knowledge.confirm")}),e.jsx(y,{type:"text",className:"origin-btn px-6",onClick:()=>t(!1),children:o("common.cancel")})]})]})})}
1const se="_cardItem_wlxap_2",oe="_corner_wlxap_25",re="_content_wlxap_32",ie="_header_wlxap_38",ae="_folderIcon_wlxap_42",le="_headerRight_wlxap_46",ne="_title_wlxap_50",ce="_description_wlxap_62",me="_stats_wlxap_76",de="_divider_wlxap_91",pe="_statItem_wlxap_97",xe="_statLabel_wlxap_103",fe="_statValue_wlxap_111",l={cardItem:se,corner:oe,content:re,header:ie,folderIcon:ae,headerRight:le,title:ne,description:ce,stats:me,divider:de,statItem:pe,statLabel:xe,statValue:fe},ge=({knowledge:t,onDelete:o})=>{var w;const{t:i}=k(),{withCheckIsExpired:a}=K(),n=D(),p=()=>{a(),n(`/resource/knowledge/detail/${t.id}/document?tag=${t.tag}`,{state:{parentId:-1}})},f=[{label:i("knowledge.documentCount"),value:t.fileCount},{label:i("knowledge.totalCharacters"),value:Math.round(t.charCount/1e3)},{label:i("knowledge.relatedAgents"),value:(w=t==null?void 0:t.bots)==null?void 0:w.length}],g=[{key:"edit",text:i("common.edit"),icon:e.jsx("img",{src:P,alt:"edit"}),onClick:(c,m)=>{m.stopPropagation(),p()}},{key:"delete",text:i("common.delete"),icon:e.jsx("img",{src:H,alt:"delete"}),onClick:(c,m)=>{m.stopPropagation(),o(t)}}];return e.jsxs("div",{className:l.cardItem,onClick:p,children:[e.jsx("img",{src:t==null?void 0:t.corner,className:l.corner,alt:""}),e.jsxs("div",{className:l.content,children:[e.jsxs("div",{className:l.header,children:[e.jsx("img",{src:Z,className:l.folderIcon,alt:""}),e.jsxs("div",{className:l.headerRight,children:[e.jsx("div",{className:l.title,title:t.name,children:t.name}),e.jsx("div",{className:l.description,title:t.description,children:t.description})]})]}),e.jsx("div",{children:e.jsx("div",{className:l.stats,children:f.map((c,m)=>e.jsxs(T.Fragment,{children:[m>0&&e.jsx("div",{className:l.divider}),e.jsxs("div",{className:l.statItem,children:[e.jsx("div",{className:l.statLabel,children:c.label}),e.jsx("div",{className:l.statValue,children:c.value})]})]},m))})}),e.jsx("div",{className:l.footer,children:e.jsx(O,{buttons:g,gap:8,align:"right"})})]})]})};function ue(){const{t}=k(),{withCheckIsExpired:o}=K(),i=Q(s=>s.user),a=r.useRef(!1),n=r.useRef(null),[p,f]=r.useState(!1),[g,w]=r.useState(!1),[c,m]=r.useState({}),[v,I]=r.useState([]),[_,C]=r.useState(1),[u,x]=r.useState(!1),[d,b]=r.useState(""),[V,U]=r.useState(!1);r.useEffect(()=>{L()},[]),J("knowledge",{onSearch:s=>{b(s),L(s==null?void 0:s.trim())},onCreate:A});function L(s){a.current=!0,n.current&&(n.current.scrollTop=0);const h={pageNo:1,pageSize:20,content:s!==void 0?s==null?void 0:s.trim():d};E(h).then(N=>{const j=N.pageData.map(F=>({...F,tagDtoList:F.tagDtoList}));I([...j]),C(()=>2),20<N.totalCount?x(!0):x(!1)}).finally(()=>{a.current=!1,U(!0)})}r.useEffect(()=>{const s=n.current;return s&&s.addEventListener("scroll",S),()=>{s&&s.removeEventListener("scroll",S)}},[_,u,d]);function S(){const s=n.current;if(!s)return;const{scrollTop:h,scrollHeight:N,clientHeight:j}=s;h+j>=N-100&&!a.current&&u&&(a.current=!0,G())}function G(){E({pageNo:_,pageSize:20,content:d}).then(h=>{const N=h.pageData.map(j=>({...j,tagDtoList:j.tagDtoList}));I([...v,...N]),C(j=>j+1),v.length+20<h.totalCount?x(!0):x(!1),a.current=!1})}function A(){if(!(i!=null&&i.login)&&!(i!=null&&i.uid))return W();o(),w(!0)}return e.jsxs("div",{className:"w-full h-full flex flex-col overflow-hidden py-5",children:[p&&e.jsx(ee,{setDeleteModal:f,currentKnowledge:c,getKnowledges:()=>{d?b(""):L()}}),g&&e.jsx(te,{setCreateModal:w}),e.jsx("div",{className:"w-full flex-1 overflow-scroll scroll-bar-UI",ref:n,children:e.jsx("div",{className:"h-full mx-auto max-w-[1425px]",style:{width:"86%"},children:V&&v.length===0?e.jsx(q,{description:t(d?"knowledge.noSearchResults":"knowledge.emptyDescription"),buttonText:t("knowledge.createNew"),onCreate:A}):e.jsx("div",{className:"grid lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-3 3xl:grid-cols-3 gap-6",children:v.map(s=>e.jsx(ge,{knowledge:s,onDelete:h=>{m(h),f(!0)}},s.id))})})})]})}const Es=r.memo(ue);export{Es as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.