(()=>{"use strict";var e,t={40828:(e,t,s)=>{var n=s(70580),r=s.n(n),i=s(96763);!function(e,t){var s=function(t){this._root=t.root,"/"===this._root.charAt(this._root.length-1)&&(this._root=this._root.substr(0,this._root.length-1));let n=s.PROTOCOL_HTTP+"://";t.useHTTPS&&(n=s.PROTOCOL_HTTPS+"://"),n+=t.host+this._root,this._host=t.host,this._defaultHeaders=t.defaultHeaders||{"X-Requested-With":"XMLHttpRequest",requesttoken:e.requestToken},this._baseUrl=n;const r={baseUrl:this._baseUrl,xmlNamespaces:{"DAV:":"d","http://owncloud.org/ns":"oc","http://nextcloud.org/ns":"nc","http://open-collaboration-services.org/ns":"ocs"}};t.userName&&(r.userName=t.userName),t.password&&(r.password=t.password),this._client=new dav.Client(r),this._client.xhrProvider=_.bind(this._xhrProvider,this),this._fileInfoParsers=[]};s.NS_OWNCLOUD="http://owncloud.org/ns",s.NS_NEXTCLOUD="http://nextcloud.org/ns",s.NS_DAV="DAV:",s.NS_OCS="http://open-collaboration-services.org/ns",s.PROPERTY_GETLASTMODIFIED="{"+s.NS_DAV+"}getlastmodified",s.PROPERTY_GETETAG="{"+s.NS_DAV+"}getetag",s.PROPERTY_GETCONTENTTYPE="{"+s.NS_DAV+"}getcontenttype",s.PROPERTY_RESOURCETYPE="{"+s.NS_DAV+"}resourcetype",s.PROPERTY_INTERNAL_FILEID="{"+s.NS_OWNCLOUD+"}fileid",s.PROPERTY_PERMISSIONS="{"+s.NS_OWNCLOUD+"}permissions",s.PROPERTY_SIZE="{"+s.NS_OWNCLOUD+"}size",s.PROPERTY_GETCONTENTLENGTH="{"+s.NS_DAV+"}getcontentlength",s.PROPERTY_ISENCRYPTED="{"+s.NS_DAV+"}is-encrypted",s.PROPERTY_SHARE_PERMISSIONS="{"+s.NS_OCS+"}share-permissions",s.PROPERTY_SHARE_ATTRIBUTES="{"+s.NS_NEXTCLOUD+"}share-attributes",s.PROPERTY_QUOTA_AVAILABLE_BYTES="{"+s.NS_DAV+"}quota-available-bytes",s.PROTOCOL_HTTP="http",s.PROTOCOL_HTTPS="https",s._PROPFIND_PROPERTIES=[[s.NS_DAV,"getlastmodified"],[s.NS_DAV,"getetag"],[s.NS_DAV,"getcontenttype"],[s.NS_DAV,"resourcetype"],[s.NS_OWNCLOUD,"fileid"],[s.NS_OWNCLOUD,"permissions"],[s.NS_OWNCLOUD,"size"],[s.NS_DAV,"getcontentlength"],[s.NS_DAV,"quota-available-bytes"],[s.NS_NEXTCLOUD,"has-preview"],[s.NS_NEXTCLOUD,"mount-type"],[s.NS_NEXTCLOUD,"is-encrypted"],[s.NS_OCS,"share-permissions"],[s.NS_NEXTCLOUD,"share-attributes"]],s.prototype={_root:null,_client:null,_fileInfoParsers:[],_xhrProvider:function(){const t=this._defaultHeaders,s=new XMLHttpRequest,n=s.open;return s.open=function(){const e=n.apply(this,arguments);return _.each(t,(function(e,t){s.setRequestHeader(t,e)})),e},e.registerXHRForErrorProcessing(s),s},_buildUrl:function(){let e=this._buildPath.apply(this,arguments);return"/"===e.charAt([e.length-1])&&(e=e.substr(0,e.length-1)),"/"===e.charAt(0)&&(e=e.substr(1)),this._baseUrl+"/"+e},_buildPath:function(){let t=e.joinPaths.apply(this,arguments);const s=t.split("/");let n;for(n=0;n=200&&e<=299},_getSabreException:function(e){const t={},s=e.xhr.responseXML;if(null===s)return t;const n=s.getElementsByTagNameNS("http://sabredav.org/ns","message"),r=s.getElementsByTagNameNS("http://sabredav.org/ns","exception");return n.length&&(t.message=n[0].textContent),r.length&&(t.exception=r[0].textContent),t},getPropfindProperties:function(){return this._propfindProperties||(this._propfindProperties=_.map(s._PROPFIND_PROPERTIES,(function(e){return"{"+e[0]+"}"+e[1]}))),this._propfindProperties},getFolderContents:function(e,t){e||(e=""),t=t||{};const s=this,n=$.Deferred(),r=n.promise();let i;return i=_.isUndefined(t.properties)?this.getPropfindProperties():t.properties,this._client.propFind(this._buildUrl(e),i,1).then((function(e){if(s._isSuccessStatus(e.status)){const r=s._parseResult(e.body);t&&t.includeParent||r.shift(),n.resolve(e.status,r)}else e=_.extend(e,s._getSabreException(e)),n.reject(e.status,e)})),r},getFilteredFiles:function(e,t){t=t||{};const s=this,n=$.Deferred(),i=n.promise();let o;if(o=_.isUndefined(t.properties)?this.getPropfindProperties():t.properties,!e||!e.systemTagIds&&_.isUndefined(e.favorite)&&!e.circlesIds)throw"Missing filter argument";let a,c="\n",_.each(o,(function(e){const t=s._client.parseClarkNotation(e);c+=" <"+s._client.xmlNamespaces[t.namespace]+":"+t.name+" />\n"})),c+=" \n",c+=" \n",_.each(e.systemTagIds,(function(e){c+=" "+r()(e)+"\n"})),_.each(e.circlesIds,(function(e){c+=" "+r()(e)+"\n"})),e.favorite&&(c+=" "+(e.favorite?"1":"0")+"\n"),c+=" \n",c+="\n",this._client.request("REPORT",this._buildUrl(),{},c).then((function(e){if(s._isSuccessStatus(e.status)){const t=s._parseResult(e.body);n.resolve(e.status,t)}else e=_.extend(e,s._getSabreException(e)),n.reject(e.status,e)})),i},getFileInfo:function(e,t){e||(e=""),t=t||{};const s=this,n=$.Deferred(),r=n.promise();let i;return i=_.isUndefined(t.properties)?this.getPropfindProperties():t.properties,this._client.propFind(this._buildUrl(e),i,0).then((function(e){s._isSuccessStatus(e.status)?n.resolve(e.status,s._parseResult([e.body])[0]):(e=_.extend(e,s._getSabreException(e)),n.reject(e.status,e))})),r},getFileContents:function(e){if(!e)throw'Missing argument "path"';const t=this,s=$.Deferred(),n=s.promise();return this._client.request("GET",this._buildUrl(e)).then((function(e){t._isSuccessStatus(e.status)?s.resolve(e.status,e.body):(e=_.extend(e,t._getSabreException(e)),s.reject(e.status,e))})),n},putFileContents:function(e,t,s){if(!e)throw'Missing argument "path"';const n=this,r=$.Deferred(),i=r.promise(),o={};let a="text/plain;charset=utf-8";return(s=s||{}).contentType&&(a=s.contentType),o["Content-Type"]=a,(_.isUndefined(s.overwrite)||s.overwrite)&&(o["If-None-Match"]="*"),this._client.request("PUT",this._buildUrl(e),o,t||"").then((function(e){n._isSuccessStatus(e.status)?r.resolve(e.status):(e=_.extend(e,n._getSabreException(e)),r.reject(e.status,e))})),i},_simpleCall:function(e,t,s){if(!t)throw'Missing argument "path"';const n=this,r=$.Deferred(),i=r.promise();return this._client.request(e,this._buildUrl(t),s||{}).then((function(e){n._isSuccessStatus(e.status)?r.resolve(e.status):(e=_.extend(e,n._getSabreException(e)),r.reject(e.status,e))})),i},createDirectory:function(e,t){return this._simpleCall("MKCOL",e,t)},remove:function(e){return this._simpleCall("DELETE",e)},move:function(e,t,s,n){if(!e)throw'Missing argument "path"';if(!t)throw'Missing argument "destinationPath"';const r=this,i=$.Deferred(),o=i.promise();return n=_.extend({},n,{Destination:this._buildUrl(t)}),s||(n.Overwrite="F"),this._client.request("MOVE",this._buildUrl(e),n).then((function(e){r._isSuccessStatus(e.status)?i.resolve(e.status):(e=_.extend(e,r._getSabreException(e)),i.reject(e.status,e))})),o},copy:function(e,t,s){if(!e)throw'Missing argument "path"';if(!t)throw'Missing argument "destinationPath"';const n=this,r=$.Deferred(),i=r.promise(),o={Destination:this._buildUrl(t)};return s||(o.Overwrite="F"),this._client.request("COPY",this._buildUrl(e),o).then((function(e){n._isSuccessStatus(e.status)?r.resolve(e.status):r.reject(e.status)})),i},addFileInfoParser:function(e){this._fileInfoParsers.push(e)},getClient:function(){return this._client},getUserName:function(){return this._client.userName},getPassword:function(){return this._client.password},getBaseUrl:function(){return this._client.baseUrl},getHost:function(){return this._host}},e.Files||(e.Files={}),e.Files.getClient=function(){if(e.Files._defaultClient)return e.Files._defaultClient;const t=new e.Files.Client({host:e.getHost(),port:e.getPort(),root:e.linkToRemoteBase("dav")+"/files/"+e.getCurrentUser().uid,useHTTPS:"https"===e.getProtocol()});return e.Files._defaultClient=t,t},e.Files.Client=s}(OC,OC.Files.FileInfo)}},s={};function n(e){var r=s[e];if(void 0!==r)return r.exports;var i=s[e]={id:e,loaded:!1,exports:{}};return t[e].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.m=t,e=[],n.O=(t,s,r,i)=>{if(!s){var o=1/0;for(l=0;l=i)&&Object.keys(n.O).every((e=>n.O[e](s[c])))?s.splice(c--,1):(a=!1,i0&&e[l-1][2]>i;l--)e[l]=e[l-1];e[l]=[s,r,i]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.e=()=>Promise.resolve(),n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.j=590,(()=>{n.b=document.baseURI||self.location.href;var e={590:0};n.O.j=t=>0===e[t];var t=(t,s)=>{var r,i,o=s[0],a=s[1],c=s[2],u=0;if(o.some((t=>0!==e[t]))){for(r in a)n.o(a,r)&&(n.m[r]=a[r]);if(c)var l=c(n)}for(t&&t(s);un(40828)));r=n.O(r)})(); //# sourceMappingURL=core-files_client.js.map?v=6e5934c626b9d7f6dc2e