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AdA,QAAQ,UAAY,UAepB,QAAQ,QAAU,CAAE,YAAO","file":"/npm/chokidar@4.0.3/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/chokidar@4.0.3/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FSWatcher = exports.WatchHelper = void 0;\nexports.watch = watch;\n/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */\nconst fs_1 = require(\"fs\");\nconst promises_1 = require(\"fs/promises\");\nconst events_1 = require(\"events\");\nconst sysPath = require(\"path\");\nconst readdirp_1 = require(\"readdirp\");\nconst handler_js_1 = require(\"./handler.js\");\nconst SLASH = '/';\nconst SLASH_SLASH = '//';\nconst ONE_DOT = '.';\nconst TWO_DOTS = '..';\nconst STRING_TYPE = 'string';\nconst BACK_SLASH_RE = /\\\\/g;\nconst DOUBLE_SLASH_RE = /\\/\\//;\nconst DOT_RE = /\\..*\\.(sw[px])$|~$|\\.subl.*\\.tmp/;\nconst REPLACER_RE = /^\\.[/\\\\]/;\nfunction arrify(item) {\n    return Array.isArray(item) ? item : [item];\n}\nconst isMatcherObject = (matcher) => typeof matcher === 'object' && matcher !== null && !(matcher instanceof RegExp);\nfunction createPattern(matcher) {\n    if (typeof matcher === 'function')\n        return matcher;\n    if (typeof matcher === 'string')\n        return (string) => matcher === string;\n    if (matcher instanceof RegExp)\n        return (string) => matcher.test(string);\n    if (typeof matcher === 'object' && matcher !== null) {\n        return (string) => {\n            if (matcher.path === string)\n                return true;\n            if (matcher.recursive) {\n                const relative = sysPath.relative(matcher.path, string);\n                if (!relative) {\n                    return false;\n                }\n                return !relative.startsWith('..') && !sysPath.isAbsolute(relative);\n            }\n            return false;\n        };\n    }\n    return () => false;\n}\nfunction normalizePath(path) {\n    if (typeof path !== 'string')\n        throw new Error('string expected');\n    path = sysPath.normalize(path);\n    path = path.replace(/\\\\/g, '/');\n    let prepend = false;\n    if (path.startsWith('//'))\n        prepend = true;\n    const DOUBLE_SLASH_RE = /\\/\\//;\n    while (path.match(DOUBLE_SLASH_RE))\n        path = path.replace(DOUBLE_SLASH_RE, '/');\n    if (prepend)\n        path = '/' + path;\n    return path;\n}\nfunction matchPatterns(patterns, testString, stats) {\n    const path = normalizePath(testString);\n    for (let index = 0; index < patterns.length; index++) {\n        const pattern = patterns[index];\n        if (pattern(path, stats)) {\n            return true;\n        }\n    }\n    return false;\n}\nfunction anymatch(matchers, testString) {\n    if (matchers == null) {\n        throw new TypeError('anymatch: specify first argument');\n    }\n    // Early cache for matchers.\n    const matchersArray = arrify(matchers);\n    const patterns = matchersArray.map((matcher) => createPattern(matcher));\n    if (testString == null) {\n        return (testString, stats) => {\n            return matchPatterns(patterns, testString, stats);\n        };\n    }\n    return matchPatterns(patterns, testString);\n}\nconst unifyPaths = (paths_) => {\n    const paths = arrify(paths_).flat();\n    if (!paths.every((p) => typeof p === STRING_TYPE)) {\n        throw new TypeError(`Non-string provided as watch path: ${paths}`);\n    }\n    return paths.map(normalizePathToUnix);\n};\n// If SLASH_SLASH occurs at the beginning of path, it is not replaced\n//     because \"//StoragePC/DrivePool/Movies\" is a valid network path\nconst toUnix = (string) => {\n    let str = string.replace(BACK_SLASH_RE, SLASH);\n    let prepend = false;\n    if (str.startsWith(SLASH_SLASH)) {\n        prepend = true;\n    }\n    while (str.match(DOUBLE_SLASH_RE)) {\n        str = str.replace(DOUBLE_SLASH_RE, SLASH);\n    }\n    if (prepend) {\n        str = SLASH + str;\n    }\n    return str;\n};\n// Our version of upath.normalize\n// TODO: this is not equal to path-normalize module - investigate why\nconst normalizePathToUnix = (path) => toUnix(sysPath.normalize(toUnix(path)));\n// TODO: refactor\nconst normalizeIgnored = (cwd = '') => (path) => {\n    if (typeof path === 'string') {\n        return normalizePathToUnix(sysPath.isAbsolute(path) ? path : sysPath.join(cwd, path));\n    }\n    else {\n        return path;\n    }\n};\nconst getAbsolutePath = (path, cwd) => {\n    if (sysPath.isAbsolute(path)) {\n        return path;\n    }\n    return sysPath.join(cwd, path);\n};\nconst EMPTY_SET = Object.freeze(new Set());\n/**\n * Directory entry.\n */\nclass DirEntry {\n    constructor(dir, removeWatcher) {\n        this.path = dir;\n        this._removeWatcher = removeWatcher;\n        this.items = new Set();\n    }\n    add(item) {\n        const { items } = this;\n        if (!items)\n            return;\n        if (item !== ONE_DOT && item !== TWO_DOTS)\n            items.add(item);\n    }\n    async remove(item) {\n        const { items } = this;\n        if (!items)\n            return;\n        items.delete(item);\n        if (items.size > 0)\n            return;\n        const dir = this.path;\n        try {\n            await (0, promises_1.readdir)(dir);\n        }\n        catch (err) {\n            if (this._removeWatcher) {\n                this._removeWatcher(sysPath.dirname(dir), sysPath.basename(dir));\n            }\n        }\n    }\n    has(item) {\n        const { items } = this;\n        if (!items)\n            return;\n        return items.has(item);\n    }\n    getChildren() {\n        const { items } = this;\n        if (!items)\n            return [];\n        return [...items.values()];\n    }\n    dispose() {\n        this.items.clear();\n        this.path = '';\n        this._removeWatcher = handler_js_1.EMPTY_FN;\n        this.items = EMPTY_SET;\n        Object.freeze(this);\n    }\n}\nconst STAT_METHOD_F = 'stat';\nconst STAT_METHOD_L = 'lstat';\nclass WatchHelper {\n    constructor(path, follow, fsw) {\n        this.fsw = fsw;\n        const watchPath = path;\n        this.path = path = path.replace(REPLACER_RE, '');\n        this.watchPath = watchPath;\n        this.fullWatchPath = sysPath.resolve(watchPath);\n        this.dirParts = [];\n        this.dirParts.forEach((parts) => {\n            if (parts.length > 1)\n                parts.pop();\n        });\n        this.followSymlinks = follow;\n        this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;\n    }\n    entryPath(entry) {\n        return sysPath.join(this.watchPath, sysPath.relative(this.watchPath, entry.fullPath));\n    }\n    filterPath(entry) {\n        const { stats } = entry;\n        if (stats && stats.isSymbolicLink())\n            return this.filterDir(entry);\n        const resolvedPath = this.entryPath(entry);\n        // TODO: what if stats is undefined? remove !\n        return this.fsw._isntIgnored(resolvedPath, stats) && this.fsw._hasReadPermissions(stats);\n    }\n    filterDir(entry) {\n        return this.fsw._isntIgnored(this.entryPath(entry), entry.stats);\n    }\n}\nexports.WatchHelper = WatchHelper;\n/**\n * Watches files & directories for changes. Emitted events:\n * `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `all`, `error`\n *\n *     new FSWatcher()\n *       .add(directories)\n *       .on('add', path => log('File', path, 'was added'))\n */\nclass FSWatcher extends events_1.EventEmitter {\n    // Not indenting methods for history sake; for now.\n    constructor(_opts = {}) {\n        super();\n        this.closed = false;\n        this._closers = new Map();\n        this._ignoredPaths = new Set();\n        this._throttled = new Map();\n        this._streams = new Set();\n        this._symlinkPaths = new Map();\n        this._watched = new Map();\n        this._pendingWrites = new Map();\n        this._pendingUnlinks = new Map();\n        this._readyCount = 0;\n        this._readyEmitted = false;\n        const awf = _opts.awaitWriteFinish;\n        const DEF_AWF = { stabilityThreshold: 2000, pollInterval: 100 };\n        const opts = {\n            // Defaults\n            persistent: true,\n            ignoreInitial: false,\n            ignorePermissionErrors: false,\n            interval: 100,\n            binaryInterval: 300,\n            followSymlinks: true,\n            usePolling: false,\n            // useAsync: false,\n            atomic: true, // NOTE: overwritten later (depends on usePolling)\n            ..._opts,\n            // Change format\n            ignored: _opts.ignored ? arrify(_opts.ignored) : arrify([]),\n            awaitWriteFinish: awf === true ? DEF_AWF : typeof awf === 'object' ? { ...DEF_AWF, ...awf } : false,\n        };\n        // Always default to polling on IBM i because fs.watch() is not available on IBM i.\n        if (handler_js_1.isIBMi)\n            opts.usePolling = true;\n        // Editor atomic write normalization enabled by default with fs.watch\n        if (opts.atomic === undefined)\n            opts.atomic = !opts.usePolling;\n        // opts.atomic = typeof _opts.atomic === 'number' ? _opts.atomic : 100;\n        // Global override. Useful for developers, who need to force polling for all\n        // instances of chokidar, regardless of usage / dependency depth\n        const envPoll = process.env.CHOKIDAR_USEPOLLING;\n        if (envPoll !== undefined) {\n            const envLower = envPoll.toLowerCase();\n            if (envLower === 'false' || envLower === '0')\n                opts.usePolling = false;\n            else if (envLower === 'true' || envLower === '1')\n                opts.usePolling = true;\n            else\n                opts.usePolling = !!envLower;\n        }\n        const envInterval = process.env.CHOKIDAR_INTERVAL;\n        if (envInterval)\n            opts.interval = Number.parseInt(envInterval, 10);\n        // This is done to emit ready only once, but each 'add' will increase that?\n        let readyCalls = 0;\n        this._emitReady = () => {\n            readyCalls++;\n            if (readyCalls >= this._readyCount) {\n                this._emitReady = handler_js_1.EMPTY_FN;\n                this._readyEmitted = true;\n                // use process.nextTick to allow time for listener to be bound\n                process.nextTick(() => this.emit(handler_js_1.EVENTS.READY));\n            }\n        };\n        this._emitRaw = (...args) => this.emit(handler_js_1.EVENTS.RAW, ...args);\n        this._boundRemove = this._remove.bind(this);\n        this.options = opts;\n        this._nodeFsHandler = new handler_js_1.NodeFsHandler(this);\n        // You’re frozen when your heart’s not open.\n        Object.freeze(opts);\n    }\n    _addIgnoredPath(matcher) {\n        if (isMatcherObject(matcher)) {\n            // return early if we already have a deeply equal matcher object\n            for (const ignored of this._ignoredPaths) {\n                if (isMatcherObject(ignored) &&\n                    ignored.path === matcher.path &&\n                    ignored.recursive === matcher.recursive) {\n                    return;\n                }\n            }\n        }\n        this._ignoredPaths.add(matcher);\n    }\n    _removeIgnoredPath(matcher) {\n        this._ignoredPaths.delete(matcher);\n        // now find any matcher objects with the matcher as path\n        if (typeof matcher === 'string') {\n            for (const ignored of this._ignoredPaths) {\n                // TODO (43081j): make this more efficient.\n                // probably just make a `this._ignoredDirectories` or some\n                // such thing.\n                if (isMatcherObject(ignored) && ignored.path === matcher) {\n                    this._ignoredPaths.delete(ignored);\n                }\n            }\n        }\n    }\n    // Public methods\n    /**\n     * Adds paths to be watched on an existing FSWatcher instance.\n     * @param paths_ file or file list. Other arguments are unused\n     */\n    add(paths_, _origAdd, _internal) {\n        const { cwd } = this.options;\n        this.closed = false;\n        this._closePromise = undefined;\n        let paths = unifyPaths(paths_);\n        if (cwd) {\n            paths = paths.map((path) => {\n                const absPath = getAbsolutePath(path, cwd);\n                // Check `path` instead of `absPath` because the cwd portion can't be a glob\n                return absPath;\n            });\n        }\n        paths.forEach((path) => {\n            this._removeIgnoredPath(path);\n        });\n        this._userIgnored = undefined;\n        if (!this._readyCount)\n            this._readyCount = 0;\n        this._readyCount += paths.length;\n        Promise.all(paths.map(async (path) => {\n            const res = await this._nodeFsHandler._addToNodeFs(path, !_internal, undefined, 0, _origAdd);\n            if (res)\n                this._emitReady();\n            return res;\n        })).then((results) => {\n            if (this.closed)\n                return;\n            results.forEach((item) => {\n                if (item)\n                    this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item));\n            });\n        });\n        return this;\n    }\n    /**\n     * Close watchers or start ignoring events from specified paths.\n     */\n    unwatch(paths_) {\n        if (this.closed)\n            return this;\n        const paths = unifyPaths(paths_);\n        const { cwd } = this.options;\n        paths.forEach((path) => {\n            // convert to absolute path unless relative path already matches\n            if (!sysPath.isAbsolute(path) && !this._closers.has(path)) {\n                if (cwd)\n                    path = sysPath.join(cwd, path);\n                path = sysPath.resolve(path);\n            }\n            this._closePath(path);\n            this._addIgnoredPath(path);\n            if (this._watched.has(path)) {\n                this._addIgnoredPath({\n                    path,\n                    recursive: true,\n                });\n            }\n            // reset the cached userIgnored anymatch fn\n            // to make ignoredPaths changes effective\n            this._userIgnored = undefined;\n        });\n        return this;\n    }\n    /**\n     * Close watchers and remove all listeners from watched paths.\n     */\n    close() {\n        if (this._closePromise) {\n            return this._closePromise;\n        }\n        this.closed = true;\n        // Memory management.\n        this.removeAllListeners();\n        const closers = [];\n        this._closers.forEach((closerList) => closerList.forEach((closer) => {\n            const promise = closer();\n            if (promise instanceof Promise)\n                closers.push(promise);\n        }));\n        this._streams.forEach((stream) => stream.destroy());\n        this._userIgnored = undefined;\n        this._readyCount = 0;\n        this._readyEmitted = false;\n        this._watched.forEach((dirent) => dirent.dispose());\n        this._closers.clear();\n        this._watched.clear();\n        this._streams.clear();\n        this._symlinkPaths.clear();\n        this._throttled.clear();\n        this._closePromise = closers.length\n            ? Promise.all(closers).then(() => undefined)\n            : Promise.resolve();\n        return this._closePromise;\n    }\n    /**\n     * Expose list of watched paths\n     * @returns for chaining\n     */\n    getWatched() {\n        const watchList = {};\n        this._watched.forEach((entry, dir) => {\n            const key = this.options.cwd ? sysPath.relative(this.options.cwd, dir) : dir;\n            const index = key || ONE_DOT;\n            watchList[index] = entry.getChildren().sort();\n        });\n        return watchList;\n    }\n    emitWithAll(event, args) {\n        this.emit(event, ...args);\n        if (event !== handler_js_1.EVENTS.ERROR)\n            this.emit(handler_js_1.EVENTS.ALL, event, ...args);\n    }\n    // Common helpers\n    // --------------\n    /**\n     * Normalize and emit events.\n     * Calling _emit DOES NOT MEAN emit() would be called!\n     * @param event Type of event\n     * @param path File or directory path\n     * @param stats arguments to be passed with event\n     * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag\n     */\n    async _emit(event, path, stats) {\n        if (this.closed)\n            return;\n        const opts = this.options;\n        if (handler_js_1.isWindows)\n            path = sysPath.normalize(path);\n        if (opts.cwd)\n            path = sysPath.relative(opts.cwd, path);\n        const args = [path];\n        if (stats != null)\n            args.push(stats);\n        const awf = opts.awaitWriteFinish;\n        let pw;\n        if (awf && (pw = this._pendingWrites.get(path))) {\n            pw.lastChange = new Date();\n            return this;\n        }\n        if (opts.atomic) {\n            if (event === handler_js_1.EVENTS.UNLINK) {\n                this._pendingUnlinks.set(path, [event, ...args]);\n                setTimeout(() => {\n                    this._pendingUnlinks.forEach((entry, path) => {\n                        this.emit(...entry);\n                        this.emit(handler_js_1.EVENTS.ALL, ...entry);\n                        this._pendingUnlinks.delete(path);\n                    });\n                }, typeof opts.atomic === 'number' ? opts.atomic : 100);\n                return this;\n            }\n            if (event === handler_js_1.EVENTS.ADD && this._pendingUnlinks.has(path)) {\n                event = handler_js_1.EVENTS.CHANGE;\n                this._pendingUnlinks.delete(path);\n            }\n        }\n        if (awf && (event === handler_js_1.EVENTS.ADD || event === handler_js_1.EVENTS.CHANGE) && this._readyEmitted) {\n            const awfEmit = (err, stats) => {\n                if (err) {\n                    event = handler_js_1.EVENTS.ERROR;\n                    args[0] = err;\n                    this.emitWithAll(event, args);\n                }\n                else if (stats) {\n                    // if stats doesn't exist the file must have been deleted\n                    if (args.length > 1) {\n                        args[1] = stats;\n                    }\n                    else {\n                        args.push(stats);\n                    }\n                    this.emitWithAll(event, args);\n                }\n            };\n            this._awaitWriteFinish(path, awf.stabilityThreshold, event, awfEmit);\n            return this;\n        }\n        if (event === handler_js_1.EVENTS.CHANGE) {\n            const isThrottled = !this._throttle(handler_js_1.EVENTS.CHANGE, path, 50);\n            if (isThrottled)\n                return this;\n        }\n        if (opts.alwaysStat &&\n            stats === undefined &&\n            (event === handler_js_1.EVENTS.ADD || event === handler_js_1.EVENTS.ADD_DIR || event === handler_js_1.EVENTS.CHANGE)) {\n            const fullPath = opts.cwd ? sysPath.join(opts.cwd, path) : path;\n            let stats;\n            try {\n                stats = await (0, promises_1.stat)(fullPath);\n            }\n            catch (err) {\n                // do nothing\n            }\n            // Suppress event when fs_stat fails, to avoid sending undefined 'stat'\n            if (!stats || this.closed)\n                return;\n            args.push(stats);\n        }\n        this.emitWithAll(event, args);\n        return this;\n    }\n    /**\n     * Common handler for errors\n     * @returns The error if defined, otherwise the value of the FSWatcher instance's `closed` flag\n     */\n    _handleError(error) {\n        const code = error && error.code;\n        if (error &&\n            code !== 'ENOENT' &&\n            code !== 'ENOTDIR' &&\n            (!this.options.ignorePermissionErrors || (code !== 'EPERM' && code !== 'EACCES'))) {\n            this.emit(handler_js_1.EVENTS.ERROR, error);\n        }\n        return error || this.closed;\n    }\n    /**\n     * Helper utility for throttling\n     * @param actionType type being throttled\n     * @param path being acted upon\n     * @param timeout duration of time to suppress duplicate actions\n     * @returns tracking object or false if action should be suppressed\n     */\n    _throttle(actionType, path, timeout) {\n        if (!this._throttled.has(actionType)) {\n            this._throttled.set(actionType, new Map());\n        }\n        const action = this._throttled.get(actionType);\n        if (!action)\n            throw new Error('invalid throttle');\n        const actionPath = action.get(path);\n        if (actionPath) {\n            actionPath.count++;\n            return false;\n        }\n        // eslint-disable-next-line prefer-const\n        let timeoutObject;\n        const clear = () => {\n            const item = action.get(path);\n            const count = item ? item.count : 0;\n            action.delete(path);\n            clearTimeout(timeoutObject);\n            if (item)\n                clearTimeout(item.timeoutObject);\n            return count;\n        };\n        timeoutObject = setTimeout(clear, timeout);\n        const thr = { timeoutObject, clear, count: 0 };\n        action.set(path, thr);\n        return thr;\n    }\n    _incrReadyCount() {\n        return this._readyCount++;\n    }\n    /**\n     * Awaits write operation to finish.\n     * Polls a newly created file for size variations. When files size does not change for 'threshold' milliseconds calls callback.\n     * @param path being acted upon\n     * @param threshold Time in milliseconds a file size must be fixed before acknowledging write OP is finished\n     * @param event\n     * @param awfEmit Callback to be called when ready for event to be emitted.\n     */\n    _awaitWriteFinish(path, threshold, event, awfEmit) {\n        const awf = this.options.awaitWriteFinish;\n        if (typeof awf !== 'object')\n            return;\n        const pollInterval = awf.pollInterval;\n        let timeoutHandler;\n        let fullPath = path;\n        if (this.options.cwd && !sysPath.isAbsolute(path)) {\n            fullPath = sysPath.join(this.options.cwd, path);\n        }\n        const now = new Date();\n        const writes = this._pendingWrites;\n        function awaitWriteFinishFn(prevStat) {\n            (0, fs_1.stat)(fullPath, (err, curStat) => {\n                if (err || !writes.has(path)) {\n                    if (err && err.code !== 'ENOENT')\n                        awfEmit(err);\n                    return;\n                }\n                const now = Number(new Date());\n                if (prevStat && curStat.size !== prevStat.size) {\n                    writes.get(path).lastChange = now;\n                }\n                const pw = writes.get(path);\n                const df = now - pw.lastChange;\n                if (df >= threshold) {\n                    writes.delete(path);\n                    awfEmit(undefined, curStat);\n                }\n                else {\n                    timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);\n                }\n            });\n        }\n        if (!writes.has(path)) {\n            writes.set(path, {\n                lastChange: now,\n                cancelWait: () => {\n                    writes.delete(path);\n                    clearTimeout(timeoutHandler);\n                    return event;\n                },\n            });\n            timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval);\n        }\n    }\n    /**\n     * Determines whether user has asked to ignore this path.\n     */\n    _isIgnored(path, stats) {\n        if (this.options.atomic && DOT_RE.test(path))\n            return true;\n        if (!this._userIgnored) {\n            const { cwd } = this.options;\n            const ign = this.options.ignored;\n            const ignored = (ign || []).map(normalizeIgnored(cwd));\n            const ignoredPaths = [...this._ignoredPaths];\n            const list = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];\n            this._userIgnored = anymatch(list, undefined);\n        }\n        return this._userIgnored(path, stats);\n    }\n    _isntIgnored(path, stat) {\n        return !this._isIgnored(path, stat);\n    }\n    /**\n     * Provides a set of common helpers and properties relating to symlink handling.\n     * @param path file or directory pattern being watched\n     */\n    _getWatchHelpers(path) {\n        return new WatchHelper(path, this.options.followSymlinks, this);\n    }\n    // Directory helpers\n    // -----------------\n    /**\n     * Provides directory tracking objects\n     * @param directory path of the directory\n     */\n    _getWatchedDir(directory) {\n        const dir = sysPath.resolve(directory);\n        if (!this._watched.has(dir))\n            this._watched.set(dir, new DirEntry(dir, this._boundRemove));\n        return this._watched.get(dir);\n    }\n    // File helpers\n    // ------------\n    /**\n     * Check for read permissions: https://stackoverflow.com/a/11781404/1358405\n     */\n    _hasReadPermissions(stats) {\n        if (this.options.ignorePermissionErrors)\n            return true;\n        return Boolean(Number(stats.mode) & 0o400);\n    }\n    /**\n     * Handles emitting unlink events for\n     * files and directories, and via recursion, for\n     * files and directories within directories that are unlinked\n     * @param directory within which the following item is located\n     * @param item      base path of item/directory\n     */\n    _remove(directory, item, isDirectory) {\n        // if what is being deleted is a directory, get that directory's paths\n        // for recursive deleting and cleaning of watched object\n        // if it is not a directory, nestedDirectoryChildren will be empty array\n        const path = sysPath.join(directory, item);\n        const fullPath = sysPath.resolve(path);\n        isDirectory =\n            isDirectory != null ? isDirectory : this._watched.has(path) || this._watched.has(fullPath);\n        // prevent duplicate handling in case of arriving here nearly simultaneously\n        // via multiple paths (such as _handleFile and _handleDir)\n        if (!this._throttle('remove', path, 100))\n            return;\n        // if the only watched file is removed, watch for its return\n        if (!isDirectory && this._watched.size === 1) {\n            this.add(directory, item, true);\n        }\n        // This will create a new entry in the watched object in either case\n        // so we got to do the directory check beforehand\n        const wp = this._getWatchedDir(path);\n        const nestedDirectoryChildren = wp.getChildren();\n        // Recursively remove children directories / files.\n        nestedDirectoryChildren.forEach((nested) => this._remove(path, nested));\n        // Check if item was on the watched list and remove it\n        const parent = this._getWatchedDir(directory);\n        const wasTracked = parent.has(item);\n        parent.remove(item);\n        // Fixes issue #1042 -> Relative paths were detected and added as symlinks\n        // (https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L612),\n        // but never removed from the map in case the path was deleted.\n        // This leads to an incorrect state if the path was recreated:\n        // https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L553\n        if (this._symlinkPaths.has(fullPath)) {\n            this._symlinkPaths.delete(fullPath);\n        }\n        // If we wait for this file to be fully written, cancel the wait.\n        let relPath = path;\n        if (this.options.cwd)\n            relPath = sysPath.relative(this.options.cwd, path);\n        if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {\n            const event = this._pendingWrites.get(relPath).cancelWait();\n            if (event === handler_js_1.EVENTS.ADD)\n                return;\n        }\n        // The Entry will either be a directory that just got removed\n        // or a bogus entry to a file, in either case we have to remove it\n        this._watched.delete(path);\n        this._watched.delete(fullPath);\n        const eventName = isDirectory ? handler_js_1.EVENTS.UNLINK_DIR : handler_js_1.EVENTS.UNLINK;\n        if (wasTracked && !this._isIgnored(path))\n            this._emit(eventName, path);\n        // Avoid conflicts if we later create another file with the same name\n        this._closePath(path);\n    }\n    /**\n     * Closes all watchers for a path\n     */\n    _closePath(path) {\n        this._closeFile(path);\n        const dir = sysPath.dirname(path);\n        this._getWatchedDir(dir).remove(sysPath.basename(path));\n    }\n    /**\n     * Closes only file-specific watchers\n     */\n    _closeFile(path) {\n        const closers = this._closers.get(path);\n        if (!closers)\n            return;\n        closers.forEach((closer) => closer());\n        this._closers.delete(path);\n    }\n    _addPathCloser(path, closer) {\n        if (!closer)\n            return;\n        let list = this._closers.get(path);\n        if (!list) {\n            list = [];\n            this._closers.set(path, list);\n        }\n        list.push(closer);\n    }\n    _readdirp(root, opts) {\n        if (this.closed)\n            return;\n        const options = { type: handler_js_1.EVENTS.ALL, alwaysStat: true, lstat: true, ...opts, depth: 0 };\n        let stream = (0, readdirp_1.readdirp)(root, options);\n        this._streams.add(stream);\n        stream.once(handler_js_1.STR_CLOSE, () => {\n            stream = undefined;\n        });\n        stream.once(handler_js_1.STR_END, () => {\n            if (stream) {\n                this._streams.delete(stream);\n                stream = undefined;\n            }\n        });\n        return stream;\n    }\n}\nexports.FSWatcher = FSWatcher;\n/**\n * Instantiates watcher with paths to be tracked.\n * @param paths file / directory paths\n * @param options opts, such as `atomic`, `awaitWriteFinish`, `ignored`, and others\n * @returns an instance of FSWatcher for chaining.\n * @example\n * const watcher = watch('.').on('all', (event, path) => { console.log(event, path); });\n * watch('.', { atomic: true, awaitWriteFinish: true, ignored: (f, stats) => stats?.isFile() && !f.endsWith('.js') })\n */\nfunction watch(paths, options = {}) {\n    const watcher = new FSWatcher(options);\n    watcher.add(paths);\n    return watcher;\n}\nexports.default = { watch, FSWatcher };\n"]}