You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nextcloud/dist/files-main.js

3 lines
110 KiB
JavaScript

/*! For license information please see files-main.js.LICENSE.txt */
(()=>{"use strict";var e,n={11115:(e,n,i)=>{var o=i(17499),s=i(79954),r=i(31352),a=i(79753),l=i(45994);const c=function(){var t,e,n,i;const o=(null===(t=OCA)||void 0===t||null===(e=t.Files)||void 0===e||null===(n=e.App)||void 0===n||null===(i=n.currentFileList)||void 0===i?void 0:i.dirInfo)||{path:"/",name:""};return"".concat(o.path,"/").concat(o.name).replace(/\/\//gi,"/")};var d=i(4820),u=i(20144),p=i(62520),h=i(64024),f=i(93455),A=i.n(f),v=i(70110),m=i.n(v);const g=256,w={name:"TemplatePreview",inheritAttrs:!1,props:{basename:{type:String,required:!0},checked:{type:Boolean,default:!1},fileid:{type:[String,Number],required:!0},filename:{type:String,required:!0},previewUrl:{type:String,default:null},hasPreview:{type:Boolean,default:!0},mime:{type:String,required:!0},ratio:{type:Number,default:null}},data:()=>({failedPreview:!1}),computed:{nameWithoutExt(){return this.basename.indexOf(".")>-1?this.basename.split(".").slice(0,-1).join("."):this.basename},id(){return"template-picker-".concat(this.fileid)},realPreviewUrl(){return this.failedPreview&&this.mimeIcon?this.mimeIcon:this.previewUrl?this.previewUrl:(0,l.ts)()?(0,a.generateUrl)("/core/preview?fileId=".concat(this.fileid,"&x=").concat(g,"&y=").concat(g,"&a=1")):(0,a.generateUrl)("/apps/files_sharing/publicpreview/".concat(document.getElementById("sharingToken")&&document.getElementById("sharingToken").value,"?fileId=").concat(this.fileid,"&file=").concat(function(t){const e=(t.startsWith("/")?t:"/".concat(t)).split("/");let n="";return e.forEach((t=>{""!==t&&(n+="/"+encodeURIComponent(t))})),n}(this.filename),"&x=").concat(g,"&y=").concat(g,"&a=1"))},mimeIcon(){return OC.MimeType.getIconUrl(this.mime)}},methods:{onCheck(){this.$emit("check",this.fileid)},onFailure(){this.failedPreview=!0}}};var b=i(93379),C=i.n(b),y=i(7795),_=i.n(y),x=i(90569),S=i.n(x),k=i(3565),I=i.n(k),N=i(19216),E=i.n(N),F=i(44589),B=i.n(F),P=i(3491),z={};z.styleTagTransform=B(),z.setAttributes=I(),z.insert=S().bind(null,"head"),z.domAPI=_(),z.insertStyleElement=E(),C()(P.Z,z),P.Z&&P.Z.locals&&P.Z.locals;var T=i(51900);const D=(0,T.Z)(w,(function(){var t=this,e=t._self._c;return e("li",{staticClass:"template-picker__item"},[e("input",{staticClass:"radio",attrs:{id:t.id,type:"radio",name:"template-picker"},domProps:{checked:t.checked},on:{change:t.onCheck}}),t._v(" "),e("label",{staticClass:"template-picker__label",attrs:{for:t.id}},[e("div",{staticClass:"template-picker__preview",class:t.failedPreview?"template-picker__preview--failed":""},[e("img",{staticClass:"template-picker__image",attrs:{src:t.realPreviewUrl,alt:"",draggable:"false"},on:{error:t.onFailure}})]),t._v(" "),e("span",{staticClass:"template-picker__title"},[t._v("\n\t\t\t"+t._s(t.nameWithoutExt)+"\n\t\t")])])])}),[],!1,null,"6c072a31",null).exports;var L=i(25108);const U={name:"TemplatePicker",components:{NcEmptyContent:A(),NcModal:m(),TemplatePreview:D},props:{logger:{type:Object,required:!0}},data:()=>({checked:-1,loading:!1,name:null,opened:!1,provider:null}),computed:{nameWithoutExt(){return this.name.indexOf(".")>-1?this.name.split(".").slice(0,-1).join("."):this.name},emptyTemplate(){var e,n;return{basename:t("files","Blank"),fileid:-1,filename:this.t("files","Blank"),hasPreview:!1,mime:(null===(e=this.provider)||void 0===e?void 0:e.mimetypes[0])||(null===(n=this.provider)||void 0===n?void 0:n.mimetypes)}},selectedTemplate(){return this.provider.templates.find((t=>t.fileid===this.checked))},style(){return{"--margin":"8px","--width":"160px","--border":"2px","--fullwidth":"180px","--height":this.provider.ratio?Math.round(160/this.provider.ratio)+"px":null}}},methods:{async open(t,e){this.checked=this.emptyTemplate.fileid,this.name=t,this.provider=e;const n=(await async function(){return(await d.default.get((0,a.generateOcsUrl)("apps/files/api/v1/templates"))).data.ocs.data}()).find((t=>t.app===e.app&&t.label===e.label));if(null===n)throw new Error("Failed to match provider in results");this.provider=n,0!==n.templates.length?this.opened=!0:this.onSubmit()},close(){this.checked=this.emptyTemplate.fileid,this.loading=!1,this.name=null,this.opened=!1,this.provider=null},onCheck(t){this.checked=t},async onSubmit(){var t,e,n;this.loading=!0;const i=c(),o=null===(t=OCA)||void 0===t||null===(e=t.Files)||void 0===e||null===(n=e.App)||void 0===n?void 0:n.currentFileList;var s,r;this.nameWithoutExt===this.name&&(this.logger.debug("Fixed invalid filename",{name:this.name,extension:null===(s=this.provider)||void 0===s?void 0:s.extension}),this.name=this.name+(null===(r=this.provider)||void 0===r?void 0:r.extension));try{var l,u;const t=await async function(t,e,n){return(await d.default.post((0,a.generateOcsUrl)("apps/files/api/v1/templates/create"),{filePath:t,templatePath:e,templateType:n})).data.ocs.data}((0,p.normalize)("".concat(i,"/").concat(this.name)),null===(l=this.selectedTemplate)||void 0===l?void 0:l.filename,null===(u=this.selectedTemplate)||void 0===u?void 0:u.templateType);this.logger.debug("Created new file",t);const e=await(null==o?void 0:o.addAndFetchFileInfo(this.name).then(((t,e)=>e))),n=new OCA.Files.FileInfoModel(e,{filesClient:null==o?void 0:o.filesClient}),s=OCA.Files.fileActions.getDefaultFileAction(t.mime,"file",OC.PERMISSION_ALL);s&&s.action(t.basename,{$file:null==o?void 0:o.findFileEl(this.name),dir:i,fileList:o,fileActions:null==o?void 0:o.fileActions,fileInfoModel:n}),this.close()}catch(t){this.logger.error("Error while creating the new file from template"),L.error(t),(0,h.x2)(this.t("files","Unable to create new file from template"))}finally{this.loading=!1}}}};var V=i(5103),O={};O.styleTagTransform=B(),O.setAttributes=I(),O.insert=S().bind(null,"head"),O.domAPI=_(),O.insertStyleElement=E(),C()(V.Z,O),V.Z&&V.Z.locals&&V.Z.locals;const Z=(0,T.Z)(U,(function(){var t=this,e=t._self._c;return t.opened?e("NcModal",{staticClass:"templates-picker",attrs:{"clear-view-delay":-1,size:"normal"},on:{close:t.close}},[e("form",{staticClass:"templates-picker__form",style:t.style,on:{submit:function(e){return e.preventDefault(),e.stopPropagation(),t.onSubmit.apply(null,arguments)}}},[e("h2",[t._v(t._s(t.t("files","Pick a template for {name}",{name:t.nameWithoutExt})))]),t._v(" "),e("ul",{staticClass:"templates-picker__list"},[e("TemplatePreview",t._b({attrs:{checked:t.checked===t.emptyTemplate.fileid},on:{check:t.onCheck}},"TemplatePreview",t.emptyTemplate,!1)),t._v(" "),t._l(t.provider.templates,(function(n){return e("TemplatePreview",t._b({key:n.fileid,attrs:{checked:t.checked===n.fileid,ratio:t.provider.ratio},on:{check:t.onCheck}},"TemplatePreview",n,!1))}))],2),t._v(" "),e("div",{staticClass:"templates-picker__buttons"},[e("button",{on:{click:t.close}},[t._v("\n\t\t\t\t"+t._s(t.t("files","Cancel"))+"\n\t\t\t")]),t._v(" "),e("input",{staticClass:"primary",attrs:{type:"submit","aria-label":t.t("files","Create a new file with the selected template")},domProps:{value:t.t("files","Create")}})])]),t._v(" "),t.loading?e("NcEmptyContent",{staticClass:"templates-picker__loading",attrs:{icon:"icon-loading"}},[t._v("\n\t\t"+t._s(t.t("files","Creating file"))+"\n\t")]):t._e()],1):t._e()}),[],!1,null,"715b4161",null).exports,q=(0,o.IY)().setApp("files").detectUser().build();u.default.mixin({methods:{t:r.Iu,n:r.uN}});const R=document.createElement("div");R.id="template-picker",document.body.appendChild(R);let j=(0,s.j)("files","templates",[]),M=(0,s.j)("files","templates_path",!1);q.debug("Templates providers",j),q.debug("Templates folder",{templatesPath:M});const $=new(u.default.extend(Z))({name:"TemplatePicker",propsData:{logger:q}});$.$mount("#template-picker"),window.addEventListener("DOMContentLoaded",(function(){if(!M){q.debug("Templates folder not initialized");const t={attach(t){t.addMenuEntry({id:"template-init",displayName:(0,r.Iu)("files","Set up templates folder"),templateName:(0,r.Iu)("files","Templates"),iconClass:"icon-template-add",fileType:"file",actionHandler(e){W(e),t.removeMenuEntry("template-init")}})}};OC.Plugins.register("OCA.Files.NewFileMenu",t)}})),j.forEach(((t,e)=>{const n={attach(n){const i=n.fileList;"files"!==i.id&&"files.public"!==i.id||n.addMenuEntry({id:"template-new-".concat(t.app,"-").concat(e),displayName:t.label,templateName:t.label+t.extension,iconClass:t.iconClass||"icon-file",fileType:"file",actionHandler(e){$.open(e,t)}})}};OC.Plugins.register("OCA.Files.NewFileMenu",n)}));const W=async function(t){const e=(c()+"/".concat(t)).replace("//","/");try{q.debug("Initializing the templates directory",{templatePath:e});const t=await d.default.post((0,a.generateOcsUrl)("apps/files/api/v1/templates/path"),{templatePath:e,copySystemTemplates:!0});OCA.Files.App.currentFileList.changeDirectory(e,!0,!0),j=t.data.ocs.data.templates,M=t.data.ocs.data.template_path}catch(t){q.error("Unable to initialize the templates directory"),(0,h.x2)((0,r.Iu)("files","Unable to initialize the templates directory"))}};var G=i(78595);!function(){const t={attach(t){(0,G.Ld)("nextcloud:unified-search.search",(e=>{let{query:n}=e;t.setFilter(n)})),(0,G.Ld)("nextcloud:unified-search.reset",(()=>{this.query=null,t.setFilter("")}))}};window.OC.Plugins.register("OCA.Files.FileList",t)}();var H=i(91770),K=i(78510);const Q=(0,o.IY)().setApp("files").detectUser().build();const Y=function(){return window._nc_fileactions||[]};var J;J=new class{constructor(t){var e,n,i;e=this,i=void 0,(n=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(n="_action"))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,this.validateAction(t),this._action=t}get id(){return this._action.id}get displayName(){return this._action.displayName}get iconSvgInline(){return this._action.iconSvgInline}get enabled(){return this._action.enabled}get exec(){return this._action.exec}get execBatch(){return this._action.execBatch}get order(){return this._action.order}get default(){return this._action.default}get inline(){return this._action.inline}get renderInline(){return this._action.renderInline}validateAction(t){if(!t.id||"string"!=typeof t.id)throw new Error("Invalid id");if(!t.displayName||"function"!=typeof t.displayName)throw new Error("Invalid displayName function");if(!t.iconSvgInline||"function"!=typeof t.iconSvgInline)throw new Error("Invalid iconSvgInline function");if(!t.exec||"function"!=typeof t.exec)throw new Error("Invalid exec function");if("enabled"in t&&"function"!=typeof t.enabled)throw new Error("Invalid enabled function");if("execBatch"in t&&"function"!=typeof t.execBatch)throw new Error("Invalid execBatch function");if("order"in t&&"number"!=typeof t.order)throw new Error("Invalid order");if("default"in t&&"boolean"!=typeof t.default)throw new Error("Invalid default");if("inline"in t&&"function"!=typeof t.inline)throw new Error("Invalid inline function");if("renderInline"in t&&"function"!=typeof t.renderInline)throw new Error("Invalid renderInline function")}}({id:"delete",displayName:(t,e)=>"trashbin"===e.id?(0,r.Iu)("files_trashbin","Delete permanently"):(0,r.Iu)("files","Delete"),iconSvgInline:()=>K,enabled:t=>t.length>0&&t.map((t=>t.permissions)).every((t=>0!=(t&H.y3.DELETE))),async exec(t){try{return await d.default.delete(t.source),(0,G.j8)("files:node:deleted",t),!0}catch(e){return Q.error("Error while deleting a file",{error:e,source:t.source,node:t}),!1}},async execBatch(t,e){return Promise.all(t.map((t=>this.exec(t,e))))},order:100}),void 0===window._nc_fileactions&&(window._nc_fileactions=[],Q.debug("FileActions initialized")),window._nc_fileactions.find((t=>t.id===J.id))?Q.error("FileAction ".concat(J.id," already registered"),{action:J}):window._nc_fileactions.push(J);var X=i(59305),tt=i(23664),et=i(69680),nt=i.n(et),it=i(10861),ot=i.n(it),st=i(64192),rt=i.n(st),at=i(33581);const lt=function(){const t=(0,X.Q_)("files",{state:()=>({files:{},roots:{}}),getters:{getNode:t=>e=>t.files[e],getNodes:t=>e=>e.map((e=>t.files[e])).filter(Boolean),getRoot:t=>e=>t.roots[e]},actions:{updateNodes(t){const e=t.reduce(((t,e)=>e.attributes.fileid?(t[e.attributes.fileid]=e,t):(Q.warn("Trying to update/set a node without fileid",e),t)),{});u.default.set(this,"files",{...this.files,...e})},deleteNodes(t){t.forEach((t=>{t.fileid&&u.default.delete(this.files,t.fileid)}))},setRoot(t){let{service:e,root:n}=t;u.default.set(this.roots,e,n)},onDeletedNode(t){this.deleteNodes([t])}}})(...arguments);return t._initialized||((0,G.Ld)("files:node:deleted",t.onDeletedNode),t._initialized=!0),t},ct=function(){const t=(0,X.Q_)("paths",{state:()=>({}),getters:{getPath:t=>(e,n)=>{if(t[e])return t[e][n]}},actions:{addPath(t){this[t.service]||u.default.set(this,t.service,{}),u.default.set(this[t.service],t.path,t.fileid)}}})(...arguments);return t._initialized||(t._initialized=!0),t},dt=(0,X.Q_)("selection",{state:()=>({selected:[],lastSelection:[],lastSelectedIndex:null}),actions:{set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];u.default.set(this,"selected",t)},setLastIndex(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;u.default.set(this,"lastSelection",t?this.selected:[]),u.default.set(this,"lastSelectedIndex",t)},reset(){u.default.set(this,"selected",[]),u.default.set(this,"lastSelection",[]),u.default.set(this,"lastSelectedIndex",null)}}}),ut=(0,s.j)("files","viewConfigs",{}),pt=function(){const t=(0,X.Q_)("viewconfig",{state:()=>({viewConfig:ut}),getters:{getConfig:t=>e=>t.viewConfig[e]||{}},actions:{onUpdate(t,e,n){this.viewConfig[t]||u.default.set(this.viewConfig,t,{}),u.default.set(this.viewConfig[t],e,n)},async update(t,e,n){d.default.put((0,a.generateUrl)("/apps/files/api/v1/views/".concat(t,"/").concat(e)),{value:n}),(0,G.j8)("files:viewconfig:updated",{view:t,key:e,value:n})},setSortingBy(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"basename",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"files";this.update(e,"sorting_mode",t),this.update(e,"sorting_direction","asc")},toggleSortingDirection(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"files";const e="asc"===(this.getConfig(t)||{sorting_direction:"asc"}).sorting_direction?"desc":"asc";this.update(t,"sorting_direction",e)}}}),e=t(...arguments);return e._initialized||((0,G.Ld)("files:viewconfig:updated",(function(t){let{view:n,key:i,value:o}=t;e.onUpdate(n,i,o)})),e._initialized=!0),e};var ht=i(15764),ft=i(64412),At=i.n(ft),vt=i(44706),mt=i.n(vt);const gt=u.default.extend({name:"BreadCrumbs",components:{Home:ht.Z,NcBreadcrumbs:mt(),NcBreadcrumb:At()},props:{path:{type:String,default:"/"}},setup:()=>({filesStore:lt(),pathsStore:ct()}),computed:{currentView(){return this.$navigation.active},dirs(){var t;return["/",...this.path.split("/").filter(Boolean).map((t="/",e=>t+="".concat(e,"/"))).map((t=>t.replace(/^(.+)\/$/,"$1")))]},sections(){return this.dirs.map((t=>{const e={...this.$route,query:{dir:t}};return{dir:t,exact:!0,name:this.getDirDisplayName(t),to:e}}))}},methods:{getNodeFromId(t){return this.filesStore.getNode(t)},getFileIdFromPath(t){var e;return this.pathsStore.getPath(null===(e=this.currentView)||void 0===e?void 0:e.id,t)},getDirDisplayName(e){var n;if("/"===e)return t("files","Home");const i=this.getFileIdFromPath(e),o=this.getNodeFromId(i);return(null==o||null===(n=o.attributes)||void 0===n?void 0:n.displayName)||(0,p.basename)(e)},onClick(t){var e;(null==t||null===(e=t.query)||void 0===e?void 0:e.dir)===this.$route.query.dir&&this.$emit("reload")},ariaLabel(e){var n,i;return(null==e||null===(n=e.to)||void 0===n||null===(i=n.query)||void 0===i?void 0:i.dir)===this.$route.query.dir?t("files","Reload current directory"):t("files",'Go to the "{dir}" directory',e)}}});var wt=i(39959),bt={};bt.styleTagTransform=B(),bt.setAttributes=I(),bt.insert=S().bind(null,"head"),bt.domAPI=_(),bt.insertStyleElement=E(),C()(wt.Z,bt),wt.Z&&wt.Z.locals&&wt.Z.locals;const Ct=(0,T.Z)(gt,(function(){var t=this,e=t._self._c;return t._self._setupProxy,e("NcBreadcrumbs",{attrs:{"data-cy-files-content-breadcrumbs":""}},t._l(t.sections,(function(n,i){return e("NcBreadcrumb",t._b({key:n.dir,attrs:{"aria-label":t.ariaLabel(n),title:t.ariaLabel(n)},nativeOn:{click:function(e){return t.onClick(n.to)}},scopedSlots:t._u([0===i?{key:"icon",fn:function(){return[e("Home",{attrs:{size:20}})]},proxy:!0}:null],null,!0)},"NcBreadcrumb",n,!1))})),1)}),[],!1,null,"68b3b20b",null).exports;var yt=i(35212),_t=i(20296),xt=i(74139),St=i(3443),kt=i.n(St),It=i(79855),Nt=i(34829),Et=i(45400),Ft=i.n(Et),Bt=i(12945),Pt=i.n(Bt),zt=i(20571),Tt=i.n(zt),Dt=i(4777);const Lt=(0,X.Q_)("actionsmenu",{state:()=>({opened:null})}),Ut=(0,s.j)("files","config",{show_hidden:!1,crop_image_previews:!0}),Vt=function(){const t=(0,X.Q_)("userconfig",{state:()=>({userConfig:Ut}),actions:{onUpdate(t,e){u.default.set(this.userConfig,t,e)},async update(t,e){await d.default.put((0,a.generateUrl)("/apps/files/api/v1/config/"+t),{value:e}),(0,G.j8)("files:config:updated",{key:t,value:e})}}})(...arguments);return t._initialized||((0,G.Ld)("files:config:updated",(function(e){let{key:n,value:i}=e;t.onUpdate(n,i)})),t._initialized=!0),t},Ot={name:"CustomElementRender",props:{source:{type:Object,required:!0},currentView:{type:Object,required:!0},render:{type:Function,required:!0}},computed:{element(){return this.render(this.source,this.currentView)}},watch:{element(){this.$el.replaceWith(this.element),this.$el=this.element}},mounted(){this.$el.replaceWith(this.element),this.$el=this.element}},Zt=(0,T.Z)(Ot,(function(){return(0,this._self._c)("span")}),[],!1,null,null,null).exports;var qt=i(27856);const Rt={name:"CustomSvgIconRender",props:{svg:{type:String,required:!0}},watch:{svg(){this.$el.innerHTML=(0,qt.sanitize)(this.svg)}},mounted(){this.$el.innerHTML=(0,qt.sanitize)(this.svg)}};var jt=i(61959),Mt={};Mt.styleTagTransform=B(),Mt.setAttributes=I(),Mt.insert=S().bind(null,"head"),Mt.domAPI=_(),Mt.insertStyleElement=E(),C()(jt.Z,Mt),jt.Z&&jt.Z.locals&&jt.Z.locals;const $t=(0,T.Z)(Rt,(function(){return(0,this._self._c)("span",{staticClass:"custom-svg-icon"})}),[],!1,null,"93e9b2f4",null).exports,Wt=Y(),Gt=u.default.extend({name:"FileEntry",components:{CustomElementRender:Zt,CustomSvgIconRender:$t,FileIcon:It.Z,FolderIcon:Nt.default,Fragment:xt.H,NcActionButton:Ft(),NcActions:Pt(),NcCheckboxRadioSwitch:Tt(),NcLoadingIcon:rt(),StarIcon:Dt.default},props:{active:{type:Boolean,default:!1},isSizeAvailable:{type:Boolean,default:!1},source:{type:Object,required:!0},index:{type:Number,required:!0},nodes:{type:Array,required:!0},filesListWidth:{type:Number,default:0}},setup(){const t=Lt(),e=lt(),n=function(){const t=(0,X.Q_)("keyboard",{state:()=>({altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1}),actions:{onEvent(t){t||(t=window.event),u.default.set(this,"altKey",!!t.altKey),u.default.set(this,"ctrlKey",!!t.ctrlKey),u.default.set(this,"metaKey",!!t.metaKey),u.default.set(this,"shiftKey",!!t.shiftKey)}}})(...arguments);return t._initialized||(window.addEventListener("keydown",t.onEvent),window.addEventListener("keyup",t.onEvent),window.addEventListener("mousemove",t.onEvent),t._initialized=!0),t}();return{actionsMenuStore:t,filesStore:e,keyboardStore:n,selectionStore:dt(),userConfigStore:Vt()}},data:()=>({backgroundFailed:!1,backgroundImage:"",boundariesElement:document.querySelector(".app-content > .files-list"),loading:""}),computed:{userConfig(){return this.userConfigStore.userConfig},currentView(){return this.$navigation.active},columns(){var t;return this.filesListWidth<512?[]:(null===(t=this.currentView)||void 0===t?void 0:t.columns)||[]},dir(){var t,e;return((null===(t=this.$route)||void 0===t||null===(e=t.query)||void 0===e?void 0:e.dir)||"/").replace(/^(.+)\/$/,"$1")},fileid(){var t,e,n;return null===(t=this.source)||void 0===t||null===(e=t.fileid)||void 0===e||null===(n=e.toString)||void 0===n?void 0:n.call(e)},displayName(){return this.source.attributes.displayName||this.source.basename},size(){const t=parseInt(this.source.size,10)||0;return"number"!=typeof t||t<0?this.t("files","Pending"):(0,H.sS)(t,!0)},sizeOpacity(){const t=parseInt(this.source.size,10)||0;return!t||t<0?1:.7+(1-.7)*Math.pow(this.source.size/10485760,2)},linkTo(){if(this.enabledDefaultActions.length>0)return{title:this.enabledDefaultActions[0].displayName([this.source],this.currentView),role:"button"};if("folder"===this.source.type){const t={...this.$route,query:{dir:(0,p.join)(this.dir,this.source.basename)}};return{is:"router-link",title:this.t("files","Open folder {name}",{name:this.displayName}),to:t}}return{href:this.source.source,title:this.t("files","Download file {name}",{name:this.displayName})}},selectedFiles(){return this.selectionStore.selected},isSelected(){var t,e,n;return this.selectedFiles.includes(null===(t=this.source)||void 0===t||null===(e=t.fileid)||void 0===e||null===(n=e.toString)||void 0===n?void 0:n.call(e))},cropPreviews(){return this.userConfig.crop_image_previews},previewUrl(){try{const t=new URL(window.location.origin+this.source.attributes.previewUrl);return t.searchParams.set("x","32"),t.searchParams.set("y","32"),t.searchParams.set("a",!0===this.cropPreviews?"0":"1"),t.href}catch(t){return null}},mimeIconUrl(){var t,e,n;const i=this.source.mime||"application/octet-stream",o=null===(t=window.OC)||void 0===t||null===(e=t.MimeType)||void 0===e||null===(n=e.getIconUrl)||void 0===n?void 0:n.call(e,i);return o?"url(".concat(o,")"):""},enabledActions(){return Wt.filter((t=>!t.enabled||t.enabled([this.source],this.currentView))).sort(((t,e)=>(t.order||0)-(e.order||0)))},enabledInlineActions(){return this.filesListWidth<768?[]:this.enabledActions.filter((t=>{var e;return null==t||null===(e=t.inline)||void 0===e?void 0:e.call(t,this.source,this.currentView)}))},enabledMenuActions(){if(this.filesListWidth<768)return this.enabledDefaultActions.length>0?this.enabledActions.slice(1):this.enabledActions;const t=[...this.enabledInlineActions,...this.enabledActions.filter((t=>!t.inline))];return this.enabledDefaultActions.length>0?t.slice(1):t},enabledDefaultActions(){return[...this.enabledActions.filter((t=>t.default))]},openedMenu:{get(){return this.actionsMenuStore.opened===this.uniqueId},set(t){this.actionsMenuStore.opened=t?this.uniqueId:null}},uniqueId(){return this.source.source.split("").reduce((function(t,e){return(t=(t<<5)-t+e.charCodeAt(0))&t}),0)},isFavorite(){return 1===this.source.attributes.favorite}},watch:{active(t,e){if(!1===t&&!0===e)return this.resetState(),void(this.$el.parentNode.style.display="none");this.$el.parentNode.style.display=""},previewUrl(){this.clearImg(),this.debounceIfNotCached()}},mounted(){var t,e;this.debounceGetPreview=(0,_t.debounce)((function(){this.fetchAndApplyPreview()}),150,!1),this.debounceIfNotCached(),null===(t=this.$el.parentNode)||void 0===t||null===(e=t.addEventListener)||void 0===e||e.call(t,"contextmenu",this.onRightClick)},beforeDestroy(){this.resetState()},methods:{async debounceIfNotCached(){var t;if(this.previewUrl)return await(t=this.previewUrl,caches.open("previews").then((function(e){return e.match(t).then((function(t){return!!t}))})))?(this.backgroundImage="url(".concat(this.previewUrl,")"),void(this.backgroundFailed=!1)):void this.debounceGetPreview()},fetchAndApplyPreview(){this.previewUrl&&(this.previewPromise&&this.clearImg(),this.previewPromise=new(kt())(((t,e,n)=>{const i=new Image;i.fetchpriority=this.active?"high":"auto",i.onload=()=>{this.backgroundImage="url(".concat(this.previewUrl,")"),this.backgroundFailed=!1,t(i)},i.onerror=()=>{this.backgroundFailed=!0,e(i)},i.src=this.previewUrl,n((()=>{i.onerror=null,i.onload=null,i.src=""}))})))},resetState(){this.loading="",this.clearImg(),this.openedMenu=!1},clearImg(){this.backgroundImage="",this.backgroundFailed=!1,this.previewPromise&&(this.previewPromise.cancel(),this.previewPromise=null)},async onActionClick(t){const e=t.displayName([this.source],this.currentView);try{this.loading=t.id,u.default.set(this.source,"_loading",!0);const n=await t.exec(this.source,this.currentView);if(null===n)return;if(n)return void(0,h.s$)(this.t("files",'"{displayName}" action executed successfully',{displayName:e}));(0,h.x2)(this.t("files",'"{displayName}" action failed',{displayName:e}))}catch(n){Q.error("Error while executing action",{action:t,e:n}),(0,h.x2)(this.t("files",'"{displayName}" action failed',{displayName:e}))}finally{this.loading="",u.default.set(this.source,"_loading",!1)}},execDefaultAction(t){this.enabledDefaultActions.length>0&&(t.preventDefault(),t.stopPropagation(),this.enabledDefaultActions[0].exec(this.source,this.currentView))},onSelectionChange(t){var e;const n=this.index,i=this.selectionStore.lastSelectedIndex;if(null!==(e=this.keyboardStore)&&void 0!==e&&e.shiftKey&&null!==i){const t=this.selectedFiles.includes(this.fileid),e=Math.min(n,i),o=Math.max(i,n),s=this.selectionStore.lastSelection,r=this.nodes.map((t=>{var e,n;return null===(e=t.fileid)||void 0===e||null===(n=e.toString)||void 0===n?void 0:n.call(e)})).slice(e,o+1),a=[...s,...r].filter((e=>!t||e!==this.fileid));return Q.debug("Shift key pressed, selecting all files in between",{start:e,end:o,filesToSelect:r,isAlreadySelected:t}),void this.selectionStore.set(a)}Q.debug("Updating selection",{selection:t}),this.selectionStore.set(t),this.selectionStore.setLastIndex(n)},onRightClick(t){if(this.openedMenu)return;const e=this.selectedFiles.length>1;this.actionsMenuStore.opened=this.isSelected&&e?"global":this.uniqueId,t.preventDefault(),t.stopPropagation()},t:r.Iu,formatFileSize:H.sS}}),Ht=Gt;var Kt=i(15925),Qt={};Qt.styleTagTransform=B(),Qt.setAttributes=I(),Qt.insert=S().bind(null,"head"),Qt.domAPI=_(),Qt.insertStyleElement=E(),C()(Kt.Z,Qt),Kt.Z&&Kt.Z.locals&&Kt.Z.locals;var Yt=i(6881),Jt={};Jt.styleTagTransform=B(),Jt.setAttributes=I(),Jt.insert=S().bind(null,"head"),Jt.domAPI=_(),Jt.insertStyleElement=E(),C()(Yt.Z,Jt),Yt.Z&&Yt.Z.locals&&Yt.Z.locals;var Xt=(0,T.Z)(Ht,(function(){var t=this,e=t._self._c;return t._self._setupProxy,e("Fragment",[e("td",{staticClass:"files-list__row-checkbox"},[t.active?e("NcCheckboxRadioSwitch",{attrs:{"aria-label":t.t("files","Select the row for {displayName}",{displayName:t.displayName}),checked:t.selectedFiles,value:t.fileid,name:"selectedFiles"},on:{"update:checked":t.onSelectionChange}}):t._e()],1),t._v(" "),e("td",{staticClass:"files-list__row-name"},[e("a",t._b({ref:"name",on:{click:t.execDefaultAction}},"a",t.linkTo,!1),[e("span",{staticClass:"files-list__row-icon"},["folder"===t.source.type?e("FolderIcon"):t.previewUrl&&!t.backgroundFailed?e("span",{ref:"previewImg",staticClass:"files-list__row-icon-preview",style:{backgroundImage:t.backgroundImage}}):t.mimeIconUrl?e("span",{staticClass:"files-list__row-icon-preview files-list__row-icon-preview--mime",style:{backgroundImage:t.mimeIconUrl}}):e("FileIcon"),t._v(" "),t.isFavorite?e("span",{staticClass:"files-list__row-icon-favorite",attrs:{"aria-label":t.t("files","Favorite")}},[e("StarIcon",{attrs:{"aria-hidden":"true",size:20}})],1):t._e()],1),t._v(" "),e("span",{staticClass:"files-list__row-name-text"},[t._v(t._s(t.displayName))])])]),t._v(" "),e("td",{staticClass:"files-list__row-actions",class:"files-list__row-actions-".concat(t.uniqueId)},[t.active?e("NcActions",{ref:"actionsMenu",attrs:{"boundaries-element":t.boundariesElement,container:t.boundariesElement,disabled:t.source._loading,"force-title":!0,inline:t.enabledInlineActions.length,open:t.openedMenu},on:{"update:open":function(e){t.openedMenu=e}}},t._l(t.enabledMenuActions,(function(n){return e("NcActionButton",{key:n.id,class:"files-list__row-action-"+n.id,on:{click:function(e){return t.onActionClick(n)}},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loading===n.id?e("NcLoadingIcon",{attrs:{size:18}}):e("CustomSvgIconRender",{attrs:{svg:n.iconSvgInline([t.source],t.currentView)}})]},proxy:!0}],null,!0)},[t._v("\n\t\t\t\t"+t._s(n.displayName([t.source],t.currentView))+"\n\t\t\t")])})),1):t._e()],1),t._v(" "),t.isSizeAvailable?e("td",{staticClass:"files-list__row-size",style:{opacity:t.sizeOpacity},on:{click:t.execDefaultAction}},[e("span",[t._v(t._s(t.size))])]):t._e(),t._v(" "),t._l(t.columns,(function(n){var i;return e("td",{key:n.id,staticClass:"files-list__row-column-custom",class:"files-list__row-".concat(null===(i=t.currentView)||void 0===i?void 0:i.id,"-").concat(n.id),on:{click:t.execDefaultAction}},[t.active?e("CustomElementRender",{attrs:{"current-view":t.currentView,render:n.render,source:t.source}}):t._e()],1)}))],2)}),[],!1,null,"4e6e4174",null);const te=Xt.exports,ee=u.default.extend({name:"FilesListFooter",components:{},props:{isSizeAvailable:{type:Boolean,default:!1},nodes:{type:Array,required:!0},summary:{type:String,default:""},filesListWidth:{type:Number,default:0}},setup(){const t=ct();return{filesStore:lt(),pathsStore:t}},computed:{currentView(){return this.$navigation.active},dir(){var t,e;return((null===(t=this.$route)||void 0===t||null===(e=t.query)||void 0===e?void 0:e.dir)||"/").replace(/^(.+)\/$/,"$1")},currentFolder(){var t;if(null===(t=this.currentView)||void 0===t||!t.id)return;if("/"===this.dir)return this.filesStore.getRoot(this.currentView.id);const e=this.pathsStore.getPath(this.currentView.id,this.dir);return this.filesStore.getNode(e)},columns(){var t;return this.filesListWidth<512?[]:(null===(t=this.currentView)||void 0===t?void 0:t.columns)||[]},totalSize(){var t;return null!==(t=this.currentFolder)&&void 0!==t&&t.size?(0,H.sS)(this.currentFolder.size,!0):(0,H.sS)(this.nodes.reduce(((t,e)=>t+e.size||0),0),!0)}},methods:{classForColumn(t){return{"files-list__row-column-custom":!0,["files-list__row-".concat(this.currentView.id,"-").concat(t.id)]:!0}},t:r.Iu}});var ne=i(97105),ie={};ie.styleTagTransform=B(),ie.setAttributes=I(),ie.insert=S().bind(null,"head"),ie.domAPI=_(),ie.insertStyleElement=E(),C()(ne.Z,ie),ne.Z&&ne.Z.locals&&ne.Z.locals;const oe=(0,T.Z)(ee,(function(){var t=this,e=t._self._c;return t._self._setupProxy,e("tr",[e("th",{staticClass:"files-list__row-checkbox"},[e("span",{staticClass:"hidden-visually"},[t._v(t._s(t.t("files","Total rows summary")))])]),t._v(" "),e("td",{staticClass:"files-list__row-name"},[e("span",{staticClass:"files-list__row-icon"}),t._v(" "),e("span",[t._v(t._s(t.summary))])]),t._v(" "),e("td",{staticClass:"files-list__row-actions"}),t._v(" "),t.isSizeAvailable?e("td",{staticClass:"files-list__column files-list__row-size"},[e("span",[t._v(t._s(t.totalSize))])]):t._e(),t._v(" "),t._l(t.columns,(function(n){var i;return e("th",{key:n.id,class:t.classForColumn(n)},[e("span",[t._v(t._s(null===(i=n.summary)||void 0===i?void 0:i.call(n,t.nodes,t.currentView)))])])}))],2)}),[],!1,null,"e6a083be",null).exports,se=u.default.extend({data:()=>({filesListWidth:null}),created(){const t=document.querySelector("#app-content-vue");this.$resizeObserver=new ResizeObserver((e=>{e.length>0&&e[0].target===t&&(this.filesListWidth=e[0].contentRect.width)})),this.$resizeObserver.observe(t)},beforeDestroy(){this.$resizeObserver.disconnect()}}),re=Y(),ae=u.default.extend({name:"FilesListHeaderActions",components:{CustomSvgIconRender:$t,NcActions:Pt(),NcActionButton:Ft(),NcLoadingIcon:rt()},mixins:[se],props:{currentView:{type:Object,required:!0},selectedNodes:{type:Array,default:()=>[]}},setup:()=>({actionsMenuStore:Lt(),filesStore:lt(),selectionStore:dt()}),data:()=>({loading:null}),computed:{enabledActions(){return re.filter((t=>t.execBatch)).filter((t=>!t.enabled||t.enabled(this.nodes,this.currentView))).sort(((t,e)=>(t.order||0)-(e.order||0)))},nodes(){return this.selectedNodes.map((t=>this.getNode(t))).filter((t=>t))},areSomeNodesLoading(){return this.nodes.some((t=>t._loading))},openedMenu:{get(){return"global"===this.actionsMenuStore.opened},set(t){this.actionsMenuStore.opened=t?"global":null}},inlineActions(){return this.filesListWidth<512?0:this.filesListWidth<768?1:this.filesListWidth<1024?2:3}},methods:{getNode(t){return this.filesStore.getNode(t)},async onActionClick(t){const e=t.displayName(this.nodes,this.currentView),n=this.selectedNodes;try{this.loading=t.id,this.nodes.forEach((t=>{u.default.set(t,"_loading",!0)}));const i=await t.execBatch(this.nodes,this.currentView);if(!i.some((t=>null!==t)))return void this.selectionStore.reset();if(i.some((t=>!1===t))){const t=n.filter(((t,e)=>!1===i[e]));return this.selectionStore.set(t),void(0,h.x2)(this.t("files",'"{displayName}" failed on some elements ',{displayName:e}))}(0,h.s$)(this.t("files",'"{displayName}" batch action executed successfully',{displayName:e})),this.selectionStore.reset()}catch(n){Q.error("Error while executing action",{action:t,e:n}),(0,h.x2)(this.t("files",'"{displayName}" action failed',{displayName:e}))}finally{this.loading=null,this.nodes.forEach((t=>{u.default.set(t,"_loading",!1)}))}},t:r.Iu}}),le=ae;var ce=i(60962),de={};de.styleTagTransform=B(),de.setAttributes=I(),de.insert=S().bind(null,"head"),de.domAPI=_(),de.insertStyleElement=E(),C()(ce.Z,de),ce.Z&&ce.Z.locals&&ce.Z.locals;var ue=(0,T.Z)(le,(function(){var t=this,e=t._self._c;return t._self._setupProxy,e("th",{staticClass:"files-list__column files-list__row-actions-batch",attrs:{colspan:"2"}},[e("NcActions",{ref:"actionsMenu",attrs:{disabled:!!t.loading||t.areSomeNodesLoading,"force-title":!0,inline:t.inlineActions,"menu-title":t.inlineActions<=1?t.t("files","Actions"):null,open:t.openedMenu},on:{"update:open":function(e){t.openedMenu=e}}},t._l(t.enabledActions,(function(n){return e("NcActionButton",{key:n.id,class:"files-list__row-actions-batch-"+n.id,on:{click:function(e){return t.onActionClick(n)}},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loading===n.id?e("NcLoadingIcon",{attrs:{size:18}}):e("CustomSvgIconRender",{attrs:{svg:n.iconSvgInline(t.nodes,t.currentView)}})]},proxy:!0}],null,!0)},[t._v("\n\t\t\t"+t._s(n.displayName(t.nodes,t.currentView))+"\n\t\t")])})),1)],1)}),[],!1,null,"76275b30",null);const pe=ue.exports;var he=i(20404),fe=i(23873);const Ae=u.default.extend({computed:{...(0,X.rn)(pt,["getConfig","setSortingBy","toggleSortingDirection"]),currentView(){return this.$navigation.active},sortingMode(){var t,e;return(null===(t=this.getConfig(this.currentView.id))||void 0===t?void 0:t.sorting_mode)||(null===(e=this.currentView)||void 0===e?void 0:e.defaultSortKey)||"basename"},isAscSorting(){var t;return"asc"===(null===(t=this.getConfig(this.currentView.id))||void 0===t?void 0:t.sorting_direction)}},methods:{toggleSortBy(t){this.sortingMode!==t?this.setSortingBy(t,this.currentView.id):this.toggleSortingDirection(this.currentView.id)}}}),ve=u.default.extend({name:"FilesListHeaderButton",components:{MenuDown:he.Z,MenuUp:fe.Z,NcButton:ot()},mixins:[Ae],props:{name:{type:String,required:!0},mode:{type:String,required:!0}},methods:{sortAriaLabel(t){const e=this.isAscSorting?this.t("files","ascending"):this.t("files","descending");return this.t("files","Sort list by {column} ({direction})",{column:t,direction:e})},t:r.Iu}});var me=i(29252),ge={};ge.styleTagTransform=B(),ge.setAttributes=I(),ge.insert=S().bind(null,"head"),ge.domAPI=_(),ge.insertStyleElement=E(),C()(me.Z,ge),me.Z&&me.Z.locals&&me.Z.locals;const we=(0,T.Z)(ve,(function(){var t=this,e=t._self._c;return t._self._setupProxy,e("NcButton",{staticClass:"files-list__column-sort-button",class:{"files-list__column-sort-button--active":t.sortingMode===t.mode},attrs:{"aria-label":t.sortAriaLabel(t.name),type:"tertiary"},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.toggleSortBy(t.mode)}}},[t.sortingMode!==t.mode||t.isAscSorting?e("MenuUp",{attrs:{slot:"icon"},slot:"icon"}):e("MenuDown",{attrs:{slot:"icon"},slot:"icon"}),t._v("\n\t"+t._s(t.name)+"\n")],1)}),[],!1,null,null,null).exports,be=u.default.extend({name:"FilesListHeader",components:{FilesListHeaderButton:we,NcCheckboxRadioSwitch:Tt(),FilesListHeaderActions:pe},mixins:[Ae],props:{isSizeAvailable:{type:Boolean,default:!1},nodes:{type:Array,required:!0},filesListWidth:{type:Number,default:0}},setup:()=>({filesStore:lt(),selectionStore:dt()}),computed:{currentView(){return this.$navigation.active},columns(){var t;return this.filesListWidth<512?[]:(null===(t=this.currentView)||void 0===t?void 0:t.columns)||[]},dir(){var t,e;return((null===(t=this.$route)||void 0===t||null===(e=t.query)||void 0===e?void 0:e.dir)||"/").replace(/^(.+)\/$/,"$1")},selectAllBind(){const t=this.isNoneSelected||this.isSomeSelected?this.t("files","Select all"):this.t("files","Unselect all");return{"aria-label":t,checked:this.isAllSelected,indeterminate:this.isSomeSelected,title:t}},selectedNodes(){return this.selectionStore.selected},isAllSelected(){return this.selectedNodes.length===this.nodes.length},isNoneSelected(){return 0===this.selectedNodes.length},isSomeSelected(){return!this.isAllSelected&&!this.isNoneSelected}},methods:{classForColumn(t){return{"files-list__column":!0,"files-list__column--sortable":!!t.sort,"files-list__row-column-custom":!0,["files-list__row-".concat(this.currentView.id,"-").concat(t.id)]:!0}},onToggleAll(t){if(t){const t=this.nodes.map((t=>t.attributes.fileid.toString()));Q.debug("Added all nodes to selection",{selection:t}),this.selectionStore.setLastIndex(null),this.selectionStore.set(t)}else Q.debug("Cleared selection"),this.selectionStore.reset()},t:r.Iu}});var Ce=i(8607),ye={};ye.styleTagTransform=B(),ye.setAttributes=I(),ye.insert=S().bind(null,"head"),ye.domAPI=_(),ye.insertStyleElement=E(),C()(Ce.Z,ye),Ce.Z&&Ce.Z.locals&&Ce.Z.locals;const _e=(0,T.Z)(be,(function(){var t=this,e=t._self._c;return t._self._setupProxy,e("tr",[e("th",{staticClass:"files-list__column files-list__row-checkbox"},[e("NcCheckboxRadioSwitch",t._b({on:{"update:checked":t.onToggleAll}},"NcCheckboxRadioSwitch",t.selectAllBind,!1))],1),t._v(" "),t.isNoneSelected?[e("th",{staticClass:"files-list__column files-list__row-name files-list__column--sortable",on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.toggleSortBy("basename")}}},[e("span",{staticClass:"files-list__row-icon"}),t._v(" "),e("FilesListHeaderButton",{attrs:{name:t.t("files","Name"),mode:"basename"}})],1),t._v(" "),e("th",{staticClass:"files-list__row-actions"}),t._v(" "),t.isSizeAvailable?e("th",{staticClass:"files-list__column files-list__row-size",class:{"files-list__column--sortable":t.isSizeAvailable}},[e("FilesListHeaderButton",{attrs:{name:t.t("files","Size"),mode:"size"}})],1):t._e(),t._v(" "),t._l(t.columns,(function(n){return e("th",{key:n.id,class:t.classForColumn(n)},[n.sort?e("FilesListHeaderButton",{attrs:{name:n.title,mode:n.id}}):e("span",[t._v("\n\t\t\t\t"+t._s(n.title)+"\n\t\t\t")])],1)}))]:e("FilesListHeaderActions",{attrs:{"current-view":t.currentView,"selected-nodes":t.selectedNodes}})],2)}),[],!1,null,"53698ce8",null).exports,xe=u.default.extend({name:"FilesListVirtual",components:{RecycleScroller:yt.EK,FileEntry:te,FilesListHeader:_e,FilesListFooter:oe},mixins:[se],props:{currentView:{type:Object,required:!0},nodes:{type:Array,required:!0}},data:()=>({FileEntry:te}),computed:{files(){return this.nodes.filter((t=>"file"===t.type))},summaryFile(){const t=this.files.length;return(0,r.uN)("files","{count} file","{count} files",t,{count:t})},summaryFolder(){const t=this.nodes.length-this.files.length;return(0,r.uN)("files","{count} folder","{count} folders",t,{count:t})},summary(){return(0,r.Iu)("files","{summaryFile} and {summaryFolder}",this)},isSizeAvailable(){return!(this.filesListWidth<768)&&this.nodes.some((t=>void 0!==t.attributes.size))}},mounted(){const t=this.$el.querySelectorAll(".vue-recycle-scroller__slot");t[0].setAttribute("role","thead"),t[1].setAttribute("role","tfoot")},methods:{getFileId:t=>t.attributes.fileid,t:r.Iu}});var Se=i(525),ke={};ke.styleTagTransform=B(),ke.setAttributes=I(),ke.insert=S().bind(null,"head"),ke.domAPI=_(),ke.insertStyleElement=E(),C()(Se.Z,ke),Se.Z&&Se.Z.locals&&Se.Z.locals;const Ie=(0,T.Z)(xe,(function(){var t=this,e=t._self._c;return t._self._setupProxy,e("RecycleScroller",{ref:"recycleScroller",staticClass:"files-list",attrs:{"key-field":"source",items:t.nodes,"item-size":55,"table-mode":!0,"item-class":"files-list__row","item-tag":"tr","list-class":"files-list__body","list-tag":"tbody",role:"table"},scopedSlots:t._u([{key:"default",fn:function(n){let{item:i,active:o,index:s}=n;return[e("FileEntry",{attrs:{active:o,index:s,"is-size-available":t.isSizeAvailable,"files-list-width":t.filesListWidth,nodes:t.nodes,source:i}})]}},{key:"before",fn:function(){return[e("caption",{staticClass:"hidden-visually"},[t._v("\n\t\t\t"+t._s(t.currentView.caption||"")+"\n\t\t\t"+t._s(t.t("files","This list is not fully rendered for performances reasons. The files will be rendered as you navigate through the list."))+"\n\t\t")]),t._v(" "),e("FilesListHeader",{attrs:{"files-list-width":t.filesListWidth,"is-size-available":t.isSizeAvailable,nodes:t.nodes}})]},proxy:!0},{key:"after",fn:function(){return[e("FilesListFooter",{attrs:{"files-list-width":t.filesListWidth,"is-size-available":t.isSizeAvailable,nodes:t.nodes,summary:t.summary}})]},proxy:!0}])})}),[],!1,null,"07b86e54",null).exports;var Ne=i(41487),Ee=i.n(Ne);function Fe(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Be=class{constructor(){Fe(this,"_views",[]),Fe(this,"_currentView",null),Q.debug("Navigation service initialized")}register(t){try{ze(t),Pe(t,this._views)}catch(e){throw e instanceof Error&&Q.error(e.message,{view:t}),e}t.legacy&&Q.warn("Legacy view detected, please migrate to Vue"),t.iconClass&&(t.legacy=!0),this._views.push(t)}get views(){return this._views}setActive(t){this._currentView=t}get active(){return this._currentView}},Pe=function(t,e){if(e.find((e=>e.id===t.id)))throw new Error("Navigation id ".concat(t.id," is already registered"));return!0},ze=function(t){if(!t.id||"string"!=typeof t.id)throw new Error("Navigation id is required and must be a string");if(!t.name||"string"!=typeof t.name)throw new Error("Navigation name is required and must be a string");if(!t.legacy){if(!t.getContents||"function"!=typeof t.getContents)throw new Error("Navigation getContents is required and must be a function");if(!t.icon||"string"!=typeof t.icon||!Ee()(t.icon))throw new Error("Navigation icon is required and must be a valid svg string")}if(!("order"in t)||"number"!=typeof t.order)throw new Error("Navigation order is required and must be a number");if(t.columns&&t.columns.forEach(Te),t.emptyView&&"function"!=typeof t.emptyView)throw new Error("Navigation emptyView must be a function");if(t.parent&&"string"!=typeof t.parent)throw new Error("Navigation parent must be a string");if("sticky"in t&&"boolean"!=typeof t.sticky)throw new Error("Navigation sticky must be a boolean");if("expanded"in t&&"boolean"!=typeof t.expanded)throw new Error("Navigation expanded must be a boolean");if(t.defaultSortKey&&"string"!=typeof t.defaultSortKey)throw new Error("Navigation defaultSortKey must be a string");return!0},Te=function(t){if(!t.id||"string"!=typeof t.id)throw new Error("A column id is required");if(!t.title||"string"!=typeof t.title)throw new Error("A column title is required");if(!t.render||"function"!=typeof t.render)throw new Error("A render function is required");if(t.sort&&"function"!=typeof t.sort)throw new Error("Column sortFunction must be a function");if(t.summary&&"function"!=typeof t.summary)throw new Error("Column summary must be a function");return!0},De=u.default.extend({name:"FilesList",components:{BreadCrumbs:Ct,FilesListVirtual:Ie,NcAppContent:nt(),NcButton:ot(),NcEmptyContent:A(),NcLoadingIcon:rt(),TrashCan:at.Z},mixins:[Ae],setup(){const t=ct();return{filesStore:lt(),pathsStore:t,selectionStore:dt(),viewConfigStore:pt()}},data:()=>({loading:!0,promise:null}),computed:{currentView(){return this.$navigation.active||this.$navigation.views.find((t=>"files"===t.id))},dir(){var t,e;return((null===(t=this.$route)||void 0===t||null===(e=t.query)||void 0===e?void 0:e.dir)||"/").replace(/^(.+)\/$/,"$1")},currentFolder(){var t;if(null===(t=this.currentView)||void 0===t||!t.id)return;if("/"===this.dir)return this.filesStore.getRoot(this.currentView.id);const e=this.pathsStore.getPath(this.currentView.id,this.dir);return this.filesStore.getNode(e)},dirContents(){var t,e;if(!this.currentView)return[];const n=((null===(t=this.currentView)||void 0===t?void 0:t.columns)||[]).find((t=>t.id===this.sortingMode));if(null!=n&&n.sort&&"function"==typeof n.sort){var i;const t=[...((null===(i=this.currentFolder)||void 0===i?void 0:i._children)||[]).map(this.getNode).filter((t=>t))].sort(n.sort);return this.isAscSorting?t:t.reverse()}return(0,tt.X)([...((null===(e=this.currentFolder)||void 0===e?void 0:e._children)||[]).map(this.getNode).filter((t=>t))],[..."basename"===this.sortingMode?[t=>"folder"!==t.type]:[],t=>t[this.sortingMode],t=>t.basename],this.isAscSorting?["asc","asc","asc"]:["desc","desc","desc"])},isEmptyDir(){return 0===this.dirContents.length},isRefreshing(){return void 0!==this.currentFolder&&!this.isEmptyDir&&this.loading},toPreviousDir(){const t=this.dir.split("/").slice(0,-1).join("/")||"/";return{...this.$route,query:{dir:t}}}},watch:{currentView(t,e){(null==t?void 0:t.id)!==(null==e?void 0:e.id)&&(Q.debug("View changed",{newView:t,oldView:e}),this.selectionStore.reset(),this.fetchContent())},dir(t,e){var n,i;Q.debug("Directory changed",{newDir:t,oldDir:e}),this.selectionStore.reset(),this.fetchContent(),null!==(n=this.$refs)&&void 0!==n&&null!==(i=n.filesListVirtual)&&void 0!==i&&i.$el&&(this.$refs.filesListVirtual.$el.scrollTop=0)}},methods:{async fetchContent(){var t,e;if(null!==(t=this.currentView)&&void 0!==t&&t.legacy)return;this.loading=!0;const n=this.dir,i=this.currentView;"function"==typeof(null===(e=this.promise)||void 0===e?void 0:e.cancel)&&(this.promise.cancel(),Q.debug("Cancelled previous ongoing fetch")),this.promise=i.getContents(n);try{const{folder:t,contents:e}=await this.promise;Q.debug("Fetched contents",{dir:n,folder:t,contents:e}),this.filesStore.updateNodes(e),t._children=e.map((t=>t.attributes.fileid)),"/"===n?this.filesStore.setRoot({service:i.id,root:t}):t.attributes.fileid?(this.filesStore.updateNodes([t]),this.pathsStore.addPath({service:i.id,fileid:t.attributes.fileid,path:n})):Q.error("Invalid root folder returned",{dir:n,folder:t,currentView:i}),e.filter((t=>"folder"===t.type)).forEach((t=>{this.pathsStore.addPath({service:i.id,fileid:t.attributes.fileid,path:(0,p.join)(n,t.basename)})}))}catch(t){Q.error("Error while fetching content",{error:t})}finally{this.loading=!1}},getNode(t){return this.filesStore.getNode(t)},t:r.Iu}});var Le=i(9756),Ue={};Ue.styleTagTransform=B(),Ue.setAttributes=I(),Ue.insert=S().bind(null,"head"),Ue.domAPI=_(),Ue.insertStyleElement=E(),C()(Le.Z,Ue),Le.Z&&Le.Z.locals&&Le.Z.locals;const Ve=(0,T.Z)(De,(function(){var t,e,n=this,i=n._self._c;return n._self._setupProxy,i("NcAppContent",{directives:[{name:"show",rawName:"v-show",value:!(null!==(t=n.currentView)&&void 0!==t&&t.legacy),expression:"!currentView?.legacy"}],class:{"app-content--hidden":null===(e=n.currentView)||void 0===e?void 0:e.legacy},attrs:{"data-cy-files-content":""}},[i("div",{staticClass:"files-list__header"},[i("BreadCrumbs",{attrs:{path:n.dir},on:{reload:n.fetchContent}}),n._v(" "),n.isRefreshing?i("NcLoadingIcon",{staticClass:"files-list__refresh-icon"}):n._e()],1),n._v(" "),n.loading&&!n.isRefreshing?i("NcLoadingIcon",{staticClass:"files-list__loading-icon",attrs:{size:38,title:n.t("files","Loading current folder")}}):!n.loading&&n.isEmptyDir?i("NcEmptyContent",{attrs:{title:n.t("files","No files in here"),description:n.t("files","No files or folders have been deleted yet"),"data-cy-files-content-empty":""},scopedSlots:n._u([{key:"action",fn:function(){return["/"!==n.dir?i("NcButton",{attrs:{"aria-label":"t('files', 'Go to the previous folder')",type:"primary",to:n.toPreviousDir}},[n._v("\n\t\t\t\t"+n._s(n.t("files","Go back"))+"\n\t\t\t")]):n._e()]},proxy:!0},{key:"icon",fn:function(){return[i("TrashCan")]},proxy:!0}])}):i("FilesListVirtual",{ref:"filesListVirtual",attrs:{"current-view":n.currentView,nodes:n.dirContents}})],1)}),[],!1,null,"7ef82237",null).exports;var Oe=i(57638),Ze=i(55209),qe=i.n(Ze),Re=i(14032),je=i.n(Re),Me=i(91211),$e=i.n(Me);var We=i(28615),Ge=i(74184),He=i(48959),Ke=i.n(He);const Qe={name:"NavigationQuota",components:{ChartPie:Ge.Z,NcAppNavigationItem:je(),NcProgressBar:Ke()},data:()=>({loadingStorageStats:!1,storageStats:(0,s.j)("files","storageStats",null)}),computed:{storageStatsTitle(){var t,e,n;const i=(0,H.sS)(null===(t=this.storageStats)||void 0===t?void 0:t.used),o=(0,H.sS)(null===(e=this.storageStats)||void 0===e?void 0:e.quota);return(null===(n=this.storageStats)||void 0===n?void 0:n.quota)<0?this.t("files","{usedQuotaByte} used",{usedQuotaByte:i}):this.t("files","{used} of {quota} used",{used:i,quota:o})},storageStatsTooltip(){return this.storageStats.relative?this.t("files","{relative}% used",this.storageStats):""}},beforeMount(){setInterval(this.throttleUpdateStorageStats,6e4),(0,G.Ld)("files:node:created",this.throttleUpdateStorageStats),(0,G.Ld)("files:node:deleted",this.throttleUpdateStorageStats),(0,G.Ld)("files:node:moved",this.throttleUpdateStorageStats),(0,G.Ld)("files:node:updated",this.throttleUpdateStorageStats)},methods:{debounceUpdateStorageStats:(0,We.D)(200,(function(t){this.updateStorageStats(t)})),throttleUpdateStorageStats:(0,We.P)(1e3,(function(t){this.updateStorageStats(t)})),async updateStorageStats(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!this.loadingStorageStats){this.loadingStorageStats=!0;try{var n;const t=await d.default.get((0,a.generateUrl)("/apps/files/api/v1/stats"));if(null==t||null===(n=t.data)||void 0===n||!n.data)throw new Error("Invalid storage stats");this.storageStats=t.data.data}catch(n){Q.error("Could not refresh storage stats",{error:n}),e&&(0,h.x2)(t("files","Could not refresh storage stats"))}finally{this.loadingStorageStats=!1}}},t:r.Iu}};var Ye=i(93582),Je={};Je.styleTagTransform=B(),Je.setAttributes=I(),Je.insert=S().bind(null,"head"),Je.domAPI=_(),Je.insertStyleElement=E(),C()(Ye.Z,Je),Ye.Z&&Ye.Z.locals&&Ye.Z.locals;const Xe=(0,T.Z)(Qe,(function(){var t=this,e=t._self._c;return t.storageStats?e("NcAppNavigationItem",{staticClass:"app-navigation-entry__settings-quota",class:{"app-navigation-entry__settings-quota--not-unlimited":t.storageStats.quota>=0},attrs:{"aria-label":t.t("files","Storage informations"),loading:t.loadingStorageStats,name:t.storageStatsTitle,title:t.storageStatsTooltip,"data-cy-files-navigation-settings-quota":""},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.debounceUpdateStorageStats.apply(null,arguments)}}},[e("ChartPie",{attrs:{slot:"icon",size:20},slot:"icon"}),t._v(" "),t.storageStats.quota>=0?e("NcProgressBar",{attrs:{slot:"extra",error:t.storageStats.relative>80,value:Math.min(t.storageStats.relative,100)},slot:"extra"}):t._e()],1):t._e()}),[],!1,null,"918797b2",null).exports;var tn=i(68988),en=i.n(tn),nn=i(16809),on=i.n(nn),sn=i(70386),rn=i(36029),an=i.n(rn);const ln={name:"Setting",props:{el:{type:Function,required:!0}},mounted(){this.$el.appendChild(this.el())}},cn=(0,T.Z)(ln,(function(){return(0,this._self._c)("div")}),[],!1,null,null,null).exports,dn={name:"Settings",components:{Clipboard:sn.Z,NcAppSettingsDialog:en(),NcAppSettingsSection:on(),NcCheckboxRadioSwitch:Tt(),NcInputField:an(),Setting:cn},props:{open:{type:Boolean,default:!1}},setup:()=>({userConfigStore:Vt()}),data(){var t,e,n,i;return{settings:(null===(t=window.OCA)||void 0===t||null===(e=t.Files)||void 0===e||null===(n=e.Settings)||void 0===n?void 0:n.settings)||[],webdavUrl:(0,a.generateRemoteUrl)("dav/files/"+encodeURIComponent(null===(i=(0,l.ts)())||void 0===i?void 0:i.uid)),webdavDocs:"https://docs.nextcloud.com/server/stable/go.php?to=user-webdav",appPasswordUrl:(0,a.generateUrl)("/settings/user/security#generate-app-token-section"),webdavUrlCopied:!1}},computed:{userConfig(){return this.userConfigStore.userConfig}},beforeMount(){this.settings.forEach((t=>t.open()))},beforeDestroy(){this.settings.forEach((t=>t.close()))},methods:{onClose(){this.$emit("close")},setConfig(t,e){this.userConfigStore.update(t,e)},async copyCloudId(){document.querySelector("input#webdav-url-input").select(),navigator.clipboard?(await navigator.clipboard.writeText(this.webdavUrl),this.webdavUrlCopied=!0,(0,h.s$)(t("files","WebDAV URL copied to clipboard")),setTimeout((()=>{this.webdavUrlCopied=!1}),5e3)):(0,h.x2)(t("files","Clipboard is not available"))},t:r.Iu}},un=dn;var pn=i(35662),hn={};hn.styleTagTransform=B(),hn.setAttributes=I(),hn.insert=S().bind(null,"head"),hn.domAPI=_(),hn.insertStyleElement=E(),C()(pn.Z,hn),pn.Z&&pn.Z.locals&&pn.Z.locals;const fn=(0,T.Z)(un,(function(){var t=this,e=t._self._c;return e("NcAppSettingsDialog",{attrs:{open:t.open,"show-navigation":!0,title:t.t("files","Files settings")},on:{"update:open":t.onClose}},[e("NcAppSettingsSection",{attrs:{id:"settings",title:t.t("files","Files settings")}},[e("NcCheckboxRadioSwitch",{attrs:{checked:t.userConfig.show_hidden},on:{"update:checked":function(e){return t.setConfig("show_hidden",e)}}},[t._v("\n\t\t\t"+t._s(t.t("files","Show hidden files"))+"\n\t\t")]),t._v(" "),e("NcCheckboxRadioSwitch",{attrs:{checked:t.userConfig.crop_image_previews},on:{"update:checked":function(e){return t.setConfig("crop_image_previews",e)}}},[t._v("\n\t\t\t"+t._s(t.t("files","Crop image previews"))+"\n\t\t")])],1),t._v(" "),0!==t.settings.length?e("NcAppSettingsSection",{attrs:{id:"more-settings",title:t.t("files","Additional settings")}},[t._l(t.settings,(function(t){return[e("Setting",{key:t.name,attrs:{el:t.el}})]}))],2):t._e(),t._v(" "),e("NcAppSettingsSection",{attrs:{id:"webdav",title:t.t("files","WebDAV")}},[e("NcInputField",{attrs:{id:"webdav-url-input","show-trailing-button":!0,success:t.webdavUrlCopied,"trailing-button-label":t.t("files","Copy to clipboard"),value:t.webdavUrl,readonly:"readonly",type:"url"},on:{focus:function(t){return t.target.select()},"trailing-button-click":t.copyCloudId},scopedSlots:t._u([{key:"trailing-button-icon",fn:function(){return[e("Clipboard",{attrs:{size:20}})]},proxy:!0}])}),t._v(" "),e("em",[e("a",{staticClass:"setting-link",attrs:{href:t.webdavDocs,target:"_blank",rel:"noreferrer noopener"}},[t._v("\n\t\t\t\t"+t._s(t.t("files","Use this address to access your Files via WebDAV"))+" ↗\n\t\t\t")])]),t._v(" "),e("br"),t._v(" "),e("em",[e("a",{staticClass:"setting-link",attrs:{href:t.appPasswordUrl}},[t._v("\n\t\t\t\t"+t._s(t.t("files","If you have enabled 2FA, you must create and use a new app password by clicking here."))+" ↗\n\t\t\t")])])],1)],1)}),[],!1,null,"76ca5d1f",null).exports,An={name:"Navigation",components:{Cog:Oe.default,NavigationQuota:Xe,NcAppNavigation:qe(),NcAppNavigationItem:je(),NcIconSvgWrapper:$e(),SettingsModal:fn},props:{Navigation:{type:Be,required:!0}},setup:()=>({viewConfigStore:pt()}),data:()=>({settingsOpened:!1}),computed:{currentViewId(){var t,e;return(null===(t=this.$route)||void 0===t||null===(e=t.params)||void 0===e?void 0:e.view)||"files"},currentView(){return this.views.find((t=>t.id===this.currentViewId))},views(){return this.Navigation.views},parentViews(){return this.views.filter((t=>!t.parent)).sort(((t,e)=>t.order-e.order))},childViews(){return this.views.filter((t=>!!t.parent)).reduce(((t,e)=>(t[e.parent]=[...t[e.parent]||[],e],t[e.parent].sort(((t,e)=>t.order-e.order)),t)),{})}},watch:{currentView(t,e){(null==t?void 0:t.id)!==(null==e?void 0:e.id)&&(this.Navigation.setActive(t),Q.debug("Navigation changed",{id:t.id,view:t}),this.showView(t,e))}},beforeMount(){this.currentView&&(Q.debug("Navigation mounted. Showing requested view",{view:this.currentView}),this.showView(this.currentView)),(0,G.Ld)("files:legacy-navigation:changed",this.onLegacyNavigationChanged),(0,G.Ld)("files:legacy-view:initialized",(()=>{Q.debug("Legacy view initialized",{...this.currentView}),this.showView(this.currentView)}))},methods:{showView(t,e){var n,i,o,s,r;if(null===(n=window)||void 0===n||null===(i=n.OCA)||void 0===i||null===(o=i.Files)||void 0===o||null===(s=o.Sidebar)||void 0===s||null===(r=s.close)||void 0===r||r.call(s),null!=t&&t.legacy){const e=document.querySelector("#app-content #app-content-"+this.currentView.id+".viewcontainer");document.querySelectorAll("#app-content .viewcontainer").forEach((t=>{t.classList.add("hidden")})),e.classList.remove("hidden");const{dir:n="/"}=OC.Util.History.parseUrlQuery(),i={itemId:t.id,dir:n};Q.debug("Triggering legacy navigation event",i),window.jQuery(e).trigger(new window.jQuery.Event("show",i)),window.jQuery(e).trigger(new window.jQuery.Event("urlChanged",i))}this.Navigation.setActive(t),function(t){const e=document.getElementById("page-heading-level-1");e&&(e.textContent=t)}(t.name),(0,G.j8)("files:navigation:changed",t)},onLegacyNavigationChanged(){let{id:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"files"};const e=this.Navigation.views.find((e=>e.id===t));e&&e.legacy&&e.id!==this.currentView.id&&(this.$router.replace({...this.$route,params:{view:e.id}}),this.Navigation.setActive(e),this.showView(e))},onToggleExpand(t){const e=this.isExpanded(t);t.expanded=!e,this.viewConfigStore.update(t.id,"expanded",!e)},isExpanded(t){var e;return"boolean"==typeof(null===(e=this.viewConfigStore.getConfig(t.id))||void 0===e?void 0:e.expanded)?!0===this.viewConfigStore.getConfig(t.id).expanded:!0===t.expanded},generateToNavigation(t){if(t.params){const{dir:e,fileid:n}=t.params;return{name:"filelist",params:t.params,query:{dir:e,fileid:n}}}return{name:"filelist",params:{view:t.id}}},openSettings(){this.settingsOpened=!0},onSettingsClose(){this.settingsOpened=!1},t:r.Iu}},vn=An;var mn=i(5304),gn={};gn.styleTagTransform=B(),gn.setAttributes=I(),gn.insert=S().bind(null,"head"),gn.domAPI=_(),gn.insertStyleElement=E(),C()(mn.Z,gn),mn.Z&&mn.Z.locals&&mn.Z.locals;const wn=(0,T.Z)(vn,(function(){var t=this,e=t._self._c;return e("NcAppNavigation",{attrs:{"data-cy-files-navigation":""},scopedSlots:t._u([{key:"list",fn:function(){return t._l(t.parentViews,(function(n){return e("NcAppNavigationItem",{key:n.id,attrs:{"allow-collapse":!0,"data-cy-files-navigation-item":n.id,icon:n.iconClass,open:t.isExpanded(n),pinned:n.sticky,title:n.name,to:t.generateToNavigation(n)},on:{"update:open":function(e){return t.onToggleExpand(n)}}},[n.icon?e("NcIconSvgWrapper",{attrs:{slot:"icon",svg:n.icon},slot:"icon"}):t._e(),t._v(" "),t._l(t.childViews[n.id],(function(i){return e("NcAppNavigationItem",{key:i.id,attrs:{"data-cy-files-navigation-item":i.id,exact:!0,icon:i.iconClass,title:i.name,to:t.generateToNavigation(i)}},[n.icon?e("NcIconSvgWrapper",{attrs:{slot:"icon",svg:n.icon},slot:"icon"}):t._e()],1)}))],2)}))},proxy:!0},{key:"footer",fn:function(){return[e("ul",{staticClass:"app-navigation-entry__settings"},[e("NavigationQuota"),t._v(" "),e("NcAppNavigationItem",{attrs:{"aria-label":t.t("files","Open the files app settings"),title:t.t("files","Files settings"),"data-cy-files-navigation-settings-button":""},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.openSettings.apply(null,arguments)}}},[e("Cog",{attrs:{slot:"icon",size:20},slot:"icon"})],1)],1)]},proxy:!0}])},[t._v(" "),t._v(" "),e("SettingsModal",{attrs:{open:t.settingsOpened,"data-cy-files-navigation-settings":""},on:{close:t.onSettingsClose}})],1)}),[],!1,null,"107b598a",null).exports,bn=function(t){let{id:e,name:n,order:i,icon:o,parent:s,classes:r="",expanded:a,params:l}=t;OCP.Files.Navigation.register({id:e,name:n,order:i,params:l,parent:s,expanded:!0===a,iconClass:o?"icon-".concat(o):"nav-icon-"+e,legacy:!0,sticky:r.includes("pinned")})};var Cn=i(78345),yn=i(17563);u.default.use(Cn.ZP);const _n=new Cn.ZP({mode:"history",base:(0,a.generateUrl)("/apps/files",""),linkActiveClass:"active",routes:[{path:"/",alias:"/files"},{path:"/:view/:fileid?",name:"filelist",props:!0}],stringifyQuery(t){const e=(0,yn.stringify)(t).replace(/%2F/gim,"/");return e?"?"+e:""}});function xn(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Sn,kn,In=i(25108);window.OCA.Files=null!==(Sn=window.OCA.Files)&&void 0!==Sn?Sn:{},window.OCP.Files=null!==(kn=window.OCP.Files)&&void 0!==kn?kn:{};const Nn=new class{constructor(t){var e,n,i;e=this,i=void 0,(n=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(n="_router"))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,this._router=t}goTo(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._router.push({path:t,replace:e})}goToRoute(t,e,n,i){return this._router.push({name:t,query:n,params:e,replace:i})}}(_n);Object.assign(window.OCP.Files,{Router:Nn}),u.default.use(X.og);const En=(0,X.WB)(),Fn=new Be;Object.assign(window.OCP.Files,{Navigation:Fn}),u.default.prototype.$navigation=Fn;const Bn=new class{constructor(){var t,e,n;t=this,n=void 0,(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e="_settings"))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,this._settings=[],In.debug("OCA.Files.Settings initialized")}register(t){return this._settings.filter((e=>e.name===t.name)).length>0?(In.error("A setting with the same name is already registered"),!1):(this._settings.push(t),!0)}get settings(){return this._settings}};Object.assign(window.OCA.Files,{Settings:Bn}),Object.assign(window.OCA.Files.Settings,{Setting:class{constructor(t,e){let{el:n,open:i,close:o}=e;xn(this,"_close",void 0),xn(this,"_el",void 0),xn(this,"_name",void 0),xn(this,"_open",void 0),this._name=t,this._el=n,this._open=i,this._close=o,"function"!=typeof this._open&&(this._open=()=>{}),"function"!=typeof this._close&&(this._close=()=>{})}get name(){return this._name}get el(){return this._el}get open(){return this._open}get close(){return this._close}}}),new(u.default.extend(wn))({name:"FilesNavigationRoot",propsData:{Navigation:Fn},router:_n,pinia:En}).$mount("#app-navigation-files"),new(u.default.extend(Ve))({name:"FilesListRoot",router:_n,pinia:En}).$mount("#app-content-vue"),function(){const t=Object.values((0,s.j)("files","navigation",{}));t.length>0&&(Q.debug("Legacy files views detected. Processing...",t),t.forEach((t=>{bn(t),t.sublist&&t.sublist.forEach((e=>bn({...e,parent:t.id})))})))}(),"serviceWorker"in navigator?window.addEventListener("load",(async()=>{try{const t=(0,a.generateUrl)("/apps/files/preview-service-worker.js",{},{noRewrite:!0}),e=await navigator.serviceWorker.register(t,{scope:"/"});Q.debug("SW registered: ",{registration:e})}catch(t){Q.error("SW registration failed: ",{error:t})}})):Q.debug("Service Worker is not enabled on this browser.")},39959:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".breadcrumb[data-v-68b3b20b]{flex:1 1 100% !important;width:100%}.breadcrumb[data-v-68b3b20b] a{cursor:pointer !important}","",{version:3,sources:["webpack://./apps/files/src/components/BreadCrumbs.vue"],names:[],mappings:"AACA,6BAEC,wBAAA,CACA,UAAA,CAEA,+BACC,yBAAA",sourcesContent:["\n.breadcrumb {\n\t// Take as much space as possible\n\tflex: 1 1 100% !important;\n\twidth: 100%;\n\n\t::v-deep a {\n\t\tcursor: pointer !important;\n\t}\n}\n\n"],sourceRoot:""}]);const a=r},61959:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".custom-svg-icon[data-v-93e9b2f4]{display:flex;align-items:center;align-self:center;justify-content:center;justify-self:center;width:44px;height:44px;opacity:1}.custom-svg-icon[data-v-93e9b2f4] svg{height:22px;width:22px;fill:currentColor}","",{version:3,sources:["webpack://./apps/files/src/components/CustomSvgIconRender.vue"],names:[],mappings:"AACA,kCACC,YAAA,CACA,kBAAA,CACA,iBAAA,CACA,sBAAA,CACA,mBAAA,CACA,UAAA,CACA,WAAA,CACA,SAAA,CAEA,sCAGC,WAAA,CACA,UAAA,CACA,iBAAA",sourcesContent:["\n.custom-svg-icon {\n\tdisplay: flex;\n\talign-items: center;\n\talign-self: center;\n\tjustify-content: center;\n\tjustify-self: center;\n\twidth: 44px;\n\theight: 44px;\n\topacity: 1;\n\n\t::v-deep svg {\n\t\t// mdi icons have a size of 24px\n\t\t// 22px results in roughly 16px inner size\n\t\theight: 22px;\n\t\twidth: 22px;\n\t\tfill: currentColor;\n\t}\n}\n\n"],sourceRoot:""}]);const a=r},15925:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,"tr[data-v-4e6e4174]:hover,tr[data-v-4e6e4174]:focus,tr[data-v-4e6e4174]:active{background-color:var(--color-background-dark)}.files-list__row-icon-preview[data-v-4e6e4174]:not([style*=background]){background:var(--color-loading-dark)}","",{version:3,sources:["webpack://./apps/files/src/components/FileEntry.vue"],names:[],mappings:"AAGC,+EAGC,6CAAA,CAKF,wEACI,oCAAA",sourcesContent:["\n/* Hover effect on tbody lines only */\ntr {\n\t&:hover,\n\t&:focus,\n\t&:active {\n\t\tbackground-color: var(--color-background-dark);\n\t}\n}\n\n/* Preview not loaded animation effect */\n.files-list__row-icon-preview:not([style*='background']) {\n background: var(--color-loading-dark);\n\t// animation: preview-gradient-fade 1.2s ease-in-out infinite;\n}\n"],sourceRoot:""}]);const a=r},97105:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,"tr[data-v-e6a083be]{padding-bottom:300px;border-top:1px solid var(--color-border);background-color:rgba(0,0,0,0) !important;border-bottom:none !important}td[data-v-e6a083be]{user-select:none;color:var(--color-text-maxcontrast) !important}","",{version:3,sources:["webpack://./apps/files/src/components/FilesListFooter.vue"],names:[],mappings:"AAEA,oBACC,oBAAA,CACA,wCAAA,CAEA,yCAAA,CACA,6BAAA,CAGD,oBACC,gBAAA,CAEA,8CAAA",sourcesContent:["\n// Scoped row\ntr {\n\tpadding-bottom: 300px;\n\tborder-top: 1px solid var(--color-border);\n\t// Prevent hover effect on the whole row\n\tbackground-color: transparent !important;\n\tborder-bottom: none !important;\n}\n\ntd {\n\tuser-select: none;\n\t// Make sure the cell colors don't apply to column headers\n\tcolor: var(--color-text-maxcontrast) !important;\n}\n\n"],sourceRoot:""}]);const a=r},8607:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".files-list__column[data-v-53698ce8]{user-select:none;color:var(--color-text-maxcontrast) !important}.files-list__column--sortable[data-v-53698ce8]{cursor:pointer}","",{version:3,sources:["webpack://./apps/files/src/components/FilesListHeader.vue"],names:[],mappings:"AACA,qCACC,gBAAA,CAEA,8CAAA,CAEA,+CACC,cAAA",sourcesContent:["\n.files-list__column {\n\tuser-select: none;\n\t// Make sure the cell colors don't apply to column headers\n\tcolor: var(--color-text-maxcontrast) !important;\n\n\t&--sortable {\n\t\tcursor: pointer;\n\t}\n}\n\n"],sourceRoot:""}]);const a=r},60962:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".files-list__row-actions-batch[data-v-76275b30]{flex:1 1 100% !important}.files-list__row-actions-batch[data-v-76275b30] .button-vue__wrapper{width:100%}.files-list__row-actions-batch[data-v-76275b30] .button-vue__wrapper span.button-vue__text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}","",{version:3,sources:["webpack://./apps/files/src/components/FilesListHeaderActions.vue"],names:[],mappings:"AACA,gDACC,wBAAA,CAGA,qEACC,UAAA,CACA,2FACC,eAAA,CACA,sBAAA,CACA,kBAAA",sourcesContent:["\n.files-list__row-actions-batch {\n\tflex: 1 1 100% !important;\n\n\t// Remove when https://github.com/nextcloud/nextcloud-vue/pull/3936 is merged\n\t::v-deep .button-vue__wrapper {\n\t\twidth: 100%;\n\t\tspan.button-vue__text {\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t}\n}\n"],sourceRoot:""}]);const a=r},29252:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".files-list__column-sort-button{margin:0 calc(var(--cell-margin)*-1);padding:0 4px 0 16px !important}.files-list__column-sort-button .button-vue__wrapper{flex-direction:row-reverse;width:100%}.files-list__column-sort-button .button-vue__icon{transition-timing-function:linear;transition-duration:.1s;transition-property:opacity;opacity:0}.files-list__column-sort-button .button-vue__text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.files-list__column-sort-button--active .button-vue__icon,.files-list__column-sort-button:hover .button-vue__icon,.files-list__column-sort-button:focus .button-vue__icon,.files-list__column-sort-button:active .button-vue__icon{opacity:1 !important}","",{version:3,sources:["webpack://./apps/files/src/components/FilesListHeaderButton.vue"],names:[],mappings:"AACA,gCAEC,oCAAA,CAEA,+BAAA,CAGA,qDACC,0BAAA,CAGA,UAAA,CAGD,kDACC,iCAAA,CACA,uBAAA,CACA,2BAAA,CACA,SAAA,CAID,kDACC,eAAA,CACA,kBAAA,CACA,sBAAA,CAOA,mOACC,oBAAA",sourcesContent:["\n.files-list__column-sort-button {\n\t// Compensate for cells margin\n\tmargin: 0 calc(var(--cell-margin) * -1);\n\t// Reverse padding\n\tpadding: 0 4px 0 16px !important;\n\n\t// Icon after text\n\t.button-vue__wrapper {\n\t\tflex-direction: row-reverse;\n\t\t// Take max inner width for text overflow ellipsis\n\t\t// Remove when https://github.com/nextcloud/nextcloud-vue/pull/3936 is merged\n\t\twidth: 100%;\n\t}\n\n\t.button-vue__icon {\n\t\ttransition-timing-function: linear;\n\t\ttransition-duration: .1s;\n\t\ttransition-property: opacity;\n\t\topacity: 0;\n\t}\n\n\t// Remove when https://github.com/nextcloud/nextcloud-vue/pull/3936 is merged\n\t.button-vue__text {\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t&--active,\n\t&:hover,\n\t&:focus,\n\t&:active {\n\t\t.button-vue__icon {\n\t\t\topacity: 1 !important;\n\t\t}\n\t}\n}\n"],sourceRoot:""}]);const a=r},525:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".files-list[data-v-07b86e54]{--row-height: 55px;--cell-margin: 14px;--checkbox-padding: calc((var(--row-height) - var(--checkbox-size)) / 2);--checkbox-size: 24px;--clickable-area: 44px;--icon-preview-size: 32px;display:block;overflow:auto;height:100%}.files-list[data-v-07b86e54] tbody,.files-list[data-v-07b86e54] .vue-recycle-scroller__slot{display:flex;flex-direction:column;width:100%;position:relative}.files-list[data-v-07b86e54] .vue-recycle-scroller__slot[role=thead]{position:sticky;z-index:10;top:0;height:var(--row-height);background-color:var(--color-main-background)}.files-list[data-v-07b86e54] tr{position:absolute;display:flex;align-items:center;width:100%;border-bottom:1px solid var(--color-border)}.files-list[data-v-07b86e54] td,.files-list[data-v-07b86e54] th{display:flex;align-items:center;flex:0 0 auto;justify-content:left;width:var(--row-height);height:var(--row-height);margin:0;padding:0;color:var(--color-text-maxcontrast);border:none}.files-list[data-v-07b86e54] td span,.files-list[data-v-07b86e54] th span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.files-list[data-v-07b86e54] .files-list__row-checkbox{justify-content:center}.files-list[data-v-07b86e54] .files-list__row-checkbox .checkbox-radio-switch{display:flex;justify-content:center;--icon-size: var(--checkbox-size)}.files-list[data-v-07b86e54] .files-list__row-checkbox .checkbox-radio-switch label.checkbox-radio-switch__label{width:var(--clickable-area);height:var(--clickable-area);margin:0;padding:calc((var(--clickable-area) - var(--checkbox-size))/2)}.files-list[data-v-07b86e54] .files-list__row-checkbox .checkbox-radio-switch .checkbox-radio-switch__icon{margin:0 !important}.files-list[data-v-07b86e54] .files-list__row-icon{display:flex;align-items:center;justify-content:center;width:var(--icon-preview-size);height:100%;margin-right:var(--checkbox-padding);color:var(--color-primary-element);flex:0 0 var(--icon-preview-size)}.files-list[data-v-07b86e54] .files-list__row-icon>span{justify-content:flex-start}.files-list[data-v-07b86e54] .files-list__row-icon svg{width:var(--icon-preview-size);height:var(--icon-preview-size)}.files-list[data-v-07b86e54] .files-list__row-icon-preview{overflow:hidden;width:var(--icon-preview-size);height:var(--icon-preview-size);border-radius:var(--border-radius);background-repeat:no-repeat;background-position:center;background-size:contain}.files-list[data-v-07b86e54] .files-list__row-name{overflow:hidden;flex:1 1 auto}.files-list[data-v-07b86e54] .files-list__row-name a{display:flex;align-items:center;width:100%;height:100%}.files-list[data-v-07b86e54] .files-list__row-name a:focus .files-list__row-name-text,.files-list[data-v-07b86e54] .files-list__row-name a:focus-visible .files-list__row-name-text{outline:2px solid var(--color-main-text) !important;border-radius:20px}.files-list[data-v-07b86e54] .files-list__row-name .files-list__row-name-text{padding:5px 10px;margin-left:-10px}.files-list[data-v-07b86e54] .files-list__row-actions{width:auto}.files-list[data-v-07b86e54] .files-list__row-actions~td,.files-list[data-v-07b86e54] .files-list__row-actions~th{margin:0 var(--cell-margin)}.files-list[data-v-07b86e54] .files-list__row-actions button .button-vue__text{font-weight:normal}.files-list[data-v-07b86e54] .files-list__row-actions button:not(:hover,:focus,:active) .button-vue__wrapper{color:var(--color-text-maxcontrast)}.files-list[data-v-07b86e54] .files-list__row-size{justify-content:flex-end;width:calc(var(--row-height)*1.5);color:var(--color-main-text)}.files-list[data-v-07b86e54] .files-list__row-size .files-list__column-sort-button{padding:0 16px 0 4px !important}.files-list[data-v-07b86e54] .files-list__row-size .files-list__column-sort-button .button-vue__wrapper{flex-direction:row}.files-list[data-v-07b86e54] .files-list__row-column-custom{width:calc(var(--row-height)*2)}","",{version:3,sources:["webpack://./apps/files/src/components/FilesListVirtual.vue"],names:[],mappings:"AACA,6BACC,kBAAA,CACA,mBAAA,CAEA,wEAAA,CACA,qBAAA,CACA,sBAAA,CACA,yBAAA,CAEA,aAAA,CACA,aAAA,CACA,WAAA,CAIC,4FACC,YAAA,CACA,qBAAA,CACA,UAAA,CAEA,iBAAA,CAID,qEAEC,eAAA,CACA,UAAA,CACA,KAAA,CACA,wBAAA,CACA,6CAAA,CAGD,gCACC,iBAAA,CACA,YAAA,CACA,kBAAA,CACA,UAAA,CACA,2CAAA,CAGD,gEACC,YAAA,CACA,kBAAA,CACA,aAAA,CACA,oBAAA,CACA,uBAAA,CACA,wBAAA,CACA,QAAA,CACA,SAAA,CACA,mCAAA,CACA,WAAA,CAKA,0EACC,eAAA,CACA,kBAAA,CACA,sBAAA,CAIF,uDACC,sBAAA,CACA,8EACC,YAAA,CACA,sBAAA,CAEA,iCAAA,CAEA,iHACC,2BAAA,CACA,4BAAA,CACA,QAAA,CACA,8DAAA,CAGD,2GACC,mBAAA,CAKH,mDACC,YAAA,CACA,kBAAA,CACA,sBAAA,CACA,8BAAA,CACA,WAAA,CAEA,oCAAA,CACA,kCAAA,CAEA,iCAAA,CAEA,wDACC,0BAAA,CAGD,uDACC,8BAAA,CACA,+BAAA,CAGD,2DACC,eAAA,CACA,8BAAA,CACA,+BAAA,CACA,kCAAA,CACA,2BAAA,CAEA,0BAAA,CACA,uBAAA,CAIF,mDAEC,eAAA,CAEA,aAAA,CAEA,qDACC,YAAA,CACA,kBAAA,CAEA,UAAA,CACA,WAAA,CAGA,oLAEC,mDAAA,CACA,kBAAA,CAIF,8EAEC,gBAAA,CACA,iBAAA,CAIF,sDACC,UAAA,CAGA,kHAEC,2BAAA,CAIA,+EAEC,kBAAA,CAED,6GAEC,mCAAA,CAKH,mDAEC,wBAAA,CACA,iCAAA,CAEA,4BAAA,CAGA,mFACC,+BAAA,CACA,wGACC,kBAAA,CAKH,4DACC,+BAAA",sourcesContent:["\n.files-list {\n\t--row-height: 55px;\n\t--cell-margin: 14px;\n\n\t--checkbox-padding: calc((var(--row-height) - var(--checkbox-size)) / 2);\n\t--checkbox-size: 24px;\n\t--clickable-area: 44px;\n\t--icon-preview-size: 32px;\n\n\tdisplay: block;\n\toverflow: auto;\n\theight: 100%;\n\n\t&::v-deep {\n\t\t// Table head, body and footer\n\t\ttbody, .vue-recycle-scroller__slot {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\twidth: 100%;\n\t\t\t// Necessary for virtual scrolling absolute\n\t\t\tposition: relative;\n\t\t}\n\n\t\t// Table header\n\t\t.vue-recycle-scroller__slot[role='thead'] {\n\t\t\t// Pinned on top when scrolling\n\t\t\tposition: sticky;\n\t\t\tz-index: 10;\n\t\t\ttop: 0;\n\t\t\theight: var(--row-height);\n\t\t\tbackground-color: var(--color-main-background);\n\t\t}\n\n\t\ttr {\n\t\t\tposition: absolute;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\twidth: 100%;\n\t\t\tborder-bottom: 1px solid var(--color-border);\n\t\t}\n\n\t\ttd, th {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tflex: 0 0 auto;\n\t\t\tjustify-content: left;\n\t\t\twidth: var(--row-height);\n\t\t\theight: var(--row-height);\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t\tborder: none;\n\n\t\t\t// Columns should try to add any text\n\t\t\t// node wrapped in a span. That should help\n\t\t\t// with the ellipsis on overflow.\n\t\t\tspan {\n\t\t\t\toverflow: hidden;\n\t\t\t\twhite-space: nowrap;\n\t\t\t\ttext-overflow: ellipsis;\n\t\t\t}\n\t\t}\n\n\t\t.files-list__row-checkbox {\n\t\t\tjustify-content: center;\n\t\t\t.checkbox-radio-switch {\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\n\t\t\t\t--icon-size: var(--checkbox-size);\n\n\t\t\t\tlabel.checkbox-radio-switch__label {\n\t\t\t\t\twidth: var(--clickable-area);\n\t\t\t\t\theight: var(--clickable-area);\n\t\t\t\t\tmargin: 0;\n\t\t\t\t\tpadding: calc((var(--clickable-area) - var(--checkbox-size)) / 2);\n\t\t\t\t}\n\n\t\t\t\t.checkbox-radio-switch__icon {\n\t\t\t\t\tmargin: 0 !important;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t.files-list__row-icon {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: var(--icon-preview-size);\n\t\t\theight: 100%;\n\t\t\t// Show same padding as the checkbox right padding for visual balance\n\t\t\tmargin-right: var(--checkbox-padding);\n\t\t\tcolor: var(--color-primary-element);\n\t\t\t// No shrinking or growing allowed\n\t\t\tflex: 0 0 var(--icon-preview-size);\n\n\t\t\t& > span {\n\t\t\t\tjustify-content: flex-start;\n\t\t\t}\n\n\t\t\tsvg {\n\t\t\t\twidth: var(--icon-preview-size);\n\t\t\t\theight: var(--icon-preview-size);\n\t\t\t}\n\n\t\t\t&-preview {\n\t\t\t\toverflow: hidden;\n\t\t\t\twidth: var(--icon-preview-size);\n\t\t\t\theight: var(--icon-preview-size);\n\t\t\t\tborder-radius: var(--border-radius);\n\t\t\t\tbackground-repeat: no-repeat;\n\t\t\t\t// Center and contain the preview\n\t\t\t\tbackground-position: center;\n\t\t\t\tbackground-size: contain;\n\t\t\t}\n\t\t}\n\n\t\t.files-list__row-name {\n\t\t\t// Prevent link from overflowing\n\t\t\toverflow: hidden;\n\t\t\t// Take as much space as possible\n\t\t\tflex: 1 1 auto;\n\n\t\t\ta {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\t// Fill cell height and width\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\n\t\t\t\t// Keyboard indicator a11y\n\t\t\t\t&:focus .files-list__row-name-text,\n\t\t\t\t&:focus-visible .files-list__row-name-text {\n\t\t\t\t\toutline: 2px solid var(--color-main-text) !important;\n\t\t\t\t\tborder-radius: 20px;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.files-list__row-name-text {\n\t\t\t\t// Make some space for the outline\n\t\t\t\tpadding: 5px 10px;\n\t\t\t\tmargin-left: -10px;\n\t\t\t}\n\t\t}\n\n\t\t.files-list__row-actions {\n\t\t\twidth: auto;\n\n\t\t\t// Add margin to all cells after the actions\n\t\t\t& ~ td,\n\t\t\t& ~ th {\n\t\t\t\tmargin: 0 var(--cell-margin);\n\t\t\t}\n\n\t\t\tbutton {\n\t\t\t\t.button-vue__text {\n\t\t\t\t\t// Remove bold from default button styling\n\t\t\t\t\tfont-weight: normal;\n\t\t\t\t}\n\t\t\t\t&:not(:hover, :focus, :active) .button-vue__wrapper {\n\t\t\t\t\t// Also apply color-text-maxcontrast to non-active button\n\t\t\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t.files-list__row-size {\n\t\t\t// Right align text\n\t\t\tjustify-content: flex-end;\n\t\t\twidth: calc(var(--row-height) * 1.5);\n\t\t\t// opacity varies with the size\n\t\t\tcolor: var(--color-main-text);\n\n\t\t\t// Icon is before text since size is right aligned\n\t\t\t.files-list__column-sort-button {\n\t\t\t\tpadding: 0 16px 0 4px !important;\n\t\t\t\t.button-vue__wrapper {\n\t\t\t\t\tflex-direction: row;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t.files-list__row-column-custom {\n\t\t\twidth: calc(var(--row-height) * 2);\n\t\t}\n\t}\n}\n"],sourceRoot:""}]);const a=r},93582:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".app-navigation-entry__settings-quota--not-unlimited[data-v-918797b2] .app-navigation-entry__title{margin-top:-4px}.app-navigation-entry__settings-quota progress[data-v-918797b2]{position:absolute;bottom:10px;margin-left:44px;width:calc(100% - 44px - 22px)}","",{version:3,sources:["webpack://./apps/files/src/components/NavigationQuota.vue"],names:[],mappings:"AAIC,mGACC,eAAA,CAGD,gEACC,iBAAA,CACA,WAAA,CACA,gBAAA,CACA,8BAAA",sourcesContent:["\n// User storage stats display\n.app-navigation-entry__settings-quota {\n\t// Align title with progress and icon\n\t&--not-unlimited::v-deep .app-navigation-entry__title {\n\t\tmargin-top: -4px;\n\t}\n\n\tprogress {\n\t\tposition: absolute;\n\t\tbottom: 10px;\n\t\tmargin-left: 44px;\n\t\twidth: calc(100% - 44px - 22px);\n\t}\n}\n"],sourceRoot:""}]);const a=r},3491:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".template-picker__item[data-v-6c072a31]{display:flex}.template-picker__label[data-v-6c072a31]{display:flex;align-items:center;flex:1 1;flex-direction:column}.template-picker__label[data-v-6c072a31],.template-picker__label *[data-v-6c072a31]{cursor:pointer;user-select:none}.template-picker__label[data-v-6c072a31]::before{display:none !important}.template-picker__preview[data-v-6c072a31]{display:block;overflow:hidden;flex:1 1;width:var(--width);min-height:var(--height);max-height:var(--height);padding:0;border:var(--border) solid var(--color-border);border-radius:var(--border-radius-large)}input:checked+label>.template-picker__preview[data-v-6c072a31]{border-color:var(--color-primary)}.template-picker__preview--failed[data-v-6c072a31]{display:flex}.template-picker__image[data-v-6c072a31]{max-width:100%;background-color:var(--color-main-background);object-fit:cover}.template-picker__preview--failed .template-picker__image[data-v-6c072a31]{width:calc(var(--margin)*8);margin:auto;background-color:rgba(0,0,0,0) !important;object-fit:initial}.template-picker__title[data-v-6c072a31]{overflow:hidden;max-width:calc(var(--width) + 4px);padding:var(--margin);white-space:nowrap;text-overflow:ellipsis}","",{version:3,sources:["webpack://./apps/files/src/components/TemplatePreview.vue"],names:[],mappings:"AAGC,wCACC,YAAA,CAGD,yCACC,YAAA,CAEA,kBAAA,CACA,QAAA,CACA,qBAAA,CAEA,oFACC,cAAA,CACA,gBAAA,CAGD,iDACC,uBAAA,CAIF,2CACC,aAAA,CACA,eAAA,CAEA,QAAA,CACA,kBAAA,CACA,wBAAA,CACA,wBAAA,CACA,SAAA,CACA,8CAAA,CACA,wCAAA,CAEA,+DACC,iCAAA,CAGD,mDAEC,YAAA,CAIF,yCACC,cAAA,CACA,6CAAA,CAEA,gBAAA,CAID,2EACC,2BAAA,CAEA,WAAA,CACA,yCAAA,CAEA,kBAAA,CAGD,yCACC,eAAA,CAEA,kCAAA,CACA,qBAAA,CACA,kBAAA,CACA,sBAAA",sourcesContent:["\n\n.template-picker {\n\t&__item {\n\t\tdisplay: flex;\n\t}\n\n\t&__label {\n\t\tdisplay: flex;\n\t\t// Align in the middle of the grid\n\t\talign-items: center;\n\t\tflex: 1 1;\n\t\tflex-direction: column;\n\n\t\t&, * {\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t}\n\n\t\t&::before {\n\t\t\tdisplay: none !important;\n\t\t}\n\t}\n\n\t&__preview {\n\t\tdisplay: block;\n\t\toverflow: hidden;\n\t\t// Stretch so all entries are the same width\n\t\tflex: 1 1;\n\t\twidth: var(--width);\n\t\tmin-height: var(--height);\n\t\tmax-height: var(--height);\n\t\tpadding: 0;\n\t\tborder: var(--border) solid var(--color-border);\n\t\tborder-radius: var(--border-radius-large);\n\n\t\tinput:checked + label > & {\n\t\t\tborder-color: var(--color-primary);\n\t\t}\n\n\t\t&--failed {\n\t\t\t// Make sure to properly center fallback icon\n\t\t\tdisplay: flex;\n\t\t}\n\t}\n\n\t&__image {\n\t\tmax-width: 100%;\n\t\tbackground-color: var(--color-main-background);\n\n\t\tobject-fit: cover;\n\t}\n\n\t// Failed preview, fallback to mime icon\n\t&__preview--failed &__image {\n\t\twidth: calc(var(--margin) * 8);\n\t\t// Center mime icon\n\t\tmargin: auto;\n\t\tbackground-color: transparent !important;\n\n\t\tobject-fit: initial;\n\t}\n\n\t&__title {\n\t\toverflow: hidden;\n\t\t// also count preview border\n\t\tmax-width: calc(var(--width) + 2*2px);\n\t\tpadding: var(--margin);\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n}\n\n"],sourceRoot:""}]);const a=r},9756:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".app-content[data-v-7ef82237]{display:flex;overflow:hidden;flex-direction:column;max-height:100%}.app-content[data-v-7ef82237]:not(.app-content--hidden)+#app-content{display:none}.files-list__header[data-v-7ef82237]{display:flex;align-content:center;flex:0 0;margin:4px 4px 4px 50px}.files-list__header>*[data-v-7ef82237]{flex:0 0}.files-list__refresh-icon[data-v-7ef82237]{flex:0 0 44px;width:44px;height:44px}.files-list__loading-icon[data-v-7ef82237]{margin:auto}","",{version:3,sources:["webpack://./apps/files/src/views/FilesList.vue"],names:[],mappings:"AACA,8BAEC,YAAA,CACA,eAAA,CACA,qBAAA,CACA,eAAA,CAIA,qEACC,YAAA,CAQD,qCACC,YAAA,CACA,oBAAA,CAEA,QAAA,CAEA,uBAAA,CACA,uCAGC,QAAA,CAGF,2CACC,aAAA,CACA,UAAA,CACA,WAAA,CAED,2CACC,WAAA",sourcesContent:["\n.app-content {\n\t// Virtual list needs to be full height and is scrollable\n\tdisplay: flex;\n\toverflow: hidden;\n\tflex-direction: column;\n\tmax-height: 100%;\n\n\t// TODO: remove after all legacy views are migrated\n\t// Hides the legacy app-content if shown view is not legacy\n\t&:not(&--hidden)::v-deep + #app-content {\n\t\tdisplay: none;\n\t}\n}\n\n$margin: 4px;\n$navigationToggleSize: 50px;\n\n.files-list {\n\t&__header {\n\t\tdisplay: flex;\n\t\talign-content: center;\n\t\t// Do not grow or shrink (vertically)\n\t\tflex: 0 0;\n\t\t// Align with the navigation toggle icon\n\t\tmargin: $margin $margin $margin $navigationToggleSize;\n\t\t> * {\n\t\t\t// Do not grow or shrink (horizontally)\n\t\t\t// Only the breadcrumbs shrinks\n\t\t\tflex: 0 0;\n\t\t}\n\t}\n\t&__refresh-icon {\n\t\tflex: 0 0 44px;\n\t\twidth: 44px;\n\t\theight: 44px;\n\t}\n\t&__loading-icon {\n\t\tmargin: auto;\n\t}\n}\n\n"],sourceRoot:""}]);const a=r},5304:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".app-navigation[data-v-107b598a] .app-navigation-entry-icon{background-repeat:no-repeat;background-position:center}.app-navigation>ul.app-navigation__list[data-v-107b598a]{padding-bottom:var(--default-grid-baseline, 4px)}.app-navigation-entry__settings[data-v-107b598a]{height:auto !important;overflow:hidden !important;padding-top:0 !important;flex:0 0 auto}","",{version:3,sources:["webpack://./apps/files/src/views/Navigation.vue"],names:[],mappings:"AAEA,4DACC,2BAAA,CACA,0BAAA,CAGD,yDAEC,gDAAA,CAGD,iDACC,sBAAA,CACA,0BAAA,CACA,wBAAA,CAEA,aAAA",sourcesContent:["\n// TODO: remove when https://github.com/nextcloud/nextcloud-vue/pull/3539 is in\n.app-navigation::v-deep .app-navigation-entry-icon {\n\tbackground-repeat: no-repeat;\n\tbackground-position: center;\n}\n\n.app-navigation > ul.app-navigation__list {\n\t// Use flex gap value for more elegant spacing\n\tpadding-bottom: var(--default-grid-baseline, 4px);\n}\n\n.app-navigation-entry__settings {\n\theight: auto !important;\n\toverflow: hidden !important;\n\tpadding-top: 0 !important;\n\t// Prevent shrinking or growing\n\tflex: 0 0 auto;\n}\n"],sourceRoot:""}]);const a=r},35662:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".setting-link[data-v-76ca5d1f]:hover{text-decoration:underline}","",{version:3,sources:["webpack://./apps/files/src/views/Settings.vue"],names:[],mappings:"AACA,qCACC,yBAAA",sourcesContent:["\n.setting-link:hover {\n\ttext-decoration: underline;\n}\n"],sourceRoot:""}]);const a=r},5103:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".templates-picker__form[data-v-715b4161]{padding:calc(var(--margin)*2);padding-bottom:0}.templates-picker__form h2[data-v-715b4161]{text-align:center;font-weight:bold;margin:var(--margin) 0 calc(var(--margin)*2)}.templates-picker__list[data-v-715b4161]{display:grid;grid-gap:calc(var(--margin)*2);grid-auto-columns:1fr;max-width:calc(var(--fullwidth)*6);grid-template-columns:repeat(auto-fit, var(--fullwidth));grid-auto-rows:1fr;justify-content:center}.templates-picker__buttons[data-v-715b4161]{display:flex;justify-content:space-between;padding:calc(var(--margin)*2) var(--margin);position:sticky;bottom:0;background-image:linear-gradient(0, var(--gradient-main-background))}.templates-picker__buttons button[data-v-715b4161],.templates-picker__buttons input[type=submit][data-v-715b4161]{height:44px}.templates-picker[data-v-715b4161] .modal-container{position:relative}.templates-picker__loading[data-v-715b4161]{position:absolute;top:0;left:0;justify-content:center;width:100%;height:100%;margin:0;background-color:var(--color-main-background-translucent)}","",{version:3,sources:["webpack://./apps/files/src/views/TemplatePicker.vue"],names:[],mappings:"AAEC,yCACC,6BAAA,CAEA,gBAAA,CAEA,4CACC,iBAAA,CACA,gBAAA,CACA,4CAAA,CAIF,yCACC,YAAA,CACA,8BAAA,CACA,qBAAA,CAEA,kCAAA,CACA,wDAAA,CAEA,kBAAA,CAEA,sBAAA,CAGD,4CACC,YAAA,CACA,6BAAA,CACA,2CAAA,CACA,eAAA,CACA,QAAA,CACA,oEAAA,CAEA,kHACC,WAAA,CAKF,oDACC,iBAAA,CAGD,4CACC,iBAAA,CACA,KAAA,CACA,MAAA,CACA,sBAAA,CACA,UAAA,CACA,WAAA,CACA,QAAA,CACA,yDAAA",sourcesContent:["\n.templates-picker {\n\t&__form {\n\t\tpadding: calc(var(--margin) * 2);\n\t\t// Will be handled by the buttons\n\t\tpadding-bottom: 0;\n\n\t\th2 {\n\t\t\ttext-align: center;\n\t\t\tfont-weight: bold;\n\t\t\tmargin: var(--margin) 0 calc(var(--margin) * 2);\n\t\t}\n\t}\n\n\t&__list {\n\t\tdisplay: grid;\n\t\tgrid-gap: calc(var(--margin) * 2);\n\t\tgrid-auto-columns: 1fr;\n\t\t// We want maximum 5 columns. Putting 6 as we don't count the grid gap. So it will always be lower than 6\n\t\tmax-width: calc(var(--fullwidth) * 6);\n\t\tgrid-template-columns: repeat(auto-fit, var(--fullwidth));\n\t\t// Make sure all rows are the same height\n\t\tgrid-auto-rows: 1fr;\n\t\t// Center the columns set\n\t\tjustify-content: center;\n\t}\n\n\t&__buttons {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tpadding: calc(var(--margin) * 2) var(--margin);\n\t\tposition: sticky;\n\t\tbottom: 0;\n\t\tbackground-image: linear-gradient(0, var(--gradient-main-background));\n\n\t\tbutton, input[type='submit'] {\n\t\t\theight: 44px;\n\t\t}\n\t}\n\n\t// Make sure we're relative for the loading emptycontent on top\n\t::v-deep .modal-container {\n\t\tposition: relative;\n\t}\n\n\t&__loading {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tjustify-content: center;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tmargin: 0;\n\t\tbackground-color: var(--color-main-background-translucent);\n\t}\n}\n\n"],sourceRoot:""}]);const a=r},6881:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,"\n/* @keyframes preview-gradient-fade {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.5;\n }\n 100% {\n opacity: 1;\n }\n} */\n","",{version:3,sources:["webpack://./apps/files/src/components/FileEntry.vue"],names:[],mappings:";AA4lBA;;;;;;;;;;GAUA",sourcesContent:["\x3c!--\n - @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @author John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n --\x3e\n\n<template>\n\t<Fragment>\n\t\t<td class=\"files-list__row-checkbox\">\n\t\t\t<NcCheckboxRadioSwitch v-if=\"active\"\n\t\t\t\t:aria-label=\"t('files', 'Select the row for {displayName}', { displayName })\"\n\t\t\t\t:checked=\"selectedFiles\"\n\t\t\t\t:value=\"fileid\"\n\t\t\t\tname=\"selectedFiles\"\n\t\t\t\t@update:checked=\"onSelectionChange\" />\n\t\t</td>\n\n\t\t\x3c!-- Link to file --\x3e\n\t\t<td class=\"files-list__row-name\">\n\t\t\t<a ref=\"name\" v-bind=\"linkTo\" @click=\"execDefaultAction\">\n\t\t\t\t\x3c!-- Icon or preview --\x3e\n\t\t\t\t<span class=\"files-list__row-icon\">\n\t\t\t\t\t<FolderIcon v-if=\"source.type === 'folder'\" />\n\n\t\t\t\t\t\x3c!-- Decorative image, should not be aria documented --\x3e\n\t\t\t\t\t<span v-else-if=\"previewUrl && !backgroundFailed\"\n\t\t\t\t\t\tref=\"previewImg\"\n\t\t\t\t\t\tclass=\"files-list__row-icon-preview\"\n\t\t\t\t\t\t:style=\"{ backgroundImage }\" />\n\n\t\t\t\t\t<span v-else-if=\"mimeIconUrl\"\n\t\t\t\t\t\tclass=\"files-list__row-icon-preview files-list__row-icon-preview--mime\"\n\t\t\t\t\t\t:style=\"{ backgroundImage: mimeIconUrl }\" />\n\n\t\t\t\t\t<FileIcon v-else />\n\n\t\t\t\t\t\x3c!-- Favorite icon --\x3e\n\t\t\t\t\t<span v-if=\"isFavorite\"\n\t\t\t\t\t\tclass=\"files-list__row-icon-favorite\"\n\t\t\t\t\t\t:aria-label=\"t('files', 'Favorite')\">\n\t\t\t\t\t\t<StarIcon aria-hidden=\"true\" :size=\"20\" />\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\n\t\t\t\t\x3c!-- File name --\x3e\n\t\t\t\t<span class=\"files-list__row-name-text\">{{ displayName }}</span>\n\t\t\t</a>\n\t\t</td>\n\n\t\t\x3c!-- Actions --\x3e\n\t\t<td :class=\"`files-list__row-actions-${uniqueId}`\" class=\"files-list__row-actions\">\n\t\t\t\x3c!-- Inline actions --\x3e\n\t\t\t\x3c!-- TODO: implement CustomElementRender --\x3e\n\n\t\t\t\x3c!-- Menu actions --\x3e\n\t\t\t<NcActions v-if=\"active\"\n\t\t\t\tref=\"actionsMenu\"\n\t\t\t\t:boundaries-element=\"boundariesElement\"\n\t\t\t\t:container=\"boundariesElement\"\n\t\t\t\t:disabled=\"source._loading\"\n\t\t\t\t:force-title=\"true\"\n\t\t\t\t:inline=\"enabledInlineActions.length\"\n\t\t\t\t:open.sync=\"openedMenu\">\n\t\t\t\t<NcActionButton v-for=\"action in enabledMenuActions\"\n\t\t\t\t\t:key=\"action.id\"\n\t\t\t\t\t:class=\"'files-list__row-action-' + action.id\"\n\t\t\t\t\t@click=\"onActionClick(action)\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<NcLoadingIcon v-if=\"loading === action.id\" :size=\"18\" />\n\t\t\t\t\t\t<CustomSvgIconRender v-else :svg=\"action.iconSvgInline([source], currentView)\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ action.displayName([source], currentView) }}\n\t\t\t\t</NcActionButton>\n\t\t\t</NcActions>\n\t\t</td>\n\n\t\t\x3c!-- Size --\x3e\n\t\t<td v-if=\"isSizeAvailable\"\n\t\t\t:style=\"{ opacity: sizeOpacity }\"\n\t\t\tclass=\"files-list__row-size\"\n\t\t\t@click=\"execDefaultAction\">\n\t\t\t<span>{{ size }}</span>\n\t\t</td>\n\n\t\t\x3c!-- View columns --\x3e\n\t\t<td v-for=\"column in columns\"\n\t\t\t:key=\"column.id\"\n\t\t\t:class=\"`files-list__row-${currentView?.id}-${column.id}`\"\n\t\t\tclass=\"files-list__row-column-custom\"\n\t\t\t@click=\"execDefaultAction\">\n\t\t\t<CustomElementRender v-if=\"active\"\n\t\t\t\t:current-view=\"currentView\"\n\t\t\t\t:render=\"column.render\"\n\t\t\t\t:source=\"source\" />\n\t\t</td>\n\t</Fragment>\n</template>\n\n<script lang='ts'>\nimport { debounce } from 'debounce'\nimport { formatFileSize } from '@nextcloud/files'\nimport { Fragment } from 'vue-frag'\nimport { join } from 'path'\nimport { showError, showSuccess } from '@nextcloud/dialogs'\nimport { translate } from '@nextcloud/l10n'\nimport CancelablePromise from 'cancelable-promise'\nimport FileIcon from 'vue-material-design-icons/File.vue'\nimport FolderIcon from 'vue-material-design-icons/Folder.vue'\nimport NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'\nimport NcActions from '@nextcloud/vue/dist/Components/NcActions.js'\nimport NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'\nimport NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'\nimport StarIcon from 'vue-material-design-icons/Star.vue'\nimport Vue from 'vue'\n\nimport { getFileActions } from '../services/FileAction.ts'\nimport { hashCode } from '../utils/hashUtils.ts'\nimport { isCachedPreview } from '../services/PreviewService.ts'\nimport { useActionsMenuStore } from '../store/actionsmenu.ts'\nimport { useFilesStore } from '../store/files.ts'\nimport { useKeyboardStore } from '../store/keyboard.ts'\nimport { useSelectionStore } from '../store/selection.ts'\nimport { useUserConfigStore } from '../store/userconfig.ts'\nimport CustomElementRender from './CustomElementRender.vue'\nimport CustomSvgIconRender from './CustomSvgIconRender.vue'\nimport logger from '../logger.js'\n\n// The registered actions list\nconst actions = getFileActions()\n\nexport default Vue.extend({\n\tname: 'FileEntry',\n\n\tcomponents: {\n\t\tCustomElementRender,\n\t\tCustomSvgIconRender,\n\t\tFileIcon,\n\t\tFolderIcon,\n\t\tFragment,\n\t\tNcActionButton,\n\t\tNcActions,\n\t\tNcCheckboxRadioSwitch,\n\t\tNcLoadingIcon,\n\t\tStarIcon,\n\t},\n\n\tprops: {\n\t\tactive: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\tisSizeAvailable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\tsource: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\t\tindex: {\n\t\t\ttype: Number,\n\t\t\trequired: true,\n\t\t},\n\t\tnodes: {\n\t\t\ttype: Array,\n\t\t\trequired: true,\n\t\t},\n\t\tfilesListWidth: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0,\n\t\t},\n\t},\n\n\tsetup() {\n\t\tconst actionsMenuStore = useActionsMenuStore()\n\t\tconst filesStore = useFilesStore()\n\t\tconst keyboardStore = useKeyboardStore()\n\t\tconst selectionStore = useSelectionStore()\n\t\tconst userConfigStore = useUserConfigStore()\n\t\treturn {\n\t\t\tactionsMenuStore,\n\t\t\tfilesStore,\n\t\t\tkeyboardStore,\n\t\t\tselectionStore,\n\t\t\tuserConfigStore,\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tbackgroundFailed: false,\n\t\t\tbackgroundImage: '',\n\t\t\tboundariesElement: document.querySelector('.app-content > .files-list'),\n\t\t\tloading: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tuserConfig() {\n\t\t\treturn this.userConfigStore.userConfig\n\t\t},\n\n\t\tcurrentView() {\n\t\t\treturn this.$navigation.active\n\t\t},\n\t\tcolumns() {\n\t\t\t// Hide columns if the list is too small\n\t\t\tif (this.filesListWidth < 512) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn this.currentView?.columns || []\n\t\t},\n\n\t\tdir() {\n\t\t\t// Remove any trailing slash but leave root slash\n\t\t\treturn (this.$route?.query?.dir || '/').replace(/^(.+)\\/$/, '$1')\n\t\t},\n\t\tfileid() {\n\t\t\treturn this.source?.fileid?.toString?.()\n\t\t},\n\t\tdisplayName() {\n\t\t\treturn this.source.attributes.displayName\n\t\t\t\t|| this.source.basename\n\t\t},\n\n\t\tsize() {\n\t\t\tconst size = parseInt(this.source.size, 10) || 0\n\t\t\tif (typeof size !== 'number' || size < 0) {\n\t\t\t\treturn this.t('files', 'Pending')\n\t\t\t}\n\t\t\treturn formatFileSize(size, true)\n\t\t},\n\t\tsizeOpacity() {\n\t\t\tconst size = parseInt(this.source.size, 10) || 0\n\t\t\tif (!size || size < 0) {\n\t\t\t\treturn 1\n\t\t\t}\n\n\t\t\t// Whatever theme is active, the contrast will pass WCAG AA\n\t\t\t// with color main text over main background and an opacity of 0.7\n\t\t\tconst minOpacity = 0.7\n\t\t\tconst maxOpacitySize = 10 * 1024 * 1024\n\t\t\treturn minOpacity + (1 - minOpacity) * Math.pow((this.source.size / maxOpacitySize), 2)\n\t\t},\n\n\t\tlinkTo() {\n\t\t\tif (this.enabledDefaultActions.length > 0) {\n\t\t\t\tconst action = this.enabledDefaultActions[0]\n\t\t\t\tconst displayName = action.displayName([this.source], this.currentView)\n\t\t\t\treturn {\n\t\t\t\t\ttitle: displayName,\n\t\t\t\t\trole: 'button',\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.source.type === 'folder') {\n\t\t\t\tconst to = { ...this.$route, query: { dir: join(this.dir, this.source.basename) } }\n\t\t\t\treturn {\n\t\t\t\t\tis: 'router-link',\n\t\t\t\t\ttitle: this.t('files', 'Open folder {name}', { name: this.displayName }),\n\t\t\t\t\tto,\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\thref: this.source.source,\n\t\t\t\t// TODO: Use first action title ?\n\t\t\t\ttitle: this.t('files', 'Download file {name}', { name: this.displayName }),\n\t\t\t}\n\t\t},\n\n\t\tselectedFiles() {\n\t\t\treturn this.selectionStore.selected\n\t\t},\n\t\tisSelected() {\n\t\t\treturn this.selectedFiles.includes(this.source?.fileid?.toString?.())\n\t\t},\n\n\t\tcropPreviews() {\n\t\t\treturn this.userConfig.crop_image_previews\n\t\t},\n\t\tpreviewUrl() {\n\t\t\ttry {\n\t\t\t\tconst url = new URL(window.location.origin + this.source.attributes.previewUrl)\n\t\t\t\t// Request tiny previews\n\t\t\t\turl.searchParams.set('x', '32')\n\t\t\t\turl.searchParams.set('y', '32')\n\t\t\t\t// Handle cropping\n\t\t\t\turl.searchParams.set('a', this.cropPreviews === true ? '0' : '1')\n\t\t\t\treturn url.href\n\t\t\t} catch (e) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t},\n\t\tmimeIconUrl() {\n\t\t\tconst mimeType = this.source.mime || 'application/octet-stream'\n\t\t\tconst mimeIconUrl = window.OC?.MimeType?.getIconUrl?.(mimeType)\n\t\t\tif (mimeIconUrl) {\n\t\t\t\treturn `url(${mimeIconUrl})`\n\t\t\t}\n\t\t\treturn ''\n\t\t},\n\n\t\tenabledActions() {\n\t\t\treturn actions\n\t\t\t\t.filter(action => !action.enabled || action.enabled([this.source], this.currentView))\n\t\t\t\t.sort((a, b) => (a.order || 0) - (b.order || 0))\n\t\t},\n\t\tenabledInlineActions() {\n\t\t\tif (this.filesListWidth < 768) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn this.enabledActions.filter(action => action?.inline?.(this.source, this.currentView))\n\t\t},\n\t\tenabledMenuActions() {\n\t\t\tif (this.filesListWidth < 768) {\n\t\t\t\t// If we have a default action, do not render the first one\n\t\t\t\tif (this.enabledDefaultActions.length > 0) {\n\t\t\t\t\treturn this.enabledActions.slice(1)\n\t\t\t\t}\n\t\t\t\treturn this.enabledActions\n\t\t\t}\n\n\t\t\tconst actions = [\n\t\t\t\t...this.enabledInlineActions,\n\t\t\t\t...this.enabledActions.filter(action => !action.inline),\n\t\t\t]\n\n\t\t\t// If we have a default action, do not render the first one\n\t\t\tif (this.enabledDefaultActions.length > 0) {\n\t\t\t\treturn actions.slice(1)\n\t\t\t}\n\n\t\t\treturn actions\n\t\t},\n\t\tenabledDefaultActions() {\n\t\t\treturn [\n\t\t\t\t...this.enabledActions.filter(action => action.default),\n\t\t\t]\n\t\t},\n\t\topenedMenu: {\n\t\t\tget() {\n\t\t\t\treturn this.actionsMenuStore.opened === this.uniqueId\n\t\t\t},\n\t\t\tset(opened) {\n\t\t\t\tthis.actionsMenuStore.opened = opened ? this.uniqueId : null\n\t\t\t},\n\t\t},\n\n\t\tuniqueId() {\n\t\t\treturn hashCode(this.source.source)\n\t\t},\n\n\t\tisFavorite() {\n\t\t\treturn this.source.attributes.favorite === 1\n\t\t},\n\t},\n\n\twatch: {\n\t\tactive(active, before) {\n\t\t\tif (active === false && before === true) {\n\t\t\t\tthis.resetState()\n\n\t\t\t\t// When the row is not active anymore\n\t\t\t\t// remove the display from the row to prevent\n\t\t\t\t// keyboard interaction with it.\n\t\t\t\tthis.$el.parentNode.style.display = 'none'\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Restore default tabindex\n\t\t\tthis.$el.parentNode.style.display = ''\n\t\t},\n\n\t\t/**\n\t\t * When the source changes, reset the preview\n\t\t * and fetch the new one.\n\t\t */\n\t\tpreviewUrl() {\n\t\t\tthis.clearImg()\n\t\t\tthis.debounceIfNotCached()\n\t\t},\n\t},\n\n\t/**\n\t * The row is mounted once and reused as we scroll.\n\t */\n\tmounted() {\n\t\t// ⚠ Init the debounce function on mount and\n\t\t// not when the module is imported to\n\t\t// avoid sharing between recycled components\n\t\tthis.debounceGetPreview = debounce(function() {\n\t\t\tthis.fetchAndApplyPreview()\n\t\t}, 150, false)\n\n\t\t// Fetch the preview on init\n\t\tthis.debounceIfNotCached()\n\n\t\t// Right click watcher on tr\n\t\tthis.$el.parentNode?.addEventListener?.('contextmenu', this.onRightClick)\n\t},\n\n\tbeforeDestroy() {\n\t\tthis.resetState()\n\t},\n\n\tmethods: {\n\t\tasync debounceIfNotCached() {\n\t\t\tif (!this.previewUrl) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Check if we already have this preview cached\n\t\t\tconst isCached = await isCachedPreview(this.previewUrl)\n\t\t\tif (isCached) {\n\t\t\t\tthis.backgroundImage = `url(${this.previewUrl})`\n\t\t\t\tthis.backgroundFailed = false\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// We don't have this preview cached or it expired, requesting it\n\t\t\tthis.debounceGetPreview()\n\t\t},\n\n\t\tfetchAndApplyPreview() {\n\t\t\t// Ignore if no preview\n\t\t\tif (!this.previewUrl) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// If any image is being processed, reset it\n\t\t\tif (this.previewPromise) {\n\t\t\t\tthis.clearImg()\n\t\t\t}\n\n\t\t\t// Store the promise to be able to cancel it\n\t\t\tthis.previewPromise = new CancelablePromise((resolve, reject, onCancel) => {\n\t\t\t\tconst img = new Image()\n\t\t\t\t// If active, load the preview with higher priority\n\t\t\t\timg.fetchpriority = this.active ? 'high' : 'auto'\n\t\t\t\timg.onload = () => {\n\t\t\t\t\tthis.backgroundImage = `url(${this.previewUrl})`\n\t\t\t\t\tthis.backgroundFailed = false\n\t\t\t\t\tresolve(img)\n\t\t\t\t}\n\t\t\t\timg.onerror = () => {\n\t\t\t\t\tthis.backgroundFailed = true\n\t\t\t\t\treject(img)\n\t\t\t\t}\n\t\t\t\timg.src = this.previewUrl\n\n\t\t\t\t// Image loading has been canceled\n\t\t\t\tonCancel(() => {\n\t\t\t\t\timg.onerror = null\n\t\t\t\t\timg.onload = null\n\t\t\t\t\timg.src = ''\n\t\t\t\t})\n\t\t\t})\n\t\t},\n\n\t\tresetState() {\n\t\t\t// Reset loading state\n\t\t\tthis.loading = ''\n\n\t\t\t// Reset the preview\n\t\t\tthis.clearImg()\n\n\t\t\t// Close menu\n\t\t\tthis.openedMenu = false\n\t\t},\n\n\t\tclearImg() {\n\t\t\tthis.backgroundImage = ''\n\t\t\tthis.backgroundFailed = false\n\n\t\t\tif (this.previewPromise) {\n\t\t\t\tthis.previewPromise.cancel()\n\t\t\t\tthis.previewPromise = null\n\t\t\t}\n\t\t},\n\n\t\tasync onActionClick(action) {\n\t\t\tconst displayName = action.displayName([this.source], this.currentView)\n\t\t\ttry {\n\t\t\t\t// Set the loading marker\n\t\t\t\tthis.loading = action.id\n\t\t\t\tVue.set(this.source, '_loading', true)\n\n\t\t\t\tconst success = await action.exec(this.source, this.currentView)\n\n\t\t\t\t// If the action returns null, we stay silent\n\t\t\t\tif (success === null) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tif (success) {\n\t\t\t\t\tshowSuccess(this.t('files', '\"{displayName}\" action executed successfully', { displayName }))\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tshowError(this.t('files', '\"{displayName}\" action failed', { displayName }))\n\t\t\t} catch (e) {\n\t\t\t\tlogger.error('Error while executing action', { action, e })\n\t\t\t\tshowError(this.t('files', '\"{displayName}\" action failed', { displayName }))\n\t\t\t} finally {\n\t\t\t\t// Reset the loading marker\n\t\t\t\tthis.loading = ''\n\t\t\t\tVue.set(this.source, '_loading', false)\n\t\t\t}\n\t\t},\n\t\texecDefaultAction(event) {\n\t\t\tif (this.enabledDefaultActions.length > 0) {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tevent.stopPropagation()\n\t\t\t\t// Execute the first default action if any\n\t\t\t\tthis.enabledDefaultActions[0].exec(this.source, this.currentView)\n\t\t\t}\n\t\t},\n\n\t\tonSelectionChange(selection) {\n\t\t\tconst newSelectedIndex = this.index\n\t\t\tconst lastSelectedIndex = this.selectionStore.lastSelectedIndex\n\n\t\t\t// Get the last selected and select all files in between\n\t\t\tif (this.keyboardStore?.shiftKey && lastSelectedIndex !== null) {\n\t\t\t\tconst isAlreadySelected = this.selectedFiles.includes(this.fileid)\n\n\t\t\t\tconst start = Math.min(newSelectedIndex, lastSelectedIndex)\n\t\t\t\tconst end = Math.max(lastSelectedIndex, newSelectedIndex)\n\n\t\t\t\tconst lastSelection = this.selectionStore.lastSelection\n\t\t\t\tconst filesToSelect = this.nodes\n\t\t\t\t\t.map(file => file.fileid?.toString?.())\n\t\t\t\t\t.slice(start, end + 1)\n\n\t\t\t\t// If already selected, update the new selection _without_ the current file\n\t\t\t\tconst selection = [...lastSelection, ...filesToSelect]\n\t\t\t\t\t.filter(fileId => !isAlreadySelected || fileId !== this.fileid)\n\n\t\t\t\tlogger.debug('Shift key pressed, selecting all files in between', { start, end, filesToSelect, isAlreadySelected })\n\t\t\t\t// Keep previous lastSelectedIndex to be use for further shift selections\n\t\t\t\tthis.selectionStore.set(selection)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tlogger.debug('Updating selection', { selection })\n\t\t\tthis.selectionStore.set(selection)\n\t\t\tthis.selectionStore.setLastIndex(newSelectedIndex)\n\t\t},\n\n\t\t// Open the actions menu on right click\n\t\tonRightClick(event) {\n\t\t\t// If already opened, fallback to default browser\n\t\t\tif (this.openedMenu) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// If the clicked row is in the selection, open global menu\n\t\t\tconst isMoreThanOneSelected = this.selectedFiles.length > 1\n\t\t\tthis.actionsMenuStore.opened = this.isSelected && isMoreThanOneSelected ? 'global' : this.uniqueId\n\n\t\t\t// Prevent any browser defaults\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t},\n\n\t\tt: translate,\n\t\tformatFileSize,\n\t},\n})\n<\/script>\n\n<style scoped lang='scss'>\n/* Hover effect on tbody lines only */\ntr {\n\t&:hover,\n\t&:focus,\n\t&:active {\n\t\tbackground-color: var(--color-background-dark);\n\t}\n}\n\n/* Preview not loaded animation effect */\n.files-list__row-icon-preview:not([style*='background']) {\n background: var(--color-loading-dark);\n\t// animation: preview-gradient-fade 1.2s ease-in-out infinite;\n}\n</style>\n\n<style>\n/* @keyframes preview-gradient-fade {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.5;\n }\n 100% {\n opacity: 1;\n }\n} */\n</style>\n"],sourceRoot:""}]);const a=r}},i={};function o(t){var e=i[t];if(void 0!==e)return e.exports;var s=i[t]={id:t,loaded:!1,exports:{}};return n[t].call(s.exports,s,s.exports,o),s.loaded=!0,s.exports}o.m=n,e=[],o.O=(t,n,i,s)=>{if(!n){var r=1/0;for(d=0;d<e.length;d++){n=e[d][0],i=e[d][1],s=e[d][2];for(var a=!0,l=0;l<n.length;l++)(!1&s||r>=s)&&Object.keys(o.O).every((t=>o.O[t](n[l])))?n.splice(l--,1):(a=!1,s<r&&(r=s));if(a){e.splice(d--,1);var c=i();void 0!==c&&(t=c)}}return t}s=s||0;for(var d=e.length;d>0&&e[d-1][2]>s;d--)e[d]=e[d-1];e[d]=[n,i,s]},o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),o.j=2181,(()=>{o.b=document.baseURI||self.location.href;var t={2181:0};o.O.j=e=>0===t[e];var e=(e,n)=>{var i,s,r=n[0],a=n[1],l=n[2],c=0;if(r.some((e=>0!==t[e]))){for(i in a)o.o(a,i)&&(o.m[i]=a[i]);if(l)var d=l(o)}for(e&&e(n);c<r.length;c++)s=r[c],o.o(t,s)&&t[s]&&t[s][0](),t[s]=0;return o.O(d)},n=self.webpackChunknextcloud=self.webpackChunknextcloud||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})(),o.nc=void 0;var s=o.O(void 0,[7874],(()=>o(11115)));s=o.O(s)})();
//# sourceMappingURL=files-main.js.map?v=5221219e116e23f986c4