@opencloud-eu/web-client 4.2.0 → 4.3.0

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../index-w54SVXTg.cjs");const r=require("../index-CAp89HBO.cjs"),e=require("../functions-Bp-DjU7_.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-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,6 +1,6 @@
1
- import "../index-2zDycGQj.js";
2
- import { w as e } from "../index-BZHg3VRz.js";
3
- import { K as t, L as p, I as v, J as i } from "../functions-DK4H9weO.js";
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";
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-B21Ll1ii.cjs"),n=require("./web-client/ocs.cjs"),o=require("./index-CAp89HBO.cjs"),e=require("./functions-Bp-DjU7_.cjs"),S=require("./toString-CgHWCW2N.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-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,10 +1,10 @@
1
- import { g as c } from "./index-BMRpHyp4.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-BMRpHyp4.js";
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";
3
3
  import { ocs as i } from "./web-client/ocs.js";
4
- import { H as u, w as n } from "./index-BZHg3VRz.js";
5
- import { D as W, e as k } from "./index-BZHg3VRz.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-DK4H9weO.js";
7
- import { u as pe } from "./toString-XlfBosfh.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";
7
+ import { u as pe } from "./toString-BMC5nz5v.js";
8
8
  const l = function* (e) {
9
9
  return yield e;
10
10
  }, p = ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencloud-eu/web-client",
