From 0522da7001f84e460ed8885f1c6a25828d953558 Mon Sep 17 00:00:00 2001 From: rakekniven <2069590+rakekniven@users.noreply.github.com> Date: Fri, 14 Jul 2023 23:18:23 +0200 Subject: [PATCH 1/2] fix(i18n) Changed case of "Files" Signed-off-by: rakekniven <2069590+rakekniven@users.noreply.github.com> --- apps/files_sharing/src/actions/openInFilesAction.spec.ts | 2 +- apps/files_sharing/src/actions/openInFilesAction.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/files_sharing/src/actions/openInFilesAction.spec.ts b/apps/files_sharing/src/actions/openInFilesAction.spec.ts index 097f825bd36dc..8920204ae3fef 100644 --- a/apps/files_sharing/src/actions/openInFilesAction.spec.ts +++ b/apps/files_sharing/src/actions/openInFilesAction.spec.ts @@ -50,7 +50,7 @@ describe('Open in files action conditions tests', () => { test('Default values', () => { expect(action).toBeInstanceOf(FileAction) expect(action.id).toBe('open-in-files') - expect(action.displayName([], validViews[0])).toBe('Open in files') + expect(action.displayName([], validViews[0])).toBe('Open in Files') expect(action.iconSvgInline([], validViews[0])).toBe('') expect(action.default).toBe(DefaultType.HIDDEN) expect(action.order).toBe(-1000) diff --git a/apps/files_sharing/src/actions/openInFilesAction.ts b/apps/files_sharing/src/actions/openInFilesAction.ts index 4c60b2882b674..f992d11b1357f 100644 --- a/apps/files_sharing/src/actions/openInFilesAction.ts +++ b/apps/files_sharing/src/actions/openInFilesAction.ts @@ -27,7 +27,7 @@ import { sharesViewId, sharedWithYouViewId, sharedWithOthersViewId, sharingByLin export const action = new FileAction({ id: 'open-in-files', - displayName: () => t('files', 'Open in files'), + displayName: () => t('files', 'Open in Files'), iconSvgInline: () => '', enabled: (nodes, view) => [ From 4c3aad898602435494570b85a05dd3bf724e04ca Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 28 Jul 2023 11:06:10 +0200 Subject: [PATCH 2/2] chore(assets): Recompile JS Signed-off-by: Joas Schilling --- dist/files_sharing-files_sharing.js | 4 ++-- dist/files_sharing-files_sharing.js.map | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/files_sharing-files_sharing.js b/dist/files_sharing-files_sharing.js index afe909fbaa98a..edb4629ef671e 100644 --- a/dist/files_sharing-files_sharing.js +++ b/dist/files_sharing-files_sharing.js @@ -1,3 +1,3 @@ /*! For license information please see files_sharing-files_sharing.js.LICENSE.txt */ -(()=>{"use strict";var e,t={64123:(e,t,i)=>{var r,n,s,o=i(31352),a=i(77958),l=i(17499),d=i(62520);null===(r=(0,a.ts)())?(0,l.IY)().setApp("files").build():(0,l.IY)().setApp("files").setUid(r.uid).build(),function(e){e.Folder="folder",e.File="file"}(n||(n={})),function(e){e[e.NONE=0]="NONE",e[e.CREATE=4]="CREATE",e[e.READ=1]="READ",e[e.UPDATE=2]="UPDATE",e[e.DELETE=8]="DELETE",e[e.SHARE=16]="SHARE",e[e.ALL=31]="ALL"}(s||(s={}));const h=function(e,t){return null!==e.match(t)},u=(e,t)=>{if("id"in e&&("number"!=typeof e.id||e.id<0))throw new Error("Invalid id type of value");if(!e.source)throw new Error("Missing mandatory source");try{new URL(e.source)}catch(e){throw new Error("Invalid source format, source must be a valid URL")}if(!e.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if("mtime"in e&&!(e.mtime instanceof Date))throw new Error("Invalid mtime type");if("crtime"in e&&!(e.crtime instanceof Date))throw new Error("Invalid crtime type");if(!e.mime||"string"!=typeof e.mime||!e.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in e&&"number"!=typeof e.size)throw new Error("Invalid size type");if("permissions"in e&&!("number"==typeof e.permissions&&e.permissions>=s.NONE&&e.permissions<=s.ALL))throw new Error("Invalid permissions");if("owner"in e&&null!==e.owner&&"string"!=typeof e.owner)throw new Error("Invalid owner type");if("attributes"in e&&"object"!=typeof e.attributes)throw new Error("Invalid attributes format");if("root"in e&&"string"!=typeof e.root)throw new Error("Invalid root format");if(e.root&&!e.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(e.root&&!e.source.includes(e.root))throw new Error("Root must be part of the source");if(e.root&&h(e.source,t)){const i=e.source.match(t)[0];if(!e.source.includes((0,d.join)(i,e.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}};class c{_data;_attributes;_knownDavService=/(remote|public)\.php\/(web)?dav/i;constructor(e,t){u(e,t||this._knownDavService),this._data=e;const i={set:(e,t,i)=>(this._data.mtime=new Date,Reflect.set(e,t,i)),deleteProperty:(e,t)=>(this._data.mtime=new Date,Reflect.deleteProperty(e,t))};this._attributes=new Proxy(e.attributes||{},i),delete this._data.attributes,t&&(this._knownDavService=t)}get source(){return this._data.source.replace(/\/$/i,"")}get basename(){return(0,d.basename)(this.source)}get extension(){return(0,d.extname)(this.source)}get dirname(){if(this.root){const e=this.source.indexOf(this.root);return(0,d.dirname)(this.source.slice(e+this.root.length)||"/")}const e=new URL(this.source);return(0,d.dirname)(e.pathname)}get mime(){return this._data.mime}get mtime(){return this._data.mtime}get crtime(){return this._data.crtime}get size(){return this._data.size}get attributes(){return this._attributes}get permissions(){return null!==this.owner||this.isDavRessource?void 0!==this._data.permissions?this._data.permissions:s.NONE:s.READ}get owner(){return this.isDavRessource?this._data.owner:null}get isDavRessource(){return h(this.source,this._knownDavService)}get root(){return this._data.root?this._data.root.replace(/^(.+)\/$/,"$1"):this.isDavRessource&&(0,d.dirname)(this.source).split(this._knownDavService).pop()||null}get path(){if(this.root){const e=this.source.indexOf(this.root);return this.source.slice(e+this.root.length)||"/"}return(this.dirname+"/"+this.basename).replace(/\/\//g,"/")}get fileid(){return this._data?.id||this.attributes?.fileid}move(e){u({...this._data,source:e},this._knownDavService),this._data.source=e,this._data.mtime=new Date}rename(e){if(e.includes("/"))throw new Error("Invalid basename");this.move((0,d.dirname)(this.source)+"/"+e)}}class p extends c{get type(){return n.File}}class f extends c{constructor(e){super({...e,mime:"httpd/unix-directory"})}get type(){return n.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}}var g=i(79753),m=i(26937);const w=(0,l.IY)().setApp("files_sharing").detectUser().build();var v;const _="/files/".concat(null===(v=(0,a.ts)())||void 0===v?void 0:v.uid),y={"Content-Type":"application/json"},b=function(e){try{var t;const i="folder"===(null==e?void 0:e.item_type),r=!0===(null==e?void 0:e.has_preview),n=i?f:p,s=e.file_source,o=r?(0,g.generateUrl)("/core/preview?fileId={fileid}&x=32&y=32&forceIcon=0",{fileid:s}):void 0,a=(null==e?void 0:e.path)||e.file_target,l=(0,g.generateRemoteUrl)("dav/".concat(_,"/").concat(a).replaceAll(/\/\//gm,"/"));let d=null!=e&&e.item_mtime?new Date(1e3*e.item_mtime):void 0;return(null==e?void 0:e.stime)>((null==e?void 0:e.item_mtime)||0)&&(d=new Date(1e3*e.stime)),new n({id:s,source:l,owner:null==e?void 0:e.uid_owner,mime:null==e?void 0:e.mimetype,mtime:d,size:null==e?void 0:e.item_size,permissions:(null==e?void 0:e.item_permissions)||(null==e?void 0:e.permissions),root:_,attributes:{...e,previewUrl:o,"has-preview":r,favorite:null!=e&&null!==(t=e.tags)&&void 0!==t&&t.includes(window.OC.TAG_FAVORITE)?1:0}})}catch(e){return w.error("Error while parsing OCS entry",{error:e}),null}},I=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=(0,g.generateOcsUrl)("apps/files_sharing/api/v1/shares");return m.Z.get(t,{headers:y,params:{shared_with_me:e,include_tags:!0}})},C=async function(){var e;let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const s=[];(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&s.push(I(!0),function(){const e=(0,g.generateOcsUrl)("apps/files_sharing/api/v1/remote_shares");return m.Z.get(e,{headers:y,params:{include_tags:!0}})}()),t&&s.push(I()),i&&s.push(function(){const e=(0,g.generateOcsUrl)("apps/files_sharing/api/v1/shares/pending");return m.Z.get(e,{headers:y,params:{include_tags:!0}})}(),function(){const e=(0,g.generateOcsUrl)("apps/files_sharing/api/v1/remote_shares/pending");return m.Z.get(e,{headers:y,params:{include_tags:!0}})}()),r&&s.push(function(){const e=(0,g.generateOcsUrl)("apps/files_sharing/api/v1/deletedshares");return m.Z.get(e,{headers:y,params:{include_tags:!0}})}());let o=(await Promise.all(s)).map((e=>e.data.ocs.data)).flat().map(b).filter((e=>null!==e));return n.length>0&&(o=o.filter((e=>{var t;return n.includes(null===(t=e.attributes)||void 0===t?void 0:t.share_type)}))),{folder:new f({id:0,source:(0,g.generateRemoteUrl)("dav"+_),owner:(null===(e=(0,a.ts)())||void 0===e?void 0:e.uid)||null}),contents:o}},E="shareoverview",x="sharingin",A="sharingout",L="sharinglinks",O="deletedshares",S="pendingshares";var H=i(69183);const R=(0,l.IY)().setApp("files").detectUser().build();var D;!function(e){e.DEFAULT="default",e.HIDDEN="hidden"}(D||(D={}));class N{constructor(e){var t,i,r;t=this,r=void 0,(i=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(i="_action"))in t?Object.defineProperty(t,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[i]=r,this.validateAction(e),this._action=e}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(e){if(!e.id||"string"!=typeof e.id)throw new Error("Invalid id");if(!e.displayName||"function"!=typeof e.displayName)throw new Error("Invalid displayName function");if(!e.iconSvgInline||"function"!=typeof e.iconSvgInline)throw new Error("Invalid iconSvgInline function");if(!e.exec||"function"!=typeof e.exec)throw new Error("Invalid exec function");if("enabled"in e&&"function"!=typeof e.enabled)throw new Error("Invalid enabled function");if("execBatch"in e&&"function"!=typeof e.execBatch)throw new Error("Invalid execBatch function");if("order"in e&&"number"!=typeof e.order)throw new Error("Invalid order");if(e.default&&!Object.values(D).includes(e.default))throw new Error("Invalid default");if("inline"in e&&"function"!=typeof e.inline)throw new Error("Invalid inline function");if("renderInline"in e&&"function"!=typeof e.renderInline)throw new Error("Invalid renderInline function")}}const M=function(e){void 0===window._nc_fileactions&&(window._nc_fileactions=[],R.debug("FileActions initialized")),window._nc_fileactions.find((t=>t.id===e.id))?R.error("FileAction ".concat(e.id," already registered"),{action:e}):window._nc_fileactions.push(e)};M(new N({id:"accept-share",displayName:e=>(0,o.uN)("files_sharing","Accept share","Accept shares",e.length),iconSvgInline:()=>'',enabled:(e,t)=>e.length>0&&t.id===S,async exec(e){try{const t=!!e.attributes.remote,i=(0,g.generateOcsUrl)("apps/files_sharing/api/v1/{shareBase}/pending/{id}",{shareBase:t?"remote_shares":"shares",id:e.attributes.id});return await m.Z.post(i),(0,H.j8)("files:node:deleted",e),!0}catch(e){return!1}},async execBatch(e,t,i){return Promise.all(e.map((e=>this.exec(e,t,i))))},order:1,inline:()=>!0})),M(new N({id:"open-in-files",displayName:()=>(0,o.Iu)("files","Open in files"),iconSvgInline:()=>"",enabled:(e,t)=>[E,x,A,L].includes(t.id),exec:async e=>(window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:e.fileid},{dir:e.dirname,fileid:e.fileid}),null),default:D.HIDDEN,order:-1e3})),M(new N({id:"reject-share",displayName:e=>(0,o.uN)("files_sharing","Reject share","Reject shares",e.length),iconSvgInline:()=>'',enabled:(e,t)=>t.id===S&&0!==e.length&&!e.some((e=>e.attributes.remote_id&&e.attributes.share_type===window.OC.Share.SHARE_TYPE_REMOTE_GROUP)),async exec(e){try{const t=!!e.attributes.remote,i=(0,g.generateOcsUrl)("apps/files_sharing/api/v1/{shareBase}/{id}",{shareBase:t?"remote_shares":"shares",id:e.attributes.id});return await m.Z.delete(i),(0,H.j8)("files:node:deleted",e),!0}catch(e){return!1}},async execBatch(e,t,i){return Promise.all(e.map((e=>this.exec(e,t,i))))},order:2,inline:()=>!0})),M(new N({id:"restore-share",displayName:e=>(0,o.uN)("files_sharing","Restore share","Restore shares",e.length),iconSvgInline:()=>'',enabled:(e,t)=>e.length>0&&t.id===O,async exec(e){try{const t=(0,g.generateOcsUrl)("apps/files_sharing/api/v1/deletedshares/{id}",{id:e.attributes.id});return await m.Z.post(t),(0,H.j8)("files:node:deleted",e),!0}catch(e){return!1}},async execBatch(e,t,i){return Promise.all(e.map((e=>this.exec(e,t,i))))},order:1,inline:()=>!0})),(()=>{const e=window.OCP.Files.Navigation;e.register({id:E,name:(0,o.Iu)("files_sharing","Shares"),caption:(0,o.Iu)("files_sharing","Overview of shared files."),emptyTitle:(0,o.Iu)("files_sharing","No shares"),emptyCaption:(0,o.Iu)("files_sharing","Files and folders you shared or have been shared with you will show up here"),icon:'',order:20,columns:[],getContents:()=>C()}),e.register({id:x,name:(0,o.Iu)("files_sharing","Shared with you"),caption:(0,o.Iu)("files_sharing","List of files that are shared with you."),emptyTitle:(0,o.Iu)("files_sharing","Nothing shared with you yet"),emptyCaption:(0,o.Iu)("files_sharing","Files and folders others shared with you will show up here"),icon:'',order:1,parent:E,columns:[],getContents:()=>C(!0,!1,!1,!1)}),e.register({id:A,name:(0,o.Iu)("files_sharing","Shared with others"),caption:(0,o.Iu)("files_sharing","List of files that you shared with others."),emptyTitle:(0,o.Iu)("files_sharing","Nothing shared yet"),emptyCaption:(0,o.Iu)("files_sharing","Files and folders you shared will show up here"),icon:'',order:2,parent:E,columns:[],getContents:()=>C(!1,!0,!1,!1)}),e.register({id:L,name:(0,o.Iu)("files_sharing","Shared by link"),caption:(0,o.Iu)("files_sharing","List of files that are shared by link."),emptyTitle:(0,o.Iu)("files_sharing","No shared links"),emptyCaption:(0,o.Iu)("files_sharing","Files and folders you shared by link will show up here"),icon:'',order:3,parent:E,columns:[],getContents:()=>C(!1,!0,!1,!1,[window.OC.Share.SHARE_TYPE_LINK])}),e.register({id:O,name:(0,o.Iu)("files_sharing","Deleted shares"),caption:(0,o.Iu)("files_sharing","List of shares you left."),emptyTitle:(0,o.Iu)("files_sharing","No deleted shares"),emptyCaption:(0,o.Iu)("files_sharing","Shares you have left will show up here"),icon:'',order:4,parent:E,columns:[],getContents:()=>C(!1,!1,!1,!0)}),e.register({id:S,name:(0,o.Iu)("files_sharing","Pending shares"),caption:(0,o.Iu)("files_sharing","List of unapproved shares."),emptyTitle:(0,o.Iu)("files_sharing","No pending shares"),emptyCaption:(0,o.Iu)("files_sharing","Shares you have received but not approved will show up here"),icon:'',order:5,parent:E,columns:[],getContents:()=>C(!1,!1,!0,!1)})})()}},i={};function r(e){var n=i[e];if(void 0!==n)return n.exports;var s=i[e]={id:e,loaded:!1,exports:{}};return t[e].call(s.exports,s,s.exports,r),s.loaded=!0,s.exports}r.m=t,e=[],r.O=(t,i,n,s)=>{if(!i){var o=1/0;for(h=0;h=s)&&Object.keys(r.O).every((e=>r.O[e](i[l])))?i.splice(l--,1):(a=!1,s0&&e[h-1][2]>s;h--)e[h]=e[h-1];e[h]=[i,n,s]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.j=6691,(()=>{r.b=document.baseURI||self.location.href;var e={6691:0};r.O.j=t=>0===e[t];var t=(t,i)=>{var n,s,o=i[0],a=i[1],l=i[2],d=0;if(o.some((t=>0!==e[t]))){for(n in a)r.o(a,n)&&(r.m[n]=a[n]);if(l)var h=l(r)}for(t&&t(i);dr(64123)));n=r.O(n)})(); -//# sourceMappingURL=files_sharing-files_sharing.js.map?v=ee51fe58f7ba7de90a86 \ No newline at end of file +(()=>{"use strict";var e,t={64123:(e,t,i)=>{var r,n,s,o=i(31352),a=i(77958),l=i(17499),d=i(62520);null===(r=(0,a.ts)())?(0,l.IY)().setApp("files").build():(0,l.IY)().setApp("files").setUid(r.uid).build(),function(e){e.Folder="folder",e.File="file"}(n||(n={})),function(e){e[e.NONE=0]="NONE",e[e.CREATE=4]="CREATE",e[e.READ=1]="READ",e[e.UPDATE=2]="UPDATE",e[e.DELETE=8]="DELETE",e[e.SHARE=16]="SHARE",e[e.ALL=31]="ALL"}(s||(s={}));const h=function(e,t){return null!==e.match(t)},u=(e,t)=>{if("id"in e&&("number"!=typeof e.id||e.id<0))throw new Error("Invalid id type of value");if(!e.source)throw new Error("Missing mandatory source");try{new URL(e.source)}catch(e){throw new Error("Invalid source format, source must be a valid URL")}if(!e.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if("mtime"in e&&!(e.mtime instanceof Date))throw new Error("Invalid mtime type");if("crtime"in e&&!(e.crtime instanceof Date))throw new Error("Invalid crtime type");if(!e.mime||"string"!=typeof e.mime||!e.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in e&&"number"!=typeof e.size)throw new Error("Invalid size type");if("permissions"in e&&!("number"==typeof e.permissions&&e.permissions>=s.NONE&&e.permissions<=s.ALL))throw new Error("Invalid permissions");if("owner"in e&&null!==e.owner&&"string"!=typeof e.owner)throw new Error("Invalid owner type");if("attributes"in e&&"object"!=typeof e.attributes)throw new Error("Invalid attributes format");if("root"in e&&"string"!=typeof e.root)throw new Error("Invalid root format");if(e.root&&!e.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(e.root&&!e.source.includes(e.root))throw new Error("Root must be part of the source");if(e.root&&h(e.source,t)){const i=e.source.match(t)[0];if(!e.source.includes((0,d.join)(i,e.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}};class c{_data;_attributes;_knownDavService=/(remote|public)\.php\/(web)?dav/i;constructor(e,t){u(e,t||this._knownDavService),this._data=e;const i={set:(e,t,i)=>(this._data.mtime=new Date,Reflect.set(e,t,i)),deleteProperty:(e,t)=>(this._data.mtime=new Date,Reflect.deleteProperty(e,t))};this._attributes=new Proxy(e.attributes||{},i),delete this._data.attributes,t&&(this._knownDavService=t)}get source(){return this._data.source.replace(/\/$/i,"")}get basename(){return(0,d.basename)(this.source)}get extension(){return(0,d.extname)(this.source)}get dirname(){if(this.root){const e=this.source.indexOf(this.root);return(0,d.dirname)(this.source.slice(e+this.root.length)||"/")}const e=new URL(this.source);return(0,d.dirname)(e.pathname)}get mime(){return this._data.mime}get mtime(){return this._data.mtime}get crtime(){return this._data.crtime}get size(){return this._data.size}get attributes(){return this._attributes}get permissions(){return null!==this.owner||this.isDavRessource?void 0!==this._data.permissions?this._data.permissions:s.NONE:s.READ}get owner(){return this.isDavRessource?this._data.owner:null}get isDavRessource(){return h(this.source,this._knownDavService)}get root(){return this._data.root?this._data.root.replace(/^(.+)\/$/,"$1"):this.isDavRessource&&(0,d.dirname)(this.source).split(this._knownDavService).pop()||null}get path(){if(this.root){const e=this.source.indexOf(this.root);return this.source.slice(e+this.root.length)||"/"}return(this.dirname+"/"+this.basename).replace(/\/\//g,"/")}get fileid(){return this._data?.id||this.attributes?.fileid}move(e){u({...this._data,source:e},this._knownDavService),this._data.source=e,this._data.mtime=new Date}rename(e){if(e.includes("/"))throw new Error("Invalid basename");this.move((0,d.dirname)(this.source)+"/"+e)}}class p extends c{get type(){return n.File}}class f extends c{constructor(e){super({...e,mime:"httpd/unix-directory"})}get type(){return n.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}}var g=i(79753),m=i(26937);const w=(0,l.IY)().setApp("files_sharing").detectUser().build();var v;const _="/files/".concat(null===(v=(0,a.ts)())||void 0===v?void 0:v.uid),y={"Content-Type":"application/json"},b=function(e){try{var t;const i="folder"===(null==e?void 0:e.item_type),r=!0===(null==e?void 0:e.has_preview),n=i?f:p,s=e.file_source,o=r?(0,g.generateUrl)("/core/preview?fileId={fileid}&x=32&y=32&forceIcon=0",{fileid:s}):void 0,a=(null==e?void 0:e.path)||e.file_target,l=(0,g.generateRemoteUrl)("dav/".concat(_,"/").concat(a).replaceAll(/\/\//gm,"/"));let d=null!=e&&e.item_mtime?new Date(1e3*e.item_mtime):void 0;return(null==e?void 0:e.stime)>((null==e?void 0:e.item_mtime)||0)&&(d=new Date(1e3*e.stime)),new n({id:s,source:l,owner:null==e?void 0:e.uid_owner,mime:null==e?void 0:e.mimetype,mtime:d,size:null==e?void 0:e.item_size,permissions:(null==e?void 0:e.item_permissions)||(null==e?void 0:e.permissions),root:_,attributes:{...e,previewUrl:o,"has-preview":r,favorite:null!=e&&null!==(t=e.tags)&&void 0!==t&&t.includes(window.OC.TAG_FAVORITE)?1:0}})}catch(e){return w.error("Error while parsing OCS entry",{error:e}),null}},I=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=(0,g.generateOcsUrl)("apps/files_sharing/api/v1/shares");return m.Z.get(t,{headers:y,params:{shared_with_me:e,include_tags:!0}})},C=async function(){var e;let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const s=[];(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&s.push(I(!0),function(){const e=(0,g.generateOcsUrl)("apps/files_sharing/api/v1/remote_shares");return m.Z.get(e,{headers:y,params:{include_tags:!0}})}()),t&&s.push(I()),i&&s.push(function(){const e=(0,g.generateOcsUrl)("apps/files_sharing/api/v1/shares/pending");return m.Z.get(e,{headers:y,params:{include_tags:!0}})}(),function(){const e=(0,g.generateOcsUrl)("apps/files_sharing/api/v1/remote_shares/pending");return m.Z.get(e,{headers:y,params:{include_tags:!0}})}()),r&&s.push(function(){const e=(0,g.generateOcsUrl)("apps/files_sharing/api/v1/deletedshares");return m.Z.get(e,{headers:y,params:{include_tags:!0}})}());let o=(await Promise.all(s)).map((e=>e.data.ocs.data)).flat().map(b).filter((e=>null!==e));return n.length>0&&(o=o.filter((e=>{var t;return n.includes(null===(t=e.attributes)||void 0===t?void 0:t.share_type)}))),{folder:new f({id:0,source:(0,g.generateRemoteUrl)("dav"+_),owner:(null===(e=(0,a.ts)())||void 0===e?void 0:e.uid)||null}),contents:o}},E="shareoverview",x="sharingin",A="sharingout",L="sharinglinks",O="deletedshares",S="pendingshares";var H=i(69183);const R=(0,l.IY)().setApp("files").detectUser().build();var D;!function(e){e.DEFAULT="default",e.HIDDEN="hidden"}(D||(D={}));class N{constructor(e){var t,i,r;t=this,r=void 0,(i=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(i="_action"))in t?Object.defineProperty(t,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[i]=r,this.validateAction(e),this._action=e}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(e){if(!e.id||"string"!=typeof e.id)throw new Error("Invalid id");if(!e.displayName||"function"!=typeof e.displayName)throw new Error("Invalid displayName function");if(!e.iconSvgInline||"function"!=typeof e.iconSvgInline)throw new Error("Invalid iconSvgInline function");if(!e.exec||"function"!=typeof e.exec)throw new Error("Invalid exec function");if("enabled"in e&&"function"!=typeof e.enabled)throw new Error("Invalid enabled function");if("execBatch"in e&&"function"!=typeof e.execBatch)throw new Error("Invalid execBatch function");if("order"in e&&"number"!=typeof e.order)throw new Error("Invalid order");if(e.default&&!Object.values(D).includes(e.default))throw new Error("Invalid default");if("inline"in e&&"function"!=typeof e.inline)throw new Error("Invalid inline function");if("renderInline"in e&&"function"!=typeof e.renderInline)throw new Error("Invalid renderInline function")}}const M=function(e){void 0===window._nc_fileactions&&(window._nc_fileactions=[],R.debug("FileActions initialized")),window._nc_fileactions.find((t=>t.id===e.id))?R.error("FileAction ".concat(e.id," already registered"),{action:e}):window._nc_fileactions.push(e)};M(new N({id:"accept-share",displayName:e=>(0,o.uN)("files_sharing","Accept share","Accept shares",e.length),iconSvgInline:()=>'',enabled:(e,t)=>e.length>0&&t.id===S,async exec(e){try{const t=!!e.attributes.remote,i=(0,g.generateOcsUrl)("apps/files_sharing/api/v1/{shareBase}/pending/{id}",{shareBase:t?"remote_shares":"shares",id:e.attributes.id});return await m.Z.post(i),(0,H.j8)("files:node:deleted",e),!0}catch(e){return!1}},async execBatch(e,t,i){return Promise.all(e.map((e=>this.exec(e,t,i))))},order:1,inline:()=>!0})),M(new N({id:"open-in-files",displayName:()=>(0,o.Iu)("files","Open in Files"),iconSvgInline:()=>"",enabled:(e,t)=>[E,x,A,L].includes(t.id),exec:async e=>(window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:e.fileid},{dir:e.dirname,fileid:e.fileid}),null),default:D.HIDDEN,order:-1e3})),M(new N({id:"reject-share",displayName:e=>(0,o.uN)("files_sharing","Reject share","Reject shares",e.length),iconSvgInline:()=>'',enabled:(e,t)=>t.id===S&&0!==e.length&&!e.some((e=>e.attributes.remote_id&&e.attributes.share_type===window.OC.Share.SHARE_TYPE_REMOTE_GROUP)),async exec(e){try{const t=!!e.attributes.remote,i=(0,g.generateOcsUrl)("apps/files_sharing/api/v1/{shareBase}/{id}",{shareBase:t?"remote_shares":"shares",id:e.attributes.id});return await m.Z.delete(i),(0,H.j8)("files:node:deleted",e),!0}catch(e){return!1}},async execBatch(e,t,i){return Promise.all(e.map((e=>this.exec(e,t,i))))},order:2,inline:()=>!0})),M(new N({id:"restore-share",displayName:e=>(0,o.uN)("files_sharing","Restore share","Restore shares",e.length),iconSvgInline:()=>'',enabled:(e,t)=>e.length>0&&t.id===O,async exec(e){try{const t=(0,g.generateOcsUrl)("apps/files_sharing/api/v1/deletedshares/{id}",{id:e.attributes.id});return await m.Z.post(t),(0,H.j8)("files:node:deleted",e),!0}catch(e){return!1}},async execBatch(e,t,i){return Promise.all(e.map((e=>this.exec(e,t,i))))},order:1,inline:()=>!0})),(()=>{const e=window.OCP.Files.Navigation;e.register({id:E,name:(0,o.Iu)("files_sharing","Shares"),caption:(0,o.Iu)("files_sharing","Overview of shared files."),emptyTitle:(0,o.Iu)("files_sharing","No shares"),emptyCaption:(0,o.Iu)("files_sharing","Files and folders you shared or have been shared with you will show up here"),icon:'',order:20,columns:[],getContents:()=>C()}),e.register({id:x,name:(0,o.Iu)("files_sharing","Shared with you"),caption:(0,o.Iu)("files_sharing","List of files that are shared with you."),emptyTitle:(0,o.Iu)("files_sharing","Nothing shared with you yet"),emptyCaption:(0,o.Iu)("files_sharing","Files and folders others shared with you will show up here"),icon:'',order:1,parent:E,columns:[],getContents:()=>C(!0,!1,!1,!1)}),e.register({id:A,name:(0,o.Iu)("files_sharing","Shared with others"),caption:(0,o.Iu)("files_sharing","List of files that you shared with others."),emptyTitle:(0,o.Iu)("files_sharing","Nothing shared yet"),emptyCaption:(0,o.Iu)("files_sharing","Files and folders you shared will show up here"),icon:'',order:2,parent:E,columns:[],getContents:()=>C(!1,!0,!1,!1)}),e.register({id:L,name:(0,o.Iu)("files_sharing","Shared by link"),caption:(0,o.Iu)("files_sharing","List of files that are shared by link."),emptyTitle:(0,o.Iu)("files_sharing","No shared links"),emptyCaption:(0,o.Iu)("files_sharing","Files and folders you shared by link will show up here"),icon:'',order:3,parent:E,columns:[],getContents:()=>C(!1,!0,!1,!1,[window.OC.Share.SHARE_TYPE_LINK])}),e.register({id:O,name:(0,o.Iu)("files_sharing","Deleted shares"),caption:(0,o.Iu)("files_sharing","List of shares you left."),emptyTitle:(0,o.Iu)("files_sharing","No deleted shares"),emptyCaption:(0,o.Iu)("files_sharing","Shares you have left will show up here"),icon:'',order:4,parent:E,columns:[],getContents:()=>C(!1,!1,!1,!0)}),e.register({id:S,name:(0,o.Iu)("files_sharing","Pending shares"),caption:(0,o.Iu)("files_sharing","List of unapproved shares."),emptyTitle:(0,o.Iu)("files_sharing","No pending shares"),emptyCaption:(0,o.Iu)("files_sharing","Shares you have received but not approved will show up here"),icon:'',order:5,parent:E,columns:[],getContents:()=>C(!1,!1,!0,!1)})})()}},i={};function r(e){var n=i[e];if(void 0!==n)return n.exports;var s=i[e]={id:e,loaded:!1,exports:{}};return t[e].call(s.exports,s,s.exports,r),s.loaded=!0,s.exports}r.m=t,e=[],r.O=(t,i,n,s)=>{if(!i){var o=1/0;for(h=0;h=s)&&Object.keys(r.O).every((e=>r.O[e](i[l])))?i.splice(l--,1):(a=!1,s0&&e[h-1][2]>s;h--)e[h]=e[h-1];e[h]=[i,n,s]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.j=6691,(()=>{r.b=document.baseURI||self.location.href;var e={6691:0};r.O.j=t=>0===e[t];var t=(t,i)=>{var n,s,o=i[0],a=i[1],l=i[2],d=0;if(o.some((t=>0!==e[t]))){for(n in a)r.o(a,n)&&(r.m[n]=a[n]);if(l)var h=l(r)}for(t&&t(i);dr(64123)));n=r.O(n)})(); +//# sourceMappingURL=files_sharing-files_sharing.js.map?v=cc5f91703b7416c8acf6 \ No newline at end of file diff --git a/dist/files_sharing-files_sharing.js.map b/dist/files_sharing-files_sharing.js.map index 69df6471f1f96..41c48dff6783a 100644 --- a/dist/files_sharing-files_sharing.js.map +++ b/dist/files_sharing-files_sharing.js.map @@ -1 +1 @@ -{"version":3,"file":"files_sharing-files_sharing.js?v=ee51fe58f7ba7de90a86","mappings":";uBAAIA,yBCoFcC,EA2HdC,EA2BAC,8CArJa,QADCF,GAWK,YATR,UACFG,OAAO,SACPC,SAEF,UACFD,OAAO,SACPE,OAAOL,EAAKM,KACZF,QAmHT,SAAWH,GACPA,EAAiB,OAAI,SACrBA,EAAe,KAAI,MACtB,CAHD,CAGGA,IAAaA,EAAW,CAAC,IAwB5B,SAAWC,GACPA,EAAWA,EAAiB,KAAI,GAAK,OACrCA,EAAWA,EAAmB,OAAI,GAAK,SACvCA,EAAWA,EAAiB,KAAI,GAAK,OACrCA,EAAWA,EAAmB,OAAI,GAAK,SACvCA,EAAWA,EAAmB,OAAI,GAAK,SACvCA,EAAWA,EAAkB,MAAI,IAAM,QACvCA,EAAWA,EAAgB,IAAI,IAAM,KACxC,CARD,CAQGA,IAAeA,EAAa,CAAC,IAKhC,MAsCMK,EAAiB,SAAUC,EAAQC,GACrC,OAAoC,OAA7BD,EAAOE,MAAMD,EACxB,EAIME,EAAe,CAACC,EAAMH,KACxB,GAAI,OAAQG,IAA4B,iBAAZA,EAAKC,IAAmBD,EAAKC,GAAK,GAC1D,MAAM,IAAIC,MAAM,4BAEpB,IAAKF,EAAKJ,OACN,MAAM,IAAIM,MAAM,4BAEpB,IACI,IAAIC,IAAIH,EAAKJ,OACjB,CACA,MAAOQ,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ules/@nextcloud/files/dist/index.esm.js","webpack:///nextcloud/apps/files_sharing/src/services/logger.ts","webpack:///nextcloud/apps/files_sharing/src/services/SharingService.ts","webpack:///nextcloud/apps/files_sharing/src/views/shares.ts","webpack:///nextcloud/apps/files/src/logger.js","webpack:///nextcloud/apps/files/src/services/FileAction.ts","webpack:///nextcloud/apps/files_sharing/src/actions/acceptShareAction.ts","webpack:///nextcloud/apps/files_sharing/src/actions/openInFilesAction.ts","webpack:///nextcloud/apps/files_sharing/src/actions/rejectShareAction.ts","webpack:///nextcloud/apps/files_sharing/src/actions/restoreShareAction.ts","webpack:///nextcloud/apps/files_sharing/src/files_sharing.ts","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/global","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand","webpack:///nextcloud/webpack/runtime/make namespace object","webpack:///nextcloud/webpack/runtime/node module decorator","webpack:///nextcloud/webpack/runtime/runtimeId","webpack:///nextcloud/webpack/runtime/jsonp chunk loading","webpack:///nextcloud/webpack/runtime/nonce","webpack:///nextcloud/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","import { getCanonicalLocale } from '@nextcloud/l10n';\nimport { getCurrentUser } from '@nextcloud/auth';\nimport { getLoggerBuilder } from '@nextcloud/logger';\nimport { join, basename, extname, dirname } from 'path';\n\n/**\n * @copyright 2019 Christoph Wurst \n *\n * @author Christoph Wurst \n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nconst humanList = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];\nconst humanListBinary = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB'];\n/**\n * Format a file size in a human-like format. e.g. 42GB\n *\n * @param size in bytes\n * @param skipSmallSizes avoid rendering tiny sizes and return '< 1 KB' instead\n */\nfunction formatFileSize(size, skipSmallSizes = false, binaryPrefixes = false) {\n if (typeof size === 'string') {\n size = Number(size);\n }\n /*\n * @note This block previously used Log base 1024, per IEC 80000-13;\n * however, the wrong prefix was used. Now we use decimal calculation\n * with base 1000 per the SI. Base 1024 calculation with binary\n * prefixes is optional, but has yet to be added to the UI.\n */\n // Calculate Log with base 1024 or 1000: size = base ** order\n let order = size > 0 ? Math.floor(Math.log(size) / Math.log(binaryPrefixes ? 1024 : 1000)) : 0;\n // Stay in range of the byte sizes that are defined\n order = Math.min((binaryPrefixes ? humanListBinary.length : humanList.length) - 1, order);\n const readableFormat = binaryPrefixes ? humanListBinary[order] : humanList[order];\n let relativeSize = (size / Math.pow(binaryPrefixes ? 1024 : 1000, order)).toFixed(1);\n if (skipSmallSizes === true && order === 0) {\n return (relativeSize !== '0.0' ? '< 1 ' : '0 ') + (binaryPrefixes ? humanListBinary[1] : humanList[1]);\n }\n if (order < 2) {\n relativeSize = parseFloat(relativeSize).toFixed(0);\n }\n else {\n relativeSize = parseFloat(relativeSize).toLocaleString(getCanonicalLocale());\n }\n return relativeSize + ' ' + readableFormat;\n}\n\n/**\n * @copyright 2019 Christoph Wurst \n *\n * @author Christoph Wurst \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nconst getLogger = user => {\n if (user === null) {\n return getLoggerBuilder()\n .setApp('files')\n .build();\n }\n return getLoggerBuilder()\n .setApp('files')\n .setUid(user.uid)\n .build();\n};\nvar logger = getLogger(getCurrentUser());\n\n/**\n * @copyright Copyright (c) 2021 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nclass NewFileMenu {\n _entries = [];\n registerEntry(entry) {\n this.validateEntry(entry);\n this._entries.push(entry);\n }\n unregisterEntry(entry) {\n const entryIndex = typeof entry === 'string'\n ? this.getEntryIndex(entry)\n : this.getEntryIndex(entry.id);\n if (entryIndex === -1) {\n logger.warn('Entry not found, nothing removed', { entry, entries: this.getEntries() });\n return;\n }\n this._entries.splice(entryIndex, 1);\n }\n /**\n * Get the list of registered entries\n *\n * @param {FileInfo} context the creation context. Usually the current folder FileInfo\n */\n getEntries(context) {\n if (context) {\n return this._entries\n .filter(entry => typeof entry.if === 'function' ? entry.if(context) : true);\n }\n return this._entries;\n }\n getEntryIndex(id) {\n return this._entries.findIndex(entry => entry.id === id);\n }\n validateEntry(entry) {\n if (!entry.id || !entry.displayName || !(entry.iconSvgInline || entry.iconClass)) {\n throw new Error('Invalid entry');\n }\n if (typeof entry.id !== 'string'\n || typeof entry.displayName !== 'string') {\n throw new Error('Invalid id or displayName property');\n }\n if ((entry.iconClass && typeof entry.iconClass !== 'string')\n || (entry.iconSvgInline && typeof entry.iconSvgInline !== 'string')) {\n throw new Error('Invalid icon provided');\n }\n if (entry.if !== undefined && typeof entry.if !== 'function') {\n throw new Error('Invalid if property');\n }\n if (entry.templateName && typeof entry.templateName !== 'string') {\n throw new Error('Invalid templateName property');\n }\n if (entry.handler && typeof entry.handler !== 'function') {\n throw new Error('Invalid handler property');\n }\n if (!entry.templateName && !entry.handler) {\n throw new Error('At least a templateName or a handler must be provided');\n }\n if (this.getEntryIndex(entry.id) !== -1) {\n throw new Error('Duplicate entry');\n }\n }\n}\nconst getNewFileMenu = function () {\n if (typeof window._nc_newfilemenu === 'undefined') {\n window._nc_newfilemenu = new NewFileMenu();\n logger.debug('NewFileMenu initialized');\n }\n return window._nc_newfilemenu;\n};\n\n/**\n * @copyright Copyright (c) 2022 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nvar FileType;\n(function (FileType) {\n FileType[\"Folder\"] = \"folder\";\n FileType[\"File\"] = \"file\";\n})(FileType || (FileType = {}));\n\n/**\n * @copyright Copyright (c) 2022 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nvar Permission;\n(function (Permission) {\n Permission[Permission[\"NONE\"] = 0] = \"NONE\";\n Permission[Permission[\"CREATE\"] = 4] = \"CREATE\";\n Permission[Permission[\"READ\"] = 1] = \"READ\";\n Permission[Permission[\"UPDATE\"] = 2] = \"UPDATE\";\n Permission[Permission[\"DELETE\"] = 8] = \"DELETE\";\n Permission[Permission[\"SHARE\"] = 16] = \"SHARE\";\n Permission[Permission[\"ALL\"] = 31] = \"ALL\";\n})(Permission || (Permission = {}));\n/**\n * Parse the webdav permission string to a permission enum\n * @see https://github.com/nextcloud/server/blob/71f698649f578db19a22457cb9d420fb62c10382/lib/public/Files/DavUtil.php#L58-L88\n */\nconst parseWebdavPermissions = function (permString = '') {\n let permissions = Permission.NONE;\n if (!permString)\n return permissions;\n if (permString.includes('C') || permString.includes('K'))\n permissions |= Permission.CREATE;\n if (permString.includes('G'))\n permissions |= Permission.READ;\n if (permString.includes('W') || permString.includes('N') || permString.includes('V'))\n permissions |= Permission.UPDATE;\n if (permString.includes('D'))\n permissions |= Permission.DELETE;\n if (permString.includes('R'))\n permissions |= Permission.SHARE;\n return permissions;\n};\n\n/**\n * @copyright Copyright (c) 2022 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nconst isDavRessource = function (source, davService) {\n return source.match(davService) !== null;\n};\n/**\n * Validate Node construct data\n */\nconst validateData = (data, davService) => {\n if ('id' in data && (typeof data.id !== 'number' || data.id < 0)) {\n throw new Error('Invalid id type of value');\n }\n if (!data.source) {\n throw new Error('Missing mandatory source');\n }\n try {\n new URL(data.source);\n }\n catch (e) {\n throw new Error('Invalid source format, source must be a valid URL');\n }\n if (!data.source.startsWith('http')) {\n throw new Error('Invalid source format, only http(s) is supported');\n }\n if ('mtime' in data && !(data.mtime instanceof Date)) {\n throw new Error('Invalid mtime type');\n }\n if ('crtime' in data && !(data.crtime instanceof Date)) {\n throw new Error('Invalid crtime type');\n }\n if (!data.mime || typeof data.mime !== 'string'\n || !data.mime.match(/^[-\\w.]+\\/[-+\\w.]+$/gi)) {\n throw new Error('Missing or invalid mandatory mime');\n }\n if ('size' in data && typeof data.size !== 'number') {\n throw new Error('Invalid size type');\n }\n if ('permissions' in data && !(typeof data.permissions === 'number'\n && data.permissions >= Permission.NONE\n && data.permissions <= Permission.ALL)) {\n throw new Error('Invalid permissions');\n }\n if ('owner' in data\n && data.owner !== null\n && typeof data.owner !== 'string') {\n throw new Error('Invalid owner type');\n }\n if ('attributes' in data && typeof data.attributes !== 'object') {\n throw new Error('Invalid attributes format');\n }\n if ('root' in data && typeof data.root !== 'string') {\n throw new Error('Invalid root format');\n }\n if (data.root && !data.root.startsWith('/')) {\n throw new Error('Root must start with a leading slash');\n }\n if (data.root && !data.source.includes(data.root)) {\n throw new Error('Root must be part of the source');\n }\n if (data.root && isDavRessource(data.source, davService)) {\n const service = data.source.match(davService)[0];\n if (!data.source.includes(join(service, data.root))) {\n throw new Error('The root must be relative to the service. e.g /files/emma');\n }\n }\n};\n\n/**\n * @copyright Copyright (c) 2022 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nclass Node {\n _data;\n _attributes;\n _knownDavService = /(remote|public)\\.php\\/(web)?dav/i;\n constructor(data, davService) {\n // Validate data\n validateData(data, davService || this._knownDavService);\n this._data = data;\n const handler = {\n set: (target, prop, value) => {\n // Edit modification time\n this._data['mtime'] = new Date();\n // Apply original changes\n return Reflect.set(target, prop, value);\n },\n deleteProperty: (target, prop) => {\n // Edit modification time\n this._data['mtime'] = new Date();\n // Apply original changes\n return Reflect.deleteProperty(target, prop);\n },\n };\n // Proxy the attributes to update the mtime on change\n this._attributes = new Proxy(data.attributes || {}, handler);\n delete this._data.attributes;\n if (davService) {\n this._knownDavService = davService;\n }\n }\n /**\n * Get the source url to this object\n */\n get source() {\n // strip any ending slash\n return this._data.source.replace(/\\/$/i, '');\n }\n /**\n * Get this object name\n */\n get basename() {\n return basename(this.source);\n }\n /**\n * Get this object's extension\n */\n get extension() {\n return extname(this.source);\n }\n /**\n * Get the directory path leading to this object\n * Will use the relative path to root if available\n */\n get dirname() {\n if (this.root) {\n // Using replace would remove all part matching root\n const firstMatch = this.source.indexOf(this.root);\n return dirname(this.source.slice(firstMatch + this.root.length) || '/');\n }\n // This should always be a valid URL\n // as this is tested in the constructor\n const url = new URL(this.source);\n return dirname(url.pathname);\n }\n /**\n * Get the file mime\n */\n get mime() {\n return this._data.mime;\n }\n /**\n * Get the file modification time\n */\n get mtime() {\n return this._data.mtime;\n }\n /**\n * Get the file creation time\n */\n get crtime() {\n return this._data.crtime;\n }\n /**\n * Get the file size\n */\n get size() {\n return this._data.size;\n }\n /**\n * Get the file attribute\n */\n get attributes() {\n return this._attributes;\n }\n /**\n * Get the file permissions\n */\n get permissions() {\n // If this is not a dav ressource, we can only read it\n if (this.owner === null && !this.isDavRessource) {\n return Permission.READ;\n }\n // If the permissions are not defined, we have none\n return this._data.permissions !== undefined\n ? this._data.permissions\n : Permission.NONE;\n }\n /**\n * Get the file owner\n */\n get owner() {\n // Remote ressources have no owner\n if (!this.isDavRessource) {\n return null;\n }\n return this._data.owner;\n }\n /**\n * Is this a dav-related ressource ?\n */\n get isDavRessource() {\n return isDavRessource(this.source, this._knownDavService);\n }\n /**\n * Get the dav root of this object\n */\n get root() {\n // If provided (recommended), use the root and strip away the ending slash\n if (this._data.root) {\n return this._data.root.replace(/^(.+)\\/$/, '$1');\n }\n // Use the source to get the root from the dav service\n if (this.isDavRessource) {\n const root = dirname(this.source);\n return root.split(this._knownDavService).pop() || null;\n }\n return null;\n }\n /**\n * Get the absolute path of this object relative to the root\n */\n get path() {\n if (this.root) {\n // Using replace would remove all part matching root\n const firstMatch = this.source.indexOf(this.root);\n return this.source.slice(firstMatch + this.root.length) || '/';\n }\n return (this.dirname + '/' + this.basename).replace(/\\/\\//g, '/');\n }\n /**\n * Get the node id if defined.\n * Will look for the fileid in attributes if undefined.\n */\n get fileid() {\n return this._data?.id || this.attributes?.fileid;\n }\n /**\n * Move the node to a new destination\n *\n * @param {string} destination the new source.\n * e.g. https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg\n */\n move(destination) {\n validateData({ ...this._data, source: destination }, this._knownDavService);\n this._data.source = destination;\n this._data.mtime = new Date();\n }\n /**\n * Rename the node\n * This aliases the move method for easier usage\n */\n rename(basename) {\n if (basename.includes('/')) {\n throw new Error('Invalid basename');\n }\n this.move(dirname(this.source) + '/' + basename);\n }\n}\n\n/**\n * @copyright Copyright (c) 2022 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nclass File extends Node {\n get type() {\n return FileType.File;\n }\n}\n\n/**\n * @copyright Copyright (c) 2022 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nclass Folder extends Node {\n constructor(data) {\n // enforcing mimes\n super({\n ...data,\n mime: 'httpd/unix-directory'\n });\n }\n get type() {\n return FileType.Folder;\n }\n get extension() {\n return null;\n }\n get mime() {\n return 'httpd/unix-directory';\n }\n}\n\n/**\n * @copyright Copyright (c) 2021 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nclass FileAction {\n _action;\n constructor(action) {\n this.validateAction(action);\n this._action = action;\n }\n get id() {\n return this._action.id;\n }\n get displayName() {\n return this._action.displayName;\n }\n get iconSvgInline() {\n return this._action.iconSvgInline;\n }\n get enabled() {\n return this._action.enabled;\n }\n get exec() {\n return this._action.exec;\n }\n get execBatch() {\n return this._action.execBatch;\n }\n get order() {\n return this._action.order;\n }\n get default() {\n return this._action.default;\n }\n get inline() {\n return this._action.inline;\n }\n get renderInline() {\n return this._action.renderInline;\n }\n validateAction(action) {\n if (!action.id || typeof action.id !== 'string') {\n throw new Error('Invalid id');\n }\n if (!action.displayName || typeof action.displayName !== 'function') {\n throw new Error('Invalid displayName function');\n }\n if (!action.iconSvgInline || typeof action.iconSvgInline !== 'function') {\n throw new Error('Invalid iconSvgInline function');\n }\n if (!action.exec || typeof action.exec !== 'function') {\n throw new Error('Invalid exec function');\n }\n // Optional properties --------------------------------------------\n if ('enabled' in action && typeof action.enabled !== 'function') {\n throw new Error('Invalid enabled function');\n }\n if ('execBatch' in action && typeof action.execBatch !== 'function') {\n throw new Error('Invalid execBatch function');\n }\n if ('order' in action && typeof action.order !== 'number') {\n throw new Error('Invalid order');\n }\n if ('default' in action && typeof action.default !== 'boolean') {\n throw new Error('Invalid default');\n }\n if ('inline' in action && typeof action.inline !== 'function') {\n throw new Error('Invalid inline function');\n }\n if ('renderInline' in action && typeof action.renderInline !== 'function') {\n throw new Error('Invalid renderInline function');\n }\n }\n}\nconst registerFileAction = function (action) {\n if (typeof window._nc_fileactions === 'undefined') {\n window._nc_fileactions = [];\n logger.debug('FileActions initialized');\n }\n // Check duplicates\n if (window._nc_fileactions.find(search => search.id === action.id)) {\n logger.error(`FileAction ${action.id} already registered`, { action });\n return;\n }\n window._nc_fileactions.push(action);\n};\nconst getFileActions = function () {\n return window._nc_fileactions || [];\n};\n\n/**\n * @copyright 2019 Christoph Wurst \n *\n * @author Christoph Wurst \n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\n/**\n * Add a new menu entry to the upload manager menu\n */\nconst addNewFileMenuEntry = function (entry) {\n const newFileMenu = getNewFileMenu();\n return newFileMenu.registerEntry(entry);\n};\n/**\n * Remove a previously registered entry from the upload menu\n */\nconst removeNewFileMenuEntry = function (entry) {\n const newFileMenu = getNewFileMenu();\n return newFileMenu.unregisterEntry(entry);\n};\n/**\n * Get the list of registered entries from the upload menu\n *\n * @param {FileInfo} context the creation context. Usually the current folder FileInfo\n */\nconst getNewFileMenuEntries = function (context) {\n const newFileMenu = getNewFileMenu();\n return newFileMenu.getEntries(context);\n};\n\nexport { File, FileAction, FileType, Folder, Node, Permission, addNewFileMenuEntry, formatFileSize, getFileActions, getNewFileMenuEntries, parseWebdavPermissions, registerFileAction, removeNewFileMenuEntry };\n//# sourceMappingURL=index.esm.js.map\n","/**\n * @copyright Copyright (c) 2022 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nimport { getLoggerBuilder } from '@nextcloud/logger';\nexport default getLoggerBuilder()\n .setApp('files_sharing')\n .detectUser()\n .build();\n","import { Folder, File } from '@nextcloud/files';\nimport { generateOcsUrl, generateRemoteUrl, generateUrl } from '@nextcloud/router';\nimport { getCurrentUser } from '@nextcloud/auth';\nimport axios from '@nextcloud/axios';\nimport logger from './logger';\nexport const rootPath = `/files/${getCurrentUser()?.uid}`;\nconst headers = {\n 'Content-Type': 'application/json',\n};\nconst ocsEntryToNode = function (ocsEntry) {\n try {\n const isFolder = ocsEntry?.item_type === 'folder';\n const hasPreview = ocsEntry?.has_preview === true;\n const Node = isFolder ? Folder : File;\n const fileid = ocsEntry.file_source;\n const previewUrl = hasPreview ? generateUrl('/core/preview?fileId={fileid}&x=32&y=32&forceIcon=0', { fileid }) : undefined;\n // Generate path and strip double slashes\n const path = ocsEntry?.path || ocsEntry.file_target;\n const source = generateRemoteUrl(`dav/${rootPath}/${path}`.replaceAll(/\\/\\//gm, '/'));\n // Prefer share time if more recent than item mtime\n let mtime = ocsEntry?.item_mtime ? new Date((ocsEntry.item_mtime) * 1000) : undefined;\n if (ocsEntry?.stime > (ocsEntry?.item_mtime || 0)) {\n mtime = new Date((ocsEntry.stime) * 1000);\n }\n return new Node({\n id: fileid,\n source,\n owner: ocsEntry?.uid_owner,\n mime: ocsEntry?.mimetype,\n mtime,\n size: ocsEntry?.item_size,\n permissions: ocsEntry?.item_permissions || ocsEntry?.permissions,\n root: rootPath,\n attributes: {\n ...ocsEntry,\n previewUrl,\n 'has-preview': hasPreview,\n favorite: ocsEntry?.tags?.includes(window.OC.TAG_FAVORITE) ? 1 : 0,\n },\n });\n }\n catch (error) {\n logger.error('Error while parsing OCS entry', { error });\n return null;\n }\n};\nconst getShares = function (shared_with_me = false) {\n const url = generateOcsUrl('apps/files_sharing/api/v1/shares');\n return axios.get(url, {\n headers,\n params: {\n shared_with_me,\n include_tags: true,\n },\n });\n};\nconst getSharedWithYou = function () {\n return getShares(true);\n};\nconst getSharedWithOthers = function () {\n return getShares();\n};\nconst getRemoteShares = function () {\n const url = generateOcsUrl('apps/files_sharing/api/v1/remote_shares');\n return axios.get(url, {\n headers,\n params: {\n include_tags: true,\n },\n });\n};\nconst getPendingShares = function () {\n const url = generateOcsUrl('apps/files_sharing/api/v1/shares/pending');\n return axios.get(url, {\n headers,\n params: {\n include_tags: true,\n },\n });\n};\nconst getRemotePendingShares = function () {\n const url = generateOcsUrl('apps/files_sharing/api/v1/remote_shares/pending');\n return axios.get(url, {\n headers,\n params: {\n include_tags: true,\n },\n });\n};\nconst getDeletedShares = function () {\n const url = generateOcsUrl('apps/files_sharing/api/v1/deletedshares');\n return axios.get(url, {\n headers,\n params: {\n include_tags: true,\n },\n });\n};\nexport const getContents = async (sharedWithYou = true, sharedWithOthers = true, pendingShares = false, deletedshares = false, filterTypes = []) => {\n const promises = [];\n if (sharedWithYou) {\n promises.push(getSharedWithYou(), getRemoteShares());\n }\n if (sharedWithOthers) {\n promises.push(getSharedWithOthers());\n }\n if (pendingShares) {\n promises.push(getPendingShares(), getRemotePendingShares());\n }\n if (deletedshares) {\n promises.push(getDeletedShares());\n }\n const responses = await Promise.all(promises);\n const data = responses.map((response) => response.data.ocs.data).flat();\n let contents = data.map(ocsEntryToNode).filter((node) => node !== null);\n if (filterTypes.length > 0) {\n contents = contents.filter((node) => filterTypes.includes(node.attributes?.share_type));\n }\n return {\n folder: new Folder({\n id: 0,\n source: generateRemoteUrl('dav' + rootPath),\n owner: getCurrentUser()?.uid || null,\n }),\n contents,\n };\n};\n","import { translate as t } from '@nextcloud/l10n';\nimport AccountClockSvg from '@mdi/svg/svg/account-clock.svg?raw';\nimport AccountGroupSvg from '@mdi/svg/svg/account-group.svg?raw';\nimport AccountSvg from '@mdi/svg/svg/account.svg?raw';\nimport DeleteSvg from '@mdi/svg/svg/delete.svg?raw';\nimport LinkSvg from '@mdi/svg/svg/link.svg?raw';\nimport ShareVariantSvg from '@mdi/svg/svg/share-variant.svg?raw';\nimport { getContents } from '../services/SharingService';\nexport const sharesViewId = 'shareoverview';\nexport const sharedWithYouViewId = 'sharingin';\nexport const sharedWithOthersViewId = 'sharingout';\nexport const sharingByLinksViewId = 'sharinglinks';\nexport const deletedSharesViewId = 'deletedshares';\nexport const pendingSharesViewId = 'pendingshares';\nexport default () => {\n const Navigation = window.OCP.Files.Navigation;\n Navigation.register({\n id: sharesViewId,\n name: t('files_sharing', 'Shares'),\n caption: t('files_sharing', 'Overview of shared files.'),\n emptyTitle: t('files_sharing', 'No shares'),\n emptyCaption: t('files_sharing', 'Files and folders you shared or have been shared with you will show up here'),\n icon: ShareVariantSvg,\n order: 20,\n columns: [],\n getContents: () => getContents(),\n });\n Navigation.register({\n id: sharedWithYouViewId,\n name: t('files_sharing', 'Shared with you'),\n caption: t('files_sharing', 'List of files that are shared with you.'),\n emptyTitle: t('files_sharing', 'Nothing shared with you yet'),\n emptyCaption: t('files_sharing', 'Files and folders others shared with you will show up here'),\n icon: AccountSvg,\n order: 1,\n parent: sharesViewId,\n columns: [],\n getContents: () => getContents(true, false, false, false),\n });\n Navigation.register({\n id: sharedWithOthersViewId,\n name: t('files_sharing', 'Shared with others'),\n caption: t('files_sharing', 'List of files that you shared with others.'),\n emptyTitle: t('files_sharing', 'Nothing shared yet'),\n emptyCaption: t('files_sharing', 'Files and folders you shared will show up here'),\n icon: AccountGroupSvg,\n order: 2,\n parent: sharesViewId,\n columns: [],\n getContents: () => getContents(false, true, false, false),\n });\n Navigation.register({\n id: sharingByLinksViewId,\n name: t('files_sharing', 'Shared by link'),\n caption: t('files_sharing', 'List of files that are shared by link.'),\n emptyTitle: t('files_sharing', 'No shared links'),\n emptyCaption: t('files_sharing', 'Files and folders you shared by link will show up here'),\n icon: LinkSvg,\n order: 3,\n parent: sharesViewId,\n columns: [],\n getContents: () => getContents(false, true, false, false, [window.OC.Share.SHARE_TYPE_LINK]),\n });\n Navigation.register({\n id: deletedSharesViewId,\n name: t('files_sharing', 'Deleted shares'),\n caption: t('files_sharing', 'List of shares you left.'),\n emptyTitle: t('files_sharing', 'No deleted shares'),\n emptyCaption: t('files_sharing', 'Shares you have left will show up here'),\n icon: DeleteSvg,\n order: 4,\n parent: sharesViewId,\n columns: [],\n getContents: () => getContents(false, false, false, true),\n });\n Navigation.register({\n id: pendingSharesViewId,\n name: t('files_sharing', 'Pending shares'),\n caption: t('files_sharing', 'List of unapproved shares.'),\n emptyTitle: t('files_sharing', 'No pending shares'),\n emptyCaption: t('files_sharing', 'Shares you have received but not approved will show up here'),\n icon: AccountClockSvg,\n order: 5,\n parent: sharesViewId,\n columns: [],\n getContents: () => getContents(false, false, true, false),\n });\n};\n","/**\n * @copyright Copyright (c) 2022 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nimport { getLoggerBuilder } from '@nextcloud/logger'\n\nexport default getLoggerBuilder()\n\t.setApp('files')\n\t.detectUser()\n\t.build()\n","/**\n * @copyright Copyright (c) 2023 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nimport logger from '../logger';\nexport var DefaultType;\n(function (DefaultType) {\n DefaultType[\"DEFAULT\"] = \"default\";\n DefaultType[\"HIDDEN\"] = \"hidden\";\n})(DefaultType || (DefaultType = {}));\nexport class FileAction {\n _action;\n constructor(action) {\n this.validateAction(action);\n this._action = action;\n }\n get id() {\n return this._action.id;\n }\n get displayName() {\n return this._action.displayName;\n }\n get iconSvgInline() {\n return this._action.iconSvgInline;\n }\n get enabled() {\n return this._action.enabled;\n }\n get exec() {\n return this._action.exec;\n }\n get execBatch() {\n return this._action.execBatch;\n }\n get order() {\n return this._action.order;\n }\n get default() {\n return this._action.default;\n }\n get inline() {\n return this._action.inline;\n }\n get renderInline() {\n return this._action.renderInline;\n }\n validateAction(action) {\n if (!action.id || typeof action.id !== 'string') {\n throw new Error('Invalid id');\n }\n if (!action.displayName || typeof action.displayName !== 'function') {\n throw new Error('Invalid displayName function');\n }\n if (!action.iconSvgInline || typeof action.iconSvgInline !== 'function') {\n throw new Error('Invalid iconSvgInline function');\n }\n if (!action.exec || typeof action.exec !== 'function') {\n throw new Error('Invalid exec function');\n }\n // Optional properties --------------------------------------------\n if ('enabled' in action && typeof action.enabled !== 'function') {\n throw new Error('Invalid enabled function');\n }\n if ('execBatch' in action && typeof action.execBatch !== 'function') {\n throw new Error('Invalid execBatch function');\n }\n if ('order' in action && typeof action.order !== 'number') {\n throw new Error('Invalid order');\n }\n if (action.default && !Object.values(DefaultType).includes(action.default)) {\n throw new Error('Invalid default');\n }\n if ('inline' in action && typeof action.inline !== 'function') {\n throw new Error('Invalid inline function');\n }\n if ('renderInline' in action && typeof action.renderInline !== 'function') {\n throw new Error('Invalid renderInline function');\n }\n }\n}\nexport const registerFileAction = function (action) {\n if (typeof window._nc_fileactions === 'undefined') {\n window._nc_fileactions = [];\n logger.debug('FileActions initialized');\n }\n // Check duplicates\n if (window._nc_fileactions.find(search => search.id === action.id)) {\n logger.error(`FileAction ${action.id} already registered`, { action });\n return;\n }\n window._nc_fileactions.push(action);\n};\nexport const getFileActions = function () {\n return window._nc_fileactions || [];\n};\n","import { emit } from '@nextcloud/event-bus';\nimport { generateOcsUrl } from '@nextcloud/router';\nimport { translatePlural as n } from '@nextcloud/l10n';\nimport axios from '@nextcloud/axios';\nimport CheckSvg from '@mdi/svg/svg/check.svg?raw';\nimport { FileAction, registerFileAction } from '../../../files/src/services/FileAction';\nimport { pendingSharesViewId } from '../views/shares';\nexport const action = new FileAction({\n id: 'accept-share',\n displayName: (nodes) => n('files_sharing', 'Accept share', 'Accept shares', nodes.length),\n iconSvgInline: () => CheckSvg,\n enabled: (nodes, view) => nodes.length > 0 && view.id === pendingSharesViewId,\n async exec(node) {\n try {\n const isRemote = !!node.attributes.remote;\n const url = generateOcsUrl('apps/files_sharing/api/v1/{shareBase}/pending/{id}', {\n shareBase: isRemote ? 'remote_shares' : 'shares',\n id: node.attributes.id,\n });\n await axios.post(url);\n // Remove from current view\n emit('files:node:deleted', node);\n return true;\n }\n catch (error) {\n return false;\n }\n },\n async execBatch(nodes, view, dir) {\n return Promise.all(nodes.map(node => this.exec(node, view, dir)));\n },\n order: 1,\n inline: () => true,\n});\nregisterFileAction(action);\n","/**\n * @copyright Copyright (c) 2023 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nimport { translate as t } from '@nextcloud/l10n';\nimport { registerFileAction, FileAction, DefaultType } from '../../../files/src/services/FileAction';\nimport { sharesViewId, sharedWithYouViewId, sharedWithOthersViewId, sharingByLinksViewId } from '../views/shares';\nexport const action = new FileAction({\n id: 'open-in-files',\n displayName: () => t('files', 'Open in files'),\n iconSvgInline: () => '',\n enabled: (nodes, view) => [\n sharesViewId,\n sharedWithYouViewId,\n sharedWithOthersViewId,\n sharingByLinksViewId,\n // Deleted and pending shares are not\n // accessible in the files app.\n ].includes(view.id),\n async exec(node) {\n window.OCP.Files.Router.goToRoute(null, // use default route\n { view: 'files', fileid: node.fileid }, { dir: node.dirname, fileid: node.fileid });\n return null;\n },\n default: DefaultType.HIDDEN,\n // Before openFolderAction\n order: -1000,\n});\nregisterFileAction(action);\n","import { emit } from '@nextcloud/event-bus';\nimport { generateOcsUrl } from '@nextcloud/router';\nimport { translatePlural as n } from '@nextcloud/l10n';\nimport axios from '@nextcloud/axios';\nimport CloseSvg from '@mdi/svg/svg/close.svg?raw';\nimport { FileAction, registerFileAction } from '../../../files/src/services/FileAction';\nimport { pendingSharesViewId } from '../views/shares';\nexport const action = new FileAction({\n id: 'reject-share',\n displayName: (nodes) => n('files_sharing', 'Reject share', 'Reject shares', nodes.length),\n iconSvgInline: () => CloseSvg,\n enabled: (nodes, view) => {\n if (view.id !== pendingSharesViewId) {\n return false;\n }\n if (nodes.length === 0) {\n return false;\n }\n // disable rejecting group shares from the pending list because they anyway\n // land back into that same list after rejecting them\n if (nodes.some(node => node.attributes.remote_id\n && node.attributes.share_type === window.OC.Share.SHARE_TYPE_REMOTE_GROUP)) {\n return false;\n }\n return true;\n },\n async exec(node) {\n try {\n const isRemote = !!node.attributes.remote;\n const url = generateOcsUrl('apps/files_sharing/api/v1/{shareBase}/{id}', {\n shareBase: isRemote ? 'remote_shares' : 'shares',\n id: node.attributes.id,\n });\n await axios.delete(url);\n // Remove from current view\n emit('files:node:deleted', node);\n return true;\n }\n catch (error) {\n return false;\n }\n },\n async execBatch(nodes, view, dir) {\n return Promise.all(nodes.map(node => this.exec(node, view, dir)));\n },\n order: 2,\n inline: () => true,\n});\nregisterFileAction(action);\n","import { emit } from '@nextcloud/event-bus';\nimport { generateOcsUrl } from '@nextcloud/router';\nimport { translatePlural as n } from '@nextcloud/l10n';\nimport axios from '@nextcloud/axios';\nimport ArrowULeftTopSvg from '@mdi/svg/svg/arrow-u-left-top.svg?raw';\nimport { FileAction, registerFileAction } from '../../../files/src/services/FileAction';\nimport { deletedSharesViewId } from '../views/shares';\nexport const action = new FileAction({\n id: 'restore-share',\n displayName: (nodes) => n('files_sharing', 'Restore share', 'Restore shares', nodes.length),\n iconSvgInline: () => ArrowULeftTopSvg,\n enabled: (nodes, view) => nodes.length > 0 && view.id === deletedSharesViewId,\n async exec(node) {\n try {\n const url = generateOcsUrl('apps/files_sharing/api/v1/deletedshares/{id}', {\n id: node.attributes.id,\n });\n await axios.post(url);\n // Remove from current view\n emit('files:node:deleted', node);\n return true;\n }\n catch (error) {\n return false;\n }\n },\n async execBatch(nodes, view, dir) {\n return Promise.all(nodes.map(node => this.exec(node, view, dir)));\n },\n order: 1,\n inline: () => true,\n});\nregisterFileAction(action);\n","/**\n * @copyright Copyright (c) 2019 John Molakvoæ \n *\n * @author John Molakvoæ \n * @author Julius Härtl \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nimport registerSharingViews from './views/shares';\nimport './actions/acceptShareAction';\nimport './actions/openInFilesAction';\nimport './actions/rejectShareAction';\nimport './actions/restoreShareAction';\nregisterSharingViews();\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 6691;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t6691: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunknextcloud\"] = self[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [7874], () => (__webpack_require__(64123)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","user","FileType","Permission","setApp","build","setUid","uid","isDavRessource","source","davService","match","validateData","data","id","Error","URL","e","startsWith","mtime","Date","crtime","mime","size","permissions","NONE","ALL","owner","attributes","root","includes","service","join","Node","_data","_attributes","_knownDavService","constructor","this","handler","set","target","prop","value","Reflect","deleteProperty","Proxy","replace","basename","extension","extname","dirname","firstMatch","indexOf","slice","length","url","pathname","undefined","READ","split","pop","path","fileid","move","destination","rename","File","type","Folder","super","getLoggerBuilder","detectUser","rootPath","concat","_getCurrentUser","getCurrentUser","headers","ocsEntryToNode","ocsEntry","_ocsEntry$tags","isFolder","item_type","hasPreview","has_preview","file_source","previewUrl","generateUrl","file_target","generateRemoteUrl","replaceAll","item_mtime","stime","uid_owner","mimetype","item_size","item_permissions","favorite","tags","window","OC","TAG_FAVORITE","error","logger","getShares","shared_with_me","arguments","generateOcsUrl","axios","get","params","include_tags","getContents","async","_getCurrentUser2","sharedWithOthers","pendingShares","deletedshares","filterTypes","promises","push","getRemoteShares","getPendingShares","getRemotePendingShares","getDeletedShares","contents","Promise","all","map","response","ocs","flat","filter","node","_node$attributes","share_type","folder","sharesViewId","sharedWithYouViewId","sharedWithOthersViewId","sharingByLinksViewId","deletedSharesViewId","pendingSharesViewId","DefaultType","FileAction","action","validateAction","_action","displayName","iconSvgInline","enabled","exec","execBatch","order","default","inline","renderInline","Object","values","registerFileAction","_nc_fileactions","debug","find","search","nodes","n","view","isRemote","remote","shareBase","post","emit","dir","t","OCP","Files","Router","goToRoute","HIDDEN","some","remote_id","Share","SHARE_TYPE_REMOTE_GROUP","delete","Navigation","register","name","caption","emptyTitle","emptyCaption","icon","columns","parent","SHARE_TYPE_LINK","registerSharingViews","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","loaded","__webpack_modules__","call","m","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","fulfilled","j","keys","every","key","splice","r","getter","__esModule","d","a","definition","o","defineProperty","enumerable","g","globalThis","Function","obj","prototype","hasOwnProperty","Symbol","toStringTag","nmd","paths","children","b","document","baseURI","self","location","href","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","chunkLoadingGlobal","forEach","bind","nc","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"files_sharing-files_sharing.js?v=cc5f91703b7416c8acf6","mappings":";uBAAIA,yBCoFcC,EA2HdC,EA2BAC,8CArJa,QADCF,GAWK,YATR,UACFG,OAAO,SACPC,SAEF,UACFD,OAAO,SACPE,OAAOL,EAAKM,KACZF,QAmHT,SAAWH,GACPA,EAAiB,OAAI,SACrBA,EAAe,KAAI,MACtB,CAHD,CAGGA,IAAaA,EAAW,CAAC,IAwB5B,SAAWC,GACPA,EAAWA,EAAiB,KAAI,GAAK,OACrCA,EAAWA,EAAmB,OAAI,GAAK,SACvCA,EAAWA,EAAiB,KAAI,GAAK,OACrCA,EAAWA,EAAmB,OAAI,GAAK,SACvCA,EAAWA,EAAmB,OAAI,GAAK,SACvCA,EAAWA,EAAkB,MAAI,IAAM,QACvCA,EAAWA,EAAgB,IAAI,IAAM,KACxC,CARD,CAQGA,IAAeA,EAAa,CAAC,IAKhC,MAsCMK,EAAiB,SAAUC,EAAQC,GACrC,OAAoC,OAA7BD,EAAOE,MAAMD,EACxB,EAIME,EAAe,CAACC,EAAMH,KACxB,GAAI,OAAQG,IAA4B,iBAAZA,EAAKC,IAAmBD,EAAKC,GAAK,GAC1D,MAAM,IAAIC,MAAM,4BAEpB,IAAKF,EAAKJ,OACN,MAAM,IAAIM,MAAM,4BAEpB,IACI,IAAIC,IAAIH,EAAKJ,OACjB,CACA,MAAOQ,GACH,MAAM,IAAIF,MAAM,oDACpB,CACA,IAAKF,EAAKJ,OAAOS,WAAW,QACxB,MAAM,IAAIH,MAAM,oDAEpB,GAAI,UAAWF,KAAUA,EAAKM,iBAAiBC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HRJ,EAAoBkB,EAAI,WCAxBlB,EAAoB2C,EAAIC,SAASC,SAAWC,KAAKC,SAASC,KAK1D,IAAIC,EAAkB,CACrB,KAAM,GAaPjD,EAAoBS,EAAES,EAAKgC,GAA0C,IAA7BD,EAAgBC,GAGxD,IAAIC,EAAuB,CAACC,EAA4B3O,KACvD,IAKIwL,EAAUiD,EALVvC,EAAWlM,EAAK,GAChB4O,EAAc5O,EAAK,GACnB6O,EAAU7O,EAAK,GAGIuM,EAAI,EAC3B,GAAGL,EAAS5B,MAAMrK,GAAgC,IAAxBuO,EAAgBvO,KAAa,CACtD,IAAIuL,KAAYoD,EACZrD,EAAoB6B,EAAEwB,EAAapD,KACrCD,EAAoBQ,EAAEP,GAAYoD,EAAYpD,IAGhD,GAAGqD,EAAS,IAAI5C,EAAS4C,EAAQtD,EAClC,CAEA,IADGoD,GAA4BA,EAA2B3O,GACrDuM,EAAIL,EAASxJ,OAAQ6J,IACzBkC,EAAUvC,EAASK,GAChBhB,EAAoB6B,EAAEoB,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAOlD,EAAoBS,EAAEC,EAAO,EAGjC6C,EAAqBT,KAA4B,sBAAIA,KAA4B,uBAAK,GAC1FS,EAAmBC,QAAQL,EAAqBM,KAAK,KAAM,IAC3DF,EAAmBnI,KAAO+H,EAAqBM,KAAK,KAAMF,EAAmBnI,KAAKqI,KAAKF,QClDvFvD,EAAoB0D,QAAKpM,ECGzB,IAAIqM,EAAsB3D,EAAoBS,OAAEnJ,EAAW,CAAC,OAAO,IAAO0I,EAAoB,SAC9F2D,EAAsB3D,EAAoBS,EAAEkD","sources":["webpack:///nextcloud/webpack/runtime/chunk loaded","webpack:///nextcloud/node_modules/@nextcloud/files/dist/index.esm.js","webpack:///nextcloud/apps/files_sharing/src/services/logger.ts","webpack:///nextcloud/apps/files_sharing/src/services/SharingService.ts","webpack:///nextcloud/apps/files_sharing/src/views/shares.ts","webpack:///nextcloud/apps/files/src/logger.js","webpack:///nextcloud/apps/files/src/services/FileAction.ts","webpack:///nextcloud/apps/files_sharing/src/actions/acceptShareAction.ts","webpack:///nextcloud/apps/files_sharing/src/actions/openInFilesAction.ts","webpack:///nextcloud/apps/files_sharing/src/actions/rejectShareAction.ts","webpack:///nextcloud/apps/files_sharing/src/actions/restoreShareAction.ts","webpack:///nextcloud/apps/files_sharing/src/files_sharing.ts","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/global","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand","webpack:///nextcloud/webpack/runtime/make namespace object","webpack:///nextcloud/webpack/runtime/node module decorator","webpack:///nextcloud/webpack/runtime/runtimeId","webpack:///nextcloud/webpack/runtime/jsonp chunk loading","webpack:///nextcloud/webpack/runtime/nonce","webpack:///nextcloud/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","import { getCanonicalLocale } from '@nextcloud/l10n';\nimport { getCurrentUser } from '@nextcloud/auth';\nimport { getLoggerBuilder } from '@nextcloud/logger';\nimport { join, basename, extname, dirname } from 'path';\n\n/**\n * @copyright 2019 Christoph Wurst \n *\n * @author Christoph Wurst \n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nconst humanList = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];\nconst humanListBinary = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB'];\n/**\n * Format a file size in a human-like format. e.g. 42GB\n *\n * @param size in bytes\n * @param skipSmallSizes avoid rendering tiny sizes and return '< 1 KB' instead\n */\nfunction formatFileSize(size, skipSmallSizes = false, binaryPrefixes = false) {\n if (typeof size === 'string') {\n size = Number(size);\n }\n /*\n * @note This block previously used Log base 1024, per IEC 80000-13;\n * however, the wrong prefix was used. Now we use decimal calculation\n * with base 1000 per the SI. Base 1024 calculation with binary\n * prefixes is optional, but has yet to be added to the UI.\n */\n // Calculate Log with base 1024 or 1000: size = base ** order\n let order = size > 0 ? Math.floor(Math.log(size) / Math.log(binaryPrefixes ? 1024 : 1000)) : 0;\n // Stay in range of the byte sizes that are defined\n order = Math.min((binaryPrefixes ? humanListBinary.length : humanList.length) - 1, order);\n const readableFormat = binaryPrefixes ? humanListBinary[order] : humanList[order];\n let relativeSize = (size / Math.pow(binaryPrefixes ? 1024 : 1000, order)).toFixed(1);\n if (skipSmallSizes === true && order === 0) {\n return (relativeSize !== '0.0' ? '< 1 ' : '0 ') + (binaryPrefixes ? humanListBinary[1] : humanList[1]);\n }\n if (order < 2) {\n relativeSize = parseFloat(relativeSize).toFixed(0);\n }\n else {\n relativeSize = parseFloat(relativeSize).toLocaleString(getCanonicalLocale());\n }\n return relativeSize + ' ' + readableFormat;\n}\n\n/**\n * @copyright 2019 Christoph Wurst \n *\n * @author Christoph Wurst \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nconst getLogger = user => {\n if (user === null) {\n return getLoggerBuilder()\n .setApp('files')\n .build();\n }\n return getLoggerBuilder()\n .setApp('files')\n .setUid(user.uid)\n .build();\n};\nvar logger = getLogger(getCurrentUser());\n\n/**\n * @copyright Copyright (c) 2021 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nclass NewFileMenu {\n _entries = [];\n registerEntry(entry) {\n this.validateEntry(entry);\n this._entries.push(entry);\n }\n unregisterEntry(entry) {\n const entryIndex = typeof entry === 'string'\n ? this.getEntryIndex(entry)\n : this.getEntryIndex(entry.id);\n if (entryIndex === -1) {\n logger.warn('Entry not found, nothing removed', { entry, entries: this.getEntries() });\n return;\n }\n this._entries.splice(entryIndex, 1);\n }\n /**\n * Get the list of registered entries\n *\n * @param {FileInfo} context the creation context. Usually the current folder FileInfo\n */\n getEntries(context) {\n if (context) {\n return this._entries\n .filter(entry => typeof entry.if === 'function' ? entry.if(context) : true);\n }\n return this._entries;\n }\n getEntryIndex(id) {\n return this._entries.findIndex(entry => entry.id === id);\n }\n validateEntry(entry) {\n if (!entry.id || !entry.displayName || !(entry.iconSvgInline || entry.iconClass)) {\n throw new Error('Invalid entry');\n }\n if (typeof entry.id !== 'string'\n || typeof entry.displayName !== 'string') {\n throw new Error('Invalid id or displayName property');\n }\n if ((entry.iconClass && typeof entry.iconClass !== 'string')\n || (entry.iconSvgInline && typeof entry.iconSvgInline !== 'string')) {\n throw new Error('Invalid icon provided');\n }\n if (entry.if !== undefined && typeof entry.if !== 'function') {\n throw new Error('Invalid if property');\n }\n if (entry.templateName && typeof entry.templateName !== 'string') {\n throw new Error('Invalid templateName property');\n }\n if (entry.handler && typeof entry.handler !== 'function') {\n throw new Error('Invalid handler property');\n }\n if (!entry.templateName && !entry.handler) {\n throw new Error('At least a templateName or a handler must be provided');\n }\n if (this.getEntryIndex(entry.id) !== -1) {\n throw new Error('Duplicate entry');\n }\n }\n}\nconst getNewFileMenu = function () {\n if (typeof window._nc_newfilemenu === 'undefined') {\n window._nc_newfilemenu = new NewFileMenu();\n logger.debug('NewFileMenu initialized');\n }\n return window._nc_newfilemenu;\n};\n\n/**\n * @copyright Copyright (c) 2022 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nvar FileType;\n(function (FileType) {\n FileType[\"Folder\"] = \"folder\";\n FileType[\"File\"] = \"file\";\n})(FileType || (FileType = {}));\n\n/**\n * @copyright Copyright (c) 2022 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nvar Permission;\n(function (Permission) {\n Permission[Permission[\"NONE\"] = 0] = \"NONE\";\n Permission[Permission[\"CREATE\"] = 4] = \"CREATE\";\n Permission[Permission[\"READ\"] = 1] = \"READ\";\n Permission[Permission[\"UPDATE\"] = 2] = \"UPDATE\";\n Permission[Permission[\"DELETE\"] = 8] = \"DELETE\";\n Permission[Permission[\"SHARE\"] = 16] = \"SHARE\";\n Permission[Permission[\"ALL\"] = 31] = \"ALL\";\n})(Permission || (Permission = {}));\n/**\n * Parse the webdav permission string to a permission enum\n * @see https://github.com/nextcloud/server/blob/71f698649f578db19a22457cb9d420fb62c10382/lib/public/Files/DavUtil.php#L58-L88\n */\nconst parseWebdavPermissions = function (permString = '') {\n let permissions = Permission.NONE;\n if (!permString)\n return permissions;\n if (permString.includes('C') || permString.includes('K'))\n permissions |= Permission.CREATE;\n if (permString.includes('G'))\n permissions |= Permission.READ;\n if (permString.includes('W') || permString.includes('N') || permString.includes('V'))\n permissions |= Permission.UPDATE;\n if (permString.includes('D'))\n permissions |= Permission.DELETE;\n if (permString.includes('R'))\n permissions |= Permission.SHARE;\n return permissions;\n};\n\n/**\n * @copyright Copyright (c) 2022 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nconst isDavRessource = function (source, davService) {\n return source.match(davService) !== null;\n};\n/**\n * Validate Node construct data\n */\nconst validateData = (data, davService) => {\n if ('id' in data && (typeof data.id !== 'number' || data.id < 0)) {\n throw new Error('Invalid id type of value');\n }\n if (!data.source) {\n throw new Error('Missing mandatory source');\n }\n try {\n new URL(data.source);\n }\n catch (e) {\n throw new Error('Invalid source format, source must be a valid URL');\n }\n if (!data.source.startsWith('http')) {\n throw new Error('Invalid source format, only http(s) is supported');\n }\n if ('mtime' in data && !(data.mtime instanceof Date)) {\n throw new Error('Invalid mtime type');\n }\n if ('crtime' in data && !(data.crtime instanceof Date)) {\n throw new Error('Invalid crtime type');\n }\n if (!data.mime || typeof data.mime !== 'string'\n || !data.mime.match(/^[-\\w.]+\\/[-+\\w.]+$/gi)) {\n throw new Error('Missing or invalid mandatory mime');\n }\n if ('size' in data && typeof data.size !== 'number') {\n throw new Error('Invalid size type');\n }\n if ('permissions' in data && !(typeof data.permissions === 'number'\n && data.permissions >= Permission.NONE\n && data.permissions <= Permission.ALL)) {\n throw new Error('Invalid permissions');\n }\n if ('owner' in data\n && data.owner !== null\n && typeof data.owner !== 'string') {\n throw new Error('Invalid owner type');\n }\n if ('attributes' in data && typeof data.attributes !== 'object') {\n throw new Error('Invalid attributes format');\n }\n if ('root' in data && typeof data.root !== 'string') {\n throw new Error('Invalid root format');\n }\n if (data.root && !data.root.startsWith('/')) {\n throw new Error('Root must start with a leading slash');\n }\n if (data.root && !data.source.includes(data.root)) {\n throw new Error('Root must be part of the source');\n }\n if (data.root && isDavRessource(data.source, davService)) {\n const service = data.source.match(davService)[0];\n if (!data.source.includes(join(service, data.root))) {\n throw new Error('The root must be relative to the service. e.g /files/emma');\n }\n }\n};\n\n/**\n * @copyright Copyright (c) 2022 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nclass Node {\n _data;\n _attributes;\n _knownDavService = /(remote|public)\\.php\\/(web)?dav/i;\n constructor(data, davService) {\n // Validate data\n validateData(data, davService || this._knownDavService);\n this._data = data;\n const handler = {\n set: (target, prop, value) => {\n // Edit modification time\n this._data['mtime'] = new Date();\n // Apply original changes\n return Reflect.set(target, prop, value);\n },\n deleteProperty: (target, prop) => {\n // Edit modification time\n this._data['mtime'] = new Date();\n // Apply original changes\n return Reflect.deleteProperty(target, prop);\n },\n };\n // Proxy the attributes to update the mtime on change\n this._attributes = new Proxy(data.attributes || {}, handler);\n delete this._data.attributes;\n if (davService) {\n this._knownDavService = davService;\n }\n }\n /**\n * Get the source url to this object\n */\n get source() {\n // strip any ending slash\n return this._data.source.replace(/\\/$/i, '');\n }\n /**\n * Get this object name\n */\n get basename() {\n return basename(this.source);\n }\n /**\n * Get this object's extension\n */\n get extension() {\n return extname(this.source);\n }\n /**\n * Get the directory path leading to this object\n * Will use the relative path to root if available\n */\n get dirname() {\n if (this.root) {\n // Using replace would remove all part matching root\n const firstMatch = this.source.indexOf(this.root);\n return dirname(this.source.slice(firstMatch + this.root.length) || '/');\n }\n // This should always be a valid URL\n // as this is tested in the constructor\n const url = new URL(this.source);\n return dirname(url.pathname);\n }\n /**\n * Get the file mime\n */\n get mime() {\n return this._data.mime;\n }\n /**\n * Get the file modification time\n */\n get mtime() {\n return this._data.mtime;\n }\n /**\n * Get the file creation time\n */\n get crtime() {\n return this._data.crtime;\n }\n /**\n * Get the file size\n */\n get size() {\n return this._data.size;\n }\n /**\n * Get the file attribute\n */\n get attributes() {\n return this._attributes;\n }\n /**\n * Get the file permissions\n */\n get permissions() {\n // If this is not a dav ressource, we can only read it\n if (this.owner === null && !this.isDavRessource) {\n return Permission.READ;\n }\n // If the permissions are not defined, we have none\n return this._data.permissions !== undefined\n ? this._data.permissions\n : Permission.NONE;\n }\n /**\n * Get the file owner\n */\n get owner() {\n // Remote ressources have no owner\n if (!this.isDavRessource) {\n return null;\n }\n return this._data.owner;\n }\n /**\n * Is this a dav-related ressource ?\n */\n get isDavRessource() {\n return isDavRessource(this.source, this._knownDavService);\n }\n /**\n * Get the dav root of this object\n */\n get root() {\n // If provided (recommended), use the root and strip away the ending slash\n if (this._data.root) {\n return this._data.root.replace(/^(.+)\\/$/, '$1');\n }\n // Use the source to get the root from the dav service\n if (this.isDavRessource) {\n const root = dirname(this.source);\n return root.split(this._knownDavService).pop() || null;\n }\n return null;\n }\n /**\n * Get the absolute path of this object relative to the root\n */\n get path() {\n if (this.root) {\n // Using replace would remove all part matching root\n const firstMatch = this.source.indexOf(this.root);\n return this.source.slice(firstMatch + this.root.length) || '/';\n }\n return (this.dirname + '/' + this.basename).replace(/\\/\\//g, '/');\n }\n /**\n * Get the node id if defined.\n * Will look for the fileid in attributes if undefined.\n */\n get fileid() {\n return this._data?.id || this.attributes?.fileid;\n }\n /**\n * Move the node to a new destination\n *\n * @param {string} destination the new source.\n * e.g. https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg\n */\n move(destination) {\n validateData({ ...this._data, source: destination }, this._knownDavService);\n this._data.source = destination;\n this._data.mtime = new Date();\n }\n /**\n * Rename the node\n * This aliases the move method for easier usage\n */\n rename(basename) {\n if (basename.includes('/')) {\n throw new Error('Invalid basename');\n }\n this.move(dirname(this.source) + '/' + basename);\n }\n}\n\n/**\n * @copyright Copyright (c) 2022 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nclass File extends Node {\n get type() {\n return FileType.File;\n }\n}\n\n/**\n * @copyright Copyright (c) 2022 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nclass Folder extends Node {\n constructor(data) {\n // enforcing mimes\n super({\n ...data,\n mime: 'httpd/unix-directory'\n });\n }\n get type() {\n return FileType.Folder;\n }\n get extension() {\n return null;\n }\n get mime() {\n return 'httpd/unix-directory';\n }\n}\n\n/**\n * @copyright Copyright (c) 2021 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nclass FileAction {\n _action;\n constructor(action) {\n this.validateAction(action);\n this._action = action;\n }\n get id() {\n return this._action.id;\n }\n get displayName() {\n return this._action.displayName;\n }\n get iconSvgInline() {\n return this._action.iconSvgInline;\n }\n get enabled() {\n return this._action.enabled;\n }\n get exec() {\n return this._action.exec;\n }\n get execBatch() {\n return this._action.execBatch;\n }\n get order() {\n return this._action.order;\n }\n get default() {\n return this._action.default;\n }\n get inline() {\n return this._action.inline;\n }\n get renderInline() {\n return this._action.renderInline;\n }\n validateAction(action) {\n if (!action.id || typeof action.id !== 'string') {\n throw new Error('Invalid id');\n }\n if (!action.displayName || typeof action.displayName !== 'function') {\n throw new Error('Invalid displayName function');\n }\n if (!action.iconSvgInline || typeof action.iconSvgInline !== 'function') {\n throw new Error('Invalid iconSvgInline function');\n }\n if (!action.exec || typeof action.exec !== 'function') {\n throw new Error('Invalid exec function');\n }\n // Optional properties --------------------------------------------\n if ('enabled' in action && typeof action.enabled !== 'function') {\n throw new Error('Invalid enabled function');\n }\n if ('execBatch' in action && typeof action.execBatch !== 'function') {\n throw new Error('Invalid execBatch function');\n }\n if ('order' in action && typeof action.order !== 'number') {\n throw new Error('Invalid order');\n }\n if ('default' in action && typeof action.default !== 'boolean') {\n throw new Error('Invalid default');\n }\n if ('inline' in action && typeof action.inline !== 'function') {\n throw new Error('Invalid inline function');\n }\n if ('renderInline' in action && typeof action.renderInline !== 'function') {\n throw new Error('Invalid renderInline function');\n }\n }\n}\nconst registerFileAction = function (action) {\n if (typeof window._nc_fileactions === 'undefined') {\n window._nc_fileactions = [];\n logger.debug('FileActions initialized');\n }\n // Check duplicates\n if (window._nc_fileactions.find(search => search.id === action.id)) {\n logger.error(`FileAction ${action.id} already registered`, { action });\n return;\n }\n window._nc_fileactions.push(action);\n};\nconst getFileActions = function () {\n return window._nc_fileactions || [];\n};\n\n/**\n * @copyright 2019 Christoph Wurst \n *\n * @author Christoph Wurst \n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\n/**\n * Add a new menu entry to the upload manager menu\n */\nconst addNewFileMenuEntry = function (entry) {\n const newFileMenu = getNewFileMenu();\n return newFileMenu.registerEntry(entry);\n};\n/**\n * Remove a previously registered entry from the upload menu\n */\nconst removeNewFileMenuEntry = function (entry) {\n const newFileMenu = getNewFileMenu();\n return newFileMenu.unregisterEntry(entry);\n};\n/**\n * Get the list of registered entries from the upload menu\n *\n * @param {FileInfo} context the creation context. Usually the current folder FileInfo\n */\nconst getNewFileMenuEntries = function (context) {\n const newFileMenu = getNewFileMenu();\n return newFileMenu.getEntries(context);\n};\n\nexport { File, FileAction, FileType, Folder, Node, Permission, addNewFileMenuEntry, formatFileSize, getFileActions, getNewFileMenuEntries, parseWebdavPermissions, registerFileAction, removeNewFileMenuEntry };\n//# sourceMappingURL=index.esm.js.map\n","/**\n * @copyright Copyright (c) 2022 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nimport { getLoggerBuilder } from '@nextcloud/logger';\nexport default getLoggerBuilder()\n .setApp('files_sharing')\n .detectUser()\n .build();\n","import { Folder, File } from '@nextcloud/files';\nimport { generateOcsUrl, generateRemoteUrl, generateUrl } from '@nextcloud/router';\nimport { getCurrentUser } from '@nextcloud/auth';\nimport axios from '@nextcloud/axios';\nimport logger from './logger';\nexport const rootPath = `/files/${getCurrentUser()?.uid}`;\nconst headers = {\n 'Content-Type': 'application/json',\n};\nconst ocsEntryToNode = function (ocsEntry) {\n try {\n const isFolder = ocsEntry?.item_type === 'folder';\n const hasPreview = ocsEntry?.has_preview === true;\n const Node = isFolder ? Folder : File;\n const fileid = ocsEntry.file_source;\n const previewUrl = hasPreview ? generateUrl('/core/preview?fileId={fileid}&x=32&y=32&forceIcon=0', { fileid }) : undefined;\n // Generate path and strip double slashes\n const path = ocsEntry?.path || ocsEntry.file_target;\n const source = generateRemoteUrl(`dav/${rootPath}/${path}`.replaceAll(/\\/\\//gm, '/'));\n // Prefer share time if more recent than item mtime\n let mtime = ocsEntry?.item_mtime ? new Date((ocsEntry.item_mtime) * 1000) : undefined;\n if (ocsEntry?.stime > (ocsEntry?.item_mtime || 0)) {\n mtime = new Date((ocsEntry.stime) * 1000);\n }\n return new Node({\n id: fileid,\n source,\n owner: ocsEntry?.uid_owner,\n mime: ocsEntry?.mimetype,\n mtime,\n size: ocsEntry?.item_size,\n permissions: ocsEntry?.item_permissions || ocsEntry?.permissions,\n root: rootPath,\n attributes: {\n ...ocsEntry,\n previewUrl,\n 'has-preview': hasPreview,\n favorite: ocsEntry?.tags?.includes(window.OC.TAG_FAVORITE) ? 1 : 0,\n },\n });\n }\n catch (error) {\n logger.error('Error while parsing OCS entry', { error });\n return null;\n }\n};\nconst getShares = function (shared_with_me = false) {\n const url = generateOcsUrl('apps/files_sharing/api/v1/shares');\n return axios.get(url, {\n headers,\n params: {\n shared_with_me,\n include_tags: true,\n },\n });\n};\nconst getSharedWithYou = function () {\n return getShares(true);\n};\nconst getSharedWithOthers = function () {\n return getShares();\n};\nconst getRemoteShares = function () {\n const url = generateOcsUrl('apps/files_sharing/api/v1/remote_shares');\n return axios.get(url, {\n headers,\n params: {\n include_tags: true,\n },\n });\n};\nconst getPendingShares = function () {\n const url = generateOcsUrl('apps/files_sharing/api/v1/shares/pending');\n return axios.get(url, {\n headers,\n params: {\n include_tags: true,\n },\n });\n};\nconst getRemotePendingShares = function () {\n const url = generateOcsUrl('apps/files_sharing/api/v1/remote_shares/pending');\n return axios.get(url, {\n headers,\n params: {\n include_tags: true,\n },\n });\n};\nconst getDeletedShares = function () {\n const url = generateOcsUrl('apps/files_sharing/api/v1/deletedshares');\n return axios.get(url, {\n headers,\n params: {\n include_tags: true,\n },\n });\n};\nexport const getContents = async (sharedWithYou = true, sharedWithOthers = true, pendingShares = false, deletedshares = false, filterTypes = []) => {\n const promises = [];\n if (sharedWithYou) {\n promises.push(getSharedWithYou(), getRemoteShares());\n }\n if (sharedWithOthers) {\n promises.push(getSharedWithOthers());\n }\n if (pendingShares) {\n promises.push(getPendingShares(), getRemotePendingShares());\n }\n if (deletedshares) {\n promises.push(getDeletedShares());\n }\n const responses = await Promise.all(promises);\n const data = responses.map((response) => response.data.ocs.data).flat();\n let contents = data.map(ocsEntryToNode).filter((node) => node !== null);\n if (filterTypes.length > 0) {\n contents = contents.filter((node) => filterTypes.includes(node.attributes?.share_type));\n }\n return {\n folder: new Folder({\n id: 0,\n source: generateRemoteUrl('dav' + rootPath),\n owner: getCurrentUser()?.uid || null,\n }),\n contents,\n };\n};\n","import { translate as t } from '@nextcloud/l10n';\nimport AccountClockSvg from '@mdi/svg/svg/account-clock.svg?raw';\nimport AccountGroupSvg from '@mdi/svg/svg/account-group.svg?raw';\nimport AccountSvg from '@mdi/svg/svg/account.svg?raw';\nimport DeleteSvg from '@mdi/svg/svg/delete.svg?raw';\nimport LinkSvg from '@mdi/svg/svg/link.svg?raw';\nimport ShareVariantSvg from '@mdi/svg/svg/share-variant.svg?raw';\nimport { getContents } from '../services/SharingService';\nexport const sharesViewId = 'shareoverview';\nexport const sharedWithYouViewId = 'sharingin';\nexport const sharedWithOthersViewId = 'sharingout';\nexport const sharingByLinksViewId = 'sharinglinks';\nexport const deletedSharesViewId = 'deletedshares';\nexport const pendingSharesViewId = 'pendingshares';\nexport default () => {\n const Navigation = window.OCP.Files.Navigation;\n Navigation.register({\n id: sharesViewId,\n name: t('files_sharing', 'Shares'),\n caption: t('files_sharing', 'Overview of shared files.'),\n emptyTitle: t('files_sharing', 'No shares'),\n emptyCaption: t('files_sharing', 'Files and folders you shared or have been shared with you will show up here'),\n icon: ShareVariantSvg,\n order: 20,\n columns: [],\n getContents: () => getContents(),\n });\n Navigation.register({\n id: sharedWithYouViewId,\n name: t('files_sharing', 'Shared with you'),\n caption: t('files_sharing', 'List of files that are shared with you.'),\n emptyTitle: t('files_sharing', 'Nothing shared with you yet'),\n emptyCaption: t('files_sharing', 'Files and folders others shared with you will show up here'),\n icon: AccountSvg,\n order: 1,\n parent: sharesViewId,\n columns: [],\n getContents: () => getContents(true, false, false, false),\n });\n Navigation.register({\n id: sharedWithOthersViewId,\n name: t('files_sharing', 'Shared with others'),\n caption: t('files_sharing', 'List of files that you shared with others.'),\n emptyTitle: t('files_sharing', 'Nothing shared yet'),\n emptyCaption: t('files_sharing', 'Files and folders you shared will show up here'),\n icon: AccountGroupSvg,\n order: 2,\n parent: sharesViewId,\n columns: [],\n getContents: () => getContents(false, true, false, false),\n });\n Navigation.register({\n id: sharingByLinksViewId,\n name: t('files_sharing', 'Shared by link'),\n caption: t('files_sharing', 'List of files that are shared by link.'),\n emptyTitle: t('files_sharing', 'No shared links'),\n emptyCaption: t('files_sharing', 'Files and folders you shared by link will show up here'),\n icon: LinkSvg,\n order: 3,\n parent: sharesViewId,\n columns: [],\n getContents: () => getContents(false, true, false, false, [window.OC.Share.SHARE_TYPE_LINK]),\n });\n Navigation.register({\n id: deletedSharesViewId,\n name: t('files_sharing', 'Deleted shares'),\n caption: t('files_sharing', 'List of shares you left.'),\n emptyTitle: t('files_sharing', 'No deleted shares'),\n emptyCaption: t('files_sharing', 'Shares you have left will show up here'),\n icon: DeleteSvg,\n order: 4,\n parent: sharesViewId,\n columns: [],\n getContents: () => getContents(false, false, false, true),\n });\n Navigation.register({\n id: pendingSharesViewId,\n name: t('files_sharing', 'Pending shares'),\n caption: t('files_sharing', 'List of unapproved shares.'),\n emptyTitle: t('files_sharing', 'No pending shares'),\n emptyCaption: t('files_sharing', 'Shares you have received but not approved will show up here'),\n icon: AccountClockSvg,\n order: 5,\n parent: sharesViewId,\n columns: [],\n getContents: () => getContents(false, false, true, false),\n });\n};\n","/**\n * @copyright Copyright (c) 2022 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nimport { getLoggerBuilder } from '@nextcloud/logger'\n\nexport default getLoggerBuilder()\n\t.setApp('files')\n\t.detectUser()\n\t.build()\n","/**\n * @copyright Copyright (c) 2023 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nimport logger from '../logger';\nexport var DefaultType;\n(function (DefaultType) {\n DefaultType[\"DEFAULT\"] = \"default\";\n DefaultType[\"HIDDEN\"] = \"hidden\";\n})(DefaultType || (DefaultType = {}));\nexport class FileAction {\n _action;\n constructor(action) {\n this.validateAction(action);\n this._action = action;\n }\n get id() {\n return this._action.id;\n }\n get displayName() {\n return this._action.displayName;\n }\n get iconSvgInline() {\n return this._action.iconSvgInline;\n }\n get enabled() {\n return this._action.enabled;\n }\n get exec() {\n return this._action.exec;\n }\n get execBatch() {\n return this._action.execBatch;\n }\n get order() {\n return this._action.order;\n }\n get default() {\n return this._action.default;\n }\n get inline() {\n return this._action.inline;\n }\n get renderInline() {\n return this._action.renderInline;\n }\n validateAction(action) {\n if (!action.id || typeof action.id !== 'string') {\n throw new Error('Invalid id');\n }\n if (!action.displayName || typeof action.displayName !== 'function') {\n throw new Error('Invalid displayName function');\n }\n if (!action.iconSvgInline || typeof action.iconSvgInline !== 'function') {\n throw new Error('Invalid iconSvgInline function');\n }\n if (!action.exec || typeof action.exec !== 'function') {\n throw new Error('Invalid exec function');\n }\n // Optional properties --------------------------------------------\n if ('enabled' in action && typeof action.enabled !== 'function') {\n throw new Error('Invalid enabled function');\n }\n if ('execBatch' in action && typeof action.execBatch !== 'function') {\n throw new Error('Invalid execBatch function');\n }\n if ('order' in action && typeof action.order !== 'number') {\n throw new Error('Invalid order');\n }\n if (action.default && !Object.values(DefaultType).includes(action.default)) {\n throw new Error('Invalid default');\n }\n if ('inline' in action && typeof action.inline !== 'function') {\n throw new Error('Invalid inline function');\n }\n if ('renderInline' in action && typeof action.renderInline !== 'function') {\n throw new Error('Invalid renderInline function');\n }\n }\n}\nexport const registerFileAction = function (action) {\n if (typeof window._nc_fileactions === 'undefined') {\n window._nc_fileactions = [];\n logger.debug('FileActions initialized');\n }\n // Check duplicates\n if (window._nc_fileactions.find(search => search.id === action.id)) {\n logger.error(`FileAction ${action.id} already registered`, { action });\n return;\n }\n window._nc_fileactions.push(action);\n};\nexport const getFileActions = function () {\n return window._nc_fileactions || [];\n};\n","import { emit } from '@nextcloud/event-bus';\nimport { generateOcsUrl } from '@nextcloud/router';\nimport { translatePlural as n } from '@nextcloud/l10n';\nimport axios from '@nextcloud/axios';\nimport CheckSvg from '@mdi/svg/svg/check.svg?raw';\nimport { FileAction, registerFileAction } from '../../../files/src/services/FileAction';\nimport { pendingSharesViewId } from '../views/shares';\nexport const action = new FileAction({\n id: 'accept-share',\n displayName: (nodes) => n('files_sharing', 'Accept share', 'Accept shares', nodes.length),\n iconSvgInline: () => CheckSvg,\n enabled: (nodes, view) => nodes.length > 0 && view.id === pendingSharesViewId,\n async exec(node) {\n try {\n const isRemote = !!node.attributes.remote;\n const url = generateOcsUrl('apps/files_sharing/api/v1/{shareBase}/pending/{id}', {\n shareBase: isRemote ? 'remote_shares' : 'shares',\n id: node.attributes.id,\n });\n await axios.post(url);\n // Remove from current view\n emit('files:node:deleted', node);\n return true;\n }\n catch (error) {\n return false;\n }\n },\n async execBatch(nodes, view, dir) {\n return Promise.all(nodes.map(node => this.exec(node, view, dir)));\n },\n order: 1,\n inline: () => true,\n});\nregisterFileAction(action);\n","/**\n * @copyright Copyright (c) 2023 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nimport { translate as t } from '@nextcloud/l10n';\nimport { registerFileAction, FileAction, DefaultType } from '../../../files/src/services/FileAction';\nimport { sharesViewId, sharedWithYouViewId, sharedWithOthersViewId, sharingByLinksViewId } from '../views/shares';\nexport const action = new FileAction({\n id: 'open-in-files',\n displayName: () => t('files', 'Open in Files'),\n iconSvgInline: () => '',\n enabled: (nodes, view) => [\n sharesViewId,\n sharedWithYouViewId,\n sharedWithOthersViewId,\n sharingByLinksViewId,\n // Deleted and pending shares are not\n // accessible in the files app.\n ].includes(view.id),\n async exec(node) {\n window.OCP.Files.Router.goToRoute(null, // use default route\n { view: 'files', fileid: node.fileid }, { dir: node.dirname, fileid: node.fileid });\n return null;\n },\n default: DefaultType.HIDDEN,\n // Before openFolderAction\n order: -1000,\n});\nregisterFileAction(action);\n","import { emit } from '@nextcloud/event-bus';\nimport { generateOcsUrl } from '@nextcloud/router';\nimport { translatePlural as n } from '@nextcloud/l10n';\nimport axios from '@nextcloud/axios';\nimport CloseSvg from '@mdi/svg/svg/close.svg?raw';\nimport { FileAction, registerFileAction } from '../../../files/src/services/FileAction';\nimport { pendingSharesViewId } from '../views/shares';\nexport const action = new FileAction({\n id: 'reject-share',\n displayName: (nodes) => n('files_sharing', 'Reject share', 'Reject shares', nodes.length),\n iconSvgInline: () => CloseSvg,\n enabled: (nodes, view) => {\n if (view.id !== pendingSharesViewId) {\n return false;\n }\n if (nodes.length === 0) {\n return false;\n }\n // disable rejecting group shares from the pending list because they anyway\n // land back into that same list after rejecting them\n if (nodes.some(node => node.attributes.remote_id\n && node.attributes.share_type === window.OC.Share.SHARE_TYPE_REMOTE_GROUP)) {\n return false;\n }\n return true;\n },\n async exec(node) {\n try {\n const isRemote = !!node.attributes.remote;\n const url = generateOcsUrl('apps/files_sharing/api/v1/{shareBase}/{id}', {\n shareBase: isRemote ? 'remote_shares' : 'shares',\n id: node.attributes.id,\n });\n await axios.delete(url);\n // Remove from current view\n emit('files:node:deleted', node);\n return true;\n }\n catch (error) {\n return false;\n }\n },\n async execBatch(nodes, view, dir) {\n return Promise.all(nodes.map(node => this.exec(node, view, dir)));\n },\n order: 2,\n inline: () => true,\n});\nregisterFileAction(action);\n","import { emit } from '@nextcloud/event-bus';\nimport { generateOcsUrl } from '@nextcloud/router';\nimport { translatePlural as n } from '@nextcloud/l10n';\nimport axios from '@nextcloud/axios';\nimport ArrowULeftTopSvg from '@mdi/svg/svg/arrow-u-left-top.svg?raw';\nimport { FileAction, registerFileAction } from '../../../files/src/services/FileAction';\nimport { deletedSharesViewId } from '../views/shares';\nexport const action = new FileAction({\n id: 'restore-share',\n displayName: (nodes) => n('files_sharing', 'Restore share', 'Restore shares', nodes.length),\n iconSvgInline: () => ArrowULeftTopSvg,\n enabled: (nodes, view) => nodes.length > 0 && view.id === deletedSharesViewId,\n async exec(node) {\n try {\n const url = generateOcsUrl('apps/files_sharing/api/v1/deletedshares/{id}', {\n id: node.attributes.id,\n });\n await axios.post(url);\n // Remove from current view\n emit('files:node:deleted', node);\n return true;\n }\n catch (error) {\n return false;\n }\n },\n async execBatch(nodes, view, dir) {\n return Promise.all(nodes.map(node => this.exec(node, view, dir)));\n },\n order: 1,\n inline: () => true,\n});\nregisterFileAction(action);\n","/**\n * @copyright Copyright (c) 2019 John Molakvoæ \n *\n * @author John Molakvoæ \n * @author Julius Härtl \n *\n * @license AGPL-3.0-or-later\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 .\n *\n */\nimport registerSharingViews from './views/shares';\nimport './actions/acceptShareAction';\nimport './actions/openInFilesAction';\nimport './actions/rejectShareAction';\nimport './actions/restoreShareAction';\nregisterSharingViews();\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 6691;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t6691: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunknextcloud\"] = self[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [7874], () => (__webpack_require__(64123)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","user","FileType","Permission","setApp","build","setUid","uid","isDavRessource","source","davService","match","validateData","data","id","Error","URL","e","startsWith","mtime","Date","crtime","mime","size","permissions","NONE","ALL","owner","attributes","root","includes","service","join","Node","_data","_attributes","_knownDavService","constructor","this","handler","set","target","prop","value","Reflect","deleteProperty","Proxy","replace","basename","extension","extname","dirname","firstMatch","indexOf","slice","length","url","pathname","undefined","READ","split","pop","path","fileid","move","destination","rename","File","type","Folder","super","getLoggerBuilder","detectUser","rootPath","concat","_getCurrentUser","getCurrentUser","headers","ocsEntryToNode","ocsEntry","_ocsEntry$tags","isFolder","item_type","hasPreview","has_preview","file_source","previewUrl","generateUrl","file_target","generateRemoteUrl","replaceAll","item_mtime","stime","uid_owner","mimetype","item_size","item_permissions","favorite","tags","window","OC","TAG_FAVORITE","error","logger","getShares","shared_with_me","arguments","generateOcsUrl","axios","get","params","include_tags","getContents","async","_getCurrentUser2","sharedWithOthers","pendingShares","deletedshares","filterTypes","promises","push","getRemoteShares","getPendingShares","getRemotePendingShares","getDeletedShares","contents","Promise","all","map","response","ocs","flat","filter","node","_node$attributes","share_type","folder","sharesViewId","sharedWithYouViewId","sharedWithOthersViewId","sharingByLinksViewId","deletedSharesViewId","pendingSharesViewId","DefaultType","FileAction","action","validateAction","_action","displayName","iconSvgInline","enabled","exec","execBatch","order","default","inline","renderInline","Object","values","registerFileAction","_nc_fileactions","debug","find","search","nodes","n","view","isRemote","remote","shareBase","post","emit","dir","t","OCP","Files","Router","goToRoute","HIDDEN","some","remote_id","Share","SHARE_TYPE_REMOTE_GROUP","delete","Navigation","register","name","caption","emptyTitle","emptyCaption","icon","columns","parent","SHARE_TYPE_LINK","registerSharingViews","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","loaded","__webpack_modules__","call","m","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","fulfilled","j","keys","every","key","splice","r","getter","__esModule","d","a","definition","o","defineProperty","enumerable","g","globalThis","Function","obj","prototype","hasOwnProperty","Symbol","toStringTag","nmd","paths","children","b","document","baseURI","self","location","href","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","chunkLoadingGlobal","forEach","bind","nc","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file