@opencloud-eu/web-client 4.3.0 → 5.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ "use strict";const b=require("./toString-CEqk2kJI.cjs"),Ie=require("./index-sTep8AuK.cjs");function K(e,r=""){return`/public-files/${e}/${r}`.split("/").filter(Boolean).join("/")}function Y(e,r=""){return`/ocm/${e}/${r}`.split("/").filter(Boolean).join("/")}var U,z;function we(){if(z)return U;z=1;function e(a){if(typeof a!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(a))}function r(a,t){for(var i="",c=0,d=-1,o=0,u,f=0;f<=a.length;++f){if(f<a.length)u=a.charCodeAt(f);else{if(u===47)break;u=47}if(u===47){if(!(d===f-1||o===1))if(d!==f-1&&o===2){if(i.length<2||c!==2||i.charCodeAt(i.length-1)!==46||i.charCodeAt(i.length-2)!==46){if(i.length>2){var p=i.lastIndexOf("/");if(p!==i.length-1){p===-1?(i="",c=0):(i=i.slice(0,p),c=i.length-1-i.lastIndexOf("/")),d=f,o=0;continue}}else if(i.length===2||i.length===1){i="",c=0,d=f,o=0;continue}}t&&(i.length>0?i+="/..":i="..",c=2)}else i.length>0?i+="/"+a.slice(d+1,f):i=a.slice(d+1,f),c=f-d-1;d=f,o=0}else u===46&&o!==-1?++o:o=-1}return i}function n(a,t){var i=t.dir||t.root,c=t.base||(t.name||"")+(t.ext||"");return i?i===t.root?i+c:i+a+c:c}var l={resolve:function(){for(var t="",i=!1,c,d=arguments.length-1;d>=-1&&!i;d--){var o;d>=0?o=arguments[d]:(c===void 0&&(c=Ie.process$1.cwd()),o=c),e(o),o.length!==0&&(t=o+"/"+t,i=o.charCodeAt(0)===47)}return t=r(t,!i),i?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(e(t),t.length===0)return".";var i=t.charCodeAt(0)===47,c=t.charCodeAt(t.length-1)===47;return t=r(t,!i),t.length===0&&!i&&(t="."),t.length>0&&c&&(t+="/"),i?"/"+t:t},isAbsolute:function(t){return e(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,i=0;i<arguments.length;++i){var c=arguments[i];e(c),c.length>0&&(t===void 0?t=c:t+="/"+c)}return t===void 0?".":l.normalize(t)},relative:function(t,i){if(e(t),e(i),t===i||(t=l.resolve(t),i=l.resolve(i),t===i))return"";for(var c=1;c<t.length&&t.charCodeAt(c)===47;++c);for(var d=t.length,o=d-c,u=1;u<i.length&&i.charCodeAt(u)===47;++u);for(var f=i.length,p=f-u,v=o<p?o:p,g=-1,h=0;h<=v;++h){if(h===v){if(p>v){if(i.charCodeAt(u+h)===47)return i.slice(u+h+1);if(h===0)return i.slice(u+h)}else o>v&&(t.charCodeAt(c+h)===47?g=h:h===0&&(g=0));break}var j=t.charCodeAt(c+h),De=i.charCodeAt(u+h);if(j!==De)break;j===47&&(g=h)}var y="";for(h=c+g+1;h<=d;++h)(h===d||t.charCodeAt(h)===47)&&(y.length===0?y+="..":y+="/..");return y.length>0?y+i.slice(u+g):(u+=g,i.charCodeAt(u)===47&&++u,i.slice(u))},_makeLong:function(t){return t},dirname:function(t){if(e(t),t.length===0)return".";for(var i=t.charCodeAt(0),c=i===47,d=-1,o=!0,u=t.length-1;u>=1;--u)if(i=t.charCodeAt(u),i===47){if(!o){d=u;break}}else o=!1;return d===-1?c?"/":".":c&&d===1?"//":t.slice(0,d)},basename:function(t,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');e(t);var c=0,d=-1,o=!0,u;if(i!==void 0&&i.length>0&&i.length<=t.length){if(i.length===t.length&&i===t)return"";var f=i.length-1,p=-1;for(u=t.length-1;u>=0;--u){var v=t.charCodeAt(u);if(v===47){if(!o){c=u+1;break}}else p===-1&&(o=!1,p=u+1),f>=0&&(v===i.charCodeAt(f)?--f===-1&&(d=u):(f=-1,d=p))}return c===d?d=p:d===-1&&(d=t.length),t.slice(c,d)}else{for(u=t.length-1;u>=0;--u)if(t.charCodeAt(u)===47){if(!o){c=u+1;break}}else d===-1&&(o=!1,d=u+1);return d===-1?"":t.slice(c,d)}},extname:function(t){e(t);for(var i=-1,c=0,d=-1,o=!0,u=0,f=t.length-1;f>=0;--f){var p=t.charCodeAt(f);if(p===47){if(!o){c=f+1;break}continue}d===-1&&(o=!1,d=f+1),p===46?i===-1?i=f:u!==1&&(u=1):i!==-1&&(u=-1)}return i===-1||d===-1||u===0||u===1&&i===d-1&&i===c+1?"":t.slice(i,d)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return n("/",t)},parse:function(t){e(t);var i={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return i;var c=t.charCodeAt(0),d=c===47,o;d?(i.root="/",o=1):o=0;for(var u=-1,f=0,p=-1,v=!0,g=t.length-1,h=0;g>=o;--g){if(c=t.charCodeAt(g),c===47){if(!v){f=g+1;break}continue}p===-1&&(v=!1,p=g+1),c===46?u===-1?u=g:h!==1&&(h=1):u!==-1&&(h=-1)}return u===-1||p===-1||h===0||h===1&&u===p-1&&u===f+1?p!==-1&&(f===0&&d?i.base=i.name=t.slice(1,p):i.base=i.name=t.slice(f,p)):(f===0&&d?(i.name=t.slice(1,u),i.base=t.slice(1,p)):(i.name=t.slice(f,u),i.base=t.slice(f,p)),i.ext=t.slice(u,p)),f>0?i.dir=t.slice(0,f-1):d&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};return l.posix=l,U=l,U}var T=we();const W=b.getDefaultExportFromCjs(T);class P{static Shared="S";static Shareable="R";static Mounted="M";static Deletable="D";static Renameable="N";static Moveable="V";static Updateable="NV";static FileUpdateable="W";static FolderCreateable="CK";static Deny="Z";static SecureView="X"}var Q=(e=>(e.copy="COPY",e.delete="DELETE",e.lock="LOCK",e.mkcol="MKCOL",e.move="MOVE",e.propfind="PROPFIND",e.proppatch="PROPPATCH",e.put="PUT",e.report="REPORT",e.unlock="UNLOCK",e))(Q||{});const A=e=>({value:e,type:null}),Le=e=>A(e),m=e=>A(e),w=e=>A(e),ke=e=>A(e),Te={Permissions:m("permissions"),IsFavorite:w("favorite"),FileId:m("fileid"),FileParent:m("file-parent"),Name:m("name"),OwnerId:m("owner-id"),OwnerDisplayName:m("owner-display-name"),PrivateLink:m("privatelink"),ContentLength:w("getcontentlength"),ContentSize:w("size"),LastModifiedDate:m("getlastmodified"),Tags:Le("tags"),Audio:{value:"audio",type:null},Location:{value:"location",type:null},Image:{value:"image",type:null},Photo:{value:"photo",type:null},ETag:m("getetag"),MimeType:m("getcontenttype"),ResourceType:ke("resourcetype"),LockDiscovery:{value:"lockdiscovery",type:null},LockOwner:m("owner"),LockTime:m("locktime"),ActiveLock:{value:"activelock",type:null},DownloadURL:m("downloadURL"),Highlights:m("highlights"),MetaPathForUser:m("meta-path-for-user"),RemoteItemId:m("remote-item-id"),HasPreview:w("has-preview"),ShareId:m("shareid"),ShareRoot:m("shareroot"),ShareTypes:{value:"share-types",type:null},SharePermissions:m("share-permissions"),TrashbinOriginalFilename:m("trashbin-original-filename"),TrashbinOriginalLocation:m("trashbin-original-location"),TrashbinDeletedDate:m("trashbin-delete-datetime"),PublicLinkItemType:m("public-link-item-type"),PublicLinkPermission:m("public-link-permission"),PublicLinkExpiration:m("public-link-expiration"),PublicLinkShareDate:m("public-link-share-datetime"),PublicLinkShareOwner:m("public-link-share-owner")},s=Object.fromEntries(Object.entries(Te).map(([e,r])=>[e,r.value]));class M{static Default=[s.Permissions,s.IsFavorite,s.FileId,s.FileParent,s.Name,s.LockDiscovery,s.ActiveLock,s.OwnerId,s.OwnerDisplayName,s.RemoteItemId,s.ShareRoot,s.ShareTypes,s.PrivateLink,s.ContentLength,s.ContentSize,s.LastModifiedDate,s.ETag,s.MimeType,s.ResourceType,s.Tags,s.Audio,s.Location,s.Image,s.Photo,s.HasPreview];static PublicLink=M.Default.concat([s.PublicLinkItemType,s.PublicLinkPermission,s.PublicLinkExpiration,s.PublicLinkShareDate,s.PublicLinkShareOwner]);static Trashbin=[s.ContentLength,s.ResourceType,s.TrashbinOriginalLocation,s.TrashbinOriginalFilename,s.TrashbinDeletedDate,s.Permissions,s.FileParent];static DavNamespace=[s.ContentLength,s.LastModifiedDate,s.ETag,s.MimeType,s.ResourceType,s.LockDiscovery,s.ActiveLock]}function X(e){return e}function Ae(e,r,n){switch(n.length){case 0:return e.call(r);case 1:return e.call(r,n[0]);case 2:return e.call(r,n[0],n[1]);case 3:return e.call(r,n[0],n[1],n[2])}return e.apply(r,n)}var Ce=800,Oe=16,Ue=Date.now;function Ee(e){var r=0,n=0;return function(){var l=Ue(),a=Oe-(l-n);if(n=l,a>0){if(++r>=Ce)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}function Fe(e){return function(){return e}}var H=(function(){try{var e=b.getNative(Object,"defineProperty");return e({},"",{}),e}catch{}})(),_e=H?function(e,r){return H(e,"toString",{configurable:!0,enumerable:!1,value:Fe(r),writable:!0})}:X,Me=Ee(_e);function $e(e,r,n,l){for(var a=e.length,t=n+-1;++t<a;)if(r(e[t],t,e))return t;return-1}function Ne(e){return e!==e}function je(e,r,n){for(var l=n-1,a=e.length;++l<a;)if(e[l]===r)return l;return-1}function ze(e,r,n){return r===r?je(e,r,n):$e(e,Ne,n)}function G(e,r){var n=e==null?0:e.length;return!!n&&ze(e,r,0)>-1}var V=Math.max;function We(e,r,n){return r=V(r===void 0?e.length-1:r,0),function(){for(var l=arguments,a=-1,t=V(l.length-r,0),i=Array(t);++a<t;)i[a]=l[r+a];a=-1;for(var c=Array(r+1);++a<r;)c[a]=l[a];return c[r]=n(i),Ae(e,this,c)}}function He(e,r){return Me(We(e,r,X),e+"")}var Ve=9007199254740991;function Je(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ve}function Be(e){return e!=null&&Je(e.length)&&!b.isFunction(e)}function Ze(e,r,n){var l=-1,a=e.length;r<0&&(r=-r>a?0:a+r),n=n>a?a:n,n<0&&(n+=a),a=r>n?0:n-r>>>0,r>>>=0;for(var t=Array(a);++l<a;)t[l]=e[l+r];return t}function qe(e,r,n){var l=e.length;return n=n===void 0?l:n,!r&&n>=l?e:Ze(e,r,n)}var Ke="\\ud800-\\udfff",Ye="\\u0300-\\u036f",Qe="\\ufe20-\\ufe2f",Xe="\\u20d0-\\u20ff",Ge=Ye+Qe+Xe,er="\\ufe0e\\ufe0f",rr="\\u200d",tr=RegExp("["+rr+Ke+Ge+er+"]");function ee(e){return tr.test(e)}function ir(e){return e.split("")}var re="\\ud800-\\udfff",nr="\\u0300-\\u036f",sr="\\ufe20-\\ufe2f",ar="\\u20d0-\\u20ff",or=nr+sr+ar,ur="\\ufe0e\\ufe0f",lr="["+re+"]",E="["+or+"]",F="\\ud83c[\\udffb-\\udfff]",cr="(?:"+E+"|"+F+")",te="[^"+re+"]",ie="(?:\\ud83c[\\udde6-\\uddff]){2}",ne="[\\ud800-\\udbff][\\udc00-\\udfff]",dr="\\u200d",se=cr+"?",ae="["+ur+"]?",fr="(?:"+dr+"(?:"+[te,ie,ne].join("|")+")"+ae+se+")*",pr=ae+se+fr,hr="(?:"+[te+E+"?",E,ie,ne,lr].join("|")+")",mr=RegExp(F+"(?="+F+")|"+hr+pr,"g");function gr(e){return e.match(mr)||[]}function br(e){return ee(e)?gr(e):ir(e)}function vr(e){return function(r){r=b.toString(r);var n=ee(r)?br(r):void 0,l=n?n[0]:r.charAt(0),a=n?qe(n,1).join(""):r.slice(1);return l[e]()+a}}var xr=vr("toUpperCase");function Pr(e){return xr(b.toString(e).toLowerCase())}function Rr(e,r,n,l){for(var a=-1,t=e==null?0:e.length;++a<t;)n=r(n,e[a],a,e);return n}function Sr(e){return function(r){return e?.[r]}}var yr={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Dr=Sr(yr),Ir=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wr="\\u0300-\\u036f",Lr="\\ufe20-\\ufe2f",kr="\\u20d0-\\u20ff",Tr=wr+Lr+kr,Ar="["+Tr+"]",Cr=RegExp(Ar,"g");function Or(e){return e=b.toString(e),e&&e.replace(Ir,Dr).replace(Cr,"")}var Ur=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Er(e){return e.match(Ur)||[]}var Fr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function _r(e){return Fr.test(e)}var oe="\\ud800-\\udfff",Mr="\\u0300-\\u036f",$r="\\ufe20-\\ufe2f",Nr="\\u20d0-\\u20ff",jr=Mr+$r+Nr,ue="\\u2700-\\u27bf",le="a-z\\xdf-\\xf6\\xf8-\\xff",zr="\\xac\\xb1\\xd7\\xf7",Wr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Hr="\\u2000-\\u206f",Vr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ce="A-Z\\xc0-\\xd6\\xd8-\\xde",Jr="\\ufe0e\\ufe0f",de=zr+Wr+Hr+Vr,fe="['’]",J="["+de+"]",Br="["+jr+"]",pe="\\d+",Zr="["+ue+"]",he="["+le+"]",me="[^"+oe+de+pe+ue+le+ce+"]",qr="\\ud83c[\\udffb-\\udfff]",Kr="(?:"+Br+"|"+qr+")",Yr="[^"+oe+"]",ge="(?:\\ud83c[\\udde6-\\uddff]){2}",be="[\\ud800-\\udbff][\\udc00-\\udfff]",R="["+ce+"]",Qr="\\u200d",B="(?:"+he+"|"+me+")",Xr="(?:"+R+"|"+me+")",Z="(?:"+fe+"(?:d|ll|m|re|s|t|ve))?",q="(?:"+fe+"(?:D|LL|M|RE|S|T|VE))?",ve=Kr+"?",xe="["+Jr+"]?",Gr="(?:"+Qr+"(?:"+[Yr,ge,be].join("|")+")"+xe+ve+")*",et="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",rt="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",tt=xe+ve+Gr,it="(?:"+[Zr,ge,be].join("|")+")"+tt,nt=RegExp([R+"?"+he+"+"+Z+"(?="+[J,R,"$"].join("|")+")",Xr+"+"+q+"(?="+[J,R+B,"$"].join("|")+")",R+"?"+B+"+"+Z,R+"+"+q,rt,et,pe,it].join("|"),"g");function st(e){return e.match(nt)||[]}function at(e,r,n){return e=b.toString(e),r=r,r===void 0?_r(e)?st(e):Er(e):e.match(r)||[]}var ot="['’]",ut=RegExp(ot,"g");function lt(e){return function(r){return Rr(at(Or(r).replace(ut,"")),e,"")}}var ct=lt(function(e,r,n){return r=r.toLowerCase(),e+(n?Pr(r):r)}),dt="__lodash_hash_undefined__";function ft(e){return this.__data__.set(e,dt),this}function pt(e){return this.__data__.has(e)}function I(e){var r=-1,n=e==null?0:e.length;for(this.__data__=new b.MapCache;++r<n;)this.add(e[r])}I.prototype.add=I.prototype.push=ft;I.prototype.has=pt;function _(e,r){return e.has(r)}function ht(e){return b.isObjectLike(e)&&Be(e)}var mt=Math.min;function gt(e,r,n){for(var l=G,a=e[0].length,t=e.length,i=t,c=Array(t),d=1/0,o=[];i--;){var u=e[i];d=mt(u.length,d),c[i]=a>=120&&u.length>=120?new I(i&&u):void 0}u=e[0];var f=-1,p=c[0];e:for(;++f<a&&o.length<d;){var v=u[f],g=v;if(v=v!==0?v:0,!(p?_(p,g):l(o,g))){for(i=t;--i;){var h=c[i];if(!(h?_(h,g):l(e[i],g)))continue e}p&&p.push(g),o.push(v)}}return o}function bt(e){return ht(e)?e:[]}var vt=He(function(e){var r=b.arrayMap(e,bt);return r.length&&r[0]===e[0]?gt(r):[]});const xt={complex:["tar.bz2","tar.gz","tar.xz"]},Pt=e=>Object.hasOwn(e,"ddate"),Rt=e=>Object.hasOwn(e,"highlights"),C=e=>e.replace(/[^A-Za-z0-9\-_]/g,""),Pe=(e,r)=>!e||typeof e!="string"?"":e.indexOf("!")>=0?e.split("!")[r]:"",Re=e=>Pe(e,0),$=e=>Pe(e,1),St=e=>{const r=e.extension||"",n=e.name||"";if(!r.length)return n;const l=n.lastIndexOf(`.${r}`);return n.substring(0,l)},O=e=>{const n=e.name.split(".");if(n.length>2)for(let l=0;l<n.length;l++){const a=n.slice(l,n.length).join(".");if(xt.complex.includes(a))return a}return n.length<2?"":n[n.length-1]},yt=e=>T.basename(T.dirname(e.path))||null,Dt=e=>typeof e.isShareRoot=="function"&&e.isShareRoot(),L=e=>{if(!e)return e;const r={};return Object.keys(e).forEach(n=>{r[ct(n)]=e[n]}),r};function It(e,r=[]){const n=e.props[s.Name]?.toString()||T.basename(e.filename),l=e.props[s.FileId],a=e.type==="directory";let t;e.filename.startsWith("/files")||e.filename.startsWith("/space")?t=e.filename.split("/").slice(3).join("/"):t=e.filename,t.startsWith("/")||(t=`/${t}`);const i=O({...e,name:n}),c=e.props[s.LockDiscovery];let d,o,u;c&&(d=c[s.ActiveLock],o=d[s.LockOwner],u=d[s.LockTime]);let f=[];e.props[s.ShareTypes]&&(f=e.props[s.ShareTypes]["share-type"],Array.isArray(f)||(f=[f]));const p={};for(const g of r||[]){const h=g.split(":").pop();e.props[h]&&(p[g]=e.props[h])}const v={id:l,fileId:l,storageId:Re(l),parentFolderId:e.props[s.FileParent],mimeType:e.props[s.MimeType],name:n,extension:i,path:t,webDavPath:e.filename,type:a?"folder":e.type,isFolder:a,locked:!!d,lockOwner:o,lockTime:u,processing:e.processing||!1,mdate:e.props[s.LastModifiedDate],size:a?e.props[s.ContentSize]?.toString()||"0":e.props[s.ContentLength]?.toString()||"0",permissions:e.props[s.Permissions]||"",starred:e.props[s.IsFavorite]!==0,etag:e.props[s.ETag],shareTypes:f,privateLink:e.props[s.PrivateLink],downloadURL:e.props[s.DownloadURL],remoteItemId:e.props[s.RemoteItemId],remoteItemPath:e.props[s.ShareRoot],owner:{id:e.props[s.OwnerId],displayName:e.props[s.OwnerDisplayName]},tags:(e.props[s.Tags]||"").toString().split(",").filter(Boolean),audio:L(e.props[s.Audio]),location:L(e.props[s.Location]),image:L(e.props[s.Image]),photo:L(e.props[s.Photo]),extraProps:p,hasPreview:()=>e.props[s.HasPreview]===1,canUpload:function(){return this.permissions.indexOf(P.FolderCreateable)>=0},canDownload:function(){return this.permissions.indexOf(P.SecureView)===-1},canBeDeleted:function(){return this.permissions.indexOf(P.Deletable)>=0},canRename:function(){return this.permissions.indexOf(P.Renameable)>=0},canShare:function({ability:g}){return g.can("create-all","Share")&&this.permissions.indexOf(P.Shareable)>=0},canCreate:function(){return this.permissions.indexOf(P.FolderCreateable)>=0},canEditTags:function(){return this.permissions.indexOf(P.Updateable)>=0||this.permissions.indexOf(P.FileUpdateable)>=0||this.permissions.indexOf(P.FolderCreateable)>=0},isMounted:function(){return this.permissions.indexOf(P.Mounted)>=0},isReceivedShare:function(){return this.permissions.indexOf(P.Shared)>=0},isShareRoot(){return e.props[s.ShareRoot]?e.filename.split("/").length===3:!1},getDomSelector:()=>C(l)};return Object.defineProperty(v,"nodeId",{get(){return $(this.id)}}),v}function wt(e){const r=e.type==="directory",n=e.props[s.TrashbinOriginalFilename]?.toString(),l=O({name:n,type:e.type}),a=W.basename(e.filename);return{type:r?"folder":e.type,isFolder:r,ddate:e.props[s.TrashbinDeletedDate],name:W.basename(n),extension:l,path:b.urlJoin(e.props[s.TrashbinOriginalLocation],{leadingSlash:!0}),id:a,parentFolderId:e.props[s.FileParent],webDavPath:"",canUpload:()=>!1,canDownload:()=>!1,canBeDeleted:()=>!0,canBeRestored:function(){return!0},canRename:()=>!1,canShare:()=>!1,canCreate:()=>!1,isMounted:()=>!1,isReceivedShare:()=>!1,hasPreview:()=>!1,getDomSelector:()=>C(a)}}var x=(e=>(e.createUpload="libre.graph/driveItem/upload/create",e.createPermissions="libre.graph/driveItem/permissions/create",e.createChildren="libre.graph/driveItem/children/create",e.readBasic="libre.graph/driveItem/basic/read",e.readPath="libre.graph/driveItem/path/read",e.readQuota="libre.graph/driveItem/quota/read",e.readContent="libre.graph/driveItem/content/read",e.readChildren="libre.graph/driveItem/children/read",e.readDeleted="libre.graph/driveItem/deleted/read",e.readPermissions="libre.graph/driveItem/permissions/read",e.readVersions="libre.graph/driveItem/versions/read",e.updatePath="libre.graph/driveItem/path/update",e.updateDeleted="libre.graph/driveItem/deleted/update",e.updatePermissions="libre.graph/driveItem/permissions/update",e.updateVersions="libre.graph/driveItem/versions/update",e.deleteStandard="libre.graph/driveItem/standard/delete",e.deleteDeleted="libre.graph/driveItem/deleted/delete",e.deletePermissions="libre.graph/driveItem/permissions/delete",e))(x||{});const D=e=>e;class S{_key;_value;_label;_icon;constructor(r,n,l,a){this._key=r,this._value=n,this._label=l,this._icon=a}get key(){return this._key}get value(){return this._value}get label(){return this._label}get icon(){return this._icon}}class Lt{static user=new S("user",0,D("User"),"user");static group=new S("group",1,D("Group"),"group");static link=new S("link",3,D("Link"),"link");static guest=new S("guest",4,D("Guest"),"global");static remote=new S("remote",6,D("External"),"earth");static individuals=[this.user,this.guest,this.remote];static collectives=[this.group];static unauthenticated=[this.link];static authenticated=[this.user,this.group,this.guest,this.remote];static all=[this.user,this.group,this.link,this.guest,this.remote];static isIndividual(r){return this.individuals.includes(r)}static isCollective(r){return this.collectives.includes(r)}static isUnauthenticated(r){return this.unauthenticated.includes(r)}static isAuthenticated(r){return this.authenticated.includes(r)}static getByValue(r){return this.all.find(n=>n.value===r)}static getByValues(r){return r.map(n=>this.getByValue(n))}static getByKeys(r){return r.map(n=>this.all.find(l=>l.key===n))}static getValues(r){return r.map(n=>n.value)}static containsAnyValue(r,n){return vt(this.getValues(r),n).length>0}}const kt="a0ca6a90-a365-4782-871e-d44447bbc668",Tt="89f37a33-858b-45fa-8890-a1f2b27d90e1",At=e=>e?.type==="space",k=e=>e?.driveType==="personal",Ct=e=>e?.driveType==="project",Ot=e=>e?.driveType==="share",Ut=e=>e?.driveType==="mountpoint",Et=e=>e?.driveType==="public";function Se(e,r){return b.urlJoin("spaces",e,r,{leadingSlash:!0})}function ye(e,r=""){return b.urlJoin("spaces","trash-bin",e,r,{leadingSlash:!0})}function Ft(e,r){const l=e[{image:"spaceImageData",readme:"spaceReadmeData"}[r]];if(!l)return"";const a=decodeURI(l.webDavUrl).split("/"),t=a.find(i=>i.startsWith(e.id));return t?a.slice(a.indexOf(t)+1).join("/"):""}function _t(e){return e.permissions.includes(x.deletePermissions)}const Mt=(e,r)=>e.root.permissions?.filter(n=>{let l=[];n["@libre.graph.permissions.actions"]&&(l=n["@libre.graph.permissions.actions"]);const a=r[n.roles?.[0]];return a&&!l.length&&(l=a.rolePermissions.find(({condition:i})=>i==="exists @Resource.Root")?.allowedResourceActions||[]),l.includes(x.deletePermissions)});function $t(e){const r=e.publicLinkPassword,n=e.props?.[s.FileId],l=e.props?.[s.PublicLinkItemType],a=e.props?.[s.PublicLinkPermission],t=e.props?.[s.PublicLinkExpiration],i=e.props?.[s.PublicLinkShareDate],c=e.props?.[s.PublicLinkShareOwner],d=e.publicLinkType;let o,u;return d==="ocm"?(o=`ocm/${e.id}`,u=Y(e.id)):(o=`public/${e.id}`,u=K(e.id)),Object.assign(N({...e,driveType:"public",driveAlias:o,webDavPath:u}),{...n&&{fileId:n},...r&&{publicLinkPassword:r},...l&&{publicLinkItemType:l},...a&&{publicLinkPermission:parseInt(a)},...t&&{publicLinkExpiration:t},...i&&{publicLinkShareDate:i},...c&&{publicLinkShareOwner:c},publicLinkType:d})}function Nt({driveAliasPrefix:e,id:r,shareName:n,serverUrl:l}){const a=N({id:r,driveAlias:`${e}/${n}`,driveType:"share",name:n,serverUrl:l});return a.rename=t=>{a.driveAlias=`${e}/${t}`,a.name=t},a}function N(e){let r,n;e.special&&(r=e.special.find(o=>o.specialFolder.name==="image"),n=e.special.find(o=>o.specialFolder.name==="readme"),r&&(r.webDavUrl=decodeURI(r.webDavUrl)),n&&(n.webDavUrl=decodeURI(n.webDavUrl)));const l=e.root?.deleted?.state==="trashed",a=b.urlJoin(e.webDavPath||Se(e.id),{leadingSlash:!0}),t=b.urlJoin(e.serverUrl,"remote.php/dav",a),i=b.urlJoin(e.webDavTrashPath||ye(e.id),{leadingSlash:!0}),c=b.urlJoin(e.serverUrl,"remote.php/dav",i),d={id:e.id,fileId:e.id,storageId:e.id,mimeType:"",name:e.name,description:e.description,extension:"",path:"/",webDavPath:a,webDavTrashPath:i,driveAlias:e.driveAlias,driveType:e.driveType,type:"space",isFolder:!0,mdate:e.lastModifiedDateTime,size:e.quota?.used||0,tags:[],permissions:"",starred:!1,etag:"",shareTypes:[],privateLink:e.webUrl,downloadURL:"",owner:e.owner?.user,disabled:l,root:e.root,spaceQuota:e.quota,spaceImageData:r,spaceReadmeData:n,hasTrashedItems:e["@libre.graph.hasTrashedItems"]||!1,graphPermissions:void 0,canUpload:function({user:o}={}){return k(this)&&this.isOwner(o)?!0:this.graphPermissions?.includes(x.createUpload)},canDownload:function(){return!0},canBeDeleted:function({ability:o}={}){return this.disabled?o?.can("delete-all","Drive")?!0:this.graphPermissions?.includes(x.deletePermissions):!1},canRename:function({ability:o}={}){return o?.can("update-all","Drive")?!0:this.graphPermissions?.includes(x.deletePermissions)},canEditDescription:function({ability:o}={}){return o?.can("update-all","Drive")?!0:this.graphPermissions?.includes(x.deletePermissions)},canRestore:function({ability:o}={}){return this.disabled?o?.can("update-all","Drive")?!0:this.graphPermissions?.includes(x.deletePermissions):!1},canDisable:function({ability:o}={}){return this.disabled?!1:o?.can("delete-all","Drive")?!0:this.graphPermissions?.includes(x.deletePermissions)},canShare:function(){return this.graphPermissions?.includes(x.createPermissions)},canEditImage:function(){return this.disabled?!1:this.graphPermissions?.includes(x.deletePermissions)},canEditReadme:function(){return this.disabled?!1:this.graphPermissions?.includes(x.deletePermissions)},canRestoreFromTrashbin:function(){return this.graphPermissions?.includes(x.updateDeleted)},canDeleteFromTrashBin:function({user:o}={}){return k(this)&&this.isOwner(o)?!0:this.graphPermissions?.includes(x.deletePermissions)},canListVersions:function({user:o}={}){return k(this)&&this.isOwner(o)?!0:this.graphPermissions?.includes(x.readVersions)},canCreate:function(){return!0},canEditTags:function(){return!1},isMounted:function(){return!0},isReceivedShare:function(){return!1},isShareRoot:function(){return["share","mountpoint","public"].includes(e.driveType)},getDomSelector:()=>C(e.id),getDriveAliasAndItem({path:o}){return b.urlJoin(this.driveAlias,o,{leadingSlash:!1})},getWebDavUrl({path:o}){return b.urlJoin(t,o)},getWebDavTrashUrl({path:o}){return b.urlJoin(c,o)},isOwner(o){return o?.id===this.owner?.id}};return Object.defineProperty(d,"nodeId",{get(){return $(this.id)}}),d}function jt(e){return{id:e.spaceImageData.id,name:e.spaceImageData.name,etag:e.spaceImageData.eTag,extension:O({name:e.spaceImageData.name}),mimeType:e.spaceImageData.file.mimeType,type:"file",webDavPath:b.urlJoin(e.webDavPath,".space",e.spaceImageData.name),hasPreview:()=>!0,canDownload:()=>!0}}exports.DavMethod=Q;exports.DavPermission=P;exports.DavProperties=M;exports.DavProperty=s;exports.GraphSharePermission=x;exports.OCM_PROVIDER_ID=Tt;exports.SHARE_JAIL_ID=kt;exports.SetCache=I;exports.ShareType=S;exports.ShareTypes=Lt;exports.arrayIncludes=G;exports.buildDeletedResource=wt;exports.buildPublicSpaceResource=$t;exports.buildResource=It;exports.buildShareSpaceResource=Nt;exports.buildSpace=N;exports.buildSpaceImageResource=jt;exports.buildWebDavOcmPath=Y;exports.buildWebDavPublicPath=K;exports.buildWebDavSpacesPath=Se;exports.buildWebDavSpacesTrashPath=ye;exports.cacheHas=_;exports.extractDomSelector=C;exports.extractExtensionFromFile=O;exports.extractNameWithoutExtension=St;exports.extractNodeId=$;exports.extractParentFolderName=yt;exports.extractStorageId=Re;exports.getRelativeSpecialFolderSpacePath=Ft;exports.getSpaceManagers=Mt;exports.isManager=_t;exports.isMountPointSpaceResource=Ut;exports.isPersonalSpaceResource=k;exports.isProjectSpaceResource=Ct;exports.isPublicSpaceResource=Et;exports.isSearchResource=Rt;exports.isShareRoot=Dt;exports.isShareSpaceResource=Ot;exports.isSpaceResource=At;exports.isTrashResource=Pt;
@@ -751,10 +751,7 @@ const wt = {
751
751
  const l = i.lastIndexOf(`.${r}`);
752
752
  return i.substring(0, l);
753
753
  }, $ = (e) => {
754
- const r = e.name;
755
- if (e.type === "directory" || e.isFolder)
756
- return "";
757
- const i = r.split(".");
754
+ const i = e.name.split(".");
758
755
  if (i.length > 2)
759
756
  for (let l = 0; l < i.length; l++) {
760
757
  const s = i.slice(l, i.length).join(".");
@@ -791,7 +788,7 @@ function Et(e, r = []) {
791
788
  parentFolderId: e.props[a.FileParent],
792
789
  mimeType: e.props[a.MimeType],
793
790
  name: i,
794
- extension: s ? "" : n,
791
+ extension: n,
795
792
  path: t,
796
793
  webDavPath: e.filename,
797
794
  type: s ? "folder" : e.type,
@@ -1 +1 @@
1
- "use strict";const h=require("./web-client/graph/generated.cjs"),g=require("./toString-CEqk2kJI.cjs"),d=require("./functions-C2T1nL62.cjs"),k=({axiosClient:e,config:s})=>{const o=h.UserApiFactory(s,s.basePath,e),c=h.UsersApiFactory(s,s.basePath,e),i=h.MeUserApiFactory(s,s.basePath,e),a=h.MeChangepasswordApiFactory(s,s.basePath,e),t=h.UserAppRoleAssignmentApiFactory(s,s.basePath,e);return{async getUser(r,n,u){const{data:l}=await o.getUser(r,n?.select?new Set([...n.select]):null,n?.expand?new Set([...n.expand]):new Set(["drive","memberOf","appRoleAssignments"]),u);return l},async createUser(r,n){const{data:u}=await c.createUser(r,n);return u},async editUser(r,n,u){const{data:l}=await o.updateUser(r,n,u);return l},async deleteUser(r,n,u){await o.deleteUser(r,n,u)},async listUsers(r,n){const{data:{value:u}}=await c.listUsers(r?.search,r?.filter,r?.orderBy?new Set([...r.orderBy]):null,r?.select?new Set([...r.select]):null,r?.expand?new Set([...r.expand]):null,n);return u},async getMe(r,n){const{data:u}=await i.getOwnUser(r?.expand?new Set([...r.expand]):new Set(["memberOf"]),n);return u},async editMe(r,n){const{data:u}=await i.updateOwnUser(r,n);return u},async changeOwnPassword(r,n){await a.changeOwnPassword(r,n)},async exportPersonalData(r,n,u){await o.exportPersonalData(r,n,u)},async createUserAppRoleAssignment(r,n,u){const{data:l}=await t.userCreateAppRoleAssignments(r,n,u);return l}}},B=({axiosClient:e,config:s})=>{const o=h.GroupApiFactory(s,s.basePath,e),c=h.GroupsApiFactory(s,s.basePath,e);return{async getGroup(i,a,t){const{data:r}=await o.getGroup(i,a?.select?new Set([...a.select]):null,a?.expand?new Set([...a.expand]):new Set(["members"]),t);return r},async createGroup(i,a){const{data:t}=await c.createGroup(i,a);return t},async editGroup(i,a,t){const{data:r}=await o.updateGroup(i,a,t);return r},async deleteGroup(i,a,t){await o.deleteGroup(i,a,t)},async listGroups(i,a){const{data:{value:t}}=await c.listGroups(i?.search,i?.orderBy?new Set([...i.orderBy]):null,i?.select?new Set([...i.select]):null,i?.expand?new Set([...i.expand]):null,a);return t},async addMember(i,a,t){await o.addMember(i,{"@odata.id":g.urlJoin(s.basePath,"v1.0","users",a)},t)},async deleteMember(i,a,t,r){await o.deleteMember(i,a,t,r)}}},M=({axiosClient:e,config:s})=>{const o=h.ApplicationsApiFactory(s,s.basePath,e);return{async getApplication(c,i){const{data:a}=await o.getApplication(c,i);return a},async listApplications(c){const{data:{value:i}}=await o.listApplications(c);return i||[]}}};function G(){}var F=g.getNative(g.root,"Set");function T(e){var s=-1,o=Array(e.size);return e.forEach(function(c){o[++s]=c}),o}var N=1/0,x=F&&1/T(new F([,-0]))[1]==N?function(e){return new F(e)}:G,L=200;function E(e,s,o){var c=-1,i=d.arrayIncludes,a=e.length,t=!0,r=[],n=r;if(a>=L){var u=x(e);if(u)return T(u);t=!1,i=d.cacheHas,n=new d.SetCache}else n=r;e:for(;++c<a;){var l=e[c],p=l;if(l=l!==0?l:0,t&&p===p){for(var y=n.length;y--;)if(n[y]===p)continue e;r.push(l)}else i(n,p,o)||(n!==r&&n.push(p),r.push(l))}return r}function O(e){return e&&e.length?E(e):[]}const v=e=>Object.hasOwn(e,"sharedWith"),W=e=>v(e)&&e.outgoing,z=e=>v(e)&&!e.outgoing,V=e=>Object.hasOwn(e,"role"),j=e=>!Object.hasOwn(e,"role"),f=({driveItem:e,graphRoles:s})=>e.remoteItem?.permissions.reduce((o,c)=>(c.roles?.forEach(i=>{const a=s[i];a&&!o.some(({id:t})=>t===a.id)&&o.push(a)}),o),[]),U=({driveItem:e,shareRoles:s})=>{if(!s.length){const c=e.remoteItem?.permissions.reduce((i,a)=>{const t=a["@libre.graph.permissions.actions"];return t&&i.push(...t),i},[]);return[...new Set(c)]}const o=s.reduce((c,i)=>(i.rolePermissions.forEach(a=>{c.push(...a.allowedResourceActions)}),c),[]);return[...new Set(o)]};function J({driveItem:e,graphRoles:s,serverUrl:o}){const c=e.name||e.remoteItem.name,i=d.extractStorageId(e.remoteItem.id),a=e.remoteItem.permissions.map(y=>{const{grantedToV2:m}=y;return{...m.group||m.user,shareType:D(y)}}),t=e.remoteItem.permissions.reduce((y,m)=>{const b=m.invitation.invitedBy.user;return y.some(({id:R})=>R===b.id)||y.push(b),y},[]);let r=O(e.remoteItem.permissions.map(D));t.some(y=>y["@libre.graph.userType"]==="Federated")&&(r=[d.ShareTypes.remote.value]);const u=f({driveItem:e,graphRoles:s}),l=U({driveItem:e,shareRoles:u}),p={id:e.id,remoteItemId:e.remoteItem.id,driveId:e.parentReference?.driveId,path:"/",name:c,fileId:e.remoteItem.id,size:e.size,storageId:i,parentFolderId:e.parentReference?.id,sdate:e.remoteItem.permissions[0].createdDateTime,tags:[],webDavPath:d.buildWebDavSpacesPath(e.remoteItem.id,"/"),sharedBy:t,owner:e.remoteItem.createdBy?.user,sharedWith:a,shareTypes:r,isFolder:!!e.folder,type:e.folder?"folder":"file",mimeType:e.file?.mimeType||"httpd/unix-directory",mdate:e.lastModifiedDateTime?new Date(e.lastModifiedDateTime).toUTCString():void 0,syncEnabled:e["@client.synchronize"],hidden:e["@UI.Hidden"],shareRoles:u,sharePermissions:l,outgoing:!1,privateLink:g.urlJoin(o,"f",e.remoteItem.id),hasPreview:()=>!!e.thumbnails,canRename:()=>e["@client.synchronize"],canDownload:()=>l.includes(d.GraphSharePermission.readContent),canUpload:()=>l.includes(d.GraphSharePermission.createUpload),canCreate:()=>l.includes(d.GraphSharePermission.createChildren),canBeDeleted:()=>l.includes(d.GraphSharePermission.deleteStandard),canEditTags:()=>l.includes(d.GraphSharePermission.createUpload),isMounted:()=>!1,isReceivedShare:()=>!0,canShare:()=>!1,getDomSelector:()=>d.extractDomSelector(e.id)};return p.extension=d.extractExtensionFromFile(p),p}function _({driveItem:e,user:s,serverUrl:o}){const c=d.extractStorageId(e.id),i=g.urlJoin(e.parentReference.path,e.name),a={id:e.id,driveId:e.parentReference?.driveId,path:i,name:e.name,fileId:e.id,size:e.size,storageId:c,parentFolderId:e.parentReference?.id,sdate:e.permissions[0].createdDateTime,tags:[],webDavPath:d.buildWebDavSpacesPath(c,i),sharedBy:[{id:s.id,displayName:s.displayName}],owner:{id:s.id,displayName:s.displayName},sharedWith:e.permissions.map(t=>{if(t.link)return{id:t.id,displayName:t.link["@libre.graph.displayName"],shareType:d.ShareTypes.link.value};const r=D(t);return{...t.grantedToV2.user||t.grantedToV2.group,shareType:r}}),shareTypes:e.permissions.map(D),isFolder:!!e.folder,type:e.folder?"folder":"file",mimeType:e.file?.mimeType||"httpd/unix-directory",outgoing:!0,privateLink:g.urlJoin(o,"f",e.id),hasPreview:()=>!!e.thumbnails,canRename:()=>!0,canDownload:()=>!0,canUpload:()=>!0,canCreate:()=>!0,canBeDeleted:()=>!0,canEditTags:()=>!0,isMounted:()=>!1,isReceivedShare:()=>!0,canShare:()=>!0,getDomSelector:()=>d.extractDomSelector(e.id)};return a.extension=d.extractExtensionFromFile(a),a}function A({graphPermission:e,graphRoles:s,resourceId:o,indirect:c=!1}){const i=s[e.roles?.[0]],a=e.invitation?.invitedBy?.user;return{id:e.id,resourceId:o,indirect:c,shareType:D(e),role:i,sharedBy:{id:a?.id,displayName:a?.displayName},sharedWith:e.grantedToV2.user||e.grantedToV2.group,permissions:e["@libre.graph.permissions.actions"]?e["@libre.graph.permissions.actions"]:i.rolePermissions.flatMap(t=>t.allowedResourceActions),createdDateTime:e.createdDateTime,expirationDateTime:e.expirationDateTime}}function S({graphPermission:e,resourceId:s,indirect:o=!1}){const c=e.invitation?.invitedBy?.user;return{id:e.id,resourceId:s,indirect:o,shareType:d.ShareTypes.link.value,sharedBy:{id:c?.id,displayName:c?.displayName},hasPassword:e.hasPassword,createdDateTime:e.createdDateTime,expirationDateTime:e.expirationDateTime,displayName:e.link["@libre.graph.displayName"],isQuickLink:e.link["@libre.graph.quickLink"],type:e.link.type,webUrl:e.link.webUrl,preventsDownload:e.link.preventsDownload}}function D({link:e,grantedToV2:s}){return e?d.ShareTypes.link.value:s?.group?d.ShareTypes.group.value:s?.user?.["@libre.graph.userType"]==="Federated"?d.ShareTypes.remote.value:d.ShareTypes.user.value}const P=e=>new URL(e.webUrl).origin,H=({axiosClient:e,config:s})=>{const o=h.DrivesApiFactory(s,s.basePath,e),c=new h.MeDrivesApi(s,s.basePath,e),i=new h.DrivesGetDrivesApi(s,s.basePath,e);return{async getDrive(a,t,r){const{data:n}=await o.getDrive(a,t?.select?new Set([...t.select]):null,r);return d.buildSpace({...n,serverUrl:P(n)})},async createDrive(a,t){const{data:r}=await o.createDrive(a,t);return d.buildSpace({...r,serverUrl:P(r)})},async updateDrive(a,t,r){const{data:n}=await o.updateDrive(a,t,r);return d.buildSpace({...n,serverUrl:P(n)})},async disableDrive(a,t,r){await o.deleteDrive(a,t,r)},async deleteDrive(a,t,r){await o.deleteDrive(a,t,{headers:{...r?.headers&&r.headers||{},Purge:"T"},...r&&{requestOptions:r}||{}})},async listMyDrives(a,t){const{data:{value:r}}=await c.listMyDrivesBeta(a?.orderBy,a?.filter,a?.expand,a?.select?new Set([...a.select]):null,t);return r.map(n=>d.buildSpace({...n,serverUrl:P(n)}))},async listAllDrives(a,t){const{data:{value:r}}=await i.listAllDrivesBeta(a?.orderBy,a?.filter,a?.expand,a?.select?new Set([...a.select]):null,t);return r.map(n=>d.buildSpace({...n,serverUrl:P(n)}))}}},Y=({axiosClient:e,config:s})=>{const o=h.DriveItemApiFactory(s,s.basePath,e),c=h.DrivesRootApiFactory(s,s.basePath,e),i=h.MeDriveApiFactory(s,s.basePath,e);return{async getDriveItem(a,t,r){const{data:n}=await o.getDriveItem(a,t,r);return n},async createDriveItem(a,t,r){const{data:n}=await c.createDriveItem(a,t,r);return n},async updateDriveItem(a,t,r,n){const{data:u}=await o.updateDriveItem(a,t,r,n);return u},async deleteDriveItem(a,t,r){await o.deleteDriveItem(a,t,r)},async listSharedByMe(a,t){const{data:r}=await i.listSharedByMe(a?.expand,t);return r?.value||[]},async listSharedWithMe(a,t){const{data:r}=await i.listSharedWithMe(a?.expand,t);return r?.value||[]}}},Q=({axiosClient:e,config:s})=>{const o=h.TagsApiFactory(s,s.basePath,e);return{async listTags(c){const{data:{value:i}}=await o.getTags(c);return i||[]},async assignTags(c,i){await o.assignTags(c,i)},async unassignTags(c,i){await o.unassignTags(c,i)}}},Z=({axiosClient:e,config:s})=>{const o=h.ActivitiesApiFactory(s,s.basePath,e);return{async listActivities(c,i){const{data:{value:a}}=await o.getActivities(c,i);return a||[]}}},$=({axiosClient:e,config:s})=>{const o=h.DrivesRootApiFactory(s,s.basePath,e),c=h.RoleManagementApiFactory(s,s.basePath,e),i=h.DrivesPermissionsApiFactory(s,s.basePath,e);return{async getPermission(a,t,r,n,u){const{data:l}=await i.getPermission(a,t,r,u);return l.link?S({graphPermission:l,resourceId:t}):A({graphPermission:l,resourceId:t,graphRoles:n||{}})},async listPermissions(a,t,r,n,u){let l;if(a===t){const{data:w}=await o.listPermissionsSpaceRoot(a,n?.filter,n?.select?new Set([...n.select]):null,n?.count,n?.top||0,u);l=w}else{const{data:w}=await i.listPermissions(a,t,n?.filter,n?.select?new Set([...n.select]):null,n?.count,n?.top||0,u);l=w}const p=l.value||[],y=l["@libre.graph.permissions.actions.allowedValues"],m=l["@libre.graph.permissions.roles.allowedValues"],b=l["@odata.count"];return{shares:p.map(w=>w.link?S({graphPermission:w,resourceId:t}):A({graphPermission:w,resourceId:t,graphRoles:r||{}})),allowedActions:y,allowedRoles:m,count:b}},async updatePermission(a,t,r,n,u,l){let p;if(a===t){const{data:y}=await o.updatePermissionSpaceRoot(a,r,n,l);p=y}else{const{data:y}=await i.updatePermission(a,t,r,n,l);p=y}return p.link?S({graphPermission:p,resourceId:t}):A({graphPermission:p,resourceId:t,graphRoles:u||{}})},async deletePermission(a,t,r,n){if(a===t){await o.deletePermissionSpaceRoot(a,r,n);return}await i.deletePermission(a,t,r,n)},async createInvite(a,t,r,n,u){let l;if(a===t){const{data:p}=await o.inviteSpaceRoot(a,r,u);l=p.value?.[0]}else{const{data:p}=await i.invite(a,t,r,u);l=p.value?.[0]}if(!l)throw new Error("no permission returned");return A({graphPermission:l,resourceId:t,graphRoles:n||{}})},async createLink(a,t,r,n){let u;if(a===t){const{data:l}=await o.createLinkSpaceRoot(a,r,n);u=l}else{const{data:l}=await i.createLink(a,t,r,n);u=l}return S({graphPermission:u,resourceId:t})},async setPermissionPassword(a,t,r,n,u){let l;if(a===t){const{data:p}=await o.setPermissionPasswordSpaceRoot(a,r,n,u);l=p}else{const{data:p}=await i.setPermissionPassword(a,t,r,n,u);l=p}return S({graphPermission:l,resourceId:t})},async listRoleDefinitions(a){const{data:t}=await c.listPermissionRoleDefinitions(a);return t}}},K=({axiosClient:e,config:s})=>{const o=h.MePhotoApiFactory(s,s.basePath,e),c=h.UserPhotoApiFactory(s,s.basePath,e);return{async getOwnUserPhoto(i){const{data:a}=await o.getOwnUserPhoto(i);return a},async deleteOwnUserPhoto(i){const{data:a}=await o.deleteOwnUserPhoto(i);return a},async updateOwnUserPhotoPatch(i,a){const{data:t}=await o.updateOwnUserPhotoPatch(i,a);return t},async getUserPhoto(i,a){const{data:t}=await c.getUserPhoto(i,a);return t}}},X=(e,s)=>{const o=new URL(e);o.pathname=[...o.pathname.split("/"),"graph"].filter(Boolean).join("/");const c=new h.Configuration({basePath:o.href});return{activities:Z({axiosClient:s,config:c}),applications:M({axiosClient:s,config:c}),tags:Q({axiosClient:s,config:c}),drives:H({axiosClient:s,config:c}),driveItems:Y({axiosClient:s,config:c}),users:k({axiosClient:s,config:c}),groups:B({axiosClient:s,config:c}),permissions:$({axiosClient:s,config:c}),photos:K({axiosClient:s,config:c})}};exports.buildCollaboratorShare=A;exports.buildIncomingShareResource=J;exports.buildLinkShare=S;exports.buildOutgoingShareResource=_;exports.getShareResourcePermissions=U;exports.getShareResourceRoles=f;exports.graph=X;exports.isCollaboratorShare=V;exports.isIncomingShareResource=z;exports.isLinkShare=j;exports.isOutgoingShareResource=W;exports.isShareResource=v;
1
+ "use strict";const h=require("./web-client/graph/generated.cjs"),g=require("./toString-CEqk2kJI.cjs"),d=require("./functions-D3Ol8cjk.cjs"),k=({axiosClient:e,config:s})=>{const o=h.UserApiFactory(s,s.basePath,e),c=h.UsersApiFactory(s,s.basePath,e),i=h.MeUserApiFactory(s,s.basePath,e),a=h.MeChangepasswordApiFactory(s,s.basePath,e),t=h.UserAppRoleAssignmentApiFactory(s,s.basePath,e);return{async getUser(r,n,u){const{data:l}=await o.getUser(r,n?.select?new Set([...n.select]):null,n?.expand?new Set([...n.expand]):new Set(["drive","memberOf","appRoleAssignments"]),u);return l},async createUser(r,n){const{data:u}=await c.createUser(r,n);return u},async editUser(r,n,u){const{data:l}=await o.updateUser(r,n,u);return l},async deleteUser(r,n,u){await o.deleteUser(r,n,u)},async listUsers(r,n){const{data:{value:u}}=await c.listUsers(r?.search,r?.filter,r?.orderBy?new Set([...r.orderBy]):null,r?.select?new Set([...r.select]):null,r?.expand?new Set([...r.expand]):null,n);return u},async getMe(r,n){const{data:u}=await i.getOwnUser(r?.expand?new Set([...r.expand]):new Set(["memberOf"]),n);return u},async editMe(r,n){const{data:u}=await i.updateOwnUser(r,n);return u},async changeOwnPassword(r,n){await a.changeOwnPassword(r,n)},async exportPersonalData(r,n,u){await o.exportPersonalData(r,n,u)},async createUserAppRoleAssignment(r,n,u){const{data:l}=await t.userCreateAppRoleAssignments(r,n,u);return l}}},B=({axiosClient:e,config:s})=>{const o=h.GroupApiFactory(s,s.basePath,e),c=h.GroupsApiFactory(s,s.basePath,e);return{async getGroup(i,a,t){const{data:r}=await o.getGroup(i,a?.select?new Set([...a.select]):null,a?.expand?new Set([...a.expand]):new Set(["members"]),t);return r},async createGroup(i,a){const{data:t}=await c.createGroup(i,a);return t},async editGroup(i,a,t){const{data:r}=await o.updateGroup(i,a,t);return r},async deleteGroup(i,a,t){await o.deleteGroup(i,a,t)},async listGroups(i,a){const{data:{value:t}}=await c.listGroups(i?.search,i?.orderBy?new Set([...i.orderBy]):null,i?.select?new Set([...i.select]):null,i?.expand?new Set([...i.expand]):null,a);return t},async addMember(i,a,t){await o.addMember(i,{"@odata.id":g.urlJoin(s.basePath,"v1.0","users",a)},t)},async deleteMember(i,a,t,r){await o.deleteMember(i,a,t,r)}}},M=({axiosClient:e,config:s})=>{const o=h.ApplicationsApiFactory(s,s.basePath,e);return{async getApplication(c,i){const{data:a}=await o.getApplication(c,i);return a},async listApplications(c){const{data:{value:i}}=await o.listApplications(c);return i||[]}}};function G(){}var F=g.getNative(g.root,"Set");function T(e){var s=-1,o=Array(e.size);return e.forEach(function(c){o[++s]=c}),o}var N=1/0,x=F&&1/T(new F([,-0]))[1]==N?function(e){return new F(e)}:G,L=200;function E(e,s,o){var c=-1,i=d.arrayIncludes,a=e.length,t=!0,r=[],n=r;if(a>=L){var u=x(e);if(u)return T(u);t=!1,i=d.cacheHas,n=new d.SetCache}else n=r;e:for(;++c<a;){var l=e[c],p=l;if(l=l!==0?l:0,t&&p===p){for(var y=n.length;y--;)if(n[y]===p)continue e;r.push(l)}else i(n,p,o)||(n!==r&&n.push(p),r.push(l))}return r}function O(e){return e&&e.length?E(e):[]}const v=e=>Object.hasOwn(e,"sharedWith"),W=e=>v(e)&&e.outgoing,z=e=>v(e)&&!e.outgoing,V=e=>Object.hasOwn(e,"role"),j=e=>!Object.hasOwn(e,"role"),f=({driveItem:e,graphRoles:s})=>e.remoteItem?.permissions.reduce((o,c)=>(c.roles?.forEach(i=>{const a=s[i];a&&!o.some(({id:t})=>t===a.id)&&o.push(a)}),o),[]),U=({driveItem:e,shareRoles:s})=>{if(!s.length){const c=e.remoteItem?.permissions.reduce((i,a)=>{const t=a["@libre.graph.permissions.actions"];return t&&i.push(...t),i},[]);return[...new Set(c)]}const o=s.reduce((c,i)=>(i.rolePermissions.forEach(a=>{c.push(...a.allowedResourceActions)}),c),[]);return[...new Set(o)]};function J({driveItem:e,graphRoles:s,serverUrl:o}){const c=e.name||e.remoteItem.name,i=d.extractStorageId(e.remoteItem.id),a=e.remoteItem.permissions.map(y=>{const{grantedToV2:m}=y;return{...m.group||m.user,shareType:D(y)}}),t=e.remoteItem.permissions.reduce((y,m)=>{const b=m.invitation.invitedBy.user;return y.some(({id:R})=>R===b.id)||y.push(b),y},[]);let r=O(e.remoteItem.permissions.map(D));t.some(y=>y["@libre.graph.userType"]==="Federated")&&(r=[d.ShareTypes.remote.value]);const u=f({driveItem:e,graphRoles:s}),l=U({driveItem:e,shareRoles:u}),p={id:e.id,remoteItemId:e.remoteItem.id,driveId:e.parentReference?.driveId,path:"/",name:c,fileId:e.remoteItem.id,size:e.size,storageId:i,parentFolderId:e.parentReference?.id,sdate:e.remoteItem.permissions[0].createdDateTime,tags:[],webDavPath:d.buildWebDavSpacesPath(e.remoteItem.id,"/"),sharedBy:t,owner:e.remoteItem.createdBy?.user,sharedWith:a,shareTypes:r,isFolder:!!e.folder,type:e.folder?"folder":"file",mimeType:e.file?.mimeType||"httpd/unix-directory",mdate:e.lastModifiedDateTime?new Date(e.lastModifiedDateTime).toUTCString():void 0,syncEnabled:e["@client.synchronize"],hidden:e["@UI.Hidden"],shareRoles:u,sharePermissions:l,outgoing:!1,privateLink:g.urlJoin(o,"f",e.remoteItem.id),hasPreview:()=>!!e.thumbnails,canRename:()=>e["@client.synchronize"],canDownload:()=>l.includes(d.GraphSharePermission.readContent),canUpload:()=>l.includes(d.GraphSharePermission.createUpload),canCreate:()=>l.includes(d.GraphSharePermission.createChildren),canBeDeleted:()=>l.includes(d.GraphSharePermission.deleteStandard),canEditTags:()=>l.includes(d.GraphSharePermission.createUpload),isMounted:()=>!1,isReceivedShare:()=>!0,canShare:()=>!1,getDomSelector:()=>d.extractDomSelector(e.id)};return p.extension=d.extractExtensionFromFile(p),p}function _({driveItem:e,user:s,serverUrl:o}){const c=d.extractStorageId(e.id),i=g.urlJoin(e.parentReference.path,e.name),a={id:e.id,driveId:e.parentReference?.driveId,path:i,name:e.name,fileId:e.id,size:e.size,storageId:c,parentFolderId:e.parentReference?.id,sdate:e.permissions[0].createdDateTime,tags:[],webDavPath:d.buildWebDavSpacesPath(c,i),sharedBy:[{id:s.id,displayName:s.displayName}],owner:{id:s.id,displayName:s.displayName},sharedWith:e.permissions.map(t=>{if(t.link)return{id:t.id,displayName:t.link["@libre.graph.displayName"],shareType:d.ShareTypes.link.value};const r=D(t);return{...t.grantedToV2.user||t.grantedToV2.group,shareType:r}}),shareTypes:e.permissions.map(D),isFolder:!!e.folder,type:e.folder?"folder":"file",mimeType:e.file?.mimeType||"httpd/unix-directory",outgoing:!0,privateLink:g.urlJoin(o,"f",e.id),hasPreview:()=>!!e.thumbnails,canRename:()=>!0,canDownload:()=>!0,canUpload:()=>!0,canCreate:()=>!0,canBeDeleted:()=>!0,canEditTags:()=>!0,isMounted:()=>!1,isReceivedShare:()=>!0,canShare:()=>!0,getDomSelector:()=>d.extractDomSelector(e.id)};return a.extension=d.extractExtensionFromFile(a),a}function A({graphPermission:e,graphRoles:s,resourceId:o,indirect:c=!1}){const i=s[e.roles?.[0]],a=e.invitation?.invitedBy?.user;return{id:e.id,resourceId:o,indirect:c,shareType:D(e),role:i,sharedBy:{id:a?.id,displayName:a?.displayName},sharedWith:e.grantedToV2.user||e.grantedToV2.group,permissions:e["@libre.graph.permissions.actions"]?e["@libre.graph.permissions.actions"]:i.rolePermissions.flatMap(t=>t.allowedResourceActions),createdDateTime:e.createdDateTime,expirationDateTime:e.expirationDateTime}}function S({graphPermission:e,resourceId:s,indirect:o=!1}){const c=e.invitation?.invitedBy?.user;return{id:e.id,resourceId:s,indirect:o,shareType:d.ShareTypes.link.value,sharedBy:{id:c?.id,displayName:c?.displayName},hasPassword:e.hasPassword,createdDateTime:e.createdDateTime,expirationDateTime:e.expirationDateTime,displayName:e.link["@libre.graph.displayName"],isQuickLink:e.link["@libre.graph.quickLink"],type:e.link.type,webUrl:e.link.webUrl,preventsDownload:e.link.preventsDownload}}function D({link:e,grantedToV2:s}){return e?d.ShareTypes.link.value:s?.group?d.ShareTypes.group.value:s?.user?.["@libre.graph.userType"]==="Federated"?d.ShareTypes.remote.value:d.ShareTypes.user.value}const P=e=>new URL(e.webUrl).origin,H=({axiosClient:e,config:s})=>{const o=h.DrivesApiFactory(s,s.basePath,e),c=new h.MeDrivesApi(s,s.basePath,e),i=new h.DrivesGetDrivesApi(s,s.basePath,e);return{async getDrive(a,t,r){const{data:n}=await o.getDrive(a,t?.select?new Set([...t.select]):null,r);return d.buildSpace({...n,serverUrl:P(n)})},async createDrive(a,t){const{data:r}=await o.createDrive(a,t);return d.buildSpace({...r,serverUrl:P(r)})},async updateDrive(a,t,r){const{data:n}=await o.updateDrive(a,t,r);return d.buildSpace({...n,serverUrl:P(n)})},async disableDrive(a,t,r){await o.deleteDrive(a,t,r)},async deleteDrive(a,t,r){await o.deleteDrive(a,t,{headers:{...r?.headers&&r.headers||{},Purge:"T"},...r&&{requestOptions:r}||{}})},async listMyDrives(a,t){const{data:{value:r}}=await c.listMyDrivesBeta(a?.orderBy,a?.filter,a?.expand,a?.select?new Set([...a.select]):null,t);return r.map(n=>d.buildSpace({...n,serverUrl:P(n)}))},async listAllDrives(a,t){const{data:{value:r}}=await i.listAllDrivesBeta(a?.orderBy,a?.filter,a?.expand,a?.select?new Set([...a.select]):null,t);return r.map(n=>d.buildSpace({...n,serverUrl:P(n)}))}}},Y=({axiosClient:e,config:s})=>{const o=h.DriveItemApiFactory(s,s.basePath,e),c=h.DrivesRootApiFactory(s,s.basePath,e),i=h.MeDriveApiFactory(s,s.basePath,e);return{async getDriveItem(a,t,r){const{data:n}=await o.getDriveItem(a,t,r);return n},async createDriveItem(a,t,r){const{data:n}=await c.createDriveItem(a,t,r);return n},async updateDriveItem(a,t,r,n){const{data:u}=await o.updateDriveItem(a,t,r,n);return u},async deleteDriveItem(a,t,r){await o.deleteDriveItem(a,t,r)},async listSharedByMe(a,t){const{data:r}=await i.listSharedByMe(a?.expand,t);return r?.value||[]},async listSharedWithMe(a,t){const{data:r}=await i.listSharedWithMe(a?.expand,t);return r?.value||[]}}},Q=({axiosClient:e,config:s})=>{const o=h.TagsApiFactory(s,s.basePath,e);return{async listTags(c){const{data:{value:i}}=await o.getTags(c);return i||[]},async assignTags(c,i){await o.assignTags(c,i)},async unassignTags(c,i){await o.unassignTags(c,i)}}},Z=({axiosClient:e,config:s})=>{const o=h.ActivitiesApiFactory(s,s.basePath,e);return{async listActivities(c,i){const{data:{value:a}}=await o.getActivities(c,i);return a||[]}}},$=({axiosClient:e,config:s})=>{const o=h.DrivesRootApiFactory(s,s.basePath,e),c=h.RoleManagementApiFactory(s,s.basePath,e),i=h.DrivesPermissionsApiFactory(s,s.basePath,e);return{async getPermission(a,t,r,n,u){const{data:l}=await i.getPermission(a,t,r,u);return l.link?S({graphPermission:l,resourceId:t}):A({graphPermission:l,resourceId:t,graphRoles:n||{}})},async listPermissions(a,t,r,n,u){let l;if(a===t){const{data:w}=await o.listPermissionsSpaceRoot(a,n?.filter,n?.select?new Set([...n.select]):null,n?.count,n?.top||0,u);l=w}else{const{data:w}=await i.listPermissions(a,t,n?.filter,n?.select?new Set([...n.select]):null,n?.count,n?.top||0,u);l=w}const p=l.value||[],y=l["@libre.graph.permissions.actions.allowedValues"],m=l["@libre.graph.permissions.roles.allowedValues"],b=l["@odata.count"];return{shares:p.map(w=>w.link?S({graphPermission:w,resourceId:t}):A({graphPermission:w,resourceId:t,graphRoles:r||{}})),allowedActions:y,allowedRoles:m,count:b}},async updatePermission(a,t,r,n,u,l){let p;if(a===t){const{data:y}=await o.updatePermissionSpaceRoot(a,r,n,l);p=y}else{const{data:y}=await i.updatePermission(a,t,r,n,l);p=y}return p.link?S({graphPermission:p,resourceId:t}):A({graphPermission:p,resourceId:t,graphRoles:u||{}})},async deletePermission(a,t,r,n){if(a===t){await o.deletePermissionSpaceRoot(a,r,n);return}await i.deletePermission(a,t,r,n)},async createInvite(a,t,r,n,u){let l;if(a===t){const{data:p}=await o.inviteSpaceRoot(a,r,u);l=p.value?.[0]}else{const{data:p}=await i.invite(a,t,r,u);l=p.value?.[0]}if(!l)throw new Error("no permission returned");return A({graphPermission:l,resourceId:t,graphRoles:n||{}})},async createLink(a,t,r,n){let u;if(a===t){const{data:l}=await o.createLinkSpaceRoot(a,r,n);u=l}else{const{data:l}=await i.createLink(a,t,r,n);u=l}return S({graphPermission:u,resourceId:t})},async setPermissionPassword(a,t,r,n,u){let l;if(a===t){const{data:p}=await o.setPermissionPasswordSpaceRoot(a,r,n,u);l=p}else{const{data:p}=await i.setPermissionPassword(a,t,r,n,u);l=p}return S({graphPermission:l,resourceId:t})},async listRoleDefinitions(a){const{data:t}=await c.listPermissionRoleDefinitions(a);return t}}},K=({axiosClient:e,config:s})=>{const o=h.MePhotoApiFactory(s,s.basePath,e),c=h.UserPhotoApiFactory(s,s.basePath,e);return{async getOwnUserPhoto(i){const{data:a}=await o.getOwnUserPhoto(i);return a},async deleteOwnUserPhoto(i){const{data:a}=await o.deleteOwnUserPhoto(i);return a},async updateOwnUserPhotoPatch(i,a){const{data:t}=await o.updateOwnUserPhotoPatch(i,a);return t},async getUserPhoto(i,a){const{data:t}=await c.getUserPhoto(i,a);return t}}},X=(e,s)=>{const o=new URL(e);o.pathname=[...o.pathname.split("/"),"graph"].filter(Boolean).join("/");const c=new h.Configuration({basePath:o.href});return{activities:Z({axiosClient:s,config:c}),applications:M({axiosClient:s,config:c}),tags:Q({axiosClient:s,config:c}),drives:H({axiosClient:s,config:c}),driveItems:Y({axiosClient:s,config:c}),users:k({axiosClient:s,config:c}),groups:B({axiosClient:s,config:c}),permissions:$({axiosClient:s,config:c}),photos:K({axiosClient:s,config:c})}};exports.buildCollaboratorShare=A;exports.buildIncomingShareResource=J;exports.buildLinkShare=S;exports.buildOutgoingShareResource=_;exports.getShareResourcePermissions=U;exports.getShareResourceRoles=f;exports.graph=X;exports.isCollaboratorShare=V;exports.isIncomingShareResource=z;exports.isLinkShare=j;exports.isOutgoingShareResource=W;exports.isShareResource=v;
@@ -1,5 +1,5 @@
1
1
  import { a as Nr } from "./index-BfIzVKrn.js";
2
- import { D as st, I as he, J as me, t as xr, l as ue, p as Kt, m as Pr, K as se } from "./functions-BBrAOhdi.js";
2
+ import { D as st, I as he, J as me, t as xr, l as ue, p as Kt, m as Pr, K as se } from "./functions-DoaLjzWZ.js";
3
3
  import { u as M } from "./toString-BMC5nz5v.js";
4
4
  import { ocs as Er } from "./web-client/ocs.js";
5
5
  import { p as oe, g as ve } from "./index-8RyXehLU.js";
@@ -1,4 +1,4 @@
1
- "use strict";const mr=require("./index-BG-qXJDl.cjs"),R=require("./functions-C2T1nL62.cjs"),V=require("./toString-CEqk2kJI.cjs"),br=require("./web-client/ocs.cjs"),re=require("./index-sTep8AuK.cjs"),fe=r=>encodeURIComponent(r).split("%2F").join("/");class et extends Error{response;statusCode;constructor(e,t,n=null){super(e),this.response=t,this.statusCode=n}}class Jt extends et{errorCode;constructor(e,t,n,a=null){super(e,n,a),this.errorCode=t}}const se=(r,{fileId:e,path:t,name:n})=>{if(t!==void 0)return V.urlJoin(r.webDavPath,t);if(e!==void 0){if(R.isPublicSpaceResource(r))throw new Error("public spaces need a path provided");return V.urlJoin("spaces",e,n||"")}return r.webDavPath},yr=(r,e)=>({copyFiles(t,{path:n,fileId:a},u,{path:c,parentFolderId:i,name:h},{overwrite:o,...s}={}){const f=se(t,{fileId:a,path:n}),l=se(u,{fileId:i,path:c,name:h});return r.copy(f,l,{overwrite:o||!1,...s})}}),vr=(r,e,t)=>({async createFolder(n,{path:a,parentFolderId:u,folderName:c,fetchFolder:i=!0,...h}){const o=se(n,{fileId:u,path:a,name:c});if(await r.mkcol(o),i)return e.getFileInfo(n,{path:a},h)}}),wr=(r,{axiosClient:e})=>({async getFileContents(t,{fileId:n,path:a},{responseType:u="text",noCache:c=!0,headers:i,...h}={}){try{const o=se(t,{fileId:n,path:a}),s=await e.get(r.getFileUrl(o),{responseType:u,headers:{...c&&{"Cache-Control":"no-cache"},...i||{}},...h});return{response:s,body:s.data,headers:{ETag:s.headers.etag,"OC-ETag":s.headers["oc-etag"],"OC-FileId":s.headers["oc-fileid"]}}}catch(o){const{message:s,response:f}=o;throw new et(s,f,f.status)}}}),Nr=(r,e)=>({async getFileInfo(t,n,a){return(await r.listFiles(t,n,{depth:0,...a})).resource}}),xr=(r,e,t,{axiosClient:n,baseUrl:a})=>({async getFileUrl(u,c,{disposition:i="attachment",isUrlSigningEnabled:h=!0,signUrlTimeout:o=86400,version:s=null,doHeadRequest:f=!1,username:l="",...g}){if(i==="inline"){const m=await e.getFileContents(u,c,{responseType:"blob",...g});return URL.createObjectURL(m.body)}if(s){if(!l)throw new Error("username is required for URL signing");const m=r.getFileUrl(V.urlJoin("meta",c.fileId,"v",s));return await br.ocs(a,n).signUrl(m,l)}if(c.downloadURL)return c.downloadURL;const{downloadURL:d}=await t.getFileInfo(u,c,{davProperties:[R.DavProperty.DownloadURL]});return d},revokeUrl:u=>{u&&u.startsWith("blob:")&&URL.revokeObjectURL(u)}}),Pr=(r,e)=>({getPublicFileUrl(t,n){return r.getFileUrl(V.urlJoin("public-files",n))}}),Er=(r,e,t)=>({async listFiles(n,{path:a,fileId:u}={},{depth:c=1,davProperties:i,isTrash:h=!1,...o}={}){let s;if(R.isPublicSpaceResource(n)){s=await r.propfind(V.urlJoin(n.webDavPath,a),{depth:c,properties:i||R.DavProperties.PublicLink,...o}),s.forEach(d=>{d.filename=d.filename.split("/").slice(1).join("/")}),s.length===1&&(s[0].filename=V.urlJoin(n.id,a,{leadingSlash:!0})),s.forEach(d=>{d.filename=d.filename.split("/").slice(2).join("/")});const l=n.driveAlias.startsWith("ocm/")?"ocm":"public-link";if((!a||a==="/")&&c>0&&l==="ocm"&&s[0].props[R.DavProperty.PublicLinkItemType]==="file"&&(s=[{basename:n.fileId,type:"directory",filename:"",props:{}},...s]),!a){const[d,...m]=s;return{resource:R.buildPublicSpaceResource({...d,id:n.id,driveAlias:n.driveAlias,webDavPath:n.webDavPath,publicLinkType:l}),children:m.map(w=>R.buildResource(w,r.extraProps))}}const g=s.map(d=>R.buildResource(d,r.extraProps));return{resource:g[0],children:g.slice(1)}}const f=async()=>{const l=await e.getPathForFileId(u);return this.listFiles(n,{path:l},{depth:c,davProperties:i})};try{let l="";if(h?l=R.buildWebDavSpacesTrashPath(n.id):l=se(n,{fileId:u,path:a}),s=await r.propfind(l,{depth:c,properties:i||R.DavProperties.Default,...o}),h)return{resource:R.buildResource(s[0],r.extraProps),children:s.slice(1).map(R.buildDeletedResource)};const g=s.map(m=>R.buildResource(m,r.extraProps)),d=u===n.id;return u&&!d&&g[0].fileId&&u!==g[0].fileId?f():{resource:g[0],children:g.slice(1)}}catch(l){if(l.statusCode===404&&u)return f();throw l}}}),Ar=(r,e)=>({moveFiles(t,{path:n,fileId:a},u,{path:c,parentFolderId:i,name:h},{overwrite:o,...s}={}){const f=se(t,{fileId:a,path:n}),l=se(u,{fileId:i,path:c,name:h});return r.move(f,l,{overwrite:o||!1,...s})}}),Tr=(r,e,t)=>({async putFileContents(n,{fileName:a,path:u,parentFolderId:c,content:i="",previousEntityTag:h="",overwrite:o,onUploadProgress:s=null,...f}){const l=se(n,{fileId:c,name:a,path:u}),{result:g}=await r.put(l,i,{previousEntityTag:h,overwrite:o,onUploadProgress:s,...f});return e.getFileInfo(n,{fileId:g.headers.get("Oc-Fileid"),path:u})}}),Or=(r,e)=>({deleteFile(t,{path:n,...a}){return r.delete(V.urlJoin(t.webDavPath,n),a)}}),Cr=(r,e)=>({restoreFile(t,{id:n},{path:a},{overwrite:u,...c}={}){if(R.isPublicSpaceResource(t))return;const i=V.urlJoin(t.webDavPath,a);return r.move(V.urlJoin(t.webDavTrashPath,n),i,{overwrite:u,...c})}}),Ir=(r,e)=>({restoreFileVersion(t,{parentFolderId:n,name:a,path:u},c,i={}){const h=se(t,{path:u,fileId:n,name:a}),o=V.urlJoin("meta",n,"v",c,{leadingSlash:!0}),s=V.urlJoin("files",h,{leadingSlash:!0});return r.copy(o,s,i)}}),Sr=(r,e)=>({clearTrashBin(t,{id:n,...a}={}){let u=R.buildWebDavSpacesTrashPath(t.id);return n&&(u=V.urlJoin(u,n)),r.delete(u,a)}}),Fr=(r,e)=>({async search(t,{davProperties:n=R.DavProperties.Default,searchLimit:a,...u}){const c="/spaces/",{range:i,results:h}=await r.report(c,{pattern:t,limit:a,properties:n,...u});return{resources:h.map(o=>({...R.buildResource(o,r.extraProps),highlights:o.props[R.DavProperty.Highlights]||""})),totalResults:i?parseInt(i?.split("/")[1]):null}}}),jr=(r,e)=>({async getPathForFileId(t,n={}){return(await r.propfind(V.urlJoin("meta",t,{leadingSlash:!0}),{properties:[R.DavProperty.MetaPathForUser],...n}))[0].props[R.DavProperty.MetaPathForUser]}});var $r={2:r=>{function e(a,u,c){a instanceof RegExp&&(a=t(a,c)),u instanceof RegExp&&(u=t(u,c));var i=n(a,u,c);return i&&{start:i[0],end:i[1],pre:c.slice(0,i[0]),body:c.slice(i[0]+a.length,i[1]),post:c.slice(i[1]+u.length)}}function t(a,u){var c=u.match(a);return c?c[0]:null}function n(a,u,c){var i,h,o,s,f,l=c.indexOf(a),g=c.indexOf(u,l+1),d=l;if(l>=0&&g>0){for(i=[],o=c.length;d>=0&&!f;)d==l?(i.push(d),l=c.indexOf(a,d+1)):i.length==1?f=[i.pop(),g]:((h=i.pop())<o&&(o=h,s=g),g=c.indexOf(u,d+1)),d=l<g&&l>=0?l:g;i.length&&(f=[o,s])}return f}r.exports=e,e.range=n},101:function(r,e,t){var n;r=t.nmd(r),(function(a){var u=(r&&r.exports,typeof re.global=="object"&&re.global);u.global!==u&&u.window;var c=function(f){this.message=f};(c.prototype=new Error).name="InvalidCharacterError";var i=function(f){throw new c(f)},h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=/[\t\n\f\r ]/g,s={encode:function(f){f=String(f),/[^\0-\xFF]/.test(f)&&i("The string to be encoded contains characters outside of the Latin1 range.");for(var l,g,d,m,w=f.length%3,v="",p=-1,y=f.length-w;++p<y;)l=f.charCodeAt(p)<<16,g=f.charCodeAt(++p)<<8,d=f.charCodeAt(++p),v+=h.charAt((m=l+g+d)>>18&63)+h.charAt(m>>12&63)+h.charAt(m>>6&63)+h.charAt(63&m);return w==2?(l=f.charCodeAt(p)<<8,g=f.charCodeAt(++p),v+=h.charAt((m=l+g)>>10)+h.charAt(m>>4&63)+h.charAt(m<<2&63)+"="):w==1&&(m=f.charCodeAt(p),v+=h.charAt(m>>2)+h.charAt(m<<4&63)+"=="),v},decode:function(f){var l=(f=String(f).replace(o,"")).length;l%4==0&&(l=(f=f.replace(/==?$/,"")).length),(l%4==1||/[^+a-zA-Z0-9/]/.test(f))&&i("Invalid character: the string to be decoded is not correctly encoded.");for(var g,d,m=0,w="",v=-1;++v<l;)d=h.indexOf(f.charAt(v)),g=m%4?64*g+d:d,m++%4&&(w+=String.fromCharCode(255&g>>(-2*m&6)));return w},version:"1.0.0"};(n=(function(){return s}).call(e,t,e,r))===void 0||(r.exports=n)})()},172:(r,e)=>{e.d=function(t){if(!t)return 0;for(var n=(t=t.toString()).length,a=t.length;a--;){var u=t.charCodeAt(a);56320<=u&&u<=57343&&a--,127<u&&u<=2047?n++:2047<u&&u<=65535&&(n+=2)}return n}},526:r=>{var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var n=[],a=0;a<t.length;a++)n.push(255&t.charCodeAt(a));return n},bytesToString:function(t){for(var n=[],a=0;a<t.length;a++)n.push(String.fromCharCode(t[a]));return n.join("")}}};r.exports=e},298:r=>{var e,t;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t={rotl:function(n,a){return n<<a|n>>>32-a},rotr:function(n,a){return n<<32-a|n>>>a},endian:function(n){if(n.constructor==Number)return 16711935&t.rotl(n,8)|4278255360&t.rotl(n,24);for(var a=0;a<n.length;a++)n[a]=t.endian(n[a]);return n},randomBytes:function(n){for(var a=[];n>0;n--)a.push(Math.floor(256*Math.random()));return a},bytesToWords:function(n){for(var a=[],u=0,c=0;u<n.length;u++,c+=8)a[c>>>5]|=n[u]<<24-c%32;return a},wordsToBytes:function(n){for(var a=[],u=0;u<32*n.length;u+=8)a.push(n[u>>>5]>>>24-u%32&255);return a},bytesToHex:function(n){for(var a=[],u=0;u<n.length;u++)a.push((n[u]>>>4).toString(16)),a.push((15&n[u]).toString(16));return a.join("")},hexToBytes:function(n){for(var a=[],u=0;u<n.length;u+=2)a.push(parseInt(n.substr(u,2),16));return a},bytesToBase64:function(n){for(var a=[],u=0;u<n.length;u+=3)for(var c=n[u]<<16|n[u+1]<<8|n[u+2],i=0;i<4;i++)8*u+6*i<=8*n.length?a.push(e.charAt(c>>>6*(3-i)&63)):a.push("=");return a.join("")},base64ToBytes:function(n){n=n.replace(/[^A-Z0-9+\/]/gi,"");for(var a=[],u=0,c=0;u<n.length;c=++u%4)c!=0&&a.push((e.indexOf(n.charAt(u-1))&Math.pow(2,-2*c+8)-1)<<2*c|e.indexOf(n.charAt(u))>>>6-2*c);return a}},r.exports=t},635:(r,e,t)=>{const n=t(31),a=t(338),u=t(221);r.exports={XMLParser:a,XMLValidator:n,XMLBuilder:u}},118:r=>{r.exports=function(e){return typeof e=="function"?e:Array.isArray(e)?t=>{for(const n of e)if(typeof n=="string"&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}},705:(r,e)=>{const t=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n="["+t+"]["+t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",a=new RegExp("^"+n+"$");e.isExist=function(u){return u!==void 0},e.isEmptyObject=function(u){return Object.keys(u).length===0},e.merge=function(u,c,i){if(c){const h=Object.keys(c),o=h.length;for(let s=0;s<o;s++)u[h[s]]=i==="strict"?[c[h[s]]]:c[h[s]]}},e.getValue=function(u){return e.isExist(u)?u:""},e.isName=function(u){return a.exec(u)!=null},e.getAllMatches=function(u,c){const i=[];let h=c.exec(u);for(;h;){const o=[];o.startIndex=c.lastIndex-h[0].length;const s=h.length;for(let f=0;f<s;f++)o.push(h[f]);i.push(o),h=c.exec(u)}return i},e.nameRegexp=n},31:(r,e,t)=>{const n=t(705),a={allowBooleanAttributes:!1,unpairedTags:[]};function u(p){return p===" "||p===" "||p===`
1
+ "use strict";const mr=require("./index-BG-qXJDl.cjs"),R=require("./functions-D3Ol8cjk.cjs"),V=require("./toString-CEqk2kJI.cjs"),br=require("./web-client/ocs.cjs"),re=require("./index-sTep8AuK.cjs"),fe=r=>encodeURIComponent(r).split("%2F").join("/");class et extends Error{response;statusCode;constructor(e,t,n=null){super(e),this.response=t,this.statusCode=n}}class Jt extends et{errorCode;constructor(e,t,n,a=null){super(e,n,a),this.errorCode=t}}const se=(r,{fileId:e,path:t,name:n})=>{if(t!==void 0)return V.urlJoin(r.webDavPath,t);if(e!==void 0){if(R.isPublicSpaceResource(r))throw new Error("public spaces need a path provided");return V.urlJoin("spaces",e,n||"")}return r.webDavPath},yr=(r,e)=>({copyFiles(t,{path:n,fileId:a},u,{path:c,parentFolderId:i,name:h},{overwrite:o,...s}={}){const f=se(t,{fileId:a,path:n}),l=se(u,{fileId:i,path:c,name:h});return r.copy(f,l,{overwrite:o||!1,...s})}}),vr=(r,e,t)=>({async createFolder(n,{path:a,parentFolderId:u,folderName:c,fetchFolder:i=!0,...h}){const o=se(n,{fileId:u,path:a,name:c});if(await r.mkcol(o),i)return e.getFileInfo(n,{path:a},h)}}),wr=(r,{axiosClient:e})=>({async getFileContents(t,{fileId:n,path:a},{responseType:u="text",noCache:c=!0,headers:i,...h}={}){try{const o=se(t,{fileId:n,path:a}),s=await e.get(r.getFileUrl(o),{responseType:u,headers:{...c&&{"Cache-Control":"no-cache"},...i||{}},...h});return{response:s,body:s.data,headers:{ETag:s.headers.etag,"OC-ETag":s.headers["oc-etag"],"OC-FileId":s.headers["oc-fileid"]}}}catch(o){const{message:s,response:f}=o;throw new et(s,f,f.status)}}}),Nr=(r,e)=>({async getFileInfo(t,n,a){return(await r.listFiles(t,n,{depth:0,...a})).resource}}),xr=(r,e,t,{axiosClient:n,baseUrl:a})=>({async getFileUrl(u,c,{disposition:i="attachment",isUrlSigningEnabled:h=!0,signUrlTimeout:o=86400,version:s=null,doHeadRequest:f=!1,username:l="",...g}){if(i==="inline"){const m=await e.getFileContents(u,c,{responseType:"blob",...g});return URL.createObjectURL(m.body)}if(s){if(!l)throw new Error("username is required for URL signing");const m=r.getFileUrl(V.urlJoin("meta",c.fileId,"v",s));return await br.ocs(a,n).signUrl(m,l)}if(c.downloadURL)return c.downloadURL;const{downloadURL:d}=await t.getFileInfo(u,c,{davProperties:[R.DavProperty.DownloadURL]});return d},revokeUrl:u=>{u&&u.startsWith("blob:")&&URL.revokeObjectURL(u)}}),Pr=(r,e)=>({getPublicFileUrl(t,n){return r.getFileUrl(V.urlJoin("public-files",n))}}),Er=(r,e,t)=>({async listFiles(n,{path:a,fileId:u}={},{depth:c=1,davProperties:i,isTrash:h=!1,...o}={}){let s;if(R.isPublicSpaceResource(n)){s=await r.propfind(V.urlJoin(n.webDavPath,a),{depth:c,properties:i||R.DavProperties.PublicLink,...o}),s.forEach(d=>{d.filename=d.filename.split("/").slice(1).join("/")}),s.length===1&&(s[0].filename=V.urlJoin(n.id,a,{leadingSlash:!0})),s.forEach(d=>{d.filename=d.filename.split("/").slice(2).join("/")});const l=n.driveAlias.startsWith("ocm/")?"ocm":"public-link";if((!a||a==="/")&&c>0&&l==="ocm"&&s[0].props[R.DavProperty.PublicLinkItemType]==="file"&&(s=[{basename:n.fileId,type:"directory",filename:"",props:{}},...s]),!a){const[d,...m]=s;return{resource:R.buildPublicSpaceResource({...d,id:n.id,driveAlias:n.driveAlias,webDavPath:n.webDavPath,publicLinkType:l}),children:m.map(w=>R.buildResource(w,r.extraProps))}}const g=s.map(d=>R.buildResource(d,r.extraProps));return{resource:g[0],children:g.slice(1)}}const f=async()=>{const l=await e.getPathForFileId(u);return this.listFiles(n,{path:l},{depth:c,davProperties:i})};try{let l="";if(h?l=R.buildWebDavSpacesTrashPath(n.id):l=se(n,{fileId:u,path:a}),s=await r.propfind(l,{depth:c,properties:i||R.DavProperties.Default,...o}),h)return{resource:R.buildResource(s[0],r.extraProps),children:s.slice(1).map(R.buildDeletedResource)};const g=s.map(m=>R.buildResource(m,r.extraProps)),d=u===n.id;return u&&!d&&g[0].fileId&&u!==g[0].fileId?f():{resource:g[0],children:g.slice(1)}}catch(l){if(l.statusCode===404&&u)return f();throw l}}}),Ar=(r,e)=>({moveFiles(t,{path:n,fileId:a},u,{path:c,parentFolderId:i,name:h},{overwrite:o,...s}={}){const f=se(t,{fileId:a,path:n}),l=se(u,{fileId:i,path:c,name:h});return r.move(f,l,{overwrite:o||!1,...s})}}),Tr=(r,e,t)=>({async putFileContents(n,{fileName:a,path:u,parentFolderId:c,content:i="",previousEntityTag:h="",overwrite:o,onUploadProgress:s=null,...f}){const l=se(n,{fileId:c,name:a,path:u}),{result:g}=await r.put(l,i,{previousEntityTag:h,overwrite:o,onUploadProgress:s,...f});return e.getFileInfo(n,{fileId:g.headers.get("Oc-Fileid"),path:u})}}),Or=(r,e)=>({deleteFile(t,{path:n,...a}){return r.delete(V.urlJoin(t.webDavPath,n),a)}}),Cr=(r,e)=>({restoreFile(t,{id:n},{path:a},{overwrite:u,...c}={}){if(R.isPublicSpaceResource(t))return;const i=V.urlJoin(t.webDavPath,a);return r.move(V.urlJoin(t.webDavTrashPath,n),i,{overwrite:u,...c})}}),Ir=(r,e)=>({restoreFileVersion(t,{parentFolderId:n,name:a,path:u},c,i={}){const h=se(t,{path:u,fileId:n,name:a}),o=V.urlJoin("meta",n,"v",c,{leadingSlash:!0}),s=V.urlJoin("files",h,{leadingSlash:!0});return r.copy(o,s,i)}}),Sr=(r,e)=>({clearTrashBin(t,{id:n,...a}={}){let u=R.buildWebDavSpacesTrashPath(t.id);return n&&(u=V.urlJoin(u,n)),r.delete(u,a)}}),Fr=(r,e)=>({async search(t,{davProperties:n=R.DavProperties.Default,searchLimit:a,...u}){const c="/spaces/",{range:i,results:h}=await r.report(c,{pattern:t,limit:a,properties:n,...u});return{resources:h.map(o=>({...R.buildResource(o,r.extraProps),highlights:o.props[R.DavProperty.Highlights]||""})),totalResults:i?parseInt(i?.split("/")[1]):null}}}),jr=(r,e)=>({async getPathForFileId(t,n={}){return(await r.propfind(V.urlJoin("meta",t,{leadingSlash:!0}),{properties:[R.DavProperty.MetaPathForUser],...n}))[0].props[R.DavProperty.MetaPathForUser]}});var $r={2:r=>{function e(a,u,c){a instanceof RegExp&&(a=t(a,c)),u instanceof RegExp&&(u=t(u,c));var i=n(a,u,c);return i&&{start:i[0],end:i[1],pre:c.slice(0,i[0]),body:c.slice(i[0]+a.length,i[1]),post:c.slice(i[1]+u.length)}}function t(a,u){var c=u.match(a);return c?c[0]:null}function n(a,u,c){var i,h,o,s,f,l=c.indexOf(a),g=c.indexOf(u,l+1),d=l;if(l>=0&&g>0){for(i=[],o=c.length;d>=0&&!f;)d==l?(i.push(d),l=c.indexOf(a,d+1)):i.length==1?f=[i.pop(),g]:((h=i.pop())<o&&(o=h,s=g),g=c.indexOf(u,d+1)),d=l<g&&l>=0?l:g;i.length&&(f=[o,s])}return f}r.exports=e,e.range=n},101:function(r,e,t){var n;r=t.nmd(r),(function(a){var u=(r&&r.exports,typeof re.global=="object"&&re.global);u.global!==u&&u.window;var c=function(f){this.message=f};(c.prototype=new Error).name="InvalidCharacterError";var i=function(f){throw new c(f)},h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=/[\t\n\f\r ]/g,s={encode:function(f){f=String(f),/[^\0-\xFF]/.test(f)&&i("The string to be encoded contains characters outside of the Latin1 range.");for(var l,g,d,m,w=f.length%3,v="",p=-1,y=f.length-w;++p<y;)l=f.charCodeAt(p)<<16,g=f.charCodeAt(++p)<<8,d=f.charCodeAt(++p),v+=h.charAt((m=l+g+d)>>18&63)+h.charAt(m>>12&63)+h.charAt(m>>6&63)+h.charAt(63&m);return w==2?(l=f.charCodeAt(p)<<8,g=f.charCodeAt(++p),v+=h.charAt((m=l+g)>>10)+h.charAt(m>>4&63)+h.charAt(m<<2&63)+"="):w==1&&(m=f.charCodeAt(p),v+=h.charAt(m>>2)+h.charAt(m<<4&63)+"=="),v},decode:function(f){var l=(f=String(f).replace(o,"")).length;l%4==0&&(l=(f=f.replace(/==?$/,"")).length),(l%4==1||/[^+a-zA-Z0-9/]/.test(f))&&i("Invalid character: the string to be decoded is not correctly encoded.");for(var g,d,m=0,w="",v=-1;++v<l;)d=h.indexOf(f.charAt(v)),g=m%4?64*g+d:d,m++%4&&(w+=String.fromCharCode(255&g>>(-2*m&6)));return w},version:"1.0.0"};(n=(function(){return s}).call(e,t,e,r))===void 0||(r.exports=n)})()},172:(r,e)=>{e.d=function(t){if(!t)return 0;for(var n=(t=t.toString()).length,a=t.length;a--;){var u=t.charCodeAt(a);56320<=u&&u<=57343&&a--,127<u&&u<=2047?n++:2047<u&&u<=65535&&(n+=2)}return n}},526:r=>{var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var n=[],a=0;a<t.length;a++)n.push(255&t.charCodeAt(a));return n},bytesToString:function(t){for(var n=[],a=0;a<t.length;a++)n.push(String.fromCharCode(t[a]));return n.join("")}}};r.exports=e},298:r=>{var e,t;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t={rotl:function(n,a){return n<<a|n>>>32-a},rotr:function(n,a){return n<<32-a|n>>>a},endian:function(n){if(n.constructor==Number)return 16711935&t.rotl(n,8)|4278255360&t.rotl(n,24);for(var a=0;a<n.length;a++)n[a]=t.endian(n[a]);return n},randomBytes:function(n){for(var a=[];n>0;n--)a.push(Math.floor(256*Math.random()));return a},bytesToWords:function(n){for(var a=[],u=0,c=0;u<n.length;u++,c+=8)a[c>>>5]|=n[u]<<24-c%32;return a},wordsToBytes:function(n){for(var a=[],u=0;u<32*n.length;u+=8)a.push(n[u>>>5]>>>24-u%32&255);return a},bytesToHex:function(n){for(var a=[],u=0;u<n.length;u++)a.push((n[u]>>>4).toString(16)),a.push((15&n[u]).toString(16));return a.join("")},hexToBytes:function(n){for(var a=[],u=0;u<n.length;u+=2)a.push(parseInt(n.substr(u,2),16));return a},bytesToBase64:function(n){for(var a=[],u=0;u<n.length;u+=3)for(var c=n[u]<<16|n[u+1]<<8|n[u+2],i=0;i<4;i++)8*u+6*i<=8*n.length?a.push(e.charAt(c>>>6*(3-i)&63)):a.push("=");return a.join("")},base64ToBytes:function(n){n=n.replace(/[^A-Z0-9+\/]/gi,"");for(var a=[],u=0,c=0;u<n.length;c=++u%4)c!=0&&a.push((e.indexOf(n.charAt(u-1))&Math.pow(2,-2*c+8)-1)<<2*c|e.indexOf(n.charAt(u))>>>6-2*c);return a}},r.exports=t},635:(r,e,t)=>{const n=t(31),a=t(338),u=t(221);r.exports={XMLParser:a,XMLValidator:n,XMLBuilder:u}},118:r=>{r.exports=function(e){return typeof e=="function"?e:Array.isArray(e)?t=>{for(const n of e)if(typeof n=="string"&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}},705:(r,e)=>{const t=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n="["+t+"]["+t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",a=new RegExp("^"+n+"$");e.isExist=function(u){return u!==void 0},e.isEmptyObject=function(u){return Object.keys(u).length===0},e.merge=function(u,c,i){if(c){const h=Object.keys(c),o=h.length;for(let s=0;s<o;s++)u[h[s]]=i==="strict"?[c[h[s]]]:c[h[s]]}},e.getValue=function(u){return e.isExist(u)?u:""},e.isName=function(u){return a.exec(u)!=null},e.getAllMatches=function(u,c){const i=[];let h=c.exec(u);for(;h;){const o=[];o.startIndex=c.lastIndex-h[0].length;const s=h.length;for(let f=0;f<s;f++)o.push(h[f]);i.push(o),h=c.exec(u)}return i},e.nameRegexp=n},31:(r,e,t)=>{const n=t(705),a={allowBooleanAttributes:!1,unpairedTags:[]};function u(p){return p===" "||p===" "||p===`
2
2
  `||p==="\r"}function c(p,y){const A=y;for(;y<p.length;y++)if(!(p[y]!="?"&&p[y]!=" ")){const N=p.substr(A,y-A);if(y>5&&N==="xml")return d("InvalidXml","XML declaration allowed only at the start of the document.",w(p,y));if(p[y]=="?"&&p[y+1]==">"){y++;break}}return y}function i(p,y){if(p.length>y+5&&p[y+1]==="-"&&p[y+2]==="-"){for(y+=3;y<p.length;y++)if(p[y]==="-"&&p[y+1]==="-"&&p[y+2]===">"){y+=2;break}}else if(p.length>y+8&&p[y+1]==="D"&&p[y+2]==="O"&&p[y+3]==="C"&&p[y+4]==="T"&&p[y+5]==="Y"&&p[y+6]==="P"&&p[y+7]==="E"){let A=1;for(y+=8;y<p.length;y++)if(p[y]==="<")A++;else if(p[y]===">"&&(A--,A===0))break}else if(p.length>y+9&&p[y+1]==="["&&p[y+2]==="C"&&p[y+3]==="D"&&p[y+4]==="A"&&p[y+5]==="T"&&p[y+6]==="A"&&p[y+7]==="["){for(y+=8;y<p.length;y++)if(p[y]==="]"&&p[y+1]==="]"&&p[y+2]===">"){y+=2;break}}return y}e.validate=function(p,y){y=Object.assign({},a,y);const A=[];let N=!1,b=!1;p[0]==="\uFEFF"&&(p=p.substr(1));for(let x=0;x<p.length;x++)if(p[x]==="<"&&p[x+1]==="?"){if(x+=2,x=c(p,x),x.err)return x}else{if(p[x]!=="<"){if(u(p[x]))continue;return d("InvalidChar","char '"+p[x]+"' is not expected.",w(p,x))}{let T=x;if(x++,p[x]==="!"){x=i(p,x);continue}{let O=!1;p[x]==="/"&&(O=!0,x++);let I="";for(;x<p.length&&p[x]!==">"&&p[x]!==" "&&p[x]!==" "&&p[x]!==`
3
3
  `&&p[x]!=="\r";x++)I+=p[x];if(I=I.trim(),I[I.length-1]==="/"&&(I=I.substring(0,I.length-1),x--),E=I,!n.isName(E)){let F;return F=I.trim().length===0?"Invalid space after '<'.":"Tag '"+I+"' is an invalid name.",d("InvalidTag",F,w(p,x))}const C=s(p,x);if(C===!1)return d("InvalidAttr","Attributes for '"+I+"' have open quote.",w(p,x));let P=C.value;if(x=C.index,P[P.length-1]==="/"){const F=x-P.length;P=P.substring(0,P.length-1);const S=l(P,y);if(S!==!0)return d(S.err.code,S.err.msg,w(p,F+S.err.line));N=!0}else if(O){if(!C.tagClosed)return d("InvalidTag","Closing tag '"+I+"' doesn't have proper closing.",w(p,x));if(P.trim().length>0)return d("InvalidTag","Closing tag '"+I+"' can't have attributes or invalid starting.",w(p,T));if(A.length===0)return d("InvalidTag","Closing tag '"+I+"' has not been opened.",w(p,T));{const F=A.pop();if(I!==F.tagName){let S=w(p,F.tagStartPos);return d("InvalidTag","Expected closing tag '"+F.tagName+"' (opened in line "+S.line+", col "+S.col+") instead of closing tag '"+I+"'.",w(p,T))}A.length==0&&(b=!0)}}else{const F=l(P,y);if(F!==!0)return d(F.err.code,F.err.msg,w(p,x-P.length+F.err.line));if(b===!0)return d("InvalidXml","Multiple possible root nodes found.",w(p,x));y.unpairedTags.indexOf(I)!==-1||A.push({tagName:I,tagStartPos:T}),N=!0}for(x++;x<p.length;x++)if(p[x]==="<"){if(p[x+1]==="!"){x++,x=i(p,x);continue}if(p[x+1]!=="?")break;if(x=c(p,++x),x.err)return x}else if(p[x]==="&"){const F=g(p,x);if(F==-1)return d("InvalidChar","char '&' is not expected.",w(p,x));x=F}else if(b===!0&&!u(p[x]))return d("InvalidXml","Extra text at the end",w(p,x));p[x]==="<"&&x--}}}var E;return N?A.length==1?d("InvalidTag","Unclosed tag '"+A[0].tagName+"'.",w(p,A[0].tagStartPos)):!(A.length>0)||d("InvalidXml","Invalid '"+JSON.stringify(A.map((x=>x.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):d("InvalidXml","Start tag expected.",1)};const h='"',o="'";function s(p,y){let A="",N="",b=!1;for(;y<p.length;y++){if(p[y]===h||p[y]===o)N===""?N=p[y]:N!==p[y]||(N="");else if(p[y]===">"&&N===""){b=!0;break}A+=p[y]}return N===""&&{value:A,index:y,tagClosed:b}}const f=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function l(p,y){const A=n.getAllMatches(p,f),N={};for(let b=0;b<A.length;b++){if(A[b][1].length===0)return d("InvalidAttr","Attribute '"+A[b][2]+"' has no space in starting.",v(A[b]));if(A[b][3]!==void 0&&A[b][4]===void 0)return d("InvalidAttr","Attribute '"+A[b][2]+"' is without value.",v(A[b]));if(A[b][3]===void 0&&!y.allowBooleanAttributes)return d("InvalidAttr","boolean attribute '"+A[b][2]+"' is not allowed.",v(A[b]));const E=A[b][2];if(!m(E))return d("InvalidAttr","Attribute '"+E+"' is an invalid name.",v(A[b]));if(N.hasOwnProperty(E))return d("InvalidAttr","Attribute '"+E+"' is repeated.",v(A[b]));N[E]=1}return!0}function g(p,y){if(p[++y]===";")return-1;if(p[y]==="#")return(function(N,b){let E=/\d/;for(N[b]==="x"&&(b++,E=/[\da-fA-F]/);b<N.length;b++){if(N[b]===";")return b;if(!N[b].match(E))break}return-1})(p,++y);let A=0;for(;y<p.length;y++,A++)if(!(p[y].match(/\w/)&&A<20)){if(p[y]===";")break;return-1}return y}function d(p,y,A){return{err:{code:p,msg:y,line:A.line||A,col:A.col}}}function m(p){return n.isName(p)}function w(p,y){const A=p.substring(0,y).split(/\r?\n/);return{line:A.length,col:A[A.length-1].length+1}}function v(p){return p.startIndex+p[1].length}},221:(r,e,t)=>{const n=t(87),a=t(118),u={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(s,f){return f},attributeValueProcessor:function(s,f){return f},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function c(s){this.options=Object.assign({},u,s),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=a(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=o),this.processTextOrObjNode=i,this.options.format?(this.indentate=h,this.tagEndChar=`>
4
4
  `,this.newLine=`
@@ -1,6 +1,6 @@
1
1
  import { UserApiFactory as N, UsersApiFactory as E, MeUserApiFactory as x, MeChangepasswordApiFactory as L, UserAppRoleAssignmentApiFactory as O, GroupApiFactory as z, GroupsApiFactory as W, ApplicationsApiFactory as V, DrivesApiFactory as j, MeDrivesApi as H, DrivesGetDrivesApi as Y, DriveItemApiFactory as _, DrivesRootApiFactory as R, MeDriveApiFactory as J, TagsApiFactory as Q, ActivitiesApiFactory as Z, RoleManagementApiFactory as $, DrivesPermissionsApiFactory as K, MePhotoApiFactory as X, UserPhotoApiFactory as q, Configuration as C } from "./web-client/graph/generated.js";
2
2
  import { u as v, g as I, r as ee } from "./toString-BMC5nz5v.js";
3
- import { E as ae, F as te, H as re, d as U, n as h, o as T, h as k, e as B, G as g, v as A } from "./functions-BBrAOhdi.js";
3
+ import { E as ae, F as te, H as re, d as U, n as h, o as T, h as k, e as B, G as g, v as A } from "./functions-DoaLjzWZ.js";
4
4
  const se = ({ axiosClient: e, config: s }) => {
5
5
  const o = N(s, s.basePath, e), c = E(s, s.basePath, e), i = x(s, s.basePath, e), a = L(
6
6
  s,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./graph/generated.cjs");const e=require("../index-o5kQnO1p.cjs");exports.graph=e.graph;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./graph/generated.cjs");const e=require("../index-CVRrfksL.cjs");exports.graph=e.graph;
@@ -1,5 +1,5 @@
1
1
  import "./graph/generated.js";
2
- import { g as a } from "../index-Di9dm5GN.js";
2
+ import { g as a } from "../index-VSN9x0VR.js";
3
3
  export {
4
4
  a as graph
5
5
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../index-BG-qXJDl.cjs");const r=require("../index-D_FAmyNm.cjs"),e=require("../functions-C2T1nL62.cjs");exports.webdav=r.webdav;exports.DavMethod=e.DavMethod;exports.DavPermission=e.DavPermission;exports.DavProperties=e.DavProperties;exports.DavProperty=e.DavProperty;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../index-BG-qXJDl.cjs");const r=require("../index-DOiCesBa.cjs"),e=require("../functions-D3Ol8cjk.cjs");exports.webdav=r.webdav;exports.DavMethod=e.DavMethod;exports.DavPermission=e.DavPermission;exports.DavProperties=e.DavProperties;exports.DavProperty=e.DavProperty;
@@ -1,6 +1,6 @@
1
1
  import "../index-BfIzVKrn.js";
2
- import { w as e } from "../index-GwKxs7Aj.js";
3
- import { K as t, L as p, J as v, I as i } from "../functions-BBrAOhdi.js";
2
+ import { w as e } from "../index-Cwfbs-Hh.js";
3
+ import { K as t, L as p, J as v, I as i } from "../functions-DoaLjzWZ.js";
4
4
  export {
5
5
  t as DavMethod,
6
6
  p as DavPermission,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-o5kQnO1p.cjs"),n=require("./web-client/ocs.cjs"),o=require("./index-D_FAmyNm.cjs"),e=require("./functions-C2T1nL62.cjs"),S=require("./toString-CEqk2kJI.cjs"),l=function*(a){return yield a},h=({message:a,statusCode:t,xReqId:s})=>{const c=new Response(void 0,{headers:{"x-request-id":s},status:t});return new o.HttpError(a,c,t)};class d{static Read=1;static Update=2;static Create=4;static Delete=8;static Share=16}const b=({axiosClient:a,baseURI:t})=>{const s=()=>{const c=a.defaults?.headers?.Authorization,i=a.defaults?.headers?.["Accept-Language"],u=a.defaults?.headers?.["Initiator-ID"];return{...c&&{Authorization:c.toString()},...i&&{"Accept-Language":i.toString()},...u&&{"Initiator-ID":u.toString()}}};return{graph:r.graph(t,a),ocs:n.ocs(t,a),webdav:o.webdav(t,s)}};exports.buildCollaboratorShare=r.buildCollaboratorShare;exports.buildIncomingShareResource=r.buildIncomingShareResource;exports.buildLinkShare=r.buildLinkShare;exports.buildOutgoingShareResource=r.buildOutgoingShareResource;exports.getShareResourcePermissions=r.getShareResourcePermissions;exports.getShareResourceRoles=r.getShareResourceRoles;exports.graph=r.graph;exports.isCollaboratorShare=r.isCollaboratorShare;exports.isIncomingShareResource=r.isIncomingShareResource;exports.isLinkShare=r.isLinkShare;exports.isOutgoingShareResource=r.isOutgoingShareResource;exports.isShareResource=r.isShareResource;exports.ocs=n.ocs;exports.DavHttpError=o.DavHttpError;exports.HttpError=o.HttpError;exports.encodePath=o.encodePath;exports.webdav=o.webdav;exports.GraphSharePermission=e.GraphSharePermission;exports.OCM_PROVIDER_ID=e.OCM_PROVIDER_ID;exports.SHARE_JAIL_ID=e.SHARE_JAIL_ID;exports.ShareType=e.ShareType;exports.ShareTypes=e.ShareTypes;exports.buildDeletedResource=e.buildDeletedResource;exports.buildPublicSpaceResource=e.buildPublicSpaceResource;exports.buildResource=e.buildResource;exports.buildShareSpaceResource=e.buildShareSpaceResource;exports.buildSpace=e.buildSpace;exports.buildSpaceImageResource=e.buildSpaceImageResource;exports.buildWebDavOcmPath=e.buildWebDavOcmPath;exports.buildWebDavPublicPath=e.buildWebDavPublicPath;exports.buildWebDavSpacesPath=e.buildWebDavSpacesPath;exports.buildWebDavSpacesTrashPath=e.buildWebDavSpacesTrashPath;exports.extractDomSelector=e.extractDomSelector;exports.extractExtensionFromFile=e.extractExtensionFromFile;exports.extractNameWithoutExtension=e.extractNameWithoutExtension;exports.extractNodeId=e.extractNodeId;exports.extractParentFolderName=e.extractParentFolderName;exports.extractStorageId=e.extractStorageId;exports.getRelativeSpecialFolderSpacePath=e.getRelativeSpecialFolderSpacePath;exports.getSpaceManagers=e.getSpaceManagers;exports.isManager=e.isManager;exports.isMountPointSpaceResource=e.isMountPointSpaceResource;exports.isPersonalSpaceResource=e.isPersonalSpaceResource;exports.isProjectSpaceResource=e.isProjectSpaceResource;exports.isPublicSpaceResource=e.isPublicSpaceResource;exports.isSearchResource=e.isSearchResource;exports.isShareRoot=e.isShareRoot;exports.isShareSpaceResource=e.isShareSpaceResource;exports.isSpaceResource=e.isSpaceResource;exports.isTrashResource=e.isTrashResource;exports.urlJoin=S.urlJoin;exports.SharePermissionBit=d;exports.call=l;exports.client=b;exports.createHttpError=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CVRrfksL.cjs"),n=require("./web-client/ocs.cjs"),o=require("./index-DOiCesBa.cjs"),e=require("./functions-D3Ol8cjk.cjs"),S=require("./toString-CEqk2kJI.cjs"),l=function*(a){return yield a},h=({message:a,statusCode:t,xReqId:s})=>{const c=new Response(void 0,{headers:{"x-request-id":s},status:t});return new o.HttpError(a,c,t)};class d{static Read=1;static Update=2;static Create=4;static Delete=8;static Share=16}const b=({axiosClient:a,baseURI:t})=>{const s=()=>{const c=a.defaults?.headers?.Authorization,i=a.defaults?.headers?.["Accept-Language"],u=a.defaults?.headers?.["Initiator-ID"];return{...c&&{Authorization:c.toString()},...i&&{"Accept-Language":i.toString()},...u&&{"Initiator-ID":u.toString()}}};return{graph:r.graph(t,a),ocs:n.ocs(t,a),webdav:o.webdav(t,s)}};exports.buildCollaboratorShare=r.buildCollaboratorShare;exports.buildIncomingShareResource=r.buildIncomingShareResource;exports.buildLinkShare=r.buildLinkShare;exports.buildOutgoingShareResource=r.buildOutgoingShareResource;exports.getShareResourcePermissions=r.getShareResourcePermissions;exports.getShareResourceRoles=r.getShareResourceRoles;exports.graph=r.graph;exports.isCollaboratorShare=r.isCollaboratorShare;exports.isIncomingShareResource=r.isIncomingShareResource;exports.isLinkShare=r.isLinkShare;exports.isOutgoingShareResource=r.isOutgoingShareResource;exports.isShareResource=r.isShareResource;exports.ocs=n.ocs;exports.DavHttpError=o.DavHttpError;exports.HttpError=o.HttpError;exports.encodePath=o.encodePath;exports.webdav=o.webdav;exports.GraphSharePermission=e.GraphSharePermission;exports.OCM_PROVIDER_ID=e.OCM_PROVIDER_ID;exports.SHARE_JAIL_ID=e.SHARE_JAIL_ID;exports.ShareType=e.ShareType;exports.ShareTypes=e.ShareTypes;exports.buildDeletedResource=e.buildDeletedResource;exports.buildPublicSpaceResource=e.buildPublicSpaceResource;exports.buildResource=e.buildResource;exports.buildShareSpaceResource=e.buildShareSpaceResource;exports.buildSpace=e.buildSpace;exports.buildSpaceImageResource=e.buildSpaceImageResource;exports.buildWebDavOcmPath=e.buildWebDavOcmPath;exports.buildWebDavPublicPath=e.buildWebDavPublicPath;exports.buildWebDavSpacesPath=e.buildWebDavSpacesPath;exports.buildWebDavSpacesTrashPath=e.buildWebDavSpacesTrashPath;exports.extractDomSelector=e.extractDomSelector;exports.extractExtensionFromFile=e.extractExtensionFromFile;exports.extractNameWithoutExtension=e.extractNameWithoutExtension;exports.extractNodeId=e.extractNodeId;exports.extractParentFolderName=e.extractParentFolderName;exports.extractStorageId=e.extractStorageId;exports.getRelativeSpecialFolderSpacePath=e.getRelativeSpecialFolderSpacePath;exports.getSpaceManagers=e.getSpaceManagers;exports.isManager=e.isManager;exports.isMountPointSpaceResource=e.isMountPointSpaceResource;exports.isPersonalSpaceResource=e.isPersonalSpaceResource;exports.isProjectSpaceResource=e.isProjectSpaceResource;exports.isPublicSpaceResource=e.isPublicSpaceResource;exports.isSearchResource=e.isSearchResource;exports.isShareRoot=e.isShareRoot;exports.isShareSpaceResource=e.isShareSpaceResource;exports.isSpaceResource=e.isSpaceResource;exports.isTrashResource=e.isTrashResource;exports.urlJoin=S.urlJoin;exports.SharePermissionBit=d;exports.call=l;exports.client=b;exports.createHttpError=h;
@@ -1,9 +1,9 @@
1
- import { g as c } from "./index-Di9dm5GN.js";
2
- import { k as P, h as D, l as f, j as I, f as v, e as x, c as H, b as w, d as A, a as E, i as O } from "./index-Di9dm5GN.js";
1
+ import { g as c } from "./index-VSN9x0VR.js";
2
+ import { k as P, h as D, l as f, j as I, f as v, e as x, c as H, b as w, d as A, a as E, i as O } from "./index-VSN9x0VR.js";
3
3
  import { ocs as i } from "./web-client/ocs.js";
4
- import { H as u, w as n } from "./index-GwKxs7Aj.js";
5
- import { D as W, e as k } from "./index-GwKxs7Aj.js";
6
- import { G as F, O as M, x as T, S as _, n as j, m as z, t as N, l as q, u as B, v as G, w as J, a as V, b as C, o as K, p as Q, e as X, h as Y, g as Z, f as $, j as U, d as ee, q as ae, s as se, r as re, C as te, z as oe, A as ce, D as ie, c as ue, k as ne, B as Se, y as de, i as he } from "./functions-BBrAOhdi.js";
4
+ import { H as u, w as n } from "./index-Cwfbs-Hh.js";
5
+ import { D as W, e as k } from "./index-Cwfbs-Hh.js";
6
+ import { G as F, O as M, x as T, S as _, n as j, m as z, t as N, l as q, u as B, v as G, w as J, a as V, b as C, o as K, p as Q, e as X, h as Y, g as Z, f as $, j as U, d as ee, q as ae, s as se, r as re, C as te, z as oe, A as ce, D as ie, c as ue, k as ne, B as Se, y as de, i as he } from "./functions-DoaLjzWZ.js";
7
7
  import { u as pe } from "./toString-BMC5nz5v.js";
8
8
  const l = function* (e) {
9
9
  return yield e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencloud-eu/web-client",
3
- "version": "4.3.0",
3
+ "version": "5.0.0-alpha.1",
4
4
  "description": "OpenCloud web client",
5
5
  "license": "AGPL-3.0",
6
6
  "private": false,
@@ -1 +0,0 @@
1
- "use strict";const b=require("./toString-CEqk2kJI.cjs"),Ie=require("./index-sTep8AuK.cjs");function K(e,r=""){return`/public-files/${e}/${r}`.split("/").filter(Boolean).join("/")}function Y(e,r=""){return`/ocm/${e}/${r}`.split("/").filter(Boolean).join("/")}var U,z;function we(){if(z)return U;z=1;function e(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function r(s,t){for(var i="",c=0,d=-1,o=0,u,f=0;f<=s.length;++f){if(f<s.length)u=s.charCodeAt(f);else{if(u===47)break;u=47}if(u===47){if(!(d===f-1||o===1))if(d!==f-1&&o===2){if(i.length<2||c!==2||i.charCodeAt(i.length-1)!==46||i.charCodeAt(i.length-2)!==46){if(i.length>2){var p=i.lastIndexOf("/");if(p!==i.length-1){p===-1?(i="",c=0):(i=i.slice(0,p),c=i.length-1-i.lastIndexOf("/")),d=f,o=0;continue}}else if(i.length===2||i.length===1){i="",c=0,d=f,o=0;continue}}t&&(i.length>0?i+="/..":i="..",c=2)}else i.length>0?i+="/"+s.slice(d+1,f):i=s.slice(d+1,f),c=f-d-1;d=f,o=0}else u===46&&o!==-1?++o:o=-1}return i}function n(s,t){var i=t.dir||t.root,c=t.base||(t.name||"")+(t.ext||"");return i?i===t.root?i+c:i+s+c:c}var l={resolve:function(){for(var t="",i=!1,c,d=arguments.length-1;d>=-1&&!i;d--){var o;d>=0?o=arguments[d]:(c===void 0&&(c=Ie.process$1.cwd()),o=c),e(o),o.length!==0&&(t=o+"/"+t,i=o.charCodeAt(0)===47)}return t=r(t,!i),i?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(e(t),t.length===0)return".";var i=t.charCodeAt(0)===47,c=t.charCodeAt(t.length-1)===47;return t=r(t,!i),t.length===0&&!i&&(t="."),t.length>0&&c&&(t+="/"),i?"/"+t:t},isAbsolute:function(t){return e(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,i=0;i<arguments.length;++i){var c=arguments[i];e(c),c.length>0&&(t===void 0?t=c:t+="/"+c)}return t===void 0?".":l.normalize(t)},relative:function(t,i){if(e(t),e(i),t===i||(t=l.resolve(t),i=l.resolve(i),t===i))return"";for(var c=1;c<t.length&&t.charCodeAt(c)===47;++c);for(var d=t.length,o=d-c,u=1;u<i.length&&i.charCodeAt(u)===47;++u);for(var f=i.length,p=f-u,v=o<p?o:p,g=-1,h=0;h<=v;++h){if(h===v){if(p>v){if(i.charCodeAt(u+h)===47)return i.slice(u+h+1);if(h===0)return i.slice(u+h)}else o>v&&(t.charCodeAt(c+h)===47?g=h:h===0&&(g=0));break}var j=t.charCodeAt(c+h),De=i.charCodeAt(u+h);if(j!==De)break;j===47&&(g=h)}var S="";for(h=c+g+1;h<=d;++h)(h===d||t.charCodeAt(h)===47)&&(S.length===0?S+="..":S+="/..");return S.length>0?S+i.slice(u+g):(u+=g,i.charCodeAt(u)===47&&++u,i.slice(u))},_makeLong:function(t){return t},dirname:function(t){if(e(t),t.length===0)return".";for(var i=t.charCodeAt(0),c=i===47,d=-1,o=!0,u=t.length-1;u>=1;--u)if(i=t.charCodeAt(u),i===47){if(!o){d=u;break}}else o=!1;return d===-1?c?"/":".":c&&d===1?"//":t.slice(0,d)},basename:function(t,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');e(t);var c=0,d=-1,o=!0,u;if(i!==void 0&&i.length>0&&i.length<=t.length){if(i.length===t.length&&i===t)return"";var f=i.length-1,p=-1;for(u=t.length-1;u>=0;--u){var v=t.charCodeAt(u);if(v===47){if(!o){c=u+1;break}}else p===-1&&(o=!1,p=u+1),f>=0&&(v===i.charCodeAt(f)?--f===-1&&(d=u):(f=-1,d=p))}return c===d?d=p:d===-1&&(d=t.length),t.slice(c,d)}else{for(u=t.length-1;u>=0;--u)if(t.charCodeAt(u)===47){if(!o){c=u+1;break}}else d===-1&&(o=!1,d=u+1);return d===-1?"":t.slice(c,d)}},extname:function(t){e(t);for(var i=-1,c=0,d=-1,o=!0,u=0,f=t.length-1;f>=0;--f){var p=t.charCodeAt(f);if(p===47){if(!o){c=f+1;break}continue}d===-1&&(o=!1,d=f+1),p===46?i===-1?i=f:u!==1&&(u=1):i!==-1&&(u=-1)}return i===-1||d===-1||u===0||u===1&&i===d-1&&i===c+1?"":t.slice(i,d)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return n("/",t)},parse:function(t){e(t);var i={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return i;var c=t.charCodeAt(0),d=c===47,o;d?(i.root="/",o=1):o=0;for(var u=-1,f=0,p=-1,v=!0,g=t.length-1,h=0;g>=o;--g){if(c=t.charCodeAt(g),c===47){if(!v){f=g+1;break}continue}p===-1&&(v=!1,p=g+1),c===46?u===-1?u=g:h!==1&&(h=1):u!==-1&&(h=-1)}return u===-1||p===-1||h===0||h===1&&u===p-1&&u===f+1?p!==-1&&(f===0&&d?i.base=i.name=t.slice(1,p):i.base=i.name=t.slice(f,p)):(f===0&&d?(i.name=t.slice(1,u),i.base=t.slice(1,p)):(i.name=t.slice(f,u),i.base=t.slice(f,p)),i.ext=t.slice(u,p)),f>0?i.dir=t.slice(0,f-1):d&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};return l.posix=l,U=l,U}var T=we();const W=b.getDefaultExportFromCjs(T);class y{static Shared="S";static Shareable="R";static Mounted="M";static Deletable="D";static Renameable="N";static Moveable="V";static Updateable="NV";static FileUpdateable="W";static FolderCreateable="CK";static Deny="Z";static SecureView="X"}var Q=(e=>(e.copy="COPY",e.delete="DELETE",e.lock="LOCK",e.mkcol="MKCOL",e.move="MOVE",e.propfind="PROPFIND",e.proppatch="PROPPATCH",e.put="PUT",e.report="REPORT",e.unlock="UNLOCK",e))(Q||{});const A=e=>({value:e,type:null}),Le=e=>A(e),m=e=>A(e),w=e=>A(e),ke=e=>A(e),Te={Permissions:m("permissions"),IsFavorite:w("favorite"),FileId:m("fileid"),FileParent:m("file-parent"),Name:m("name"),OwnerId:m("owner-id"),OwnerDisplayName:m("owner-display-name"),PrivateLink:m("privatelink"),ContentLength:w("getcontentlength"),ContentSize:w("size"),LastModifiedDate:m("getlastmodified"),Tags:Le("tags"),Audio:{value:"audio",type:null},Location:{value:"location",type:null},Image:{value:"image",type:null},Photo:{value:"photo",type:null},ETag:m("getetag"),MimeType:m("getcontenttype"),ResourceType:ke("resourcetype"),LockDiscovery:{value:"lockdiscovery",type:null},LockOwner:m("owner"),LockTime:m("locktime"),ActiveLock:{value:"activelock",type:null},DownloadURL:m("downloadURL"),Highlights:m("highlights"),MetaPathForUser:m("meta-path-for-user"),RemoteItemId:m("remote-item-id"),HasPreview:w("has-preview"),ShareId:m("shareid"),ShareRoot:m("shareroot"),ShareTypes:{value:"share-types",type:null},SharePermissions:m("share-permissions"),TrashbinOriginalFilename:m("trashbin-original-filename"),TrashbinOriginalLocation:m("trashbin-original-location"),TrashbinDeletedDate:m("trashbin-delete-datetime"),PublicLinkItemType:m("public-link-item-type"),PublicLinkPermission:m("public-link-permission"),PublicLinkExpiration:m("public-link-expiration"),PublicLinkShareDate:m("public-link-share-datetime"),PublicLinkShareOwner:m("public-link-share-owner")},a=Object.fromEntries(Object.entries(Te).map(([e,r])=>[e,r.value]));class M{static Default=[a.Permissions,a.IsFavorite,a.FileId,a.FileParent,a.Name,a.LockDiscovery,a.ActiveLock,a.OwnerId,a.OwnerDisplayName,a.RemoteItemId,a.ShareRoot,a.ShareTypes,a.PrivateLink,a.ContentLength,a.ContentSize,a.LastModifiedDate,a.ETag,a.MimeType,a.ResourceType,a.Tags,a.Audio,a.Location,a.Image,a.Photo,a.HasPreview];static PublicLink=M.Default.concat([a.PublicLinkItemType,a.PublicLinkPermission,a.PublicLinkExpiration,a.PublicLinkShareDate,a.PublicLinkShareOwner]);static Trashbin=[a.ContentLength,a.ResourceType,a.TrashbinOriginalLocation,a.TrashbinOriginalFilename,a.TrashbinDeletedDate,a.Permissions,a.FileParent];static DavNamespace=[a.ContentLength,a.LastModifiedDate,a.ETag,a.MimeType,a.ResourceType,a.LockDiscovery,a.ActiveLock]}function X(e){return e}function Ae(e,r,n){switch(n.length){case 0:return e.call(r);case 1:return e.call(r,n[0]);case 2:return e.call(r,n[0],n[1]);case 3:return e.call(r,n[0],n[1],n[2])}return e.apply(r,n)}var Ce=800,Oe=16,Ue=Date.now;function Ee(e){var r=0,n=0;return function(){var l=Ue(),s=Oe-(l-n);if(n=l,s>0){if(++r>=Ce)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}function Fe(e){return function(){return e}}var H=(function(){try{var e=b.getNative(Object,"defineProperty");return e({},"",{}),e}catch{}})(),_e=H?function(e,r){return H(e,"toString",{configurable:!0,enumerable:!1,value:Fe(r),writable:!0})}:X,Me=Ee(_e);function $e(e,r,n,l){for(var s=e.length,t=n+-1;++t<s;)if(r(e[t],t,e))return t;return-1}function Ne(e){return e!==e}function je(e,r,n){for(var l=n-1,s=e.length;++l<s;)if(e[l]===r)return l;return-1}function ze(e,r,n){return r===r?je(e,r,n):$e(e,Ne,n)}function G(e,r){var n=e==null?0:e.length;return!!n&&ze(e,r,0)>-1}var V=Math.max;function We(e,r,n){return r=V(r===void 0?e.length-1:r,0),function(){for(var l=arguments,s=-1,t=V(l.length-r,0),i=Array(t);++s<t;)i[s]=l[r+s];s=-1;for(var c=Array(r+1);++s<r;)c[s]=l[s];return c[r]=n(i),Ae(e,this,c)}}function He(e,r){return Me(We(e,r,X),e+"")}var Ve=9007199254740991;function Je(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ve}function Be(e){return e!=null&&Je(e.length)&&!b.isFunction(e)}function Ze(e,r,n){var l=-1,s=e.length;r<0&&(r=-r>s?0:s+r),n=n>s?s:n,n<0&&(n+=s),s=r>n?0:n-r>>>0,r>>>=0;for(var t=Array(s);++l<s;)t[l]=e[l+r];return t}function qe(e,r,n){var l=e.length;return n=n===void 0?l:n,!r&&n>=l?e:Ze(e,r,n)}var Ke="\\ud800-\\udfff",Ye="\\u0300-\\u036f",Qe="\\ufe20-\\ufe2f",Xe="\\u20d0-\\u20ff",Ge=Ye+Qe+Xe,er="\\ufe0e\\ufe0f",rr="\\u200d",tr=RegExp("["+rr+Ke+Ge+er+"]");function ee(e){return tr.test(e)}function ir(e){return e.split("")}var re="\\ud800-\\udfff",nr="\\u0300-\\u036f",sr="\\ufe20-\\ufe2f",ar="\\u20d0-\\u20ff",or=nr+sr+ar,ur="\\ufe0e\\ufe0f",lr="["+re+"]",E="["+or+"]",F="\\ud83c[\\udffb-\\udfff]",cr="(?:"+E+"|"+F+")",te="[^"+re+"]",ie="(?:\\ud83c[\\udde6-\\uddff]){2}",ne="[\\ud800-\\udbff][\\udc00-\\udfff]",dr="\\u200d",se=cr+"?",ae="["+ur+"]?",fr="(?:"+dr+"(?:"+[te,ie,ne].join("|")+")"+ae+se+")*",pr=ae+se+fr,hr="(?:"+[te+E+"?",E,ie,ne,lr].join("|")+")",mr=RegExp(F+"(?="+F+")|"+hr+pr,"g");function gr(e){return e.match(mr)||[]}function br(e){return ee(e)?gr(e):ir(e)}function vr(e){return function(r){r=b.toString(r);var n=ee(r)?br(r):void 0,l=n?n[0]:r.charAt(0),s=n?qe(n,1).join(""):r.slice(1);return l[e]()+s}}var xr=vr("toUpperCase");function yr(e){return xr(b.toString(e).toLowerCase())}function Pr(e,r,n,l){for(var s=-1,t=e==null?0:e.length;++s<t;)n=r(n,e[s],s,e);return n}function Rr(e){return function(r){return e?.[r]}}var Sr={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Dr=Rr(Sr),Ir=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wr="\\u0300-\\u036f",Lr="\\ufe20-\\ufe2f",kr="\\u20d0-\\u20ff",Tr=wr+Lr+kr,Ar="["+Tr+"]",Cr=RegExp(Ar,"g");function Or(e){return e=b.toString(e),e&&e.replace(Ir,Dr).replace(Cr,"")}var Ur=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Er(e){return e.match(Ur)||[]}var Fr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function _r(e){return Fr.test(e)}var oe="\\ud800-\\udfff",Mr="\\u0300-\\u036f",$r="\\ufe20-\\ufe2f",Nr="\\u20d0-\\u20ff",jr=Mr+$r+Nr,ue="\\u2700-\\u27bf",le="a-z\\xdf-\\xf6\\xf8-\\xff",zr="\\xac\\xb1\\xd7\\xf7",Wr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Hr="\\u2000-\\u206f",Vr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ce="A-Z\\xc0-\\xd6\\xd8-\\xde",Jr="\\ufe0e\\ufe0f",de=zr+Wr+Hr+Vr,fe="['’]",J="["+de+"]",Br="["+jr+"]",pe="\\d+",Zr="["+ue+"]",he="["+le+"]",me="[^"+oe+de+pe+ue+le+ce+"]",qr="\\ud83c[\\udffb-\\udfff]",Kr="(?:"+Br+"|"+qr+")",Yr="[^"+oe+"]",ge="(?:\\ud83c[\\udde6-\\uddff]){2}",be="[\\ud800-\\udbff][\\udc00-\\udfff]",P="["+ce+"]",Qr="\\u200d",B="(?:"+he+"|"+me+")",Xr="(?:"+P+"|"+me+")",Z="(?:"+fe+"(?:d|ll|m|re|s|t|ve))?",q="(?:"+fe+"(?:D|LL|M|RE|S|T|VE))?",ve=Kr+"?",xe="["+Jr+"]?",Gr="(?:"+Qr+"(?:"+[Yr,ge,be].join("|")+")"+xe+ve+")*",et="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",rt="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",tt=xe+ve+Gr,it="(?:"+[Zr,ge,be].join("|")+")"+tt,nt=RegExp([P+"?"+he+"+"+Z+"(?="+[J,P,"$"].join("|")+")",Xr+"+"+q+"(?="+[J,P+B,"$"].join("|")+")",P+"?"+B+"+"+Z,P+"+"+q,rt,et,pe,it].join("|"),"g");function st(e){return e.match(nt)||[]}function at(e,r,n){return e=b.toString(e),r=r,r===void 0?_r(e)?st(e):Er(e):e.match(r)||[]}var ot="['’]",ut=RegExp(ot,"g");function lt(e){return function(r){return Pr(at(Or(r).replace(ut,"")),e,"")}}var ct=lt(function(e,r,n){return r=r.toLowerCase(),e+(n?yr(r):r)}),dt="__lodash_hash_undefined__";function ft(e){return this.__data__.set(e,dt),this}function pt(e){return this.__data__.has(e)}function I(e){var r=-1,n=e==null?0:e.length;for(this.__data__=new b.MapCache;++r<n;)this.add(e[r])}I.prototype.add=I.prototype.push=ft;I.prototype.has=pt;function _(e,r){return e.has(r)}function ht(e){return b.isObjectLike(e)&&Be(e)}var mt=Math.min;function gt(e,r,n){for(var l=G,s=e[0].length,t=e.length,i=t,c=Array(t),d=1/0,o=[];i--;){var u=e[i];d=mt(u.length,d),c[i]=s>=120&&u.length>=120?new I(i&&u):void 0}u=e[0];var f=-1,p=c[0];e:for(;++f<s&&o.length<d;){var v=u[f],g=v;if(v=v!==0?v:0,!(p?_(p,g):l(o,g))){for(i=t;--i;){var h=c[i];if(!(h?_(h,g):l(e[i],g)))continue e}p&&p.push(g),o.push(v)}}return o}function bt(e){return ht(e)?e:[]}var vt=He(function(e){var r=b.arrayMap(e,bt);return r.length&&r[0]===e[0]?gt(r):[]});const xt={complex:["tar.bz2","tar.gz","tar.xz"]},yt=e=>Object.hasOwn(e,"ddate"),Pt=e=>Object.hasOwn(e,"highlights"),C=e=>e.replace(/[^A-Za-z0-9\-_]/g,""),ye=(e,r)=>!e||typeof e!="string"?"":e.indexOf("!")>=0?e.split("!")[r]:"",Pe=e=>ye(e,0),$=e=>ye(e,1),Rt=e=>{const r=e.extension||"",n=e.name||"";if(!r.length)return n;const l=n.lastIndexOf(`.${r}`);return n.substring(0,l)},O=e=>{const r=e.name;if(e.type==="directory"||e.isFolder)return"";const n=r.split(".");if(n.length>2)for(let l=0;l<n.length;l++){const s=n.slice(l,n.length).join(".");if(xt.complex.includes(s))return s}return n.length<2?"":n[n.length-1]},St=e=>T.basename(T.dirname(e.path))||null,Dt=e=>typeof e.isShareRoot=="function"&&e.isShareRoot(),L=e=>{if(!e)return e;const r={};return Object.keys(e).forEach(n=>{r[ct(n)]=e[n]}),r};function It(e,r=[]){const n=e.props[a.Name]?.toString()||T.basename(e.filename),l=e.props[a.FileId],s=e.type==="directory";let t;e.filename.startsWith("/files")||e.filename.startsWith("/space")?t=e.filename.split("/").slice(3).join("/"):t=e.filename,t.startsWith("/")||(t=`/${t}`);const i=O({...e,name:n}),c=e.props[a.LockDiscovery];let d,o,u;c&&(d=c[a.ActiveLock],o=d[a.LockOwner],u=d[a.LockTime]);let f=[];e.props[a.ShareTypes]&&(f=e.props[a.ShareTypes]["share-type"],Array.isArray(f)||(f=[f]));const p={};for(const g of r||[]){const h=g.split(":").pop();e.props[h]&&(p[g]=e.props[h])}const v={id:l,fileId:l,storageId:Pe(l),parentFolderId:e.props[a.FileParent],mimeType:e.props[a.MimeType],name:n,extension:s?"":i,path:t,webDavPath:e.filename,type:s?"folder":e.type,isFolder:s,locked:!!d,lockOwner:o,lockTime:u,processing:e.processing||!1,mdate:e.props[a.LastModifiedDate],size:s?e.props[a.ContentSize]?.toString()||"0":e.props[a.ContentLength]?.toString()||"0",permissions:e.props[a.Permissions]||"",starred:e.props[a.IsFavorite]!==0,etag:e.props[a.ETag],shareTypes:f,privateLink:e.props[a.PrivateLink],downloadURL:e.props[a.DownloadURL],remoteItemId:e.props[a.RemoteItemId],remoteItemPath:e.props[a.ShareRoot],owner:{id:e.props[a.OwnerId],displayName:e.props[a.OwnerDisplayName]},tags:(e.props[a.Tags]||"").toString().split(",").filter(Boolean),audio:L(e.props[a.Audio]),location:L(e.props[a.Location]),image:L(e.props[a.Image]),photo:L(e.props[a.Photo]),extraProps:p,hasPreview:()=>e.props[a.HasPreview]===1,canUpload:function(){return this.permissions.indexOf(y.FolderCreateable)>=0},canDownload:function(){return this.permissions.indexOf(y.SecureView)===-1},canBeDeleted:function(){return this.permissions.indexOf(y.Deletable)>=0},canRename:function(){return this.permissions.indexOf(y.Renameable)>=0},canShare:function({ability:g}){return g.can("create-all","Share")&&this.permissions.indexOf(y.Shareable)>=0},canCreate:function(){return this.permissions.indexOf(y.FolderCreateable)>=0},canEditTags:function(){return this.permissions.indexOf(y.Updateable)>=0||this.permissions.indexOf(y.FileUpdateable)>=0||this.permissions.indexOf(y.FolderCreateable)>=0},isMounted:function(){return this.permissions.indexOf(y.Mounted)>=0},isReceivedShare:function(){return this.permissions.indexOf(y.Shared)>=0},isShareRoot(){return e.props[a.ShareRoot]?e.filename.split("/").length===3:!1},getDomSelector:()=>C(l)};return Object.defineProperty(v,"nodeId",{get(){return $(this.id)}}),v}function wt(e){const r=e.type==="directory",n=e.props[a.TrashbinOriginalFilename]?.toString(),l=O({name:n,type:e.type}),s=W.basename(e.filename);return{type:r?"folder":e.type,isFolder:r,ddate:e.props[a.TrashbinDeletedDate],name:W.basename(n),extension:l,path:b.urlJoin(e.props[a.TrashbinOriginalLocation],{leadingSlash:!0}),id:s,parentFolderId:e.props[a.FileParent],webDavPath:"",canUpload:()=>!1,canDownload:()=>!1,canBeDeleted:()=>!0,canBeRestored:function(){return!0},canRename:()=>!1,canShare:()=>!1,canCreate:()=>!1,isMounted:()=>!1,isReceivedShare:()=>!1,hasPreview:()=>!1,getDomSelector:()=>C(s)}}var x=(e=>(e.createUpload="libre.graph/driveItem/upload/create",e.createPermissions="libre.graph/driveItem/permissions/create",e.createChildren="libre.graph/driveItem/children/create",e.readBasic="libre.graph/driveItem/basic/read",e.readPath="libre.graph/driveItem/path/read",e.readQuota="libre.graph/driveItem/quota/read",e.readContent="libre.graph/driveItem/content/read",e.readChildren="libre.graph/driveItem/children/read",e.readDeleted="libre.graph/driveItem/deleted/read",e.readPermissions="libre.graph/driveItem/permissions/read",e.readVersions="libre.graph/driveItem/versions/read",e.updatePath="libre.graph/driveItem/path/update",e.updateDeleted="libre.graph/driveItem/deleted/update",e.updatePermissions="libre.graph/driveItem/permissions/update",e.updateVersions="libre.graph/driveItem/versions/update",e.deleteStandard="libre.graph/driveItem/standard/delete",e.deleteDeleted="libre.graph/driveItem/deleted/delete",e.deletePermissions="libre.graph/driveItem/permissions/delete",e))(x||{});const D=e=>e;class R{_key;_value;_label;_icon;constructor(r,n,l,s){this._key=r,this._value=n,this._label=l,this._icon=s}get key(){return this._key}get value(){return this._value}get label(){return this._label}get icon(){return this._icon}}class Lt{static user=new R("user",0,D("User"),"user");static group=new R("group",1,D("Group"),"group");static link=new R("link",3,D("Link"),"link");static guest=new R("guest",4,D("Guest"),"global");static remote=new R("remote",6,D("External"),"earth");static individuals=[this.user,this.guest,this.remote];static collectives=[this.group];static unauthenticated=[this.link];static authenticated=[this.user,this.group,this.guest,this.remote];static all=[this.user,this.group,this.link,this.guest,this.remote];static isIndividual(r){return this.individuals.includes(r)}static isCollective(r){return this.collectives.includes(r)}static isUnauthenticated(r){return this.unauthenticated.includes(r)}static isAuthenticated(r){return this.authenticated.includes(r)}static getByValue(r){return this.all.find(n=>n.value===r)}static getByValues(r){return r.map(n=>this.getByValue(n))}static getByKeys(r){return r.map(n=>this.all.find(l=>l.key===n))}static getValues(r){return r.map(n=>n.value)}static containsAnyValue(r,n){return vt(this.getValues(r),n).length>0}}const kt="a0ca6a90-a365-4782-871e-d44447bbc668",Tt="89f37a33-858b-45fa-8890-a1f2b27d90e1",At=e=>e?.type==="space",k=e=>e?.driveType==="personal",Ct=e=>e?.driveType==="project",Ot=e=>e?.driveType==="share",Ut=e=>e?.driveType==="mountpoint",Et=e=>e?.driveType==="public";function Re(e,r){return b.urlJoin("spaces",e,r,{leadingSlash:!0})}function Se(e,r=""){return b.urlJoin("spaces","trash-bin",e,r,{leadingSlash:!0})}function Ft(e,r){const l=e[{image:"spaceImageData",readme:"spaceReadmeData"}[r]];if(!l)return"";const s=decodeURI(l.webDavUrl).split("/"),t=s.find(i=>i.startsWith(e.id));return t?s.slice(s.indexOf(t)+1).join("/"):""}function _t(e){return e.permissions.includes(x.deletePermissions)}const Mt=(e,r)=>e.root.permissions?.filter(n=>{let l=[];n["@libre.graph.permissions.actions"]&&(l=n["@libre.graph.permissions.actions"]);const s=r[n.roles?.[0]];return s&&!l.length&&(l=s.rolePermissions.find(({condition:i})=>i==="exists @Resource.Root")?.allowedResourceActions||[]),l.includes(x.deletePermissions)});function $t(e){const r=e.publicLinkPassword,n=e.props?.[a.FileId],l=e.props?.[a.PublicLinkItemType],s=e.props?.[a.PublicLinkPermission],t=e.props?.[a.PublicLinkExpiration],i=e.props?.[a.PublicLinkShareDate],c=e.props?.[a.PublicLinkShareOwner],d=e.publicLinkType;let o,u;return d==="ocm"?(o=`ocm/${e.id}`,u=Y(e.id)):(o=`public/${e.id}`,u=K(e.id)),Object.assign(N({...e,driveType:"public",driveAlias:o,webDavPath:u}),{...n&&{fileId:n},...r&&{publicLinkPassword:r},...l&&{publicLinkItemType:l},...s&&{publicLinkPermission:parseInt(s)},...t&&{publicLinkExpiration:t},...i&&{publicLinkShareDate:i},...c&&{publicLinkShareOwner:c},publicLinkType:d})}function Nt({driveAliasPrefix:e,id:r,shareName:n,serverUrl:l}){const s=N({id:r,driveAlias:`${e}/${n}`,driveType:"share",name:n,serverUrl:l});return s.rename=t=>{s.driveAlias=`${e}/${t}`,s.name=t},s}function N(e){let r,n;e.special&&(r=e.special.find(o=>o.specialFolder.name==="image"),n=e.special.find(o=>o.specialFolder.name==="readme"),r&&(r.webDavUrl=decodeURI(r.webDavUrl)),n&&(n.webDavUrl=decodeURI(n.webDavUrl)));const l=e.root?.deleted?.state==="trashed",s=b.urlJoin(e.webDavPath||Re(e.id),{leadingSlash:!0}),t=b.urlJoin(e.serverUrl,"remote.php/dav",s),i=b.urlJoin(e.webDavTrashPath||Se(e.id),{leadingSlash:!0}),c=b.urlJoin(e.serverUrl,"remote.php/dav",i),d={id:e.id,fileId:e.id,storageId:e.id,mimeType:"",name:e.name,description:e.description,extension:"",path:"/",webDavPath:s,webDavTrashPath:i,driveAlias:e.driveAlias,driveType:e.driveType,type:"space",isFolder:!0,mdate:e.lastModifiedDateTime,size:e.quota?.used||0,tags:[],permissions:"",starred:!1,etag:"",shareTypes:[],privateLink:e.webUrl,downloadURL:"",owner:e.owner?.user,disabled:l,root:e.root,spaceQuota:e.quota,spaceImageData:r,spaceReadmeData:n,hasTrashedItems:e["@libre.graph.hasTrashedItems"]||!1,graphPermissions:void 0,canUpload:function({user:o}={}){return k(this)&&this.isOwner(o)?!0:this.graphPermissions?.includes(x.createUpload)},canDownload:function(){return!0},canBeDeleted:function({ability:o}={}){return this.disabled?o?.can("delete-all","Drive")?!0:this.graphPermissions?.includes(x.deletePermissions):!1},canRename:function({ability:o}={}){return o?.can("update-all","Drive")?!0:this.graphPermissions?.includes(x.deletePermissions)},canEditDescription:function({ability:o}={}){return o?.can("update-all","Drive")?!0:this.graphPermissions?.includes(x.deletePermissions)},canRestore:function({ability:o}={}){return this.disabled?o?.can("update-all","Drive")?!0:this.graphPermissions?.includes(x.deletePermissions):!1},canDisable:function({ability:o}={}){return this.disabled?!1:o?.can("delete-all","Drive")?!0:this.graphPermissions?.includes(x.deletePermissions)},canShare:function(){return this.graphPermissions?.includes(x.createPermissions)},canEditImage:function(){return this.disabled?!1:this.graphPermissions?.includes(x.deletePermissions)},canEditReadme:function(){return this.disabled?!1:this.graphPermissions?.includes(x.deletePermissions)},canRestoreFromTrashbin:function(){return this.graphPermissions?.includes(x.updateDeleted)},canDeleteFromTrashBin:function({user:o}={}){return k(this)&&this.isOwner(o)?!0:this.graphPermissions?.includes(x.deletePermissions)},canListVersions:function({user:o}={}){return k(this)&&this.isOwner(o)?!0:this.graphPermissions?.includes(x.readVersions)},canCreate:function(){return!0},canEditTags:function(){return!1},isMounted:function(){return!0},isReceivedShare:function(){return!1},isShareRoot:function(){return["share","mountpoint","public"].includes(e.driveType)},getDomSelector:()=>C(e.id),getDriveAliasAndItem({path:o}){return b.urlJoin(this.driveAlias,o,{leadingSlash:!1})},getWebDavUrl({path:o}){return b.urlJoin(t,o)},getWebDavTrashUrl({path:o}){return b.urlJoin(c,o)},isOwner(o){return o?.id===this.owner?.id}};return Object.defineProperty(d,"nodeId",{get(){return $(this.id)}}),d}function jt(e){return{id:e.spaceImageData.id,name:e.spaceImageData.name,etag:e.spaceImageData.eTag,extension:O({name:e.spaceImageData.name}),mimeType:e.spaceImageData.file.mimeType,type:"file",webDavPath:b.urlJoin(e.webDavPath,".space",e.spaceImageData.name),hasPreview:()=>!0,canDownload:()=>!0}}exports.DavMethod=Q;exports.DavPermission=y;exports.DavProperties=M;exports.DavProperty=a;exports.GraphSharePermission=x;exports.OCM_PROVIDER_ID=Tt;exports.SHARE_JAIL_ID=kt;exports.SetCache=I;exports.ShareType=R;exports.ShareTypes=Lt;exports.arrayIncludes=G;exports.buildDeletedResource=wt;exports.buildPublicSpaceResource=$t;exports.buildResource=It;exports.buildShareSpaceResource=Nt;exports.buildSpace=N;exports.buildSpaceImageResource=jt;exports.buildWebDavOcmPath=Y;exports.buildWebDavPublicPath=K;exports.buildWebDavSpacesPath=Re;exports.buildWebDavSpacesTrashPath=Se;exports.cacheHas=_;exports.extractDomSelector=C;exports.extractExtensionFromFile=O;exports.extractNameWithoutExtension=Rt;exports.extractNodeId=$;exports.extractParentFolderName=St;exports.extractStorageId=Pe;exports.getRelativeSpecialFolderSpacePath=Ft;exports.getSpaceManagers=Mt;exports.isManager=_t;exports.isMountPointSpaceResource=Ut;exports.isPersonalSpaceResource=k;exports.isProjectSpaceResource=Ct;exports.isPublicSpaceResource=Et;exports.isSearchResource=Pt;exports.isShareRoot=Dt;exports.isShareSpaceResource=Ot;exports.isSpaceResource=At;exports.isTrashResource=yt;