/*! For license information please see files-init.js.LICENSE.txt */ (()=>{var e,s,t,n={9052:e=>{"use strict";var s=Object.prototype.hasOwnProperty,t="~";function n(){}function i(e,s,t){this.fn=e,this.context=s,this.once=t||!1}function a(e,s,n,a,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var l=new i(n,a||e,o),r=t?t+s:s;return e._events[r]?e._events[r].fn?e._events[r]=[e._events[r],l]:e._events[r].push(l):(e._events[r]=l,e._eventsCount++),e}function o(e,s){0==--e._eventsCount?e._events=new n:delete e._events[s]}function l(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(t=!1)),l.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)s.call(e,n)&&i.push(t?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},l.prototype.listeners=function(e){var s=t?t+e:e,n=this._events[s];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=new Array(a);i{"use strict";t.d(s,{A:()=>n});const n=(0,t(35947).YK)().setApp("files").detectUser().build()},75638:(e,s,t)=>{"use strict";var n=t(31346),i=t(85168),a=t(53334),o=t(49264),l=t(76150),r=t(61338),m=t(87485),d=t(65043);const c=()=>{var e;return!0===(null===(e=(0,m.F)())||void 0===e||null===(e=e.files)||void 0===e?void 0:e.undelete)},g=e=>e.every((e=>!0===e.attributes["is-mount-root"]&&"shared"===e.attributes["mount-type"])),u=e=>e.every((e=>!0===e.attributes["is-mount-root"]&&"external"===e.attributes["mount-type"])),f=(e,s)=>"trashbin"!==s.id&&c()?(e=>{if(1===e.length)return!1;const s=e.some((e=>g([e]))),t=e.some((e=>!g([e])));return s&&t})(e)?(0,a.t)("files","Delete and unshare"):g(e)?1===e.length?(0,a.t)("files","Leave this share"):(0,a.t)("files","Leave these shares"):u(e)?1===e.length?(0,a.t)("files","Disconnect storage"):(0,a.t)("files","Disconnect storages"):(e=>!e.some((e=>e.type!==n.pt.File)))(e)?1===e.length?(0,a.t)("files","Delete file"):(0,a.t)("files","Delete files"):(e=>!e.some((e=>e.type!==n.pt.Folder)))(e)?1===e.length?(0,a.t)("files","Delete folder"):(0,a.t)("files","Delete folders"):(0,a.t)("files","Delete"):(0,a.t)("files","Delete permanently"),p=async(e,s)=>{const t="trashbin"!==s.id&&c()?(0,a.n)("files","You are about to delete {count} item","You are about to delete {count} items",e.length,{count:e.length}):(0,a.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(t,(0,a.t)("files","Confirm deletion"),{type:window.OC.dialogs.YES_NO_BUTTONS,confirm:f(e,s),confirmClasses:"error",cancel:(0,a.t)("files","Cancel")},(e=>{n(e)}))}))},h=async e=>{await d.Ay.delete(e.encodedSource),(0,r.Ic)("files:node:deleted",e)},w=new o.A({concurrency:5}),v=new n.hY({id:"delete",displayName:f,iconSvgInline:e=>g(e)?'':u(e)?'':'',enabled:e=>e.length>0&&e.map((e=>e.permissions)).every((e=>Boolean(e&n.aX.DELETE))),async exec(e,s){try{let t=!0;return c()||(t=await p([e],s)),!1===t?((0,i.cf)((0,a.Tl)("files","Deletion cancelled")),null):(await h(e),!0)}catch(s){return l.A.error("Error while deleting a file",{error:s,source:e.source,node:e}),!1}},async execBatch(e,s){let t=!0;if(c()?e.length>=5&&!g(e)&&!u(e)&&(t=await p(e,s)):t=await p(e,s),!1===t)return(0,i.cf)((0,a.Tl)("files","Deletion cancelled")),Promise.all(e.map((()=>null)));const n=e.map((e=>new Promise((s=>{w.add((async()=>{try{await h(e),s(!0)}catch(t){l.A.error("Error while deleting a file",{error:t,source:e.source,node:e}),s(!1)}}))}))));return Promise.all(n)},order:100});var T=t(63814);const x=function(e){const s=document.createElement("a");s.download="",s.href=e,s.click()},y=function(e,s){const t=Math.random().toString(36).substring(2),n=(0,T.Jv)("/apps/files/ajax/download.php?dir={dir}&files={files}&downloadStartSecret={secret}",{dir:e,secret:t,files:JSON.stringify(s.map((e=>e.basename)))});x(n)},k=function(e){if(0==(e.permissions&n.aX.READ))return!1;if("shared"===e.attributes["mount-type"]){var s,t;const n=JSON.parse(null!==(s=e.attributes["share-attributes"])&&void 0!==s?s:"null"),i=null==n||null===(t=n.find)||void 0===t?void 0:t.call(n,(e=>"permissions"===e.scope&&"download"===e.key));if(void 0!==i&&!1===i.enabled)return!1}return!0},C=new n.hY({id:"download",default:n.m9.DEFAULT,displayName:()=>(0,a.Tl)("files","Download"),iconSvgInline:()=>'',enabled:e=>0!==e.length&&(!e.some((e=>e.type===n.pt.Folder))||!e.some((e=>{var s;return!(null!==(s=e.root)&&void 0!==s&&s.startsWith("/files"))})))&&e.every(k),exec:async(e,s,t)=>e.type===n.pt.Folder?(y(t,[e]),null):(x(e.encodedSource),null),async execBatch(e,s,t){return 1===e.length?(this.exec(e[0],s,t),[null]):(y(t,e),new Array(e.length).fill(null))},order:30});var b=t(71225),L=t(21777),S=t(65659);const U=async function(e){const s=(0,T.KT)("apps/files/api/v1")+"/openlocaleditor?format=json";try{var t;const n=await d.Ay.post(s,{path:e}),i=null===(t=(0,L.HW)())||void 0===t?void 0:t.uid;let a="nc://open/".concat(i,"@")+window.location.host+(0,b.O0)(e);a+="?token="+n.data.ocs.data.token,window.location.href=a}catch(e){(0,i.Qg)((0,a.Tl)("files","Failed to redirect to client"))}},A=new n.hY({id:"edit-locally",displayName:()=>(0,a.Tl)("files","Edit locally"),iconSvgInline:()=>'',enabled:e=>1===e.length&&0!=(e[0].permissions&n.aX.UPDATE),exec:async e=>((async e=>{U(e),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{},s=!1;(new i.ik).setName((0,a.Tl)("files","Edit file locally")).setText((0,a.Tl)("files","The file should now open locally. If you don't see this happening, make sure that the desktop client is installed on your system.")).setButtons([{label:(0,a.Tl)("files","Retry local edit"),icon:'',callback:()=>{s=!0,e(!1)}},{label:(0,a.Tl)("files","Edit online"),icon:S,type:"primary",callback:()=>{s=!0,e(!0)}}]).build().show().then((()=>{s||e(!1)}))}((s=>{s?U(e):window.OCA.Viewer.open({path:e})}))})(e.path),null),order:25});var _=t(85471);const F='',P=e=>e.some((e=>1!==e.attributes.favorite)),N=async(e,s,t)=>{try{const n=(0,T.Jv)("/apps/files/api/v1/files")+(0,b.O0)(e.path);return await d.Ay.post(n,{tags:t?[window.OC.TAG_FAVORITE]:[]}),"favorites"!==s.id||t||"/"!==e.dirname||(0,r.Ic)("files:node:deleted",e),_.Ay.set(e.attributes,"favorite",t?1:0),t?(0,r.Ic)("files:favorites:added",e):(0,r.Ic)("files:favorites:removed",e),!0}catch(s){const n=t?"adding a file to favourites":"removing a file from favourites";return l.A.error("Error while "+n,{error:s,source:e.source,node:e}),!1}},E=new n.hY({id:"favorite",displayName:e=>P(e)?(0,a.Tl)("files","Add to favorites"):(0,a.Tl)("files","Remove from favorites"),iconSvgInline:e=>P(e)?'':F,enabled:e=>!e.some((e=>{var s,t;return!(null!==(s=e.root)&&void 0!==s&&null!==(t=s.startsWith)&&void 0!==t&&t.call(s,"/files"))}))&&e.every((e=>e.permissions!==n.aX.NONE)),async exec(e,s){const t=P([e]);return await N(e,s,t)},async execBatch(e,s){const t=P(e);return Promise.all(e.map((async e=>await N(e,s,t))))},order:-50});t(18205);var I=t(53110),B=t(43627),z=t(86635),R=t(36882),j=t(39285);let O;var D;!function(e){e.MOVE="Move",e.COPY="Copy",e.MOVE_OR_COPY="move-or-copy"}(D||(D={}));const M=e=>0!=(e.reduce(((e,s)=>Math.min(e,s.permissions)),n.aX.ALL)&n.aX.UPDATE),W=e=>(e=>e.every((e=>{var s,t;return!JSON.parse(null!==(s=null===(t=e.attributes)||void 0===t?void 0:t["share-attributes"])&&void 0!==s?s:"[]").some((e=>"permissions"===e.scope&&!1===e.enabled&&"download"===e.key))})))(e)&&!e.some((e=>e.permissions===n.aX.NONE));var H=t(36117);const Y=e=>(0,n.Al)(e),V=(0,n.H4)(),q=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";e="".concat(n.lJ).concat(e);const s=new AbortController,t=(0,n.VL)();return new H.CancelablePromise((async(n,i,a)=>{a((()=>s.abort()));try{const i=await V.getDirectoryContents(e,{details:!0,data:t,includeSelf:!0,signal:s.signal}),a=i.data[0],o=i.data.slice(1);if(a.filename!==e&&"".concat(a.filename,"/")!==e)throw new Error("Root node does not match requested path");n({folder:Y(a),contents:o.map((e=>{try{return Y(e)}catch(s){return l.A.error("Invalid node detected '".concat(e.basename,"'"),{error:s}),null}})).filter(Boolean)})}catch(e){i(e)}}))},G=e=>M(e)?W(e)?D.MOVE_OR_COPY:D.MOVE:D.COPY,$=async function(e,s,t){let m=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!s)return;if(s.type!==n.pt.Folder)throw new Error((0,a.Tl)("files","Destination is not a folder"));if(t===D.MOVE&&e.dirname===s.path)throw new Error((0,a.Tl)("files","This file/folder is already in that directory"));if("".concat(s.path,"/").startsWith("".concat(e.path,"/")))throw new Error((0,a.Tl)("files","You cannot move a file/folder onto itself or into a subfolder of itself"));_.Ay.set(e,"status",n.zI.LOADING);const d=(O||(O=new o.A({concurrency:5})),O);return await d.add((async()=>{const o=e=>1===e?(0,a.Tl)("files","(copy)"):(0,a.Tl)("files","(copy %n)",void 0,e);try{const l=(0,n.H4)(),d=(0,B.join)(n.lJ,e.path),c=(0,B.join)(n.lJ,s.path);if(t===D.COPY){let t=e.basename;if(!m){const s=await l.getDirectoryContents(c);t=(0,n.E6)(e.basename,s.map((e=>e.basename)),{suffix:o,ignoreFileExtension:e.type===n.pt.Folder})}if(await l.copyFile(d,(0,B.join)(c,t)),e.dirname===s.path){const{data:e}=await l.stat((0,B.join)(c,t),{details:!0,data:(0,n.VL)()});(0,r.Ic)("files:node:created",(0,n.Al)(e))}}else{const t=await q(s.path);if((0,z.h)([e],t.contents))try{const{selected:n,renamed:i}=await(0,z.o)(s.path,[e],t.contents);if(!n.length&&!i.length)return}catch(e){return void(0,i.Qg)((0,a.Tl)("files","Move cancelled"))}await l.moveFile(d,(0,B.join)(c,e.basename)),(0,r.Ic)("files:node:deleted",e)}}catch(e){if(e instanceof I.pe){var d,c,g;if(412===(null==e||null===(d=e.response)||void 0===d?void 0:d.status))throw new Error((0,a.Tl)("files","A file or folder with that name already exists in this folder"));if(423===(null==e||null===(c=e.response)||void 0===c?void 0:c.status))throw new Error((0,a.Tl)("files","The files are locked"));if(404===(null==e||null===(g=e.response)||void 0===g?void 0:g.status))throw new Error((0,a.Tl)("files","The file does not exist anymore"));if(e.message)throw new Error(e.message)}throw l.A.debug(e),new Error}finally{_.Ay.set(e,"status",void 0)}}))};async function K(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",t=arguments.length>2?arguments[2]:void 0;const{resolve:n,reject:o,promise:r}=Promise.withResolvers(),m=t.map((e=>e.fileid)).filter(Boolean);return(0,i.a1)((0,a.Tl)("files","Choose destination")).allowDirectories(!0).setFilter((e=>!m.includes(e.fileid))).setMimeTypeFilter([]).setMultiSelect(!1).startAt(s).setButtonFactory(((s,i)=>{const o=[],l=(0,B.basename)(i),r=t.map((e=>e.dirname)),m=t.map((e=>e.path));return e!==D.COPY&&e!==D.MOVE_OR_COPY||o.push({label:l?(0,a.Tl)("files","Copy to {target}",{target:l},void 0,{escape:!1,sanitize:!1}):(0,a.Tl)("files","Copy"),type:"primary",icon:R,async callback(e){n({destination:e[0],action:D.COPY})}}),r.includes(i)||m.includes(i)||e!==D.MOVE&&e!==D.MOVE_OR_COPY||o.push({label:l?(0,a.Tl)("files","Move to {target}",{target:l},void 0,{escape:!1,sanitize:!1}):(0,a.Tl)("files","Move"),type:e===D.MOVE?"primary":"secondary",icon:j,async callback(e){n({destination:e[0],action:D.MOVE})}}),o})).build().pick().catch((e=>{l.A.debug(e),e instanceof i.vT?n(!1):o(new Error((0,a.Tl)("files","Move or copy operation failed")))})),r}const J=new n.hY({id:"move-copy",displayName(e){switch(G(e)){case D.MOVE:return(0,a.Tl)("files","Move");case D.COPY:return(0,a.Tl)("files","Copy");case D.MOVE_OR_COPY:return(0,a.Tl)("files","Move or copy")}},iconSvgInline:()=>j,enabled:e=>!!e.every((e=>{var s;return null===(s=e.root)||void 0===s?void 0:s.startsWith("/files/")}))&&e.length>0&&(M(e)||W(e)),async exec(e,s,t){const n=G([e]);let o;try{o=await K(n,t,[e])}catch(e){return l.A.error(e),!1}if(!1===o)return(0,i.cf)((0,a.Tl)("files",'Cancelled move or copy of "{filename}".',{filename:e.displayname})),null;try{return await $(e,o.destination,o.action),!0}catch(e){return!!(e instanceof Error&&e.message)&&((0,i.Qg)(e.message),null)}},async execBatch(e,s,t){const n=G(e),o=await K(n,t,e);if(!1===o)return(0,i.cf)(1===e.length?(0,a.Tl)("files",'Cancelled move or copy of "{filename}".',{filename:e[0].displayname}):(0,a.Tl)("files","Cancelled move or copy operation")),e.map((()=>null));const r=e.map((async e=>{try{return await $(e,o.destination,o.action),!0}catch(s){return l.A.error("Failed to ".concat(o.action," node"),{node:e,error:s}),!1}}));return await Promise.all(r)},order:15}),Q='',Z=new n.hY({id:"open-folder",displayName(e){const s=e[0].displayname;return(0,a.Tl)("files","Open folder {displayName}",{displayName:s})},iconSvgInline:()=>Q,enabled(e){if(1!==e.length)return!1;const s=e[0];return!!s.isDavRessource&&s.type===n.pt.Folder&&0!=(s.permissions&n.aX.READ)},exec:async(e,s)=>!(!e||e.type!==n.pt.Folder)&&(window.OCP.Files.Router.goToRoute(null,{view:s.id,fileid:e.fileid},{dir:e.path}),null),default:n.m9.HIDDEN,order:-100}),X=new n.hY({id:"open-in-files-recent",displayName:()=>(0,a.Tl)("files","Open in Files"),iconSvgInline:()=>"",enabled:(e,s)=>"recent"===s.id,async exec(e){let s=e.dirname;return e.type===n.pt.Folder&&(s=s+"/"+e.basename),window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:e.fileid},{dir:s,openfile:"true"}),null},order:-1e3,default:n.m9.HIDDEN}),ee=new n.hY({id:"rename",displayName:()=>(0,a.Tl)("files","Rename"),iconSvgInline:()=>'',enabled:e=>e.length>0&&e.map((e=>e.permissions)).every((e=>0!=(e&n.aX.UPDATE))),exec:async e=>((0,r.Ic)("files:node:rename",e),null),order:10});var se=t(49981);const te=new n.hY({id:"details",displayName:()=>(0,a.Tl)("files","Open details"),iconSvgInline:()=>se,enabled:e=>{var s,t,i;return 1===e.length&&!!e[0]&&!(null===(s=window)||void 0===s||null===(s=s.OCA)||void 0===s||null===(s=s.Files)||void 0===s||!s.Sidebar)&&null!==(t=(null===(i=e[0].root)||void 0===i?void 0:i.startsWith("/files/"))&&e[0].permissions!==n.aX.NONE)&&void 0!==t&&t},async exec(e,s,t){try{return await window.OCA.Files.Sidebar.open(e.path),window.OCP.Files.Router.goToRoute(null,{view:s.id,fileid:e.fileid},{...window.OCP.Files.Router.query,dir:t},!0),null}catch(e){return l.A.error("Error while opening sidebar",{error:e}),!1}},order:-50}),ne=new n.hY({id:"view-in-folder",displayName:()=>(0,a.Tl)("files","View in folder"),iconSvgInline:()=>j,enabled(e,s){if("files"===s.id)return!1;if(1!==e.length)return!1;const t=e[0];return!!t.isDavRessource&&t.permissions!==n.aX.NONE&&t.type===n.pt.File},exec:async e=>!(!e||e.type!==n.pt.File)&&(window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:e.fileid},{dir:e.dirname}),null),order:80});var ie=t(18740),ae=t(94219),oe=t(82182);const le=(0,_.pM)({__name:"NewNodeDialog",props:{defaultName:{type:String,default:(0,a.t)("files","New folder")},otherNames:{type:Array,default:()=>[]},open:{type:Boolean,default:!0},name:{type:String,default:(0,a.t)("files","Create new folder")},label:{type:String,default:(0,a.t)("files","Folder name")}},emits:["close"],setup(e,s){let{emit:t}=s;const i=e,o=(0,_.KR)(i.defaultName),l=(0,_.KR)(),r=(0,_.KR)(),m=(0,_.KR)("");function d(){(0,_.dY)((()=>{var e;const s=null===(e=l.value)||void 0===e?void 0:e.$el.querySelector("input");if(!i.open||!s)return;const t=o.value.length-(0,B.extname)(o.value).length;s.focus(),s.setSelectionRange(0,t)}))}return(0,_.wB)((()=>i.defaultName),(()=>{o.value=(0,n.E6)(i.defaultName,i.otherNames).trim()})),(0,_.nT)((()=>{var e;i.otherNames.includes(o.value.trim())?m.value=(0,a.t)("files","This name is already in use."):m.value=function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(""===e.trim())return(0,a.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,a.t)("files",'"{char}" is not allowed inside a filename.',{char:e.segment},void 0,{escape:s});case n.nF.ReservedName:return(0,a.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,a.t)("files",'"{extension}" is not an allowed filetype.',{extension:e.segment},void 0,{escape:!1}):(0,a.t)("files",'Filenames must not end with "{extension}".',{extension:e.segment},void 0,{escape:!1});default:return(0,a.t)("files","Invalid filename.")}}}(o.value.trim());const s=null===(e=l.value)||void 0===e?void 0:e.$el.querySelector("input");s&&(s.setCustomValidity(m.value),s.reportValidity())})),(0,_.wB)((()=>i.open),(()=>{(0,_.dY)((()=>{d()}))})),(0,_.sV)((()=>{o.value=(0,n.E6)(o.value,i.otherNames).trim(),(0,_.dY)((()=>d()))})),{__sfc:!0,props:i,emit:t,localDefaultName:o,nameInput:l,formElement:r,validity:m,focusInput:d,submit:function(){var e;null===(e=r.value)||void 0===e||e.requestSubmit()},t:a.t,NcButton:ie.A,NcDialog:ae.A,NcTextField:oe.A}}});var re=t(85072),me=t.n(re),de=t(97825),ce=t.n(de),ge=t(77659),ue=t.n(ge),fe=t(55056),pe=t.n(fe),he=t(10540),we=t.n(he),ve=t(41113),Te=t.n(ve),xe=t(6058),ye={};ye.styleTagTransform=Te(),ye.setAttributes=pe(),ye.insert=ue().bind(null,"head"),ye.domAPI=ce(),ye.insertStyleElement=we(),me()(xe.A,ye),xe.A&&xe.A.locals&&xe.A.locals;const ke=(0,t(14486).A)(le,(function(){var e=this,s=e._self._c,t=e._self._setupProxy;return s(t.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 t.emit("close",null)}},scopedSlots:e._u([{key:"actions",fn:function(){return[s(t.NcButton,{attrs:{"data-cy-files-new-node-dialog-submit":"",type:"primary",disabled:""!==t.validity},on:{click:t.submit}},[e._v("\n\t\t\t"+e._s(t.t("files","Create"))+"\n\t\t")])]},proxy:!0}])},[e._v(" "),s("form",{ref:"formElement",staticClass:"new-node-dialog__form",on:{submit:function(e){return e.preventDefault(),t.emit("close",t.localDefaultName)}}},[s(t.NcTextField,{ref:"nameInput",attrs:{"data-cy-files-new-node-dialog-input":"",error:""!==t.validity,"helper-text":t.validity,label:e.label,value:t.localDefaultName},on:{"update:value":function(e){t.localDefaultName=e}}})],1)])}),[],!1,null,"242a2438",null).exports;function Ce(e,s){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=s.map((e=>e.basename));return new Promise((s=>{(0,i.Ss)(ke,{...t,defaultName:e,otherNames:n},(e=>{s(e)}))}))}const be={id:"newFolder",displayName:(0,a.Tl)("files","New folder"),enabled:e=>0!=(e.permissions&n.aX.CREATE),iconSvgInline:'',order:0,async handler(e,s){const t=await Ce((0,a.Tl)("files","New folder"),s);if(null!==t){var o,m,c,g,u;const{fileid:s,source:f}=await(async(e,s)=>{const t=e.source+"/"+s,n=e.encodedSource+"/"+encodeURIComponent(s),i=await(0,d.Ay)({method:"MKCOL",url:n,headers:{Overwrite:"F"}});return{fileid:parseInt(i.headers["oc-fileid"]),source:t}})(e,t.trim()),p=new n.vd({source:f,id:s,mtime:new Date,owner:(null===(o=(0,L.HW)())||void 0===o?void 0:o.uid)||null,permissions:n.aX.ALL,root:(null==e?void 0:e.root)||"/files/"+(null===(m=(0,L.HW)())||void 0===m?void 0:m.uid),attributes:{"mount-type":null===(c=e.attributes)||void 0===c?void 0:c["mount-type"],"owner-id":null===(g=e.attributes)||void 0===g?void 0:g["owner-id"],"owner-display-name":null===(u=e.attributes)||void 0===u?void 0:u["owner-display-name"]}});(0,r.Ic)("files:node:created",p),(0,i.Te)((0,a.Tl)("files",'Created new folder "{name}"',{name:(0,B.basename)(f)})),l.A.debug("Created new folder",{folder:p,source:f}),window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:p.fileid},{dir:e.path})}}};var Le=t(32981);let Se=(0,Le.C)("files","templates_path",!1);l.A.debug("Initial templates folder",{templatesPath:Se});const Ue={id:"template-picker",displayName:(0,a.Tl)("files","Create new templates folder"),iconSvgInline:'',order:10,enabled(e){var s;return!Se&&e.owner===(null===(s=(0,L.HW)())||void 0===s?void 0:s.uid)&&0!=(e.permissions&n.aX.CREATE)},async handler(e,s){const t=await Ce((0,a.Tl)("files","Templates"),s,{name:(0,a.Tl)("files","New template folder")});null!==t&&(async function(e,s){const t=(0,B.join)(e.path,s);try{l.A.debug("Initializing the templates directory",{templatePath:t});const{data:e}=await d.Ay.post((0,T.KT)("apps/files/api/v1/templates/path"),{templatePath:t,copySystemTemplates:!0});window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:void 0},{dir:t}),l.A.info("Created new templates folder",{...e.ocs.data}),Se=e.ocs.data.templates_path}catch(e){l.A.error("Unable to initialize the templates directory"),(0,i.Qg)((0,a.Tl)("files","Unable to initialize the templates directory"))}}(e,t),(0,n.gj)("template-picker"))}},Ae=(0,_.$V)((()=>Promise.all([t.e(4208),t.e(9558)]).then(t.bind(t,47177))));let _e=null;const Fe=async e=>{if(null===_e){const s=document.createElement("div");s.id="template-picker",document.body.appendChild(s),_e=new _.Ay({render:s=>s(Ae,{ref:"picker",props:{parent:e}}),methods:{open(){this.$refs.picker.open(...arguments)}},el:s})}return _e};var Pe;const Ne="/files/".concat(null===(Pe=(0,L.HW)())||void 0===Pe?void 0:Pe.uid),Ee=((0,T.dC)("dav"+Ne),(0,n.H4)()),Ie=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";return"/"!==e?q(e):new H.CancelablePromise(((e,s,t)=>{const i=(0,n.Q$)(Ee).catch(s).then((t=>{var i;t?e({contents:t,folder:new n.vd({id:0,source:"".concat(n.PY).concat(n.lJ),root:n.lJ,owner:(null===(i=(0,L.HW)())||void 0===i?void 0:i.uid)||null,permissions:n.aX.READ})}):s()}));t((()=>i.cancel()))}))},Be=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new n.Ss({id:ze(e.path),name:(0,B.basename)(e.path),icon:Q,order:s,params:{dir:e.path,fileid:e.fileid.toString(),view:"favorites"},parent:"favorites",columns:[],getContents:Ie})},ze=function(e){return"favorite-".concat(function(e){let s=0;for(let t=0;t>>0}(e))};var Re=t(65899);const je=(0,Le.C)("files","config",{show_hidden:!1,crop_image_previews:!0,sort_favorites_first:!0,sort_folders_first:!0,grid_view:!1}),Oe=(0,Re.Ey)(),De=(0,n.H4)(),Me=Math.round(Date.now()/1e3-1209600),We=e=>(0,n.Al)(e,n.lJ,(0,T.$_)());var He;const Ye=null===(He=(0,L.HW)())||void 0===He?void 0:He.uid,Ve=function(e){const s=e.attributes["mount-type"];return!(Ye&&e.owner!==Ye||["group","shared"].includes(s))};(0,n.Gg)(v),(0,n.Gg)(C),(0,n.Gg)(A),(0,n.Gg)(E),(0,n.Gg)(J),(0,n.Gg)(Z),(0,n.Gg)(X),(0,n.Gg)(ee),(0,n.Gg)(te),(0,n.Gg)(ne),(0,n.zj)(be),(0,n.zj)(Ue),(0,Le.C)("files","templates",[]).forEach(((e,s)=>{(0,n.zj)({id:"template-new-".concat(e.app,"-").concat(s),displayName:e.label,iconClass:e.iconClass||"icon-file",iconSvgInline:e.iconSvgInline,enabled:e=>0!=(e.permissions&n.aX.CREATE),order:11,async handler(s,t){const n=Fe(s),i=await Ce("".concat(e.label).concat(e.extension),t,{label:(0,a.Tl)("files","Filename"),name:e.label});null!==i&&(await n).open(i.trim(),e)}})})),(()=>{const e=(0,Le.C)("files","favoriteFolders",[]),s=e.map(((e,s)=>Be(e,s)));l.A.debug("Generating favorites view",{favoriteFolders:e});const t=(0,n.bh)();t.register(new n.Ss({id:"favorites",name:(0,a.Tl)("files","Favorites"),caption:(0,a.Tl)("files","List of favorites files and folders."),emptyTitle:(0,a.Tl)("files","No favorites yet"),emptyCaption:(0,a.Tl)("files","Files and folders you mark as favorite will show up here"),icon:F,order:15,columns:[],getContents:Ie})),s.forEach((e=>t.register(e))),(0,r.B1)("files:favorites:added",(e=>{var s;e.type===n.pt.Folder&&(null!==e.path&&null!==(s=e.root)&&void 0!==s&&s.startsWith("/files")?o(e):l.A.error("Favorite folder is not within user files root",{node:e}))})),(0,r.B1)("files:favorites:removed",(e=>{var s;e.type===n.pt.Folder&&(null!==e.path&&null!==(s=e.root)&&void 0!==s&&s.startsWith("/files")?m(e.path):l.A.error("Favorite folder is not within user files root",{node:e}))})),(0,r.B1)("files:node:renamed",(e=>{e.type===n.pt.Folder&&1===e.attributes.favorite&&d(e)}));const i=function(){e.sort(((e,s)=>e.path.localeCompare(s.path,(0,a.Z0)(),{ignorePunctuation:!0}))),e.forEach(((e,t)=>{const n=s.find((s=>s.id===ze(e.path)));n&&(n.order=t)}))},o=function(n){const a={path:n.path,fileid:n.fileid},o=Be(a);e.find((e=>e.path===n.path))||(e.push(a),s.push(o),i(),t.register(o))},m=function(n){const a=ze(n),o=e.findIndex((e=>e.path===n));-1!==o&&(e.splice(o,1),s.splice(o,1),t.remove(a),i())},d=function(s){const t=e.find((e=>e.fileid===s.fileid));void 0!==t&&(m(t.path),o(s))}})(),(0,n.bh)().register(new n.Ss({id:"files",name:(0,a.Tl)("files","All files"),caption:(0,a.Tl)("files","List of your files and folders."),icon:Q,order:0,getContents:q})),(0,n.bh)().register(new n.Ss({id:"recent",name:(0,a.Tl)("files","Recent"),caption:(0,a.Tl)("files","List of recently modified files and folders."),emptyTitle:(0,a.Tl)("files","No recently modified files"),emptyCaption:(0,a.Tl)("files","Files and folders you recently modified will show up here."),icon:'',order:10,defaultSortKey:"mtime",getContents:async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";const s=function(){const e=(0,Re.nY)("userconfig",{state:()=>({userConfig:je}),actions:{onUpdate(e,s){_.Ay.set(this.userConfig,e,s)},async update(e,s){await d.Ay.put((0,T.Jv)("/apps/files/api/v1/config/"+e),{value:s}),(0,r.Ic)("files:config:updated",{key:e,value:s})}}})(...arguments);return e._initialized||((0,r.B1)("files:config:updated",(function(s){let{key:t,value:n}=s;e.onUpdate(t,n)})),e._initialized=!0),e}(Oe),t=t=>"/"!==e||s.userConfig.show_hidden||!t.dirname.split("/").some((e=>e.startsWith("."))),i=new AbortController;return new H.CancelablePromise((async(e,s,a)=>{var o;let l;a((()=>i.abort()));try{l=await De.search("/",{details:!0,data:(0,n.R3)(Me),signal:i.signal})}catch(e){return void s(e)}i.signal.aborted?s():e({contents:l.data.results.map(We).filter(t),folder:new n.vd({id:0,source:"".concat(n.PY).concat(n.lJ),root:n.lJ,owner:(null===(o=(0,L.HW)())||void 0===o?void 0:o.uid)||null,permissions:n.aX.READ})})}))}})),(0,n.bh)().register(new n.Ss({id:"personal",name:(0,a.Tl)("files","Personal Files"),caption:(0,a.Tl)("files","List of your files and folders that are not shared."),emptyTitle:(0,a.Tl)("files","No personal files found"),emptyCaption:(0,a.Tl)("files","Files that are not shared will show up here."),icon:'',order:5,getContents:function(){return q(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/").then((e=>(e.contents=e.contents.filter(Ve),e)))}})),"serviceWorker"in navigator?window.addEventListener("load",(async()=>{try{const e=(0,T.Jv)("/apps/files/preview-service-worker.js",{},{noRewrite:!0}),s=await navigator.serviceWorker.register(e,{scope:"/"});l.A.debug("SW registered: ",{registration:s})}catch(e){l.A.error("SW registration failed: ",{error:e})}})):l.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-files-live-photo",{nc:"http://nextcloud.org/ns"})},82190:(e,s,t)=>{"use strict";t.d(s,{A:()=>l});var n=t(71354),i=t.n(n),a=t(76314),o=t.n(a)()(i());o.push([e.id,"\n.invalid-filename-dialog__input[data-v-3a479259] {\n\t/* Ensure the helper text can always be shown without jumping */\n\tmin-height: calc(var(--default-clickable-area) + 4 * var(--default-font-size));\n}\n.upload-picker[data-v-3e5a9212] {\n display: inline-flex;\n align-items: center;\n height: var(--default-clickable-area);\n}\n.upload-picker__progress[data-v-3e5a9212] {\n width: 200px;\n max-width: 0;\n transition: max-width var(--animation-quick) ease-in-out;\n margin-top: 8px;\n}\n.upload-picker__progress p[data-v-3e5a9212] {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.upload-picker--uploading .upload-picker__progress[data-v-3e5a9212] {\n max-width: 200px;\n margin-right: 20px;\n margin-left: 8px;\n}\n.upload-picker--paused .upload-picker__progress[data-v-3e5a9212] {\n animation: breathing-3e5a9212 3s ease-out infinite normal;\n}\n@keyframes breathing-3e5a9212 {\n0% {\n opacity: 0.5;\n}\n25% {\n opacity: 1;\n}\n60% {\n opacity: 0.5;\n}\n100% {\n opacity: 0.5;\n}\n}","",{version:3,sources:["webpack://./node_modules/@nextcloud/upload/dist/assets/index-Dg3Dlw7h.css"],names:[],mappings:";AACA;CACC,+DAA+D;CAC/D,8EAA8E;AAC/E;AACA;EACE,oBAAoB;EACpB,mBAAmB;EACnB,qCAAqC;AACvC;AACA;EACE,YAAY;EACZ,YAAY;EACZ,wDAAwD;EACxD,eAAe;AACjB;AACA;EACE,gBAAgB;EAChB,mBAAmB;EACnB,uBAAuB;AACzB;AACA;EACE,gBAAgB;EAChB,kBAAkB;EAClB,gBAAgB;AAClB;AACA;EACE,yDAAyD;AAC3D;AACA;AACA;IACI,YAAY;AAChB;AACA;IACI,UAAU;AACd;AACA;IACI,YAAY;AAChB;AACA;IACI,YAAY;AAChB;AACA",sourcesContent:["\n.invalid-filename-dialog__input[data-v-3a479259] {\n\t/* Ensure the helper text can always be shown without jumping */\n\tmin-height: calc(var(--default-clickable-area) + 4 * var(--default-font-size));\n}\n.upload-picker[data-v-3e5a9212] {\n display: inline-flex;\n align-items: center;\n height: var(--default-clickable-area);\n}\n.upload-picker__progress[data-v-3e5a9212] {\n width: 200px;\n max-width: 0;\n transition: max-width var(--animation-quick) ease-in-out;\n margin-top: 8px;\n}\n.upload-picker__progress p[data-v-3e5a9212] {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.upload-picker--uploading .upload-picker__progress[data-v-3e5a9212] {\n max-width: 200px;\n margin-right: 20px;\n margin-left: 8px;\n}\n.upload-picker--paused .upload-picker__progress[data-v-3e5a9212] {\n animation: breathing-3e5a9212 3s ease-out infinite normal;\n}\n@keyframes breathing-3e5a9212 {\n0% {\n opacity: 0.5;\n}\n25% {\n opacity: 1;\n}\n60% {\n opacity: 0.5;\n}\n100% {\n opacity: 0.5;\n}\n}"],sourceRoot:""}]);const l=o},6058:(e,s,t)=>{"use strict";t.d(s,{A:()=>l});var n=t(71354),i=t.n(n),a=t(76314),o=t.n(a)()(i());o.push([e.id,"\n.new-node-dialog__form[data-v-242a2438] {\n\t/* Ensure the dialog does not jump when there is a validity error */\n\tmin-height: calc(3 * var(--default-clickable-area));\n}\n","",{version:3,sources:["webpack://./apps/files/src/components/NewNodeDialog.vue"],names:[],mappings:";AAwJA;CACA,mEAAA;CACA,mDAAA;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