Brunobkr/llama.cpp_AlgMor24_github
ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.
03.1k
1import CJS_COMPAT_NODE_URL_9zo2090uugq from 'node:url';2import CJS_COMPAT_NODE_PATH_9zo2090uugq from 'node:path';3import CJS_COMPAT_NODE_MODULE_9zo2090uugq from "node:module";4 5var __filename = CJS_COMPAT_NODE_URL_9zo2090uugq.fileURLToPath(import.meta.url);6var __dirname = CJS_COMPAT_NODE_PATH_9zo2090uugq.dirname(__filename);7var require = CJS_COMPAT_NODE_MODULE_9zo2090uugq.createRequire(import.meta.url);8 9// ------------------------------------------------------------10// end of CJS compatibility banner, injected by Storybook's esbuild configuration11// ------------------------------------------------------------12import {13 isTelemetryModuleEnabled,14 telemetry15} from "../_node-chunks/chunk-4YKGMOWJ.js";16import "../_node-chunks/chunk-2UHKX4RM.js";17import {18 CLAUDE_PREVIEW_AGENT_NAME,19 isClaudePreviewLaunch20} from "../_node-chunks/chunk-VPWNWE7A.js";21import {22 detectAgent23} from "../_node-chunks/chunk-5B7VJ5CO.js";24import "../_node-chunks/chunk-ZTBHFRMH.js";25import {26 execa,27 require_cross_spawn,28 resolveImport,29 supportedExtensions,30 userOrAutoTitleFromSpecifier31} from "../_node-chunks/chunk-DXKWFBLE.js";32import "../_node-chunks/chunk-IYYRBJ6A.js";33import "../_node-chunks/chunk-6IJC47ZF.js";34import {35 logger,36 require_pretty_hrtime37} from "../_node-chunks/chunk-HNCVUDZX.js";38import {39 UniversalStore,40 analyzeTestResults,41 debounce,42 defineService,43 docgenManifestRef,44 docgenStaticStorePath,45 fullTestProviderStore,46 generateStoryFile,47 getComponentCandidates,48 getErrorLevel,49 getStoryIdsByAbsolutePath,50 getTestProviderStoreById,51 getWsToken,52 mapStaticDir,53 parseStaticDir,54 resolveChangeDetectionAdapter,55 runStoryTests,56 sendTelemetryError,57 storyDocsManifestRef,58 storyDocsStaticStorePath,59 toStoryTestResult,60 universalTestProviderStore,61 useStatics,62 withTelemetry63} from "../_node-chunks/chunk-PUL3B5RN.js";64import "../_node-chunks/chunk-VF7RHUTK.js";65import "../_node-chunks/chunk-KLPIPE5T.js";66import "../_node-chunks/chunk-ICZ5TGZI.js";67import "../_node-chunks/chunk-D3SKCU36.js";68import {69 Channel,70 describeService,71 getRegisteredServices,72 getService,73 listServices,74 optionalEnvToBoolean,75 registerService,76 writeOpenServiceStaticFiles77} from "../_node-chunks/chunk-M4WPWXBW.js";78import "../_node-chunks/chunk-R4ZTPG4K.js";79import {80 Tag81} from "../_node-chunks/chunk-5VUPW2CE.js";82import "../_node-chunks/chunk-DAV6URMF.js";83import {84 UNIVERSAL_STATUS_STORE_OPTIONS,85 createStatusStore,86 detectPnp87} from "../_node-chunks/chunk-TL6AUD3A.js";88import {89 require_lib,90 require_src91} from "../_node-chunks/chunk-6RKCYWK4.js";92import "../_node-chunks/chunk-KIPVWN75.js";93import {94 invariant,95 up2 as up96} from "../_node-chunks/chunk-Q2H5WIGS.js";97import {98 importModule,99 resolvePackageDir100} from "../_node-chunks/chunk-P34EJWSD.js";101import "../_node-chunks/chunk-WBGUDDIU.js";102import "../_node-chunks/chunk-5OSVVXLI.js";103import {104 StorybookError105} from "../_node-chunks/chunk-7T7BCSOI.js";106import {107 require_dist108} from "../_node-chunks/chunk-RSQFAFCN.js";109import {110 require_picocolors111} from "../_node-chunks/chunk-SLGVGTWJ.js";112import {113 storyIndexPathToAbsolutePath114} from "../_node-chunks/chunk-WQRGS6PD.js";115import {116 dirname,117 isAbsolute,118 join,119 normalize,120 relative,121 resolve122} from "../_node-chunks/chunk-AN5PKEA2.js";123import {124 slash125} from "../_node-chunks/chunk-7NFVFFX4.js";126import "../_node-chunks/chunk-QBGVQW7M.js";127import {128 __commonJS,129 __esm,130 __export,131 __require,132 __toCommonJS,133 __toESM134} from "../_node-chunks/chunk-IATWEHFW.js";135 136// ../../node_modules/watchpack/lib/LinkResolver.js137var require_LinkResolver = __commonJS({138 "../../node_modules/watchpack/lib/LinkResolver.js"(exports, module) {139 "use strict";140 var fs = __require("fs"), path2 = __require("path"), EXPECTED_ERRORS = /* @__PURE__ */ new Set(["EINVAL", "ENOENT"]);141 process.platform === "win32" && EXPECTED_ERRORS.add("UNKNOWN");142 var LinkResolver = class {143 constructor() {144 this.cache = /* @__PURE__ */ new Map();145 }146 /**147 * @param {string} file path to file or directory148 * @returns {readonly string[]} array of file and all symlinks contributed in the resolving process (first item is the resolved file)149 */150 resolve(file) {151 let cacheEntry = this.cache.get(file);152 if (cacheEntry !== void 0)153 return cacheEntry;154 let parent = path2.dirname(file);155 if (parent === file) {156 let result = Object.freeze([file]);157 return this.cache.set(file, result), result;158 }159 let parentResolved = this.resolve(parent), realFile = file;160 if (parentResolved[0] !== parent) {161 let basename4 = path2.basename(file);162 realFile = path2.resolve(parentResolved[0], basename4);163 }164 try {165 let linkContent = fs.readlinkSync(realFile), resolvedLink = path2.resolve(parentResolved[0], linkContent), linkResolved = this.resolve(resolvedLink), result;166 if (linkResolved.length > 1 && parentResolved.length > 1) {167 let resultSet = new Set(linkResolved);168 resultSet.add(realFile);169 for (let i2 = 1; i2 < parentResolved.length; i2++)170 resultSet.add(parentResolved[i2]);171 result = Object.freeze([...resultSet]);172 } else parentResolved.length > 1 ? (result = [...parentResolved], result[0] = linkResolved[0], result.push(realFile), Object.freeze(result)) : linkResolved.length > 1 ? (result = [...linkResolved], result.push(realFile), Object.freeze(result)) : result = Object.freeze([173 // the resolve real location174 linkResolved[0],175 // add the link176 realFile177 ]);178 return this.cache.set(file, result), result;179 } catch (err) {180 if (181 /** @type {NodeJS.ErrnoException} */182 err.code && !EXPECTED_ERRORS.has(183 /** @type {NodeJS.ErrnoException} */184 err.code185 )186 )187 throw err;188 let result = [...parentResolved];189 return result[0] = realFile, Object.freeze(result), this.cache.set(file, result), result;190 }191 }192 };193 module.exports = LinkResolver;194 }195});196 197// ../../node_modules/graceful-fs/polyfills.js198var require_polyfills = __commonJS({199 "../../node_modules/graceful-fs/polyfills.js"(exports, module) {200 var constants = __require("constants"), origCwd = process.cwd, cwd = null, platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;201 process.cwd = function() {202 return cwd || (cwd = origCwd.call(process)), cwd;203 };204 try {205 process.cwd();206 } catch {207 }208 typeof process.chdir == "function" && (chdir = process.chdir, process.chdir = function(d) {209 cwd = null, chdir.call(process, d);210 }, Object.setPrototypeOf && Object.setPrototypeOf(process.chdir, chdir));211 var chdir;212 module.exports = patch;213 function patch(fs) {214 constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./) && patchLchmod(fs), fs.lutimes || patchLutimes(fs), fs.chown = chownFix(fs.chown), fs.fchown = chownFix(fs.fchown), fs.lchown = chownFix(fs.lchown), fs.chmod = chmodFix(fs.chmod), fs.fchmod = chmodFix(fs.fchmod), fs.lchmod = chmodFix(fs.lchmod), fs.chownSync = chownFixSync(fs.chownSync), fs.fchownSync = chownFixSync(fs.fchownSync), fs.lchownSync = chownFixSync(fs.lchownSync), fs.chmodSync = chmodFixSync(fs.chmodSync), fs.fchmodSync = chmodFixSync(fs.fchmodSync), fs.lchmodSync = chmodFixSync(fs.lchmodSync), fs.stat = statFix(fs.stat), fs.fstat = statFix(fs.fstat), fs.lstat = statFix(fs.lstat), fs.statSync = statFixSync(fs.statSync), fs.fstatSync = statFixSync(fs.fstatSync), fs.lstatSync = statFixSync(fs.lstatSync), fs.chmod && !fs.lchmod && (fs.lchmod = function(path2, mode, cb) {215 cb && process.nextTick(cb);216 }, fs.lchmodSync = function() {217 }), fs.chown && !fs.lchown && (fs.lchown = function(path2, uid, gid, cb) {218 cb && process.nextTick(cb);219 }, fs.lchownSync = function() {220 }), platform === "win32" && (fs.rename = typeof fs.rename != "function" ? fs.rename : (function(fs$rename) {221 function rename2(from, to, cb) {222 var start2 = Date.now(), backoff = 0;223 fs$rename(from, to, function CB(er) {224 if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start2 < 6e4) {225 setTimeout(function() {226 fs.stat(to, function(stater, st) {227 stater && stater.code === "ENOENT" ? fs$rename(from, to, CB) : cb(er);228 });229 }, backoff), backoff < 100 && (backoff += 10);230 return;231 }232 cb && cb(er);233 });234 }235 return Object.setPrototypeOf && Object.setPrototypeOf(rename2, fs$rename), rename2;236 })(fs.rename)), fs.read = typeof fs.read != "function" ? fs.read : (function(fs$read) {237 function read(fd, buffer, offset2, length, position2, callback_) {238 var callback;239 if (callback_ && typeof callback_ == "function") {240 var eagCounter = 0;241 callback = function(er, _, __) {242 if (er && er.code === "EAGAIN" && eagCounter < 10)243 return eagCounter++, fs$read.call(fs, fd, buffer, offset2, length, position2, callback);244 callback_.apply(this, arguments);245 };246 }247 return fs$read.call(fs, fd, buffer, offset2, length, position2, callback);248 }249 return Object.setPrototypeOf && Object.setPrototypeOf(read, fs$read), read;250 })(fs.read), fs.readSync = typeof fs.readSync != "function" ? fs.readSync : /* @__PURE__ */ (function(fs$readSync) {251 return function(fd, buffer, offset2, length, position2) {252 for (var eagCounter = 0; ; )253 try {254 return fs$readSync.call(fs, fd, buffer, offset2, length, position2);255 } catch (er) {256 if (er.code === "EAGAIN" && eagCounter < 10) {257 eagCounter++;258 continue;259 }260 throw er;261 }262 };263 })(fs.readSync);264 function patchLchmod(fs2) {265 fs2.lchmod = function(path2, mode, callback) {266 fs2.open(267 path2,268 constants.O_WRONLY | constants.O_SYMLINK,269 mode,270 function(err, fd) {271 if (err) {272 callback && callback(err);273 return;274 }275 fs2.fchmod(fd, mode, function(err2) {276 fs2.close(fd, function(err22) {277 callback && callback(err2 || err22);278 });279 });280 }281 );282 }, fs2.lchmodSync = function(path2, mode) {283 var fd = fs2.openSync(path2, constants.O_WRONLY | constants.O_SYMLINK, mode), threw = !0, ret;284 try {285 ret = fs2.fchmodSync(fd, mode), threw = !1;286 } finally {287 if (threw)288 try {289 fs2.closeSync(fd);290 } catch {291 }292 else293 fs2.closeSync(fd);294 }295 return ret;296 };297 }298 function patchLutimes(fs2) {299 constants.hasOwnProperty("O_SYMLINK") && fs2.futimes ? (fs2.lutimes = function(path2, at2, mt, cb) {300 fs2.open(path2, constants.O_SYMLINK, function(er, fd) {301 if (er) {302 cb && cb(er);303 return;304 }305 fs2.futimes(fd, at2, mt, function(er2) {306 fs2.close(fd, function(er22) {307 cb && cb(er2 || er22);308 });309 });310 });311 }, fs2.lutimesSync = function(path2, at2, mt) {312 var fd = fs2.openSync(path2, constants.O_SYMLINK), ret, threw = !0;313 try {314 ret = fs2.futimesSync(fd, at2, mt), threw = !1;315 } finally {316 if (threw)317 try {318 fs2.closeSync(fd);319 } catch {320 }321 else322 fs2.closeSync(fd);323 }324 return ret;325 }) : fs2.futimes && (fs2.lutimes = function(_a, _b, _c, cb) {326 cb && process.nextTick(cb);327 }, fs2.lutimesSync = function() {328 });329 }330 function chmodFix(orig) {331 return orig && function(target, mode, cb) {332 return orig.call(fs, target, mode, function(er) {333 chownErOk(er) && (er = null), cb && cb.apply(this, arguments);334 });335 };336 }337 function chmodFixSync(orig) {338 return orig && function(target, mode) {339 try {340 return orig.call(fs, target, mode);341 } catch (er) {342 if (!chownErOk(er)) throw er;343 }344 };345 }346 function chownFix(orig) {347 return orig && function(target, uid, gid, cb) {348 return orig.call(fs, target, uid, gid, function(er) {349 chownErOk(er) && (er = null), cb && cb.apply(this, arguments);350 });351 };352 }353 function chownFixSync(orig) {354 return orig && function(target, uid, gid) {355 try {356 return orig.call(fs, target, uid, gid);357 } catch (er) {358 if (!chownErOk(er)) throw er;359 }360 };361 }362 function statFix(orig) {363 return orig && function(target, options, cb) {364 typeof options == "function" && (cb = options, options = null);365 function callback(er, stats) {366 stats && (stats.uid < 0 && (stats.uid += 4294967296), stats.gid < 0 && (stats.gid += 4294967296)), cb && cb.apply(this, arguments);367 }368 return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback);369 };370 }371 function statFixSync(orig) {372 return orig && function(target, options) {373 var stats = options ? orig.call(fs, target, options) : orig.call(fs, target);374 return stats && (stats.uid < 0 && (stats.uid += 4294967296), stats.gid < 0 && (stats.gid += 4294967296)), stats;375 };376 }377 function chownErOk(er) {378 if (!er || er.code === "ENOSYS")379 return !0;380 var nonroot = !process.getuid || process.getuid() !== 0;381 return !!(nonroot && (er.code === "EINVAL" || er.code === "EPERM"));382 }383 }384 }385});386 387// ../../node_modules/graceful-fs/legacy-streams.js388var require_legacy_streams = __commonJS({389 "../../node_modules/graceful-fs/legacy-streams.js"(exports, module) {390 var Stream = __require("stream").Stream;391 module.exports = legacy;392 function legacy(fs) {393 return {394 ReadStream,395 WriteStream396 };397 function ReadStream(path2, options) {398 if (!(this instanceof ReadStream)) return new ReadStream(path2, options);399 Stream.call(this);400 var self2 = this;401 this.path = path2, this.fd = null, this.readable = !0, this.paused = !1, this.flags = "r", this.mode = 438, this.bufferSize = 64 * 1024, options = options || {};402 for (var keys = Object.keys(options), index2 = 0, length = keys.length; index2 < length; index2++) {403 var key2 = keys[index2];404 this[key2] = options[key2];405 }406 if (this.encoding && this.setEncoding(this.encoding), this.start !== void 0) {407 if (typeof this.start != "number")408 throw TypeError("start must be a Number");409 if (this.end === void 0)410 this.end = 1 / 0;411 else if (typeof this.end != "number")412 throw TypeError("end must be a Number");413 if (this.start > this.end)414 throw new Error("start must be <= end");415 this.pos = this.start;416 }417 if (this.fd !== null) {418 process.nextTick(function() {419 self2._read();420 });421 return;422 }423 fs.open(this.path, this.flags, this.mode, function(err, fd) {424 if (err) {425 self2.emit("error", err), self2.readable = !1;426 return;427 }428 self2.fd = fd, self2.emit("open", fd), self2._read();429 });430 }431 function WriteStream(path2, options) {432 if (!(this instanceof WriteStream)) return new WriteStream(path2, options);433 Stream.call(this), this.path = path2, this.fd = null, this.writable = !0, this.flags = "w", this.encoding = "binary", this.mode = 438, this.bytesWritten = 0, options = options || {};434 for (var keys = Object.keys(options), index2 = 0, length = keys.length; index2 < length; index2++) {435 var key2 = keys[index2];436 this[key2] = options[key2];437 }438 if (this.start !== void 0) {439 if (typeof this.start != "number")440 throw TypeError("start must be a Number");441 if (this.start < 0)442 throw new Error("start must be >= zero");443 this.pos = this.start;444 }445 this.busy = !1, this._queue = [], this.fd === null && (this._open = fs.open, this._queue.push([this._open, this.path, this.flags, this.mode, void 0]), this.flush());446 }447 }448 }449});450 451// ../../node_modules/graceful-fs/clone.js452var require_clone = __commonJS({453 "../../node_modules/graceful-fs/clone.js"(exports, module) {454 "use strict";455 module.exports = clone;456 var getPrototypeOf = Object.getPrototypeOf || function(obj) {457 return obj.__proto__;458 };459 function clone(obj) {460 if (obj === null || typeof obj != "object")461 return obj;462 if (obj instanceof Object)463 var copy = { __proto__: getPrototypeOf(obj) };464 else465 var copy = /* @__PURE__ */ Object.create(null);466 return Object.getOwnPropertyNames(obj).forEach(function(key2) {467 Object.defineProperty(copy, key2, Object.getOwnPropertyDescriptor(obj, key2));468 }), copy;469 }470 }471});472 473// ../../node_modules/graceful-fs/graceful-fs.js474var require_graceful_fs = __commonJS({475 "../../node_modules/graceful-fs/graceful-fs.js"(exports, module) {476 var fs = __require("fs"), polyfills = require_polyfills(), legacy = require_legacy_streams(), clone = require_clone(), util = __require("util"), gracefulQueue, previousSymbol;477 typeof Symbol == "function" && typeof Symbol.for == "function" ? (gracefulQueue = /* @__PURE__ */ Symbol.for("graceful-fs.queue"), previousSymbol = /* @__PURE__ */ Symbol.for("graceful-fs.previous")) : (gracefulQueue = "___graceful-fs.queue", previousSymbol = "___graceful-fs.previous");478 function noop() {479 }480 function publishQueue(context, queue2) {481 Object.defineProperty(context, gracefulQueue, {482 get: function() {483 return queue2;484 }485 });486 }487 var debug = noop;488 util.debuglog ? debug = util.debuglog("gfs4") : /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && (debug = function() {489 var m = util.format.apply(util, arguments);490 m = "GFS4: " + m.split(/\n/).join(`491GFS4: `), console.error(m);492 });493 fs[gracefulQueue] || (queue = global[gracefulQueue] || [], publishQueue(fs, queue), fs.close = (function(fs$close) {494 function close(fd, cb) {495 return fs$close.call(fs, fd, function(err) {496 err || resetQueue(), typeof cb == "function" && cb.apply(this, arguments);497 });498 }499 return Object.defineProperty(close, previousSymbol, {500 value: fs$close501 }), close;502 })(fs.close), fs.closeSync = (function(fs$closeSync) {503 function closeSync(fd) {504 fs$closeSync.apply(fs, arguments), resetQueue();505 }506 return Object.defineProperty(closeSync, previousSymbol, {507 value: fs$closeSync508 }), closeSync;509 })(fs.closeSync), /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && process.on("exit", function() {510 debug(fs[gracefulQueue]), __require("assert").equal(fs[gracefulQueue].length, 0);511 }));512 var queue;513 global[gracefulQueue] || publishQueue(global, fs[gracefulQueue]);514 module.exports = patch(clone(fs));515 process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched && (module.exports = patch(fs), fs.__patched = !0);516 function patch(fs2) {517 polyfills(fs2), fs2.gracefulify = patch, fs2.createReadStream = createReadStream, fs2.createWriteStream = createWriteStream2;518 var fs$readFile = fs2.readFile;519 fs2.readFile = readFile9;520 function readFile9(path2, options, cb) {521 return typeof options == "function" && (cb = options, options = null), go$readFile(path2, options, cb);522 function go$readFile(path3, options2, cb2, startTime) {523 return fs$readFile(path3, options2, function(err) {524 err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([go$readFile, [path3, options2, cb2], err, startTime || Date.now(), Date.now()]) : typeof cb2 == "function" && cb2.apply(this, arguments);525 });526 }527 }528 var fs$writeFile = fs2.writeFile;529 fs2.writeFile = writeFile6;530 function writeFile6(path2, data2, options, cb) {531 return typeof options == "function" && (cb = options, options = null), go$writeFile(path2, data2, options, cb);532 function go$writeFile(path3, data3, options2, cb2, startTime) {533 return fs$writeFile(path3, data3, options2, function(err) {534 err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([go$writeFile, [path3, data3, options2, cb2], err, startTime || Date.now(), Date.now()]) : typeof cb2 == "function" && cb2.apply(this, arguments);535 });536 }537 }538 var fs$appendFile = fs2.appendFile;539 fs$appendFile && (fs2.appendFile = appendFile);540 function appendFile(path2, data2, options, cb) {541 return typeof options == "function" && (cb = options, options = null), go$appendFile(path2, data2, options, cb);542 function go$appendFile(path3, data3, options2, cb2, startTime) {543 return fs$appendFile(path3, data3, options2, function(err) {544 err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([go$appendFile, [path3, data3, options2, cb2], err, startTime || Date.now(), Date.now()]) : typeof cb2 == "function" && cb2.apply(this, arguments);545 });546 }547 }548 var fs$copyFile = fs2.copyFile;549 fs$copyFile && (fs2.copyFile = copyFile);550 function copyFile(src, dest, flags, cb) {551 return typeof flags == "function" && (cb = flags, flags = 0), go$copyFile(src, dest, flags, cb);552 function go$copyFile(src2, dest2, flags2, cb2, startTime) {553 return fs$copyFile(src2, dest2, flags2, function(err) {554 err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]) : typeof cb2 == "function" && cb2.apply(this, arguments);555 });556 }557 }558 var fs$readdir = fs2.readdir;559 fs2.readdir = readdir2;560 var noReaddirOptionVersions = /^v[0-5]\./;561 function readdir2(path2, options, cb) {562 typeof options == "function" && (cb = options, options = null);563 var go$readdir = noReaddirOptionVersions.test(process.version) ? function(path3, options2, cb2, startTime) {564 return fs$readdir(path3, fs$readdirCallback(565 path3,566 options2,567 cb2,568 startTime569 ));570 } : function(path3, options2, cb2, startTime) {571 return fs$readdir(path3, options2, fs$readdirCallback(572 path3,573 options2,574 cb2,575 startTime576 ));577 };578 return go$readdir(path2, options, cb);579 function fs$readdirCallback(path3, options2, cb2, startTime) {580 return function(err, files) {581 err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([582 go$readdir,583 [path3, options2, cb2],584 err,585 startTime || Date.now(),586 Date.now()587 ]) : (files && files.sort && files.sort(), typeof cb2 == "function" && cb2.call(this, err, files));588 };589 }590 }591 if (process.version.substr(0, 4) === "v0.8") {592 var legStreams = legacy(fs2);593 ReadStream = legStreams.ReadStream, WriteStream = legStreams.WriteStream;594 }595 var fs$ReadStream = fs2.ReadStream;596 fs$ReadStream && (ReadStream.prototype = Object.create(fs$ReadStream.prototype), ReadStream.prototype.open = ReadStream$open);597 var fs$WriteStream = fs2.WriteStream;598 fs$WriteStream && (WriteStream.prototype = Object.create(fs$WriteStream.prototype), WriteStream.prototype.open = WriteStream$open), Object.defineProperty(fs2, "ReadStream", {599 get: function() {600 return ReadStream;601 },602 set: function(val) {603 ReadStream = val;604 },605 enumerable: !0,606 configurable: !0607 }), Object.defineProperty(fs2, "WriteStream", {608 get: function() {609 return WriteStream;610 },611 set: function(val) {612 WriteStream = val;613 },614 enumerable: !0,615 configurable: !0616 });617 var FileReadStream = ReadStream;618 Object.defineProperty(fs2, "FileReadStream", {619 get: function() {620 return FileReadStream;621 },622 set: function(val) {623 FileReadStream = val;624 },625 enumerable: !0,626 configurable: !0627 });628 var FileWriteStream = WriteStream;629 Object.defineProperty(fs2, "FileWriteStream", {630 get: function() {631 return FileWriteStream;632 },633 set: function(val) {634 FileWriteStream = val;635 },636 enumerable: !0,637 configurable: !0638 });639 function ReadStream(path2, options) {640 return this instanceof ReadStream ? (fs$ReadStream.apply(this, arguments), this) : ReadStream.apply(Object.create(ReadStream.prototype), arguments);641 }642 function ReadStream$open() {643 var that = this;644 open3(that.path, that.flags, that.mode, function(err, fd) {645 err ? (that.autoClose && that.destroy(), that.emit("error", err)) : (that.fd = fd, that.emit("open", fd), that.read());646 });647 }648 function WriteStream(path2, options) {649 return this instanceof WriteStream ? (fs$WriteStream.apply(this, arguments), this) : WriteStream.apply(Object.create(WriteStream.prototype), arguments);650 }651 function WriteStream$open() {652 var that = this;653 open3(that.path, that.flags, that.mode, function(err, fd) {654 err ? (that.destroy(), that.emit("error", err)) : (that.fd = fd, that.emit("open", fd));655 });656 }657 function createReadStream(path2, options) {658 return new fs2.ReadStream(path2, options);659 }660 function createWriteStream2(path2, options) {661 return new fs2.WriteStream(path2, options);662 }663 var fs$open = fs2.open;664 fs2.open = open3;665 function open3(path2, flags, mode, cb) {666 return typeof mode == "function" && (cb = mode, mode = null), go$open(path2, flags, mode, cb);667 function go$open(path3, flags2, mode2, cb2, startTime) {668 return fs$open(path3, flags2, mode2, function(err, fd) {669 err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([go$open, [path3, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]) : typeof cb2 == "function" && cb2.apply(this, arguments);670 });671 }672 }673 return fs2;674 }675 function enqueue(elem) {676 debug("ENQUEUE", elem[0].name, elem[1]), fs[gracefulQueue].push(elem), retry();677 }678 var retryTimer;679 function resetQueue() {680 for (var now = Date.now(), i2 = 0; i2 < fs[gracefulQueue].length; ++i2)681 fs[gracefulQueue][i2].length > 2 && (fs[gracefulQueue][i2][3] = now, fs[gracefulQueue][i2][4] = now);682 retry();683 }684 function retry() {685 if (clearTimeout(retryTimer), retryTimer = void 0, fs[gracefulQueue].length !== 0) {686 var elem = fs[gracefulQueue].shift(), fn = elem[0], args = elem[1], err = elem[2], startTime = elem[3], lastTime = elem[4];687 if (startTime === void 0)688 debug("RETRY", fn.name, args), fn.apply(null, args);689 else if (Date.now() - startTime >= 6e4) {690 debug("TIMEOUT", fn.name, args);691 var cb = args.pop();692 typeof cb == "function" && cb.call(null, err);693 } else {694 var sinceAttempt = Date.now() - lastTime, sinceStart = Math.max(lastTime - startTime, 1), desiredDelay = Math.min(sinceStart * 1.2, 100);695 sinceAttempt >= desiredDelay ? (debug("RETRY", fn.name, args), fn.apply(null, args.concat([startTime]))) : fs[gracefulQueue].push(elem);696 }697 retryTimer === void 0 && (retryTimer = setTimeout(retry, 0));698 }699 }700 }701});702 703// ../../node_modules/watchpack/lib/reducePlan.js704var require_reducePlan = __commonJS({705 "../../node_modules/watchpack/lib/reducePlan.js"(exports, module) {706 "use strict";707 var path2 = __require("path");708 module.exports = (plan, limit) => {709 let treeMap = /* @__PURE__ */ new Map();710 for (let [target, value] of plan)711 treeMap.set(target, {712 target,713 parent: void 0,714 children: void 0,715 entries: 1,716 active: !0,717 value718 });719 let currentCount = treeMap.size;720 for (let node2 of treeMap.values()) {721 let parentPath = path2.dirname(node2.target);722 if (parentPath !== node2.target) {723 let parent = treeMap.get(parentPath);724 if (parent === void 0)725 parent = {726 target: parentPath,727 parent: void 0,728 children: [node2],729 entries: node2.entries,730 active: !1,731 value: void 0732 }, treeMap.set(parentPath, parent), node2.parent = parent;733 else {734 node2.parent = parent, parent.children === void 0 ? parent.children = [node2] : parent.children.push(node2);735 do736 parent.entries += node2.entries, parent = parent.parent;737 while (parent);738 }739 }740 }741 if (currentCount > limit) {742 let candidates = /* @__PURE__ */ new Set();743 for (let node2 of treeMap.values())744 !node2.parent || !node2.children || node2.children.length !== 0 && (node2.children.length === 1 && !node2.value || candidates.add(node2));745 let costBias = limit * 0.3;746 for (; currentCount > limit; ) {747 let overLimit = currentCount - limit, bestNode, bestCost = 1 / 0;748 for (let node2 of candidates) {749 if (node2.entries <= 1) continue;750 let diff = node2.entries - 1 - overLimit, cost = diff >= 0 ? diff : -diff + costBias;751 if (cost < bestCost && (bestNode = node2, bestCost = cost, cost === 0))752 break;753 }754 if (!bestNode) break;755 let reduction = bestNode.entries - 1;756 bestNode.active = !0, bestNode.entries = 1, candidates.delete(bestNode), currentCount -= reduction;757 let { parent } = bestNode;758 for (; parent; )759 parent.entries -= reduction, parent = parent.parent;760 let queue = new Set(bestNode.children);761 for (let node2 of queue)762 if (node2.active = !1, node2.entries = 0, candidates.delete(node2), node2.children)763 for (let child of node2.children) queue.add(child);764 }765 }766 let newPlan = /* @__PURE__ */ new Map();767 for (let rootNode of treeMap.values()) {768 if (!rootNode.active) continue;769 let map = /* @__PURE__ */ new Map(), queue = /* @__PURE__ */ new Set([rootNode]);770 for (let node2 of queue)771 if (!(node2.active && node2 !== rootNode)) {772 if (node2.value)773 if (Array.isArray(node2.value))774 for (let item of node2.value)775 map.set(item, node2.target);776 else777 map.set(node2.value, node2.target);778 if (node2.children)779 for (let child of node2.children)780 queue.add(child);781 }782 newPlan.set(rootNode.target, map);783 }784 return newPlan;785 };786 }787});788 789// ../../node_modules/watchpack/lib/watchEventSource.js790var require_watchEventSource = __commonJS({791 "../../node_modules/watchpack/lib/watchEventSource.js"(exports, module) {792 "use strict";793 var { EventEmitter } = __require("events"), fs = __require("fs"), path2 = __require("path"), reducePlan = require_reducePlan(), IS_OSX = __require("os").platform() === "darwin", IS_WIN = __require("os").platform() === "win32", SUPPORTS_RECURSIVE_WATCHING = IS_OSX || IS_WIN, watcherLimit = (794 // @ts-expect-error avoid additional checks795 +process.env.WATCHPACK_WATCHER_LIMIT || (IS_OSX ? 20 : 1e4)796 ), recursiveWatcherLogging = !!process.env.WATCHPACK_RECURSIVE_WATCHER_LOGGING, isBatch = !1, watcherCount = 0, pendingWatchers = /* @__PURE__ */ new Map(), recursiveWatchers = /* @__PURE__ */ new Map(), directWatchers = /* @__PURE__ */ new Map(), underlyingWatcher = /* @__PURE__ */ new Map();797 function createEPERMError(filePath) {798 let error = (799 /** @type {NodeJS.ErrnoException} */800 new Error(`Operation not permitted: ${filePath}`)801 );802 return error.code = "EPERM", error;803 }804 function createHandleChangeEvent(watcher, filePath, handleChangeEvent) {805 let ownBasename = path2.basename(filePath);806 return (type, filename) => {807 if (type === "rename" && path2.isAbsolute(filename) && path2.basename(filename) === ownBasename) {808 IS_OSX || watcher.emit("error", createEPERMError(filename));809 return;810 }811 handleChangeEvent(type, filename);812 };813 }814 var DirectWatcher = class {815 /**816 * @param {string} filePath file path817 */818 constructor(filePath) {819 this.filePath = filePath, this.watchers = /* @__PURE__ */ new Set(), this.watcher = void 0;820 try {821 let watcher = fs.watch(filePath);822 this.watcher = watcher;823 let handleChangeEvent = createHandleChangeEvent(824 watcher,825 filePath,826 (type, filename) => {827 for (let w of this.watchers)828 w.emit("change", type, filename);829 }830 );831 watcher.on("change", handleChangeEvent), watcher.on("error", (error) => {832 for (let w of this.watchers)833 w.emit("error", error);834 });835 } catch (err) {836 process.nextTick(() => {837 for (let w of this.watchers)838 w.emit("error", err);839 });840 }841 watcherCount++;842 }843 /**844 * @param {Watcher} watcher a watcher845 */846 add(watcher) {847 underlyingWatcher.set(watcher, this), this.watchers.add(watcher);848 }849 /**850 * @param {Watcher} watcher a watcher851 */852 remove(watcher) {853 this.watchers.delete(watcher), this.watchers.size === 0 && (directWatchers.delete(this.filePath), watcherCount--, this.watcher && this.watcher.close());854 }855 getWatchers() {856 return this.watchers;857 }858 }, RecursiveWatcher = class {859 /**860 * @param {string} rootPath a root path861 */862 constructor(rootPath) {863 this.rootPath = rootPath, this.mapWatcherToPath = /* @__PURE__ */ new Map(), this.mapPathToWatchers = /* @__PURE__ */ new Map(), this.watcher = void 0;864 try {865 let watcher = fs.watch(rootPath, {866 recursive: !0867 });868 this.watcher = watcher, watcher.on("change", (type, filename) => {869 if (filename) {870 let dir = path2.dirname(871 /** @type {string} */872 filename873 ), watchers = this.mapPathToWatchers.get(dir);874 if (recursiveWatcherLogging && process.stderr.write(875 `[watchpack] dispatch ${type} event in recursive watcher (${this.rootPath}) for '${filename}' to ${watchers ? watchers.size : 0} watchers876`877 ), watchers === void 0) return;878 for (let w of watchers)879 w.emit(880 "change",881 /** @type {EventType} */882 type,883 path2.basename(884 /** @type {string} */885 filename886 )887 );888 } else {889 recursiveWatcherLogging && process.stderr.write(890 `[watchpack] dispatch ${type} event in recursive watcher (${this.rootPath}) to all watchers891`892 );893 for (let w of this.mapWatcherToPath.keys())894 w.emit(895 "change",896 /** @type {EventType} */897 type898 );899 }900 }), watcher.on("error", (error) => {901 for (let w of this.mapWatcherToPath.keys())902 w.emit("error", error);903 });904 } catch (err) {905 process.nextTick(() => {906 for (let w of this.mapWatcherToPath.keys())907 w.emit("error", err);908 });909 }910 watcherCount++, recursiveWatcherLogging && process.stderr.write(911 `[watchpack] created recursive watcher at ${rootPath}912`913 );914 }915 /**916 * @param {string} filePath a file path917 * @param {Watcher} watcher a watcher918 */919 add(filePath, watcher) {920 underlyingWatcher.set(watcher, this);921 let subpath = filePath.slice(this.rootPath.length + 1) || ".";922 this.mapWatcherToPath.set(watcher, subpath);923 let set = this.mapPathToWatchers.get(subpath);924 if (set === void 0) {925 let newSet = /* @__PURE__ */ new Set();926 newSet.add(watcher), this.mapPathToWatchers.set(subpath, newSet);927 } else928 set.add(watcher);929 }930 /**931 * @param {Watcher} watcher a watcher932 */933 remove(watcher) {934 let subpath = this.mapWatcherToPath.get(watcher);935 if (!subpath) return;936 this.mapWatcherToPath.delete(watcher);937 let set = (938 /** @type {WatcherSet} */939 this.mapPathToWatchers.get(subpath)940 );941 set.delete(watcher), set.size === 0 && this.mapPathToWatchers.delete(subpath), this.mapWatcherToPath.size === 0 && (recursiveWatchers.delete(this.rootPath), watcherCount--, this.watcher && this.watcher.close(), recursiveWatcherLogging && process.stderr.write(942 `[watchpack] closed recursive watcher at ${this.rootPath}943`944 ));945 }946 getWatchers() {947 return this.mapWatcherToPath;948 }949 }, Watcher = class extends EventEmitter {950 constructor() {951 super();952 }953 close() {954 if (pendingWatchers.has(this)) {955 pendingWatchers.delete(this);956 return;957 }958 underlyingWatcher.get(this).remove(this), underlyingWatcher.delete(this);959 }960 }, createDirectWatcher = (filePath) => {961 let existing = directWatchers.get(filePath);962 if (existing !== void 0) return existing;963 let w = new DirectWatcher(filePath);964 return directWatchers.set(filePath, w), w;965 }, createRecursiveWatcher = (rootPath) => {966 let existing = recursiveWatchers.get(rootPath);967 if (existing !== void 0) return existing;968 let w = new RecursiveWatcher(rootPath);969 return recursiveWatchers.set(rootPath, w), w;970 }, execute = () => {971 let map = /* @__PURE__ */ new Map(), addWatcher = (watcher, filePath) => {972 let entry = map.get(filePath);973 entry === void 0 ? map.set(filePath, watcher) : Array.isArray(entry) ? entry.push(watcher) : map.set(filePath, [entry, watcher]);974 };975 for (let [watcher, filePath] of pendingWatchers)976 addWatcher(watcher, filePath);977 if (pendingWatchers.clear(), !SUPPORTS_RECURSIVE_WATCHING || watcherLimit - watcherCount >= map.size) {978 for (let [filePath, entry] of map) {979 let w = createDirectWatcher(filePath);980 if (Array.isArray(entry))981 for (let item of entry) w.add(item);982 else983 w.add(entry);984 }985 return;986 }987 for (let watcher of recursiveWatchers.values())988 for (let [w, subpath] of watcher.getWatchers())989 addWatcher(w, path2.join(watcher.rootPath, subpath));990 for (let watcher of directWatchers.values())991 for (let w of watcher.getWatchers())992 addWatcher(w, watcher.filePath);993 let plan = reducePlan(map, watcherLimit * 0.9);994 for (let [filePath, entry] of plan)995 if (entry.size === 1)996 for (let [watcher, filePath2] of entry) {997 let w = createDirectWatcher(filePath2), old = underlyingWatcher.get(watcher);998 old !== w && (w.add(watcher), old !== void 0 && old.remove(watcher));999 }1000 else {1001 let filePaths = new Set(entry.values());1002 if (filePaths.size > 1) {1003 let w = createRecursiveWatcher(filePath);1004 for (let [watcher, watcherPath] of entry) {1005 let old = underlyingWatcher.get(watcher);1006 old !== w && (w.add(watcherPath, watcher), old !== void 0 && old.remove(watcher));1007 }1008 } else1009 for (let filePath2 of filePaths) {1010 let w = createDirectWatcher(filePath2);1011 for (let watcher of entry.keys()) {1012 let old = underlyingWatcher.get(watcher);1013 old !== w && (w.add(watcher), old !== void 0 && old.remove(watcher));1014 }1015 }1016 }1017 };1018 module.exports.Watcher = Watcher;1019 module.exports.batch = (fn) => {1020 isBatch = !0;1021 try {1022 fn();1023 } finally {1024 isBatch = !1, execute();1025 }1026 };1027 module.exports.createHandleChangeEvent = createHandleChangeEvent;1028 module.exports.getNumberOfWatchers = () => watcherCount;1029 module.exports.watch = (filePath) => {1030 let watcher = new Watcher(), directWatcher = directWatchers.get(filePath);1031 if (directWatcher !== void 0)1032 return directWatcher.add(watcher), watcher;1033 if (recursiveWatchers.size !== 0) {1034 let current2 = filePath;1035 for (; ; ) {1036 let recursiveWatcher = recursiveWatchers.get(current2);1037 if (recursiveWatcher !== void 0)1038 return recursiveWatcher.add(filePath, watcher), watcher;1039 let parent = path2.dirname(current2);1040 if (parent === current2) break;1041 current2 = parent;1042 }1043 }1044 return pendingWatchers.set(watcher, filePath), isBatch || execute(), watcher;1045 };1046 module.exports.watcherLimit = watcherLimit;1047 }1048});1049 1050// ../../node_modules/watchpack/lib/DirectoryWatcher.js1051var require_DirectoryWatcher = __commonJS({1052 "../../node_modules/watchpack/lib/DirectoryWatcher.js"(exports, module) {1053 "use strict";1054 var { EventEmitter } = __require("events"), path2 = __require("path"), fs = require_graceful_fs(), watchEventSource = require_watchEventSource(), EXISTANCE_ONLY_TIME_ENTRY = Object.freeze({}), FS_ACCURACY = 2e3, IS_OSX = __require("os").platform() === "darwin", IS_WIN = __require("os").platform() === "win32", { WATCHPACK_POLLING, WATCHPACK_RETRIES } = process.env, FORCE_POLLING = (1055 // @ts-expect-error avoid additional checks1056 `${+WATCHPACK_POLLING}` === WATCHPACK_POLLING ? +WATCHPACK_POLLING : !!WATCHPACK_POLLING && WATCHPACK_POLLING !== "false"1057 ), BUSY_RETRIES = (() => {1058 if (WATCHPACK_RETRIES === void 0) return 3;1059 if (WATCHPACK_RETRIES === "false") return 0;1060 let n = Number(WATCHPACK_RETRIES);1061 return Number.isFinite(n) && n >= 0 ? Math.floor(n) : 3;1062 })(), BUSY_RETRY_DELAY = 100;1063 function withoutCase(str) {1064 return str.toLowerCase();1065 }1066 function needCalls(times, callback) {1067 return function() {1068 if (--times === 0)1069 return callback();1070 };1071 }1072 function fixupEntryAccuracy(entry) {1073 entry.accuracy > FS_ACCURACY && (entry.safeTime = entry.safeTime - entry.accuracy + FS_ACCURACY, entry.accuracy = FS_ACCURACY);1074 }1075 function ensureFsAccuracy(mtime) {1076 mtime && (FS_ACCURACY > 1 && mtime % 1 !== 0 ? FS_ACCURACY = 1 : FS_ACCURACY > 10 && mtime % 10 !== 0 ? FS_ACCURACY = 10 : FS_ACCURACY > 100 && mtime % 100 !== 0 ? FS_ACCURACY = 100 : FS_ACCURACY > 1e3 && mtime % 1e3 !== 0 && (FS_ACCURACY = 1e3));1077 }1078 function lstatWithRetry(target, watcher, callback, remaining = BUSY_RETRIES) {1079 fs.lstat(target, (err, stats) => {1080 if (err && /** @type {NodeJS.ErrnoException} */1081 err.code === "EBUSY" && remaining > 0 && !watcher.closed) {1082 setTimeout(1083 () => lstatWithRetry(target, watcher, callback, remaining - 1),1084 BUSY_RETRY_DELAY1085 );1086 return;1087 }1088 callback(err, stats);1089 });1090 }1091 var Watcher = class extends EventEmitter {1092 /**1093 * @param {DirectoryWatcher} directoryWatcher a directory watcher1094 * @param {string} target a target to watch1095 * @param {number=} startTime start time1096 */1097 constructor(directoryWatcher, target, startTime) {1098 super(), this.directoryWatcher = directoryWatcher, this.path = target, this.startTime = startTime && +startTime;1099 }1100 /**1101 * @param {number} mtime mtime1102 * @param {boolean} initial true when initial, otherwise false1103 * @returns {boolean} true of start time less than mtile, otherwise false1104 */1105 checkStartTime(mtime, initial) {1106 let { startTime } = this;1107 return typeof startTime != "number" ? !initial : startTime <= mtime;1108 }1109 close() {1110 this.emit("closed");1111 }1112 }, DirectoryWatcher = class extends EventEmitter {1113 /**1114 * @param {WatcherManager} watcherManager a watcher manager1115 * @param {string} directoryPath directory path1116 * @param {DirectoryWatcherOptions=} options options1117 */1118 constructor(watcherManager, directoryPath, options = {}) {1119 super(), FORCE_POLLING && (options.poll = FORCE_POLLING), this.watcherManager = watcherManager, this.options = options, this.path = directoryPath, this.files = /* @__PURE__ */ new Map(), this.filesWithoutCase = /* @__PURE__ */ new Map(), this.directories = /* @__PURE__ */ new Map(), this._symlinkTargetWatchers = /* @__PURE__ */ new Map(), this.lastWatchEvent = 0, this.initialScan = !0, this.ignored = options.ignored || (() => !1), this.nestedWatching = !1, this.polledWatching = typeof options.poll == "number" ? options.poll : options.poll ? 5007 : !1, this.timeout = void 0, this.initialScanRemoved = /* @__PURE__ */ new Set(), this.initialScanFinished = void 0, this.watchers = /* @__PURE__ */ new Map(), this.parentWatcher = null, this.refs = 0, this._activeEvents = /* @__PURE__ */ new Map(), this.closed = !1, this.scanning = !1, this.scanAgain = !1, this.scanAgainInitial = !1, this.createWatcher(), this.doScan(!0);1120 }1121 createWatcher() {1122 try {1123 this.polledWatching ? this.watcher = /** @type {EventSourceWatcher} */1124 {1125 close: () => {1126 this.timeout && (clearTimeout(this.timeout), this.timeout = void 0);1127 }1128 } : (IS_OSX && this.watchInParentDirectory(), this.watcher = /** @type {EventSourceWatcher} */1129 watchEventSource.watch(this.path), this.watcher.on("change", this.onWatchEvent.bind(this)), this.watcher.on("error", this.onWatcherError.bind(this)));1130 } catch (err) {1131 this.onWatcherError(err);1132 }1133 }1134 /**1135 * @template {(watcher: Watcher<EventMap>) => void} T1136 * @param {string} path path1137 * @param {T} fn function1138 */1139 forEachWatcher(path3, fn) {1140 let watchers = this.watchers.get(withoutCase(path3));1141 if (watchers !== void 0)1142 for (let w of watchers)1143 fn(w);1144 }1145 /**1146 * @param {string} itemPath an item path1147 * @param {boolean} initial true when initial, otherwise false1148 * @param {EventType} type even type1149 */1150 setMissing(itemPath, initial, type) {1151 this.initialScan && this.initialScanRemoved.add(itemPath);1152 let oldDirectory = this.directories.get(itemPath);1153 if (oldDirectory && (this.nestedWatching && oldDirectory.close(), this.directories.delete(itemPath), this.forEachWatcher(itemPath, (w) => w.emit("remove", type)), initial || this.forEachWatcher(1154 this.path,1155 (w) => w.emit("change", itemPath, null, type, initial)1156 )), this.files.get(itemPath)) {1157 this.files.delete(itemPath);1158 let key2 = withoutCase(itemPath), count = (1159 /** @type {number} */1160 this.filesWithoutCase.get(key2) - 11161 );1162 count <= 0 ? (this.filesWithoutCase.delete(key2), this.forEachWatcher(itemPath, (w) => w.emit("remove", type))) : this.filesWithoutCase.set(key2, count), initial || this.forEachWatcher(1163 this.path,1164 (w) => w.emit("change", itemPath, null, type, initial)1165 );1166 }1167 }1168 /**1169 * @param {string} target a target to set file time1170 * @param {number} mtime mtime1171 * @param {boolean} initial true when initial, otherwise false1172 * @param {boolean} ignoreWhenEqual true to ignore when equal, otherwise false1173 * @param {EventType} type type1174 */1175 setFileTime(target, mtime, initial, ignoreWhenEqual, type) {1176 let now = Date.now();1177 if (this.ignored(target)) return;1178 let old = this.files.get(target), safeTime, accuracy;1179 if (initial)1180 safeTime = Math.min(now, mtime) + FS_ACCURACY, accuracy = FS_ACCURACY;1181 else if (safeTime = now, accuracy = 0, old && old.timestamp === mtime && mtime + FS_ACCURACY < now)1182 return;1183 if (!(ignoreWhenEqual && old && old.timestamp === mtime)) {1184 if (this.files.set(target, {1185 safeTime,1186 accuracy,1187 timestamp: mtime1188 }), old)1189 initial || this.forEachWatcher(target, (w) => w.emit("change", mtime, type));1190 else {1191 let key2 = withoutCase(target), count = this.filesWithoutCase.get(key2);1192 this.filesWithoutCase.set(key2, (count || 0) + 1), count !== void 0 && this.doScan(!1), this.forEachWatcher(target, (w) => {1193 (!initial || w.checkStartTime(safeTime, initial)) && w.emit("change", mtime, type);1194 });1195 }1196 this.forEachWatcher(this.path, (w) => {1197 (!initial || w.checkStartTime(safeTime, initial)) && w.emit("change", target, safeTime, type, initial);1198 });1199 }1200 }