@deep-eye/core 1.3.85 → 1.3.91

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.
Files changed (119) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/README.md +1 -1
  3. package/dist/{ChartRenderer-4jMDeAxm.js → ChartRenderer-CKsUJhbc.js} +1 -1
  4. package/dist/{ChartRenderer-Bq-WRQmw.cjs → ChartRenderer-TzsnqnyV.cjs} +1 -1
  5. package/dist/ChatMyFilesArtifacts-BeQHLrUE.cjs +1 -0
  6. package/dist/ChatMyFilesArtifacts-qD7q7u2u.js +795 -0
  7. package/dist/components/chat/ChatApp.vue.d.ts +24 -10
  8. package/dist/components/chat/ChatApp.vue.d.ts.map +1 -1
  9. package/dist/components/chat/ChatBot.vue.d.ts.map +1 -1
  10. package/dist/components/chat/chatAppScheduledTasks.d.ts +42 -0
  11. package/dist/components/chat/chatAppScheduledTasks.d.ts.map +1 -0
  12. package/dist/components/chat/chatConfirm.d.ts +37 -0
  13. package/dist/components/chat/chatConfirm.d.ts.map +1 -0
  14. package/dist/components/chat/chatFilePicker.d.ts +10 -0
  15. package/dist/components/chat/chatFilePicker.d.ts.map +1 -1
  16. package/dist/components/chat/chatQuota.d.ts +62 -8
  17. package/dist/components/chat/chatQuota.d.ts.map +1 -1
  18. package/dist/components/chat/chatSessionSidebarAssets.d.ts +7 -0
  19. package/dist/components/chat/chatSessionSidebarAssets.d.ts.map +1 -1
  20. package/dist/components/chat/chatToast.d.ts +8 -0
  21. package/dist/components/chat/chatToast.d.ts.map +1 -0
  22. package/dist/components/chat/components/ChatConfirmHost.vue.d.ts +4 -0
  23. package/dist/components/chat/components/ChatConfirmHost.vue.d.ts.map +1 -0
  24. package/dist/components/chat/components/ChatQuotaDialog.vue.d.ts +3 -0
  25. package/dist/components/chat/components/ChatQuotaDialog.vue.d.ts.map +1 -1
  26. package/dist/components/chat/components/ChatQuotaEntry.vue.d.ts.map +1 -1
  27. package/dist/components/chat/components/ChatQuotaRefreshButton.vue.d.ts +12 -0
  28. package/dist/components/chat/components/ChatQuotaRefreshButton.vue.d.ts.map +1 -0
  29. package/dist/components/chat/components/ChatSender.vue.d.ts +7 -1
  30. package/dist/components/chat/components/ChatSender.vue.d.ts.map +1 -1
  31. package/dist/components/chat/components/ChatSessionSidebar.vue.d.ts +3 -0
  32. package/dist/components/chat/components/ChatSessionSidebar.vue.d.ts.map +1 -1
  33. package/dist/components/chat/components/ChatToastStack.vue.d.ts +17 -0
  34. package/dist/components/chat/components/ChatToastStack.vue.d.ts.map +1 -0
  35. package/dist/components/chat/components/ChatWelcomeRobot.vue.d.ts +10 -0
  36. package/dist/components/chat/components/ChatWelcomeRobot.vue.d.ts.map +1 -0
  37. package/dist/components/chat/components/files/ChatMyFiles.vue.d.ts +6 -0
  38. package/dist/components/chat/components/files/ChatMyFiles.vue.d.ts.map +1 -1
  39. package/dist/components/chat/components/files/ChatMyFilesDirectory.vue.d.ts.map +1 -1
  40. package/dist/components/chat/components/files/ChatMyFilesEmptyGuide.vue.d.ts.map +1 -1
  41. package/dist/components/chat/components/files/ChatMyFilesFileTable.vue.d.ts.map +1 -1
  42. package/dist/components/chat/components/files/ChatMyFilesGuideIcon.vue.d.ts +1 -0
  43. package/dist/components/chat/components/files/ChatMyFilesGuideIcon.vue.d.ts.map +1 -1
  44. package/dist/components/chat/components/files/ChatMyFilesTree.vue.d.ts.map +1 -1
  45. package/dist/components/chat/components/files/ChatMyFilesViewer.vue.d.ts.map +1 -1
  46. package/dist/components/chat/components/files/chatArtifactFileActions.d.ts +4 -2
  47. package/dist/components/chat/components/files/chatArtifactFileActions.d.ts.map +1 -1
  48. package/dist/components/chat/components/files/chatFileTransferSources.d.ts +10 -3
  49. package/dist/components/chat/components/files/chatFileTransferSources.d.ts.map +1 -1
  50. package/dist/components/chat/components/files/chatMyFilesApi.d.ts +8 -0
  51. package/dist/components/chat/components/files/chatMyFilesApi.d.ts.map +1 -1
  52. package/dist/components/chat/components/files/chatMyFilesModel.d.ts +5 -0
  53. package/dist/components/chat/components/files/chatMyFilesModel.d.ts.map +1 -1
  54. package/dist/components/chat/components/files/chatReviewApi.d.ts +11 -2
  55. package/dist/components/chat/components/files/chatReviewApi.d.ts.map +1 -1
  56. package/dist/components/chat/components/files/guideIcon.d.ts +0 -2
  57. package/dist/components/chat/components/files/guideIcon.d.ts.map +1 -1
  58. package/dist/components/chat/components/files/index.d.ts +4 -1
  59. package/dist/components/chat/components/files/index.d.ts.map +1 -1
  60. package/dist/components/chat/components/files/myFilesShareSchool.d.ts +24 -0
  61. package/dist/components/chat/components/files/myFilesShareSchool.d.ts.map +1 -0
  62. package/dist/components/chat/components/index.d.ts +1 -0
  63. package/dist/components/chat/components/index.d.ts.map +1 -1
  64. package/dist/components/chat/components/schedule/ChatScheduleRecords.vue.d.ts +21 -0
  65. package/dist/components/chat/components/schedule/ChatScheduleRecords.vue.d.ts.map +1 -0
  66. package/dist/components/chat/components/schedule/ChatScheduleSelect.vue.d.ts +29 -0
  67. package/dist/components/chat/components/schedule/ChatScheduleSelect.vue.d.ts.map +1 -0
  68. package/dist/components/chat/components/schedule/ChatScheduleSwitch.vue.d.ts +19 -0
  69. package/dist/components/chat/components/schedule/ChatScheduleSwitch.vue.d.ts.map +1 -0
  70. package/dist/components/chat/components/schedule/ChatScheduleTaskCard.vue.d.ts +33 -0
  71. package/dist/components/chat/components/schedule/ChatScheduleTaskCard.vue.d.ts.map +1 -0
  72. package/dist/components/chat/components/schedule/ChatScheduleTaskDialog.vue.d.ts +42 -0
  73. package/dist/components/chat/components/schedule/ChatScheduleTaskDialog.vue.d.ts.map +1 -0
  74. package/dist/components/chat/components/schedule/ChatScheduleTime.vue.d.ts +15 -0
  75. package/dist/components/chat/components/schedule/ChatScheduleTime.vue.d.ts.map +1 -0
  76. package/dist/components/chat/components/schedule/ChatScheduledTasks.vue.d.ts +41 -0
  77. package/dist/components/chat/components/schedule/ChatScheduledTasks.vue.d.ts.map +1 -0
  78. package/dist/components/chat/components/schedule/chatScheduledTasksApi.d.ts +35 -0
  79. package/dist/components/chat/components/schedule/chatScheduledTasksApi.d.ts.map +1 -0
  80. package/dist/components/chat/components/schedule/index.d.ts +10 -0
  81. package/dist/components/chat/components/schedule/index.d.ts.map +1 -0
  82. package/dist/components/chat/components/schedule/scheduledTaskWire.d.ts +60 -0
  83. package/dist/components/chat/components/schedule/scheduledTaskWire.d.ts.map +1 -0
  84. package/dist/components/chat/components/schedule/scheduledTasksModel.d.ts +116 -0
  85. package/dist/components/chat/components/schedule/scheduledTasksModel.d.ts.map +1 -0
  86. package/dist/components/chat/components/schedule/scheduledTasksRemoteApi.d.ts +18 -0
  87. package/dist/components/chat/components/schedule/scheduledTasksRemoteApi.d.ts.map +1 -0
  88. package/dist/components/chat/composables/chatApiRequest.d.ts +7 -1
  89. package/dist/components/chat/composables/chatApiRequest.d.ts.map +1 -1
  90. package/dist/components/chat/composables/chatQuotaApi.d.ts +4 -0
  91. package/dist/components/chat/composables/chatQuotaApi.d.ts.map +1 -1
  92. package/dist/components/chat/composables/useChatQuota.d.ts +1 -0
  93. package/dist/components/chat/composables/useChatQuota.d.ts.map +1 -1
  94. package/dist/components/chat/composables/useChatSessionHistory.d.ts.map +1 -1
  95. package/dist/components/chat/composer/composerExtensions.d.ts +31 -0
  96. package/dist/components/chat/composer/composerExtensions.d.ts.map +1 -1
  97. package/dist/components/chat/composerBannerNotice.d.ts +14 -0
  98. package/dist/components/chat/composerBannerNotice.d.ts.map +1 -0
  99. package/dist/components/chat/index.d.ts +6 -1
  100. package/dist/components/chat/index.d.ts.map +1 -1
  101. package/dist/components/chat/types.d.ts +26 -0
  102. package/dist/components/chat/types.d.ts.map +1 -1
  103. package/dist/{docx-preview-ljv2r1o6.cjs → docx-preview-CC8jDFyo.cjs} +1 -1
  104. package/dist/{docx-preview-_KbfGYVZ.js → docx-preview-Ddq2Rd5j.js} +1 -1
  105. package/dist/index-47_t1k1t.cjs +1467 -0
  106. package/dist/{index-CgfD9R7Z.js → index-B5TwLeqQ.js} +1 -1
  107. package/dist/{index-xNFX7ZcL.js → index-BXOcelf2.js} +31348 -28618
  108. package/dist/{index-DkAkCzn-.cjs → index-G1cUXwuV.cjs} +1 -1
  109. package/dist/index.cjs +1 -1
  110. package/dist/index.js +645 -608
  111. package/dist/{papaparse.min-DYV83FIL.cjs → papaparse.min-Bi9-MNQC.cjs} +1 -1
  112. package/dist/{papaparse.min-CxNXl7Vn.js → papaparse.min-CABieqyR.js} +15 -15
  113. package/dist/style.css +2 -2
  114. package/dist/welcome-robot-typing.webp +0 -0
  115. package/dist/welcome-robot-wave.webp +0 -0
  116. package/package.json +1 -1
  117. package/dist/ChatMyFilesArtifacts-D7unczTL.js +0 -1013
  118. package/dist/ChatMyFilesArtifacts-dk7QXDl0.cjs +0 -1
  119. package/dist/index-B0LYCMyD.cjs +0 -1447
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue");require("@vueuse/core");const l=require("./index-B0LYCMyD.cjs"),Qe="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20version='1.1'%20viewBox='0%200%2024.0%2024.0'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdefs%3e%3cclipPath%20id='i0'%3e%3cpath%20d='M2000,0%20L2000,4212%20L0,4212%20L0,0%20L2000,0%20Z'%3e%3c/path%3e%3c/clipPath%3e%3c/defs%3e%3cg%20transform='translate(-157.0%20-2549.0)'%3e%3cg%20clip-path='url(%23i0)'%3e%3cg%20transform='translate(145.0%202545.0)'%3e%3cg%20transform='translate(12.0%204.0)'%3e%3cg%20transform='translate(24.0%2024.0)%20rotate(90.0)%20scale(-1.0%201.0)'%3e%3cg%20transform='translate(17.5%209.5)%20rotate(90.00000000000001)'%3e%3cpath%20d='M0,0%20L5,5%20L0,10'%20stroke='currentColor'%20stroke-width='1.8'%20fill='none'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Je={class:"chat-artifact-row__lead"},Xe={class:"chat-artifact-row__name"},et=["title"],tt={class:"chat-artifact-row__meta"},at={class:"chat-artifact-row__cell chat-artifact-row__cell--kind"},lt=["title"],nt={class:"chat-artifact-row__cell chat-artifact-row__cell--time"},ot={class:"chat-artifact-row__cell chat-artifact-row__cell--size"},st=e.defineComponent({name:"ChatArtifactFileRow",__name:"ChatArtifactFileRow",props:{file:{},selected:{type:Boolean},actionsDisabled:{type:Boolean,default:!1},showOwner:{type:Boolean,default:!1}},emits:["toggle","open","action"],setup(c,{emit:N}){const s=c,y=N,_=l.useTransferTargetFilter(),p=e.computed(()=>l.createArtifactFileMenuItems({disabled:s.actionsDisabled},{canUploadTo:_(s.file)})),{Menu:u}=l.useUiDropdown({items:p,placement:l.ARTIFACT_FILE_MENU_PLACEMENT,width:l.ARTIFACT_FILE_MENU_WIDTH,panelClass:l.ARTIFACT_FILE_MENU_PANEL_CLASS,submenuPanelClass:l.ARTIFACT_FILE_SUBMENU_PANEL_CLASS,onItemClick:({id:f})=>{if(f.split(":").at(-1)==="download"){if(s.actionsDisabled)return;s.file.url&&l.downloadFromSrc(s.file.url,s.file.name);return}y("action",f)}}),m=e.computed(()=>[s.file.kind,s.file.updatedLabel,s.file.sizeLabel].filter(Boolean).join(" · "));return(f,v)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["chat-artifact-row",{"is-selected":c.selected,"has-owner":c.showOwner}]),onClick:v[3]||(v[3]=B=>y("toggle"))},[e.createElementVNode("span",Je,[e.createVNode(l.ChatFileCheckbox,{class:"chat-artifact-row__check",checked:c.selected,label:c.selected?"取消选择":"选择文件",onToggle:v[0]||(v[0]=B=>y("toggle"))},null,8,["checked","label"]),e.createVNode(l.ChatMyFilesTypeMark,{ext:c.file.ext,name:c.file.name},null,8,["ext","name"])]),e.createElementVNode("span",Xe,[e.createElementVNode("button",{class:"chat-artifact-row__title",type:"button",title:c.file.name,onClick:v[1]||(v[1]=e.withModifiers(B=>y("open"),["stop"]))},e.toDisplayString(c.file.name),9,et),e.createElementVNode("span",tt,e.toDisplayString(m.value),1)]),e.createElementVNode("span",at,e.toDisplayString(c.file.kind),1),c.showOwner?(e.openBlock(),e.createElementBlock("span",{key:0,class:"chat-artifact-row__cell chat-artifact-row__cell--owner",title:c.file.owner||""},e.toDisplayString(c.file.owner||"—"),9,lt)):e.createCommentVNode("",!0),e.createElementVNode("span",nt,e.toDisplayString(c.file.updatedLabel),1),e.createElementVNode("span",ot,e.toDisplayString(c.file.sizeLabel),1),e.createVNode(e.unref(u),null,{default:e.withCtx(()=>[e.createVNode(l.ArtifactFileMoreButton,{class:"chat-artifact-row__more","data-testid":"artifact-row-more",loading:"lazy",decoding:"async",onClick:v[2]||(v[2]=e.withModifiers(()=>{},["stop"]))})]),_:1})],2))}}),rt=l._export_sfc(st,[["__scopeId","data-v-c9c7f7c8"]]),ct=["aria-label"],it={class:"chat-artifact-preview__body"},ut={key:3,class:"chat-artifact-preview__empty"},dt=e.defineComponent({name:"ChatArtifactPreview",__name:"ChatArtifactPreview",props:{file:{},cloud:{default:void 0},actionsDisabled:{type:Boolean,default:!1},onlyofficeProfile:{default:"preview"}},emits:["close","action"],setup(c,{emit:N}){const s=c,y=N,_=l.useTransferTargetFilter(),p=e.computed(()=>l.createArtifactFileMenuItems({disabled:s.actionsDisabled},{canUploadTo:_(s.file)})),{Menu:u}=l.useUiDropdown({items:p,placement:l.ARTIFACT_FILE_MENU_PLACEMENT,width:l.ARTIFACT_FILE_MENU_WIDTH,panelClass:l.ARTIFACT_FILE_MENU_PANEL_CLASS,submenuPanelClass:l.ARTIFACT_FILE_SUBMENU_PANEL_CLASS,zIndex:3100,onItemClick:({id:i})=>{if(i.split(":").at(-1)==="download"){G();return}y("action",i)}}),m=e.ref(null),f=e.ref(!0);let v=0;async function B(){const i=++v;if(m.value=null,s.file.url){m.value={url:s.file.url,previewType:s.file.previewType},f.value=!1;return}f.value=!0;const O=await l.resolveArtifactPreview(s.cloud,s.file);i===v&&(m.value=O??null,f.value=!1)}const k=e.computed(()=>l.artifactToResource(s.file,m.value??void 0)),R=e.computed(()=>{var i;return((i=m.value)==null?void 0:i.url)??""}),oe=e.computed(()=>l.getChatPreviewKind(k.value)),W=e.computed(()=>l.isPlainTextResource(k.value)),D=e.ref(""),K=e.ref(0),P=e.ref(!1);let j;function se(i){D.value=i.text,K.value=i.lines}async function Y(){if(D.value){try{await navigator.clipboard.writeText(D.value)}catch{return}P.value=!0,clearTimeout(j),j=setTimeout(()=>{P.value=!1},1600)}}const E=e.computed(()=>[s.file.kind,W.value&&K.value?`${K.value} 行`:"",s.file.sizeLabel].filter(Boolean).join(" · ")),g=e.computed(()=>l.isUnpreviewableKind(oe.value)),$=e.computed(()=>l.unsupportedPreviewHint(s.file)),C=e.computed(()=>!!R.value&&!g.value);e.watch(()=>[s.file.id,s.file.url],()=>void B());const F=e.ref(),Q=e.ref();let b=null;const U=l.useDocViewerChromeHost();e.watch(()=>s.file.id,()=>{l.resetDocViewerChrome(U),D.value="",K.value=0,P.value=!1});const I=e.ref(!1),w=e.ref(!1);let z=!1;function T(){z||(z=!0,I.value=!1)}function V(){z&&y("close")}function G(){var O;const i=(O=m.value)==null?void 0:O.url;i&&l.downloadFromSrc(i,s.file.name)}function X(){w.value=!w.value}function re(i){if(i.key==="Escape"){if(w.value){w.value=!1;return}T()}}return e.onMounted(()=>{b=document.activeElement instanceof HTMLElement?document.activeElement:null,I.value=!0,B(),e.nextTick(()=>{var i;return(i=Q.value)==null?void 0:i.focusClose()})}),e.onBeforeUnmount(()=>{b==null||b.focus(),b=null,clearTimeout(j)}),(i,O)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"cap-drawer",onAfterLeave:V},{default:e.withCtx(()=>[I.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["chat-artifact-preview",{"is-expanded":w.value}]),onKeydown:re},[e.createElementVNode("div",{class:"chat-artifact-preview__backdrop",onClick:T}),e.createElementVNode("section",{ref_key:"panelRef",ref:F,class:"chat-artifact-preview__panel",role:"dialog","aria-modal":"true","aria-label":`${c.file.name} 预览`},[e.createVNode(l.ChatPreviewHeader,{ref_key:"headerRef",ref:Q,class:"chat-artifact-preview__header",name:c.file.name,ext:c.file.ext,meta:E.value,chrome:e.unref(U),"show-download":!!R.value,fullscreen:w.value,"show-copy":W.value&&!!D.value,copied:P.value,"show-fullscreen":"",onDownload:G,onCopy:Y,onFullscreen:X,onClose:T},{actions:e.withCtx(()=>[e.createVNode(e.unref(u),null,{default:e.withCtx(()=>[e.createVNode(l.ArtifactFileMoreButton,{class:"chat-artifact-preview__more",loading:"eager",decoding:"async"})]),_:1})]),_:1},8,["name","ext","meta","chrome","show-download","fullscreen","show-copy","copied"]),e.createElementVNode("div",it,[f.value?(e.openBlock(),e.createBlock(l.ChatPreviewSkeleton,{key:0,label:"正在加载文件"})):C.value&&W.value?(e.openBlock(),e.createBlock(l.ChatTextReader,{key:1,src:R.value,onLoaded:se},null,8,["src"])):C.value?(e.openBlock(),e.createBlock(l.ChatFilePreview,{key:2,class:"chat-artifact-preview__viewer",resource:k.value,"onlyoffice-profile":c.onlyofficeProfile,"screenshot-ask":!1,"hide-close":"","hide-download":"","hide-fullscreen":"","hide-sidebar":"","hide-image-controls":""},null,8,["resource","onlyoffice-profile"])):(e.openBlock(),e.createElementBlock("div",ut,[g.value?(e.openBlock(),e.createBlock(l._sfc_main,{key:0,ext:c.file.ext,name:c.file.name,description:$.value,download:!!R.value,"secondary-label":R.value?void 0:"返回列表",onDownload:G,onSecondary:T},null,8,["ext","name","description","download","secondary-label"])):(e.openBlock(),e.createBlock(l._sfc_main,{key:1,title:"暂时无法预览",description:"未能获取该文件的预览地址,可稍后重试,或返回列表用其他方式打开。","secondary-label":"返回列表",onSecondary:T}))]))])],8,ct)],34)):e.createCommentVNode("",!0)]),_:1})]))}}),ft=l._export_sfc(dt,[["__scopeId","data-v-d66b7d72"]]),mt={class:"art-skeleton","aria-hidden":"true"},vt={key:0,class:"art-skeleton__group"},pt={class:"art-skeleton__task"},_t={class:"art-skeleton__name"},ht=e.defineComponent({name:"ChatArtifactsSkeleton",__name:"ChatArtifactsSkeleton",props:{blocks:{default:2},rows:{default:2},groupHead:{type:Boolean,default:!1}},setup(c){const N=["42%","54%","34%","48%"],s=["58%","44%","66%","50%"],y=p=>N[p%N.length],_=p=>s[p%s.length];return(p,u)=>(e.openBlock(),e.createElementBlock("div",mt,[c.groupHead?(e.openBlock(),e.createElementBlock("div",vt,[...u[0]||(u[0]=[e.createElementVNode("span",{class:"mf-skeleton-row art-skeleton__chevron"},null,-1),e.createElementVNode("span",{class:"mf-skeleton-row art-skeleton__group-name"},null,-1),e.createElementVNode("span",{class:"mf-skeleton-row art-skeleton__group-count"},null,-1)])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.blocks,m=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"art-skeleton__block"},[e.createElementVNode("div",pt,[u[1]||(u[1]=e.createElementVNode("span",{class:"mf-skeleton-row art-skeleton__spark"},null,-1)),e.createElementVNode("span",{class:"mf-skeleton-row art-skeleton__task-name",style:e.normalizeStyle({width:N[(m+1)%N.length]})},null,4)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.rows,f=>(e.openBlock(),e.createElementBlock("div",{key:f,class:"art-skeleton__row"},[u[3]||(u[3]=e.createElementVNode("span",{class:"art-skeleton__lead"},[e.createElementVNode("span",{class:"mf-skeleton-row art-skeleton__icon"})],-1)),e.createElementVNode("span",_t,[e.createElementVNode("span",{class:"mf-skeleton-row art-skeleton__bar art-skeleton__bar--name",style:e.normalizeStyle({width:y(f-1)})},null,4),u[2]||(u[2]=e.createElementVNode("span",{class:"mf-skeleton-row art-skeleton__bar art-skeleton__bar--meta"},null,-1))]),e.createElementVNode("span",{class:"mf-skeleton-row art-skeleton__cell art-skeleton__cell--kind",style:e.normalizeStyle({width:_(f)})},null,4),e.createElementVNode("span",{class:"mf-skeleton-row art-skeleton__cell art-skeleton__cell--time",style:e.normalizeStyle({width:_(f+1)})},null,4),u[4]||(u[4]=e.createElementVNode("span",{class:"mf-skeleton-row art-skeleton__cell art-skeleton__cell--size"},null,-1)),u[5]||(u[5]=e.createElementVNode("span",{class:"art-skeleton__cell--action"},null,-1))]))),128))]))),128))]))}}),be=l._export_sfc(ht,[["__scopeId","data-v-6ca80140"]]),kt={class:"chat-my-files-artifacts__frame"},yt={class:"chat-my-files-artifacts__toolbar"},wt=["src"],gt={class:"chat-my-files-artifacts__filter",type:"button"},Et=["src"],Ct={class:"chat-my-files-artifacts__search"},bt=["src"],Tt={key:0,class:"chat-my-files-artifacts__progress",role:"status","aria-label":"正在加载 AI 产物"},Nt={class:"chat-my-files-artifacts__table"},At={key:0,class:"chat-my-files-artifacts__col chat-my-files-artifacts__col--owner"},Bt={key:0,class:"chat-my-files-artifacts__skeleton","data-testid":"artifact-first-load","aria-busy":"true"},Vt=["aria-expanded","onClick"],St=["src"],Ft={class:"chat-my-files-artifacts__group-name"},It={class:"chat-my-files-artifacts__group-count"},xt=["inert"],Lt={class:"chat-my-files-artifacts__group-clip"},Mt={class:"chat-my-files-artifacts__task-head"},Rt=["src"],Dt=["title"],Pt=["disabled","aria-busy","onClick"],$t={class:"chat-my-files-artifacts__sentinel-sheet"},Ut={class:"chat-my-files-artifacts__sr-only",role:"status"},zt=["disabled","aria-busy"],Z=6,Ot=3,Te=400,Ht=e.defineComponent({name:"ChatMyFilesArtifacts",__name:"ChatMyFilesArtifacts",props:{cloud:{},actionsDisabled:{type:Boolean}},emits:["back","add-to-task"],setup(c,{emit:N}){const s=c,y=N,_=e.ref(""),p=e.ref("全部类型"),u=e.ref("updatedAt"),m=e.ref("desc"),f=e.ref(new Set),v=e.ref(new Set),B=l.useMyFilesToast();function k(t,a="info"){B==null||B(t,a)}const R=l.useChatContext(),{source:oe,open:W,busy:D,title:K,request:P,confirm:j,close:se}=l.useFileTransfer({getCloud:()=>s.cloud,flash:k,sources:()=>R.transferSources.value,board:l.getMyFilesTransferQueue()}),Y=l.injectChatAddToTask(),E=e.ref([]),g=e.ref(!1),$=e.ref(""),C=e.ref(!1),F=e.ref(new Set),Q=e.ref(1),b=e.ref(!1),U=e.ref(!1),I=e.ref({});let w=0,z=0;const T=new Map,V=e.computed(()=>g.value&&E.value.length===0);function G(){return s.cloud?E.value:l.artifactGroups}function X(t,a){const n=new Set(F.value);a?n.add(t):n.delete(t),F.value=n}function re(t){const a=(t.productCount??0)-t.files.length;return a>0?`还有 ${a} 个`:"加载更多"}async function i(t="replace"){const a=s.cloud;if(!a||t==="append"&&g.value)return;const n=++w,o=t==="append"?Q.value+1:1;t==="replace"&&L&&(A.value=Z,ee.clear()),g.value=!0,$.value="",C.value=t==="append";try{const r=await l.fetchArtifactLibrary(a,{page:o,pageSize:l.ARTIFACT_SESSION_PAGE_SIZE,search:_.value.trim()});if(n!==w)return;const d=l.countArtifactSessions(E.value);E.value=t==="append"?l.mergeArtifactGroups(E.value,r):r;const h=l.countArtifactSessions(E.value)-d;Q.value=o,t==="replace"&&(I.value={}),U.value=!1;const M=l.countArtifactSessions(r)>=l.ARTIFACT_SESSION_PAGE_SIZE;b.value=M&&(t==="replace"||h>0)}catch(r){if(n!==w)return;const d=r instanceof Error?r.message:"产物加载失败";E.value.length?t==="append"&&(U.value=!0):$.value=d,k(d,"error")}finally{n===w&&(g.value=!1,C.value=!1,fe())}}function O(){i("replace")}async function Ne(t){const a=s.cloud;if(!a||g.value||F.value.has(t))return;const n=(T.get(t)??0)+1;T.set(t,n);const o=w;X(t,!0);try{let r=I.value[t]??1,d=0;for(;d<5;){d+=1;const h=await l.fetchArtifactPage(a,t,r,l.ARTIFACT_FILE_PAGE_SIZE);if(T.get(t)!==n||w!==o)return;const M=l.appendArtifactPage(E.value,t,h);if(E.value=M.groups,r+=1,I.value={...I.value,[t]:r},M.added>0||!M.hasMore)break}}catch(r){if(T.get(t)!==n)return;k(r instanceof Error?r.message:"产物加载失败","error")}finally{T.get(t)===n&&X(t,!1)}}const Ae=l.buildKindMenuItems(l.ARTIFACT_KIND_OPTIONS),{Menu:Be}=l.useUiDropdown({items:Ae,placement:"bottom-start",width:140,selectedId:p,panelClass:l.KIND_MENU_PANEL_CLASS,onItemClick:({id:t})=>{Ve(t)&&(p.value=t)}});function Ve(t){return l.ARTIFACT_KIND_OPTIONS.includes(t)}function Se(t){if(!u.value)return t;const a=m.value==="asc"?1:-1;return[...t].sort((n,o)=>u.value==="name"?n.name.localeCompare(o.name,"zh")*a:(n.updatedAt-o.updatedAt)*a)}const x=e.computed(()=>{const t=s.cloud?"":_.value.trim().toLowerCase();return G().map(a=>{const n=!!t&&a.name.toLowerCase().includes(t),o=a.sessions.map(r=>{const d=!!t&&r.title.toLowerCase().includes(t),h=Se(r.files.filter(M=>{const je=p.value==="全部类型"||M.kind===p.value,Ye=!t||M.name.toLowerCase().includes(t);return je&&(n||d||Ye)}));return{...r,files:h}}).filter(r=>r.files.length>0||r.hasMore===!0);return{...a,taskCount:a.taskCount??a.sessions.length,sessions:o}}).filter(a=>a.sessions.length>0)}),Fe=e.computed(()=>x.value.flatMap(t=>t.sessions.flatMap(a=>a.files.map(n=>l.artifactRowKey(a.id,n.id))))),ce=e.computed(()=>Fe.value.filter(t=>v.value.has(t)).length),ee=new Map,L=typeof IntersectionObserver<"u",te=e.ref(null),ae=e.ref(null),A=e.ref(L?Z:Number.POSITIVE_INFINITY);let S=null,ie=!1,le=0;const _e=e.computed(()=>x.value.reduce((t,a)=>t+a.sessions.length,0)),H=e.computed(()=>_e.value>A.value),he=e.computed(()=>{if(!H.value)return x.value;let t=A.value;const a=[];for(const n of x.value){if(t<=0)break;const o=n.sessions.slice(0,t);t-=o.length,a.push({...n,sessions:o})}return a});function ke(){!s.cloud||!L||!b.value||g.value||V.value||_e.value-A.value>Ot||i("append")}let ne=1;function Ie(){if(ne>0)return ne-=1,!0;const t=te.value,a=ae.value;if(!t||!a)return!1;const n=a.getBoundingClientRect(),o=t.getBoundingClientRect();return n.top<o.bottom&&n.bottom>o.top}function ye(){if(L){if(H.value){A.value+=Z;return}b.value&&!g.value&&!V.value&&Ie()&&i("append")}}function xe(){if(H.value){A.value+=Z;return}i("append")}const Le=e.computed(()=>!L||U.value),ue=e.computed(()=>H.value||b.value);let de=0;function fe(){!L||ie||(ie=!0,window.requestAnimationFrame(()=>{if(ie=!1,performance.now()<de)return;const t=ae.value,a=te.value;if(!t||!a)return;const n=t.getBoundingClientRect(),o=a.getBoundingClientRect();n.top<o.bottom+240&&n.bottom>o.top-240&&ye()}))}function we(){window.clearTimeout(le),le=window.setTimeout(()=>{le=0,ue.value&&(ne=1,fe())},Te+40)}function ge(){if(!L)return;S==null||S.disconnect();const t=ae.value;t&&(S=new IntersectionObserver(a=>{if(a.some(n=>n.isIntersecting)){if(performance.now()<de){we();return}ne=1,ye(),ke()}},{root:te.value,rootMargin:"240px 0px"}),S.observe(t))}e.watch([_,p,u,m],()=>{L&&(A.value=Z)}),e.watch([H,b,A],()=>{ge(),fe(),ke()},{flush:"post"});const J=e.computed(()=>!!_.value.trim()||p.value!=="全部类型"),Me=e.computed(()=>J.value?"没有匹配的文件":"暂无 AI 产物"),Re=e.computed(()=>J.value?"换个关键词或切换到「全部类型」试试,也可以清空筛选查看全部产物":"对话里生成的文件会收在这里,可以再加回任务继续使用"),De=e.computed(()=>J.value?"清空筛选":"返回我的文件"),Pe=e.computed(()=>!$.value&&(V.value||x.value.length>0)),me=e.computed(()=>x.value.some(t=>t.sessions.some(a=>a.files.some(n=>!!n.owner))));function $e(){if(!J.value){y("back");return}_.value="",p.value="全部类型"}function Ee(t){if(u.value!==t){u.value=t,m.value=t==="name"?"asc":"desc";return}m.value=m.value==="asc"?"desc":"asc"}function Ce(t){return u.value!==t?"idle":m.value==="asc"?"asc":"desc"}function Ue(t){var r;de=performance.now()+Te;const a=new Set(f.value),n=!a.has(t);n?a.add(t):a.delete(t);const o=n?((r=he.value.find(d=>d.id===t))==null?void 0:r.sessions.length)??0:ee.get(t)??0;n?ee.set(t,o):ee.delete(t),A.value=Math.max(Z,A.value+(n?o:-o)),f.value=a,we()}function ze(t){const a=new Set(v.value);a.has(t)?a.delete(t):a.add(t),v.value=a}const q=e.ref(null),Oe=e.ref("");function He(t,a){Oe.value=t,q.value=a}function Ke(t){const a=l.normalizeArtifactFileActionId(t);if(!a)return;const n=q.value;if(a==="add-task"){if(s.actionsDisabled===!0)return;n&&pe([l.artifactToResource(n)]);return}const o=l.fileTransferTargetOfAction(a);if(o){if(s.actionsDisabled===!0||!n)return;P(o,[l.artifactToTransferItem(n)]);return}const r=l.resolveArtifactFileAction(t,{unavailable:!!s.cloud,disabled:s.actionsDisabled===!0});if(r){if(r.kind==="unavailable"){k(r.notice,"warning");return}r.kind==="notice"&&k(r.notice,"warning")}}function ve(){v.value=new Set}function Ge(t){for(const a of G())for(const n of a.sessions){const o=n.files.findIndex(r=>l.artifactRowKey(n.id,r.id)===t);if(o>=0)return{groupId:a.id,session:n,index:o}}}function qe(t,a){const n=Ge(t);if(!n)return;const o=l.normalizeArtifactFileActionId(a);if(!o)return;const r=n.session.files[n.index];if(!r)return;if(o==="add-task"){if(s.actionsDisabled===!0)return;pe([l.artifactToResource(r)]);return}const d=l.fileTransferTargetOfAction(o);if(d){if(s.actionsDisabled===!0)return;P(d,[l.artifactToTransferItem(r,n.session)]);return}const h=l.resolveArtifactFileAction(a,{unavailable:!!s.cloud,disabled:s.actionsDisabled===!0});if(h){if(h.kind==="unavailable"){k(h.notice,"warning");return}h.kind==="notice"&&k(h.notice,"warning")}}function pe(t){if(t.length!==0){if(Y){Y(t);return}y("add-to-task",t),k(l.ARTIFACT_FILE_ACTION_NOTICES["add-task"],"success")}}function Ze(){return x.value.flatMap(t=>t.sessions.flatMap(a=>a.files.filter(n=>v.value.has(l.artifactRowKey(a.id,n.id))).map(n=>l.artifactToResource(n))))}function We(){if(s.actionsDisabled===!0)return;const t=Ze();if(t.length!==0){if(!Y){if(s.cloud){k(l.ARTIFACT_FILE_ACTIONS_UNAVAILABLE_NOTICE,"warning");return}k(`已添加 ${ce.value} 个文件到任务`,"success"),ve();return}pe(t),ve()}}return e.watch(_,()=>{s.cloud&&(window.clearTimeout(z),z=window.setTimeout(()=>{i("replace")},300))}),e.onMounted(()=>{ge(),s.cloud&&i()}),e.onUnmounted(()=>{S==null||S.disconnect(),S=null,window.clearTimeout(z),window.clearTimeout(le)}),(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["chat-my-files-artifacts",{"has-selection":ce.value>0}])},[e.createElementVNode("div",kt,[e.createElementVNode("header",yt,[e.createElementVNode("button",{class:"chat-my-files-artifacts__back",type:"button",onClick:a[0]||(a[0]=n=>y("back"))},[e.createElementVNode("img",{loading:"eager",decoding:"async",class:"chat-my-files-artifacts__back-glyph",src:e.unref(Qe),alt:""},null,8,wt),a[5]||(a[5]=e.createElementVNode("span",null,"返回我的文件",-1))]),e.createVNode(e.unref(Be),null,{"item-icon":e.withCtx(({item:n})=>[e.createVNode(l._sfc_main$1,{kind:n.id},null,8,["kind"])]),default:e.withCtx(()=>[e.createElementVNode("button",gt,[e.createElementVNode("span",null,e.toDisplayString(p.value),1),e.createElementVNode("img",{loading:"eager",decoding:"async",class:"chat-my-files-artifacts__filter-glyph",src:e.unref(l.chevronDownIcon),alt:""},null,8,Et)])]),_:1}),e.createElementVNode("label",Ct,[e.createElementVNode("img",{loading:"eager",decoding:"async",class:"chat-my-files-artifacts__search-glyph",src:e.unref(l.searchIcon),alt:""},null,8,bt),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":a[1]||(a[1]=n=>_.value=n),type:"search",placeholder:"搜索文件、任务或工作空间",title:"搜索文件、任务或工作空间"},null,512),[[e.vModelText,_.value]])])]),g.value&&!C.value&&!V.value?(e.openBlock(),e.createElementBlock("div",Tt)):e.createCommentVNode("",!0),e.createElementVNode("div",Nt,[Pe.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["chat-my-files-artifacts__head",{"has-owner":me.value}])},[e.createElementVNode("button",{class:"chat-my-files-artifacts__sort chat-my-files-artifacts__sort--name",type:"button",onClick:a[2]||(a[2]=n=>Ee("name"))},[a[7]||(a[7]=e.createTextVNode(" 名称 ",-1)),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["chat-my-files-artifacts__sort-glyph",`is-${Ce("name")}`]),viewBox:"0 0 20 20","aria-hidden":"true"},[...a[6]||(a[6]=[e.createElementVNode("path",{class:"up",d:"M10 3.5 13.5 8H6.5Z"},null,-1),e.createElementVNode("path",{class:"down",d:"M10 16.5 6.5 12h7Z"},null,-1)])],2))]),a[10]||(a[10]=e.createElementVNode("span",{class:"chat-my-files-artifacts__col chat-my-files-artifacts__col--kind"},"类型",-1)),me.value?(e.openBlock(),e.createElementBlock("span",At,"更新人")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"chat-my-files-artifacts__sort chat-my-files-artifacts__sort--time",type:"button",onClick:a[3]||(a[3]=n=>Ee("updatedAt"))},[a[9]||(a[9]=e.createTextVNode(" 更新时间 ",-1)),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["chat-my-files-artifacts__sort-glyph",`is-${Ce("updatedAt")}`]),viewBox:"0 0 20 20","aria-hidden":"true"},[...a[8]||(a[8]=[e.createElementVNode("path",{class:"up",d:"M10 3.5 13.5 8H6.5Z"},null,-1),e.createElementVNode("path",{class:"down",d:"M10 16.5 6.5 12h7Z"},null,-1)])],2))]),a[11]||(a[11]=e.createElementVNode("span",{class:"chat-my-files-artifacts__col chat-my-files-artifacts__col--size"},"大小",-1)),a[12]||(a[12]=e.createElementVNode("span",{class:"chat-my-files-artifacts__col chat-my-files-artifacts__col--action"},"操作",-1))],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"bodyRef",ref:te,class:"chat-my-files-artifacts__body"},[V.value?(e.openBlock(),e.createElementBlock("div",Bt,[e.createVNode(be,{"group-head":"",blocks:2,rows:3}),a[13]||(a[13]=e.createElementVNode("p",{class:"chat-my-files-artifacts__sr-only",role:"status"},"正在加载 AI 产物",-1))])):$.value?(e.openBlock(),e.createBlock(l.ChatMyFilesState,{key:1,class:"chat-my-files-artifacts__state",tone:"error",variant:"error",title:"产物加载失败",description:$.value,"action-text":"重新加载",onAction:O},null,8,["description"])):x.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(l.ChatMyFilesState,{key:2,class:"chat-my-files-artifacts__state",variant:J.value?"search":"files",title:Me.value,description:Re.value,"action-text":De.value,onAction:$e},null,8,["variant","title","description","action-text"])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,n=>(e.openBlock(),e.createElementBlock("section",{key:n.id,class:"chat-my-files-artifacts__group"},[e.createElementVNode("button",{class:"chat-my-files-artifacts__group-head",type:"button","aria-expanded":!f.value.has(n.id),onClick:o=>Ue(n.id)},[e.createElementVNode("img",{loading:"lazy",decoding:"async",class:e.normalizeClass(["chat-my-files-artifacts__chevron",{"is-open":!f.value.has(n.id)}]),src:e.unref(l.chevronDownIcon),alt:""},null,10,St),e.createElementVNode("span",Ft,e.toDisplayString(n.name),1),e.createElementVNode("em",It,e.toDisplayString(n.taskCount)+"个任务",1)],8,Vt),e.createElementVNode("div",{class:e.normalizeClass(["chat-my-files-artifacts__group-body",{"is-collapsed":f.value.has(n.id)}]),inert:f.value.has(n.id)||void 0},[e.createElementVNode("div",Lt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.sessions,(o,r)=>(e.openBlock(),e.createElementBlock("div",{key:o.id,class:"chat-my-files-artifacts__task",style:e.normalizeStyle({"--mf-stagger":r})},[e.createElementVNode("div",Mt,[e.createElementVNode("img",{loading:"lazy",decoding:"async",class:"chat-my-files-artifacts__spark",src:e.unref(l.sparkIcon),alt:""},null,8,Rt),e.createElementVNode("span",{title:o.title},e.toDisplayString(o.title),9,Dt)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.files,d=>(e.openBlock(),e.createBlock(rt,{key:e.unref(l.artifactRowKey)(o.id,d.id),file:d,selected:v.value.has(e.unref(l.artifactRowKey)(o.id,d.id)),"show-owner":me.value,"actions-disabled":c.actionsDisabled,onToggle:h=>ze(e.unref(l.artifactRowKey)(o.id,d.id)),onOpen:h=>He(e.unref(l.artifactRowKey)(o.id,d.id),d),onAction:h=>qe(e.unref(l.artifactRowKey)(o.id,d.id),h)},null,8,["file","selected","show-owner","actions-disabled","onToggle","onOpen","onAction"]))),128)),c.cloud&&o.hasMore?(e.openBlock(),e.createElementBlock("button",{key:0,class:"chat-my-files-artifacts__more",type:"button","data-testid":"artifact-file-more",disabled:F.value.has(o.id),"aria-busy":F.value.has(o.id),onClick:d=>Ne(o.id)},e.toDisplayString(F.value.has(o.id)?"加载中":re(o)),9,Pt)):e.createCommentVNode("",!0)],4))),128))])],10,xt)]))),128)),c.cloud&&ue.value&&!V.value?(e.openBlock(),e.createElementBlock("div",{key:3,ref_key:"sentinelRef",ref:ae,class:e.normalizeClass(["chat-my-files-artifacts__sentinel",{"is-loading":C.value}])},[e.createElementVNode("div",$t,[C.value?(e.openBlock(),e.createBlock(be,{key:0,blocks:1,rows:1})):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0),e.createElementVNode("p",Ut,e.toDisplayString(C.value?"正在加载更多 AI 产物":""),1),c.cloud&&ue.value&&!V.value&&Le.value?(e.openBlock(),e.createElementBlock("button",{key:4,class:"chat-my-files-artifacts__sessions-more",type:"button","data-testid":"artifact-session-more",disabled:g.value&&!H.value,"aria-busy":C.value,onClick:xe},e.toDisplayString(C.value?"加载中":U.value?"重新加载":H.value?"显示更多任务":"加载更多会话"),9,zt)):e.createCommentVNode("",!0)],512)]),e.createVNode(l._sfc_main$2,{count:ce.value,onClear:ve,onAddTask:We},null,8,["count"]),q.value?(e.openBlock(),e.createBlock(ft,{key:q.value.id,file:q.value,cloud:c.cloud,"actions-disabled":c.actionsDisabled,onClose:a[4]||(a[4]=n=>q.value=null),onAction:Ke},null,8,["file","cloud","actions-disabled"])):e.createCommentVNode("",!0),e.createVNode(l.ChatFilePickerDialog,{source:e.unref(oe),open:e.unref(W),mode:"target",title:e.unref(K),busy:e.unref(D),"onUpdate:open":e.unref(se),onConfirm:e.unref(j)},null,8,["source","open","title","busy","onUpdate:open","onConfirm"])])],2))}}),Kt=l._export_sfc(Ht,[["__scopeId","data-v-13517c8c"]]);exports.default=Kt;