(()=>{var e,i,s,n={78348:(e,i,s)=>{"use strict";var n=s(85471),r=s(53334),o=s(43627),a=s.n(o),l=s(85168),c=s(61338),d=s(21777),u=s(84237),p=s(16406),h=s(63814),f=s(71225),m=s(19231),v=s(60669);const A=(0,h.dC)("dav"),g=(0,v.UU)(A),E=e=>{g.setHeaders({"X-Requested-With":"XMLHttpRequest",requesttoken:e??""})};(0,d.zo)(E),E((0,d.do)());const b=g,w=(0,s(35947).YK)().setApp("files_version").detectUser().build();const y={name:"BackupRestoreIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var _=s(14486);const N=(0,_.A)(y,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon backup-restore-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M12,3A9,9 0 0,0 3,12H0L4,16L8,12H5A7,7 0 0,1 12,5A7,7 0 0,1 19,12A7,7 0 0,1 12,19C10.5,19 9.09,18.5 7.94,17.7L6.5,19.14C8.04,20.3 9.94,21 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M14,12A2,2 0 0,0 12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports;var I=s(11037);const C={name:"DownloadIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},L=(0,_.A)(C,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon download-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports,R={name:"FileCompareIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},O=(0,_.A)(R,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon file-compare-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M10,18H6V16H10V18M10,14H6V12H10V14M10,1V2H6C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H10V23H12V1H10M20,8V20C20,21.11 19.11,22 18,22H14V20H18V11H14V9H18.5L14,4.5V2L20,8M16,14H14V12H16V14M16,18H14V16H16V18Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports,x={name:"ImageOffOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},$=(0,_.A)(x,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon image-off-outline-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M22 20.7L3.3 2L2 3.3L3 4.3V19C3 20.1 3.9 21 5 21H19.7L20.7 22L22 20.7M5 19V6.3L12.6 13.9L11.1 15.8L9 13.1L6 17H15.7L17.7 19H5M8.8 5L6.8 3H19C20.1 3 21 3.9 21 5V17.2L19 15.2V5H8.8"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports;var T=s(93919),S=s(89257),D=s(73267),V=s(41944),P=s(4604),F=s(1522),k=s(18300),M=s(32981),H=s(35810),B=s(65043);const U=(e,t)=>!!(e&t),G=(0,n.pM)({name:"Version",components:{NcActionLink:D.A,NcActionButton:S.A,NcAvatar:V.A,NcDateTime:P.A,NcListItem:F.A,BackupRestore:N,Download:L,FileCompare:O,Pencil:T.A,Delete:I.A,ImageOffOutline:$},directives:{tooltip:k.A},props:{version:{type:Object,required:!0},fileInfo:{type:Object,required:!0},isCurrent:{type:Boolean,default:!1},isFirstVersion:{type:Boolean,default:!1},loadPreview:{type:Boolean,default:!1},canView:{type:Boolean,default:!1},canCompare:{type:Boolean,default:!1}},emits:["click","compare","restore","delete","label-update-request"],data:()=>({previewLoaded:!1,previewErrored:!1,capabilities:(0,M.C)("core","capabilities",{files:{version_labeling:!1,version_deletion:!1}}),versionAuthor:""}),computed:{humanReadableSize(){return(0,H.v7)(this.version.size)},versionLabel(){const e=this.version.label??"";return this.isCurrent?""===e?(0,r.Tl)("files_versions","Current version"):`${e} (${(0,r.Tl)("files_versions","Current version")})`:this.isFirstVersion&&""===e?(0,r.Tl)("files_versions","Initial version"):e},downloadURL(){return this.isCurrent?(0,h.aU)()+(0,f.HS)("/remote.php/webdav",this.fileInfo.path,this.fileInfo.name):(0,h.aU)()+this.version.url},enableLabeling(){return!0===this.capabilities.files.version_labeling},enableDeletion(){return!0===this.capabilities.files.version_deletion},hasDeletePermissions(){return U(this.fileInfo.permissions,H.aX.DELETE)},hasUpdatePermissions(){return U(this.fileInfo.permissions,H.aX.UPDATE)},isDownloadable(){if(!(this.fileInfo.permissions&H.aX.READ))return!1;if("shared"===this.fileInfo.mountType){const e=this.fileInfo.shareAttributes.find((e=>"permissions"===e.scope&&"download"===e.key))||{};if(!1===e?.value)return!1}return!0}},created(){this.fetchDisplayName()},methods:{labelUpdate(){this.$emit("label-update-request")},restoreVersion(){this.$emit("restore",this.version)},async deleteVersion(){await this.$nextTick(),await this.$nextTick(),this.$emit("delete",this.version)},async fetchDisplayName(){if(this.version.author)try{const{data:e}=await B.Ay.get((0,h.KT)(`/cloud/users/${this.version.author}`));this.versionAuthor=e.ocs.data.displayname}catch(e){this.versionAuthor=null}},click(){this.canView?this.$emit("click",{version:this.version}):window.location=this.downloadURL},compareVersion(){if(!this.canView)throw new Error("Cannot compare version of this file");this.$emit("compare",{version:this.version})},t:r.Tl}});var j=s(85072),z=s.n(j),X=s(97825),q=s.n(X),W=s(77659),K=s.n(W),Y=s(55056),Z=s.n(Y),Q=s(10540),J=s.n(Q),ee=s(41113),te=s.n(ee),ie=s(91974),se={};se.styleTagTransform=te(),se.setAttributes=Z(),se.insert=K().bind(null,"head"),se.domAPI=q(),se.insertStyleElement=J(),z()(ie.A,se),ie.A&&ie.A.locals&&ie.A.locals;const ne=(0,_.A)(G,(function(){var e=this,t=e._self._c;return e._self._setupProxy,t("NcListItem",{staticClass:"version",attrs:{"force-display-actions":!0,"data-files-versions-version":e.version.fileVersion},on:{click:e.click},scopedSlots:e._u([{key:"icon",fn:function(){return[e.loadPreview||e.previewLoaded?!e.isCurrent&&!e.version.hasPreview||e.previewErrored?t("div",{staticClass:"version__image"},[t("ImageOffOutline",{attrs:{size:20}})],1):t("img",{staticClass:"version__image",attrs:{src:e.version.previewUrl,alt:"",decoding:"async",fetchpriority:"low",loading:"lazy"},on:{load:function(t){e.previewLoaded=!0},error:function(t){e.previewErrored=!0}}}):t("div",{staticClass:"version__image"})]},proxy:!0},{key:"name",fn:function(){return[t("div",{staticClass:"version__info"},[e.versionLabel?t("div",{staticClass:"version__info__label",attrs:{title:e.versionLabel}},[e._v("\n\t\t\t\t"+e._s(e.versionLabel)+"\n\t\t\t")]):e._e(),e._v(" "),e.versionAuthor?t("div",{staticClass:"version__info"},[e.versionLabel?t("span",[e._v("•")]):e._e(),e._v(" "),t("NcAvatar",{staticClass:"avatar",attrs:{user:e.version.author,size:16,"disable-menu":!0,"disable-tooltip":!0,"show-user-status":!1}}),e._v(" "),t("div",[e._v(e._s(e.versionAuthor))])],1):e._e()])]},proxy:!0},{key:"subname",fn:function(){return[t("div",{staticClass:"version__info version__info__subline"},[t("NcDateTime",{staticClass:"version__info__date",attrs:{"relative-time":"short",timestamp:e.version.mtime}}),e._v(" "),t("span",[e._v("•")]),e._v(" "),t("span",[e._v(e._s(e.humanReadableSize))])],1)]},proxy:!0},{key:"actions",fn:function(){return[e.enableLabeling&&e.hasUpdatePermissions?t("NcActionButton",{attrs:{"data-cy-files-versions-version-action":"label","close-after-click":!0},on:{click:e.labelUpdate},scopedSlots:e._u([{key:"icon",fn:function(){return[t("Pencil",{attrs:{size:22}})]},proxy:!0}],null,!1,3072546167)},[e._v("\n\t\t\t"+e._s(""===e.version.label?e.t("files_versions","Name this version"):e.t("files_versions","Edit version name"))+"\n\t\t")]):e._e(),e._v(" "),!e.isCurrent&&e.canView&&e.canCompare?t("NcActionButton",{attrs:{"data-cy-files-versions-version-action":"compare","close-after-click":!0},on:{click:e.compareVersion},scopedSlots:e._u([{key:"icon",fn:function(){return[t("FileCompare",{attrs:{size:22}})]},proxy:!0}],null,!1,1958207595)},[e._v("\n\t\t\t"+e._s(e.t("files_versions","Compare to current version"))+"\n\t\t")]):e._e(),e._v(" "),!e.isCurrent&&e.hasUpdatePermissions?t("NcActionButton",{attrs:{"data-cy-files-versions-version-action":"restore","close-after-click":!0},on:{click:e.restoreVersion},scopedSlots:e._u([{key:"icon",fn:function(){return[t("BackupRestore",{attrs:{size:22}})]},proxy:!0}],null,!1,2239038444)},[e._v("\n\t\t\t"+e._s(e.t("files_versions","Restore version"))+"\n\t\t")]):e._e(),e._v(" "),e.isDownloadable?t("NcActionLink",{attrs:{"data-cy-files-versions-version-action":"download",href:e.downloadURL,"close-after-click":!0,download:e.downloadURL},scopedSlots:e._u([{key:"icon",fn:function(){return[t("Download",{attrs:{size:22}})]},proxy:!0}],null,!1,927269758)},[e._v("\n\t\t\t"+e._s(e.t("files_versions","Download version"))+"\n\t\t")]):e._e(),e._v(" "),!e.isCurrent&&e.enableDeletion&&e.hasDeletePermissions?t("NcActionButton",{attrs:{"data-cy-files-versions-version-action":"delete","close-after-click":!0},on:{click:e.deleteVersion},scopedSlots:e._u([{key:"icon",fn:function(){return[t("Delete",{attrs:{size:22}})]},proxy:!0}],null,!1,2429175571)},[e._v("\n\t\t\t"+e._s(e.t("files_versions","Delete version"))+"\n\t\t")]):e._e()]},proxy:!0}])})}),[],!1,null,"a0fb4a78",null).exports,re=(0,n.pM)({name:"VirtualScrolling",props:{sections:{type:Array,required:!0},containerElement:{type:HTMLElement,default:null},useWindow:{type:Boolean,default:!1},headerHeight:{type:Number,default:75},renderDistance:{type:Number,default:.5},bottomBufferRatio:{type:Number,default:2},scrollToKey:{type:String,default:""}},data:()=>({scrollPosition:0,containerHeight:0,rowsContainerHeight:0,resizeObserver:null}),computed:{visibleSections(){w.debug("[VirtualScrolling] Computing visible section",{sections:this.sections});const e=this.containerHeight,t=this.scrollPosition,i=t+e;let s=0,n=0;const r=this.sections.map((r=>(n+=this.headerHeight,{...r,rows:r.rows.reduce(((r,o)=>{s=n,n+=o.height;let a=0;return ni&&(a=(s-i)/e),a>this.renderDistance?r:[...r,{...o,distance:a}]}),[])}))).filter((e=>e.rows.length>0)),o=r.flatMap((e=>{let{rows:t}=e;return t})).flatMap((e=>{let{items:t}=e;return t})),a=this._rowIdToKeyMap;o.forEach((e=>e.key=a[e.id]));const l=o.map((e=>{let{key:t}=e;return t})).filter((e=>void 0!==e)),c=Object.values(a).filter((e=>!l.includes(e)));return o.filter((e=>{let{key:t}=e;return void 0===t})).forEach((e=>e.key=c.pop()??Math.random().toString(36).substr(2))),this._rowIdToKeyMap=o.reduce(((e,t)=>{let{id:i,key:s}=t;return{...e,[`${i}`]:s}}),{}),r},totalHeight(){return this.sections.map((e=>this.headerHeight+e.height)).reduce(((e,t)=>e+t),0)+0},paddingTop(){if(0===this.visibleSections.length)return 0;let e=0;for(const t of this.sections)if(t.key===this.visibleSections[0].rows[0].sectionKey){for(const i of t.rows){if(i.key===this.visibleSections[0].rows[0].key)return e;e+=i.height}e+=this.headerHeight}else e+=this.headerHeight+t.height;return e},rowsContainerStyle(){return{height:`${this.totalHeight}px`,paddingTop:`${this.paddingTop}px`}},isNearBottom(){const e=this.containerHeight*this.bottomBufferRatio;return this.scrollPosition+this.containerHeight>=this.totalHeight-e},container(){return w.debug("[VirtualScrolling] Computing container"),null!==this.containerElement?this.containerElement:this.useWindow?window:this.$refs.container}},watch:{isNearBottom(e){w.debug("[VirtualScrolling] isNearBottom changed",{value:e}),e&&this.$emit("need-content")},visibleSections(){this.isNearBottom&&this.$emit("need-content")},scrollToKey(e){let t=0;for(const i of this.sections){if(i.key===e)break;t+=this.headerHeight+i.height}w.debug("[VirtualScrolling] Scrolling to",{currentRowTopDistanceFromTop:t}),this.container.scrollTo({top:t,behavior:"smooth"})}},beforeCreate(){this._rowIdToKeyMap={}},mounted(){this.resizeObserver=new ResizeObserver((e=>{for(const t of e){const e=t.contentRect;t.target===this.container&&(this.containerHeight=e.height),t.target.classList.contains("vs-rows-container")&&(this.rowsContainerHeight=e.height)}})),this.useWindow?(window.addEventListener("resize",this.updateContainerSize,{passive:!0}),this.containerHeight=window.innerHeight):this.resizeObserver.observe(this.container),this.resizeObserver.observe(this.$refs.rowsContainer),this.container.addEventListener("scroll",this.updateScrollPosition,{passive:!0})},beforeDestroy(){this.useWindow&&window.removeEventListener("resize",this.updateContainerSize),this.resizeObserver?.disconnect(),this.container.removeEventListener("scroll",this.updateScrollPosition)},methods:{updateScrollPosition(){this._onScrollHandle??=requestAnimationFrame((()=>{this._onScrollHandle=null,this.useWindow?this.scrollPosition=this.container.scrollY:this.scrollPosition=this.container.scrollTop}))},updateContainerSize(){this.containerHeight=window.innerHeight}}});var oe=s(26201),ae={};ae.styleTagTransform=te(),ae.setAttributes=Z(),ae.insert=K().bind(null,"head"),ae.domAPI=q(),ae.insertStyleElement=J(),z()(oe.A,ae),oe.A&&oe.A.locals&&oe.A.locals;const le=(0,_.A)(re,(function(){var e=this,t=e._self._c;return e._self._setupProxy,e.useWindow||null!==e.containerElement?t("div",{ref:"rowsContainer",staticClass:"vs-rows-container",style:e.rowsContainerStyle},[e._t("default",null,{visibleSections:e.visibleSections}),e._v(" "),e._t("loader")],2):t("div",{ref:"container",staticClass:"vs-container"},[t("div",{ref:"rowsContainer",staticClass:"vs-rows-container",style:e.rowsContainerStyle},[e._t("default",null,{visibleSections:e.visibleSections}),e._v(" "),e._t("loader")],2)])}),[],!1,null,"49a1883f",null).exports;var ce=s(65659),de=s(94219),ue=s(82182);const pe=(0,n.pM)({name:"VersionLabelDialog",components:{NcDialog:de.A,NcTextField:ue.A},props:{open:{type:Boolean,default:!1},versionLabel:{type:String,default:""}},data:()=>({editedVersionLabel:""}),computed:{dialogButtons(){const e=[];return""===this.versionLabel.trim()?e.push({label:(0,r.t)("files_versions","Cancel")}):e.push({label:(0,r.t)("files_versions","Remove version name"),type:"error",nativeType:"reset",callback:()=>{this.setVersionLabel("")}}),[...e,{label:(0,r.t)("files_versions","Save version name"),type:"primary",nativeType:"submit",icon:ce}]}},watch:{versionLabel:{immediate:!0,handler(e){this.editedVersionLabel=e??""}},open:{immediate:!0,handler(e){e&&this.$nextTick((()=>this.$refs.labelInput.focus())),this.editedVersionLabel=this.versionLabel}}},methods:{setVersionLabel(e){this.$emit("label-update",e)},t:r.t}});var he=s(14085),fe={};fe.styleTagTransform=te(),fe.setAttributes=Z(),fe.insert=K().bind(null,"head"),fe.domAPI=q(),fe.insertStyleElement=J(),z()(he.A,fe),he.A&&he.A.locals&&he.A.locals;const me={name:"VersionTab",components:{Version:ne,VirtualScrolling:le,VersionLabelDialog:(0,_.A)(pe,(function(){var e=this,t=e._self._c;return e._self._setupProxy,t("NcDialog",{attrs:{buttons:e.dialogButtons,"content-classes":"version-label-modal","is-form":"",open:e.open,size:"normal",name:e.t("files_versions","Name this version")},on:{"update:open":function(t){return e.$emit("update:open",t)},submit:function(t){return e.setVersionLabel(e.editedVersionLabel)}}},[t("NcTextField",{ref:"labelInput",staticClass:"version-label-modal__input",attrs:{label:e.t("files_versions","Version name"),placeholder:e.t("files_versions","Version name"),value:e.editedVersionLabel},on:{"update:value":function(t){e.editedVersionLabel=t}}}),e._v(" "),t("p",{staticClass:"version-label-modal__info"},[e._v("\n\t\t"+e._s(e.t("files_versions","Named versions are persisted, and excluded from automatic cleanups when your storage quota is full."))+"\n\t")])],1)}),[],!1,null,"6e140e12",null).exports,NcLoadingIcon:u.A},mixins:[p.A],data:()=>({fileInfo:null,isActive:!1,versions:[],loading:!1,showVersionLabelForm:!1,editedVersion:null}),computed:{sections(){return[{key:"versions",rows:this.orderedVersions.map((e=>({key:e.mtime,height:68,sectionKey:"versions",items:[e]}))),height:68*this.orderedVersions.length}]},orderedVersions(){return[...this.versions].sort(((e,t)=>e.mtime===this.fileInfo.mtime?-1:t.mtime===this.fileInfo.mtime?1:t.mtime-e.mtime))},initialVersionMtime(){return this.versions.map((e=>e.mtime)).reduce(((e,t)=>Math.min(e,t)))},viewerFileInfo(){let e="";return 1&this.fileInfo.permissions&&(e+="R"),2&this.fileInfo.permissions&&(e+="W"),8&this.fileInfo.permissions&&(e+="D"),{...this.fileInfo,mime:this.fileInfo.mimetype,basename:this.fileInfo.name,filename:this.fileInfo.path+"/"+this.fileInfo.name,permissions:e,fileid:this.fileInfo.id}},canView(){return window.OCA.Viewer?.mimetypesCompare?.includes(this.fileInfo.mimetype)},canCompare(){return!this.isMobile}},mounted(){(0,c.B1)("files_versions:restore:restored",this.fetchVersions)},beforeUnmount(){(0,c.al)("files_versions:restore:restored",this.fetchVersions)},methods:{async update(e){this.fileInfo=e,this.resetState(),this.fetchVersions()},async setIsActive(e){this.isActive=e},async fetchVersions(){try{this.loading=!0,this.versions=await async function(e){const t=`/versions/${(0,d.HW)()?.uid}/versions/${e.id}`;try{return(await b.getDirectoryContents(t,{data:'\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n',details:!0})).data.filter((e=>{let{mime:t}=e;return""!==t})).map((t=>function(e,t){const i=1e3*(0,m.A)(e.lastmod).unix();let s="";return s=i===t.mtime?(0,h.Jv)("/core/preview?fileId={fileId}&c={fileEtag}&x=250&y=250&forceIcon=0&a=0",{fileId:t.id,fileEtag:t.etag}):(0,h.Jv)("/apps/files_versions/preview?file={file}&version={fileVersion}",{file:(0,f.HS)(t.path,t.name),fileVersion:e.basename}),{fileId:t.id,label:e.props["version-label"]&&String(e.props["version-label"]),author:e.props["version-author"]??null,filename:e.filename,basename:(0,m.A)(i).format("LLL"),mime:e.mime,etag:`${e.props.getetag}`,size:e.size,type:e.type,mtime:i,permissions:"R",hasPreview:1===e.props["has-preview"],previewUrl:s,url:(0,f.HS)("/remote.php/dav",e.filename),source:(0,h.dC)("dav")+(0,f.O0)(e.filename),fileVersion:e.basename}}(t,e)))}catch(e){throw w.error("Could not fetch version",{exception:e}),e}}(this.fileInfo)}finally{this.loading=!1}},async handleRestore(e){const i=this.fileInfo;this.fileInfo={...this.fileInfo,size:e.size,mtime:e.mtime};const s={preventDefault:!1,fileInfo:this.fileInfo,version:e};if((0,c.Ic)("files_versions:restore:requested",s),!s.preventDefault)try{await async function(e){try{w.debug("Restoring version",{url:e.url}),await b.moveFile(`/versions/${(0,d.HW)()?.uid}/versions/${e.fileId}/${e.fileVersion}`,`/versions/${(0,d.HW)()?.uid}/restore/target`)}catch(e){throw w.error("Could not restore version",{exception:e}),e}}(e),""!==e.label?(0,l.Te)(t("files_versions",`${e.label} restored`)):e.mtime===this.initialVersionMtime?(0,l.Te)(t("files_versions","Initial version restored")):(0,l.Te)(t("files_versions","Version restored")),(0,c.Ic)("files_versions:restore:restored",e)}catch(s){this.fileInfo=i,(0,l.Qg)(t("files_versions","Could not restore version")),(0,c.Ic)("files_versions:restore:failed",e)}},handleLabelUpdateRequest(e){this.showVersionLabelForm=!0,this.editedVersion=e},async handleLabelUpdate(e){const t=this.editedVersion.label;this.editedVersion.label=e,this.showVersionLabelForm=!1;try{await async function(e,t){return await b.customRequest(e.filename,{method:"PROPPATCH",data:`\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t${t}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t`})}(this.editedVersion,e),this.editedVersion=null}catch(e){this.editedVersion.label=t,(0,l.Qg)(this.t("files_versions","Could not set version label")),logger.error("Could not set version label",{exception:e})}},async handleDelete(e){const i=this.versions.indexOf(e);this.versions.splice(i,1);try{await async function(e){await b.deleteFile(e.filename)}(e)}catch(i){this.versions.push(e),(0,l.Qg)(t("files_versions","Could not delete version"))}},resetState(){this.$set(this,"versions",[])},openVersion(e){let{version:t}=e;if(t.mtime===this.fileInfo.mtime)return void OCA.Viewer.open({fileInfo:this.viewerFileInfo});const i=this.versions.map((e=>({...e,filename:e.mtime===this.fileInfo.mtime?a().join("files",(0,d.HW)()?.uid??"",this.fileInfo.path,this.fileInfo.name):e.filename,hasPreview:!1,previewUrl:void 0})));OCA.Viewer.open({fileInfo:i.find((e=>e.source===t.source)),enableSidebar:!1})},compareVersion(e){let{version:t}=e;const i=this.versions.map((e=>({...e,hasPreview:!1,previewUrl:void 0})));OCA.Viewer.compare(this.viewerFileInfo,i.find((e=>e.source===t.source)))}}};var ve=s(24649),Ae={};Ae.styleTagTransform=te(),Ae.setAttributes=Z(),Ae.insert=K().bind(null,"head"),Ae.domAPI=q(),Ae.insertStyleElement=J(),z()(ve.A,Ae),ve.A&&ve.A.locals&&ve.A.locals;const ge=(0,_.A)(me,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"versions-tab__container"},[t("VirtualScrolling",{attrs:{sections:e.sections,"header-height":0},scopedSlots:e._u([{key:"default",fn:function(i){let{visibleSections:s}=i;return[t("ul",{attrs:{"data-files-versions-versions-list":""}},[1===s.length?e._l(s[0].rows,(function(i){return t("Version",{key:i.items[0].mtime,attrs:{"can-view":e.canView,"can-compare":e.canCompare,"load-preview":e.isActive,version:i.items[0],"file-info":e.fileInfo,"is-current":i.items[0].mtime===e.fileInfo.mtime,"is-first-version":i.items[0].mtime===e.initialVersionMtime},on:{click:e.openVersion,compare:e.compareVersion,restore:e.handleRestore,"label-update-request":function(t){return e.handleLabelUpdateRequest(i.items[0])},delete:e.handleDelete}})})):e._e()],2)]}}])},[e._v(" "),e.loading?t("NcLoadingIcon",{staticClass:"files-list-viewer__loader",attrs:{slot:"loader"},slot:"loader"}):e._e()],1),e._v(" "),e.editedVersion?t("VersionLabelDialog",{attrs:{open:e.showVersionLabelForm,"version-label":e.editedVersion.label},on:{"update:open":function(t){e.showVersionLabelForm=t},"label-update":e.handleLabelUpdate}}):e._e()],1)}),[],!1,null,null,null).exports;var Ee=s(80284);n.Ay.prototype.t=r.Tl,n.Ay.prototype.n=r.zw,n.Ay.use(Ee.Ay);const be=n.Ay.extend(ge);let we=null;window.addEventListener("DOMContentLoaded",(function(){void 0!==OCA.Files?.Sidebar&&OCA.Files.Sidebar.registerTab(new OCA.Files.Sidebar.Tab({id:"version_vue",name:(0,r.Tl)("files_versions","Versions"),iconSvg:'',async mount(e,t,i){we&&we.$destroy(),we=new be({parent:i}),await we.update(t),we.$mount(e)},update(e){we.update(e)},setIsActive(e){we&&we.setIsActive(e)},destroy(){we.$destroy(),we=null},enabled:e=>!(e?.isDirectory()??1)}))}))},91974:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(71354),n=i.n(s),r=i(76314),o=i.n(r)()(n());o.push([e.id,".version[data-v-a0fb4a78]{display:flex;flex-direction:row}.version__info[data-v-a0fb4a78]{display:flex;flex-direction:row;align-items:center;gap:.5rem;color:var(--color-main-text);font-weight:500}.version__info__label[data-v-a0fb4a78]{font-weight:700;overflow:hidden;text-overflow:ellipsis}.version__info__date[data-v-a0fb4a78]{overflow:hidden;text-overflow:ellipsis}.version__info__subline[data-v-a0fb4a78]{color:var(--color-text-maxcontrast)}.version__image[data-v-a0fb4a78]{width:3rem;height:3rem;border:1px solid var(--color-border);border-radius:var(--border-radius-large);display:flex;justify-content:center;color:var(--color-text-light)}","",{version:3,sources:["webpack://./apps/files_versions/src/components/Version.vue"],names:[],mappings:"AACA,0BACC,YAAA,CACA,kBAAA,CAEA,gCACC,YAAA,CACA,kBAAA,CACA,kBAAA,CACA,SAAA,CACA,4BAAA,CACA,eAAA,CAEA,uCACC,eAAA,CAEA,eAAA,CACA,sBAAA,CAGD,sCAEC,eAAA,CACA,sBAAA,CAGD,yCACC,mCAAA,CAIF,iCACC,UAAA,CACA,WAAA,CACA,oCAAA,CACA,wCAAA,CAGA,YAAA,CACA,sBAAA,CACA,6BAAA",sourcesContent:["\n.version {\n\tdisplay: flex;\n\tflex-direction: row;\n\n\t&__info {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\talign-items: center;\n\t\tgap: 0.5rem;\n\t\tcolor: var(--color-main-text);\n\t\tfont-weight: 500;\n\n\t\t&__label {\n\t\t\tfont-weight: 700;\n\t\t\t// Fix overflow on narrow screens\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t&__date {\n\t\t\t// Fix overflow on narrow screens\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t&__subline {\n\t\t\tcolor: var(--color-text-maxcontrast)\n\t\t}\n\t}\n\n\t&__image {\n\t\twidth: 3rem;\n\t\theight: 3rem;\n\t\tborder: 1px solid var(--color-border);\n\t\tborder-radius: var(--border-radius-large);\n\n\t\t// Useful to display no preview icon.\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\tcolor: var(--color-text-light);\n\t}\n}\n"],sourceRoot:""}]);const a=o},14085:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(71354),n=i.n(s),r=i(76314),o=i.n(r)()(n());o.push([e.id,".version-label-modal__info[data-v-6e140e12]{color:var(--color-text-maxcontrast);margin-block:calc(3*var(--default-grid-baseline))}.version-label-modal__input[data-v-6e140e12]{margin-block-start:calc(2*var(--default-grid-baseline))}","",{version:3,sources:["webpack://./apps/files_versions/src/components/VersionLabelDialog.vue"],names:[],mappings:"AAEC,4CACC,mCAAA,CACA,iDAAA,CAGD,6CACC,uDAAA",sourcesContent:["\n.version-label-modal {\n\t&__info {\n\t\tcolor: var(--color-text-maxcontrast);\n\t\tmargin-block: calc(3 * var(--default-grid-baseline));\n\t}\n\n\t&__input {\n\t\tmargin-block-start: calc(2 * var(--default-grid-baseline));\n\t}\n}\n"],sourceRoot:""}]);const a=o},26201:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(71354),n=i.n(s),r=i(76314),o=i.n(r)()(n());o.push([e.id,".vs-container[data-v-49a1883f]{overflow-y:scroll;height:100%}.vs-rows-container[data-v-49a1883f]{box-sizing:border-box;will-change:scroll-position,padding;contain:layout paint style}","",{version:3,sources:["webpack://./apps/files_versions/src/components/VirtualScrolling.vue"],names:[],mappings:"AACA,+BACC,iBAAA,CACA,WAAA,CAGD,oCACC,qBAAA,CACA,mCAAA,CACA,0BAAA",sourcesContent:["\n.vs-container {\n\toverflow-y: scroll;\n\theight: 100%;\n}\n\n.vs-rows-container {\n\tbox-sizing: border-box;\n\twill-change: scroll-position, padding;\n\tcontain: layout paint style;\n}\n"],sourceRoot:""}]);const a=o},24649:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var s=i(71354),n=i.n(s),r=i(76314),o=i.n(r)()(n());o.push([e.id,".versions-tab__container{height:100%}","",{version:3,sources:["webpack://./apps/files_versions/src/views/VersionTab.vue"],names:[],mappings:"AACA,yBACC,WAAA",sourcesContent:["\n.versions-tab__container {\n\theight: 100%;\n}\n"],sourceRoot:""}]);const a=o},42634:()=>{},63779:()=>{},77199:()=>{},59169:()=>{},86833:()=>{},35810:(e,t,i)=>{"use strict";i.d(t,{Al:()=>D,H4:()=>T,Q$:()=>S,R3:()=>y,VL:()=>w,aX:()=>v,lJ:()=>x,pt:()=>_,ur:()=>M,v7:()=>F});var s=i(35947),n=i(21777),r=i(43627),o=i(71225),a=i(63814),l=i(36117),c=i(44719),d=i(82680),u=(i(87485),i(53334)),p=i(380),h=i(65606),f=i(96763);const m=(0,s.YK)().setApp("@nextcloud/files").detectUser().build();var v=(e=>(e[e.NONE=0]="NONE",e[e.CREATE=4]="CREATE",e[e.READ=1]="READ",e[e.UPDATE=2]="UPDATE",e[e.DELETE=8]="DELETE",e[e.SHARE=16]="SHARE",e[e.ALL=31]="ALL",e))(v||{});const A=["d:getcontentlength","d:getcontenttype","d:getetag","d:getlastmodified","d:creationdate","d:displayname","d:quota-available-bytes","d:resourcetype","nc:has-preview","nc:is-encrypted","nc:mount-type","oc:comments-unread","oc:favorite","oc:fileid","oc:owner-display-name","oc:owner-id","oc:permissions","oc:size"],g={d:"DAV:",nc:"http://nextcloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"},E=function(){return void 0===window._nc_dav_properties&&(window._nc_dav_properties=[...A]),window._nc_dav_properties.map((e=>`<${e} />`)).join(" ")},b=function(){return void 0===window._nc_dav_namespaces&&(window._nc_dav_namespaces={...g}),Object.keys(window._nc_dav_namespaces).map((e=>`xmlns:${e}="${window._nc_dav_namespaces?.[e]}"`)).join(" ")},w=function(){return`\n\t\t\n\t\t\t\n\t\t\t\t${E()}\n\t\t\t\n\t\t`},y=function(e){return`\n\n\t\n\t\t\n\t\t\t\n\t\t\t\t${E()}\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t/files/${(0,n.HW)()?.uid}/\n\t\t\t\tinfinity\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\thttpd/unix-directory\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t0\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${e}\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t100\n\t\t\t0\n\t\t\n\t\n`};var _=(e=>(e.Folder="folder",e.File="file",e))(_||{});const N=function(e,t){return null!==e.match(t)},I=(e,t)=>{if(e.id&&"number"!=typeof e.id)throw new Error("Invalid id type of value");if(!e.source)throw new Error("Missing mandatory source");try{new URL(e.source)}catch(e){throw new Error("Invalid source format, source must be a valid URL")}if(!e.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(e.displayname&&"string"!=typeof e.displayname)throw new Error("Invalid displayname type");if(e.mtime&&!(e.mtime instanceof Date))throw new Error("Invalid mtime type");if(e.crtime&&!(e.crtime instanceof Date))throw new Error("Invalid crtime type");if(!e.mime||"string"!=typeof e.mime||!e.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in e&&"number"!=typeof e.size&&void 0!==e.size)throw new Error("Invalid size type");if("permissions"in e&&void 0!==e.permissions&&!("number"==typeof e.permissions&&e.permissions>=v.NONE&&e.permissions<=v.ALL))throw new Error("Invalid permissions");if(e.owner&&null!==e.owner&&"string"!=typeof e.owner)throw new Error("Invalid owner type");if(e.attributes&&"object"!=typeof e.attributes)throw new Error("Invalid attributes type");if(e.root&&"string"!=typeof e.root)throw new Error("Invalid root type");if(e.root&&!e.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(e.root&&!e.source.includes(e.root))throw new Error("Root must be part of the source");if(e.root&&N(e.source,t)){const i=e.source.match(t)[0];if(!e.source.includes((0,r.join)(i,e.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(e.status&&!Object.values(C).includes(e.status))throw new Error("Status must be a valid NodeStatus")};var C=(e=>(e.NEW="new",e.FAILED="failed",e.LOADING="loading",e.LOCKED="locked",e))(C||{});class L{_data;_attributes;_knownDavService=/(remote|public)\.php\/(web)?dav/i;readonlyAttributes=Object.entries(Object.getOwnPropertyDescriptors(L.prototype)).filter((e=>"function"==typeof e[1].get&&"__proto__"!==e[0])).map((e=>e[0]));handler={set:(e,t,i)=>!this.readonlyAttributes.includes(t)&&Reflect.set(e,t,i),deleteProperty:(e,t)=>!this.readonlyAttributes.includes(t)&&Reflect.deleteProperty(e,t),get:(e,t,i)=>this.readonlyAttributes.includes(t)?(m.warn(`Accessing "Node.attributes.${t}" is deprecated, access it directly on the Node instance.`),Reflect.get(this,t)):Reflect.get(e,t,i)};constructor(e,t){I(e,t||this._knownDavService),this._data={displayname:e.attributes?.displayname,...e,attributes:{}},this._attributes=new Proxy(this._data.attributes,this.handler),this.update(e.attributes??{}),t&&(this._knownDavService=t)}get source(){return this._data.source.replace(/\/$/i,"")}get encodedSource(){const{origin:e}=new URL(this.source);return e+(0,o.O0)(this.source.slice(e.length))}get basename(){return(0,r.basename)(this.source)}get displayname(){return this._data.displayname||this.basename}set displayname(e){this._data.displayname=e}get extension(){return(0,r.extname)(this.source)}get dirname(){if(this.root){let e=this.source;this.isDavRessource&&(e=e.split(this._knownDavService).pop());const t=e.indexOf(this.root),i=this.root.replace(/\/$/,"");return(0,r.dirname)(e.slice(t+i.length)||"/")}const e=new URL(this.source);return(0,r.dirname)(e.pathname)}get mime(){return this._data.mime}get mtime(){return this._data.mtime}set mtime(e){this._data.mtime=e}get crtime(){return this._data.crtime}get size(){return this._data.size}set size(e){this.updateMtime(),this._data.size=e}get attributes(){return this._attributes}get permissions(){return null!==this.owner||this.isDavRessource?void 0!==this._data.permissions?this._data.permissions:v.NONE:v.READ}set permissions(e){this.updateMtime(),this._data.permissions=e}get owner(){return this.isDavRessource?this._data.owner:null}get isDavRessource(){return N(this.source,this._knownDavService)}get root(){return this._data.root?this._data.root.replace(/^(.+)\/$/,"$1"):this.isDavRessource&&(0,r.dirname)(this.source).split(this._knownDavService).pop()||null}get path(){if(this.root){let e=this.source;this.isDavRessource&&(e=e.split(this._knownDavService).pop());const t=e.indexOf(this.root),i=this.root.replace(/\/$/,"");return e.slice(t+i.length)||"/"}return(this.dirname+"/"+this.basename).replace(/\/\//g,"/")}get fileid(){return this._data?.id}get status(){return this._data?.status}set status(e){this._data.status=e}move(e){I({...this._data,source:e},this._knownDavService);const t=this.basename;this._data.source=e,this.displayname===t&&this.basename!==t&&(this.displayname=this.basename),this.updateMtime()}rename(e){if(e.includes("/"))throw new Error("Invalid basename");this.move((0,r.dirname)(this.source)+"/"+e)}updateMtime(){this._data.mtime&&(this._data.mtime=new Date)}update(e){for(const[t,i]of Object.entries(e))try{void 0===i?delete this.attributes[t]:this.attributes[t]=i}catch(e){if(e instanceof TypeError)continue;throw e}}}class R extends L{get type(){return _.File}}class O extends L{constructor(e){super({...e,mime:"httpd/unix-directory"})}get type(){return _.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}}const x=(0,d.f)()?`/files/${(0,d.G)()}`:`/files/${(0,n.HW)()?.uid}`,$=function(){const e=(0,a.dC)("dav");return(0,d.f)()?e.replace("remote.php","public.php"):e}(),T=function(e=$,t={}){const i=(0,c.UU)(e,{headers:t});function s(e){i.setHeaders({...t,"X-Requested-With":"XMLHttpRequest",requesttoken:e??""})}return(0,n.zo)(s),s((0,n.do)()),(0,c.Gu)().patch("fetch",((e,t)=>{const i=t.headers;return i?.method&&(t.method=i.method,delete i.method),fetch(e,t)})),i},S=(e,t="/",i=x)=>{const s=new AbortController;return new l.CancelablePromise((async(n,r,o)=>{o((()=>s.abort()));try{n((await e.getDirectoryContents(`${i}${t}`,{signal:s.signal,details:!0,data:`\n\t\t\n\t\t\t\n\t\t\t\t${E()}\n\t\t\t\n\t\t\t\n\t\t\t\t1\n\t\t\t\n\t\t`,headers:{method:"REPORT"},includeSelf:!0})).data.filter((e=>e.filename!==t)).map((e=>D(e,i))))}catch(e){r(e)}}))},D=function(e,t=x,i=$){let s=(0,n.HW)()?.uid;if((0,d.f)())s=s??"anonymous";else if(!s)throw new Error("No user id found");const r=e.props,o=function(e=""){let t=v.NONE;return e?((e.includes("C")||e.includes("K"))&&(t|=v.CREATE),e.includes("G")&&(t|=v.READ),(e.includes("W")||e.includes("N")||e.includes("V"))&&(t|=v.UPDATE),e.includes("D")&&(t|=v.DELETE),e.includes("R")&&(t|=v.SHARE),t):t}(r?.permissions),a=String(r?.["owner-id"]||s),l=r.fileid||0,c={id:l,source:`${i}${e.filename}`,mtime:new Date(Date.parse(e.lastmod)),mime:e.mime||"application/octet-stream",displayname:void 0!==r.displayname?String(r.displayname):void 0,size:r?.size||Number.parseInt(r.getcontentlength||"0"),status:l<0?C.FAILED:void 0,permissions:o,owner:a,root:t,attributes:{...e,...r,hasPreview:r?.["has-preview"]}};return delete c.attributes?.props,"file"===e.type?new R(c):new O(c)};Error;const V=["B","KB","MB","GB","TB","PB"],P=["B","KiB","MiB","GiB","TiB","PiB"];function F(e,t=!1,i=!1,s=!1){i=i&&!s,"string"==typeof e&&(e=Number(e));let n=e>0?Math.floor(Math.log(e)/Math.log(s?1e3:1024)):0;n=Math.min((i?P.length:V.length)-1,n);const r=i?P[n]:V[n];let o=(e/Math.pow(s?1e3:1024,n)).toFixed(1);return!0===t&&0===n?("0.0"!==o?"< 1 ":"0 ")+(i?P[1]:V[1]):(o=n<2?parseFloat(o).toFixed(0):parseFloat(o).toLocaleString((0,u.lO)()),o+" "+r)}function k(e){return e instanceof Date?e.toISOString():String(e)}function M(e,t={}){const i={sortingMode:"basename",sortingOrder:"asc",...t};return function(e,t,i){i=i??[];const s=(t=t??[e=>e]).map(((e,t)=>"asc"===(i[t]??"asc")?1:-1)),n=Intl.Collator([(0,u.Z0)(),(0,u.lO)()],{numeric:!0,usage:"sort"});return[...e].sort(((e,i)=>{for(const[r,o]of t.entries()){const t=n.compare(k(o(e)),k(o(i)));if(0!==t)return t*s[r]}return 0}))}(e,[...i.sortFavoritesFirst?[e=>1!==e.attributes?.favorite]:[],...i.sortFoldersFirst?[e=>"folder"!==e.type]:[],..."basename"!==i.sortingMode?[e=>e[i.sortingMode]]:[],e=>{return(t=e.attributes?.displayname||e.basename).lastIndexOf(".")>0?t.slice(0,t.lastIndexOf(".")):t;var t},e=>e.basename],[...i.sortFavoritesFirst?["asc"]:[],...i.sortFoldersFirst?["asc"]:[],..."mtime"===i.sortingMode?["asc"===i.sortingOrder?"desc":"asc"]:[],..."mtime"!==i.sortingMode&&"basename"!==i.sortingMode?[i.sortingOrder]:[],i.sortingOrder,i.sortingOrder])}var H={};!function(e){const t=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i="["+t+"]["+t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",s=new RegExp("^"+i+"$");e.isExist=function(e){return void 0!==e},e.isEmptyObject=function(e){return 0===Object.keys(e).length},e.merge=function(e,t,i){if(t){const s=Object.keys(t),n=s.length;for(let r=0;r!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,i){return e}};B.buildOptions=function(e){return Object.assign({},U,e)},B.defaultOptions=U,!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");var G={};function j(e,t,i){let s;const n={};for(let r=0;r0&&(n[t.textNodeName]=s):void 0!==s&&(n[t.textNodeName]=s),n}function z(e){const t=Object.keys(e);for(let e=0;e`,r=!1;continue}if(l===t.commentPropName){n+=s+`\x3c!--${a[l][0][t.textNodeName]}--\x3e`,r=!0;continue}if("?"===l[0]){const e=Q(a[":@"],t),i="?xml"===l?"":s;let o=a[l][0][t.textNodeName];o=0!==o.length?" "+o:"",n+=i+`<${l}${o}${e}?>`,r=!0;continue}let d=s;""!==d&&(d+=t.indentBy);const u=s+`<${l}${Q(a[":@"],t)}`,p=Y(a[l],t,c,d);-1!==t.unpairedTags.indexOf(l)?t.suppressUnpairedNode?n+=u+">":n+=u+"/>":p&&0!==p.length||!t.suppressEmptyNode?p&&p.endsWith(">")?n+=u+`>${p}${s}`:(n+=u+">",p&&""!==s&&(p.includes("/>")||p.includes("`):n+=u+"/>",r=!0}return n}function Z(e){const t=Object.keys(e);for(let i=0;i0&&t.processEntities)for(let i=0;i0&&(i="\n"),Y(e,t,"",i)},ie=function(e){return"function"==typeof e?e:Array.isArray(e)?t=>{for(const i of e){if("string"==typeof i&&t===i)return!0;if(i instanceof RegExp&&i.test(t))return!0}}:()=>!1},se={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function ne(e){this.options=Object.assign({},se,e),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=ie(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=ae),this.processTextOrObjNode=re,this.options.format?(this.indentate=oe,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function re(e,t,i,s){const n=this.j2x(e,i+1,s.concat(t));return void 0!==e[this.options.textNodeName]&&1===Object.keys(e).length?this.buildTextValNode(e[this.options.textNodeName],t,n.attrStr,i):this.buildObjectNode(n.val,t,n.attrStr,i)}function oe(e){return this.options.indentBy.repeat(e)}function ae(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}ne.prototype.build=function(e){return this.options.preserveOrder?te(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0,[]).val)},ne.prototype.j2x=function(e,t,i){let s="",n="";const r=i.join(".");for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o))if(void 0===e[o])this.isAttribute(o)&&(n+="");else if(null===e[o])this.isAttribute(o)?n+="":"?"===o[0]?n+=this.indentate(t)+"<"+o+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+o+"/"+this.tagEndChar;else if(e[o]instanceof Date)n+=this.buildTextValNode(e[o],o,"",t);else if("object"!=typeof e[o]){const i=this.isAttribute(o);if(i&&!this.ignoreAttributesFn(i,r))s+=this.buildAttrPairStr(i,""+e[o]);else if(!i)if(o===this.options.textNodeName){let t=this.options.tagValueProcessor(o,""+e[o]);n+=this.replaceEntitiesValue(t)}else n+=this.buildTextValNode(e[o],o,"",t)}else if(Array.isArray(e[o])){const s=e[o].length;let r="",a="";for(let l=0;l"+e+n}},ne.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`>`+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(s)+`\x3c!--${e}--\x3e`+this.newLine;if("?"===t[0])return this.indentate(s)+"<"+t+i+"?"+this.tagEndChar;{let n=this.options.tagValueProcessor(t,e);return n=this.replaceEntitiesValue(n),""===n?this.indentate(s)+"<"+t+i+this.closeTag(t)+this.tagEndChar:this.indentate(s)+"<"+t+i+">"+n+"0&&this.options.processEntities)for(let t=0;tf.error("SEMVER",...e):()=>{},ce={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},de={exports:{}};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:s,MAX_LENGTH:n}=ce,r=le,o=(t=e.exports={}).re=[],a=t.safeRe=[],l=t.src=[],c=t.t={};let d=0;const u="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",n],[u,s]],h=(e,t,i)=>{const s=(e=>{for(const[t,i]of p)e=e.split(`${t}*`).join(`${t}{0,${i}}`).split(`${t}+`).join(`${t}{1,${i}}`);return e})(t),n=d++;r(e,n,t),c[e]=n,l[n]=t,o[n]=new RegExp(t,i?"g":void 0),a[n]=new RegExp(s,i?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${u}*`),h("MAINVERSION",`(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${l[c.NUMERICIDENTIFIER]}|${l[c.NONNUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NUMERICIDENTIFIERLOOSE]}|${l[c.NONNUMERICIDENTIFIER]})`),h("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${u}+`),h("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),h("FULL",`^${l[c.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),h("LOOSE",`^${l[c.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),h("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${i}})(?:\\.(\\d{1,${i}}))?(?:\\.(\\d{1,${i}}))?`),h("COERCE",`${l[c.COERCEPLAIN]}(?:$|[^\\d])`),h("COERCEFULL",l[c.COERCEPLAIN]+`(?:${l[c.PRERELEASE]})?(?:${l[c.BUILD]})?(?:$|[^\\d])`),h("COERCERTL",l[c.COERCE],!0),h("COERCERTLFULL",l[c.COERCEFULL],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",h("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",h("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(de,de.exports);var ue=de.exports;Object.freeze({loose:!0}),Object.freeze({});const pe=/^[0-9]+$/,he=(e,t)=>{const i=pe.test(e),s=pe.test(t);return i&&s&&(e=+e,t=+t),e===t?0:i&&!s?-1:s&&!i?1:ehe(t,e)};const{MAX_LENGTH:me,MAX_SAFE_INTEGER:ve}=ce,{safeRe:Ae,t:ge}=ue,{compareIdentifiers:Ee}=fe;p.m}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={id:e,loaded:!1,exports:{}};return n[e].call(i.exports,i,i.exports,o),i.loaded=!0,i.exports}o.m=n,e=[],o.O=(t,i,s,n)=>{if(!i){var r=1/0;for(d=0;d=n)&&Object.keys(o.O).every((e=>o.O[e](i[l])))?i.splice(l--,1):(a=!1,n0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[i,s,n]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var i in t)o.o(t,i)&&!o.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,i)=>(o.f[i](e,t),t)),[])),o.u=e=>e+"-"+e+".js?v="+{5706:"3153330af47fc26a725a",6127:"374a617a5ed71ccd7362"}[e],o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},s="nextcloud:",o.l=(e,t,n,r)=>{if(i[e])i[e].push(t);else{var a,l;if(void 0!==n)for(var c=document.getElementsByTagName("script"),d=0;d{a.onerror=a.onload=null,clearTimeout(h);var n=i[e];if(delete i[e],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(s))),t)return t(s)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),l&&document.head.appendChild(a)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),o.j=2250,(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var i=t.getElementsByTagName("script");if(i.length)for(var s=i.length-1;s>-1&&(!e||!/^http(s?):/.test(e));)e=i[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{o.b=document.baseURI||self.location.href;var e={2250:0};o.f.j=(t,i)=>{var s=o.o(e,t)?e[t]:void 0;if(0!==s)if(s)i.push(s[2]);else{var n=new Promise(((i,n)=>s=e[t]=[i,n]));i.push(s[2]=n);var r=o.p+o.u(t),a=new Error;o.l(r,(i=>{if(o.o(e,t)&&(0!==(s=e[t])&&(e[t]=void 0),s)){var n=i&&("load"===i.type?"missing":i.type),r=i&&i.target&&i.target.src;a.message="Loading chunk "+t+" failed.\n("+n+": "+r+")",a.name="ChunkLoadError",a.type=n,a.request=r,s[1](a)}}),"chunk-"+t,t)}},o.O.j=t=>0===e[t];var t=(t,i)=>{var s,n,r=i[0],a=i[1],l=i[2],c=0;if(r.some((t=>0!==e[t]))){for(s in a)o.o(a,s)&&(o.m[s]=a[s]);if(l)var d=l(o)}for(t&&t(i);co(78348)));a=o.O(a)})(); //# sourceMappingURL=files_versions-files_versions.js.map?v=0c8d643d9013e44c59f3