{"version":3,"file":"_internal.mjs","names":["assertArg","assertArg","assertArg"],"sources":["../src/shared/internal/codec.ts","../src/shared/internal/helpers.ts","../node_modules/.pnpm/@jsr+std__path@1.1.6/node_modules/@jsr/std__path/_common/assert_path.js","../node_modules/.pnpm/@jsr+std__path@1.1.6/node_modules/@jsr/std__path/_common/basename.js","../node_modules/.pnpm/@jsr+std__path@1.1.6/node_modules/@jsr/std__path/_common/from_file_url.js","../node_modules/.pnpm/@jsr+std__path@1.1.6/node_modules/@jsr/std__path/posix/from_file_url.js","../node_modules/.pnpm/@jsr+std__path@1.1.6/node_modules/@jsr/std__path/_common/strip_trailing_separators.js","../node_modules/.pnpm/@jsr+std__path@1.1.6/node_modules/@jsr/std__path/posix/_util.js","../node_modules/.pnpm/@jsr+std__path@1.1.6/node_modules/@jsr/std__path/posix/basename.js","../node_modules/.pnpm/@jsr+std__path@1.1.6/node_modules/@jsr/std__path/posix/constants.js","../node_modules/.pnpm/@jsr+std__path@1.1.6/node_modules/@jsr/std__path/_common/dirname.js","../node_modules/.pnpm/@jsr+std__path@1.1.6/node_modules/@jsr/std__path/posix/dirname.js","../node_modules/.pnpm/@jsr+std__path@1.1.6/node_modules/@jsr/std__path/posix/extname.js","../node_modules/.pnpm/@jsr+std__path@1.1.6/node_modules/@jsr/std__path/_common/normalize.js","../node_modules/.pnpm/@jsr+std__path@1.1.6/node_modules/@jsr/std__path/_common/normalize_string.js","../node_modules/.pnpm/@jsr+std__path@1.1.6/node_modules/@jsr/std__path/posix/normalize.js","../node_modules/.pnpm/@jsr+std__path@1.1.6/node_modules/@jsr/std__path/posix/join.js","../src/shared/internal/validations.ts","../src/sync/channel/state.ts","../src/sync/protocol.ts"],"sourcesContent":["/**\n * Text encoding/decoding utilities using cached TextEncoder/TextDecoder.\n *\n * @internal\n * @module\n */\n\nimport { Lazy } from 'happy-rusty';\n\n/**\n * Lazily initialized `TextEncoder` instance.\n * Created on first access via `force()`.\n */\nconst encoder = /*#__PURE__*/ Lazy(() => new TextEncoder());\n\n/**\n * Lazily initialized `TextDecoder` instance.\n * Created on first access via `force()`.\n */\nconst decoder = /*#__PURE__*/ Lazy(() => new TextDecoder());\n\n/**\n * Encodes a string to a UTF-8 `Uint8Array`.\n *\n * @param data - The string to encode.\n * @returns A `Uint8Array` containing the encoded data.\n */\nexport function encodeUtf8(data: string): Uint8Array<ArrayBuffer> {\n    return encoder.force().encode(data);\n}\n\n/**\n * Decodes binary data to a UTF-8 string.\n *\n * @param data - The binary data to decode.\n * @returns The decoded string.\n */\nexport function decodeUtf8(data: AllowSharedBufferSource): string {\n    return decoder.force().decode(data);\n}\n","/**\n * Shared helper utilities for both async and sync APIs.\n *\n * @internal\n * @module\n */\n\nimport type { WriteSyncFileContent } from '../defines.ts';\nimport { encodeUtf8 } from './codec.ts';\n\n/**\n * Asynchronously reads a Blob's content as a Uint8Array.\n * Uses native `bytes()` method if available, otherwise falls back to `arrayBuffer()`.\n *\n * @param blob - The Blob to read.\n * @returns A promise that resolves to a Uint8Array containing the blob's binary data.\n */\nexport async function readBlobBytes(blob: Blob): Promise<Uint8Array<ArrayBuffer>> {\n    return typeof blob.bytes === 'function'\n        ? blob.bytes()\n        : new Uint8Array(await blob.arrayBuffer());\n}\n\n/**\n * Synchronously reads a Blob's content as a Uint8Array.\n * Uses FileReaderSync for synchronous binary data reading.\n *\n * **Note:** This function can only be used in Worker threads,\n * as `FileReaderSync` is not available in the main thread.\n *\n * @param blob - The Blob to read.\n * @returns A Uint8Array containing the blob's binary data.\n */\nexport function readBlobBytesSync(blob: Blob): Uint8Array<ArrayBuffer> {\n    const reader = new FileReaderSync();\n    return new Uint8Array(reader.readAsArrayBuffer(blob));\n}\n\n/**\n * Converts a `WriteSyncFileContent` to a `Uint8Array` without copying the buffer.\n * Handles `Uint8Array`, `ArrayBuffer`, other `ArrayBufferView` (e.g. TypedArray),\n * and `string` (via UTF-8 encoding). `Blob` is intentionally NOT handled here —\n * callers that accept `Blob` (e.g. the async `writeFile`) must convert it via\n * `readBlobBytesSync` before calling this helper.\n *\n * @param contents - The content to convert. Must not be a `Blob` or `ReadableStream`.\n * @returns A `Uint8Array` view over the given content.\n */\nexport function toBytesView(contents: WriteSyncFileContent): Uint8Array<ArrayBuffer> {\n    if (contents instanceof Uint8Array) {\n        return contents as Uint8Array<ArrayBuffer>;\n    }\n    if (contents instanceof ArrayBuffer) {\n        return new Uint8Array(contents);\n    }\n    if (ArrayBuffer.isView(contents)) {\n        // Other TypedArray -> Uint8Array (handle potential byteOffset)\n        return new Uint8Array(contents.buffer, contents.byteOffset, contents.byteLength);\n    }\n    // String -> Uint8Array via TextEncoder\n    return encodeUtf8(contents);\n}\n","// Copyright 2018-2026 the Deno authors. MIT license.\n// Copyright the Browserify authors. MIT License.\nexport function assertPath(path) {\n  if (typeof path !== \"string\") {\n    throw new TypeError(`Path must be a string, received \"${JSON.stringify(path)}\"`);\n  }\n}\n//# sourceMappingURL=assert_path.js.map","// Copyright 2018-2026 the Deno authors. MIT license.\n// This module is browser compatible.\nimport { assertPath } from \"./assert_path.js\";\nexport function stripSuffix(name, suffix) {\n  if (suffix.length >= name.length) {\n    return name;\n  }\n  const lenDiff = name.length - suffix.length;\n  for(let i = suffix.length - 1; i >= 0; --i){\n    if (name.charCodeAt(lenDiff + i) !== suffix.charCodeAt(i)) {\n      return name;\n    }\n  }\n  return name.slice(0, -suffix.length);\n}\nexport function lastPathSegment(path, isSep, start = 0) {\n  let matchedNonSeparator = false;\n  let end = path.length;\n  for(let i = path.length - 1; i >= start; --i){\n    if (isSep(path.charCodeAt(i))) {\n      if (matchedNonSeparator) {\n        start = i + 1;\n        break;\n      }\n    } else if (!matchedNonSeparator) {\n      matchedNonSeparator = true;\n      end = i + 1;\n    }\n  }\n  return path.slice(start, end);\n}\nexport function assertArgs(path, suffix) {\n  assertPath(path);\n  if (path.length === 0) return path;\n  if (typeof suffix !== \"string\") {\n    throw new TypeError(`Suffix must be a string, received \"${JSON.stringify(suffix)}\"`);\n  }\n}\n//# sourceMappingURL=basename.js.map","// Copyright 2018-2026 the Deno authors. MIT license.\n// This module is browser compatible.\nexport function assertArg(url) {\n  url = url instanceof URL ? url : new URL(url);\n  if (url.protocol !== \"file:\") {\n    throw new TypeError(`URL must be a file URL: received \"${url.protocol}\"`);\n  }\n  return url;\n}\n//# sourceMappingURL=from_file_url.js.map","// Copyright 2018-2026 the Deno authors. MIT license.\n// This module is browser compatible.\nimport { assertArg } from \"../_common/from_file_url.js\";\n/**\n * Converts a file URL to a path string.\n *\n * @example Usage\n * ```ts\n * import { fromFileUrl } from \"@std/path/posix/from-file-url\";\n * import { assertEquals } from \"@std/assert\";\n *\n * assertEquals(fromFileUrl(new URL(\"file:///home/foo\")), \"/home/foo\");\n * ```\n *\n * @param url The file URL to convert.\n * @returns The path string.\n */ export function fromFileUrl(url) {\n  url = assertArg(url);\n  return decodeURIComponent(url.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, \"%25\"));\n}\n//# sourceMappingURL=from_file_url.js.map","// Copyright 2018-2026 the Deno authors. MIT license.\n// Copyright the Browserify authors. MIT License.\n// Ported from https://github.com/browserify/path-browserify/\n// This module is browser compatible.\nexport function stripTrailingSeparators(segment, isSep) {\n  if (segment.length <= 1) {\n    return segment;\n  }\n  let end = segment.length;\n  for(let i = segment.length - 1; i > 0; i--){\n    if (isSep(segment.charCodeAt(i))) {\n      end = i;\n    } else {\n      break;\n    }\n  }\n  return segment.slice(0, end);\n}\n//# sourceMappingURL=strip_trailing_separators.js.map","// Copyright 2018-2026 the Deno authors. MIT license.\n// Copyright the Browserify authors. MIT License.\n// Ported from https://github.com/browserify/path-browserify/\n// This module is browser compatible.\nimport { CHAR_FORWARD_SLASH } from \"../_common/constants.js\";\nexport function isPosixPathSeparator(code) {\n  return code === CHAR_FORWARD_SLASH;\n}\n//# sourceMappingURL=_util.js.map","// Copyright 2018-2026 the Deno authors. MIT license.\n// This module is browser compatible.\nimport { assertArgs, lastPathSegment, stripSuffix } from \"../_common/basename.js\";\nimport { fromFileUrl } from \"./from_file_url.js\";\nimport { stripTrailingSeparators } from \"../_common/strip_trailing_separators.js\";\nimport { isPosixPathSeparator } from \"./_util.js\";\n/**\n * Return the last portion of a `path`.\n * Trailing directory separators are ignored, and optional suffix is removed.\n *\n * @example Usage\n * ```ts\n * import { basename } from \"@std/path/posix/basename\";\n * import { assertEquals } from \"@std/assert\";\n *\n * assertEquals(basename(\"/home/user/Documents/\"), \"Documents\");\n * assertEquals(basename(\"/home/user/Documents/image.png\"), \"image.png\");\n * assertEquals(basename(\"/home/user/Documents/image.png\", \".png\"), \"image\");\n * assertEquals(basename(new URL(\"file:///home/user/Documents/image.png\")), \"image.png\");\n * assertEquals(basename(new URL(\"file:///home/user/Documents/image.png\"), \".png\"), \"image\");\n * ```\n *\n * @example Working with URLs\n *\n * Only `URL` instances with the `file:` protocol are accepted. To process a\n * non-`file:` URL, pass it as a string or pass its `pathname` property.\n *\n * Note: This function doesn't automatically strip hash and query parts from\n * URLs. If your URL contains a hash or query, remove them before passing the\n * URL to the function. This can be done by passing the URL to `new URL(url)`,\n * and setting the `hash` and `search` properties to empty strings.\n *\n * ```ts\n * import { basename } from \"@std/path/posix/basename\";\n * import { assertEquals } from \"@std/assert\";\n *\n * assertEquals(basename(\"https://deno.land/std/path/mod.ts\"), \"mod.ts\");\n * assertEquals(basename(\"https://deno.land/std/path/mod.ts\", \".ts\"), \"mod\");\n * assertEquals(basename(\"https://deno.land/std/path/mod.ts?a=b\"), \"mod.ts?a=b\");\n * assertEquals(basename(\"https://deno.land/std/path/mod.ts#header\"), \"mod.ts#header\");\n * assertEquals(basename(new URL(\"https://deno.land/std/path/mod.ts\").pathname), \"mod.ts\");\n * ```\n *\n * @param path The path to extract the name from.\n * @param suffix The suffix to remove from extracted name.\n * @returns The extracted name.\n * @throws {TypeError} If `path` is a `URL` instance whose protocol is not `file:`.\n */ export function basename(path, suffix = \"\") {\n  if (path instanceof URL) {\n    path = fromFileUrl(path);\n  }\n  assertArgs(path, suffix);\n  const lastSegment = lastPathSegment(path, isPosixPathSeparator);\n  const strippedSegment = stripTrailingSeparators(lastSegment, isPosixPathSeparator);\n  return suffix ? stripSuffix(strippedSegment, suffix) : strippedSegment;\n}\n//# sourceMappingURL=basename.js.map","// Copyright 2018-2026 the Deno authors. MIT license.\n// This module is browser compatible.\n/**\n * The character used to separate entries in the PATH environment variable.\n */ export const DELIMITER = \":\";\n/**\n * The character used to separate components of a file path.\n */ export const SEPARATOR = \"/\";\n/**\n * A regular expression that matches one or more path separators.\n */ // deno-lint-ignore deno-style-guide/naming-convention\nexport const SEPARATOR_PATTERN = /\\/+/;\n//# sourceMappingURL=constants.js.map","// Copyright 2018-2026 the Deno authors. MIT license.\n// This module is browser compatible.\nimport { assertPath } from \"./assert_path.js\";\nexport function assertArg(path) {\n  assertPath(path);\n  if (path.length === 0) return \".\";\n}\n//# sourceMappingURL=dirname.js.map","// Copyright 2018-2026 the Deno authors. MIT license.\n// This module is browser compatible.\nimport { assertArg } from \"../_common/dirname.js\";\nimport { stripTrailingSeparators } from \"../_common/strip_trailing_separators.js\";\nimport { isPosixPathSeparator } from \"./_util.js\";\nimport { fromFileUrl } from \"./from_file_url.js\";\n/**\n * Return the directory path of a `path`.\n *\n * @example Usage\n * ```ts\n * import { dirname } from \"@std/path/posix/dirname\";\n * import { assertEquals } from \"@std/assert\";\n *\n * assertEquals(dirname(\"/home/user/Documents/\"), \"/home/user\");\n * assertEquals(dirname(\"/home/user/Documents/image.png\"), \"/home/user/Documents\");\n * assertEquals(dirname(\"https://deno.land/std/path/mod.ts\"), \"https://deno.land/std/path\");\n * assertEquals(dirname(new URL(\"file:///home/user/Documents/image.png\")), \"/home/user/Documents\");\n * ```\n *\n * @example Working with URLs\n *\n * Only `URL` instances with the `file:` protocol are accepted. To process a\n * non-`file:` URL, pass it as a string or pass its `pathname` property.\n *\n * ```ts\n * import { dirname } from \"@std/path/posix/dirname\";\n * import { assertEquals } from \"@std/assert\";\n *\n * assertEquals(dirname(\"https://deno.land/std/path/mod.ts\"), \"https://deno.land/std/path\");\n * assertEquals(dirname(\"https://deno.land/std/path/mod.ts?a=b\"), \"https://deno.land/std/path\");\n * assertEquals(dirname(\"https://deno.land/std/path/mod.ts#header\"), \"https://deno.land/std/path\");\n * assertEquals(dirname(new URL(\"https://deno.land/std/path/mod.ts\").pathname), \"/std/path\");\n * ```\n *\n * @param path The path to get the directory from.\n * @returns The directory path.\n * @throws {TypeError} If `path` is a `URL` instance whose protocol is not `file:`.\n */ export function dirname(path) {\n  if (path instanceof URL) {\n    path = fromFileUrl(path);\n  }\n  assertArg(path);\n  let end = -1;\n  let matchedNonSeparator = false;\n  for(let i = path.length - 1; i >= 1; --i){\n    if (isPosixPathSeparator(path.charCodeAt(i))) {\n      if (matchedNonSeparator) {\n        end = i;\n        break;\n      }\n    } else {\n      matchedNonSeparator = true;\n    }\n  }\n  // No matches. Fallback based on provided path:\n  //\n  // - leading slashes paths\n  //     \"/foo\" => \"/\"\n  //     \"///foo\" => \"/\"\n  // - no slash path\n  //     \"foo\" => \".\"\n  if (end === -1) {\n    return isPosixPathSeparator(path.charCodeAt(0)) ? \"/\" : \".\";\n  }\n  return stripTrailingSeparators(path.slice(0, end), isPosixPathSeparator);\n}\n//# sourceMappingURL=dirname.js.map","// Copyright 2018-2026 the Deno authors. MIT license.\n// This module is browser compatible.\nimport { CHAR_DOT } from \"../_common/constants.js\";\nimport { assertPath } from \"../_common/assert_path.js\";\nimport { isPosixPathSeparator } from \"./_util.js\";\nimport { fromFileUrl } from \"./from_file_url.js\";\n/**\n * Return the extension of the `path` with leading period.\n *\n * @example Usage\n * ```ts\n * import { extname } from \"@std/path/posix/extname\";\n * import { assertEquals } from \"@std/assert\";\n *\n * assertEquals(extname(\"/home/user/Documents/file.ts\"), \".ts\");\n * assertEquals(extname(\"/home/user/Documents/\"), \"\");\n * assertEquals(extname(\"/home/user/Documents/image.png\"), \".png\");\n * assertEquals(extname(new URL(\"file:///home/user/Documents/file.ts\")), \".ts\");\n * assertEquals(extname(new URL(\"file:///home/user/Documents/file.ts?a=b\")), \".ts\");\n * assertEquals(extname(new URL(\"file:///home/user/Documents/file.ts#header\")), \".ts\");\n * ```\n *\n * @example Working with URLs\n *\n * Only `URL` instances with the `file:` protocol are accepted. To process a\n * non-`file:` URL, pass it as a string or pass its `pathname` property.\n *\n * Note: This function doesn't automatically strip hash and query parts from\n * URLs. If your URL contains a hash or query, remove them before passing the\n * URL to the function. This can be done by passing the URL to `new URL(url)`,\n * and setting the `hash` and `search` properties to empty strings.\n *\n * ```ts\n * import { extname } from \"@std/path/posix/extname\";\n * import { assertEquals } from \"@std/assert\";\n *\n * assertEquals(extname(\"https://deno.land/std/path/mod.ts\"), \".ts\");\n * assertEquals(extname(\"https://deno.land/std/path/mod.ts?a=b\"), \".ts?a=b\");\n * assertEquals(extname(\"https://deno.land/std/path/mod.ts#header\"), \".ts#header\");\n * assertEquals(extname(new URL(\"https://deno.land/std/path/mod.ts\").pathname), \".ts\");\n * ```\n *\n * @param path The path to get the extension from.\n * @returns The extension (ex. for `file.ts` returns `.ts`).\n * @throws {TypeError} If `path` is a `URL` instance whose protocol is not `file:`.\n */ export function extname(path) {\n  if (path instanceof URL) {\n    path = fromFileUrl(path);\n  }\n  assertPath(path);\n  let startDot = -1;\n  let startPart = 0;\n  let end = -1;\n  let matchedSlash = true;\n  // Track the state of characters (if any) we see before our first dot and\n  // after any path separator we find\n  let preDotState = 0;\n  for(let i = path.length - 1; i >= 0; --i){\n    const code = path.charCodeAt(i);\n    if (isPosixPathSeparator(code)) {\n      // If we reached a path separator that was not part of a set of path\n      // separators at the end of the string, stop now\n      if (!matchedSlash) {\n        startPart = i + 1;\n        break;\n      }\n      continue;\n    }\n    if (end === -1) {\n      // We saw the first non-path separator, mark this as the end of our\n      // extension\n      matchedSlash = false;\n      end = i + 1;\n    }\n    if (code === CHAR_DOT) {\n      // If this is our first dot, mark it as the start of our extension\n      if (startDot === -1) startDot = i;\n      else if (preDotState !== 1) preDotState = 1;\n    } else if (startDot !== -1) {\n      // We saw a non-dot and non-path separator before our dot, so we should\n      // have a good chance at having a non-empty extension\n      preDotState = -1;\n    }\n  }\n  if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot\n  preDotState === 0 || // The (right-most) trimmed path component is exactly '..'\n  preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n    return \"\";\n  }\n  return path.slice(startDot, end);\n}\n//# sourceMappingURL=extname.js.map","// Copyright 2018-2026 the Deno authors. MIT license.\n// This module is browser compatible.\nimport { assertPath } from \"./assert_path.js\";\nexport function assertArg(path) {\n  assertPath(path);\n  if (path.length === 0) return \".\";\n}\n//# sourceMappingURL=normalize.js.map","// Copyright 2018-2026 the Deno authors. MIT license.\n// Copyright the Browserify authors. MIT License.\n// Ported from https://github.com/browserify/path-browserify/\n// This module is browser compatible.\nimport { CHAR_DOT, CHAR_FORWARD_SLASH } from \"./constants.js\";\n// Resolves . and .. elements in a path with directory names\nexport function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {\n  let res = \"\";\n  let lastSegmentLength = 0;\n  let lastSlash = -1;\n  let dots = 0;\n  let code;\n  for(let i = 0; i <= path.length; ++i){\n    if (i < path.length) code = path.charCodeAt(i);\n    else if (isPathSeparator(code)) break;\n    else code = CHAR_FORWARD_SLASH;\n    if (isPathSeparator(code)) {\n      if (lastSlash === i - 1 || dots === 1) {\n      // NOOP\n      } else if (lastSlash !== i - 1 && dots === 2) {\n        if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) {\n          if (res.length > 2) {\n            const lastSlashIndex = res.lastIndexOf(separator);\n            if (lastSlashIndex === -1) {\n              res = \"\";\n              lastSegmentLength = 0;\n            } else {\n              res = res.slice(0, lastSlashIndex);\n              lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);\n            }\n            lastSlash = i;\n            dots = 0;\n            continue;\n          } else if (res.length === 2 || res.length === 1) {\n            res = \"\";\n            lastSegmentLength = 0;\n            lastSlash = i;\n            dots = 0;\n            continue;\n          }\n        }\n        if (allowAboveRoot) {\n          if (res.length > 0) res += `${separator}..`;\n          else res = \"..\";\n          lastSegmentLength = 2;\n        }\n      } else {\n        if (res.length > 0) res += separator + path.slice(lastSlash + 1, i);\n        else res = path.slice(lastSlash + 1, i);\n        lastSegmentLength = i - lastSlash - 1;\n      }\n      lastSlash = i;\n      dots = 0;\n    } else if (code === CHAR_DOT && dots !== -1) {\n      ++dots;\n    } else {\n      dots = -1;\n    }\n  }\n  return res;\n}\n//# sourceMappingURL=normalize_string.js.map","// Copyright 2018-2026 the Deno authors. MIT license.\n// This module is browser compatible.\nimport { assertArg } from \"../_common/normalize.js\";\nimport { normalizeString } from \"../_common/normalize_string.js\";\nimport { isPosixPathSeparator } from \"./_util.js\";\nimport { fromFileUrl } from \"./from_file_url.js\";\n/**\n * Normalize the `path`, resolving `'..'` and `'.'` segments.\n * Note that resolving these segments does not necessarily mean that all will be eliminated.\n * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.\n *\n * @example Usage\n * ```ts\n * import { normalize } from \"@std/path/posix/normalize\";\n * import { assertEquals } from \"@std/assert\";\n *\n * assertEquals(normalize(\"/foo/bar//baz/asdf/quux/..\"), \"/foo/bar/baz/asdf\");\n * assertEquals(normalize(new URL(\"file:///foo/bar//baz/asdf/quux/..\")), \"/foo/bar/baz/asdf/\");\n * ```\n *\n * @example Working with URLs\n *\n * Note: This function will remove the double slashes from a URL's scheme.\n * Hence, do not pass a full URL to this function. Instead, pass the pathname of\n * the URL.\n *\n * ```ts\n * import { normalize } from \"@std/path/posix/normalize\";\n * import { assertEquals } from \"@std/assert\";\n *\n * const url = new URL(\"https://deno.land\");\n * url.pathname = normalize(\"//std//assert//.//mod.ts\");\n * assertEquals(url.href, \"https://deno.land/std/assert/mod.ts\");\n *\n * url.pathname = normalize(\"std/assert/../async/retry.ts\");\n * assertEquals(url.href, \"https://deno.land/std/async/retry.ts\");\n * ```\n *\n * @param path The path to normalize.\n * @returns The normalized path.\n */ export function normalize(path) {\n  if (path instanceof URL) {\n    path = fromFileUrl(path);\n  }\n  assertArg(path);\n  const isAbsolute = isPosixPathSeparator(path.charCodeAt(0));\n  const trailingSeparator = isPosixPathSeparator(path.charCodeAt(path.length - 1));\n  // Normalize the path\n  path = normalizeString(path, !isAbsolute, \"/\", isPosixPathSeparator);\n  if (path.length === 0 && !isAbsolute) path = \".\";\n  if (path.length > 0 && trailingSeparator) path += \"/\";\n  if (isAbsolute) return `/${path}`;\n  return path;\n}\n//# sourceMappingURL=normalize.js.map","// Copyright 2018-2026 the Deno authors. MIT license.\n// This module is browser compatible.\nimport { assertPath } from \"../_common/assert_path.js\";\nimport { fromFileUrl } from \"./from_file_url.js\";\nimport { normalize } from \"./normalize.js\";\n/**\n * Join all given a sequence of `paths`,then normalizes the resulting path.\n *\n * @example Usage\n * ```ts\n * import { join } from \"@std/path/posix/join\";\n * import { assertEquals } from \"@std/assert\";\n *\n * assertEquals(join(\"/foo\", \"bar\", \"baz/asdf\", \"quux\", \"..\"), \"/foo/bar/baz/asdf\");\n * assertEquals(join(new URL(\"file:///foo\"), \"bar\", \"baz/asdf\", \"quux\", \"..\"), \"/foo/bar/baz/asdf\");\n * ```\n *\n * @example Working with URLs\n * ```ts\n * import { join } from \"@std/path/posix/join\";\n * import { assertEquals } from \"@std/assert\";\n *\n * const url = new URL(\"https://deno.land\");\n * url.pathname = join(\"std\", \"path\", \"mod.ts\");\n * assertEquals(url.href, \"https://deno.land/std/path/mod.ts\");\n *\n * url.pathname = join(\"//std\", \"path/\", \"/mod.ts\");\n * assertEquals(url.href, \"https://deno.land/std/path/mod.ts\");\n * ```\n *\n * @param path The path to join. This can be string or file URL.\n * @param paths The paths to join.\n * @returns The joined path.\n */ export function join(path, ...paths) {\n  if (path === undefined) return \".\";\n  if (path instanceof URL) {\n    path = fromFileUrl(path);\n  }\n  paths = path ? [\n    path,\n    ...paths\n  ] : paths;\n  paths.forEach((path)=>assertPath(path));\n  const joined = paths.filter((path)=>path.length > 0).join(\"/\");\n  return joined === \"\" ? \".\" : normalize(joined);\n}\n//# sourceMappingURL=join.js.map","/**\n * Internal shared validation functions for async and sync operations.\n * These functions return Result types instead of throwing exceptions.\n *\n * @internal\n * @module\n */\n\nimport { Err, Ok, RESULT_VOID, type IOResult, type VoidIOResult } from 'happy-rusty';\nimport {\n    ROOT_DIR,\n    type ExistsOptions,\n    type WriteFileContent,\n    type WriteSyncFileContent,\n} from '../mod.ts';\nimport { normalize } from './path.ts';\n\n/**\n * Validates that the provided path is an absolute path and normalizes it.\n * Returns a Result instead of throwing.\n *\n * @param path - The file path to validate.\n * @returns An `IOResult` containing the normalized absolute path, or an error.\n */\nexport function validateAbsolutePath(path: string): IOResult<string> {\n    if (typeof path !== 'string') {\n        return Err(new TypeError(`Path must be a string but received ${typeof path}`));\n    }\n\n    if (path[0] !== ROOT_DIR) {\n        return Err(new Error(`Path must be absolute (start with '/'): '${path}'`));\n    }\n\n    // Normalize and remove trailing slash except for root\n    const normalized = normalize(path);\n    const result =\n        normalized.length > 1 && normalized[normalized.length - 1] === ROOT_DIR\n            ? normalized.slice(0, -1)\n            : normalized;\n\n    return Ok(result);\n}\n\n/**\n * Validates that the provided URL is valid and returns a URL object.\n * Supports relative URLs by using current location as base.\n * Returns a Result instead of throwing.\n *\n * @param url - The URL string or URL object to validate.\n * @returns An `IOResult` containing the URL object, or an error.\n */\nexport function validateUrl(url: string | URL): IOResult<URL> {\n    if (url instanceof URL) {\n        return Ok(url);\n    }\n\n    try {\n        return Ok(new URL(url, location.href));\n    } catch {\n        return Err(new TypeError(`Invalid URL: '${url}'`));\n    }\n}\n\n/**\n * Validates that the provided ExistsOptions are valid.\n * `isDirectory` and `isFile` cannot both be `true`.\n *\n * @param options - The ExistsOptions to validate.\n * @returns A `VoidIOResult` indicating success, or an error if options are invalid.\n */\nexport function validateExistsOptions(options?: ExistsOptions): VoidIOResult {\n    const { isDirectory = false, isFile = false } = options ?? {};\n\n    return isDirectory && isFile\n        ? Err(new Error('isDirectory and isFile cannot both be true'))\n        : RESULT_VOID;\n}\n\n/**\n * Validates that the provided value is a valid Date for pruneTemp expiration.\n * Returns a Result instead of throwing.\n *\n * @param expired - The Date to validate.\n * @returns A `VoidIOResult` indicating success, or an error if not a valid Date instance, eg: `new Date('invalid')`.\n */\nexport function validateExpiredDate(expired: Date): VoidIOResult {\n    if (!(expired instanceof Date)) {\n        return Err(new TypeError(`Expired must be a Date but received ${typeof expired}`));\n    }\n\n    return Number.isNaN(expired.getTime())\n        ? Err(new TypeError('Expired must be a valid Date'))\n        : RESULT_VOID;\n}\n\n/**\n * Validates that the provided content is a valid type for writeFile (async).\n * Supports: string, Blob, ArrayBuffer, TypedArray, ReadableStream<Uint8Array>.\n *\n * @param contents - The content to validate.\n * @returns A `VoidIOResult` indicating success, or an error if type is invalid.\n */\nexport function validateWriteFileContent(contents: WriteFileContent): VoidIOResult {\n    // Check for ReadableStream first (async only)\n    if (isBinaryReadableStream(contents)) {\n        return RESULT_VOID;\n    }\n\n    // Check for Blob (async only)\n    if (contents instanceof Blob) {\n        return RESULT_VOID;\n    }\n\n    // Check for sync-compatible types (string, ArrayBuffer, TypedArray)\n    if (isWriteSyncFileContent(contents)) {\n        return RESULT_VOID;\n    }\n\n    return Err(\n        new TypeError(\n            'Invalid content type for writeFile. Expected string, Blob, ArrayBuffer, TypedArray, or ReadableStream',\n        ),\n    );\n}\n\n/**\n * Validates that the provided content is a valid type for writeFileSync (sync).\n * Supports: string, ArrayBuffer, TypedArray.\n * Note: Blob and ReadableStream are NOT supported in sync operations.\n *\n * @param contents - The content to validate.\n * @returns A `VoidIOResult` indicating success, or an error if type is invalid.\n */\nexport function validateWriteSyncFileContent(contents: WriteSyncFileContent): VoidIOResult {\n    if (!isWriteSyncFileContent(contents)) {\n        return Err(\n            new TypeError(\n                'Invalid content type for writeFileSync. Expected string, ArrayBuffer, or TypedArray',\n            ),\n        );\n    }\n\n    return RESULT_VOID;\n}\n\n// #region Internal functions\n\n/**\n * Type guard for detecting binary ReadableStream input for file writing.\n *\n * @param x - The value to check.\n * @returns `true` if the value is a ReadableStream.\n */\nfunction isBinaryReadableStream(x: unknown): x is ReadableStream<Uint8Array<ArrayBuffer>> {\n    return typeof ReadableStream !== 'undefined' && x instanceof ReadableStream;\n}\n\n/**\n * Type guard for detecting valid sync file content types.\n * Supports: string, ArrayBuffer, ArrayBufferView (TypedArray/DataView).\n *\n * @param contents - The value to check.\n * @returns `true` if the value is a valid sync file content type.\n */\nfunction isWriteSyncFileContent(contents: unknown): contents is WriteSyncFileContent {\n    return (\n        typeof contents === 'string' ||\n        contents instanceof ArrayBuffer ||\n        ArrayBuffer.isView(contents)\n    );\n}\n\n// #endregion\n","/**\n * Internal shared state for sync channel.\n * This module is not exported publicly.\n *\n * @internal\n */\n\nimport type { SyncMessenger } from '../protocol.ts';\n\n/**\n * State for sync channel.\n * - 'idle': Not initialized, can call connectSyncChannel or attachSyncChannel\n * - 'connecting': Connection in progress (only during connectSyncChannel)\n * - 'ready': Ready to use, messenger is available\n */\nexport type SyncChannelState = 'idle' | 'connecting' | 'ready';\n\n/**\n * Current state of the sync channel.\n */\nlet syncChannelState: SyncChannelState = 'idle';\n\n/**\n * Messenger instance for sync communication.\n * Only available when syncChannelState is 'ready'.\n */\nlet messenger: SyncMessenger | null = null;\n\n/**\n * Worker created by `connectSyncChannel`, if it created one.\n * Only a library-owned worker may be terminated when the channel is released;\n * a caller-supplied worker or the worker behind an attached buffer keeps running.\n */\nlet ownedWorker: Worker | null = null;\n\n/**\n * Global timeout for synchronous I/O operations in milliseconds.\n */\nlet globalSyncOpTimeout = 1000;\n\n/**\n * Gets the current sync channel state.\n */\nexport function getSyncChannelState(): SyncChannelState {\n    return syncChannelState;\n}\n\n/**\n * Sets the sync channel state.\n */\nexport function setSyncChannelState(state: SyncChannelState): void {\n    syncChannelState = state;\n}\n\n/**\n * Gets the messenger instance.\n */\nexport function getMessenger(): SyncMessenger | null {\n    return messenger;\n}\n\n/**\n * Sets the messenger instance and marks the channel as ready.\n */\nexport function setMessenger(m: SyncMessenger): void {\n    messenger = m;\n    syncChannelState = 'ready';\n}\n\n/**\n * Remembers the worker created by `connectSyncChannel` so it can be terminated later.\n */\nexport function setOwnedWorker(worker: Worker | null): void {\n    ownedWorker = worker;\n}\n\n/**\n * Releases the channel state: drops the messenger and the owned-worker reference\n * and returns to 'idle', so `connect`/`attach` may be called again.\n *\n * @returns The worker that was owned by this context, if any. The caller decides\n *          whether to terminate it - this module holds no behaviour.\n */\nexport function resetSyncChannel(): Worker | null {\n    const worker = ownedWorker;\n    messenger = null;\n    ownedWorker = null;\n    syncChannelState = 'idle';\n\n    return worker;\n}\n\n/**\n * Gets the global sync operation timeout.\n */\nexport function getGlobalSyncOpTimeout(): number {\n    return globalSyncOpTimeout;\n}\n\n/**\n * Sets the global sync operation timeout.\n */\nexport function setGlobalSyncOpTimeout(timeout: number): void {\n    globalSyncOpTimeout = timeout;\n}\n","/**\n * Binary protocol for synchronous communication between main thread and worker.\n * Uses SharedArrayBuffer with lock-based synchronization via Atomics.\n *\n * @internal\n * @module\n */\n\nimport { decodeUtf8, encodeUtf8 } from '../shared/internal/mod.ts';\n\n// #region Internal Variables\n\n/**\n * Payload type markers for binary protocol.\n */\nconst PayloadType = {\n    /**\n     * Pure JSON payload, no binary data.\n     * Format: [type: 1B][json bytes]\n     */\n    JSON: 0,\n    /**\n     * JSON payload with separate binary data field.\n     * Binary data is stored separately to avoid JSON serialization overhead.\n     * Format: [type: 1B][json length: 4B][json bytes][binary bytes]\n     */\n    BINARY_JSON: 1,\n} as const;\n\n// #endregion\n\n/**\n * Operations that can be called from main thread to worker thread.\n * Each value corresponds to a specific file system operation.\n */\nexport const WorkerOp = {\n    // core (0-99)\n    createFile: 0,\n    mkdir: 1,\n    move: 2,\n    readDir: 3,\n    readFile: 4,\n    remove: 5,\n    stat: 6,\n    truncate: 7,\n    writeFile: 8,\n    // ext (100+)\n    copy: 100,\n    emptyDir: 101,\n    exists: 102,\n    deleteTemp: 103,\n    mkTemp: 104,\n    pruneTemp: 105,\n    readBlobFile: 106,\n    unzip: 107,\n    zip: 108,\n} as const;\n\n/**\n * Worker operation type.\n */\nexport type WorkerOp = (typeof WorkerOp)[keyof typeof WorkerOp];\n\n/**\n * Main thread lock index in the Int32Array view of SharedArrayBuffer.\n * Used to synchronize main thread state.\n */\nexport const MAIN_LOCK_INDEX = 0;\n\n/**\n * Worker thread lock index in the Int32Array view of SharedArrayBuffer.\n * Used to synchronize worker thread state.\n */\nexport const WORKER_LOCK_INDEX = 1;\n\n/**\n * Data length index in the Int32Array view of SharedArrayBuffer.\n * Stores the byte length of the current payload.\n */\nexport const DATA_INDEX = 2;\n\n/**\n * Main thread locked value (waiting for response).\n */\nexport const MAIN_LOCKED = 1;\n\n/**\n * Main thread unlocked value (response ready or idle).\n * This is the default/initial state.\n */\nexport const MAIN_UNLOCKED = 0;\n\n/**\n * Worker thread unlocked value (request ready to process).\n * Intentionally equals MAIN_LOCKED to simplify state machine.\n */\nexport const WORKER_UNLOCKED = MAIN_LOCKED;\n\n/**\n * Encodes data to a binary buffer for cross-thread communication.\n * Uses JSON serialization with optional binary data separation.\n *\n * If the last element of the array is a Uint8Array, it is stored separately\n * to avoid JSON serialization overhead (which would convert to number[]).\n *\n * All requests/responses use array format: `[op, ...args]` or `[error, result]`.\n *\n * @param value - The array data to encode.\n * @returns A `Uint8Array` containing the encoded payload.\n */\nexport function encodePayload(value: unknown[]): Uint8Array<ArrayBuffer> {\n    const lastItem = value[value.length - 1];\n\n    // If the last element is a Uint8Array, store it separately\n    if (lastItem instanceof Uint8Array) {\n        // BINARY_JSON format: [type: 1B][json length: 4B][json bytes][binary bytes]\n        const jsonValue = value.slice(0, -1);\n        const json = encodeUtf8(JSON.stringify(jsonValue));\n        const result = new Uint8Array(1 + 4 + json.byteLength + lastItem.byteLength);\n        result[0] = PayloadType.BINARY_JSON;\n        new DataView(result.buffer).setUint32(1, json.byteLength);\n        result.set(json, 5);\n        result.set(lastItem, 5 + json.byteLength);\n        return result;\n    }\n\n    // JSON format: [type: 1B][json bytes]\n    const json = encodeUtf8(JSON.stringify(value));\n    const result = new Uint8Array(1 + json.byteLength);\n    result[0] = PayloadType.JSON;\n    result.set(json, 1);\n    return result;\n}\n\n/**\n * Decodes binary payload back to its original structure.\n * Reverses the `encodePayload` operation.\n *\n * For BINARY_JSON payloads, the binary data is restored as the last element.\n *\n * All requests/responses use array format: `[op, ...args]` or `[error, result]`.\n *\n * @template T - The expected type of the decoded data (must be an array type).\n * @param payload - The binary payload from SharedArrayBuffer to decode.\n * @returns The decoded array with Uint8Array<ArrayBuffer> restored as the last element if applicable.\n */\nexport function decodePayload<T extends unknown[]>(payload: Uint8Array<SharedArrayBuffer>): T {\n    const type = payload[0];\n\n    if (type === PayloadType.BINARY_JSON) {\n        // BINARY_JSON format: [type: 1B][json length: 4B][json bytes][binary bytes]\n        const jsonLen = new DataView(payload.buffer, payload.byteOffset + 1, 4).getUint32(0);\n        // Use slice() for both json and data:\n        // 1. TextDecoder cannot accept SharedArrayBuffer views (browser security restriction)\n        // 2. Returned data needs its own ArrayBuffer (caller may access .buffer property)\n        const json = payload.slice(5, 5 + jsonLen);\n        const data = payload.slice(5 + jsonLen);\n        const parsed: unknown[] = JSON.parse(decodeUtf8(json));\n\n        // Restore binary data as the last element\n        parsed.push(data);\n\n        return parsed as T;\n    }\n\n    // JSON format: [type: 1B][json bytes]\n    // Use slice() because TextDecoder cannot accept SharedArrayBuffer views\n    return JSON.parse(decodeUtf8(payload.slice(1)));\n}\n\n/**\n * Messenger for synchronous communication between main thread and worker thread.\n * Inspired by [memfs](https://github.com/streamich/memfs/blob/master/src/fsa-to-node/worker/SyncMessenger.ts).\n *\n * Uses a `SharedArrayBuffer` with lock-based synchronization via `Atomics`.\n *\n * Buffer Layout (all values are Int32 at 4-byte boundaries):\n * ```\n * Offset  Size    Field           Description\n * ------  ----    -----           -----------\n * 0       4       MAIN_LOCK       Main thread state (0=unlocked/ready, 1=locked/waiting)\n * 4       4       WORKER_LOCK     Worker thread state (0=locked/idle, 1=unlocked/processing)\n * 8       4       DATA_LENGTH     Length of payload data in bytes\n * 12      4       RESERVED        Reserved for future use\n * 16+     var     PAYLOAD         Actual request/response binary data\n * ```\n *\n * Communication Flow:\n * 1. Main thread writes request to PAYLOAD, sets DATA_LENGTH\n * 2. Main thread sets MAIN_LOCK=1 (locked), WORKER_LOCK=1 (unlocked)\n * 3. Worker sees WORKER_LOCK=1, reads request, processes it\n * 4. Worker writes response to PAYLOAD, sets DATA_LENGTH\n * 5. Worker sets WORKER_LOCK=0 (locked), MAIN_LOCK=0 (unlocked)\n * 6. Main thread sees MAIN_LOCK=0, reads response\n *\n * `MAIN_LOCK` doubles as the \"a response is still owed\" flag: it stays locked\n * when the main thread gives up on a request (timeout) and only the worker\n * unlocks it, so the next call from the same context can tell that the slot is\n * not safe to reuse yet. The protocol has a single request slot and no\n * cross-context arbitration, so contexts sharing one buffer via `attach` must\n * not issue sync operations concurrently.\n *\n * @example\n * ```typescript\n * // Create messenger with 1MB buffer\n * const sab = new SharedArrayBuffer(1024 * 1024);\n * const messenger = new SyncMessenger(sab);\n * ```\n */\nexport class SyncMessenger {\n    /**\n     * Header size in bytes: 4 Int32 values = 16 bytes.\n     * Payload data starts after this offset.\n     */\n    private static readonly HEADER_LENGTH = 4 * 4;\n\n    /**\n     * Int32 view for atomic lock operations.\n     * Layout: [MAIN_LOCK, WORKER_LOCK, DATA_LENGTH, RESERVED]\n     */\n    readonly i32a: Int32Array;\n\n    /**\n     * Maximum payload size in bytes.\n     * Calculated as: total buffer size - header length.\n     * Requests/responses exceeding this limit will fail.\n     */\n    readonly maxDataLength: number;\n\n    /**\n     * Uint8 view for reading/writing binary payload.\n     * Payload starts after the header.\n     */\n    private readonly u8a: Uint8Array<SharedArrayBuffer>;\n\n    /**\n     * Creates a new SyncMessenger instance.\n     *\n     * @param sab - The SharedArrayBuffer to use for cross-thread communication.\n     *              Must be created in the main thread and transferred to the worker.\n     */\n    constructor(sab: SharedArrayBuffer) {\n        this.i32a = new Int32Array(sab);\n        this.u8a = new Uint8Array(sab);\n        this.maxDataLength = sab.byteLength - SyncMessenger.HEADER_LENGTH;\n    }\n\n    /**\n     * Writes payload data to the buffer after the header.\n     *\n     * @param data - The payload data to write.\n     */\n    setPayload(data: Uint8Array): void {\n        this.u8a.set(data, SyncMessenger.HEADER_LENGTH);\n    }\n\n    /**\n     * Reads payload data from the buffer as a view.\n     *\n     * Note: Returns a subarray (view) of the SharedArrayBuffer.\n     * Caller must use slice() if they need to pass data to TextDecoder\n     * or return data to user code that may access .buffer property.\n     *\n     * @param length - The number of bytes to read.\n     * @returns A view into the SharedArrayBuffer payload region.\n     */\n    getPayload(length: number): Uint8Array<SharedArrayBuffer> {\n        return this.u8a.subarray(SyncMessenger.HEADER_LENGTH, SyncMessenger.HEADER_LENGTH + length);\n    }\n}\n"],"x_google_ignoreList":[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],"mappings":";;;;;;;;;;;;AAaA,MAAM,UAAwB,yBAAW,IAAI,YAAY,CAAC;;;;;AAM1D,MAAM,UAAwB,yBAAW,IAAI,YAAY,CAAC;;;;;;;AAQ1D,SAAgB,WAAW,MAAuC;CAC9D,OAAO,QAAQ,MAAM,CAAC,CAAC,OAAO,IAAI;AACtC;;;;;;;AAQA,SAAgB,WAAW,MAAuC;CAC9D,OAAO,QAAQ,MAAM,CAAC,CAAC,OAAO,IAAI;AACtC;;;;;;;;;;ACtBA,eAAsB,cAAc,MAA8C;CAC9E,OAAO,OAAO,KAAK,UAAU,aACvB,KAAK,MAAM,IACX,IAAI,WAAW,MAAM,KAAK,YAAY,CAAC;AACjD;;;;;;;;;;;AAYA,SAAgB,kBAAkB,MAAqC;CACnE,MAAM,SAAS,IAAI,eAAe;CAClC,OAAO,IAAI,WAAW,OAAO,kBAAkB,IAAI,CAAC;AACxD;;;;;;;;;;;AAYA,SAAg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