(()=>{"use strict";var e,t,s,n={9165:(e,t,s)=>{s.d(t,{DvY:()=>a,NZC:()=>i,O1W:()=>n,ZL5:()=>r,fEr:()=>o});var n="M9,10H7V12H9V10M13,10H11V12H13V10M17,10H15V12H17V10M19,3H18V1H16V3H8V1H6V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M19,19H5V8H19V19Z",i="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M16.2,16.2L11,13V7H12.5V12.2L17,14.9L16.2,16.2Z",a="M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z",o="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z",r="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z"},20733:(e,t,s)=>{var n=s(35810),i=s(85168),a=s(32981),o=s(53334),r=s(49264),l=s(5655),m=s(19231),d=s(21777),c=s(71225),g=s(85471),u=s(77764);const f=new n.VP({id:"files_trashbin--original-location",title:(0,o.Tl)("files_trashbin","Original location"),render(e){const t=w(e),s=document.createElement("span");return s.title=t,s.textContent=t,s},sort(e,t){const s=w(e),n=w(t);return s.localeCompare(n,[(0,o.Z0)(),(0,o.lO)()],{numeric:!0,usage:"sort"})}}),p=new n.VP({id:"files_trashbin--deleted-by",title:(0,o.Tl)("files_trashbin","Deleted by"),render(e){const{userId:t,displayName:s,label:n}=v(e);if(n){const e=document.createElement("span");return e.textContent=n,e}return new(g.Ay.extend(u.A))({propsData:{size:32,user:t??void 0,displayName:s??t}}).$mount().$el},sort(e,t){const s=v(e),n=s.label??s.displayName??s.userId,i=v(t),a=i.label??i.displayName??i.userId;return n.localeCompare(a,[(0,o.Z0)(),(0,o.lO)()],{numeric:!0,usage:"sort"})}}),h=new n.VP({id:"files_trashbin--deleted",title:(0,o.Tl)("files_trashbin","Deleted"),render(e){const t=e.attributes?.["trashbin-deletion-time"]||(e?.mtime?.getTime()??0)/1e3,s=document.createElement("span");return t?(s.title=m.A.unix(t).format("LLL"),s.textContent=m.A.unix(t).fromNow(),s):(s.textContent=(0,o.Tl)("files_trashbin","A long time ago"),s)},sort(e,t){const s=e.attributes?.["trashbin-deletion-time"]||(e?.mtime?.getTime()??0)/1e3;return(t.attributes?.["trashbin-deletion-time"]||(t?.mtime?.getTime()??0)/1e3)-s}});function w(e){const t=b(e.attributes?.["trashbin-original-location"]);if(!t)return(0,o.Tl)("files_trashbin","Unknown");const s=(0,c.pD)(t);return s===t?(0,o.Tl)("files_trashbin","All files"):s.replace(/^\//,"")}function v(e){const t=b(e.attributes?.["trashbin-deleted-by-id"]),s=b(e.attributes?.["trashbin-deleted-by-display-name"]);let n;const i=(0,d.HW)()?.uid;return t===i&&(n=(0,o.Tl)("files_trashbin","You")),t||s||(n=(0,o.Tl)("files_trashbin","Unknown")),{userId:t,displayName:s,label:n}}function b(e){return e?String(e):null}const y=`/trashbin/${(0,d.HW)()?.uid}/trash`,T=(0,n.H4)();var k=s(63814);const x=`\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t${(0,n.VX)()}\n\t\n`,C=e=>{const t=(0,n.Al)(e,y);return t.attributes.previewUrl=(0,k.Jv)("/apps/files_trashbin/preview?fileId={fileid}&x=32&y=32",{fileid:t.fileid}),t};var L=s(45174);const S="trashbin";new n.Ss({id:S,name:(0,o.t)("files_trashbin","Deleted files"),caption:(0,o.t)("files_trashbin","List of files that have been deleted."),emptyTitle:(0,o.t)("files_trashbin","No deleted files"),emptyCaption:(0,o.t)("files_trashbin","Files and folders you have deleted will show up here"),icon:L,order:50,sticky:!0,defaultSortKey:"deleted",columns:[f,p,h],getContents:async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";const t=(await T.getDirectoryContents(`${y}${e}`,{details:!0,data:x,includeSelf:!0})).data.map(C),[s]=t.splice(t.findIndex((t=>t.path===e)),1);return{folder:s,contents:t}}});var U=s(61338),N=s(87485),_=s(65043);const A=()=>!0===(0,N.F)()?.files?.undelete,F=e=>e.every((e=>!0===e.attributes["is-mount-root"]&&"shared"===e.attributes["mount-type"])),E=e=>e.every((e=>!0===e.attributes["is-mount-root"]&&"external"===e.attributes["mount-type"])),P=(e,t)=>F(e)?1===e.length?(0,o.t)("files","Leave this share"):(0,o.t)("files","Leave these shares"):E(e)?1===e.length?(0,o.t)("files","Disconnect storage"):(0,o.t)("files","Disconnect storages"):"trashbin"!==t.id&&A()?(e=>{if(1===e.length)return!1;const t=e.some((e=>F([e]))),s=e.some((e=>!F([e])));return t&&s})(e)?(0,o.t)("files","Delete and unshare"):(e=>!e.some((e=>e.type!==n.pt.File)))(e)?1===e.length?(0,o.t)("files","Delete file"):(0,o.t)("files","Delete files"):(e=>!e.some((e=>e.type!==n.pt.Folder)))(e)?1===e.length?(0,o.t)("files","Delete folder"):(0,o.t)("files","Delete folders"):(0,o.t)("files","Delete"):(0,o.t)("files","Delete permanently"),I=async(e,t)=>{const s="trashbin"!==t.id&&A()?(0,o.n)("files","You are about to delete {count} item","You are about to delete {count} items",e.length,{count:e.length}):(0,o.n)("files","You are about to permanently delete {count} item","You are about to permanently delete {count} items",e.length,{count:e.length});return new Promise((n=>{window.OC.dialogs.confirmDestructive(s,(0,o.t)("files","Confirm deletion"),{type:window.OC.dialogs.YES_NO_BUTTONS,confirm:P(e,t),confirmClasses:"error",cancel:(0,o.t)("files","Cancel")},(e=>{n(e)}))}))},O=async e=>{await _.Ay.delete(e.encodedSource),(0,U.Ic)("files:node:deleted",e)};var R=s(9558);const j=new r.A({concurrency:5}),z=new n.hY({id:"delete",displayName:P,iconSvgInline:e=>F(e)?l:E(e)?'':'',enabled:(e,t)=>(t.id!==S||!1!==(0,a.C)("files_trashbin","config",{allow_delete:!0}).allow_delete)&&(e.length>0&&e.map((e=>e.permissions)).every((e=>!!(e&n.aX.DELETE)))),async exec(e,t){try{let s=!0;const n=((new Error).stack||"").toLocaleLowerCase().includes("keydown");return A()&&!n||(s=await I([e],t)),!1===s?((0,i.cf)((0,o.Tl)("files","Deletion cancelled")),null):(await O(e),!0)}catch(t){return R.A.error("Error while deleting a file",{error:t,source:e.source,node:e}),!1}},async execBatch(e,t){let s=!0;if(A()?e.length>=5&&!F(e)&&!E(e)&&(s=await I(e,t)):s=await I(e,t),!1===s)return(0,i.cf)((0,o.Tl)("files","Deletion cancelled")),Promise.all(e.map((()=>null)));const n=e.map((e=>new Promise((t=>{j.add((async()=>{try{await O(e),t(!0)}catch(s){R.A.error("Error while deleting a file",{error:s,source:e.source,node:e}),t(!1)}}))}))));return Promise.all(n)},order:100});function B(e){if(!(e.permissions&n.aX.READ))return!1;if(e.attributes["share-attributes"]){const t=JSON.parse(e.attributes["share-attributes"]||"[]").find((e=>{let{scope:t,key:s}=e;return"permissions"===t&&"download"===s}));if(void 0!==t)return!0===t.value}return!0}function M(e,t){const s=document.createElement("a");s.download=t??"",s.href=e,s.click()}function D(e,t){const s=e.split("/").filter(Boolean),n=t.split("/").filter(Boolean);let i="";for(const[e,a]of s.entries()){if(e>=t.length)break;if(a!==n[e])break;i=`${i}${""===i?"":"/"}${a}`}return i}const V=function(e){let t;if(1===e.length){if(e[0].type===n.pt.File)return M(e[0].encodedSource,e[0].displayname);t=new URL(e[0].encodedSource),t.searchParams.append("accept","zip")}else{t=new URL(e[0].source);let s=t.pathname;for(const t of e.slice(1))s=D(s,new URL(t.source).pathname);t.pathname=s;const n=e.map((e=>decodeURI(e.encodedSource.slice(t.href.length+1))));t.searchParams.append("accept","zip"),t.searchParams.append("files",JSON.stringify(n))}return"/"!==t.pathname.at(-1)&&(t.pathname=`${t.pathname}/`),M(t.href)},H=new n.hY({id:"download",default:n.m9.DEFAULT,displayName:()=>(0,o.t)("files","Download"),iconSvgInline:()=>'',enabled:(e,t)=>0!==e.length&&!e.some((e=>!e.isDavRessource))&&!(e.length>1&&"trashbin"===t.id)&&e.every(B),exec:async e=>(V([e]),null),execBatch:async e=>(V(e),new Array(e.length).fill(null)),order:30});var $=s(82680);const W=async function(e){const t=(0,k.KT)("apps/files/api/v1")+"/openlocaleditor?format=json";try{const s=await _.Ay.post(t,{path:e}),n=(0,d.HW)()?.uid;let i=`nc://open/${n}@`+window.location.host+(0,c.O0)(e);i+="?token="+s.data.ocs.data.token,window.open(i,"_self")}catch(e){(0,i.Qg)((0,o.Tl)("files","Failed to redirect to client"))}},Y=new n.hY({id:"edit-locally",displayName:()=>(0,o.Tl)("files","Edit locally"),iconSvgInline:()=>'',enabled:e=>1===e.length&&!(0,$.f)()&&!!(e[0].permissions&n.aX.UPDATE),exec:async e=>((async e=>{W(e),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{},t=!1;(new i.ik).setName((0,o.Tl)("files","Edit file locally")).setText((0,o.Tl)("files","The file should now open on your device. If it doesn't, please check that you have the desktop app installed.")).setButtons([{label:(0,o.Tl)("files","Retry and close"),type:"secondary",callback:()=>{t=!0,e(!0)}},{label:(0,o.Tl)("files","Edit online"),icon:'',type:"primary",callback:()=>{t=!0,e(!1)}}]).build().show().then((()=>{t||e(!1)}))}((t=>{t?W(e):window.OCA.Viewer.open({path:e})}))})(e.path),null),order:25});var G=s(63006),q=s(11459);const K=new r.A({concurrency:5}),X=e=>e.some((e=>1!==e.attributes.favorite)),J=async(e,t,s)=>{try{const n=(0,k.Jv)("/apps/files/api/v1/files")+(0,c.O0)(e.path);return await _.Ay.post(n,{tags:s?[window.OC.TAG_FAVORITE]:[]}),"favorites"!==t.id||s||"/"!==e.dirname||(0,U.Ic)("files:node:deleted",e),g.Ay.set(e.attributes,"favorite",s?1:0),s?(0,U.Ic)("files:favorites:added",e):(0,U.Ic)("files:favorites:removed",e),!0}catch(t){const n=s?"adding a file to favourites":"removing a file from favourites";return R.A.error("Error while "+n,{error:t,source:e.source,node:e}),!1}},Z=new n.hY({id:"favorite",displayName:e=>X(e)?(0,o.Tl)("files","Add to favorites"):(0,o.Tl)("files","Remove from favorites"),iconSvgInline:e=>X(e)?G:q,enabled:e=>!(0,$.f)()&&e.every((e=>e.root?.startsWith?.("/files")))&&e.every((e=>e.permissions!==n.aX.NONE)),async exec(e,t){const s=X([e]);return await J(e,t,s)},async execBatch(e,t){const s=X(e),n=e.map((e=>new Promise((n=>{K.add((async()=>{try{await J(e,t,s),n(!0)}catch(t){R.A.error("Error while adding file to favorite",{error:t,source:e.source,node:e}),n(!1)}}))}))));return Promise.all(n)},order:-50});var Q=s(75612),ee=s(43627),te=s(36882),se=s(39285);const ne=(0,a.C)("files_sharing","sharePermissions",n.aX.NONE);let ie;var ae;!function(e){e.MOVE="Move",e.COPY="Copy",e.MOVE_OR_COPY="move-or-copy"}(ae||(ae={}));const oe=e=>{const t=e.reduce(((e,t)=>Math.min(e,t.permissions)),n.aX.ALL);return Boolean(t&n.aX.DELETE)},re=e=>!!(e=>e.every((e=>!JSON.parse(e.attributes?.["share-attributes"]??"[]").some((e=>"permissions"===e.scope&&!1===e.value&&"download"===e.key)))))(e)&&!e.some((e=>e.permissions===n.aX.NONE))&&(!(0,$.f)()||Boolean(ne&n.aX.CREATE));var le=s(36117),me=s(77815);const de=(0,me.KU)(),ce=async e=>{const t=(0,me.aN)(),s=await de.stat(`${(0,me.ei)()}${e}`,{details:!0,data:t});return(0,me.pO)(s.data)},ge=e=>(0,n.Al)(e),ue=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";e=(0,ee.join)(n.lJ,e);const t=new AbortController,s=(0,n.VL)();return new le.CancelablePromise((async(n,i,a)=>{a((()=>t.abort()));try{const i=await de.getDirectoryContents(e,{details:!0,data:s,includeSelf:!0,signal:t.signal}),a=i.data[0],o=i.data.slice(1);if(a.filename!==e&&`${a.filename}/`!==e)throw R.A.debug(`Exepected "${e}" but got filename "${a.filename}" instead.`),new Error("Root node does not match requested path");n({folder:ge(a),contents:o.map((e=>{try{return ge(e)}catch(t){return R.A.error(`Invalid node detected '${e.basename}'`,{error:t}),null}})).filter(Boolean)})}catch(e){i(e)}}))},fe=e=>oe(e)?re(e)?ae.MOVE_OR_COPY:ae.MOVE:ae.COPY,pe=async function(e,t,s){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!t)return;if(t.type!==n.pt.Folder)throw new Error((0,o.Tl)("files","Destination is not a folder"));if(s===ae.MOVE&&e.dirname===t.path)throw new Error((0,o.Tl)("files","This file/folder is already in that directory"));if(`${t.path}/`.startsWith(`${e.path}/`))throw new Error((0,o.Tl)("files","You cannot move a file/folder onto itself or into a subfolder of itself"));g.Ay.set(e,"status",n.zI.LOADING);const l=function(e,t,s){const n=e===ae.MOVE?(0,o.Tl)("files",'Moving "{source}" to "{destination}" …',{source:t,destination:s}):(0,o.Tl)("files",'Copying "{source}" to "{destination}" …',{source:t,destination:s});let a;return a=(0,i.cf)(` ${n}`,{isHTML:!0,timeout:i.DH,onRemove:()=>{a?.hideToast(),a=void 0}}),()=>a&&a.hideToast()}(s,e.basename,t.path),m=(ie||(ie=new r.A({concurrency:5})),ie);return await m.add((async()=>{const r=e=>1===e?(0,o.Tl)("files","(copy)"):(0,o.Tl)("files","(copy %n)",void 0,e);try{const l=(0,n.H4)(),m=(0,ee.join)(n.lJ,e.path),d=(0,ee.join)(n.lJ,t.path);if(s===ae.COPY){let s=e.basename;if(!a){const t=await l.getDirectoryContents(d);s=(0,n.E6)(e.basename,t.map((e=>e.basename)),{suffix:r,ignoreFileExtension:e.type===n.pt.Folder})}if(await l.copyFile(m,(0,ee.join)(d,s)),e.dirname===t.path){const{data:e}=await l.stat((0,ee.join)(d,s),{details:!0,data:(0,n.VL)()});(0,U.Ic)("files:node:created",(0,n.Al)(e))}}else{if(!a){const s=await ue(t.path);if((0,Q.h)([e],s.contents))try{const{selected:n,renamed:i}=await(0,Q.o)(t.path,[e],s.contents);if(!n.length&&!i.length)return}catch(e){return void(0,i.Qg)((0,o.Tl)("files","Move cancelled"))}}try{await l.moveFile(m,(0,ee.join)(d,e.basename))}catch(e){const t=new DOMParser,s=await(e.response?.text()),n=t.parseFromString(s??"","text/xml").querySelector("message")?.textContent;throw n&&(0,i.Qg)(n),e}(0,U.Ic)("files:node:deleted",e)}}catch(e){if((0,_.F0)(e)){if(412===e.response?.status)throw new Error((0,o.Tl)("files","A file or folder with that name already exists in this folder"));if(423===e.response?.status)throw new Error((0,o.Tl)("files","The files are locked"));if(404===e.response?.status)throw new Error((0,o.Tl)("files","The file does not exist anymore"));if(e.message)throw new Error(e.message)}throw R.A.debug(e),new Error}finally{g.Ay.set(e,"status",""),l()}}))};async function he(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",s=arguments.length>2?arguments[2]:void 0;const{resolve:a,reject:r,promise:l}=Promise.withResolvers(),m=s.map((e=>e.fileid)).filter(Boolean);return(0,i.a1)((0,o.Tl)("files","Choose destination")).allowDirectories(!0).setFilter((e=>!m.includes(e.fileid))).setMimeTypeFilter([]).setMultiSelect(!1).startAt(t).setButtonFactory(((t,i)=>{const r=[],l=(0,ee.basename)(i),m=s.map((e=>e.dirname)),d=s.map((e=>e.path));return e!==ae.COPY&&e!==ae.MOVE_OR_COPY||r.push({label:l?(0,o.Tl)("files","Copy to {target}",{target:l},void 0,{escape:!1,sanitize:!1}):(0,o.Tl)("files","Copy"),type:"primary",icon:te,disabled:t.some((e=>!(e.permissions&n.aX.CREATE))),async callback(e){a({destination:e[0],action:ae.COPY})}}),m.includes(i)||d.includes(i)||t.some((e=>!(e.permissions&n.aX.CREATE)))||e!==ae.MOVE&&e!==ae.MOVE_OR_COPY||r.push({label:l?(0,o.Tl)("files","Move to {target}",{target:l},void 0,{escape:!1,sanitize:!1}):(0,o.Tl)("files","Move"),type:e===ae.MOVE?"primary":"secondary",icon:se,async callback(e){a({destination:e[0],action:ae.MOVE})}}),r})).build().pick().catch((e=>{R.A.debug(e),e instanceof i.vT?a(!1):r(new Error((0,o.Tl)("files","Move or copy operation failed")))})),l}const we=new n.hY({id:"move-copy",displayName(e){switch(fe(e)){case ae.MOVE:return(0,o.Tl)("files","Move");case ae.COPY:return(0,o.Tl)("files","Copy");case ae.MOVE_OR_COPY:return(0,o.Tl)("files","Move or copy")}},iconSvgInline:()=>se,enabled:(e,t)=>"public-file-share"!==t.id&&!!e.every((e=>e.root?.startsWith("/files/")))&&e.length>0&&(oe(e)||re(e)),async exec(e,t,s){const n=fe([e]);let a;try{a=await he(n,s,[e])}catch(e){return R.A.error(e),!1}if(!1===a)return(0,i.cf)((0,o.Tl)("files",'Cancelled move or copy of "{filename}".',{filename:e.displayname})),null;try{return await pe(e,a.destination,a.action),!0}catch(e){return!!(e instanceof Error&&e.message)&&((0,i.Qg)(e.message),null)}},async execBatch(e,t,s){const n=fe(e),a=await he(n,s,e);if(!1===a)return(0,i.cf)(1===e.length?(0,o.Tl)("files",'Cancelled move or copy of "{filename}".',{filename:e[0].displayname}):(0,o.Tl)("files","Cancelled move or copy operation")),e.map((()=>null));const r=e.map((async e=>{try{return await pe(e,a.destination,a.action),!0}catch(t){return R.A.error(`Failed to ${a.action} node`,{node:e,error:t}),!1}}));return await Promise.all(r)},order:15}),ve='',be=new n.hY({id:"open-folder",displayName(e){const t=e[0].displayname;return(0,o.Tl)("files","Open folder {displayName}",{displayName:t})},iconSvgInline:()=>ve,enabled(e){if(1!==e.length)return!1;const t=e[0];return!!t.isDavRessource&&t.type===n.pt.Folder&&!!(t.permissions&n.aX.READ)},exec:async(e,t)=>!(!e||e.type!==n.pt.Folder)&&(window.OCP.Files.Router.goToRoute(null,{view:t.id,fileid:String(e.fileid)},{dir:e.path}),null),default:n.m9.HIDDEN,order:-100}),ye=new n.hY({id:"open-in-files-recent",displayName:()=>(0,o.Tl)("files","Open in Files"),iconSvgInline:()=>"",enabled:(e,t)=>"recent"===t.id,async exec(e){let t=e.dirname;return e.type===n.pt.Folder&&(t=t+"/"+e.basename),window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:String(e.fileid)},{dir:t,openfile:"true"}),null},order:-1e3,default:n.m9.HIDDEN});var Te=s(19664);const ke=new n.hY({id:"rename",displayName:()=>(0,o.Tl)("files","Rename"),iconSvgInline:()=>Te,enabled:(e,t)=>0!==e.length&&"public-file-share"!==t.id&&e.every((e=>Boolean(e.permissions&n.aX.DELETE))),exec:async e=>((0,U.Ic)("files:node:rename",e),null),order:10});var xe=s(49981);const Ce=new n.hY({id:"details",displayName:()=>(0,o.Tl)("files","Open details"),iconSvgInline:()=>xe,enabled:e=>!(0,$.f)()&&1===e.length&&!!e[0]&&!!window?.OCA?.Files?.Sidebar&&((e[0].root?.startsWith("/files/")&&e[0].permissions!==n.aX.NONE)??!1),async exec(e,t,s){try{return window.OCA.Files.Sidebar.file===e.path?(R.A.debug("Sidebar already open for this file",{node:e}),null):(window.OCA.Files.Sidebar.setActiveTab("sharing"),await window.OCA.Files.Sidebar.open(e.path),window.OCP?.Files?.Router?.goToRoute(null,{view:t.id,fileid:String(e.fileid)},{...window.OCP.Files.Router.query,dir:s,opendetails:"true"},!0),null)}catch(e){return R.A.error("Error while opening sidebar",{error:e}),!1}},order:-50}),Le=new n.hY({id:"view-in-folder",displayName:()=>(0,o.Tl)("files","View in folder"),iconSvgInline:()=>se,enabled(e,t){if((0,$.f)())return!1;if("files"===t.id)return!1;if(1!==e.length)return!1;const s=e[0];return!!s.isDavRessource&&!!s.root?.startsWith("/files")&&s.permissions!==n.aX.NONE&&s.type===n.pt.File},exec:async e=>!(!e||e.type!==n.pt.File)&&(window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:String(e.fileid)},{dir:e.dirname}),null),order:80});class Se extends n.L3{constructor(){var e,t,s;super("files:hidden",0),e=this,s=void 0,(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var s=t.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t="showHidden"))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,this.showHidden=(0,a.C)("files","config",{show_hidden:!1}).show_hidden,(0,U.B1)("files:config:updated",(e=>{let{key:t,value:s}=e;"show_hidden"===t&&(this.showHidden=Boolean(s),this.filterUpdated())}))}filter(e){return this.showHidden?e:e.filter((e=>!0!==e.attributes.hidden&&!e.basename.startsWith(".")))}}var Ue=s(9165),Ne=s(57505),_e=s(6695),Ae=s(24764),Fe=s(15502);const Ee=(0,g.pM)({__name:"FileListFilter",props:{isActive:{type:Boolean},filterName:null},emits:["reset-filter"],setup:e=>({__sfc:!0,t:o.t,NcActions:Ae.A,NcActionButton:Ne.A,NcActionSeparator:Fe.A})});var Pe=s(85072),Ie=s.n(Pe),Oe=s(97825),Re=s.n(Oe),je=s(77659),ze=s.n(je),Be=s(55056),Me=s.n(Be),De=s(10540),Ve=s.n(De),He=s(41113),$e=s.n(He),We=s(69409),Ye={};Ye.styleTagTransform=$e(),Ye.setAttributes=Me(),Ye.insert=ze().bind(null,"head"),Ye.domAPI=Re(),Ye.insertStyleElement=Ve(),Ie()(We.A,Ye),We.A&&We.A.locals&&We.A.locals;var Ge=s(14486);const qe=(0,Ge.A)(Ee,(function(){var e=this,t=e._self._c,s=e._self._setupProxy;return t(s.NcActions,{attrs:{"force-menu":"",type:e.isActive?"secondary":"tertiary","menu-name":e.filterName},scopedSlots:e._u([{key:"icon",fn:function(){return[e._t("icon")]},proxy:!0}],null,!0)},[e._v(" "),e._t("default"),e._v(" "),e.isActive?[t(s.NcActionSeparator),e._v(" "),t(s.NcActionButton,{staticClass:"files-list-filter__clear-button",attrs:{"close-after-click":""},on:{click:function(t){return e.$emit("reset-filter")}}},[e._v("\n\t\t\t"+e._s(s.t("files","Clear filter"))+"\n\t\t")])]:e._e()],2)}),[],!1,null,"5c37f334",null).exports,Ke=(0,g.pM)({name:"FileListFilterType",components:{FileListFilter:qe,NcActionButton:Ne.A,NcIconSvgWrapper:_e.A},props:{presets:{type:Array,default:()=>[]},typePresets:{type:Array,required:!0}},setup:()=>({mdiFile:Ue.DvY,t:o.Tl}),data:()=>({selectedOptions:[]}),computed:{isActive(){return this.selectedOptions.length>0}},watch:{presets(){this.selectedOptions=this.presets??[]},selectedOptions(e,t){0===this.selectedOptions.length?0!==t.length&&this.$emit("update:presets"):this.$emit("update:presets",this.selectedOptions)}},mounted(){this.selectedOptions=this.presets??[]},methods:{resetFilter(){this.selectedOptions=[]},toggleOption(e){const t=this.selectedOptions.indexOf(e);-1!==t?this.selectedOptions.splice(t,1):this.selectedOptions.push(e)}}});var Xe=s(95294),Je={};Je.styleTagTransform=$e(),Je.setAttributes=Me(),Je.insert=ze().bind(null,"head"),Je.domAPI=Re(),Je.insertStyleElement=Ve(),Ie()(Xe.A,Je),Xe.A&&Xe.A.locals&&Xe.A.locals;const Ze=(0,Ge.A)(Ke,(function(){var e=this,t=e._self._c;return e._self._setupProxy,t("FileListFilter",{staticClass:"file-list-filter-type",attrs:{"is-active":e.isActive,"filter-name":e.t("files","Type")},on:{"reset-filter":e.resetFilter},scopedSlots:e._u([{key:"icon",fn:function(){return[t("NcIconSvgWrapper",{attrs:{path:e.mdiFile}})]},proxy:!0}])},[e._v(" "),e._l(e.typePresets,(function(s){return t("NcActionButton",{key:s.id,attrs:{type:"checkbox","model-value":e.selectedOptions.includes(s)},on:{click:function(t){return e.toggleOption(s)}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("NcIconSvgWrapper",{attrs:{svg:s.icon}})]},proxy:!0}],null,!0)},[e._v("\n\t\t"+e._s(s.label)+"\n\t")])}))],2)}),[],!1,null,null,null).exports;function Qe(e,t,s){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var s=t.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const et=(e,t)=>e.replace("[{id:"document",label:(0,o.t)("files","Documents"),icon:et('',"#49abea"),mime:["x-office/document"]},{id:"spreadsheet",label:(0,o.t)("files","Spreadsheets"),icon:et('',"#9abd4e"),mime:["x-office/spreadsheet"]},{id:"presentation",label:(0,o.t)("files","Presentations"),icon:et('',"#f0965f"),mime:["x-office/presentation"]},{id:"pdf",label:(0,o.t)("files","PDFs"),icon:et('',"#dc5047"),mime:["application/pdf"]},{id:"folder",label:(0,o.t)("files","Folders"),icon:et(ve,window.getComputedStyle(document.body).getPropertyValue("--color-primary-element")),mime:["httpd/unix-directory"]},{id:"audio",label:(0,o.t)("files","Audio"),icon:'',mime:["audio"]},{id:"image",label:(0,o.t)("files","Photos and images"),icon:'',mime:["image"]},{id:"video",label:(0,o.t)("files","Videos"),icon:'',mime:["video"]}])()),this.currentInstance&&(this.currentInstance.$destroy(),delete this.currentInstance);const t=g.Ay.extend(Ze);this.currentInstance=new t({propsData:{presets:this.currentPresets,typePresets:this.allPresets},el:e}).$on("update:presets",this.setPresets.bind(this)).$mount()}filter(e){if(!this.currentPresets||0===this.currentPresets.length)return e;const t=this.currentPresets.reduce(((e,t)=>[...e,...t.mime]),[]);return e.filter((e=>{if(!e.mime)return!1;const s=e.mime.toLowerCase();return!!t.includes(s)||!!t.includes(window.OC.MimeTypeList.aliases[s])||!!t.includes(s.split("/")[0])}))}reset(){this.setPresets()}setPresets(e){this.currentPresets=e??[],void 0!==this.currentInstance&&(this.currentInstance.$props.presets=e),this.filterUpdated();const t=[];if(e&&e.length>0)for(const s of e)t.push({icon:s.icon,text:s.label,onclick:()=>this.removeFilterPreset(s.id)});else this.currentInstance?.resetFilter();this.updateChips(t)}removeFilterPreset(e){const t=this.currentPresets.filter((t=>{let{id:s}=t;return s!==e}));this.setPresets(t)}}const st=(0,g.pM)({components:{FileListFilter:qe,NcActionButton:Ne.A,NcIconSvgWrapper:_e.A},props:{timePresets:{type:Array,required:!0}},setup:()=>({mdiCalendarRange:Ue.O1W}),data:()=>({selectedOption:null,timeRangeEnd:null,timeRangeStart:null}),computed:{isActive(){return null!==this.selectedOption},currentPreset(){return this.timePresets.find((e=>{let{id:t}=e;return t===this.selectedOption}))??null}},watch:{selectedOption(){if(null===this.selectedOption)this.$emit("update:preset");else{const e=this.currentPreset;this.$emit("update:preset",e)}}},methods:{t:o.Tl,resetFilter(){this.selectedOption=null,this.timeRangeEnd=null,this.timeRangeStart=null}}});var nt=s(27107),it={};it.styleTagTransform=$e(),it.setAttributes=Me(),it.insert=ze().bind(null,"head"),it.domAPI=Re(),it.insertStyleElement=Ve(),Ie()(nt.A,it),nt.A&&nt.A.locals&&nt.A.locals;const at=(0,Ge.A)(st,(function(){var e=this,t=e._self._c;return e._self._setupProxy,t("FileListFilter",{attrs:{"is-active":e.isActive,"filter-name":e.t("files","Modified")},on:{"reset-filter":e.resetFilter},scopedSlots:e._u([{key:"icon",fn:function(){return[t("NcIconSvgWrapper",{attrs:{path:e.mdiCalendarRange}})]},proxy:!0}])},[e._v(" "),e._l(e.timePresets,(function(s){return t("NcActionButton",{key:s.id,attrs:{type:"radio","close-after-click":"","model-value":e.selectedOption,value:s.id},on:{"update:modelValue":function(t){e.selectedOption=t},"update:model-value":function(t){e.selectedOption=t}}},[e._v("\n\t\t"+e._s(s.label)+"\n\t")])}))],2)}),[],!1,null,"cfb7f0ce",null).exports;function ot(e,t,s){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var s=t.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const rt=()=>(new Date).setHours(0,0,0,0),lt=[{id:"today",label:(0,o.t)("files","Today"),filter:e=>e>rt()},{id:"last-7",label:(0,o.t)("files","Last 7 days"),filter:e=>e>rt()-6048e5},{id:"last-30",label:(0,o.t)("files","Last 30 days"),filter:e=>e>rt()-2592e6},{id:"this-year",label:(0,o.t)("files","This year ({year})",{year:(new Date).getFullYear()}),filter:e=>e>new Date(rt()).setMonth(0,1)},{id:"last-year",label:(0,o.t)("files","Last year ({year})",{year:(new Date).getFullYear()-1}),filter:e=>e>new Date(rt()).setFullYear((new Date).getFullYear()-1,0,1)&&evoid 0===e.mtime||this.currentPreset.filter(e.mtime.getTime()))):e}reset(){this.setPreset()}setPreset(e){this.currentPreset=e,this.filterUpdated();const t=[];e?t.push({icon:'',text:e.label,onclick:()=>this.setPreset()}):this.currentInstance?.resetFilter(),this.updateChips(t)}}var dt=s(32051),ct=s(94219),gt=s(82182);const ut=(0,g.pM)({__name:"NewNodeDialog",props:{defaultName:{type:String,default:(0,o.t)("files","New folder")},otherNames:{type:Array,default:()=>[]},open:{type:Boolean,default:!0},name:{type:String,default:(0,o.t)("files","Create new folder")},label:{type:String,default:(0,o.t)("files","Folder name")}},emits:["close"],setup(e,t){let{emit:s}=t;const i=e,a=(0,g.KR)(i.defaultName),r=(0,g.KR)(),l=(0,g.KR)(),m=(0,g.KR)("");function d(){(0,g.dY)((()=>{const e=r.value?.$el.querySelector("input");if(!i.open||!e)return;const t=a.value.length-(0,ee.extname)(a.value).length;e.focus(),e.setSelectionRange(0,t)}))}return(0,g.wB)((()=>[i.defaultName,i.otherNames]),(()=>{a.value=(0,n.E6)(i.defaultName,i.otherNames).trim()})),(0,g.nT)((()=>{i.otherNames.includes(a.value.trim())?m.value=(0,o.t)("files","This name is already in use."):m.value=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(""===e.trim())return(0,o.t)("files","Filename must not be empty.");try{return(0,n.KT)(e),""}catch(e){if(!(e instanceof n.di))throw e;switch(e.reason){case n.nF.Character:return(0,o.t)("files",'"{char}" is not allowed inside a filename.',{char:e.segment},void 0,{escape:t});case n.nF.ReservedName:return(0,o.t)("files",'"{segment}" is a reserved name and not allowed for filenames.',{segment:e.segment},void 0,{escape:!1});case n.nF.Extension:return e.segment.match(/\.[a-z]/i)?(0,o.t)("files",'"{extension}" is not an allowed filetype.',{extension:e.segment},void 0,{escape:!1}):(0,o.t)("files",'Filenames must not end with "{extension}".',{extension:e.segment},void 0,{escape:!1});default:return(0,o.t)("files","Invalid filename.")}}}(a.value.trim());const e=r.value?.$el.querySelector("input");e&&(e.setCustomValidity(m.value),e.reportValidity())})),(0,g.wB)((()=>i.open),(()=>{(0,g.dY)((()=>{d()}))})),(0,g.sV)((()=>{a.value=(0,n.E6)(a.value,i.otherNames).trim(),(0,g.dY)((()=>d()))})),{__sfc:!0,props:i,emit:s,localDefaultName:a,nameInput:r,formElement:l,validity:m,focusInput:d,submit:function(){l.value?.requestSubmit()},t:o.t,NcButton:dt.A,NcDialog:ct.A,NcTextField:gt.A}}});var ft=s(17104),pt={};pt.styleTagTransform=$e(),pt.setAttributes=Me(),pt.insert=ze().bind(null,"head"),pt.domAPI=Re(),pt.insertStyleElement=Ve(),Ie()(ft.A,pt),ft.A&&ft.A.locals&&ft.A.locals;const ht=(0,Ge.A)(ut,(function(){var e=this,t=e._self._c,s=e._self._setupProxy;return t(s.NcDialog,{attrs:{"data-cy-files-new-node-dialog":"",name:e.name,open:e.open,"close-on-click-outside":"","out-transition":""},on:{"update:open":function(e){return s.emit("close",null)}},scopedSlots:e._u([{key:"actions",fn:function(){return[t(s.NcButton,{attrs:{"data-cy-files-new-node-dialog-submit":"",type:"primary",disabled:""!==s.validity},on:{click:s.submit}},[e._v("\n\t\t\t"+e._s(s.t("files","Create"))+"\n\t\t")])]},proxy:!0}])},[e._v(" "),t("form",{ref:"formElement",staticClass:"new-node-dialog__form",on:{submit:function(e){return e.preventDefault(),s.emit("close",s.localDefaultName)}}},[t(s.NcTextField,{ref:"nameInput",attrs:{"data-cy-files-new-node-dialog-input":"",error:""!==s.validity,"helper-text":s.validity,label:e.label,value:s.localDefaultName},on:{"update:value":function(e){s.localDefaultName=e}}})],1)])}),[],!1,null,"42dcb609",null).exports;function wt(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=t.map((e=>e.basename));return new Promise((t=>{(0,i.Ss)(ht,{...s,defaultName:e,otherNames:n},(e=>{t(e)}))}))}const vt={id:"newFolder",displayName:(0,o.Tl)("files","New folder"),enabled:e=>Boolean(e.permissions&n.aX.CREATE)&&Boolean(e.permissions&n.aX.READ),iconSvgInline:'',order:0,async handler(e,t){const s=await wt((0,o.Tl)("files","New folder"),t);if(null!==s)try{const{fileid:t,source:a}=await(async(e,t)=>{const s=e.source+"/"+t,n=e.encodedSource+"/"+encodeURIComponent(t),i=await(0,_.Ay)({method:"MKCOL",url:n,headers:{Overwrite:"F"}});return{fileid:parseInt(i.headers["oc-fileid"]),source:s}})(e,s.trim()),r=new n.vd({source:a,id:t,mtime:new Date,owner:e.owner,permissions:n.aX.ALL,root:e?.root||"/files/"+(0,d.HW)()?.uid,attributes:{"mount-type":e.attributes?.["mount-type"],"owner-id":e.attributes?.["owner-id"],"owner-display-name":e.attributes?.["owner-display-name"]}});(0,U.Ic)("files:node:created",r),(0,i.Te)((0,o.Tl)("files",'Created new folder "{name}"',{name:(0,ee.basename)(a)})),R.A.debug("Created new folder",{folder:r,source:a}),window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:String(t)},{dir:e.path})}catch(e){R.A.error("Creating new folder failed",{error:e}),(0,i.Qg)("Creating new folder failed")}else(0,i.cf)((0,o.Tl)("files","New folder creation cancelled"))}},bt=(0,a.C)("files","templates_enabled",!0);let yt=(0,a.C)("files","templates_path",!1);R.A.debug("Templates folder enabled",{templatesEnabled:bt}),R.A.debug("Initial templates folder",{templatesPath:yt});const Tt={id:"template-picker",displayName:(0,o.Tl)("files","Create templates folder"),iconSvgInline:'',order:30,enabled:e=>!(!bt||yt||e.owner!==(0,d.HW)()?.uid||!(e.permissions&n.aX.CREATE)),async handler(e,t){const s=await wt((0,o.Tl)("files","Templates"),t,{name:(0,o.Tl)("files","New template folder")});null!==s&&(async function(e,t){const s=(0,ee.join)(e.path,t);try{R.A.debug("Initializing the templates directory",{templatePath:s});const{data:e}=await _.Ay.post((0,k.KT)("apps/files/api/v1/templates/path"),{templatePath:s,copySystemTemplates:!0});window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:void 0},{dir:s}),R.A.info("Created new templates folder",{...e.ocs.data}),yt=e.ocs.data.templates_path}catch(e){R.A.error("Unable to initialize the templates directory"),(0,i.Qg)((0,o.Tl)("files","Unable to initialize the templates directory"))}}(e,s),(0,n.gj)("template-picker"))}},kt=(0,g.$V)((()=>Promise.all([s.e(4208),s.e(6366)]).then(s.bind(s,33976))));let xt=null;const Ct=async e=>{if(null===xt){const t=document.createElement("div");t.id="template-picker",document.body.appendChild(t),xt=new g.Ay({render:t=>t(kt,{ref:"picker",props:{parent:e}}),methods:{open(){this.$refs.picker.open(...arguments)}},el:t})}return xt},Lt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";return"/"!==e?ue(e):new le.CancelablePromise(((e,t,s)=>{const i=(0,n.Q$)(de).catch(t).then((s=>{s?e({contents:s,folder:new n.vd({id:0,source:`${n.PY}${n.lJ}`,root:n.lJ,owner:(0,d.HW)()?.uid||null,permissions:n.aX.READ})}):t()}));s((()=>i.cancel()))}))},St=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new n.Ss({id:Ut(e.path),name:e.displayname,icon:ve,order:t,params:{dir:e.path,fileid:String(e.fileid),view:"favorites"},parent:"favorites",columns:[],getContents:Lt})},Ut=function(e){return`favorite-${function(e){let t=0;for(let s=0;s>>0}(e)}`};var Nt=s(65899);const _t=(0,a.C)("files","config",{show_hidden:!1,crop_image_previews:!0,sort_favorites_first:!0,sort_folders_first:!0,grid_view:!1,show_dialog_file_extension:!0}),At=(0,Nt.nY)("userconfig",(()=>{const e=(0,g.KR)({..._t});return(0,U.B1)("files:config:updated",(t=>{let{key:s,value:n}=t;return function(t,s){(0,g.hZ)(e.value,t,s)}(s,n)})),{userConfig:e,update:async function(e,t){null!==(0,d.HW)()&&await _.Ay.put((0,k.Jv)("/apps/files/api/v1/config/{key}",{key:e}),{value:t}),(0,U.Ic)("files:config:updated",{key:e,value:t})}}})),Ft=Math.round(Date.now()/1e3-1209600),Et=e=>(0,n.Al)(e,n.lJ,(0,k.$_)()),Pt=(0,d.HW)()?.uid,It=function(e){const t=e.attributes["mount-type"];return Pt===e.owner&&!["group","shared"].includes(t)},Ot="folders",Rt=`${n.PY}/files/${(0,d.HW)()?.uid}`,jt=Intl.Collator([(0,o.Z0)(),(0,o.lO)()],{numeric:!0,usage:"sort"}),zt=(e,t)=>jt.compare(e.displayName??e.basename,t.displayName??t.basename),Bt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=e.toSorted(zt);for(const{id:e,basename:i,displayName:a,children:o}of n){const n=(0,c.HS)(t,i),r=`${Rt}${n}`,l={source:r,encodedSource:Dt(r),path:n,fileid:e,basename:i};a&&(l.displayName=a),s.push(l),o.length>0&&Bt(o,n,s)}return s},Mt=e=>ue(e),Dt=e=>{const{origin:t}=new URL(e);return t+(0,c.O0)(e.slice(t.length))},Vt=e=>{const t=(0,c.pD)(e);return t===Rt?Ot:Dt(t)},Ht=(0,a.C)("files","config",{folder_tree:!0}).folder_tree;let $t=(0,a.C)("files","config",{show_hidden:!1}).show_hidden;const Wt=(0,n.bh)(),Yt=new r.A({concurrency:5,intervalCap:5,interval:200}),Gt=new r.A({concurrency:5,intervalCap:5,interval:200}),qt=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";await Yt.add((async()=>{const t=await async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const{data:s}=await _.Ay.get((0,k.KT)("/apps/files/api/v1/folder-tree"),{params:new URLSearchParams({path:e,depth:String(t)})});return Bt(s,e)}(e),s=t.map((e=>Gt.add((()=>Xt(e)))));await Promise.allSettled(s)}))},Kt=e=>async t=>{t.loading||t.loaded||(t.loading=!0,await qt(e.path),t.loading=!1,t.loaded=!0,(0,U.Ic)("files:navigation:updated"),(0,U.Ic)("files:folder-tree:expanded"))},Xt=e=>{const t=Wt.views.find((t=>t.id===e.encodedSource));t&&Wt.remove(t.id),!$t&&e.basename.startsWith(".")||Wt.register(new n.Ss({id:e.encodedSource,parent:Vt(e.source),name:e.displayName??e.displayname??e.basename,icon:ve,getContents:Mt,loadChildViews:Kt(e),params:{view:Ot,fileid:String(e.fileid),dir:e.path}}))},Jt=e=>{e instanceof n.vd&&Xt(e)},Zt=e=>{e instanceof n.vd&&(e=>{const t=e.encodedSource;Wt.remove(t)})(e)},Qt=e=>{let{node:t,oldSource:s}=e;if(!(t instanceof n.vd))return;var i;i=s,Wt.remove(i),Xt(t);const a=t.source.replace(Rt,""),o=s.replace(Rt,""),r=Wt.views.filter((e=>!!e.params?.dir&&!(0,c.ys)(e.params.dir,o)&&e.params.dir.startsWith(o)));for(const e of r)e.parent=Vt(t.source),e.params.dir=e.params.dir.replace(o,a)},es=async e=>{let{key:t,value:s}=e;"show_hidden"===t&&($t=s,await qt(),(0,U.Ic)("files:folder-tree:initialized"))},ts=new r.A({concurrency:5}),ss=function(e,t){return _.Ay.post((0,k.KT)("/apps/files/api/v1/convert"),{fileId:e,targetMimeType:t})},ns="convert";(()=>{const e=((0,N.F)()?.files?.file_conversions??[]).map((e=>{let{to:t,from:s,displayName:a}=e;return new n.hY({id:`convert-${s}-${t}`,displayName:()=>(0,o.t)("files","Save as {displayName}",{displayName:a}),iconSvgInline:()=>{return e=t,`\n\t\t\n\t`;var e},enabled:e=>e.every((e=>s===e.mime)),exec:async e=>(async function(e,t){const s=(0,i.Cs)((0,o.t)("files","Converting file …"));try{const s=await ts.add((()=>ss(e,t)));(0,i.Te)((0,o.t)("files","File successfully converted"));const n=await ce(s.data.ocs.data.path);(0,U.Ic)("files:node:created",n);const a=s.data.ocs.data.fileId;window.OCP.Files.Router.goToRoute(null,{...window.OCP.Files.Router.params,fileid:a.toString()},window.OCP.Files.Router.query)}catch(s){if((0,_.F0)(s)&&s.response?.data?.ocs?.meta?.message)return void(0,i.Qg)((0,o.t)("files","Failed to convert file: {message}",{message:s.response.data.ocs.meta.message}));R.A.error("Failed to convert file",{fileId:e,targetMimeType:t,error:s}),(0,i.Qg)((0,o.t)("files","Failed to convert file"))}finally{s.hideToast()}}(e.fileid,t),null),execBatch:async e=>(async function(e,t){const s=e.map((e=>ts.add((()=>ss(e,t))))),n=(0,i.Cs)((0,o.t)("files","Converting files …"));try{const n=await Promise.allSettled(s),a=n.filter((e=>"rejected"===e.status));if(a.length>0){const s=a.map((e=>e.reason?.response?.data?.ocs?.meta?.message));return R.A.error("Failed to convert files",{fileIds:e,targetMimeType:t,messages:s}),1===new Set(s).size&&"string"==typeof s[0]?void(0,i.Qg)((0,o.t)("files","Failed to convert files: {message}",{message:s[0]})):a.length===e.length?void(0,i.Qg)((0,o.t)("files","All files failed to be converted")):1===a.length?s[0]?void(0,i.Qg)((0,o.t)("files","One file could not be converted: {message}",{message:s[0]})):void(0,i.Qg)((0,o.t)("files","One file could not be converted")):((0,i.Qg)((0,o.t)("files","{count} files could not be converted",{count:a.length})),void(0,i.Te)((0,o.t)("files","{count} files successfully converted",{count:e.length-a.length})))}(0,i.Te)((0,o.t)("files","Files successfully converted"));const r=window.OCP.Files.Router.query.dir,l=n.filter((e=>"fulfilled"===e.status)).map((e=>e.value.data.ocs.data.path)).filter((e=>e.startsWith(r)));R.A.debug("Files to fetch",{newPaths:l}),(await Promise.all(l.map((e=>ce(e))))).forEach((e=>(0,U.Ic)("files:node:created",e)));const m=n[0].value.data.ocs.data.fileId;window.OCP.Files.Router.goToRoute(null,{...window.OCP.Files.Router.params,fileid:m.toString()},window.OCP.Files.Router.query)}catch(s){(0,i.Qg)((0,o.t)("files","Failed to convert files")),R.A.error("Failed to convert files",{fileIds:e,targetMimeType:t,error:s})}finally{n.hideToast()}}(e.map((e=>e.fileid)).filter(Boolean),t),Array(e.length).fill(null)),parent:ns})}));(0,n.Gg)(new n.hY({id:ns,displayName:()=>(0,o.t)("files","Save as …"),iconSvgInline:()=>'',enabled:(t,s)=>e.some((e=>e.enabled(t,s))),exec:async()=>null,order:25})),e.forEach(n.Gg)})(),(0,n.Gg)(z),(0,n.Gg)(H),(0,n.Gg)(Y),(0,n.Gg)(Z),(0,n.Gg)(we),(0,n.Gg)(be),(0,n.Gg)(ye),(0,n.Gg)(ke),(0,n.Gg)(Ce),(0,n.Gg)(Le),(0,n.zj)(vt),(0,n.zj)(Tt),(0,a.C)("files","templates",[]).forEach(((e,t)=>{(0,n.zj)({id:`template-new-${e.app}-${t}`,displayName:e.label,iconClass:e.iconClass||"icon-file",iconSvgInline:e.iconSvgInline,enabled:e=>!!(e.permissions&n.aX.CREATE),order:11,async handler(t,s){const n=Ct(t),i=await wt(`${e.label}${e.extension}`,s,{label:(0,o.Tl)("files","Filename"),name:e.label});null!==i&&(await n).open(i.trim(),e)}})})),!1===(0,$.f)()&&((async()=>{const e=(0,n.bh)();e.register(new n.Ss({id:"favorites",name:(0,o.Tl)("files","Favorites"),caption:(0,o.Tl)("files","List of favorite files and folders."),emptyTitle:(0,o.Tl)("files","No favorites yet"),emptyCaption:(0,o.Tl)("files","Files and folders you mark as favorite will show up here"),icon:q,order:15,columns:[],getContents:Lt}));const t=(await(0,n.Q$)(de)).filter((e=>e.type===n.pt.Folder)),s=t.map(((e,t)=>St(e,t)));R.A.debug("Generating favorites view",{favoriteFolders:t}),s.forEach((t=>e.register(t))),(0,U.B1)("files:favorites:added",(e=>{e.type===n.pt.Folder&&(null!==e.path&&e.root?.startsWith("/files")?a(e):R.A.error("Favorite folder is not within user files root",{node:e}))})),(0,U.B1)("files:favorites:removed",(e=>{e.type===n.pt.Folder&&(null!==e.path&&e.root?.startsWith("/files")?r(e.path):R.A.error("Favorite folder is not within user files root",{node:e}))})),(0,U.B1)("files:node:renamed",(e=>{e.type===n.pt.Folder&&1===e.attributes.favorite&&l(e)}));const i=function(){t.sort(((e,t)=>e.path.localeCompare(t.path,(0,o.Z0)(),{ignorePunctuation:!0}))),t.forEach(((e,t)=>{const n=s.find((t=>t.id===Ut(e.path)));n&&(n.order=t)}))},a=function(n){const a=St(n);t.find((e=>e.path===n.path))||(t.push(n),s.push(a),i(),e.register(a))},r=function(n){const a=Ut(n),o=t.findIndex((e=>e.path===n));-1!==o&&(t.splice(o,1),s.splice(o,1),e.remove(a),i())},l=function(e){const s=t.find((t=>t.fileid===e.fileid));void 0!==s&&(r(s.path),a(e))}})(),(0,n.bh)().register(new n.Ss({id:"files",name:(0,o.Tl)("files","All files"),caption:(0,o.Tl)("files","List of your files and folders."),icon:ve,order:0,getContents:ue})),(0,n.bh)().register(new n.Ss({id:"recent",name:(0,o.Tl)("files","Recent"),caption:(0,o.Tl)("files","List of recently modified files and folders."),emptyTitle:(0,o.Tl)("files","No recently modified files"),emptyCaption:(0,o.Tl)("files","Files and folders you recently modified will show up here."),icon:'',order:10,defaultSortKey:"mtime",getContents:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";const t=At((window._nc_files_pinia||(window._nc_files_pinia=(0,Nt.Ey)()),window._nc_files_pinia)),s=s=>"/"!==e||t.userConfig.show_hidden||!s.dirname.split("/").some((e=>e.startsWith("."))),i=new AbortController;return new le.CancelablePromise((async(e,t,a)=>{a((()=>i.abort())),e((async()=>{const e=(await de.search("/",{signal:i.signal,details:!0,data:(0,n.R3)(Ft)})).data.results.map(Et).filter(s);return{folder:new n.vd({id:0,source:`${n.PY}${n.lJ}`,root:n.lJ,owner:(0,d.HW)()?.uid||null,permissions:n.aX.READ}),contents:e}})())}))}})),(0,n.bh)().register(new n.Ss({id:"personal",name:(0,o.Tl)("files","Personal files"),caption:(0,o.Tl)("files","List of your files and folders that are not shared."),emptyTitle:(0,o.Tl)("files","No personal files found"),emptyCaption:(0,o.Tl)("files","Files that are not shared will show up here."),icon:'',order:5,getContents:function(){return ue(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/").then((e=>(e.contents=e.contents.filter(It),e)))}})),(async()=>{Ht&&(Wt.register(new n.Ss({id:Ot,name:(0,o.Tl)("files","All folders"),caption:(0,o.Tl)("files","List of your files and folders."),icon:te,order:50,getContents:Mt})),await qt(),(0,U.B1)("files:node:created",Jt),(0,U.B1)("files:node:deleted",Zt),(0,U.B1)("files:node:moved",Qt),(0,U.B1)("files:config:updated",es),(0,U.Ic)("files:folder-tree:initialized"))})()),(0,n.cZ)(new Se),(0,n.cZ)(new tt),(0,n.cZ)(new mt),"serviceWorker"in navigator?window.addEventListener("load",(async()=>{try{const e=(0,k.Jv)("/apps/files/preview-service-worker.js",{},{noRewrite:!0});let t=(0,k.aU)();""===t&&(t="/");const s=await navigator.serviceWorker.register(e,{scope:t});R.A.debug("SW registered: ",{registration:s})}catch(e){R.A.error("SW registration failed: ",{error:e})}})):R.A.debug("Service Worker is not enabled on this browser."),(0,n.Yc)("nc:hidden",{nc:"http://nextcloud.org/ns"}),(0,n.Yc)("nc:is-mount-root",{nc:"http://nextcloud.org/ns"}),(0,n.Yc)("nc:metadata-blurhash",{nc:"http://nextcloud.org/ns"}),(0,n.Yc)("nc:metadata-files-live-photo",{nc:"http://nextcloud.org/ns"})},9558:(e,t,s)=>{s.d(t,{A:()=>n});const n=(0,s(35947).YK)().setApp("files").detectUser().build()},27107:(e,t,s)=>{s.d(t,{A:()=>r});var n=s(71354),i=s.n(n),a=s(76314),o=s.n(a)()(i());o.push([e.id,".files-list-filter-time__clear-button[data-v-cfb7f0ce] .action-button__text{color:var(--color-error-text)}","",{version:3,sources:["webpack://./apps/files/src/components/FileListFilter/FileListFilterModified.vue"],names:[],mappings:"AAEC,4EACC,6BAAA",sourcesContent:["\n.files-list-filter-time {\n\t&__clear-button :deep(.action-button__text) {\n\t\tcolor: var(--color-error-text);\n\t}\n}\n"],sourceRoot:""}]);const r=o},69409:(e,t,s)=>{s.d(t,{A:()=>r});var n=s(71354),i=s.n(n),a=s(76314),o=s.n(a)()(i());o.push([e.id,"\n.files-list-filter__clear-button[data-v-5c37f334] .action-button__text {\n\tcolor: var(--color-error-text);\n}\n[data-v-5c37f334] .button-vue {\n\tfont-weight: normal !important;\n*[data-v-5c37f334] {\n\t\tfont-weight: normal !important;\n}\n}\n","",{version:3,sources:["webpack://./apps/files/src/components/FileListFilter/FileListFilter.vue"],names:[],mappings:";AAyCA;CACA,8BAAA;AACA;AAEA;CACA,8BAAA;AAEA;EACA,8BAAA;AACA;AACA",sourcesContent:["\x3c!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n--\x3e\n\n\n