opfs-worker 1.2.2 → 1.2.4
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.
- package/dist/assets/worker-BEh95XuP.js.map +1 -0
- package/dist/assets/worker-CS9nvwsF.js.map +1 -0
- package/dist/assets/worker-Dy3EFYv_.js.map +1 -0
- package/dist/facade.d.ts +50 -14
- package/dist/facade.d.ts.map +1 -1
- package/dist/helpers-04x7UBul.cjs +4 -0
- package/dist/helpers-04x7UBul.cjs.map +1 -0
- package/dist/{helpers-CkNHswLp.js → helpers-BXhw_-Ar.js} +112 -110
- package/dist/helpers-BXhw_-Ar.js.map +1 -0
- package/dist/helpers-BwklIUit.js +1329 -0
- package/dist/helpers-BwklIUit.js.map +1 -0
- package/dist/helpers-ppMRzIAJ.cjs +4 -0
- package/dist/helpers-ppMRzIAJ.cjs.map +1 -0
- package/dist/index.cjs +262 -260
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +379 -334
- package/dist/index.js.map +1 -1
- package/dist/raw.cjs +1 -1
- package/dist/raw.cjs.map +1 -1
- package/dist/raw.js +136 -134
- package/dist/raw.js.map +1 -1
- package/dist/types.d.ts +11 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/helpers.d.ts.map +1 -1
- package/dist/worker.d.ts.map +1 -1
- package/package.json +2 -3
- package/dist/assets/worker-BuPeqKqw.js.map +0 -1
- package/dist/helpers-CkNHswLp.js.map +0 -1
- package/dist/helpers-TAynP0fb.cjs +0 -4
- package/dist/helpers-TAynP0fb.cjs.map +0 -1
package/dist/facade.d.ts
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import type { DirentData, Encoding, FileOpenOptions, FileStat, OPFSOptions, PathLike, RenameOptions, WatchOptions } from './types';
|
|
1
|
+
import type { BinaryEncoding, DirentData, Encoding, FileOpenOptions, FileStat, OPFSOptions, PathLike, RenameOptions, StringEncoding, WatchOptions } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Facade class that provides a clean interface for communicating with the OPFS worker
|
|
4
4
|
* while hiding Comlink implementation details.
|
|
5
5
|
*/
|
|
6
6
|
export declare class OPFSFileSystem {
|
|
7
7
|
#private;
|
|
8
|
+
promises: OPFSFileSystem;
|
|
8
9
|
constructor(options?: OPFSOptions);
|
|
10
|
+
/**
|
|
11
|
+
* Start watching a file or directory for changes
|
|
12
|
+
*/
|
|
13
|
+
watch(path: PathLike, options?: WatchOptions): () => void;
|
|
14
|
+
/**
|
|
15
|
+
* Stop watching a previously watched path
|
|
16
|
+
*/
|
|
17
|
+
unwatch(path: PathLike): void;
|
|
9
18
|
/**
|
|
10
19
|
* Update configuration options
|
|
11
20
|
*/
|
|
@@ -17,13 +26,21 @@ export declare class OPFSFileSystem {
|
|
|
17
26
|
/**
|
|
18
27
|
* Read a file from the file system
|
|
19
28
|
*/
|
|
20
|
-
readFile(path: PathLike, encoding:
|
|
21
|
-
readFile(path: PathLike, encoding:
|
|
22
|
-
readFile(path: PathLike,
|
|
29
|
+
readFile(path: PathLike, encoding: StringEncoding): Promise<string>;
|
|
30
|
+
readFile(path: PathLike, encoding: BinaryEncoding): Promise<Uint8Array>;
|
|
31
|
+
readFile(path: PathLike, options: {
|
|
32
|
+
encoding: StringEncoding;
|
|
33
|
+
}): Promise<string>;
|
|
34
|
+
readFile(path: PathLike, options: {
|
|
35
|
+
encoding: BinaryEncoding;
|
|
36
|
+
}): Promise<Uint8Array>;
|
|
37
|
+
readFile(path: PathLike): Promise<string | Uint8Array>;
|
|
23
38
|
/**
|
|
24
39
|
* Write data to a file
|
|
25
40
|
*/
|
|
26
|
-
writeFile(path: PathLike, data: string | Uint8Array | ArrayBuffer,
|
|
41
|
+
writeFile(path: PathLike, data: string | Uint8Array | ArrayBuffer, options?: {
|
|
42
|
+
encoding?: Encoding;
|
|
43
|
+
} | Encoding): Promise<void>;
|
|
27
44
|
/**
|
|
28
45
|
* Append data to a file
|
|
29
46
|
*/
|
|
@@ -31,7 +48,7 @@ export declare class OPFSFileSystem {
|
|
|
31
48
|
/**
|
|
32
49
|
* Create a directory
|
|
33
50
|
*/
|
|
34
|
-
mkdir(path: PathLike,
|
|
51
|
+
mkdir(path: PathLike, mode?: number | {
|
|
35
52
|
recursive?: boolean;
|
|
36
53
|
}): Promise<void>;
|
|
37
54
|
/**
|
|
@@ -57,6 +74,33 @@ export declare class OPFSFileSystem {
|
|
|
57
74
|
recursive?: boolean;
|
|
58
75
|
force?: boolean;
|
|
59
76
|
}): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Alias for remove() for NodeJS like API compatibility
|
|
79
|
+
*/
|
|
80
|
+
unlink(path: PathLike): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Alias for remove() for NodeJS like API compatibility
|
|
83
|
+
*/
|
|
84
|
+
rm(path: PathLike, options?: {
|
|
85
|
+
recursive?: boolean;
|
|
86
|
+
force?: boolean;
|
|
87
|
+
}): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* Alias for remove() for NodeJS like API compatibility
|
|
90
|
+
*/
|
|
91
|
+
rmdir(path: PathLike): Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* Alias for readDir() for NodeJS like API compatibility
|
|
94
|
+
*/
|
|
95
|
+
readdir(path: PathLike, _options?: unknown): Promise<DirentData[]>;
|
|
96
|
+
/**
|
|
97
|
+
* Alias for stat() for NodeJS like API compatibility
|
|
98
|
+
*/
|
|
99
|
+
lstat(path: PathLike): Promise<FileStat>;
|
|
100
|
+
/**
|
|
101
|
+
* Note: OPFS doesn't support file modes, so this is a no-op and exists only for compatibility with tools like isomorphic-git
|
|
102
|
+
*/
|
|
103
|
+
chmod(_path: PathLike, _mode: number): Promise<void>;
|
|
60
104
|
/**
|
|
61
105
|
* Resolve a path to an absolute path
|
|
62
106
|
*/
|
|
@@ -72,14 +116,6 @@ export declare class OPFSFileSystem {
|
|
|
72
116
|
recursive?: boolean;
|
|
73
117
|
overwrite?: boolean;
|
|
74
118
|
}): Promise<void>;
|
|
75
|
-
/**
|
|
76
|
-
* Start watching a file or directory for changes
|
|
77
|
-
*/
|
|
78
|
-
watch(path: PathLike, options?: WatchOptions): () => void;
|
|
79
|
-
/**
|
|
80
|
-
* Stop watching a previously watched path
|
|
81
|
-
*/
|
|
82
|
-
unwatch(path: PathLike): void;
|
|
83
119
|
/**
|
|
84
120
|
* Open a file and return a file descriptor
|
|
85
121
|
*/
|
package/dist/facade.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facade.d.ts","sourceRoot":"","sources":["../src/facade.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACR,UAAU,EACV,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,WAAW,EACX,QAAQ,EAER,aAAa,EACb,YAAY,EACf,MAAM,SAAS,CAAC;AAcjB;;;GAGG;AACH,qBAAa,cAAc;;
|
|
1
|
+
{"version":3,"file":"facade.d.ts","sourceRoot":"","sources":["../src/facade.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACR,cAAc,EACd,UAAU,EACV,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,WAAW,EACX,QAAQ,EAER,aAAa,EACb,cAAc,EACd,YAAY,EACf,MAAM,SAAS,CAAC;AAcjB;;;GAGG;AACH,qBAAa,cAAc;;IAEvB,QAAQ,EAAE,cAAc,CAAQ;gBAEpB,OAAO,CAAC,EAAE,WAAW;IAejC;;OAEG;IACH,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM,IAAI;IAQzD;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,QAAQ;IAMtB;;OAEG;IACG,UAAU,CAAC,OAAO,EAAE,WAAW;IAIrC;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAI7C;;OAEG;IAEG,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,GA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,IAAI,CAAC;IAMnF;;OAEG;IACG,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,GAAE,QAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAO7E;;OAEG;IACG,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,QAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAO1F;;OAEG;IACG,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,QAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;CAM9F"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";class g extends Error{constructor(t,e,s,r){super(t,{cause:r}),this.code=e,this.path=s,this.name="OPFSError"}}class Y extends g{constructor(t){super("OPFS is not supported in this browser","OPFS_NOT_SUPPORTED",void 0,t)}}class lt extends g{constructor(t){super("OPFS is not mounted","OPFS_NOT_MOUNTED",void 0,t)}}class ut extends g{constructor(t,e,s){super(t,"INVALID_PATH",e,s)}}class ft extends g{constructor(t,e){super(`File not found: ${t}`,"FILE_NOT_FOUND",t,e)}}class pt extends g{constructor(t,e){super(`Directory not found: ${t}`,"DIRECTORY_NOT_FOUND",t,e)}}class dt extends g{constructor(t,e,s){super(`Permission denied for ${e} on: ${t}`,"PERMISSION_DENIED",t,s)}}class gt extends g{constructor(t,e,s){super(t,"STORAGE_ERROR",e,s)}}class mt extends g{constructor(t,e,s){super(`Operation timed out: ${t}`,"TIMEOUT_ERROR",e,s)}}function wt(n,t,e,s){const r=`${n.toUpperCase()}_FAILED`;return new g(`Failed to ${n} file descriptor: ${t}`,r,e,s)}function Z(n,t){const e=t?.path,s=t?.isDirectory;switch(n.name){case"InvalidStateError":return new g(`File is busy: ${e||"unknown"}`,"EBUSY",e,n);case"QuotaExceededError":return new g(`No space left on device: ${e||"unknown"}`,"ENOSPC",e,n);case"NotFoundError":return new g(`No such file or directory: ${e||"unknown"}`,"ENOENT",e,n);case"TypeMismatchError":return s!==void 0?s?new g(`Not a directory: ${e||"unknown"}`,"ENOTDIR",e,n):new g(`Is a directory: ${e||"unknown"}`,"EISDIR",e,n):new g(`Type mismatch: ${e||"unknown"}`,"EINVAL",e,n);case"NotAllowedError":case"SecurityError":return new g(`Permission denied: ${e||"unknown"}`,"EACCES",e,n);case"InvalidModificationError":return new g(`Invalid modification: ${e||"unknown"}`,"EINVAL",e,n);case"AbortError":return new g(`Operation aborted: ${e||"unknown"}`,"EINTR",e,n);case"OperationError":return new g(`Operation failed: ${e||"unknown"}`,"EIO",e,n);case"TypeError":return new g(`Operation not supported: ${e||"unknown"}`,"ENOTSUP",e,n);default:return new g(`I/O error: ${e||"unknown"}`,"EIO",e,n)}}const X=[".jpg",".jpeg",".png",".gif",".bmp",".webp",".ico",".tiff",".tga",".mp3",".wav",".ogg",".flac",".aac",".wma",".m4a",".mp4",".avi",".mov",".wmv",".flv",".webm",".mkv",".m4v",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".zip",".rar",".7z",".tar",".gz",".bz2",".exe",".dll",".so",".dylib",".dat",".db",".sqlite",".bin",".obj",".fbx",".3ds"];function yt(n){const t=n.lastIndexOf(".");if(t<=0)return!0;const e=n.slice(t).toLowerCase();return X.includes(e)}function J(n,t="utf-8"){switch(t){case"utf8":case"utf-8":return new TextEncoder().encode(n);case"utf16le":case"utf-16le":case"ucs2":case"ucs-2":return St(n);case"ascii":return Ot(n);case"latin1":return Nt(n);case"binary":return Uint8Array.from(n,e=>e.charCodeAt(0));case"base64":return Uint8Array.from(atob(n),e=>e.charCodeAt(0));case"hex":if(!/^[\da-f]+$/i.test(n)||n.length%2!==0)throw new g("Invalid hex string","INVALID_HEX_FORMAT");return Uint8Array.from(n.match(/.{1,2}/g).map(e=>parseInt(e,16)));default:return console.warn("Encoding not supported, falling back to UTF-8"),new TextEncoder().encode(n)}}function Et(n,t="utf-8"){switch(t){case"utf8":case"utf-8":return new TextDecoder().decode(n);case"utf16le":case"utf-16le":case"ucs2":case"ucs-2":return xt(n);case"latin1":return String.fromCharCode(...n);case"ascii":return String.fromCharCode(...n.map(e=>e&127));case"base64":return btoa(String.fromCharCode(...n));case"hex":return Array.from(n).map(e=>e.toString(16).padStart(2,"0")).join("");default:return console.warn("Unsupported encoding, falling back to UTF-8"),new TextDecoder().decode(n)}}function St(n){const t=new Uint8Array(n.length*2);for(let e=0;e<n.length;e++){const s=n.charCodeAt(e);t[e*2]=s&255,t[e*2+1]=s>>8}return t}function xt(n){n.length%2!==0&&(console.warn("Invalid UTF-16LE buffer length, truncating last byte"),n=n.slice(0,n.length-1));const t=new Uint16Array(n.buffer,n.byteOffset,n.byteLength/2);return String.fromCharCode(...t)}function Nt(n){const t=new Uint8Array(n.length);for(let e=0;e<n.length;e++)t[e]=n.charCodeAt(e)&255;return t}function Ot(n){const t=new Uint8Array(n.length);for(let e=0;e<n.length;e++)t[e]=n.charCodeAt(e)&127;return t}var Q=(n=>(n.Added="added",n.Changed="changed",n.Removed="removed",n))(Q||{});const K=(n,t,e)=>{const s=n instanceof RegExp?z(n,e):n,r=t instanceof RegExp?z(t,e):t,i=s!==null&&r!=null&&bt(s,r,e);return i&&{start:i[0],end:i[1],pre:e.slice(0,i[0]),body:e.slice(i[0]+s.length,i[1]),post:e.slice(i[1]+r.length)}},z=(n,t)=>{const e=t.match(n);return e?e[0]:null},bt=(n,t,e)=>{let s,r,i,o,a,h=e.indexOf(n),l=e.indexOf(t,h+1),c=h;if(h>=0&&l>0){if(n===t)return[h,l];for(s=[],i=e.length;c>=0&&!a;){if(c===h)s.push(c),h=e.indexOf(n,c+1);else if(s.length===1){const p=s.pop();p!==void 0&&(a=[p,l])}else r=s.pop(),r!==void 0&&r<i&&(i=r,o=l),l=e.indexOf(t,c+1);c=h<l&&h>=0?h:l}s.length&&o!==void 0&&(a=[i,o])}return a},tt="\0SLASH"+Math.random()+"\0",et="\0OPEN"+Math.random()+"\0",F="\0CLOSE"+Math.random()+"\0",nt="\0COMMA"+Math.random()+"\0",st="\0PERIOD"+Math.random()+"\0",vt=new RegExp(tt,"g"),At=new RegExp(et,"g"),$t=new RegExp(F,"g"),Pt=new RegExp(nt,"g"),Tt=new RegExp(st,"g"),Mt=/\\\\/g,Rt=/\\{/g,It=/\\}/g,Ct=/\\,/g,Lt=/\\./g;function D(n){return isNaN(n)?n.charCodeAt(0):parseInt(n,10)}function Dt(n){return n.replace(Mt,tt).replace(Rt,et).replace(It,F).replace(Ct,nt).replace(Lt,st)}function Ft(n){return n.replace(vt,"\\").replace(At,"{").replace($t,"}").replace(Pt,",").replace(Tt,".")}function rt(n){if(!n)return[""];const t=[],e=K("{","}",n);if(!e)return n.split(",");const{pre:s,body:r,post:i}=e,o=s.split(",");o[o.length-1]+="{"+r+"}";const a=rt(i);return i.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),t.push.apply(t,o),t}function kt(n){return n?(n.slice(0,2)==="{}"&&(n="\\{\\}"+n.slice(2)),P(Dt(n),!0).map(Ft)):[]}function Ut(n){return"{"+n+"}"}function Wt(n){return/^-?0\d/.test(n)}function jt(n,t){return n<=t}function zt(n,t){return n>=t}function P(n,t){const e=[],s=K("{","}",n);if(!s)return[n];const r=s.pre,i=s.post.length?P(s.post,!1):[""];if(/\$$/.test(s.pre))for(let o=0;o<i.length;o++){const a=r+"{"+s.body+"}"+i[o];e.push(a)}else{const o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),a=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),h=o||a,l=s.body.indexOf(",")>=0;if(!h&&!l)return s.post.match(/,(?!,).*\}/)?(n=s.pre+"{"+s.body+F+s.post,P(n)):[n];let c;if(h)c=s.body.split(/\.\./);else if(c=rt(s.body),c.length===1&&c[0]!==void 0&&(c=P(c[0],!1).map(Ut),c.length===1))return i.map(f=>s.pre+c[0]+f);let p;if(h&&c[0]!==void 0&&c[1]!==void 0){const f=D(c[0]),u=D(c[1]),m=Math.max(c[0].length,c[1].length);let d=c.length===3&&c[2]!==void 0?Math.abs(D(c[2])):1,S=jt;u<f&&(d*=-1,S=zt);const v=c.some(Wt);p=[];for(let x=f;S(x,u);x+=d){let w;if(a)w=String.fromCharCode(x),w==="\\"&&(w="");else if(w=String(x),v){const A=m-w.length;if(A>0){const M=new Array(A+1).join("0");x<0?w="-"+M+w.slice(1):w=M+w}}p.push(w)}}else{p=[];for(let f=0;f<c.length;f++)p.push.apply(p,P(c[f],!1))}for(let f=0;f<p.length;f++)for(let u=0;u<i.length;u++){const m=r+p[f]+i[u];(!t||h||m)&&e.push(m)}}return e}const _t=1024*64,I=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>_t)throw new TypeError("pattern is too long")},Bt={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},$=n=>n.replace(/[[\]\\-]/g,"\\$&"),qt=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),_=n=>n.join(""),Gt=(n,t)=>{const e=t;if(n.charAt(e)!=="[")throw new Error("not in a brace expression");const s=[],r=[];let i=e+1,o=!1,a=!1,h=!1,l=!1,c=e,p="";t:for(;i<n.length;){const d=n.charAt(i);if((d==="!"||d==="^")&&i===e+1){l=!0,i++;continue}if(d==="]"&&o&&!h){c=i+1;break}if(o=!0,d==="\\"&&!h){h=!0,i++;continue}if(d==="["&&!h){for(const[S,[b,v,x]]of Object.entries(Bt))if(n.startsWith(S,i)){if(p)return["$.",!1,n.length-e,!0];i+=S.length,x?r.push(b):s.push(b),a=a||v;continue t}}if(h=!1,p){d>p?s.push($(p)+"-"+$(d)):d===p&&s.push($(d)),p="",i++;continue}if(n.startsWith("-]",i+1)){s.push($(d+"-")),i+=2;continue}if(n.startsWith("-",i+1)){p=d,i+=2;continue}s.push($(d)),i++}if(c<i)return["",!1,0,!1];if(!s.length&&!r.length)return["$.",!1,n.length-e,!0];if(r.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!l){const d=s[0].length===2?s[0].slice(-1):s[0];return[qt(d),!1,c-e,!1]}const f="["+(l?"^":"")+_(s)+"]",u="["+(l?"":"^")+_(r)+"]";return[s.length&&r.length?"("+f+"|"+u+")":s.length?f:u,a,c-e,!0]},T=(n,{windowsPathsNoEscape:t=!1}={})=>t?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),Ht=new Set(["!","?","+","*","@"]),B=n=>Ht.has(n),Vt="(?!(?:^|/)\\.\\.?(?:$|/))",R="(?!\\.)",Yt=new Set(["[","."]),Zt=new Set(["..","."]),Xt=new Set("().*{}+?[]^$\\!"),Jt=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),k="[^/]",q=k+"*?",G=k+"+?";class E{type;#n;#s;#i=!1;#t=[];#e;#o;#a;#c=!1;#r;#h;#u=!1;constructor(t,e,s={}){this.type=t,t&&(this.#s=!0),this.#e=e,this.#n=this.#e?this.#e.#n:this,this.#r=this.#n===this?s:this.#n.#r,this.#a=this.#n===this?[]:this.#n.#a,t==="!"&&!this.#n.#c&&this.#a.push(this),this.#o=this.#e?this.#e.#t.length:0}get hasMagic(){if(this.#s!==void 0)return this.#s;for(const t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#s=!0;return this.#s}toString(){return this.#h!==void 0?this.#h:this.type?this.#h=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#h=this.#t.map(t=>String(t)).join("")}#p(){if(this!==this.#n)throw new Error("should only call on root");if(this.#c)return this;this.toString(),this.#c=!0;let t;for(;t=this.#a.pop();){if(t.type!=="!")continue;let e=t,s=e.#e;for(;s;){for(let r=e.#o+1;!s.type&&r<s.#t.length;r++)for(const i of t.#t){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(s.#t[r])}e=s,s=e.#e}}return this}push(...t){for(const e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof E&&e.#e===this))throw new Error("invalid part: "+e);this.#t.push(e)}}toJSON(){const t=this.type===null?this.#t.slice().map(e=>typeof e=="string"?e:e.toJSON()):[this.type,...this.#t.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#c&&this.#e?.type==="!")&&t.push({}),t}isStart(){if(this.#n===this)return!0;if(!this.#e?.isStart())return!1;if(this.#o===0)return!0;const t=this.#e;for(let e=0;e<this.#o;e++){const s=t.#t[e];if(!(s instanceof E&&s.type==="!"))return!1}return!0}isEnd(){if(this.#n===this||this.#e?.type==="!")return!0;if(!this.#e?.isEnd())return!1;if(!this.type)return this.#e?.isEnd();const t=this.#e?this.#e.#t.length:0;return this.#o===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const e=new E(this.type,t);for(const s of this.#t)e.copyIn(s);return e}static#l(t,e,s,r){let i=!1,o=!1,a=-1,h=!1;if(e.type===null){let u=s,m="";for(;u<t.length;){const d=t.charAt(u++);if(i||d==="\\"){i=!i,m+=d;continue}if(o){u===a+1?(d==="^"||d==="!")&&(h=!0):d==="]"&&!(u===a+2&&h)&&(o=!1),m+=d;continue}else if(d==="["){o=!0,a=u,h=!1,m+=d;continue}if(!r.noext&&B(d)&&t.charAt(u)==="("){e.push(m),m="";const S=new E(d,e);u=E.#l(t,S,u,r),e.push(S);continue}m+=d}return e.push(m),u}let l=s+1,c=new E(null,e);const p=[];let f="";for(;l<t.length;){const u=t.charAt(l++);if(i||u==="\\"){i=!i,f+=u;continue}if(o){l===a+1?(u==="^"||u==="!")&&(h=!0):u==="]"&&!(l===a+2&&h)&&(o=!1),f+=u;continue}else if(u==="["){o=!0,a=l,h=!1,f+=u;continue}if(B(u)&&t.charAt(l)==="("){c.push(f),f="";const m=new E(u,c);c.push(m),l=E.#l(t,m,l,r);continue}if(u==="|"){c.push(f),f="",p.push(c),c=new E(null,e);continue}if(u===")")return f===""&&e.#t.length===0&&(e.#u=!0),c.push(f),f="",e.push(...p,c),l;f+=u}return e.type=null,e.#s=void 0,e.#t=[t.substring(s-1)],l}static fromGlob(t,e={}){const s=new E(null,void 0,e);return E.#l(t,s,0,e),s}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();const t=this.toString(),[e,s,r,i]=this.toRegExpSource();if(!(r||this.#s||this.#r.nocase&&!this.#r.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;const a=(this.#r.nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${e}$`,a),{_src:e,_glob:t})}get options(){return this.#r}toRegExpSource(t){const e=t??!!this.#r.dot;if(this.#n===this&&this.#p(),!this.type){const h=this.isStart()&&this.isEnd(),l=this.#t.map(u=>{const[m,d,S,b]=typeof u=="string"?E.#d(u,this.#s,h):u.toRegExpSource(t);return this.#s=this.#s||S,this.#i=this.#i||b,m}).join("");let c="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&Zt.has(this.#t[0]))){const m=Yt,d=e&&m.has(l.charAt(0))||l.startsWith("\\.")&&m.has(l.charAt(2))||l.startsWith("\\.\\.")&&m.has(l.charAt(4)),S=!e&&!t&&m.has(l.charAt(0));c=d?Vt:S?R:""}let p="";return this.isEnd()&&this.#n.#c&&this.#e?.type==="!"&&(p="(?:$|\\/)"),[c+l+p,T(l),this.#s=!!this.#s,this.#i]}const s=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:";let i=this.#f(e);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){const h=this.toString();return this.#t=[h],this.type=null,this.#s=void 0,[h,T(this.toString()),!1,!1]}let o=!s||t||e||!R?"":this.#f(!0);o===i&&(o=""),o&&(i=`(?:${i})(?:${o})*?`);let a="";if(this.type==="!"&&this.#u)a=(this.isStart()&&!e?R:"")+G;else{const h=this.type==="!"?"))"+(this.isStart()&&!e&&!t?R:"")+q+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=r+i+h}return[a,T(i),this.#s=!!this.#s,this.#i]}#f(t){return this.#t.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");const[s,r,i,o]=e.toRegExpSource(t);return this.#i=this.#i||o,s}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#d(t,e,s=!1){let r=!1,i="",o=!1;for(let a=0;a<t.length;a++){const h=t.charAt(a);if(r){r=!1,i+=(Xt.has(h)?"\\":"")+h;continue}if(h==="\\"){a===t.length-1?i+="\\\\":r=!0;continue}if(h==="["){const[l,c,p,f]=Gt(t,a);if(p){i+=l,o=o||c,a+=p-1,e=e||f;continue}}if(h==="*"){s&&t==="*"?i+=G:i+=q,e=!0;continue}if(h==="?"){i+=k,e=!0;continue}i+=Jt(h)}return[i,T(t),!!e,o]}}const Qt=(n,{windowsPathsNoEscape:t=!1}={})=>t?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&"),y=(n,t,e={})=>(I(t),!e.nocomment&&t.charAt(0)==="#"?!1:new C(t,e).match(n)),Kt=/^\*+([^+@!?\*\[\(]*)$/,te=n=>t=>!t.startsWith(".")&&t.endsWith(n),ee=n=>t=>t.endsWith(n),ne=n=>(n=n.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(n)),se=n=>(n=n.toLowerCase(),t=>t.toLowerCase().endsWith(n)),re=/^\*+\.\*+$/,ie=n=>!n.startsWith(".")&&n.includes("."),oe=n=>n!=="."&&n!==".."&&n.includes("."),ce=/^\.\*+$/,ae=n=>n!=="."&&n!==".."&&n.startsWith("."),he=/^\*+$/,le=n=>n.length!==0&&!n.startsWith("."),ue=n=>n.length!==0&&n!=="."&&n!=="..",fe=/^\?+([^+@!?\*\[\(]*)?$/,pe=([n,t=""])=>{const e=it([n]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},de=([n,t=""])=>{const e=ot([n]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},ge=([n,t=""])=>{const e=ot([n]);return t?s=>e(s)&&s.endsWith(t):e},me=([n,t=""])=>{const e=it([n]);return t?s=>e(s)&&s.endsWith(t):e},it=([n])=>{const t=n.length;return e=>e.length===t&&!e.startsWith(".")},ot=([n])=>{const t=n.length;return e=>e.length===t&&e!=="."&&e!==".."},ct=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",H={win32:{sep:"\\"},posix:{sep:"/"}},we=ct==="win32"?H.win32.sep:H.posix.sep;y.sep=we;const O=Symbol("globstar **");y.GLOBSTAR=O;const ye="[^/]",Ee=ye+"*?",Se="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",xe="(?:(?!(?:\\/|^)\\.).)*?",Ne=(n,t={})=>e=>y(e,n,t);y.filter=Ne;const N=(n,t={})=>Object.assign({},n,t),Oe=n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return y;const t=y;return Object.assign((s,r,i={})=>t(s,r,N(n,i)),{Minimatch:class extends t.Minimatch{constructor(r,i={}){super(r,N(n,i))}static defaults(r){return t.defaults(N(n,r)).Minimatch}},AST:class extends t.AST{constructor(r,i,o={}){super(r,i,N(n,o))}static fromGlob(r,i={}){return t.AST.fromGlob(r,N(n,i))}},unescape:(s,r={})=>t.unescape(s,N(n,r)),escape:(s,r={})=>t.escape(s,N(n,r)),filter:(s,r={})=>t.filter(s,N(n,r)),defaults:s=>t.defaults(N(n,s)),makeRe:(s,r={})=>t.makeRe(s,N(n,r)),braceExpand:(s,r={})=>t.braceExpand(s,N(n,r)),match:(s,r,i={})=>t.match(s,r,N(n,i)),sep:t.sep,GLOBSTAR:O})};y.defaults=Oe;const at=(n,t={})=>(I(n),t.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:kt(n));y.braceExpand=at;const be=(n,t={})=>new C(n,t).makeRe();y.makeRe=be;const ve=(n,t,e={})=>{const s=new C(t,e);return n=n.filter(r=>s.match(r)),s.options.nonull&&!n.length&&n.push(t),n};y.match=ve;const V=/[?*]|[+@!]\(.*?\)|\[|\]/,Ae=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class C{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){I(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||ct,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){const t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...i)=>console.error(...i)),this.debug(this.pattern,this.globSet);const s=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let r=this.globParts.map((i,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){const h=i[0]===""&&i[1]===""&&(i[2]==="?"||!V.test(i[2]))&&!V.test(i[3]),l=/^[a-z]:/i.test(i[0]);if(h)return[...i.slice(0,4),...i.slice(4).map(c=>this.parse(c))];if(l)return[i[0],...i.slice(1).map(c=>this.parse(c))]}return i.map(h=>this.parse(h))});if(this.debug(this.pattern,r),this.set=r.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){const o=this.set[i];o[0]===""&&o[1]===""&&this.globParts[i][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let s=0;s<t.length;s++)for(let r=0;r<t[s].length;r++)t[s][r]==="**"&&(t[s][r]="*");const{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let r=s;for(;e[r+1]==="**";)r++;r!==s&&e.splice(s,r-s)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((s,r)=>{const i=s[s.length-1];return r==="**"&&i==="**"?s:r===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(s.pop(),s):(s.push(r),s)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let r=1;r<t.length-1;r++){const i=t[r];r===1&&i===""&&t[0]===""||(i==="."||i==="")&&(e=!0,t.splice(r,1),r--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let s=0;for(;(s=t.indexOf("..",s+1))!==-1;){const r=t[s-1];r&&r!=="."&&r!==".."&&r!=="**"&&(e=!0,t.splice(s-1,2),s-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let s of t){let r=-1;for(;(r=s.indexOf("**",r+1))!==-1;){let o=r;for(;s[o+1]==="**";)o++;o>r&&s.splice(r+1,o-r);let a=s[r+1];const h=s[r+2],l=s[r+3];if(a!==".."||!h||h==="."||h===".."||!l||l==="."||l==="..")continue;e=!0,s.splice(r,1);const c=s.slice(0);c[r]="**",t.push(c),r--}if(!this.preserveMultipleSlashes){for(let o=1;o<s.length-1;o++){const a=s[o];o===1&&a===""&&s[0]===""||(a==="."||a==="")&&(e=!0,s.splice(o,1),o--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(e=!0,s.pop())}let i=0;for(;(i=s.indexOf("..",i+1))!==-1;){const o=s[i-1];if(o&&o!=="."&&o!==".."&&o!=="**"){e=!0;const h=i===1&&s[i+1]==="**"?["."]:[];s.splice(i-1,2,...h),s.length===0&&s.push(""),i-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let s=e+1;s<t.length;s++){const r=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);if(r){t[e]=[],t[s]=r;break}}return t.filter(e=>e.length)}partsMatch(t,e,s=!1){let r=0,i=0,o=[],a="";for(;r<t.length&&i<e.length;)if(t[r]===e[i])o.push(a==="b"?e[i]:t[r]),r++,i++;else if(s&&t[r]==="**"&&e[i]===t[r+1])o.push(t[r]),r++;else if(s&&e[i]==="**"&&t[r]===e[i+1])o.push(e[i]),i++;else if(t[r]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="b")return!1;a="a",o.push(t[r]),r++,i++}else if(e[i]==="*"&&t[r]&&(this.options.dot||!t[r].startsWith("."))&&t[r]!=="**"){if(a==="a")return!1;a="b",o.push(e[i]),r++,i++}else return!1;return t.length===e.length&&o}parseNegate(){if(this.nonegate)return;const t=this.pattern;let e=!1,s=0;for(let r=0;r<t.length&&t.charAt(r)==="!";r++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}matchOne(t,e,s=!1){const r=this.options;if(this.isWindows){const d=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),S=!d&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),b=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),v=!b&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),x=S?3:d?0:void 0,w=v?3:b?0:void 0;if(typeof x=="number"&&typeof w=="number"){const[A,M]=[t[x],e[w]];A.toLowerCase()===M.toLowerCase()&&(e[w]=A,w>x?e=e.slice(w):x>w&&(t=t.slice(x)))}}const{optimizationLevel:i=1}=this.options;i>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var o=0,a=0,h=t.length,l=e.length;o<h&&a<l;o++,a++){this.debug("matchOne loop");var c=e[a],p=t[o];if(this.debug(e,c,p),c===!1)return!1;if(c===O){this.debug("GLOBSTAR",[e,c,p]);var f=o,u=a+1;if(u===l){for(this.debug("** at the end");o<h;o++)if(t[o]==="."||t[o]===".."||!r.dot&&t[o].charAt(0)===".")return!1;return!0}for(;f<h;){var m=t[f];if(this.debug(`
|
|
2
|
+
globstar while`,t,f,e,u,m),this.matchOne(t.slice(f),e.slice(u),s))return this.debug("globstar found match!",f,h,m),!0;if(m==="."||m===".."||!r.dot&&m.charAt(0)==="."){this.debug("dot detected!",t,f,e,u);break}this.debug("globstar swallow a segment, and continue"),f++}return!!(s&&(this.debug(`
|
|
3
|
+
>>> no match, partial?`,t,f,e,u),f===h))}let d;if(typeof c=="string"?(d=p===c,this.debug("string match",c,p,d)):(d=c.test(p),this.debug("pattern match",c,p,d)),!d)return!1}if(o===h&&a===l)return!0;if(o===h)return s;if(a===l)return o===h-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return at(this.pattern,this.options)}parse(t){I(t);const e=this.options;if(t==="**")return O;if(t==="")return"";let s,r=null;(s=t.match(he))?r=e.dot?ue:le:(s=t.match(Kt))?r=(e.nocase?e.dot?se:ne:e.dot?ee:te)(s[1]):(s=t.match(fe))?r=(e.nocase?e.dot?de:pe:e.dot?ge:me)(s):(s=t.match(re))?r=e.dot?oe:ie:(s=t.match(ce))&&(r=ae);const i=E.fromGlob(t,this.options).toMMPattern();return r&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:r}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const e=this.options,s=e.noglobstar?Ee:e.dot?Se:xe,r=new Set(e.nocase?["i"]:[]);let i=t.map(h=>{const l=h.map(c=>{if(c instanceof RegExp)for(const p of c.flags.split(""))r.add(p);return typeof c=="string"?Ae(c):c===O?O:c._src});return l.forEach((c,p)=>{const f=l[p+1],u=l[p-1];c!==O||u===O||(u===void 0?f!==void 0&&f!==O?l[p+1]="(?:\\/|"+s+"\\/)?"+f:l[p]=s:f===void 0?l[p-1]=u+"(?:\\/|"+s+")?":f!==O&&(l[p-1]=u+"(?:\\/|\\/"+s+"\\/)"+f,l[p+1]=O))}),l.filter(c=>c!==O).join("/")}).join("|");const[o,a]=t.length>1?["(?:",")"]:["",""];i="^"+o+i+a+"$",this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...r].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;const s=this.options;this.isWindows&&(t=t.split("\\").join("/"));const r=this.slashSplit(t);this.debug(this.pattern,"split",r);const i=this.set;this.debug(this.pattern,"set",i);let o=r[r.length-1];if(!o)for(let a=r.length-2;!o&&a>=0;a--)o=r[a];for(let a=0;a<i.length;a++){const h=i[a];let l=r;if(s.matchBase&&h.length===1&&(l=[o]),this.matchOne(l,h,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return y.defaults(t).Minimatch}}y.AST=E;y.Minimatch=C;y.escape=Qt;y.unescape=T;function $e(){if(!("storage"in navigator)||!("getDirectory"in navigator.storage))throw new Y}async function ht(n,t,e){return typeof navigator<"u"&&navigator.locks?.request?navigator.locks.request(`opfs:${n.replace(/\/+/g,"/")}`,{mode:t},e):e()}function L(n){return Array.isArray(n)?n:(n.startsWith("~/")?n.slice(2):n).split("/").filter(Boolean)}function U(n){return typeof n=="string"?n??"/":`/${n.join("/")}`}function W(n){const t=L(n);return t[t.length-1]||""}function Pe(n){const t=L(n);return t.pop(),U(t)}function j(n){return!n||n==="/"?"/":n.startsWith("~/")?`/${n.slice(2)}`:n.startsWith("/")?n:`/${n}`}function Te(n,t=!1){return n=n.replace(/\/$/,""),t&&!n.includes("*")?`${n}/**`:n}function Me(n,t){return y(n,t,{dot:!0,matchBase:!0})}function Re(n,t){if(!t||Array.isArray(t)&&t.length===0)return!1;const e=j(n);return(Array.isArray(t)?t:[t]).some(r=>y(e,r,{dot:!0}))}function Ie(n){const t=j(n),e=L(t),s=[];for(const r of e)if(!(r==="."||r===""))if(r===".."){if(s.length===0)continue;s.pop()}else s.push(r);return U(s)}function Ce(n){const t=W(n),e=t.lastIndexOf(".");return e<=0||e===t.length-1?"":t.slice(e)}function Le(n,t="utf-8"){return typeof n=="string"?J(n,t):n instanceof Uint8Array?n:new Uint8Array(n)}async function De(n,t="SHA-1",e=50*1024*1024){if(n instanceof File&&(n=await n.arrayBuffer()),n.byteLength>e)throw new Error(`File size ${n.byteLength} bytes exceeds maximum allowed size ${e} bytes`);const s=new Uint8Array(n),r=await crypto.subtle.digest(t,s);return Array.from(new Uint8Array(r)).map(o=>o.toString(16).padStart(2,"0")).join("")}function Fe(n,t){if(n.length!==t.length)return!1;for(let e=0;e<n.length;e++)if(n[e]!==t[e])return!1;return!0}async function ke(n){const t=await n.arrayBuffer();return new Uint8Array(t)}async function Ue(n,t,e={}){const s=W(t);return ht(t,"exclusive",async()=>{const r=e.recursive??!1,i=e.force??!1;e.useTrash;try{await n.removeEntry(s,{recursive:r})}catch(o){if(o.name==="NotFoundError"){if(!i)throw new g(`No such file or directory: ${t}`,"ENOENT",void 0,o)}else throw o.name==="InvalidModificationError"?new g(`Directory not empty: ${t}. Use recursive option to force removal.`,"ENOTEMPTY",void 0,o):o.name==="TypeMismatchError"&&!r?new g(`Cannot remove directory without recursive option: ${t}`,"EISDIR",void 0,o):new g(`Failed to remove entry: ${t}`,"RM_FAILED",void 0,o)}})}function We(n,t,e,s){if(!Number.isInteger(t)||!Number.isInteger(e))throw new g("Invalid offset or length","EINVAL");if(t<0||e<0)throw new g("Negative offset or length not allowed","EINVAL");if(t+e>n)throw new g("Operation would overflow buffer","ERANGE");if(s!=null&&(!Number.isInteger(s)||s<0))throw new g("Invalid position","EINVAL")}function je(n,t,e){try{t.flush(),t.close()}catch(s){console.warn(`Warning: Failed to properly close file descriptor ${n} (${e}):`,s)}}function ze(n,t,e){if(n>=e)return{isEOF:!0,actualLength:0};const s=Math.min(t,e-n);return s<=0?{isEOF:!0,actualLength:0}:{isEOF:!1,actualLength:s}}async function _e(n,t){try{return await n.createSyncAccessHandle()}catch(e){throw Z(e,{path:t,isDirectory:!1})}}exports.BINARY_FILE_EXTENSIONS=X;exports.DirectoryNotFoundError=pt;exports.FileNotFoundError=ft;exports.OPFSError=g;exports.OPFSNotMountedError=lt;exports.OPFSNotSupportedError=Y;exports.PathError=ut;exports.PermissionError=dt;exports.StorageError=gt;exports.TimeoutError=mt;exports.WatchEventType=Q;exports.basename=W;exports.buffersEqual=Fe;exports.calculateFileHash=De;exports.calculateReadLength=ze;exports.checkOPFSSupport=$e;exports.convertBlobToUint8Array=ke;exports.createBuffer=Le;exports.createFDError=wt;exports.createSyncHandleSafe=_e;exports.decodeBuffer=Et;exports.dirname=Pe;exports.encodeString=J;exports.extname=Ce;exports.isBinaryFileExtension=yt;exports.isPathExcluded=Re;exports.joinPath=U;exports.mapDomError=Z;exports.matchMinimatch=Me;exports.normalizeMinimatch=Te;exports.normalizePath=j;exports.removeEntry=Ue;exports.resolvePath=Ie;exports.safeCloseSyncHandle=je;exports.splitPath=L;exports.validateReadWriteArgs=We;exports.withLock=ht;
|
|
4
|
+
//# sourceMappingURL=helpers-04x7UBul.cjs.map
|