3
- "version": "4.2.0",
3
+ "version": "4.3.0",
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-CgHWCW2N.cjs"),Ie=require("./index-D_NPkUGY.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 n="",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(n.length<2||c!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var p=n.lastIndexOf("/");if(p!==n.length-1){p===-1?(n="",c=0):(n=n.slice(0,p),c=n.length-1-n.lastIndexOf("/")),d=f,o=0;continue}}else if(n.length===2||n.length===1){n="",c=0,d=f,o=0;continue}}t&&(n.length>0?n+="/..":n="..",c=2)}else n.length>0?n+="/"+a.slice(d+1,f):n=a.slice(d+1,f),c=f-d-1;d=f,o=0}else u===46&&o!==-1?++o:o=-1}return n}function i(a,t){var n=t.dir||t.root,c=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+c:n+a+c:c}var l={resolve:function(){for(var t="",n=!1,c,d=arguments.length-1;d>=-1&&!n;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,n=o.charCodeAt(0)===47)}return t=r(t,!n),n?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(e(t),t.length===0)return".";var n=t.charCodeAt(0)===47,c=t.charCodeAt(t.length-1)===47;return t=r(t,!n),t.length===0&&!n&&(t="."),t.length>0&&c&&(t+="/"),n?"/"+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,n=0;n<arguments.length;++n){var c=arguments[n];e(c),c.length>0&&(t===void 0?t=c:t+="/"+c)}return t===void 0?".":l.normalize(t)},relative:function(t,n){if(e(t),e(n),t===n||(t=l.resolve(t),n=l.resolve(n),t===n))return"";for(var c=1;c<t.length&&t.charCodeAt(c)===47;++c);for(var d=t.length,o=d-c,u=1;u<n.length&&n.charCodeAt(u)===47;++u);for(var f=n.length,p=f-u,v=o<p?o:p,g=-1,h=0;h<=v;++h){if(h===v){if(p>v){if(n.charCodeAt(u+h)===47)return n.slice(u+h+1);if(h===0)return n.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=n.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+n.slice(u+g):(u+=g,n.charCodeAt(u)===47&&++u,n.slice(u))},_makeLong:function(t){return t},dirname:function(t){if(e(t),t.length===0)return".";for(var n=t.charCodeAt(0),c=n===47,d=-1,o=!0,u=t.length-1;u>=1;--u)if(n=t.charCodeAt(u),n===47){if(!o){d=u;break}}else o=!1;return d===-1?c?"/":".":c&&d===1?"//":t.slice(0,d)},basename:function(t,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');e(t);var c=0,d=-1,o=!0,u;if(n!==void 0&&n.length>0&&n.length<=t.length){if(n.length===t.length&&n===t)return"";var f=n.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===n.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 n=-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?n===-1?n=f:u!==1&&(u=1):n!==-1&&(u=-1)}return n===-1||d===-1||u===0||u===1&&n===d-1&&n===c+1?"":t.slice(n,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 i("/",t)},parse:function(t){e(t);var n={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return n;var c=t.charCodeAt(0),d=c===47,o;d?(n.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?n.base=n.name=t.slice(1,p):n.base=n.name=t.slice(f,p)):(f===0&&d?(n.name=t.slice(1,u),n.base=t.slice(1,p)):(n.name=t.slice(f,u),n.base=t.slice(f,p)),n.ext=t.slice(u,p)),f>0?n.dir=t.slice(0,f-1):d&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};return l.posix=l,U=l,U}var T=we();const W=b.getDefaultExportFromCjs(T);class R{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.DownloadURL,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,i){switch(i.length){case 0:return e.call(r);case 1:return e.call(r,i[0]);case 2:return e.call(r,i[0],i[1]);case 3:return e.call(r,i[0],i[1],i[2])}return e.apply(r,i)}var Ce=800,Oe=16,Ue=Date.now;function Ee(e){var r=0,i=0;return function(){var l=Ue(),a=Oe-(l-i);if(i=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,i,l){for(var a=e.length,t=i+-1;++t<a;)if(r(e[t],t,e))return t;return-1}function Ne(e){return e!==e}function je(e,r,i){for(var l=i-1,a=e.length;++l<a;)if(e[l]===r)return l;return-1}function ze(e,r,i){return r===r?je(e,r,i):$e(e,Ne,i)}function G(e,r){var i=e==null?0:e.length;return!!i&&ze(e,r,0)>-1}var V=Math.max;function We(e,r,i){return r=V(r===void 0?e.length-1:r,0),function(){for(var l=arguments,a=-1,t=V(l.length-r,0),n=Array(t);++a<t;)n[a]=l[r+a];a=-1;for(var c=Array(r+1);++a<r;)c[a]=l[a];return c[r]=i(n),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,i){var l=-1,a=e.length;r<0&&(r=-r>a?0:a+r),i=i>a?a:i,i<0&&(i+=a),a=r>i?0:i-r>>>0,r>>>=0;for(var t=Array(a);++l<a;)t[l]=e[l+r];return t}function qe(e,r,i){var l=e.length;return i=i===void 0?l:i,!r&&i>=l?e:Ze(e,r,i)}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 nr(e){return e.split("")}var re="\\ud800-\\udfff",ir="\\u0300-\\u036f",sr="\\ufe20-\\ufe2f",ar="\\u20d0-\\u20ff",or=ir+sr+ar,ur="\\ufe0e\\ufe0f",lr="["+re+"]",E="["+or+"]",F="\\ud83c[\\udffb-\\udfff]",cr="(?:"+E+"|"+F+")",te="[^"+re+"]",ne="(?:\\ud83c[\\udde6-\\uddff]){2}",ie="[\\ud800-\\udbff][\\udc00-\\udfff]",dr="\\u200d",se=cr+"?",ae="["+ur+"]?",fr="(?:"+dr+"(?:"+[te,ne,ie].join("|")+")"+ae+se+")*",pr=ae+se+fr,hr="(?:"+[te+E+"?",E,ne,ie,lr].join("|")+")",mr=RegExp(F+"(?="+F+")|"+hr+pr,"g");function gr(e){return e.match(mr)||[]}function br(e){return ee(e)?gr(e):nr(e)}function vr(e){return function(r){r=b.toString(r);var i=ee(r)?br(r):void 0,l=i?i[0]:r.charAt(0),a=i?qe(i,1).join(""):r.slice(1);return l[e]()+a}}var xr=vr("toUpperCase");function Rr(e){return xr(b.toString(e).toLowerCase())}function yr(e,r,i,l){for(var a=-1,t=e==null?0:e.length;++a<t;)i=r(i,e[a],a,e);return i}function Pr(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=Pr(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]",y="["+ce+"]",Qr="\\u200d",B="(?:"+he+"|"+me+")",Xr="(?:"+y+"|"+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,nt="(?:"+[Zr,ge,be].join("|")+")"+tt,it=RegExp([y+"?"+he+"+"+Z+"(?="+[J,y,"$"].join("|")+")",Xr+"+"+q+"(?="+[J,y+B,"$"].join("|")+")",y+"?"+B+"+"+Z,y+"+"+q,rt,et,pe,nt].join("|"),"g");function st(e){return e.match(it)||[]}function at(e,r,i){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 yr(at(Or(r).replace(ut,"")),e,"")}}var ct=lt(function(e,r,i){return r=r.toLowerCase(),e+(i?Rr(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,i=e==null?0:e.length;for(this.__data__=new b.MapCache;++r<i;)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,i){for(var l=G,a=e[0].length,t=e.length,n=t,c=Array(t),d=1/0,o=[];n--;){var u=e[n];d=mt(u.length,d),c[n]=a>=120&&u.length>=120?new I(n&&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(n=t;--n;){var h=c[n];if(!(h?_(h,g):l(e[n],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"]},Rt=e=>Object.hasOwn(e,"ddate"),yt=e=>Object.hasOwn(e,"highlights"),C=e=>e.replace(/[^A-Za-z0-9\-_]/g,""),Re=(e,r)=>!e||typeof e!="string"?"":e.indexOf("!")>=0?e.split("!")[r]:"",ye=e=>Re(e,0),$=e=>Re(e,1),Pt=e=>{const r=e.extension||"",i=e.name||"";if(!r.length)return i;const l=i.lastIndexOf(`.${r}`);return i.substring(0,l)},O=e=>{const r=e.name;if(e.type==="directory"||e.isFolder)return"";const i=r.split(".");if(i.length>2)for(let l=0;l<i.length;l++){const a=i.slice(l,i.length).join(".");if(xt.complex.includes(a))return a}return i.length<2?"":i[i.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(i=>{r[ct(i)]=e[i]}),r};function It(e,r=[]){const i=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 n=O({...e,name:i}),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:ye(l),parentFolderId:e.props[s.FileParent],mimeType:e.props[s.MimeType],name:i,extension:a?"":n,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(R.FolderCreateable)>=0},canDownload:function(){return this.permissions.indexOf(R.SecureView)===-1},canBeDeleted:function(){return this.permissions.indexOf(R.Deletable)>=0},canRename:function(){return this.permissions.indexOf(R.Renameable)>=0},canShare:function({ability:g}){return g.can("create-all","Share")&&this.permissions.indexOf(R.Shareable)>=0},canCreate:function(){return this.permissions.indexOf(R.FolderCreateable)>=0},canEditTags:function(){return this.permissions.indexOf(R.Updateable)>=0||this.permissions.indexOf(R.FileUpdateable)>=0},isMounted:function(){return this.permissions.indexOf(R.Mounted)>=0},isReceivedShare:function(){return this.permissions.indexOf(R.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",i=e.props[s.TrashbinOriginalFilename]?.toString(),l=O({name:i,type:e.type}),a=W.basename(e.filename);return{type:r?"folder":e.type,isFolder:r,ddate:e.props[s.TrashbinDeletedDate],name:W.basename(i),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 P{_key;_value;_label;_icon;constructor(r,i,l,a){this._key=r,this._value=i,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 P("user",0,D("User"),"user");static group=new P("group",1,D("Group"),"group");static link=new P("link",3,D("Link"),"link");static guest=new P("guest",4,D("Guest"),"global");static remote=new P("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(i=>i.value===r)}static getByValues(r){return r.map(i=>this.getByValue(i))}static getByKeys(r){return r.map(i=>this.all.find(l=>l.key===i))}static getValues(r){return r.map(i=>i.value)}static containsAnyValue(r,i){return vt(this.getValues(r),i).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 Pe(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 a=decodeURI(l.webDavUrl).split("/"),t=a.find(n=>n.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(i=>{let l=[];i["@libre.graph.permissions.actions"]&&(l=i["@libre.graph.permissions.actions"]);const a=r[i.roles?.[0]];return a&&!l.length&&(l=a.rolePermissions.find(({condition:n})=>n==="exists @Resource.Root")?.allowedResourceActions||[]),l.includes(x.deletePermissions)});function $t(e){const r=e.publicLinkPassword,i=e.props?.[s.FileId],l=e.props?.[s.PublicLinkItemType],a=e.props?.[s.PublicLinkPermission],t=e.props?.[s.PublicLinkExpiration],n=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}),{...i&&{fileId:i},...r&&{publicLinkPassword:r},...l&&{publicLinkItemType:l},...a&&{publicLinkPermission:parseInt(a)},...t&&{publicLinkExpiration:t},...n&&{publicLinkShareDate:n},...c&&{publicLinkShareOwner:c},publicLinkType:d})}function Nt({driveAliasPrefix:e,id:r,shareName:i,serverUrl:l}){const a=N({id:r,driveAlias:`${e}/${i}`,driveType:"share",name:i,serverUrl:l});return a.rename=t=>{a.driveAlias=`${e}/${t}`,a.name=t},a}function N(e){let r,i;e.special&&(r=e.special.find(o=>o.specialFolder.name==="image"),i=e.special.find(o=>o.specialFolder.name==="readme"),r&&(r.webDavUrl=decodeURI(r.webDavUrl)),i&&(i.webDavUrl=decodeURI(i.webDavUrl)));const l=e.root?.deleted?.state==="trashed",a=b.urlJoin(e.webDavPath||Pe(e.id),{leadingSlash:!0}),t=b.urlJoin(e.serverUrl,"remote.php/dav",a),n=b.urlJoin(e.webDavTrashPath||Se(e.id),{leadingSlash:!0}),c=b.urlJoin(e.serverUrl,"remote.php/dav",n),d={id:e.id,fileId:e.id,storageId:e.id,mimeType:"",name:e.name,description:e.description,extension:"",path:"/",webDavPath:a,webDavTrashPath:n,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:i,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=R;exports.DavProperties=M;exports.DavProperty=s;exports.GraphSharePermission=x;exports.OCM_PROVIDER_ID=Tt;exports.SHARE_JAIL_ID=kt;exports.SetCache=I;exports.ShareType=P;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=Pe;exports.buildWebDavSpacesTrashPath=Se;exports.cacheHas=_;exports.extractDomSelector=C;exports.extractExtensionFromFile=O;exports.extractNameWithoutExtension=Pt;exports.extractNodeId=$;exports.extractParentFolderName=St;exports.extractStorageId=ye;exports.getRelativeSpecialFolderSpacePath=Ft;exports.getSpaceManagers=Mt;exports.isManager=_t;exports.isMountPointSpaceResource=Ut;exports.isPersonalSpaceResource=k;exports.isProjectSpaceResource=Ct;exports.isPublicSpaceResource=Et;exports.isSearchResource=yt;exports.isShareRoot=Dt;exports.isShareSpaceResource=Ot;exports.isSpaceResource=At;exports.isTrashResource=Rt;
@@ -1 +0,0 @@
1
- "use strict";const h=require("./web-client/graph/generated.cjs"),g=require("./toString-CgHWCW2N.cjs"),d=require("./functions-Bp-DjU7_.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.createChildren),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,6 +0,0 @@
1
- "use strict";const Vr=globalThis||void 0||self;function Xr(c){return c&&c.__esModule&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c}var Er={exports:{}},g=Er.exports={},_,S;function er(){throw new Error("setTimeout has not been defined")}function nr(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?_=setTimeout:_=er}catch{_=er}try{typeof clearTimeout=="function"?S=clearTimeout:S=nr}catch{S=nr}})();function dr(c){if(_===setTimeout)return setTimeout(c,0);if((_===er||!_)&&setTimeout)return _=setTimeout,setTimeout(c,0);try{return _(c,0)}catch{try{return _.call(null,c,0)}catch{return _.call(this,c,0)}}}function Jr(c){if(S===clearTimeout)return clearTimeout(c);if((S===nr||!S)&&clearTimeout)return S=clearTimeout,clearTimeout(c);try{return S(c)}catch{try{return S.call(null,c)}catch{return S.call(this,c)}}}var M=[],q=!1,O,V=-1;function zr(){!q||!O||(q=!1,O.length?M=O.concat(M):V=-1,M.length&&mr())}function mr(){if(!q){var c=dr(zr);q=!0;for(var f=M.length;f;){for(O=M,M=[];++V<f;)O&&O[V].run();V=-1,f=M.length}O=null,q=!1,Jr(c)}}g.nextTick=function(c){var f=new Array(arguments.length-1);if(arguments.length>1)for(var l=1;l<arguments.length;l++)f[l-1]=arguments[l];M.push(new gr(c,f)),M.length===1&&!q&&dr(mr)};function gr(c,f){this.fun=c,this.array=f}gr.prototype.run=function(){this.fun.apply(null,this.array)};g.title="browser";g.browser=!0;g.env={};g.argv=[];g.version="";g.versions={};function D(){}g.on=D;g.addListener=D;g.once=D;g.off=D;g.removeListener=D;g.removeAllListeners=D;g.emit=D;g.prependListener=D;g.prependOnceListener=D;g.listeners=function(c){return[]};g.binding=function(c){throw new Error("process.binding is not supported")};g.cwd=function(){return"/"};g.chdir=function(c){throw new Error("process.chdir is not supported")};g.umask=function(){return 0};var Qr=Er.exports;const Kr=Xr(Qr);var Ir={},X={};X.byteLength=rt;X.toByteArray=et;X.fromByteArray=ot;var L=[],C=[],Zr=typeof Uint8Array<"u"?Uint8Array:Array,tr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var j=0,vr=tr.length;j<vr;++j)L[j]=tr[j],C[tr.charCodeAt(j)]=j;C[45]=62;C[95]=63;function Fr(c){var f=c.length;if(f%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var l=c.indexOf("=");l===-1&&(l=f);var x=l===f?0:4-l%4;return[l,x]}function rt(c){var f=Fr(c),l=f[0],x=f[1];return(l+x)*3/4-x}function tt(c,f,l){return(f+l)*3/4-l}function et(c){var f,l=Fr(c),x=l[0],w=l[1],p=new Zr(tt(c,x,w)),s=0,I=w>0?x-4:x,B;for(B=0;B<I;B+=4)f=C[c.charCodeAt(B)]<<18|C[c.charCodeAt(B+1)]<<12|C[c.charCodeAt(B+2)]<<6|C[c.charCodeAt(B+3)],p[s++]=f>>16&255,p[s++]=f>>8&255,p[s++]=f&255;return w===2&&(f=C[c.charCodeAt(B)]<<2|C[c.charCodeAt(B+1)]>>4,p[s++]=f&255),w===1&&(f=C[c.charCodeAt(B)]<<10|C[c.charCodeAt(B+1)]<<4|C[c.charCodeAt(B+2)]>>2,p[s++]=f>>8&255,p[s++]=f&255),p}function nt(c){return L[c>>18&63]+L[c>>12&63]+L[c>>6&63]+L[c&63]}function it(c,f,l){for(var x,w=[],p=f;p<l;p+=3)x=(c[p]<<16&16711680)+(c[p+1]<<8&65280)+(c[p+2]&255),w.push(nt(x));return w.join("")}function ot(c){for(var f,l=c.length,x=l%3,w=[],p=16383,s=0,I=l-x;s<I;s+=p)w.push(it(c,s,s+p>I?I:s+p));return x===1?(f=c[l-1],w.push(L[f>>2]+L[f<<4&63]+"==")):x===2&&(f=(c[l-2]<<8)+c[l-1],w.push(L[f>>10]+L[f>>4&63]+L[f<<2&63]+"=")),w.join("")}var ir={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ir.read=function(c,f,l,x,w){var p,s,I=w*8-x-1,B=(1<<I)-1,T=B>>1,o=-7,A=l?w-1:0,N=l?-1:1,R=c[f+A];for(A+=N,p=R&(1<<-o)-1,R>>=-o,o+=I;o>0;p=p*256+c[f+A],A+=N,o-=8);for(s=p&(1<<-o)-1,p>>=-o,o+=x;o>0;s=s*256+c[f+A],A+=N,o-=8);if(p===0)p=1-T;else{if(p===B)return s?NaN:(R?-1:1)*(1/0);s=s+Math.pow(2,x),p=p-T}return(R?-1:1)*s*Math.pow(2,p-x)};ir.write=function(c,f,l,x,w,p){var s,I,B,T=p*8-w-1,o=(1<<T)-1,A=o>>1,N=w===23?Math.pow(2,-24)-Math.pow(2,-77):0,R=x?0:p-1,$=x?1:-1,J=f<0||f===0&&1/f<0?1:0;for(f=Math.abs(f),isNaN(f)||f===1/0?(I=isNaN(f)?1:0,s=o):(s=Math.floor(Math.log(f)/Math.LN2),f*(B=Math.pow(2,-s))<1&&(s--,B*=2),s+A>=1?f+=N/B:f+=N*Math.pow(2,1-A),f*B>=2&&(s++,B/=2),s+A>=o?(I=0,s=o):s+A>=1?(I=(f*B-1)*Math.pow(2,w),s=s+A):(I=f*Math.pow(2,A-1)*Math.pow(2,w),s=0));w>=8;c[l+R]=I&255,R+=$,I/=256,w-=8);for(s=s<<w|I,T+=w;T>0;c[l+R]=s&255,R+=$,s/=256,T-=8);c[l+R-$]|=J*128};/*!
2
- * The buffer module from node.js, for the browser.
3
- *
4
- * @author Feross Aboukhadijeh <https://feross.org>
5
- * @license MIT
6
- */(function(c){const f=X,l=ir,x=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;c.Buffer=o,c.SlowBuffer=Ur,c.INSPECT_MAX_BYTES=50;const w=2147483647;c.kMaxLength=w;const{Uint8Array:p,ArrayBuffer:s,SharedArrayBuffer:I}=globalThis;o.TYPED_ARRAY_SUPPORT=B(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function B(){try{const e=new p(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,p.prototype),Object.setPrototypeOf(e,r),e.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function T(e){if(e>w)throw new RangeError('The value "'+e+'" is invalid for option "size"');const r=new p(e);return Object.setPrototypeOf(r,o.prototype),r}function o(e,r,t){if(typeof e=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return $(e)}return A(e,r,t)}o.poolSize=8192;function A(e,r,t){if(typeof e=="string")return J(e,r);if(s.isView(e))return Tr(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(b(e,s)||e&&b(e.buffer,s)||typeof I<"u"&&(b(e,I)||e&&b(e.buffer,I)))return Q(e,r,t);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return o.from(n,r,t);const i=Ar(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return o.from(e[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}o.from=function(e,r,t){return A(e,r,t)},Object.setPrototypeOf(o.prototype,p.prototype),Object.setPrototypeOf(o,p);function N(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function R(e,r,t){return N(e),e<=0?T(e):r!==void 0?typeof t=="string"?T(e).fill(r,t):T(e).fill(r):T(e)}o.alloc=function(e,r,t){return R(e,r,t)};function $(e){return N(e),T(e<0?0:K(e)|0)}o.allocUnsafe=function(e){return $(e)},o.allocUnsafeSlow=function(e){return $(e)};function J(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r);const t=or(e,r)|0;let n=T(t);const i=n.write(e,r);return i!==t&&(n=n.slice(0,i)),n}function z(e){const r=e.length<0?0:K(e.length)|0,t=T(r);for(let n=0;n<r;n+=1)t[n]=e[n]&255;return t}function Tr(e){if(b(e,p)){const r=new p(e);return Q(r.buffer,r.byteOffset,r.byteLength)}return z(e)}function Q(e,r,t){if(r<0||e.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<r+(t||0))throw new RangeError('"length" is outside of buffer bounds');let n;return r===void 0&&t===void 0?n=new p(e):t===void 0?n=new p(e,r):n=new p(e,r,t),Object.setPrototypeOf(n,o.prototype),n}function Ar(e){if(o.isBuffer(e)){const r=K(e.length)|0,t=T(r);return t.length===0||e.copy(t,0,0,r),t}if(e.length!==void 0)return typeof e.length!="number"||rr(e.length)?T(0):z(e);if(e.type==="Buffer"&&Array.isArray(e.data))return z(e.data)}function K(e){if(e>=w)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+w.toString(16)+" bytes");return e|0}function Ur(e){return+e!=e&&(e=0),o.alloc(+e)}o.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==o.prototype},o.compare=function(r,t){if(b(r,p)&&(r=o.from(r,r.offset,r.byteLength)),b(t,p)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(r)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;let n=r.length,i=t.length;for(let u=0,h=Math.min(n,i);u<h;++u)if(r[u]!==t[u]){n=r[u],i=t[u];break}return n<i?-1:i<n?1:0},o.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return o.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<r.length;++n)t+=r[n].length;const i=o.allocUnsafe(t);let u=0;for(n=0;n<r.length;++n){let h=r[n];if(b(h,p))u+h.length>i.length?(o.isBuffer(h)||(h=o.from(h)),h.copy(i,u)):p.prototype.set.call(i,h,u);else if(o.isBuffer(h))h.copy(i,u);else throw new TypeError('"list" argument must be an Array of Buffers');u+=h.length}return i};function or(e,r){if(o.isBuffer(e))return e.length;if(s.isView(e)||b(e,s))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const t=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;let i=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return v(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Br(e).length;default:if(i)return n?-1:v(e).length;r=(""+r).toLowerCase(),i=!0}}o.byteLength=or;function Rr(e,r,t){let n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return $r(this,r,t);case"utf8":case"utf-8":return cr(this,r,t);case"ascii":return Dr(this,r,t);case"latin1":case"binary":return kr(this,r,t);case"base64":return Nr(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pr(this,r,t);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}o.prototype._isBuffer=!0;function P(e,r,t){const n=e[r];e[r]=e[t],e[t]=n}o.prototype.swap16=function(){const r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<r;t+=2)P(this,t,t+1);return this},o.prototype.swap32=function(){const r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<r;t+=4)P(this,t,t+3),P(this,t+1,t+2);return this},o.prototype.swap64=function(){const r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<r;t+=8)P(this,t,t+7),P(this,t+1,t+6),P(this,t+2,t+5),P(this,t+3,t+4);return this},o.prototype.toString=function(){const r=this.length;return r===0?"":arguments.length===0?cr(this,0,r):Rr.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(r){if(!o.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:o.compare(this,r)===0},o.prototype.inspect=function(){let r="";const t=c.INSPECT_MAX_BYTES;return r=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(r+=" ... "),"<Buffer "+r+">"},x&&(o.prototype[x]=o.prototype.inspect),o.prototype.compare=function(r,t,n,i,u){if(b(r,p)&&(r=o.from(r,r.offset,r.byteLength)),!o.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),u===void 0&&(u=this.length),t<0||n>r.length||i<0||u>this.length)throw new RangeError("out of range index");if(i>=u&&t>=n)return 0;if(i>=u)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,u>>>=0,this===r)return 0;let h=u-i,a=n-t;const d=Math.min(h,a),E=this.slice(i,u),m=r.slice(t,n);for(let y=0;y<d;++y)if(E[y]!==m[y]){h=E[y],a=m[y];break}return h<a?-1:a<h?1:0};function ur(e,r,t,n,i){if(e.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,rr(t)&&(t=i?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(i)return-1;t=e.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof r=="string"&&(r=o.from(r,n)),o.isBuffer(r))return r.length===0?-1:hr(e,r,t,n,i);if(typeof r=="number")return r=r&255,typeof p.prototype.indexOf=="function"?i?p.prototype.indexOf.call(e,r,t):p.prototype.lastIndexOf.call(e,r,t):hr(e,[r],t,n,i);throw new TypeError("val must be string, number or Buffer")}function hr(e,r,t,n,i){let u=1,h=e.length,a=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||r.length<2)return-1;u=2,h/=2,a/=2,t/=2}function d(m,y){return u===1?m[y]:m.readUInt16BE(y*u)}let E;if(i){let m=-1;for(E=t;E<h;E++)if(d(e,E)===d(r,m===-1?0:E-m)){if(m===-1&&(m=E),E-m+1===a)return m*u}else m!==-1&&(E-=E-m),m=-1}else for(t+a>h&&(t=h-a),E=t;E>=0;E--){let m=!0;for(let y=0;y<a;y++)if(d(e,E+y)!==d(r,y)){m=!1;break}if(m)return E}return-1}o.prototype.includes=function(r,t,n){return this.indexOf(r,t,n)!==-1},o.prototype.indexOf=function(r,t,n){return ur(this,r,t,n,!0)},o.prototype.lastIndexOf=function(r,t,n){return ur(this,r,t,n,!1)};function Cr(e,r,t,n){t=Number(t)||0;const i=e.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;const u=r.length;n>u/2&&(n=u/2);let h;for(h=0;h<n;++h){const a=parseInt(r.substr(h*2,2),16);if(rr(a))return h;e[t+h]=a}return h}function br(e,r,t,n){return H(v(r,e.length-t),e,t,n)}function _r(e,r,t,n){return H(jr(r),e,t,n)}function Sr(e,r,t,n){return H(Br(r),e,t,n)}function Lr(e,r,t,n){return H(qr(r,e.length-t),e,t,n)}o.prototype.write=function(r,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const u=this.length-t;if((n===void 0||n>u)&&(n=u),r.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let h=!1;for(;;)switch(i){case"hex":return Cr(this,r,t,n);case"utf8":case"utf-8":return br(this,r,t,n);case"ascii":case"latin1":case"binary":return _r(this,r,t,n);case"base64":return Sr(this,r,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Lr(this,r,t,n);default:if(h)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),h=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Nr(e,r,t){return r===0&&t===e.length?f.fromByteArray(e):f.fromByteArray(e.slice(r,t))}function cr(e,r,t){t=Math.min(e.length,t);const n=[];let i=r;for(;i<t;){const u=e[i];let h=null,a=u>239?4:u>223?3:u>191?2:1;if(i+a<=t){let d,E,m,y;switch(a){case 1:u<128&&(h=u);break;case 2:d=e[i+1],(d&192)===128&&(y=(u&31)<<6|d&63,y>127&&(h=y));break;case 3:d=e[i+1],E=e[i+2],(d&192)===128&&(E&192)===128&&(y=(u&15)<<12|(d&63)<<6|E&63,y>2047&&(y<55296||y>57343)&&(h=y));break;case 4:d=e[i+1],E=e[i+2],m=e[i+3],(d&192)===128&&(E&192)===128&&(m&192)===128&&(y=(u&15)<<18|(d&63)<<12|(E&63)<<6|m&63,y>65535&&y<1114112&&(h=y))}}h===null?(h=65533,a=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|h&1023),n.push(h),i+=a}return Mr(n)}const fr=4096;function Mr(e){const r=e.length;if(r<=fr)return String.fromCharCode.apply(String,e);let t="",n=0;for(;n<r;)t+=String.fromCharCode.apply(String,e.slice(n,n+=fr));return t}function Dr(e,r,t){let n="";t=Math.min(e.length,t);for(let i=r;i<t;++i)n+=String.fromCharCode(e[i]&127);return n}function kr(e,r,t){let n="";t=Math.min(e.length,t);for(let i=r;i<t;++i)n+=String.fromCharCode(e[i]);return n}function $r(e,r,t){const n=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>n)&&(t=n);let i="";for(let u=r;u<t;++u)i+=Wr[e[u]];return i}function Pr(e,r,t){const n=e.slice(r,t);let i="";for(let u=0;u<n.length-1;u+=2)i+=String.fromCharCode(n[u]+n[u+1]*256);return i}o.prototype.slice=function(r,t){const n=this.length;r=~~r,t=t===void 0?n:~~t,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<r&&(t=r);const i=this.subarray(r,t);return Object.setPrototypeOf(i,o.prototype),i};function F(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(r,t,n){r=r>>>0,t=t>>>0,n||F(r,t,this.length);let i=this[r],u=1,h=0;for(;++h<t&&(u*=256);)i+=this[r+h]*u;return i},o.prototype.readUintBE=o.prototype.readUIntBE=function(r,t,n){r=r>>>0,t=t>>>0,n||F(r,t,this.length);let i=this[r+--t],u=1;for(;t>0&&(u*=256);)i+=this[r+--t]*u;return i},o.prototype.readUint8=o.prototype.readUInt8=function(r,t){return r=r>>>0,t||F(r,1,this.length),this[r]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||F(r,2,this.length),this[r]|this[r+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||F(r,2,this.length),this[r]<<8|this[r+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||F(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||F(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])},o.prototype.readBigUInt64LE=k(function(r){r=r>>>0,Y(r,"offset");const t=this[r],n=this[r+7];(t===void 0||n===void 0)&&W(r,this.length-8);const i=t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,u=this[++r]+this[++r]*2**8+this[++r]*2**16+n*2**24;return BigInt(i)+(BigInt(u)<<BigInt(32))}),o.prototype.readBigUInt64BE=k(function(r){r=r>>>0,Y(r,"offset");const t=this[r],n=this[r+7];(t===void 0||n===void 0)&&W(r,this.length-8);const i=t*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],u=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(u)}),o.prototype.readIntLE=function(r,t,n){r=r>>>0,t=t>>>0,n||F(r,t,this.length);let i=this[r],u=1,h=0;for(;++h<t&&(u*=256);)i+=this[r+h]*u;return u*=128,i>=u&&(i-=Math.pow(2,8*t)),i},o.prototype.readIntBE=function(r,t,n){r=r>>>0,t=t>>>0,n||F(r,t,this.length);let i=t,u=1,h=this[r+--i];for(;i>0&&(u*=256);)h+=this[r+--i]*u;return u*=128,h>=u&&(h-=Math.pow(2,8*t)),h},o.prototype.readInt8=function(r,t){return r=r>>>0,t||F(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]},o.prototype.readInt16LE=function(r,t){r=r>>>0,t||F(r,2,this.length);const n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n},o.prototype.readInt16BE=function(r,t){r=r>>>0,t||F(r,2,this.length);const n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n},o.prototype.readInt32LE=function(r,t){return r=r>>>0,t||F(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},o.prototype.readInt32BE=function(r,t){return r=r>>>0,t||F(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},o.prototype.readBigInt64LE=k(function(r){r=r>>>0,Y(r,"offset");const t=this[r],n=this[r+7];(t===void 0||n===void 0)&&W(r,this.length-8);const i=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24)}),o.prototype.readBigInt64BE=k(function(r){r=r>>>0,Y(r,"offset");const t=this[r],n=this[r+7];(t===void 0||n===void 0)&&W(r,this.length-8);const i=(t<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return(BigInt(i)<<BigInt(32))+BigInt(this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+n)}),o.prototype.readFloatLE=function(r,t){return r=r>>>0,t||F(r,4,this.length),l.read(this,r,!0,23,4)},o.prototype.readFloatBE=function(r,t){return r=r>>>0,t||F(r,4,this.length),l.read(this,r,!1,23,4)},o.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||F(r,8,this.length),l.read(this,r,!0,52,8)},o.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||F(r,8,this.length),l.read(this,r,!1,52,8)};function U(e,r,t,n,i,u){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<u)throw new RangeError('"value" argument is out of bounds');if(t+n>e.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(r,t,n,i){if(r=+r,t=t>>>0,n=n>>>0,!i){const a=Math.pow(2,8*n)-1;U(this,r,t,n,a,0)}let u=1,h=0;for(this[t]=r&255;++h<n&&(u*=256);)this[t+h]=r/u&255;return t+n},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(r,t,n,i){if(r=+r,t=t>>>0,n=n>>>0,!i){const a=Math.pow(2,8*n)-1;U(this,r,t,n,a,0)}let u=n-1,h=1;for(this[t+u]=r&255;--u>=0&&(h*=256);)this[t+u]=r/h&255;return t+n},o.prototype.writeUint8=o.prototype.writeUInt8=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,1,255,0),this[t]=r&255,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function pr(e,r,t,n,i){xr(r,n,i,e,t,7);let u=Number(r&BigInt(4294967295));e[t++]=u,u=u>>8,e[t++]=u,u=u>>8,e[t++]=u,u=u>>8,e[t++]=u;let h=Number(r>>BigInt(32)&BigInt(4294967295));return e[t++]=h,h=h>>8,e[t++]=h,h=h>>8,e[t++]=h,h=h>>8,e[t++]=h,t}function sr(e,r,t,n,i){xr(r,n,i,e,t,7);let u=Number(r&BigInt(4294967295));e[t+7]=u,u=u>>8,e[t+6]=u,u=u>>8,e[t+5]=u,u=u>>8,e[t+4]=u;let h=Number(r>>BigInt(32)&BigInt(4294967295));return e[t+3]=h,h=h>>8,e[t+2]=h,h=h>>8,e[t+1]=h,h=h>>8,e[t]=h,t+8}o.prototype.writeBigUInt64LE=k(function(r,t=0){return pr(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=k(function(r,t=0){return sr(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(r,t,n,i){if(r=+r,t=t>>>0,!i){const d=Math.pow(2,8*n-1);U(this,r,t,n,d-1,-d)}let u=0,h=1,a=0;for(this[t]=r&255;++u<n&&(h*=256);)r<0&&a===0&&this[t+u-1]!==0&&(a=1),this[t+u]=(r/h>>0)-a&255;return t+n},o.prototype.writeIntBE=function(r,t,n,i){if(r=+r,t=t>>>0,!i){const d=Math.pow(2,8*n-1);U(this,r,t,n,d-1,-d)}let u=n-1,h=1,a=0;for(this[t+u]=r&255;--u>=0&&(h*=256);)r<0&&a===0&&this[t+u+1]!==0&&(a=1),this[t+u]=(r/h>>0)-a&255;return t+n},o.prototype.writeInt8=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1},o.prototype.writeInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2},o.prototype.writeInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2},o.prototype.writeInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4},o.prototype.writeInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4},o.prototype.writeBigInt64LE=k(function(r,t=0){return pr(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=k(function(r,t=0){return sr(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function lr(e,r,t,n,i,u){if(t+n>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function ar(e,r,t,n,i){return r=+r,t=t>>>0,i||lr(e,r,t,4),l.write(e,r,t,n,23,4),t+4}o.prototype.writeFloatLE=function(r,t,n){return ar(this,r,t,!0,n)},o.prototype.writeFloatBE=function(r,t,n){return ar(this,r,t,!1,n)};function wr(e,r,t,n,i){return r=+r,t=t>>>0,i||lr(e,r,t,8),l.write(e,r,t,n,52,8),t+8}o.prototype.writeDoubleLE=function(r,t,n){return wr(this,r,t,!0,n)},o.prototype.writeDoubleBE=function(r,t,n){return wr(this,r,t,!1,n)},o.prototype.copy=function(r,t,n,i){if(!o.isBuffer(r))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),t>=r.length&&(t=r.length),t||(t=0),i>0&&i<n&&(i=n),i===n||r.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-t<i-n&&(i=r.length-t+n);const u=i-n;return this===r&&typeof p.prototype.copyWithin=="function"?this.copyWithin(t,n,i):p.prototype.set.call(r,this.subarray(n,i),t),u},o.prototype.fill=function(r,t,n,i){if(typeof r=="string"){if(typeof t=="string"?(i=t,t=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!o.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(r.length===1){const h=r.charCodeAt(0);(i==="utf8"&&h<128||i==="latin1")&&(r=h)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);let u;if(typeof r=="number")for(u=t;u<n;++u)this[u]=r;else{const h=o.isBuffer(r)?r:o.from(r,i),a=h.length;if(a===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(u=0;u<n-t;++u)this[u+t]=h[u%a]}return this};const G={};function Z(e,r,t){G[e]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:r.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}Z("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Z("ERR_INVALID_ARG_TYPE",function(e,r){return`The "${e}" argument must be of type number. Received type ${typeof r}`},TypeError),Z("ERR_OUT_OF_RANGE",function(e,r,t){let n=`The value of "${e}" is out of range.`,i=t;return Number.isInteger(t)&&Math.abs(t)>2**32?i=yr(String(t)):typeof t=="bigint"&&(i=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=yr(i)),i+="n"),n+=` It must be ${r}. Received ${i}`,n},RangeError);function yr(e){let r="",t=e.length;const n=e[0]==="-"?1:0;for(;t>=n+4;t-=3)r=`_${e.slice(t-3,t)}${r}`;return`${e.slice(0,t)}${r}`}function Or(e,r,t){Y(r,"offset"),(e[r]===void 0||e[r+t]===void 0)&&W(r,e.length-(t+1))}function xr(e,r,t,n,i,u){if(e>t||e<r){const h=typeof r=="bigint"?"n":"";let a;throw r===0||r===BigInt(0)?a=`>= 0${h} and < 2${h} ** ${(u+1)*8}${h}`:a=`>= -(2${h} ** ${(u+1)*8-1}${h}) and < 2 ** ${(u+1)*8-1}${h}`,new G.ERR_OUT_OF_RANGE("value",a,e)}Or(n,i,u)}function Y(e,r){if(typeof e!="number")throw new G.ERR_INVALID_ARG_TYPE(r,"number",e)}function W(e,r,t){throw Math.floor(e)!==e?(Y(e,t),new G.ERR_OUT_OF_RANGE("offset","an integer",e)):r<0?new G.ERR_BUFFER_OUT_OF_BOUNDS:new G.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${r}`,e)}const Gr=/[^+/0-9A-Za-z-_]/g;function Yr(e){if(e=e.split("=")[0],e=e.trim().replace(Gr,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function v(e,r){r=r||1/0;let t;const n=e.length;let i=null;const u=[];for(let h=0;h<n;++h){if(t=e.charCodeAt(h),t>55295&&t<57344){if(!i){if(t>56319){(r-=3)>-1&&u.push(239,191,189);continue}else if(h+1===n){(r-=3)>-1&&u.push(239,191,189);continue}i=t;continue}if(t<56320){(r-=3)>-1&&u.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(r-=3)>-1&&u.push(239,191,189);if(i=null,t<128){if((r-=1)<0)break;u.push(t)}else if(t<2048){if((r-=2)<0)break;u.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;u.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;u.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return u}function jr(e){const r=[];for(let t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function qr(e,r){let t,n,i;const u=[];for(let h=0;h<e.length&&!((r-=2)<0);++h)t=e.charCodeAt(h),n=t>>8,i=t%256,u.push(i),u.push(n);return u}function Br(e){return f.toByteArray(Yr(e))}function H(e,r,t,n){let i;for(i=0;i<n&&!(i+t>=r.length||i>=e.length);++i)r[i+t]=e[i];return i}function b(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function rr(e){return e!==e}const Wr=(function(){const e="0123456789abcdef",r=new Array(256);for(let t=0;t<16;++t){const n=t*16;for(let i=0;i<16;++i)r[n+i]=e[t]+e[i]}return r})();function k(e){return typeof BigInt>"u"?Hr:e}function Hr(){throw new Error("BigInt not supported")}})(Ir);const ut=Ir.Buffer;exports.Buffer=ut;exports.global=Vr;exports.process$1=Kr;