const __vite__fileDeps=["./chunks/ActivityCommentAction-BeBYTh03.mjs","./core-common.mjs","./chunks/CommentView-f2_R7DxB.mjs","./chunks/preload-helper-BG02UnR2.mjs","./chunks/icons-TElqpmA8.mjs","./chunks/index-PaKKd09k.mjs","./chunks/_plugin-vue2_normalizer-VrK6B12S-BQkexw0P.mjs","./chunks/GetComments-BFQTC104.mjs","./chunks/index-tn-fAC9x.mjs","./chunks/json2xml-BD0x8Z3S.mjs","./chunks/logger-DMHE5Ua4.mjs","./chunks/index-CiG5J8j_.mjs","./chunks/ActivityCommentEntry-3KwIWIj7.mjs"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); /*! third party licenses: dist/vendor.LICENSE.txt */ import{M as y}from"./chunks/icons-TElqpmA8.mjs";import{aV as l,b_ as A}from"./core-common.mjs";import{_ as u}from"./chunks/preload-helper-BG02UnR2.mjs";import{m as b}from"./chunks/index-DaZEPb_2.mjs";import{l as d}from"./chunks/logger-DMHE5Ua4.mjs";import{g as _}from"./chunks/GetComments-BFQTC104.mjs";import"./chunks/index-CiG5J8j_.mjs";import"./chunks/index-tn-fAC9x.mjs";import"./chunks/json2xml-BD0x8Z3S.mjs";let c,s;function v(){window.OCA.Activity.registerSidebarAction({mount:async(e,{context:n,fileInfo:o,reload:i})=>{if(!c){const{default:a}=await u(async()=>{const{default:m}=await import("./chunks/ActivityCommentAction-BeBYTh03.mjs");return{default:m}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url);c=l.extend(a)}s=new c({parent:n,propsData:{reloadCallback:i,resourceId:o.id}}),s.$mount(e),d.info("Comments plugin mounted in Activity sidebar action",{fileInfo:o})},unmount:()=>{s&&s.$destroy()}}),window.OCA.Activity.registerSidebarEntries(async({fileInfo:e,limit:n,offset:o})=>{const{data:i}=await _({resourceType:"files",resourceId:e.id},{limit:n,offset:o});d.debug("Loaded comments",{fileInfo:e,comments:i});const{default:a}=await u(async()=>{const{default:r}=await import("./chunks/ActivityCommentEntry-3KwIWIj7.mjs");return{default:r}},__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),m=l.extend(a);return i.map(r=>({timestamp:b(r.props.creationDateTime).toDate().getTime(),mount(p,{context:w,reload:C}){this._CommentsViewInstance=new m({parent:w,propsData:{comment:r,resourceId:e.id,reloadCallback:C}}),this._CommentsViewInstance.$mount(p)},unmount(){this._CommentsViewInstance.$destroy()}}))}),window.OCA.Activity.registerSidebarFilter(e=>e.type!=="comments"),d.info("Comments plugin registered for Activity sidebar action")}var f;if(A("comments","activityEnabled",!1)&&((f=OCA==null?void 0:OCA.Activity)==null?void 0:f.registerSidebarAction)!==void 0)window.addEventListener("DOMContentLoaded",function(){v()});else{let e=null;const n=new OCA.Files.Sidebar.Tab({id:"comments",name:t("comments","Comments"),iconSvg:y,async mount(o,i,a){e&&e.$destroy(),e=new OCA.Comments.View("files",{parent:a,propsData:{resourceId:i.id}}),await e.update(i.id),e.$mount(o)},update(o){e.update(o.id)},destroy(){e.$destroy(),e=null},scrollBottomReached(){e.onScrollBottomReached()}});window.addEventListener("DOMContentLoaded",function(){OCA.Files&&OCA.Files.Sidebar&&OCA.Files.Sidebar.registerTab(n)})}