"use strict";(self.webpackChunknextcloud=self.webpackChunknextcloud||[]).push([[7462],{10396:(e,n,a)=>{a.d(n,{A:()=>d});varo=a(85168),i=a(70395),s=a(80486),r=a(10767),c=a(96689),m=a(96763);constd={props:{id:{type:Number,default:null},message:{type:String,default:""},resourceId:{type:[String,Number],required:!0},resourceType:{type:String,default:"files"}},data:()=>({deleted:!1,editing:!1,loading:!1}),methods:{onEdit(){this.editing=!0},onEditCancel(){this.editing=!1,this.updateLocalMessage(this.message)},asynconEditComment(e){this.loading=!0;try{await(0,r.A)(this.resourceType,this.resourceId,this.id,e),c.A.debug("Comment edited",{resourceType:this.resourceType,resourceId:this.resourceId,id:this.id,message:e}),this.$emit("update:message",e),this.editing=!1}catch(e){(0,o.Qg)(t("comments","An error occurred while trying to edit the comment")),m.error(e)}finally{this.loading=!1}},onDeleteWithUndo(){this.deleted=!0;conste=setTimeout(this.onDelete,o.Br);(0,o._h)(t("comments","Comment deleted"),(()=>{clearTimeout(e),this.deleted=!1}))},asynconDelete(){try{await(0,s.A)(this.resourceType,this.resourceId,this.id),c.A.debug("Comment deleted",{resourceType:this.resourceType,resourceId:this.resourceId,id:this.id}),this.$emit("delete",this.id)}catch(e){(0,o.Qg)(t("comments","An error occurred while trying to delete the comment")),m.error(e),this.deleted=!1}},asynconNewComment(e){this.loading=!0;try{constt=await(0,i.A)(this.resourceType,this.resourceId,e);c.A.debug("New comment posted",{resourceType:this.resourceType,resourceId:this.resourceId,newComment:t}),this.$emit("new",t),this.$emit("update:message",""),this.localMessage=""}catch(e){(0,o.Qg)(t("comments","An error occurred while trying to create the comment")),m.error(e)}finally{this.loading=!1}}}}},80486:(t,e,n)=>{n.d(e,{A:()=>o});vara=n(35550);asyncfunctiono(t,e,n){consto=["",t,e,n].join("/");awaita.A.deleteFile(o)}},10767:(t,e,n)=>{n.d(e,{A:()=>o});vara=n(35550);asyncfunctiono(t,e,n,o){consti=["",t,e,n].join("/");returnawaita.A.customRequest(i,Object.assign({method:"PROPPATCH",data:'<?xml version="1.0"?>\n\t\t\t<d:propertyupdate\n\t\t\t\txmlns:d="DAV:"\n\t\t\t\txmlns:oc="http://owncloud.org/ns">\n\t\t\t<d:set>\n\t\t\t\t<d:prop>\n\t\t\t\t\t<oc:message>'.concat(o,"</oc:message>\n\t\t\t\t</d:prop>\n\t\t\t</d:set>\n\t\t\t</d:propertyupdate>")}))}},70395:(t,e,n)=>{n.d(e,{A:()=>c});vara=n(21777),o=n(17003),i=n(51195),s=n(26287),r=n(35550);asyncfunctionc(t,e,n){constc=["",t,e].join("/"),m=awaits.A.post((0,o.e)()+c,{actorDisplayName:(0,a.HW)().displayName,actorId:(0,a.HW)().uid,actorType:"users",creationDateTime:(newDate).toUTCString(),message:n,objectType:t,verb:"comment"}),d=c+"/"+parseInt(m.headers["content-location"].split("/").pop()),l=awaitr.A.stat(d,{details:!0}),A=l.data.props;returnA.actorDisplayName=(0,i.j)(A.actorDisplayName,2),A.message=(0,i.j)(A.message,2),l.data}},51195:(t,e,n)=>{functiona(t){lete=arguments.length>1&&void0!==arguments[1]?arguments[1]:1;constn=newDOMParser;leta=t;for(lett=0;t<e;t++)a=n.parseFromString(a,"text/html").documentElement.textContent;returna}n.d(e,{j:()=>a})},70452:(t,e,n)=>{n.d(e,{A:()=>r});vara=n(26287),o=n(21777),i=n(38613),s=n(99498);constr=(0,n(85471).pM)({props:{resourceId:{type:Number,required:!0},resourceType:{type:String,default:"files"}},data:()=>({editorData:{actorDisplayName:(0,o.HW)().displayName,actorId:(0,o.HW)().uid,key:"editor"},userData:{}}),methods:{asyncautoComplete(t,e){const{data:n}=awaita.A.get((0,s.KT)("core/autocomplete/get"),{params:{search:t,itemType:"files",itemId:this.resourceId,sorter:"commenters|share-recipients",limit:(0,i.C)("comments","maxAutoCompleteResults")}});returnn.ocs.data.forEach((t=>{this.userData[t.id]=t})),e(Object.values(this.userData))},genMentionsData(t){returnObject.values(t).flat().forEach((t=>{vare;this.userData[t.mentionId]={icon:"icon-user",id:t.mentionId,label:t.mentionDisplayName,source:"users",primary:(null===(e=(0,o.HW)())||void0===e?void0:e.uid)===t.mentionId}})),this.userData}}})},29369:(t,e,n)=>{n.d(e,{A:()=>C});vara=n(21777),o=n(53334),i=n(516