@lgriffin/esi.ts 9.4.0 → 9.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +71 -52
  3. package/dist/EsiClient.d.ts +4 -0
  4. package/dist/EsiClient.d.ts.map +1 -1
  5. package/dist/clients/AllianceClient.d.ts +2 -0
  6. package/dist/clients/AllianceClient.d.ts.map +1 -1
  7. package/dist/clients/AssetsClient.d.ts +2 -0
  8. package/dist/clients/AssetsClient.d.ts.map +1 -1
  9. package/dist/clients/BaseEsiClient.d.ts +1 -0
  10. package/dist/clients/BaseEsiClient.d.ts.map +1 -1
  11. package/dist/clients/CalendarClient.d.ts +2 -0
  12. package/dist/clients/CalendarClient.d.ts.map +1 -1
  13. package/dist/clients/CharacterClient.d.ts +8 -0
  14. package/dist/clients/CharacterClient.d.ts.map +1 -1
  15. package/dist/clients/ClonesClient.d.ts +1 -0
  16. package/dist/clients/ClonesClient.d.ts.map +1 -1
  17. package/dist/clients/ContactsClient.d.ts +6 -0
  18. package/dist/clients/ContactsClient.d.ts.map +1 -1
  19. package/dist/clients/ContractsClient.d.ts +3 -0
  20. package/dist/clients/ContractsClient.d.ts.map +1 -1
  21. package/dist/clients/CorporationsClient.d.ts +17 -0
  22. package/dist/clients/CorporationsClient.d.ts.map +1 -1
  23. package/dist/clients/CosmeticsClient.d.ts +11 -0
  24. package/dist/clients/CosmeticsClient.d.ts.map +1 -0
  25. package/dist/clients/FittingsClient.d.ts +1 -0
  26. package/dist/clients/FittingsClient.d.ts.map +1 -1
  27. package/dist/clients/FleetClient.d.ts +2 -0
  28. package/dist/clients/FleetClient.d.ts.map +1 -1
  29. package/dist/clients/IndustryClient.d.ts +8 -0
  30. package/dist/clients/IndustryClient.d.ts.map +1 -1
  31. package/dist/clients/KillmailsClient.d.ts +2 -0
  32. package/dist/clients/KillmailsClient.d.ts.map +1 -1
  33. package/dist/clients/LoyaltyClient.d.ts +2 -0
  34. package/dist/clients/LoyaltyClient.d.ts.map +1 -1
  35. package/dist/clients/MailClient.d.ts +5 -0
  36. package/dist/clients/MailClient.d.ts.map +1 -1
  37. package/dist/clients/MarketClient.d.ts +6 -0
  38. package/dist/clients/MarketClient.d.ts.map +1 -1
  39. package/dist/clients/MercenaryClient.d.ts +19 -1
  40. package/dist/clients/MercenaryClient.d.ts.map +1 -1
  41. package/dist/clients/ParagonHubClient.d.ts +13 -0
  42. package/dist/clients/ParagonHubClient.d.ts.map +1 -0
  43. package/dist/clients/PiClient.d.ts +2 -0
  44. package/dist/clients/PiClient.d.ts.map +1 -1
  45. package/dist/clients/SkillsClient.d.ts +1 -0
  46. package/dist/clients/SkillsClient.d.ts.map +1 -1
  47. package/dist/clients/SkyhooksClient.d.ts +19 -1
  48. package/dist/clients/SkyhooksClient.d.ts.map +1 -1
  49. package/dist/clients/WalletClient.d.ts +4 -0
  50. package/dist/clients/WalletClient.d.ts.map +1 -1
  51. package/dist/clients/WarsClient.d.ts +2 -0
  52. package/dist/clients/WarsClient.d.ts.map +1 -1
  53. package/dist/core/ApiClient.d.ts +4 -0
  54. package/dist/core/ApiClient.d.ts.map +1 -1
  55. package/dist/core/ApiClientBuilder.d.ts +3 -1
  56. package/dist/core/ApiClientBuilder.d.ts.map +1 -1
  57. package/dist/core/ApiRequestHandler.d.ts.map +1 -1
  58. package/dist/core/ClientRegistry.d.ts +5 -3
  59. package/dist/core/ClientRegistry.d.ts.map +1 -1
  60. package/dist/core/cache/cacheKey.d.ts +3 -0
  61. package/dist/core/cache/cacheKey.d.ts.map +1 -0
  62. package/dist/core/constants.d.ts +2 -2
  63. package/dist/core/endpoints/EndpointDefinition.d.ts +2 -2
  64. package/dist/core/endpoints/EndpointDefinition.d.ts.map +1 -1
  65. package/dist/core/endpoints/cosmeticsEndpoints.d.ts +52 -0
  66. package/dist/core/endpoints/cosmeticsEndpoints.d.ts.map +1 -0
  67. package/dist/core/endpoints/createClient.d.ts +2 -2
  68. package/dist/core/endpoints/createClient.d.ts.map +1 -1
  69. package/dist/core/endpoints/mercenaryEndpoints.d.ts +45 -0
  70. package/dist/core/endpoints/mercenaryEndpoints.d.ts.map +1 -1
  71. package/dist/core/endpoints/paragonHubEndpoints.d.ts +163 -0
  72. package/dist/core/endpoints/paragonHubEndpoints.d.ts.map +1 -0
  73. package/dist/core/endpoints/skyhookEndpoints.d.ts +64 -0
  74. package/dist/core/endpoints/skyhookEndpoints.d.ts.map +1 -1
  75. package/dist/core/logger/NoopLogger.d.ts +3 -0
  76. package/dist/core/logger/NoopLogger.d.ts.map +1 -0
  77. package/dist/core/pagination/AsyncPaginationIterator.d.ts +1 -0
  78. package/dist/core/pagination/AsyncPaginationIterator.d.ts.map +1 -1
  79. package/dist/core/rateLimiter/RateLimiter.d.ts +6 -0
  80. package/dist/core/rateLimiter/RateLimiter.d.ts.map +1 -1
  81. package/dist/core/requestPipeline/cachePolicy.d.ts +3 -3
  82. package/dist/core/requestPipeline/cachePolicy.d.ts.map +1 -1
  83. package/dist/core/requestPipeline/headers.d.ts.map +1 -1
  84. package/dist/core/requestPipeline/statusHandling.d.ts +2 -2
  85. package/dist/core/requestPipeline/statusHandling.d.ts.map +1 -1
  86. package/dist/index.d.ts +6 -3
  87. package/dist/index.d.ts.map +1 -1
  88. package/dist/index.js +1141 -76
  89. package/dist/index.js.map +1 -1
  90. package/dist/index.mjs +1137 -76
  91. package/dist/index.mjs.map +1 -1
  92. package/dist/schemas/common.d.ts +11 -1
  93. package/dist/schemas/common.d.ts.map +1 -1
  94. package/dist/schemas/cosmetics.d.ts +58 -0
  95. package/dist/schemas/cosmetics.d.ts.map +1 -0
  96. package/dist/schemas/index.d.ts +2 -0
  97. package/dist/schemas/index.d.ts.map +1 -1
  98. package/dist/schemas/index.js +1467 -1192
  99. package/dist/schemas/index.js.map +1 -1
  100. package/dist/schemas/index.mjs +1433 -1192
  101. package/dist/schemas/index.mjs.map +1 -1
  102. package/dist/schemas/mercenary.d.ts +54 -0
  103. package/dist/schemas/mercenary.d.ts.map +1 -1
  104. package/dist/schemas/paragon-hub.d.ts +96 -0
  105. package/dist/schemas/paragon-hub.d.ts.map +1 -0
  106. package/dist/schemas/skyhooks.d.ts +101 -0
  107. package/dist/schemas/skyhooks.d.ts.map +1 -1
  108. package/dist/sde/index.js +7 -5100
  109. package/dist/sde/index.js.map +1 -1
  110. package/dist/sde/index.mjs +12 -5134
  111. package/dist/sde/index.mjs.map +1 -1
  112. package/dist/sde/memory.d.ts +8 -0
  113. package/dist/sde/memory.d.ts.map +1 -0
  114. package/dist/sde/memory.js +1100 -0
  115. package/dist/sde/memory.js.map +1 -0
  116. package/dist/sde/memory.mjs +1064 -0
  117. package/dist/sde/memory.mjs.map +1 -0
  118. package/dist/types/api-responses.d.ts +2 -0
  119. package/dist/types/api-responses.d.ts.map +1 -1
  120. package/dist/types/cosmetics.d.ts +8 -0
  121. package/dist/types/cosmetics.d.ts.map +1 -0
  122. package/dist/types/generated/esi-spec.generated.d.ts +12 -12
  123. package/dist/types/generated/esi-spec.generated.d.ts.map +1 -1
  124. package/dist/types/mercenary.d.ts +3 -1
  125. package/dist/types/mercenary.d.ts.map +1 -1
  126. package/dist/types/paragon-hub.d.ts +8 -0
  127. package/dist/types/paragon-hub.d.ts.map +1 -0
  128. package/dist/types/skyhooks.d.ts +3 -1
  129. package/dist/types/skyhooks.d.ts.map +1 -1
  130. package/package.json +30 -9
@@ -1 +1 @@
1
- {"version":3,"sources":["../../node_modules/adm-zip/util/constants.js","../../node_modules/adm-zip/util/errors.js","../../node_modules/adm-zip/util/utils.js","../../node_modules/adm-zip/util/fattr.js","../../node_modules/adm-zip/util/decoder.js","../../node_modules/adm-zip/util/index.js","../../node_modules/adm-zip/headers/entryHeader.js","../../node_modules/adm-zip/headers/mainHeader.js","../../node_modules/adm-zip/headers/index.js","../../node_modules/adm-zip/methods/deflater.js","../../node_modules/adm-zip/methods/inflater.js","../../node_modules/adm-zip/methods/zipcrypto.js","../../node_modules/adm-zip/methods/index.js","../../node_modules/adm-zip/zipEntry.js","../../node_modules/adm-zip/zipFile.js","../../node_modules/adm-zip/adm-zip.js","../../src/sde/index.ts","../../src/sde/SdeDataProvider.ts","../../node_modules/js-yaml/src/tag.ts","../../node_modules/js-yaml/src/tag/scalar/str.ts","../../node_modules/js-yaml/src/tag/scalar/null_core.ts","../../node_modules/js-yaml/src/tag/scalar/null_json.ts","../../node_modules/js-yaml/src/tag/scalar/null_yaml11.ts","../../node_modules/js-yaml/src/tag/scalar/bool_core.ts","../../node_modules/js-yaml/src/tag/scalar/bool_json.ts","../../node_modules/js-yaml/src/tag/scalar/bool_yaml11.ts","../../node_modules/js-yaml/src/tag/scalar/int_core.ts","../../node_modules/js-yaml/src/tag/scalar/int_json.ts","../../node_modules/js-yaml/src/tag/scalar/int_yaml11.ts","../../node_modules/js-yaml/src/tag/scalar/float_core.ts","../../node_modules/js-yaml/src/tag/scalar/float_json.ts","../../node_modules/js-yaml/src/tag/scalar/float_yaml11.ts","../../node_modules/js-yaml/src/tag/scalar/merge.ts","../../node_modules/js-yaml/src/tag/scalar/binary.ts","../../node_modules/js-yaml/src/tag/scalar/timestamp.ts","../../node_modules/js-yaml/src/tag/sequence/seq.ts","../../node_modules/js-yaml/src/common/object.ts","../../node_modules/js-yaml/src/tag/sequence/omap.ts","../../node_modules/js-yaml/src/tag/sequence/pairs.ts","../../node_modules/js-yaml/src/tag/mapping/map.ts","../../node_modules/js-yaml/src/tag/mapping/set.ts","../../node_modules/js-yaml/src/schema.ts","../../node_modules/js-yaml/src/tag/mapping/real_map.ts","../../node_modules/js-yaml/src/tag/mapping/legacy_map.ts","../../node_modules/js-yaml/src/common/snippet.ts","../../node_modules/js-yaml/src/common/exception.ts","../../node_modules/js-yaml/src/parser/events.ts","../../node_modules/js-yaml/src/parser/parser_scalar.ts","../../node_modules/js-yaml/src/common/tagname.ts","../../node_modules/js-yaml/src/parser/constructor.ts","../../node_modules/js-yaml/src/parser/parser.ts","../../node_modules/js-yaml/src/load.ts","../../node_modules/js-yaml/src/ast/nodes.ts","../../node_modules/js-yaml/src/ast/from_js.ts","../../node_modules/js-yaml/src/ast/visit.ts","../../node_modules/js-yaml/src/ast/presenter.ts","../../node_modules/js-yaml/src/dump.ts","../../node_modules/js-yaml/src/ast/from_events.ts","../../node_modules/js-yaml/src/index.ts","../../src/sde/ingestion/constants.ts","../../src/sde/ingestion/SdeExtractor.ts","../../src/sde/errors.ts","../../src/sde/ingestion/transforms.ts","../../src/sde/MemorySdeProvider.ts","../../src/sde/SdeTestDataFactory.ts"],"sourcesContent":["module.exports = {\n /* The local file header */\n LOCHDR : 30, // LOC header size\n LOCSIG : 0x04034b50, // \"PK\\003\\004\"\n LOCVER : 4,\t// version needed to extract\n LOCFLG : 6, // general purpose bit flag\n LOCHOW : 8, // compression method\n LOCTIM : 10, // modification time (2 bytes time, 2 bytes date)\n LOCCRC : 14, // uncompressed file crc-32 value\n LOCSIZ : 18, // compressed size\n LOCLEN : 22, // uncompressed size\n LOCNAM : 26, // filename length\n LOCEXT : 28, // extra field length\n\n /* The Data descriptor */\n EXTSIG : 0x08074b50, // \"PK\\007\\008\"\n EXTHDR : 16, // EXT header size\n EXTCRC : 4, // uncompressed file crc-32 value\n EXTSIZ : 8, // compressed size\n EXTLEN : 12, // uncompressed size\n\n /* The central directory file header */\n CENHDR : 46, // CEN header size\n CENSIG : 0x02014b50, // \"PK\\001\\002\"\n CENVEM : 4, // version made by\n CENVER : 6, // version needed to extract\n CENFLG : 8, // encrypt, decrypt flags\n CENHOW : 10, // compression method\n CENTIM : 12, // modification time (2 bytes time, 2 bytes date)\n CENCRC : 16, // uncompressed file crc-32 value\n CENSIZ : 20, // compressed size\n CENLEN : 24, // uncompressed size\n CENNAM : 28, // filename length\n CENEXT : 30, // extra field length\n CENCOM : 32, // file comment length\n CENDSK : 34, // volume number start\n CENATT : 36, // internal file attributes\n CENATX : 38, // external file attributes (host system dependent)\n CENOFF : 42, // LOC header offset\n\n /* The entries in the end of central directory */\n ENDHDR : 22, // END header size\n ENDSIG : 0x06054b50, // \"PK\\005\\006\"\n ENDSUB : 8, // number of entries on this disk\n ENDTOT : 10, // total number of entries\n ENDSIZ : 12, // central directory size in bytes\n ENDOFF : 16, // offset of first CEN header\n ENDCOM : 20, // zip file comment length\n\n END64HDR : 20, // zip64 END header size\n END64SIG : 0x07064b50, // zip64 Locator signature, \"PK\\006\\007\"\n END64START : 4, // number of the disk with the start of the zip64\n END64OFF : 8, // relative offset of the zip64 end of central directory\n END64NUMDISKS : 16, // total number of disks\n\n ZIP64SIG : 0x06064b50, // zip64 signature, \"PK\\006\\006\"\n ZIP64HDR : 56, // zip64 record minimum size\n ZIP64LEAD : 12, // leading bytes at the start of the record, not counted by the value stored in ZIP64SIZE\n ZIP64SIZE : 4, // zip64 size of the central directory record\n ZIP64VEM : 12, // zip64 version made by\n ZIP64VER : 14, // zip64 version needed to extract\n ZIP64DSK : 16, // zip64 number of this disk\n ZIP64DSKDIR : 20, // number of the disk with the start of the record directory\n ZIP64SUB : 24, // number of entries on this disk\n ZIP64TOT : 32, // total number of entries\n ZIP64SIZB : 40, // zip64 central directory size in bytes\n ZIP64OFF : 48, // offset of start of central directory with respect to the starting disk number\n ZIP64EXTRA : 56, // extensible data sector\n\n /* Compression methods */\n STORED : 0, // no compression\n SHRUNK : 1, // shrunk\n REDUCED1 : 2, // reduced with compression factor 1\n REDUCED2 : 3, // reduced with compression factor 2\n REDUCED3 : 4, // reduced with compression factor 3\n REDUCED4 : 5, // reduced with compression factor 4\n IMPLODED : 6, // imploded\n // 7 reserved for Tokenizing compression algorithm\n DEFLATED : 8, // deflated\n ENHANCED_DEFLATED: 9, // enhanced deflated\n PKWARE : 10,// PKWare DCL imploded\n // 11 reserved by PKWARE\n BZIP2 : 12, // compressed using BZIP2\n // 13 reserved by PKWARE\n LZMA : 14, // LZMA\n // 15-17 reserved by PKWARE\n IBM_TERSE : 18, // compressed using IBM TERSE\n IBM_LZ77 : 19, // IBM LZ77 z\n AES_ENCRYPT : 99, // WinZIP AES encryption method\n\n /* General purpose bit flag */\n // values can obtained with expression 2**bitnr\n FLG_ENC : 1, // Bit 0: encrypted file\n FLG_COMP1 : 2, // Bit 1, compression option\n FLG_COMP2 : 4, // Bit 2, compression option\n FLG_DESC : 8, // Bit 3, data descriptor\n FLG_ENH : 16, // Bit 4, enhanced deflating\n FLG_PATCH : 32, // Bit 5, indicates that the file is compressed patched data.\n FLG_STR : 64, // Bit 6, strong encryption (patented)\n // Bits 7-10: Currently unused.\n FLG_EFS : 2048, // Bit 11: Language encoding flag (EFS)\n // Bit 12: Reserved by PKWARE for enhanced compression.\n // Bit 13: encrypted the Central Directory (patented).\n // Bits 14-15: Reserved by PKWARE.\n FLG_MSK : 4096, // mask header values\n\n /* Load type */\n FILE : 2,\n BUFFER : 1,\n NONE : 0,\n\n /* 4.5 Extensible data fields */\n EF_ID : 0,\n EF_SIZE : 2,\n\n /* Header IDs */\n ID_ZIP64 : 0x0001,\n ID_AVINFO : 0x0007,\n ID_PFS : 0x0008,\n ID_OS2 : 0x0009,\n ID_NTFS : 0x000a,\n ID_OPENVMS : 0x000c,\n ID_UNIX : 0x000d,\n ID_FORK : 0x000e,\n ID_PATCH : 0x000f,\n ID_X509_PKCS7 : 0x0014,\n ID_X509_CERTID_F : 0x0015,\n ID_X509_CERTID_C : 0x0016,\n ID_STRONGENC : 0x0017,\n ID_RECORD_MGT : 0x0018,\n ID_X509_PKCS7_RL : 0x0019,\n ID_IBM1 : 0x0065,\n ID_IBM2 : 0x0066,\n ID_POSZIP : 0x4690,\n\n EF_ZIP64_OR_32 : 0xffffffff,\n EF_ZIP64_OR_16 : 0xffff,\n EF_ZIP64_SUNCOMP : 0,\n EF_ZIP64_SCOMP : 8,\n EF_ZIP64_RHO : 16,\n EF_ZIP64_DSN : 24\n};\n","const errors = {\n /* Header error messages */\n INVALID_LOC: \"Invalid LOC header (bad signature)\",\n INVALID_CEN: \"Invalid CEN header (bad signature)\",\n INVALID_END: \"Invalid END header (bad signature)\",\n\n /* Descriptor */\n DESCRIPTOR_NOT_EXIST: \"No descriptor present\",\n DESCRIPTOR_UNKNOWN: \"Unknown descriptor format\",\n DESCRIPTOR_FAULTY: \"Descriptor data is malformed\",\n\n /* ZipEntry error messages*/\n NO_DATA: \"Nothing to decompress\",\n BAD_CRC: \"CRC32 checksum failed {0}\",\n FILE_IN_THE_WAY: \"There is a file in the way: {0}\",\n UNKNOWN_METHOD: \"Invalid/unsupported compression method\",\n\n /* Inflater error messages */\n AVAIL_DATA: \"inflate::Available inflate data did not terminate\",\n INVALID_DISTANCE: \"inflate::Invalid literal/length or distance code in fixed or dynamic block\",\n TO_MANY_CODES: \"inflate::Dynamic block code description: too many length or distance codes\",\n INVALID_REPEAT_LEN: \"inflate::Dynamic block code description: repeat more than specified lengths\",\n INVALID_REPEAT_FIRST: \"inflate::Dynamic block code description: repeat lengths with no first length\",\n INCOMPLETE_CODES: \"inflate::Dynamic block code description: code lengths codes incomplete\",\n INVALID_DYN_DISTANCE: \"inflate::Dynamic block code description: invalid distance code lengths\",\n INVALID_CODES_LEN: \"inflate::Dynamic block code description: invalid literal/length code lengths\",\n INVALID_STORE_BLOCK: \"inflate::Stored block length did not match one's complement\",\n INVALID_BLOCK_TYPE: \"inflate::Invalid block type (type == 3)\",\n\n /* ADM-ZIP error messages */\n CANT_EXTRACT_FILE: \"Could not extract the file\",\n CANT_OVERRIDE: \"Target file already exists\",\n DISK_ENTRY_TOO_LARGE: \"Number of disk entries is too large\",\n NO_ZIP: \"No zip file was loaded\",\n NO_ENTRY: \"Entry doesn't exist\",\n DIRECTORY_CONTENT_ERROR: \"A directory cannot have content\",\n FILE_NOT_FOUND: 'File not found: \"{0}\"',\n NOT_IMPLEMENTED: \"Not implemented\",\n INVALID_FILENAME: \"Invalid filename\",\n INVALID_FORMAT: \"Invalid or unsupported zip format. No END header found\",\n INVALID_PASS_PARAM: \"Incompatible password parameter\",\n WRONG_PASSWORD: \"Wrong Password\",\n\n /* ADM-ZIP */\n COMMENT_TOO_LONG: \"Comment is too long\", // Comment can be max 65535 bytes long (NOTE: some non-US characters may take more space)\n EXTRA_FIELD_PARSE_ERROR: \"Extra field parsing error\"\n};\n\n// template\nfunction E(message) {\n return function (...args) {\n if (args.length) { // Allow {0} .. {9} arguments in error message, based on argument number\n message = message.replace(/\\{(\\d)\\}/g, (_, n) => args[n] || '');\n }\n\n return new Error('ADM-ZIP: ' + message);\n };\n}\n\n// Init errors with template\nfor (const msg of Object.keys(errors)) {\n exports[msg] = E(errors[msg]);\n}\n","const fsystem = require(\"fs\");\nconst pth = require(\"path\");\nconst Constants = require(\"./constants\");\nconst Errors = require(\"./errors\");\nconst isWin = typeof process === \"object\" && \"win32\" === process.platform;\n\nconst is_Obj = (obj) => typeof obj === \"object\" && obj !== null;\n\n// generate CRC32 lookup table\nconst crcTable = new Uint32Array(256).map((t, c) => {\n for (let k = 0; k < 8; k++) {\n if ((c & 1) !== 0) {\n c = 0xedb88320 ^ (c >>> 1);\n } else {\n c >>>= 1;\n }\n }\n return c >>> 0;\n});\n\n// UTILS functions\n\nfunction Utils(opts) {\n this.sep = pth.sep;\n this.fs = fsystem;\n\n if (is_Obj(opts)) {\n // custom filesystem\n if (is_Obj(opts.fs) && typeof opts.fs.statSync === \"function\") {\n this.fs = opts.fs;\n }\n }\n}\n\nmodule.exports = Utils;\n\n// INSTANTIABLE functions\n\nUtils.prototype.makeDir = function (/*String*/ folder) {\n const self = this;\n\n // Sync - make directories tree\n function mkdirSync(/*String*/ fpath) {\n let resolvedPath = fpath.split(self.sep)[0];\n fpath.split(self.sep).forEach(function (name) {\n if (!name || name.substr(-1, 1) === \":\") return;\n resolvedPath += self.sep + name;\n var stat;\n try {\n stat = self.fs.statSync(resolvedPath);\n } catch (e) {\n if (e.message && e.message.startsWith('ENOENT')) {\n self.fs.mkdirSync(resolvedPath);\n } else {\n throw e;\n }\n }\n if (stat && stat.isFile()) throw Errors.FILE_IN_THE_WAY(`\"${resolvedPath}\"`);\n });\n }\n\n mkdirSync(folder);\n};\n\nUtils.prototype.writeFileTo = function (/*String*/ path, /*Buffer*/ content, /*Boolean*/ overwrite, /*Number*/ attr) {\n const self = this;\n if (self.fs.existsSync(path)) {\n if (!overwrite) return false; // cannot overwrite\n\n var stat = self.fs.statSync(path);\n if (stat.isDirectory()) {\n return false;\n }\n }\n var folder = pth.dirname(path);\n if (!self.fs.existsSync(folder)) {\n self.makeDir(folder);\n }\n\n var fd;\n try {\n fd = self.fs.openSync(path, \"w\", 0o666); // 0666\n } catch (e) {\n self.fs.chmodSync(path, 0o666);\n fd = self.fs.openSync(path, \"w\", 0o666);\n }\n if (fd) {\n try {\n self.fs.writeSync(fd, content, 0, content.length, 0);\n } finally {\n self.fs.closeSync(fd);\n }\n }\n self.fs.chmodSync(path, attr || 0o666);\n return true;\n};\n\nUtils.prototype.writeFileToAsync = function (/*String*/ path, /*Buffer*/ content, /*Boolean*/ overwrite, /*Number*/ attr, /*Function*/ callback) {\n if (typeof attr === \"function\") {\n callback = attr;\n attr = undefined;\n }\n\n const self = this;\n\n self.fs.exists(path, function (exist) {\n if (exist && !overwrite) return callback(false);\n\n self.fs.stat(path, function (err, stat) {\n if (exist && stat && stat.isDirectory()) {\n return callback(false);\n }\n\n var folder = pth.dirname(path);\n self.fs.exists(folder, function (exists) {\n if (!exists) {\n // makeDir is synchronous and can throw (e.g. EACCES); report failure\n // rather than letting it escape this callback as an uncaught exception\n try {\n self.makeDir(folder);\n } catch (e) {\n return callback(false);\n }\n }\n\n // write the content to an open descriptor, then apply the attributes\n const writeToFd = function (fd) {\n self.fs.write(fd, content, 0, content.length, 0, function (writeErr) {\n self.fs.close(fd, function () {\n // surface write failures instead of silently reporting success (issue #402)\n if (writeErr) return callback(false);\n self.fs.chmod(path, attr || 0o666, function () {\n callback(true);\n });\n });\n });\n };\n\n self.fs.open(path, \"w\", 0o666, function (err, fd) {\n if (err) {\n // the target may exist but be read-only: make it writable and retry once\n self.fs.chmod(path, 0o666, function () {\n self.fs.open(path, \"w\", 0o666, function (retryErr, fd) {\n // Previously the retry error was ignored and an undefined fd was\n // passed to fs.write, throwing an uncaught ERR_INVALID_ARG_TYPE that\n // crashed the process (issues #470, #459, #402). Report failure instead.\n if (retryErr || !fd) return callback(false);\n writeToFd(fd);\n });\n });\n } else if (fd) {\n writeToFd(fd);\n } else {\n callback(false);\n }\n });\n });\n });\n });\n};\n\nUtils.prototype.findFiles = function (/*String*/ path) {\n const self = this;\n\n function findSync(/*String*/ dir, /*RegExp*/ pattern, /*Boolean*/ recursive, /*Set*/ visited) {\n if (typeof pattern === \"boolean\") {\n recursive = pattern;\n pattern = undefined;\n }\n let files = [];\n self.fs.readdirSync(dir).forEach(function (file) {\n const path = pth.join(dir, file);\n const stat = self.fs.statSync(path);\n\n if (!pattern || pattern.test(path)) {\n files.push(pth.normalize(path) + (stat.isDirectory() ? self.sep : \"\"));\n }\n\n if (stat.isDirectory() && recursive) {\n // Descend by resolved real path and skip directories we have already\n // visited. This stops a symlink that points back to an ancestor from\n // recursing forever until the path fails with ELOOP / ENAMETOOLONG\n // (issue #541).\n const realDir = self.fs.realpathSync(path);\n if (!visited.has(realDir)) {\n visited.add(realDir);\n files = files.concat(findSync(path, pattern, recursive, visited));\n }\n }\n });\n return files;\n }\n\n return findSync(path, undefined, true, new Set([self.fs.realpathSync(path)]));\n};\n\n/**\n * Callback for showing if everything was done.\n *\n * @callback filelistCallback\n * @param {Error} err - Error object\n * @param {string[]} list - was request fully completed\n */\n\n/**\n *\n * @param {string} dir\n * @param {filelistCallback} cb\n */\nUtils.prototype.findFilesAsync = function (dir, cb) {\n const self = this;\n const results = [];\n let finished = false;\n const finish = function (err) {\n if (finished) return;\n finished = true;\n cb(err, err ? undefined : results);\n };\n\n // Descend by resolved real path and skip directories already visited, so a\n // symlink pointing back to an ancestor cannot recurse forever (issue #541).\n const walk = function (dir, visited, done) {\n self.fs.readdir(dir, function (err, list) {\n if (err) return done(err);\n let pending = list.length;\n if (!pending) return done();\n list.forEach(function (name) {\n const file = pth.join(dir, name);\n self.fs.stat(file, function (err, stat) {\n if (err) return done(err);\n if (!stat) {\n if (!--pending) done();\n return;\n }\n results.push(pth.normalize(file) + (stat.isDirectory() ? self.sep : \"\"));\n if (!stat.isDirectory()) {\n if (!--pending) done();\n return;\n }\n self.fs.realpath(file, function (err, realDir) {\n if (err) return done(err);\n if (visited.has(realDir)) {\n if (!--pending) done();\n return;\n }\n visited.add(realDir);\n walk(file, visited, function (err) {\n if (err) return done(err);\n if (!--pending) done();\n });\n });\n });\n });\n });\n };\n\n self.fs.realpath(dir, function (err, realDir) {\n if (err) return finish(err);\n walk(dir, new Set([realDir]), finish);\n });\n};\n\nUtils.prototype.getAttributes = function () {};\n\nUtils.prototype.setAttributes = function () {};\n\n// STATIC functions\n\n// crc32 single update (it is part of crc32)\nUtils.crc32update = function (crc, byte) {\n return crcTable[(crc ^ byte) & 0xff] ^ (crc >>> 8);\n};\n\nUtils.crc32 = function (buf) {\n if (typeof buf === \"string\") {\n buf = Buffer.from(buf, \"utf8\");\n }\n\n let len = buf.length;\n let crc = ~0;\n for (let off = 0; off < len; ) crc = Utils.crc32update(crc, buf[off++]);\n // xor and cast as uint32 number\n return ~crc >>> 0;\n};\n\nUtils.methodToString = function (/*Number*/ method) {\n switch (method) {\n case Constants.STORED:\n return \"STORED (\" + method + \")\";\n case Constants.DEFLATED:\n return \"DEFLATED (\" + method + \")\";\n default:\n return \"UNSUPPORTED (\" + method + \")\";\n }\n};\n\n/**\n * removes \"..\" style path elements\n * @param {string} path - fixable path\n * @returns string - fixed filepath\n */\nUtils.canonical = function (/*string*/ path) {\n if (!path) return \"\";\n // trick normalize think path is absolute\n const safeSuffix = pth.posix.normalize(\"/\" + path.split(\"\\\\\").join(\"/\"));\n return pth.join(\".\", safeSuffix);\n};\n\n/**\n * fix file names in achive\n * @param {string} path - fixable path\n * @returns string - fixed filepath\n */\n\nUtils.zipnamefix = function (path) {\n if (!path) return \"\";\n // trick normalize think path is absolute\n const safeSuffix = pth.posix.normalize(\"/\" + path.split(\"\\\\\").join(\"/\"));\n return pth.posix.join(\".\", safeSuffix);\n};\n\n/**\n *\n * @param {Array} arr\n * @param {function} callback\n * @returns\n */\nUtils.findLast = function (arr, callback) {\n if (!Array.isArray(arr)) throw new TypeError(\"arr is not array\");\n\n const len = arr.length >>> 0;\n for (let i = len - 1; i >= 0; i--) {\n if (callback(arr[i], i, arr)) {\n return arr[i];\n }\n }\n return void 0;\n};\n\n// make absolute paths taking prefix as root folder\nUtils.sanitize = function (/*string*/ prefix, /*string*/ name) {\n prefix = pth.resolve(pth.normalize(prefix));\n var parts = name.split(\"/\");\n for (var i = 0, l = parts.length; i < l; i++) {\n var path = pth.normalize(pth.join(prefix, parts.slice(i, l).join(pth.sep)));\n if (path === prefix || path.startsWith(prefix + pth.sep)) {\n return path;\n }\n }\n return pth.normalize(pth.join(prefix, pth.basename(name)));\n};\n\n// converts buffer, Uint8Array, string types to buffer\nUtils.toBuffer = function toBuffer(/*buffer, Uint8Array, string*/ input, /* function */ encoder) {\n if (Buffer.isBuffer(input)) {\n return input;\n } else if (input instanceof Uint8Array) {\n return Buffer.from(input);\n } else {\n // expect string all other values are invalid and return empty buffer\n return typeof input === \"string\" ? encoder(input) : Buffer.alloc(0);\n }\n};\n\nUtils.readBigUInt64LE = function (/*Buffer*/ buffer, /*int*/ index) {\n const lo = buffer.readUInt32LE(index);\n const hi = buffer.readUInt32LE(index + 4);\n return hi * 0x100000000 + lo;\n};\n\nUtils.writeBigUInt64LE = function (/*Buffer*/ buffer, /*Number*/ value, /*int*/ index) {\n const lo = value >>> 0;\n const hi = Math.floor(value / 0x100000000) >>> 0;\n buffer.writeUInt32LE(lo, index);\n buffer.writeUInt32LE(hi, index + 4);\n};\n\nUtils.fromDOS2Date = function (val) {\n return new Date(((val >> 25) & 0x7f) + 1980, Math.max(((val >> 21) & 0x0f) - 1, 0), Math.max((val >> 16) & 0x1f, 1), (val >> 11) & 0x1f, (val >> 5) & 0x3f, (val & 0x1f) << 1);\n};\n\nUtils.fromDate2DOS = function (val) {\n let date = 0;\n let time = 0;\n if (val.getFullYear() > 1979) {\n date = (((val.getFullYear() - 1980) & 0x7f) << 9) | ((val.getMonth() + 1) << 5) | val.getDate();\n time = (val.getHours() << 11) | (val.getMinutes() << 5) | (val.getSeconds() >> 1);\n }\n return (date << 16) | time;\n};\n\nUtils.isWin = isWin; // Do we have windows system\nUtils.crcTable = crcTable;\n","const pth = require(\"path\");\n\nmodule.exports = function (/*String*/ path, /*Utils object*/ { fs }) {\n var _path = path || \"\",\n _obj = newAttr(),\n _stat = null;\n\n function newAttr() {\n return {\n directory: false,\n readonly: false,\n hidden: false,\n executable: false,\n mtime: 0,\n atime: 0\n };\n }\n\n if (_path && fs.existsSync(_path)) {\n _stat = fs.statSync(_path);\n _obj.directory = _stat.isDirectory();\n _obj.mtime = _stat.mtime;\n _obj.atime = _stat.atime;\n _obj.executable = (0o111 & _stat.mode) !== 0; // file is executable who ever har right not just owner\n _obj.readonly = (0o200 & _stat.mode) === 0; // readonly if owner has no write right\n _obj.hidden = pth.basename(_path)[0] === \".\";\n } else {\n console.warn(\"Invalid path: \" + _path);\n }\n\n return {\n get directory() {\n return _obj.directory;\n },\n\n get readOnly() {\n return _obj.readonly;\n },\n\n get hidden() {\n return _obj.hidden;\n },\n\n get mtime() {\n return _obj.mtime;\n },\n\n get atime() {\n return _obj.atime;\n },\n\n get executable() {\n return _obj.executable;\n },\n\n decodeAttributes: function () {},\n\n encodeAttributes: function () {},\n\n toJSON: function () {\n return {\n path: _path,\n isDirectory: _obj.directory,\n isReadOnly: _obj.readonly,\n isHidden: _obj.hidden,\n isExecutable: _obj.executable,\n mTime: _obj.mtime,\n aTime: _obj.atime\n };\n },\n\n toString: function () {\n return JSON.stringify(this.toJSON(), null, \"\\t\");\n }\n };\n};\n","module.exports = {\n efs: true,\n encode: (data) => Buffer.from(data, \"utf8\"),\n decode: (data) => data.toString(\"utf8\")\n};\n","module.exports = require(\"./utils\");\nmodule.exports.Constants = require(\"./constants\");\nmodule.exports.Errors = require(\"./errors\");\nmodule.exports.FileAttr = require(\"./fattr\");\nmodule.exports.decoder = require(\"./decoder\");\n","var Utils = require(\"../util\"),\n Constants = Utils.Constants;\n\n/* The central directory file header */\nmodule.exports = function () {\n var _verMade = 20, // v2.0\n _version = 10, // v1.0\n _flags = 0,\n _method = 0,\n _time = 0,\n _crc = 0,\n _compressedSize = 0,\n _size = 0,\n _fnameLen = 0,\n _extraLen = 0,\n _comLen = 0,\n _diskStart = 0,\n _inattr = 0,\n _attr = 0,\n _offset = 0;\n\n _verMade |= Utils.isWin ? 0x0a00 : 0x0300;\n\n // Set EFS flag since filename and comment fields are all by default encoded using UTF-8.\n // Without it file names may be corrupted for other apps when file names use unicode chars\n _flags |= Constants.FLG_EFS;\n\n const _localHeader = {\n extraLen: 0\n };\n\n // casting\n const uint32 = (val) => Math.max(0, val) >>> 0;\n const uint16 = (val) => Math.max(0, val) & 0xffff;\n const uint8 = (val) => Math.max(0, val) & 0xff;\n\n _time = Utils.fromDate2DOS(new Date());\n\n return {\n get made() {\n return _verMade;\n },\n set made(val) {\n _verMade = val;\n },\n\n get version() {\n return _version;\n },\n set version(val) {\n _version = val;\n },\n\n get flags() {\n return _flags;\n },\n set flags(val) {\n _flags = val;\n },\n\n get flags_efs() {\n return (_flags & Constants.FLG_EFS) > 0;\n },\n set flags_efs(val) {\n if (val) {\n _flags |= Constants.FLG_EFS;\n } else {\n _flags &= ~Constants.FLG_EFS;\n }\n },\n\n get flags_desc() {\n return (_flags & Constants.FLG_DESC) > 0;\n },\n set flags_desc(val) {\n if (val) {\n _flags |= Constants.FLG_DESC;\n } else {\n _flags &= ~Constants.FLG_DESC;\n }\n },\n\n get method() {\n return _method;\n },\n set method(val) {\n switch (val) {\n case Constants.STORED:\n this.version = 10;\n break;\n case Constants.DEFLATED:\n default:\n this.version = 20;\n }\n _method = val;\n },\n\n get time() {\n return Utils.fromDOS2Date(this.timeval);\n },\n set time(val) {\n val = new Date(val);\n this.timeval = Utils.fromDate2DOS(val);\n },\n\n get timeval() {\n return _time;\n },\n set timeval(val) {\n _time = uint32(val);\n },\n\n get timeHighByte() {\n return uint8(_time >>> 8);\n },\n get crc() {\n return _crc;\n },\n set crc(val) {\n _crc = uint32(val);\n },\n\n get compressedSize() {\n return _compressedSize;\n },\n set compressedSize(val) {\n _compressedSize = uint32(val);\n },\n\n get size() {\n return _size;\n },\n set size(val) {\n _size = uint32(val);\n },\n\n get fileNameLength() {\n return _fnameLen;\n },\n set fileNameLength(val) {\n _fnameLen = val;\n },\n\n get extraLength() {\n return _extraLen;\n },\n set extraLength(val) {\n _extraLen = val;\n },\n\n get extraLocalLength() {\n return _localHeader.extraLen;\n },\n set extraLocalLength(val) {\n _localHeader.extraLen = val;\n },\n\n get commentLength() {\n return _comLen;\n },\n set commentLength(val) {\n _comLen = val;\n },\n\n get diskNumStart() {\n return _diskStart;\n },\n set diskNumStart(val) {\n _diskStart = uint32(val);\n },\n\n get inAttr() {\n return _inattr;\n },\n set inAttr(val) {\n _inattr = uint32(val);\n },\n\n get attr() {\n return _attr;\n },\n set attr(val) {\n _attr = uint32(val);\n },\n\n // get Unix file permissions\n get fileAttr() {\n return (_attr || 0) >> 16 & 0xfff;\n },\n\n get offset() {\n return _offset;\n },\n set offset(val) {\n _offset = uint32(val);\n },\n\n get encrypted() {\n return (_flags & Constants.FLG_ENC) === Constants.FLG_ENC;\n },\n\n get centralHeaderSize() {\n return Constants.CENHDR + _fnameLen + _extraLen + _comLen;\n },\n\n get realDataOffset() {\n return _offset + Constants.LOCHDR + _localHeader.fnameLen + _localHeader.extraLen;\n },\n\n get localHeader() {\n return _localHeader;\n },\n\n loadLocalHeaderFromBinary: function (/*Buffer*/ input) {\n var data = input.slice(_offset, _offset + Constants.LOCHDR);\n // 30 bytes and should start with \"PK\\003\\004\"\n if (data.readUInt32LE(0) !== Constants.LOCSIG) {\n throw Utils.Errors.INVALID_LOC();\n }\n\n // version needed to extract\n _localHeader.version = data.readUInt16LE(Constants.LOCVER);\n // general purpose bit flag\n _localHeader.flags = data.readUInt16LE(Constants.LOCFLG);\n // desc flag\n _localHeader.flags_desc = (_localHeader.flags & Constants.FLG_DESC) > 0;\n // compression method\n _localHeader.method = data.readUInt16LE(Constants.LOCHOW);\n // modification time (2 bytes time, 2 bytes date)\n _localHeader.time = data.readUInt32LE(Constants.LOCTIM);\n // uncompressed file crc-32 valu\n _localHeader.crc = data.readUInt32LE(Constants.LOCCRC);\n // compressed size\n _localHeader.compressedSize = data.readUInt32LE(Constants.LOCSIZ);\n // uncompressed size\n _localHeader.size = data.readUInt32LE(Constants.LOCLEN);\n // filename length\n _localHeader.fnameLen = data.readUInt16LE(Constants.LOCNAM);\n // extra field length\n _localHeader.extraLen = data.readUInt16LE(Constants.LOCEXT);\n\n // read extra data\n const extraStart = _offset + Constants.LOCHDR + _localHeader.fnameLen;\n const extraEnd = extraStart + _localHeader.extraLen;\n return input.slice(extraStart, extraEnd);\n },\n\n loadFromBinary: function (/*Buffer*/ data) {\n // data should be 46 bytes and start with \"PK 01 02\"\n if (data.length !== Constants.CENHDR || data.readUInt32LE(0) !== Constants.CENSIG) {\n throw Utils.Errors.INVALID_CEN();\n }\n // version made by\n _verMade = data.readUInt16LE(Constants.CENVEM);\n // version needed to extract\n _version = data.readUInt16LE(Constants.CENVER);\n // encrypt, decrypt flags\n _flags = data.readUInt16LE(Constants.CENFLG);\n // compression method\n _method = data.readUInt16LE(Constants.CENHOW);\n // modification time (2 bytes time, 2 bytes date)\n _time = data.readUInt32LE(Constants.CENTIM);\n // uncompressed file crc-32 value\n _crc = data.readUInt32LE(Constants.CENCRC);\n // compressed size\n _compressedSize = data.readUInt32LE(Constants.CENSIZ);\n // uncompressed size\n _size = data.readUInt32LE(Constants.CENLEN);\n // filename length\n _fnameLen = data.readUInt16LE(Constants.CENNAM);\n // extra field length\n _extraLen = data.readUInt16LE(Constants.CENEXT);\n // file comment length\n _comLen = data.readUInt16LE(Constants.CENCOM);\n // volume number start\n _diskStart = data.readUInt16LE(Constants.CENDSK);\n // internal file attributes\n _inattr = data.readUInt16LE(Constants.CENATT);\n // external file attributes\n _attr = data.readUInt32LE(Constants.CENATX);\n // LOC header offset\n _offset = data.readUInt32LE(Constants.CENOFF);\n },\n\n localHeaderToBinary: function () {\n // LOC header size (30 bytes)\n var data = Buffer.alloc(Constants.LOCHDR);\n // \"PK\\003\\004\"\n data.writeUInt32LE(Constants.LOCSIG, 0);\n // version needed to extract\n data.writeUInt16LE(_version, Constants.LOCVER);\n // general purpose bit flag\n // clear bit 3 (data descriptor): we always write the real crc-32\n // and sizes into this local header, so no trailing descriptor is\n // emitted. Leaving the flag set would make the output unreadable\n // (see issue #555).\n data.writeUInt16LE(_flags & ~Constants.FLG_DESC, Constants.LOCFLG);\n // compression method\n data.writeUInt16LE(_method, Constants.LOCHOW);\n // modification time (2 bytes time, 2 bytes date)\n data.writeUInt32LE(_time, Constants.LOCTIM);\n // uncompressed file crc-32 value\n data.writeUInt32LE(_crc, Constants.LOCCRC);\n // compressed size\n data.writeUInt32LE(_compressedSize, Constants.LOCSIZ);\n // uncompressed size\n data.writeUInt32LE(_size, Constants.LOCLEN);\n // filename length\n data.writeUInt16LE(_fnameLen, Constants.LOCNAM);\n // extra field length\n data.writeUInt16LE(_localHeader.extraLen, Constants.LOCEXT);\n return data;\n },\n\n centralHeaderToBinary: function () {\n // CEN header size (46 bytes)\n var data = Buffer.alloc(Constants.CENHDR + _fnameLen + _extraLen + _comLen);\n // \"PK\\001\\002\"\n data.writeUInt32LE(Constants.CENSIG, 0);\n // version made by\n data.writeUInt16LE(_verMade, Constants.CENVEM);\n // version needed to extract\n data.writeUInt16LE(_version, Constants.CENVER);\n // encrypt, decrypt flags\n // clear bit 3 (data descriptor) to match the local header we emit\n // (real crc/sizes are written, no descriptor follows the data) — issue #555\n data.writeUInt16LE(_flags & ~Constants.FLG_DESC, Constants.CENFLG);\n // compression method\n data.writeUInt16LE(_method, Constants.CENHOW);\n // modification time (2 bytes time, 2 bytes date)\n data.writeUInt32LE(_time, Constants.CENTIM);\n // uncompressed file crc-32 value\n data.writeUInt32LE(_crc, Constants.CENCRC);\n // compressed size\n data.writeUInt32LE(_compressedSize, Constants.CENSIZ);\n // uncompressed size\n data.writeUInt32LE(_size, Constants.CENLEN);\n // filename length\n data.writeUInt16LE(_fnameLen, Constants.CENNAM);\n // extra field length\n data.writeUInt16LE(_extraLen, Constants.CENEXT);\n // file comment length\n data.writeUInt16LE(_comLen, Constants.CENCOM);\n // volume number start\n data.writeUInt16LE(_diskStart, Constants.CENDSK);\n // internal file attributes\n data.writeUInt16LE(_inattr, Constants.CENATT);\n // external file attributes\n data.writeUInt32LE(_attr, Constants.CENATX);\n // LOC header offset\n data.writeUInt32LE(_offset, Constants.CENOFF);\n return data;\n },\n\n toJSON: function () {\n const bytes = function (nr) {\n return nr + \" bytes\";\n };\n\n return {\n made: _verMade,\n version: _version,\n flags: _flags,\n method: Utils.methodToString(_method),\n time: this.time,\n crc: \"0x\" + _crc.toString(16).toUpperCase(),\n compressedSize: bytes(_compressedSize),\n size: bytes(_size),\n fileNameLength: bytes(_fnameLen),\n extraLength: bytes(_extraLen),\n commentLength: bytes(_comLen),\n diskNumStart: _diskStart,\n inAttr: _inattr,\n attr: _attr,\n offset: _offset,\n centralHeaderSize: bytes(Constants.CENHDR + _fnameLen + _extraLen + _comLen)\n };\n },\n\n toString: function () {\n return JSON.stringify(this.toJSON(), null, \"\\t\");\n }\n };\n};\n","var Utils = require(\"../util\"),\n Constants = Utils.Constants;\n\n/* The entries in the end of central directory */\nmodule.exports = function () {\n var _volumeEntries = 0,\n _totalEntries = 0,\n _size = 0,\n _offset = 0,\n _commentLength = 0;\n\n const needsZip64 = () => _volumeEntries > Constants.EF_ZIP64_OR_16 || _totalEntries > Constants.EF_ZIP64_OR_16 || _size > Constants.EF_ZIP64_OR_32 || _offset > Constants.EF_ZIP64_OR_32;\n\n return {\n get diskEntries() {\n return _volumeEntries;\n },\n set diskEntries(/*Number*/ val) {\n _volumeEntries = _totalEntries = val;\n },\n\n get totalEntries() {\n return _totalEntries;\n },\n set totalEntries(/*Number*/ val) {\n _totalEntries = _volumeEntries = val;\n },\n\n get size() {\n return _size;\n },\n set size(/*Number*/ val) {\n _size = val;\n },\n\n get offset() {\n return _offset;\n },\n set offset(/*Number*/ val) {\n _offset = val;\n },\n\n get commentLength() {\n return _commentLength;\n },\n set commentLength(/*Number*/ val) {\n _commentLength = val;\n },\n\n get mainHeaderSize() {\n return (needsZip64() ? Constants.ZIP64HDR + Constants.END64HDR : 0) + Constants.ENDHDR + _commentLength;\n },\n\n loadFromBinary: function (/*Buffer*/ data) {\n // data should be 22 bytes and start with \"PK 05 06\"\n // or be 56+ bytes and start with \"PK 06 06\" for Zip64\n if (\n (data.length !== Constants.ENDHDR || data.readUInt32LE(0) !== Constants.ENDSIG) &&\n (data.length < Constants.ZIP64HDR || data.readUInt32LE(0) !== Constants.ZIP64SIG)\n ) {\n throw Utils.Errors.INVALID_END();\n }\n\n if (data.readUInt32LE(0) === Constants.ENDSIG) {\n // number of entries on this volume\n _volumeEntries = data.readUInt16LE(Constants.ENDSUB);\n // total number of entries\n _totalEntries = data.readUInt16LE(Constants.ENDTOT);\n // central directory size in bytes\n _size = data.readUInt32LE(Constants.ENDSIZ);\n // offset of first CEN header\n _offset = data.readUInt32LE(Constants.ENDOFF);\n // zip file comment length\n _commentLength = data.readUInt16LE(Constants.ENDCOM);\n } else {\n // number of entries on this volume\n _volumeEntries = Utils.readBigUInt64LE(data, Constants.ZIP64SUB);\n // total number of entries\n _totalEntries = Utils.readBigUInt64LE(data, Constants.ZIP64TOT);\n // central directory size in bytes\n _size = Utils.readBigUInt64LE(data, Constants.ZIP64SIZB);\n // offset of first CEN header\n _offset = Utils.readBigUInt64LE(data, Constants.ZIP64OFF);\n\n _commentLength = 0;\n }\n },\n\n toBinary: function () {\n if (!needsZip64()) {\n var b = Buffer.alloc(Constants.ENDHDR + _commentLength);\n // \"PK 05 06\" signature\n b.writeUInt32LE(Constants.ENDSIG, 0);\n b.writeUInt32LE(0, 4);\n // number of entries on this volume\n b.writeUInt16LE(_volumeEntries, Constants.ENDSUB);\n // total number of entries\n b.writeUInt16LE(_totalEntries, Constants.ENDTOT);\n // central directory size in bytes\n b.writeUInt32LE(_size, Constants.ENDSIZ);\n // offset of first CEN header\n b.writeUInt32LE(_offset, Constants.ENDOFF);\n // zip file comment length\n b.writeUInt16LE(_commentLength, Constants.ENDCOM);\n // fill comment memory with spaces so no garbage is left there\n b.fill(\" \", Constants.ENDHDR);\n\n return b;\n }\n\n var b = Buffer.alloc(this.mainHeaderSize);\n let offset = 0;\n\n // Zip64 end of central directory record.\n b.writeUInt32LE(Constants.ZIP64SIG, offset);\n Utils.writeBigUInt64LE(b, Constants.ZIP64HDR - Constants.ZIP64LEAD, offset + Constants.ZIP64SIZE);\n b.writeUInt16LE(45, offset + Constants.ZIP64VEM);\n b.writeUInt16LE(45, offset + Constants.ZIP64VER);\n b.writeUInt32LE(0, offset + Constants.ZIP64DSK);\n b.writeUInt32LE(0, offset + Constants.ZIP64DSKDIR);\n Utils.writeBigUInt64LE(b, _volumeEntries, offset + Constants.ZIP64SUB);\n Utils.writeBigUInt64LE(b, _totalEntries, offset + Constants.ZIP64TOT);\n Utils.writeBigUInt64LE(b, _size, offset + Constants.ZIP64SIZB);\n Utils.writeBigUInt64LE(b, _offset, offset + Constants.ZIP64OFF);\n\n const zip64EndOffset = _offset + _size;\n offset += Constants.ZIP64HDR;\n\n // Zip64 end of central directory locator.\n b.writeUInt32LE(Constants.END64SIG, offset);\n b.writeUInt32LE(0, offset + Constants.END64START);\n Utils.writeBigUInt64LE(b, zip64EndOffset, offset + Constants.END64OFF);\n b.writeUInt32LE(1, offset + Constants.END64NUMDISKS);\n offset += Constants.END64HDR;\n\n // \"PK 05 06\" signature\n b.writeUInt32LE(Constants.ENDSIG, offset);\n b.writeUInt32LE(0, offset + 4);\n // number of entries on this volume\n b.writeUInt16LE(Math.min(_volumeEntries, Constants.EF_ZIP64_OR_16), offset + Constants.ENDSUB);\n // total number of entries\n b.writeUInt16LE(Math.min(_totalEntries, Constants.EF_ZIP64_OR_16), offset + Constants.ENDTOT);\n // central directory size in bytes\n b.writeUInt32LE(Math.min(_size, Constants.EF_ZIP64_OR_32), offset + Constants.ENDSIZ);\n // offset of first CEN header\n b.writeUInt32LE(Math.min(_offset, Constants.EF_ZIP64_OR_32), offset + Constants.ENDOFF);\n // zip file comment length\n b.writeUInt16LE(_commentLength, offset + Constants.ENDCOM);\n // fill comment memory with spaces so no garbage is left there\n b.fill(\" \", offset + Constants.ENDHDR);\n\n return b;\n },\n\n toJSON: function () {\n // creates 0x0000 style output\n const offset = function (nr, len) {\n let offs = nr.toString(16).toUpperCase();\n while (offs.length < len) offs = \"0\" + offs;\n return \"0x\" + offs;\n };\n\n return {\n diskEntries: _volumeEntries,\n totalEntries: _totalEntries,\n size: _size + \" bytes\",\n offset: offset(_offset, 4),\n commentLength: _commentLength\n };\n },\n\n toString: function () {\n return JSON.stringify(this.toJSON(), null, \"\\t\");\n }\n };\n};\n// Misspelled\n","exports.EntryHeader = require(\"./entryHeader\");\nexports.MainHeader = require(\"./mainHeader\");\n","module.exports = function (/*Buffer*/ inbuf) {\n var zlib = require(\"zlib\");\n\n var opts = { chunkSize: (parseInt(inbuf.length / 1024) + 1) * 1024 };\n\n return {\n deflate: function () {\n return zlib.deflateRawSync(inbuf, opts);\n },\n\n deflateAsync: function (/*Function*/ callback) {\n var tmp = zlib.createDeflateRaw(opts),\n parts = [],\n total = 0;\n tmp.on(\"data\", function (data) {\n parts.push(data);\n total += data.length;\n });\n tmp.on(\"end\", function () {\n var buf = Buffer.alloc(total),\n written = 0;\n buf.fill(0);\n for (var i = 0; i < parts.length; i++) {\n var part = parts[i];\n part.copy(buf, written);\n written += part.length;\n }\n callback && callback(buf);\n });\n tmp.end(inbuf);\n }\n };\n};\n","const version = +(process?.versions?.node ?? \"\").split(\".\")[0] || 0;\n\nmodule.exports = function (/*Buffer*/ inbuf, /*number*/ expectedLength) {\n var zlib = require(\"zlib\");\n const option = version >= 15 && expectedLength > 0 ? { maxOutputLength: expectedLength } : {};\n\n return {\n inflate: function () {\n return zlib.inflateRawSync(inbuf, option);\n },\n\n inflateAsync: function (/*Function*/ callback) {\n var tmp = zlib.createInflateRaw(option),\n parts = [],\n total = 0;\n tmp.on(\"data\", function (data) {\n parts.push(data);\n total += data.length;\n });\n tmp.on(\"end\", function () {\n var buf = Buffer.alloc(total),\n written = 0;\n buf.fill(0);\n for (var i = 0; i < parts.length; i++) {\n var part = parts[i];\n part.copy(buf, written);\n written += part.length;\n }\n callback && callback(buf);\n });\n tmp.end(inbuf);\n }\n };\n};\n","\"use strict\";\n\n// node crypt, we use it for generate salt\n// eslint-disable-next-line node/no-unsupported-features/node-builtins\nconst { randomFillSync } = require(\"crypto\");\nconst Errors = require(\"../util/errors\");\n\n// generate CRC32 lookup table\nconst crctable = new Uint32Array(256).map((t, crc) => {\n for (let j = 0; j < 8; j++) {\n if (0 !== (crc & 1)) {\n crc = (crc >>> 1) ^ 0xedb88320;\n } else {\n crc >>>= 1;\n }\n }\n return crc >>> 0;\n});\n\n// C-style uInt32 Multiply (discards higher bits, when JS multiply discards lower bits)\nconst uMul = (a, b) => Math.imul(a, b) >>> 0;\n\n// crc32 byte single update (actually same function is part of utils.crc32 function :) )\nconst crc32update = (pCrc32, bval) => {\n return crctable[(pCrc32 ^ bval) & 0xff] ^ (pCrc32 >>> 8);\n};\n\n// function for generating salt for encrytion header\nconst genSalt = () => {\n if (\"function\" === typeof randomFillSync) {\n return randomFillSync(Buffer.alloc(12));\n } else {\n // fallback if function is not defined\n return genSalt.node();\n }\n};\n\n// salt generation with node random function (mainly as fallback)\ngenSalt.node = () => {\n const salt = Buffer.alloc(12);\n const len = salt.length;\n for (let i = 0; i < len; i++) salt[i] = (Math.random() * 256) & 0xff;\n return salt;\n};\n\n// general config\nconst config = {\n genSalt\n};\n\n// Class Initkeys handles same basic ops with keys\nfunction Initkeys(pw) {\n const pass = Buffer.isBuffer(pw) ? pw : Buffer.from(pw);\n this.keys = new Uint32Array([0x12345678, 0x23456789, 0x34567890]);\n for (let i = 0; i < pass.length; i++) {\n this.updateKeys(pass[i]);\n }\n}\n\nInitkeys.prototype.updateKeys = function (byteValue) {\n const keys = this.keys;\n keys[0] = crc32update(keys[0], byteValue);\n keys[1] += keys[0] & 0xff;\n keys[1] = uMul(keys[1], 134775813) + 1;\n keys[2] = crc32update(keys[2], keys[1] >>> 24);\n return byteValue;\n};\n\nInitkeys.prototype.next = function () {\n const k = (this.keys[2] | 2) >>> 0; // key\n return (uMul(k, k ^ 1) >> 8) & 0xff; // decode\n};\n\nfunction make_decrypter(/*Buffer*/ pwd) {\n // 1. Stage initialize key\n const keys = new Initkeys(pwd);\n\n // return decrypter function\n return function (/*Buffer*/ data) {\n // result - we create new Buffer for results\n const result = Buffer.alloc(data.length);\n let pos = 0;\n // process input data\n for (let c of data) {\n //c ^= keys.next();\n //result[pos++] = c; // decode & Save Value\n result[pos++] = keys.updateKeys(c ^ keys.next()); // update keys with decoded byte\n }\n return result;\n };\n}\n\nfunction make_encrypter(/*Buffer*/ pwd) {\n // 1. Stage initialize key\n const keys = new Initkeys(pwd);\n\n // return encrypting function, result and pos is here so we dont have to merge buffers later\n return function (/*Buffer*/ data, /*Buffer*/ result, /* Number */ pos = 0) {\n // result - we create new Buffer for results\n if (!result) result = Buffer.alloc(data.length);\n // process input data\n for (let c of data) {\n const k = keys.next(); // save key byte\n result[pos++] = c ^ k; // save val\n keys.updateKeys(c); // update keys with decoded byte\n }\n return result;\n };\n}\n\nfunction decrypt(/*Buffer*/ data, /*Object*/ header, /*String, Buffer*/ pwd) {\n if (!data || !Buffer.isBuffer(data) || data.length < 12) {\n return Buffer.alloc(0);\n }\n\n // 1. We Initialize and generate decrypting function\n const decrypter = make_decrypter(pwd);\n\n // 2. decrypt salt what is always 12 bytes and is a part of file content\n const salt = decrypter(data.slice(0, 12));\n\n // if bit 3 (0x08) of the general-purpose flags field is set, check salt[11] with the high byte of the header time\n // 2 byte data block (as per Info-Zip spec), otherwise check with the high byte of the header entry\n const verifyByte = (header.flags & 0x8) === 0x8 ? header.timeHighByte : header.crc >>> 24;\n\n //3. does password meet expectations\n if (salt[11] !== verifyByte) {\n throw Errors.WRONG_PASSWORD();\n }\n\n // 4. decode content\n return decrypter(data.slice(12));\n}\n\n// lets add way to populate salt, NOT RECOMMENDED for production but maybe useful for testing general functionality\nfunction _salter(data) {\n if (Buffer.isBuffer(data) && data.length >= 12) {\n // be aware - currently salting buffer data is modified\n config.genSalt = function () {\n return data.slice(0, 12);\n };\n } else if (data === \"node\") {\n // test salt generation with node random function\n config.genSalt = genSalt.node;\n } else {\n // if value is not acceptable config gets reset.\n config.genSalt = genSalt;\n }\n}\n\nfunction encrypt(/*Buffer*/ data, /*Object*/ header, /*String, Buffer*/ pwd, /*Boolean*/ oldlike = false) {\n // 1. test data if data is not Buffer we make buffer from it\n if (data == null) data = Buffer.alloc(0);\n // if data is not buffer be make buffer from it\n if (!Buffer.isBuffer(data)) data = Buffer.from(data.toString());\n\n // 2. We Initialize and generate encrypting function\n const encrypter = make_encrypter(pwd);\n\n // 3. generate salt (12-bytes of random data)\n const salt = config.genSalt();\n salt[11] = (header.crc >>> 24) & 0xff;\n\n // old implementations (before PKZip 2.04g) used two byte check\n if (oldlike) salt[10] = (header.crc >>> 16) & 0xff;\n\n // 4. create output\n const result = Buffer.alloc(data.length + 12);\n encrypter(salt, result);\n\n // finally encode content\n return encrypter(data, result, 12);\n}\n\nmodule.exports = { decrypt, encrypt, _salter };\n","exports.Deflater = require(\"./deflater\");\nexports.Inflater = require(\"./inflater\");\nexports.ZipCrypto = require(\"./zipcrypto\");\n","var Utils = require(\"./util\"),\n Headers = require(\"./headers\"),\n Constants = Utils.Constants,\n Methods = require(\"./methods\");\n\nmodule.exports = function (/** object */ options, /*Buffer*/ input) {\n var _centralHeader = new Headers.EntryHeader(),\n _entryName = Buffer.alloc(0),\n _comment = Buffer.alloc(0),\n _isDirectory = false,\n uncompressedData = null,\n _extra = Buffer.alloc(0),\n _extralocal = Buffer.alloc(0),\n _efs = true;\n\n // assign options\n const opts = options;\n\n const decoder = typeof opts.decoder === \"object\" ? opts.decoder : Utils.decoder;\n _efs = decoder.hasOwnProperty(\"efs\") ? decoder.efs : false;\n\n function getCompressedDataFromZip() {\n //if (!input || !Buffer.isBuffer(input)) {\n if (!input || !(input instanceof Uint8Array)) {\n return Buffer.alloc(0);\n }\n _extralocal = _centralHeader.loadLocalHeaderFromBinary(input);\n return input.slice(_centralHeader.realDataOffset, _centralHeader.realDataOffset + _centralHeader.compressedSize);\n }\n\n function crc32OK(data) {\n // When bit 3 (0x08) of the general-purpose flags is set, the crc-32 and\n // sizes were unknown when the local file header was written, so that\n // header carries placeholder zeros and the real values are repeated in a\n // data descriptor after the compressed data. adm-zip always parses the\n // central directory, whose header holds the authoritative crc-32 and\n // sizes, so we validate the payload against that value.\n //\n // Earlier versions instead located and parsed the trailing descriptor and\n // threw when it was absent or in an unexpected shape. Many valid archives\n // set the descriptor flag but write the real crc/sizes into the local and\n // central headers without emitting a descriptor (or write one we did not\n // recognise), so that strict handling rejected readable zips\n // (issues #533, #548, #554). Trusting the central-directory crc keeps the\n // integrity check while accepting those archives.\n const expectedCrc = _centralHeader.flags_desc || _centralHeader.localHeader.flags_desc ? _centralHeader.crc : _centralHeader.localHeader.crc;\n\n return Utils.crc32(data) === expectedCrc;\n }\n\n function decompress(/*Boolean*/ async, /*Function*/ callback, /*String, Buffer*/ pass) {\n if (typeof callback === \"undefined\" && typeof async === \"string\") {\n pass = async;\n async = void 0;\n }\n if (_isDirectory) {\n if (async && callback) {\n callback(Buffer.alloc(0), Utils.Errors.DIRECTORY_CONTENT_ERROR()); //si added error.\n }\n return Buffer.alloc(0);\n }\n\n var compressedData = getCompressedDataFromZip();\n\n if (compressedData.length === 0) {\n // File is empty, nothing to decompress.\n if (async && callback) callback(compressedData);\n return compressedData;\n }\n\n if (_centralHeader.encrypted) {\n if (\"string\" !== typeof pass && !Buffer.isBuffer(pass)) {\n throw Utils.Errors.INVALID_PASS_PARAM();\n }\n compressedData = Methods.ZipCrypto.decrypt(compressedData, _centralHeader, pass);\n }\n\n var data;\n\n switch (_centralHeader.method) {\n case Utils.Constants.STORED:\n // STORED entries are not compressed, so the uncompressed output is\n // exactly the bytes present in the archive. Allocate from the real\n // data length rather than the attacker-declared central-directory\n // size, otherwise a tiny archive can declare a huge size and force a\n // multi-gigabyte allocation before any validation (CVE-2026-39244).\n data = Buffer.alloc(compressedData.length);\n compressedData.copy(data);\n if (!crc32OK(data)) {\n if (async && callback) callback(data, Utils.Errors.BAD_CRC()); //si added error\n throw Utils.Errors.BAD_CRC();\n } else {\n //si added otherwise did not seem to return data.\n if (async && callback) callback(data);\n return data;\n }\n case Utils.Constants.DEFLATED:\n // Do not pre-allocate the declared uncompressed size. The inflater\n // grows its output buffer as zlib emits data and caps the total at\n // the declared size (maxOutputLength), so a bogus size can no longer\n // trigger an eager allocation before the data is read (CVE-2026-39244).\n var inflater = new Methods.Inflater(compressedData, _centralHeader.size);\n if (!async) {\n data = inflater.inflate();\n if (!crc32OK(data)) {\n throw Utils.Errors.BAD_CRC(`\"${decoder.decode(_entryName)}\"`);\n }\n return data;\n } else {\n inflater.inflateAsync(function (result) {\n if (callback) {\n if (!crc32OK(result)) {\n callback(result, Utils.Errors.BAD_CRC()); //si added error\n } else {\n callback(result);\n }\n }\n });\n }\n break;\n default:\n if (async && callback) callback(Buffer.alloc(0), Utils.Errors.UNKNOWN_METHOD());\n throw Utils.Errors.UNKNOWN_METHOD();\n }\n }\n\n function compress(/*Boolean*/ async, /*Function*/ callback) {\n if ((!uncompressedData || !uncompressedData.length) && Buffer.isBuffer(input)) {\n // no data set or the data wasn't changed to require recompression\n if (async && callback) callback(getCompressedDataFromZip());\n return getCompressedDataFromZip();\n }\n\n if (uncompressedData.length && !_isDirectory) {\n var compressedData;\n // Local file header\n switch (_centralHeader.method) {\n case Utils.Constants.STORED:\n _centralHeader.compressedSize = _centralHeader.size;\n\n compressedData = Buffer.alloc(uncompressedData.length);\n uncompressedData.copy(compressedData);\n\n if (async && callback) callback(compressedData);\n return compressedData;\n default:\n case Utils.Constants.DEFLATED:\n var deflater = new Methods.Deflater(uncompressedData);\n if (!async) {\n var deflated = deflater.deflate();\n _centralHeader.compressedSize = deflated.length;\n return deflated;\n } else {\n deflater.deflateAsync(function (data) {\n compressedData = Buffer.alloc(data.length);\n _centralHeader.compressedSize = data.length;\n data.copy(compressedData);\n callback && callback(compressedData);\n });\n }\n deflater = null;\n break;\n }\n } else if (async && callback) {\n callback(Buffer.alloc(0));\n } else {\n return Buffer.alloc(0);\n }\n }\n\n function readUInt64LE(buffer, offset) {\n return Utils.readBigUInt64LE(buffer, offset);\n }\n\n function parseExtra(data) {\n try {\n var offset = 0;\n var signature, size, part;\n while (offset + 4 < data.length) {\n signature = data.readUInt16LE(offset);\n offset += 2;\n size = data.readUInt16LE(offset);\n offset += 2;\n part = data.slice(offset, offset + size);\n offset += size;\n if (Constants.ID_ZIP64 === signature) {\n parseZip64ExtendedInformation(part);\n }\n }\n } catch (error) {\n throw Utils.Errors.EXTRA_FIELD_PARSE_ERROR();\n }\n }\n\n //Override header field values with values from the ZIP64 extra field\n function parseZip64ExtendedInformation(data) {\n var size, compressedSize, offset, diskNumStart;\n\n if (data.length >= Constants.EF_ZIP64_SCOMP) {\n size = readUInt64LE(data, Constants.EF_ZIP64_SUNCOMP);\n if (_centralHeader.size === Constants.EF_ZIP64_OR_32) {\n _centralHeader.size = size;\n }\n }\n if (data.length >= Constants.EF_ZIP64_RHO) {\n compressedSize = readUInt64LE(data, Constants.EF_ZIP64_SCOMP);\n if (_centralHeader.compressedSize === Constants.EF_ZIP64_OR_32) {\n _centralHeader.compressedSize = compressedSize;\n }\n }\n if (data.length >= Constants.EF_ZIP64_DSN) {\n offset = readUInt64LE(data, Constants.EF_ZIP64_RHO);\n if (_centralHeader.offset === Constants.EF_ZIP64_OR_32) {\n _centralHeader.offset = offset;\n }\n }\n if (data.length >= Constants.EF_ZIP64_DSN + 4) {\n diskNumStart = data.readUInt32LE(Constants.EF_ZIP64_DSN);\n if (_centralHeader.diskNumStart === Constants.EF_ZIP64_OR_16) {\n _centralHeader.diskNumStart = diskNumStart;\n }\n }\n }\n\n return {\n get entryName() {\n return decoder.decode(_entryName);\n },\n get rawEntryName() {\n return _entryName;\n },\n set entryName(val) {\n _entryName = Utils.toBuffer(val, decoder.encode);\n var lastChar = _entryName[_entryName.length - 1];\n _isDirectory = lastChar === 47 || lastChar === 92;\n _centralHeader.fileNameLength = _entryName.length;\n },\n\n get efs() {\n if (typeof _efs === \"function\") {\n return _efs(this.entryName);\n } else {\n return _efs;\n }\n },\n\n get extra() {\n return _extra;\n },\n set extra(val) {\n _extra = val;\n _centralHeader.extraLength = val.length;\n parseExtra(val);\n },\n\n get comment() {\n return decoder.decode(_comment);\n },\n set comment(val) {\n _comment = Utils.toBuffer(val, decoder.encode);\n _centralHeader.commentLength = _comment.length;\n if (_comment.length > 0xffff) throw Utils.Errors.COMMENT_TOO_LONG();\n },\n\n get name() {\n const n = decoder.decode(_entryName);\n // For directories the name is the last path segment; drop the trailing\n // separator first so \"a/b/c/\" yields \"c\" and not \"\" (issue #466).\n return _isDirectory\n ? n\n .replace(/[/\\\\]$/, \"\")\n .split(\"/\")\n .pop()\n : n.split(\"/\").pop();\n },\n get isDirectory() {\n return _isDirectory;\n },\n\n getCompressedData: function () {\n return compress(false, null);\n },\n\n getCompressedDataAsync: function (/*Function*/ callback) {\n compress(true, callback);\n },\n\n setData: function (value) {\n uncompressedData = Utils.toBuffer(value, Utils.decoder.encode);\n if (!_isDirectory && uncompressedData.length) {\n _centralHeader.size = uncompressedData.length;\n _centralHeader.method = Utils.Constants.DEFLATED;\n _centralHeader.crc = Utils.crc32(value);\n _centralHeader.changed = true;\n } else {\n // folders and blank files should be stored\n _centralHeader.method = Utils.Constants.STORED;\n }\n },\n\n getData: function (pass) {\n if (_centralHeader.changed) {\n return uncompressedData;\n } else {\n return decompress(false, null, pass);\n }\n },\n\n getDataAsync: function (/*Function*/ callback, pass) {\n if (_centralHeader.changed) {\n callback(uncompressedData);\n } else {\n decompress(true, callback, pass);\n }\n },\n\n set attr(attr) {\n _centralHeader.attr = attr;\n },\n get attr() {\n return _centralHeader.attr;\n },\n\n set header(/*Buffer*/ data) {\n _centralHeader.loadFromBinary(data);\n },\n\n get header() {\n return _centralHeader;\n },\n\n packCentralHeader: function () {\n _centralHeader.flags_efs = this.efs;\n _centralHeader.extraLength = _extra.length;\n // 1. create header (buffer)\n var header = _centralHeader.centralHeaderToBinary();\n var addpos = Utils.Constants.CENHDR;\n // 2. add file name\n _entryName.copy(header, addpos);\n addpos += _entryName.length;\n // 3. add extra data\n _extra.copy(header, addpos);\n addpos += _centralHeader.extraLength;\n // 4. add file comment\n _comment.copy(header, addpos);\n return header;\n },\n\n packLocalHeader: function () {\n let addpos = 0;\n _centralHeader.flags_efs = this.efs;\n _centralHeader.extraLocalLength = _extralocal.length;\n // 1. construct local header Buffer\n const localHeaderBuf = _centralHeader.localHeaderToBinary();\n // 2. localHeader - crate header buffer\n const localHeader = Buffer.alloc(localHeaderBuf.length + _entryName.length + _centralHeader.extraLocalLength);\n // 2.1 add localheader\n localHeaderBuf.copy(localHeader, addpos);\n addpos += localHeaderBuf.length;\n // 2.2 add file name\n _entryName.copy(localHeader, addpos);\n addpos += _entryName.length;\n // 2.3 add extra field\n _extralocal.copy(localHeader, addpos);\n addpos += _extralocal.length;\n\n return localHeader;\n },\n\n toJSON: function () {\n const bytes = function (nr) {\n return \"<\" + ((nr && nr.length + \" bytes buffer\") || \"null\") + \">\";\n };\n\n return {\n entryName: this.entryName,\n name: this.name,\n comment: this.comment,\n isDirectory: this.isDirectory,\n header: _centralHeader.toJSON(),\n compressedData: bytes(input),\n data: bytes(uncompressedData)\n };\n },\n\n toString: function () {\n return JSON.stringify(this.toJSON(), null, \"\\t\");\n }\n };\n};\n","const ZipEntry = require(\"./zipEntry\");\nconst Headers = require(\"./headers\");\nconst Utils = require(\"./util\");\n\nmodule.exports = function (/*Buffer|null*/ inBuffer, /** object */ options) {\n var entryList = [],\n // prototype-less: entry names come from untrusted input, so keys like\n // \"__proto__\" or \"constructor\" must be plain data, not touch the prototype\n // chain (which otherwise crashes addFile and hides such entries)\n entryTable = Object.create(null),\n _comment = Buffer.alloc(0),\n mainHeader = new Headers.MainHeader(),\n loadedEntries = false;\n var password = null;\n const temporary = new Set();\n\n // assign options\n const opts = options;\n\n const { noSort, decoder } = opts;\n\n if (inBuffer) {\n // is a memory buffer\n readMainHeader(opts.readEntries);\n } else {\n // none. is a new file\n loadedEntries = true;\n }\n\n function makeTemporaryFolders() {\n const foldersList = new Set();\n\n // Make list of all folders in file\n for (const elem of Object.keys(entryTable)) {\n const elements = elem.split(\"/\");\n elements.pop(); // filename\n if (!elements.length) continue; // no folders\n for (let i = 0; i < elements.length; i++) {\n const sub = elements.slice(0, i + 1).join(\"/\") + \"/\";\n foldersList.add(sub);\n }\n }\n\n // create missing folders as temporary\n for (const elem of foldersList) {\n if (!(elem in entryTable)) {\n const tempfolder = new ZipEntry(opts);\n tempfolder.entryName = elem;\n tempfolder.attr = 0x10;\n tempfolder.temporary = true;\n entryList.push(tempfolder);\n entryTable[tempfolder.entryName] = tempfolder;\n temporary.add(tempfolder);\n }\n }\n }\n\n function readEntries() {\n loadedEntries = true;\n entryTable = Object.create(null);\n if (mainHeader.diskEntries > (inBuffer.length - mainHeader.offset) / Utils.Constants.CENHDR) {\n throw Utils.Errors.DISK_ENTRY_TOO_LARGE();\n }\n entryList = new Array(mainHeader.diskEntries); // total number of entries\n var index = mainHeader.offset; // offset of first CEN header\n for (var i = 0; i < entryList.length; i++) {\n var tmp = index,\n entry = new ZipEntry(opts, inBuffer);\n entry.header = inBuffer.slice(tmp, (tmp += Utils.Constants.CENHDR));\n\n entry.entryName = inBuffer.slice(tmp, (tmp += entry.header.fileNameLength));\n\n if (entry.header.extraLength) {\n entry.extra = inBuffer.slice(tmp, (tmp += entry.header.extraLength));\n }\n\n if (entry.header.commentLength) entry.comment = inBuffer.slice(tmp, tmp + entry.header.commentLength);\n\n index += entry.header.centralHeaderSize;\n\n entryList[i] = entry;\n entryTable[entry.entryName] = entry;\n }\n temporary.clear();\n makeTemporaryFolders();\n }\n\n function readMainHeader(/*Boolean*/ readNow) {\n var i = inBuffer.length - Utils.Constants.ENDHDR, // END header size\n max = Math.max(0, i - 0xffff), // 0xFFFF is the max zip file comment length\n n = max,\n endStart = inBuffer.length,\n endOffset = -1, // Start offset of the END header\n commentEnd = 0;\n\n // option to search header form entire file\n const trailingSpace = typeof opts.trailingSpace === \"boolean\" ? opts.trailingSpace : false;\n if (trailingSpace) max = 0;\n\n for (i; i >= n; i--) {\n if (inBuffer[i] !== 0x50) continue; // quick check that the byte is 'P'\n if (inBuffer.readUInt32LE(i) === Utils.Constants.ENDSIG) {\n // \"PK\\005\\006\"\n endOffset = i;\n commentEnd = i;\n endStart = i + Utils.Constants.ENDHDR;\n // We already found a regular signature, let's look just a bit further to check if there's any zip64 signature\n n = i - Utils.Constants.END64HDR;\n continue;\n }\n\n if (inBuffer.readUInt32LE(i) === Utils.Constants.END64SIG) {\n // Found a zip64 signature, let's continue reading the whole zip64 record\n n = max;\n continue;\n }\n\n if (inBuffer.readUInt32LE(i) === Utils.Constants.ZIP64SIG) {\n // Found the zip64 record, let's determine it's size\n endOffset = i;\n endStart = i + Utils.readBigUInt64LE(inBuffer, i + Utils.Constants.ZIP64SIZE) + Utils.Constants.ZIP64LEAD;\n break;\n }\n }\n\n if (endOffset == -1) throw Utils.Errors.INVALID_FORMAT();\n\n mainHeader.loadFromBinary(inBuffer.slice(endOffset, endStart));\n if (mainHeader.commentLength) {\n _comment = inBuffer.slice(commentEnd + Utils.Constants.ENDHDR);\n }\n if (readNow) readEntries();\n }\n\n function sortEntries() {\n if (entryList.length > 1 && !noSort) {\n // Decode + lowercase each name once rather than on every comparison:\n // the entryName getter re-decodes the underlying buffer on each access,\n // so the previous inline comparator did O(n log n) redundant decoding.\n // Ordering is unchanged (same localeCompare on the same keys).\n entryList = entryList\n .map((entry) => ({ entry, key: entry.entryName.toLowerCase() }))\n .sort((a, b) => a.key.localeCompare(b.key))\n .map((pair) => pair.entry);\n }\n }\n\n return {\n /**\n * Returns an array of ZipEntry objects existent in the current opened archive\n * @return Array\n */\n get entries() {\n if (!loadedEntries) {\n readEntries();\n }\n return entryList.filter((e) => !temporary.has(e));\n },\n\n /**\n * Archive comment\n * @return {String}\n */\n get comment() {\n return decoder.decode(_comment);\n },\n set comment(val) {\n _comment = Utils.toBuffer(val, decoder.encode);\n mainHeader.commentLength = _comment.length;\n },\n\n getEntryCount: function () {\n if (!loadedEntries) {\n return mainHeader.diskEntries;\n }\n\n return entryList.length;\n },\n\n forEach: function (callback) {\n this.entries.forEach(callback);\n },\n\n /**\n * Returns a reference to the entry with the given name or null if entry is inexistent\n *\n * @param entryName\n * @return ZipEntry\n */\n getEntry: function (/*String*/ entryName) {\n if (!loadedEntries) {\n readEntries();\n }\n return entryTable[entryName] || null;\n },\n\n /**\n * Adds the given entry to the entry list\n *\n * @param entry\n */\n setEntry: function (/*ZipEntry*/ entry) {\n if (!loadedEntries) {\n readEntries();\n }\n entryList.push(entry);\n entryTable[entry.entryName] = entry;\n mainHeader.totalEntries = entryList.length;\n },\n\n /**\n * Removes the file with the given name from the entry list.\n *\n * If the entry is a directory, then all nested files and directories will be removed\n * @param entryName\n * @returns {void}\n */\n deleteFile: function (/*String*/ entryName, withsubfolders = true) {\n if (!loadedEntries) {\n readEntries();\n }\n const entry = entryTable[entryName];\n const list = this.getEntryChildren(entry, withsubfolders).map((child) => child.entryName);\n\n list.forEach(this.deleteEntry);\n },\n\n /**\n * Removes the entry with the given name from the entry list.\n *\n * @param {string} entryName\n * @returns {void}\n */\n deleteEntry: function (/*String*/ entryName) {\n if (!loadedEntries) {\n readEntries();\n }\n const entry = entryTable[entryName];\n const index = entryList.indexOf(entry);\n if (index >= 0) {\n entryList.splice(index, 1);\n delete entryTable[entryName];\n mainHeader.totalEntries = entryList.length;\n }\n },\n\n /**\n * Iterates and returns all nested files and directories of the given entry\n *\n * @param entry\n * @return Array\n */\n getEntryChildren: function (/*ZipEntry*/ entry, subfolders = true) {\n if (!loadedEntries) {\n readEntries();\n }\n if (typeof entry === \"object\") {\n if (entry.isDirectory && subfolders) {\n const list = [];\n const name = entry.entryName;\n\n for (const zipEntry of entryList) {\n if (zipEntry.entryName.startsWith(name)) {\n list.push(zipEntry);\n }\n }\n return list;\n } else {\n return [entry];\n }\n }\n return [];\n },\n\n /**\n * How many child elements entry has\n *\n * @param {ZipEntry} entry\n * @return {integer}\n */\n getChildCount: function (entry) {\n if (entry && entry.isDirectory) {\n const list = this.getEntryChildren(entry);\n return list.includes(entry) ? list.length - 1 : list.length;\n }\n return 0;\n },\n\n /**\n * Returns the zip file\n *\n * @return Buffer\n */\n compressToBuffer: function () {\n if (!loadedEntries) {\n readEntries();\n }\n sortEntries();\n\n const dataBlock = [];\n const headerBlocks = [];\n let totalSize = 0;\n let dindex = 0;\n\n mainHeader.size = 0;\n mainHeader.offset = 0;\n let totalEntries = 0;\n\n for (const entry of this.entries) {\n // compress data and set local and entry header accordingly. Reason why is called first\n const compressedData = entry.getCompressedData();\n entry.header.offset = dindex;\n\n // 1. construct local header\n const localHeader = entry.packLocalHeader();\n\n // 2. offsets\n const dataLength = localHeader.length + compressedData.length;\n dindex += dataLength;\n\n // 3. store values in sequence\n dataBlock.push(localHeader);\n dataBlock.push(compressedData);\n\n // 4. construct central header\n const centralHeader = entry.packCentralHeader();\n headerBlocks.push(centralHeader);\n // 5. update main header\n mainHeader.size += centralHeader.length;\n totalSize += dataLength + centralHeader.length;\n totalEntries++;\n }\n\n totalSize += mainHeader.mainHeaderSize; // also includes zip file comment length\n // point to end of data and beginning of central directory first record\n mainHeader.offset = dindex;\n mainHeader.totalEntries = totalEntries;\n\n dindex = 0;\n const outBuffer = Buffer.alloc(totalSize);\n // write data blocks\n for (const content of dataBlock) {\n content.copy(outBuffer, dindex);\n dindex += content.length;\n }\n\n // write central directory entries\n for (const content of headerBlocks) {\n content.copy(outBuffer, dindex);\n dindex += content.length;\n }\n\n // write main header\n const mh = mainHeader.toBinary();\n if (_comment) {\n _comment.copy(mh, mh.length - _comment.length); // add zip file comment\n }\n mh.copy(outBuffer, dindex);\n\n // Since we update entry and main header offsets,\n // they are no longer valid and we have to reset content\n // (Issue 64)\n\n inBuffer = outBuffer;\n loadedEntries = false;\n\n return outBuffer;\n },\n\n toAsyncBuffer: function (/*Function*/ onSuccess, /*Function*/ onFail, /*Function*/ onItemStart, /*Function*/ onItemEnd) {\n try {\n if (!loadedEntries) {\n readEntries();\n }\n sortEntries();\n\n const dataBlock = [];\n const centralHeaders = [];\n let totalSize = 0;\n let dindex = 0;\n let totalEntries = 0;\n\n mainHeader.size = 0;\n mainHeader.offset = 0;\n\n const compress2Buffer = function (entryLists) {\n if (entryLists.length > 0) {\n const entry = entryLists.shift();\n const name = entry.entryName + entry.extra.toString();\n if (onItemStart) onItemStart(name);\n entry.getCompressedDataAsync(function (compressedData) {\n if (onItemEnd) onItemEnd(name);\n entry.header.offset = dindex;\n\n // 1. construct local header\n const localHeader = entry.packLocalHeader();\n\n // 2. offsets\n const dataLength = localHeader.length + compressedData.length;\n dindex += dataLength;\n\n // 3. store values in sequence\n dataBlock.push(localHeader);\n dataBlock.push(compressedData);\n\n // central header\n const centalHeader = entry.packCentralHeader();\n centralHeaders.push(centalHeader);\n mainHeader.size += centalHeader.length;\n totalSize += dataLength + centalHeader.length;\n totalEntries++;\n\n compress2Buffer(entryLists);\n });\n } else {\n totalSize += mainHeader.mainHeaderSize; // also includes zip file comment length\n // point to end of data and beginning of central directory first record\n mainHeader.offset = dindex;\n mainHeader.totalEntries = totalEntries;\n\n dindex = 0;\n const outBuffer = Buffer.alloc(totalSize);\n dataBlock.forEach(function (content) {\n content.copy(outBuffer, dindex); // write data blocks\n dindex += content.length;\n });\n centralHeaders.forEach(function (content) {\n content.copy(outBuffer, dindex); // write central directory entries\n dindex += content.length;\n });\n\n const mh = mainHeader.toBinary();\n if (_comment) {\n _comment.copy(mh, mh.length - _comment.length); // add zip file comment\n }\n\n mh.copy(outBuffer, dindex); // write main header\n\n // Since we update entry and main header offsets, they are no\n // longer valid and we have to reset content using our new buffer\n // (Issue 64)\n\n inBuffer = outBuffer;\n loadedEntries = false;\n\n onSuccess(outBuffer);\n }\n };\n\n compress2Buffer(Array.from(this.entries));\n } catch (e) {\n onFail(e);\n }\n }\n };\n};\n","const Utils = require(\"./util\");\nconst pth = require(\"path\");\nconst ZipEntry = require(\"./zipEntry\");\nconst ZipFile = require(\"./zipFile\");\n\nconst get_Bool = (...val) => Utils.findLast(val, (c) => typeof c === \"boolean\");\nconst get_Str = (...val) => Utils.findLast(val, (c) => typeof c === \"string\");\nconst get_Fun = (...val) => Utils.findLast(val, (c) => typeof c === \"function\");\n\nconst defaultOptions = {\n // option \"noSort\" : if true it disables files sorting\n noSort: false,\n // read entries during load (initial loading may be slower)\n readEntries: false,\n // default method is none\n method: Utils.Constants.NONE,\n // file system\n fs: null\n};\n\nmodule.exports = function (/**String*/ input, /** object */ options) {\n let inBuffer = null;\n\n // create object based default options, allowing them to be overwritten\n const opts = Object.assign(Object.create(null), defaultOptions);\n\n // test input variable\n if (input && \"object\" === typeof input) {\n // if value is not buffer we accept it to be object with options\n if (!(input instanceof Uint8Array)) {\n Object.assign(opts, input);\n input = opts.input ? opts.input : undefined;\n if (opts.input) delete opts.input;\n }\n\n // if input is buffer\n if (Buffer.isBuffer(input)) {\n inBuffer = input;\n opts.method = Utils.Constants.BUFFER;\n input = undefined;\n }\n }\n\n // assign options\n Object.assign(opts, options);\n\n // instanciate utils filesystem\n const filetools = new Utils(opts);\n\n // Restore the archived permissions on extracted directories. This has to run\n // after a directory's contents are written: applying a restrictive mode\n // (e.g. 0o500) up front would stop us writing the files it contains. Applying\n // the deepest paths first keeps parent directories traversable while their\n // children are updated (issue #530).\n const applyDirAttributes = (dirEntries) => {\n dirEntries\n .filter((d) => d.attr)\n .sort((a, b) => b.path.length - a.path.length)\n .forEach((d) => filetools.fs.chmodSync(d.path, d.attr));\n };\n\n if (typeof opts.decoder !== \"object\" || typeof opts.decoder.encode !== \"function\" || typeof opts.decoder.decode !== \"function\") {\n opts.decoder = Utils.decoder;\n }\n\n // if input is file name we retrieve its content\n if (input && \"string\" === typeof input) {\n // load zip file\n if (filetools.fs.existsSync(input)) {\n opts.method = Utils.Constants.FILE;\n opts.filename = input;\n inBuffer = filetools.fs.readFileSync(input);\n } else {\n throw Utils.Errors.INVALID_FILENAME();\n }\n }\n\n // create variable\n const _zip = new ZipFile(inBuffer, opts);\n\n const { canonical, sanitize, zipnamefix } = Utils;\n\n function getEntry(/**Object*/ entry) {\n if (entry && _zip) {\n var item;\n // If entry was given as a file name\n if (typeof entry === \"string\") item = _zip.getEntry(pth.posix.normalize(entry));\n // if entry was given as a ZipEntry object\n if (typeof entry === \"object\" && typeof entry.entryName !== \"undefined\" && typeof entry.header !== \"undefined\") item = _zip.getEntry(entry.entryName);\n\n if (item) {\n return item;\n }\n }\n return null;\n }\n\n function fixPath(zipPath) {\n const { join, normalize, sep } = pth.posix;\n // convert windows file separators and normalize\n return join(pth.isAbsolute(zipPath) ? \"/\": '.', normalize(sep + zipPath.split(\"\\\\\").join(sep) + sep));\n }\n\n function filenameFilter(filterfn) {\n if (filterfn instanceof RegExp) {\n // if filter is RegExp wrap it\n return (function (rx) {\n return function (filename) {\n return rx.test(filename);\n };\n })(filterfn);\n } else if (\"function\" !== typeof filterfn) {\n // if filter is not function we will replace it\n return () => true;\n }\n return filterfn;\n }\n\n // keep last character on folders\n const relativePath = (local, entry) => {\n let lastChar = entry.slice(-1);\n lastChar = lastChar === filetools.sep ? filetools.sep : \"\";\n return pth.relative(local, entry) + lastChar;\n };\n\n return {\n /**\n * Extracts the given entry from the archive and returns the content as a Buffer object\n * @param {ZipEntry|string} entry ZipEntry object or String with the full path of the entry\n * @param {Buffer|string} [pass] - password\n * @return Buffer or Null in case of error\n */\n readFile: function (entry, pass) {\n var item = getEntry(entry);\n return (item && item.getData(pass)) || null;\n },\n\n /**\n * Returns how many child elements has on entry (directories) on files it is always 0\n * @param {ZipEntry|string} entry ZipEntry object or String with the full path of the entry\n * @returns {integer}\n */\n childCount: function (entry) {\n const item = getEntry(entry);\n if (item) {\n return _zip.getChildCount(item);\n }\n },\n\n /**\n * Asynchronous readFile\n * @param {ZipEntry|string} entry ZipEntry object or String with the full path of the entry\n * @param {callback} callback\n *\n * @return Buffer or Null in case of error\n */\n readFileAsync: function (entry, callback) {\n var item = getEntry(entry);\n if (item) {\n item.getDataAsync(callback);\n } else {\n callback(null, \"getEntry failed for:\" + entry);\n }\n },\n\n /**\n * Extracts the given entry from the archive and returns the content as plain text in the given encoding\n * @param {ZipEntry|string} entry - ZipEntry object or String with the full path of the entry\n * @param {string} encoding - Optional. If no encoding is specified utf8 is used\n *\n * @return String\n */\n readAsText: function (entry, encoding) {\n var item = getEntry(entry);\n if (item) {\n var data = item.getData();\n if (data && data.length) {\n return data.toString(encoding || \"utf8\");\n }\n }\n return \"\";\n },\n\n /**\n * Asynchronous readAsText\n * @param {ZipEntry|string} entry ZipEntry object or String with the full path of the entry\n * @param {callback} callback\n * @param {string} [encoding] - Optional. If no encoding is specified utf8 is used\n *\n * @return String\n */\n readAsTextAsync: function (entry, callback, encoding) {\n var item = getEntry(entry);\n if (item) {\n item.getDataAsync(function (data, err) {\n if (err) {\n callback(data, err);\n return;\n }\n\n if (data && data.length) {\n callback(data.toString(encoding || \"utf8\"));\n } else {\n callback(\"\");\n }\n });\n } else {\n callback(\"\");\n }\n },\n\n /**\n * Remove the entry from the file or the entry and all it's nested directories and files if the given entry is a directory\n *\n * @param {ZipEntry|string} entry\n * @param {boolean} withsubfolders\n * @returns {void}\n */\n deleteFile: function (entry, withsubfolders = true) {\n // @TODO: test deleteFile\n var item = getEntry(entry);\n if (item) {\n _zip.deleteFile(item.entryName, withsubfolders);\n }\n },\n\n /**\n * Remove the entry from the file or directory without affecting any nested entries\n *\n * @param {ZipEntry|string} entry\n * @returns {void}\n */\n deleteEntry: function (entry) {\n // @TODO: test deleteEntry\n var item = getEntry(entry);\n if (item) {\n _zip.deleteEntry(item.entryName);\n }\n },\n\n /**\n * Adds a comment to the zip. The zip must be rewritten after adding the comment.\n *\n * @param {string} comment\n */\n addZipComment: function (comment) {\n // @TODO: test addZipComment\n _zip.comment = comment;\n },\n\n /**\n * Returns the zip comment\n *\n * @return String\n */\n getZipComment: function () {\n return _zip.comment || \"\";\n },\n\n /**\n * Adds a comment to a specified zipEntry. The zip must be rewritten after adding the comment\n * The comment cannot exceed 65535 characters in length\n *\n * @param {ZipEntry} entry\n * @param {string} comment\n */\n addZipEntryComment: function (entry, comment) {\n var item = getEntry(entry);\n if (item) {\n item.comment = comment;\n }\n },\n\n /**\n * Returns the comment of the specified entry\n *\n * @param {ZipEntry} entry\n * @return String\n */\n getZipEntryComment: function (entry) {\n var item = getEntry(entry);\n if (item) {\n return item.comment || \"\";\n }\n return \"\";\n },\n\n /**\n * Updates the content of an existing entry inside the archive. The zip must be rewritten after updating the content\n *\n * @param {ZipEntry} entry\n * @param {Buffer} content\n */\n updateFile: function (entry, content) {\n var item = getEntry(entry);\n if (item) {\n item.setData(content);\n }\n },\n\n /**\n * Adds a file from the disk to the archive\n *\n * @param {string} localPath File to add to zip\n * @param {string} [zipPath] Optional path inside the zip\n * @param {string} [zipName] Optional name for the file\n * @param {string} [comment] Optional file comment\n */\n addLocalFile: function (localPath, zipPath, zipName, comment) {\n if (filetools.fs.existsSync(localPath)) {\n // fix ZipPath\n zipPath = zipPath ? fixPath(zipPath) : \"\";\n\n // p - local file name\n const p = pth.win32.basename(pth.win32.normalize(localPath));\n\n // add file name into zippath\n zipPath += zipName ? zipName : p;\n\n // read file attributes\n const _attr = filetools.fs.statSync(localPath);\n\n // get file content\n const data = _attr.isFile() ? filetools.fs.readFileSync(localPath) : Buffer.alloc(0);\n\n // if folder\n if (_attr.isDirectory()) zipPath += filetools.sep;\n\n // add file into zip file\n this.addFile(zipPath, data, comment, _attr);\n } else {\n throw Utils.Errors.FILE_NOT_FOUND(localPath);\n }\n },\n\n /**\n * Callback for showing if everything was done.\n *\n * @callback doneCallback\n * @param {Error} err - Error object\n * @param {boolean} done - was request fully completed\n */\n\n /**\n * Adds a file from the disk to the archive\n *\n * @param {(object|string)} options - options object, if it is string it us used as localPath.\n * @param {string} options.localPath - Local path to the file.\n * @param {string} [options.comment] - Optional file comment.\n * @param {string} [options.zipPath] - Optional path inside the zip\n * @param {string} [options.zipName] - Optional name for the file\n * @param {doneCallback} callback - The callback that handles the response.\n */\n addLocalFileAsync: function (options, callback) {\n options = typeof options === \"object\" ? options : { localPath: options };\n const localPath = pth.resolve(options.localPath);\n const { comment } = options;\n let { zipPath, zipName } = options;\n const self = this;\n\n filetools.fs.stat(localPath, function (err, stats) {\n if (err) return callback(err, false);\n // fix ZipPath\n zipPath = zipPath ? fixPath(zipPath) : \"\";\n // p - local file name\n const p = pth.win32.basename(pth.win32.normalize(localPath));\n // add file name into zippath\n zipPath += zipName ? zipName : p;\n\n if (stats.isFile()) {\n filetools.fs.readFile(localPath, function (err, data) {\n if (err) return callback(err, false);\n self.addFile(zipPath, data, comment, stats);\n return setImmediate(callback, undefined, true);\n });\n } else if (stats.isDirectory()) {\n zipPath += filetools.sep;\n self.addFile(zipPath, Buffer.alloc(0), comment, stats);\n return setImmediate(callback, undefined, true);\n }\n });\n },\n\n /**\n * Adds a local directory and all its nested files and directories to the archive\n *\n * @param {string} localPath - local path to the folder\n * @param {string} [zipPath] - optional path inside zip\n * @param {(RegExp|function)} [filter] - optional RegExp or Function if files match will be included.\n */\n addLocalFolder: function (localPath, zipPath, filter) {\n // Prepare filter\n filter = filenameFilter(filter);\n\n // fix ZipPath\n zipPath = zipPath ? fixPath(zipPath) : \"\";\n\n // normalize the path first\n localPath = pth.normalize(localPath);\n\n if (filetools.fs.existsSync(localPath)) {\n const items = filetools.findFiles(localPath);\n const self = this;\n\n if (items.length) {\n for (const filepath of items) {\n const p = pth.join(zipPath, relativePath(localPath, filepath));\n if (filter(p)) {\n self.addLocalFile(filepath, pth.dirname(p));\n }\n }\n }\n } else {\n throw Utils.Errors.FILE_NOT_FOUND(localPath);\n }\n },\n\n /**\n * Asynchronous addLocalFolder\n * @param {string} localPath\n * @param {callback} callback\n * @param {string} [zipPath] optional path inside zip\n * @param {RegExp|function} [filter] optional RegExp or Function if files match will\n * be included.\n */\n addLocalFolderAsync: function (localPath, callback, zipPath, filter) {\n // Prepare filter\n filter = filenameFilter(filter);\n\n // fix ZipPath\n zipPath = zipPath ? fixPath(zipPath) : \"\";\n\n // normalize the path first\n localPath = pth.normalize(localPath);\n\n var self = this;\n filetools.fs.open(localPath, \"r\", function (err) {\n if (err && err.code === \"ENOENT\") {\n callback(undefined, Utils.Errors.FILE_NOT_FOUND(localPath));\n } else if (err) {\n callback(undefined, err);\n } else {\n var items = filetools.findFiles(localPath);\n var i = -1;\n\n var next = function () {\n i += 1;\n if (i < items.length) {\n var filepath = items[i];\n var p = relativePath(localPath, filepath).split(\"\\\\\").join(\"/\"); //windows fix\n p = p\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/[^\\x20-\\x7E]/g, \"\"); // accent fix\n if (filter(p)) {\n filetools.fs.stat(filepath, function (er0, stats) {\n if (er0) callback(undefined, er0);\n if (stats.isFile()) {\n filetools.fs.readFile(filepath, function (er1, data) {\n if (er1) {\n callback(undefined, er1);\n } else {\n self.addFile(zipPath + p, data, \"\", stats);\n next();\n }\n });\n } else {\n self.addFile(zipPath + p + \"/\", Buffer.alloc(0), \"\", stats);\n next();\n }\n });\n } else {\n process.nextTick(() => {\n next();\n });\n }\n } else {\n callback(true, undefined);\n }\n };\n\n next();\n }\n });\n },\n\n /**\n * Adds a local directory and all its nested files and directories to the archive\n *\n * @param {object | string} options - options object, if it is string it us used as localPath.\n * @param {string} options.localPath - Local path to the folder.\n * @param {string} [options.zipPath] - optional path inside zip.\n * @param {RegExp|function} [options.filter] - optional RegExp or Function if files match will be included.\n * @param {function|string} [options.namefix] - optional function to help fix filename\n * @param {doneCallback} callback - The callback that handles the response.\n *\n */\n addLocalFolderAsync2: function (options, callback) {\n const self = this;\n options = typeof options === \"object\" ? options : { localPath: options };\n const localPath = pth.resolve(fixPath(options.localPath));\n let { zipPath, filter, namefix } = options;\n\n if (filter instanceof RegExp) {\n filter = (function (rx) {\n return function (filename) {\n return rx.test(filename);\n };\n })(filter);\n } else if (\"function\" !== typeof filter) {\n filter = function () {\n return true;\n };\n }\n\n // fix ZipPath\n zipPath = zipPath ? fixPath(zipPath) : \"\";\n\n // Check Namefix function\n if (namefix === \"latin1\") {\n namefix = (str) =>\n str\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/[^\\x20-\\x7E]/g, \"\"); // accent fix (latin1 characers only)\n }\n\n if (typeof namefix !== \"function\") namefix = (str) => str;\n\n // internal, create relative path + fix the name\n const relPathFix = (entry) => pth.join(zipPath, namefix(relativePath(localPath, entry)));\n const fileNameFix = (entry) => pth.win32.basename(pth.win32.normalize(namefix(entry)));\n\n filetools.fs.open(localPath, \"r\", function (err) {\n if (err && err.code === \"ENOENT\") {\n callback(undefined, Utils.Errors.FILE_NOT_FOUND(localPath));\n } else if (err) {\n callback(undefined, err);\n } else {\n filetools.findFilesAsync(localPath, function (err, fileEntries) {\n if (err) return callback(err);\n fileEntries = fileEntries.filter((dir) => filter(relPathFix(dir)));\n if (!fileEntries.length) callback(undefined, false);\n\n setImmediate(\n fileEntries.reverse().reduce(function (next, entry) {\n return function (err, done) {\n if (err || done === false) return setImmediate(next, err, false);\n\n self.addLocalFileAsync(\n {\n localPath: entry,\n zipPath: pth.dirname(relPathFix(entry)),\n zipName: fileNameFix(entry)\n },\n next\n );\n };\n }, callback)\n );\n });\n }\n });\n },\n\n /**\n * Adds a local directory and all its nested files and directories to the archive\n *\n * @param {string} localPath - path where files will be extracted\n * @param {object} props - optional properties\n * @param {string} [props.zipPath] - optional path inside zip\n * @param {RegExp|function} [props.filter] - optional RegExp or Function if files match will be included.\n * @param {function|string} [props.namefix] - optional function to help fix filename\n */\n addLocalFolderPromise: function (localPath, props) {\n return new Promise((resolve, reject) => {\n this.addLocalFolderAsync2(Object.assign({ localPath }, props), (err, done) => {\n if (err) reject(err);\n if (done) resolve(this);\n });\n });\n },\n\n /**\n * Allows you to create a entry (file or directory) in the zip file.\n * If you want to create a directory the entryName must end in / and a null buffer should be provided.\n * Comment and attributes are optional\n *\n * @param {string} entryName\n * @param {Buffer | string} content - file content as buffer or utf8 coded string\n * @param {string} [comment] - file comment\n * @param {number | object} [attr] - number as unix file permissions, object as filesystem Stats object\n */\n addFile: function (entryName, content, comment, attr) {\n entryName = zipnamefix(entryName);\n let entry = getEntry(entryName);\n const update = entry != null;\n\n // prepare new entry\n if (!update) {\n entry = new ZipEntry(opts);\n entry.entryName = entryName;\n }\n entry.comment = comment || \"\";\n\n const isStat = \"object\" === typeof attr && attr instanceof filetools.fs.Stats;\n\n // last modification time from file stats\n if (isStat) {\n entry.header.time = attr.mtime;\n }\n\n // Set file attribute\n var fileattr = entry.isDirectory ? 0x10 : 0; // (MS-DOS directory flag)\n\n // extended attributes field for Unix\n // set file type either S_IFDIR / S_IFREG\n let unix = entry.isDirectory ? 0x4000 : 0x8000;\n\n if (isStat) {\n // File attributes from file stats\n unix |= 0xfff & attr.mode;\n } else if (\"number\" === typeof attr) {\n // attr from given attr values\n unix |= 0xfff & attr;\n } else {\n // Default values:\n unix |= entry.isDirectory ? 0o755 : 0o644; // permissions (drwxr-xr-x) or (-r-wr--r--)\n }\n\n fileattr = (fileattr | (unix << 16)) >>> 0; // add attributes\n\n entry.attr = fileattr;\n\n entry.setData(content);\n if (!update) _zip.setEntry(entry);\n\n return entry;\n },\n\n /**\n * Returns an array of ZipEntry objects representing the files and folders inside the archive\n *\n * @param {string} [password]\n * @returns Array\n */\n getEntries: function (password) {\n _zip.password = password;\n return _zip ? _zip.entries : [];\n },\n\n /**\n * Returns a ZipEntry object representing the file or folder specified by ``name``.\n *\n * @param {string} name\n * @return ZipEntry\n */\n getEntry: function (/**String*/ name) {\n return getEntry(name);\n },\n\n getEntryCount: function () {\n return _zip.getEntryCount();\n },\n\n forEach: function (callback) {\n return _zip.forEach(callback);\n },\n\n /**\n * Extracts the given entry to the given targetPath\n * If the entry is a directory inside the archive, the entire directory and it's subdirectories will be extracted\n *\n * @param {string|ZipEntry} entry - ZipEntry object or String with the full path of the entry\n * @param {string} targetPath - Target folder where to write the file\n * @param {boolean} [maintainEntryPath=true] - If maintainEntryPath is true and the entry is inside a folder, the entry folder will be created in targetPath as well. Default is TRUE\n * @param {boolean} [overwrite=false] - If the file already exists at the target path, the file will be overwriten if this is true.\n * @param {boolean} [keepOriginalPermission=false] - The file will be set as the permission from the entry if this is true.\n * @param {string} [outFileName] - String If set will override the filename of the extracted file (Only works if the entry is a file)\n *\n * @return Boolean\n */\n extractEntryTo: function (entry, targetPath, maintainEntryPath, overwrite, keepOriginalPermission, outFileName) {\n overwrite = get_Bool(false, overwrite);\n keepOriginalPermission = get_Bool(false, keepOriginalPermission);\n maintainEntryPath = get_Bool(true, maintainEntryPath);\n outFileName = get_Str(keepOriginalPermission, outFileName);\n\n var item = getEntry(entry);\n if (!item) {\n throw Utils.Errors.NO_ENTRY();\n }\n\n var entryName = canonical(item.entryName);\n\n var target = sanitize(targetPath, outFileName && !item.isDirectory ? canonical(outFileName) : maintainEntryPath ? entryName : pth.basename(entryName));\n\n if (item.isDirectory) {\n var children = _zip.getEntryChildren(item);\n children.forEach(function (child) {\n if (child.isDirectory) return;\n var content = child.getData();\n if (!content) {\n throw Utils.Errors.CANT_EXTRACT_FILE();\n }\n // When not maintaining the full entry path, keep each child's path\n // relative to the extracted directory (drop the directory's own\n // prefix) instead of flattening every file to its basename, which\n // collapsed subdirectories together (issue #306).\n var name = canonical(maintainEntryPath ? child.entryName : child.entryName.substring(item.entryName.length));\n var childName = sanitize(targetPath, name);\n // The reverse operation for attr depend on method addFile()\n const fileAttr = keepOriginalPermission ? child.header.fileAttr : undefined;\n filetools.writeFileTo(childName, content, overwrite, fileAttr);\n });\n return true;\n }\n\n var content = item.getData(_zip.password);\n if (!content) throw Utils.Errors.CANT_EXTRACT_FILE();\n\n if (filetools.fs.existsSync(target) && !overwrite) {\n throw Utils.Errors.CANT_OVERRIDE();\n }\n // The reverse operation for attr depend on method addFile()\n const fileAttr = keepOriginalPermission ? entry.header.fileAttr : undefined;\n filetools.writeFileTo(target, content, overwrite, fileAttr);\n\n return true;\n },\n\n /**\n * Test the archive\n * @param {string} [pass]\n */\n test: function (pass) {\n if (!_zip) {\n return false;\n }\n\n for (var entry of _zip.entries) {\n try {\n if (entry.isDirectory) {\n continue;\n }\n // was `_zip.entries[entry]` (indexing the array with an entry\n // object -> undefined -> threw -> test() always returned false)\n var content = entry.getData(pass);\n if (!content) {\n return false;\n }\n } catch (err) {\n return false;\n }\n }\n return true;\n },\n\n /**\n * Extracts the entire archive to the given location\n *\n * @param {string} targetPath Target location\n * @param {boolean} [overwrite=false] If the file already exists at the target path, the file will be overwriten if this is true.\n * Default is FALSE\n * @param {boolean} [keepOriginalPermission=false] The file will be set as the permission from the entry if this is true.\n * Default is FALSE\n * @param {string|Buffer} [pass] password\n */\n extractAllTo: function (targetPath, overwrite, keepOriginalPermission, pass) {\n keepOriginalPermission = get_Bool(false, keepOriginalPermission);\n pass = get_Str(keepOriginalPermission, pass);\n overwrite = get_Bool(false, overwrite);\n if (!_zip) throw Utils.Errors.NO_ZIP();\n\n const dirEntries = [];\n _zip.entries.forEach(function (entry) {\n var entryName = sanitize(targetPath, canonical(entry.entryName));\n if (entry.isDirectory) {\n filetools.makeDir(entryName);\n // defer restoring the directory permission until its files are written\n if (keepOriginalPermission) dirEntries.push({ path: entryName, attr: entry.header.fileAttr });\n return;\n }\n var content = entry.getData(pass);\n if (!content) {\n throw Utils.Errors.CANT_EXTRACT_FILE();\n }\n // The reverse operation for attr depend on method addFile()\n const fileAttr = keepOriginalPermission ? entry.header.fileAttr : undefined;\n filetools.writeFileTo(entryName, content, overwrite, fileAttr);\n try {\n // best-effort: an invalid date in the archive or a filesystem that\n // rejects utimes must not fail extraction of already-written content (issue #379)\n filetools.fs.utimesSync(entryName, entry.header.time, entry.header.time);\n } catch (err) {\n /* ignore timestamp failures */\n }\n });\n\n applyDirAttributes(dirEntries);\n },\n\n /**\n * Asynchronous extractAllTo\n *\n * @param {string} targetPath Target location\n * @param {boolean} [overwrite=false] If the file already exists at the target path, the file will be overwriten if this is true.\n * Default is FALSE\n * @param {boolean} [keepOriginalPermission=false] The file will be set as the permission from the entry if this is true.\n * Default is FALSE\n * @param {function} callback The callback will be executed when all entries are extracted successfully or any error is thrown.\n */\n extractAllToAsync: function (targetPath, overwrite, keepOriginalPermission, callback) {\n callback = get_Fun(overwrite, keepOriginalPermission, callback);\n keepOriginalPermission = get_Bool(false, keepOriginalPermission);\n overwrite = get_Bool(false, overwrite);\n if (!callback) {\n return new Promise((resolve, reject) => {\n this.extractAllToAsync(targetPath, overwrite, keepOriginalPermission, function (err) {\n if (err) {\n reject(err);\n } else {\n resolve(this);\n }\n });\n });\n }\n if (!_zip) {\n callback(Utils.Errors.NO_ZIP());\n return;\n }\n\n targetPath = pth.resolve(targetPath);\n // convert entryName to\n const getPath = (entry) => sanitize(targetPath, pth.normalize(canonical(entry.entryName)));\n const getError = (msg, file) => new Error(msg + ': \"' + file + '\"');\n\n // separate directories from files\n const dirEntries = [];\n const fileEntries = [];\n _zip.entries.forEach((e) => {\n if (e.isDirectory) {\n dirEntries.push(e);\n } else {\n fileEntries.push(e);\n }\n });\n\n // Create directory entries first synchronously\n // this prevents race condition and assures folders are there before writing files\n const deferredDirAttr = [];\n for (const entry of dirEntries) {\n const dirPath = getPath(entry);\n // The reverse operation for attr depend on method addFile()\n const dirAttr = keepOriginalPermission ? entry.header.fileAttr : undefined;\n try {\n filetools.makeDir(dirPath);\n } catch (er) {\n callback(getError(\"Unable to create folder\", dirPath));\n continue;\n }\n // defer restoring the directory permission until its files are written:\n // a restrictive mode applied now would block writing them\n if (dirAttr) deferredDirAttr.push({ path: dirPath, attr: dirAttr });\n try {\n // in unix timestamp will change if files are later added to folder, but still.\n // best-effort: a utimes failure must not abort extraction (issue #379)\n filetools.fs.utimesSync(dirPath, entry.header.time, entry.header.time);\n } catch (er) {\n /* ignore timestamp failures */\n }\n }\n\n // restore directory permissions once every file has been extracted\n const done = (err) => {\n if (!err) {\n try {\n applyDirAttributes(deferredDirAttr);\n } catch (er) {\n return callback(getError(\"Unable to set folder permissions\", er.path || \"\"));\n }\n }\n callback(err);\n };\n\n fileEntries.reverse().reduce(function (next, entry) {\n return function (err) {\n if (err) {\n next(err);\n } else {\n const entryName = pth.normalize(canonical(entry.entryName));\n const filePath = sanitize(targetPath, entryName);\n entry.getDataAsync(function (content, err_1) {\n if (err_1) {\n next(err_1);\n } else if (!content) {\n next(Utils.Errors.CANT_EXTRACT_FILE());\n } else {\n // The reverse operation for attr depend on method addFile()\n const fileAttr = keepOriginalPermission ? entry.header.fileAttr : undefined;\n filetools.writeFileToAsync(filePath, content, overwrite, fileAttr, function (succ) {\n if (!succ) {\n return next(getError(\"Unable to write file\", filePath));\n }\n filetools.fs.utimes(filePath, entry.header.time, entry.header.time, function () {\n // best-effort: a utimes failure must not abort extraction\n // of already-written content (issue #379)\n next();\n });\n });\n }\n });\n }\n };\n }, done)();\n },\n\n /**\n * Writes the newly created zip file to disk at the specified location or if a zip was opened and no ``targetFileName`` is provided, it will overwrite the opened zip\n *\n * @param {string} targetFileName\n * @param {function} callback\n */\n writeZip: function (targetFileName, callback) {\n if (arguments.length === 1) {\n if (typeof targetFileName === \"function\") {\n callback = targetFileName;\n targetFileName = \"\";\n }\n }\n\n if (!targetFileName && opts.filename) {\n targetFileName = opts.filename;\n }\n if (!targetFileName) return;\n\n var zipData = _zip.compressToBuffer();\n if (zipData) {\n var ok = filetools.writeFileTo(targetFileName, zipData, true);\n if (typeof callback === \"function\") callback(!ok ? new Error(\"failed\") : null, \"\");\n }\n },\n\n /**\n *\n * @param {string} targetFileName\n * @param {object} [props]\n * @param {boolean} [props.overwrite=true] If the file already exists at the target path, the file will be overwriten if this is true.\n * @param {boolean} [props.perm] The file will be set as the permission from the entry if this is true.\n\n * @returns {Promise<void>}\n */\n writeZipPromise: function (/**String*/ targetFileName, /* object */ props) {\n const { overwrite, perm } = Object.assign({ overwrite: true }, props);\n\n return new Promise((resolve, reject) => {\n // find file name\n if (!targetFileName && opts.filename) targetFileName = opts.filename;\n if (!targetFileName) reject(\"ADM-ZIP: ZIP File Name Missing\");\n\n this.toBufferPromise().then((zipData) => {\n const ret = (done) => (done ? resolve(done) : reject(\"ADM-ZIP: Wasn't able to write zip file\"));\n filetools.writeFileToAsync(targetFileName, zipData, overwrite, perm, ret);\n }, reject);\n });\n },\n\n /**\n * @returns {Promise<Buffer>} A promise to the Buffer.\n */\n toBufferPromise: function () {\n return new Promise((resolve, reject) => {\n _zip.toAsyncBuffer(resolve, reject);\n });\n },\n\n /**\n * Returns the content of the entire zip file as a Buffer object\n *\n * @prop {function} [onSuccess]\n * @prop {function} [onFail]\n * @prop {function} [onItemStart]\n * @prop {function} [onItemEnd]\n * @returns {Buffer}\n */\n toBuffer: function (onSuccess, onFail, onItemStart, onItemEnd) {\n if (typeof onSuccess === \"function\") {\n _zip.toAsyncBuffer(onSuccess, onFail, onItemStart, onItemEnd);\n return null;\n }\n return _zip.compressToBuffer();\n }\n };\n};\n","export type { IStaticDataProvider } from './IStaticDataProvider';\n\nexport { SdeDataProvider } from './SdeDataProvider';\nexport { MemorySdeProvider } from './MemorySdeProvider';\nexport type { MemorySdeData } from './MemorySdeProvider';\n\nexport type {\n Position3D,\n Position2D,\n StarStatistics,\n StargateDestination,\n BlueprintMaterial,\n BlueprintProduct,\n BlueprintActivity,\n BlueprintActivities,\n AccountingEntryType,\n AgentType,\n AgentInSpace,\n Ancestry,\n AppliedProximityEffect,\n Archetype,\n AsteroidBelt,\n Bloodline,\n Blueprint,\n EveCategory,\n Certificate,\n CharacterAttribute,\n CharacterTitle,\n CloneGrade,\n CompressibleType,\n Constellation,\n ContrabandType,\n ControlTowerResource,\n CorporationActivity,\n CorporationRoleGroup,\n CorporationRole,\n DbuffCollection,\n DogmaAttributeCategory,\n DogmaAttribute,\n DogmaEffect,\n DogmaUnit,\n Dungeon,\n DynamicItemAttribute,\n EpicArc,\n ExpertSystem,\n Faction,\n FighterAbility,\n FighterAbilityByType,\n FreelanceJobSchema,\n GraphicMaterialSet,\n Graphic,\n EveGroup,\n Icon,\n IndustryActivity,\n IndustryAssemblyLine,\n IndustryInstallationType,\n IndustryModifierSource,\n IndustryTargetFilter,\n Landmark,\n LinkWithShip,\n MarketGroup,\n Mastery,\n MercenaryTacticalOperation,\n MetaGroup,\n MetenoxMoonDrill,\n MilitaryCampaignObjective,\n MilitaryCampaign,\n Mission,\n Moon,\n NotificationType,\n NpcCharacter,\n NpcCorporationDivision,\n NpcCorporation,\n NpcStation,\n PlanetResource,\n PlanetSchematic,\n Planet,\n ProximityTrap,\n Race,\n Region,\n SchoolMap,\n School,\n SecondarySun,\n ShipTreeElement,\n ShipTreeFaction,\n ShipTreeGroup,\n SkillPlan,\n SkinLicense,\n SkinMaterial,\n SkinrComponentCategory,\n SkinrComponentPointValue,\n SkinrComponentRarity,\n SkinrComponent,\n SkinrSlotCategory,\n SkinrSlotConfiguration,\n SkinrSlotName,\n SkinrSlot,\n SkinrSlotToMaterial,\n SkinrTierThreshold,\n Skin,\n SolarSystem,\n SovereigntyUpgrade,\n Stargate,\n Star,\n StationOperation,\n StationService,\n StationStandingsRestriction,\n SystemDbuffEmitter,\n SystemWideEffect,\n TranslationLanguage,\n TypeBonus,\n TypeDogma,\n TypeElement,\n TypeList,\n TypeMaterial,\n EveType,\n} from './types';\n\nexport type { SdeVersionInfo } from './version';\n\nexport {\n SdeError,\n SdeDatabaseError,\n SdeValidationError,\n SdeVersionMismatchError,\n isSdeError,\n isSdeDatabaseError,\n isSdeValidationError,\n isSdeVersionMismatch,\n} from './errors';\n\nexport { SdeTestDataFactory } from './SdeTestDataFactory';\n","import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport * as yaml from 'js-yaml';\nimport type { IStaticDataProvider } from './IStaticDataProvider';\nimport type {\n EveType,\n EveGroup,\n EveCategory,\n Region,\n Constellation,\n SolarSystem,\n Stargate,\n Star,\n Planet,\n Moon,\n AsteroidBelt,\n Faction,\n Race,\n Bloodline,\n Ancestry,\n NpcCorporation,\n NpcStation,\n MarketGroup,\n MetaGroup,\n Icon,\n Graphic,\n DogmaAttribute,\n DogmaEffect,\n Blueprint,\n PlanetSchematic,\n AgentType,\n AgentInSpace,\n Certificate,\n CharacterAttribute,\n CloneGrade,\n CorporationActivity,\n DogmaAttributeCategory,\n DogmaUnit,\n IndustryActivity,\n Landmark,\n NotificationType,\n NpcCharacter,\n NpcCorporationDivision,\n School,\n SecondarySun,\n Skin,\n SkinLicense,\n StationOperation,\n StationService,\n TypeDogma,\n TypeMaterial,\n TypeBonus,\n Mission,\n Dungeon,\n EpicArc,\n} from './types';\nimport type { SdeVersionInfo } from './version';\nimport { SDE_FILE_REGISTRY } from './ingestion/constants';\nimport type { SdeFileSpec } from './ingestion/constants';\nimport { SdeExtractor } from './ingestion/SdeExtractor';\nimport { transformRecordNative } from './ingestion/transforms';\nimport { SdeError } from './errors';\n\nexport class SdeDataProvider implements IStaticDataProvider {\n private entities = new Map<\n string,\n Map<number | string, Record<string, unknown>>\n >();\n private fkIndexes = new Map<\n string,\n Map<unknown, Record<string, unknown>[]>\n >();\n private versionInfo: SdeVersionInfo;\n\n private constructor(version: SdeVersionInfo) {\n this.versionInfo = version;\n }\n\n static fromDirectory(dirPath: string): SdeDataProvider {\n const resolvedDir = path.resolve(dirPath);\n if (!fs.existsSync(resolvedDir)) {\n throw new SdeError(`SDE directory not found: ${resolvedDir}`);\n }\n\n let version: SdeVersionInfo = {\n version: 'unknown',\n buildDate: 'unknown',\n importedAt: new Date().toISOString(),\n };\n\n const metaPath = path.join(resolvedDir, '_sde.yaml');\n if (fs.existsSync(metaPath)) {\n const metaContent = fs.readFileSync(metaPath, 'utf-8');\n const parsed = yaml.load(metaContent) as Record<string, unknown>;\n const sdeBlock = (parsed.sde ?? parsed) as Record<string, unknown>;\n const bn = sdeBlock.buildNumber;\n const rd = sdeBlock.releaseDate;\n version = {\n version:\n typeof bn === 'string' || typeof bn === 'number'\n ? String(bn)\n : 'unknown',\n buildDate:\n typeof rd === 'string' || typeof rd === 'number'\n ? String(rd)\n : 'unknown',\n importedAt: new Date().toISOString(),\n };\n }\n\n const provider = new SdeDataProvider(version);\n\n for (const spec of SDE_FILE_REGISTRY) {\n const filePath = path.join(resolvedDir, spec.yamlFile);\n if (!fs.existsSync(filePath)) continue;\n\n const content = fs.readFileSync(filePath, 'utf-8');\n const parsed = yaml.load(content) as Record<\n string | number,\n Record<string, unknown>\n > | null;\n if (!parsed || typeof parsed !== 'object') continue;\n\n provider.loadRecords(spec, parsed);\n }\n\n return provider;\n }\n\n static fromZip(zipPath: string): SdeDataProvider {\n const resolvedPath = path.resolve(zipPath);\n if (!fs.existsSync(resolvedPath)) {\n throw new SdeError(`SDE ZIP file not found: ${resolvedPath}`);\n }\n\n const extractor = new SdeExtractor();\n const metadata = extractor.readMetadata(resolvedPath);\n\n const version: SdeVersionInfo = {\n version: metadata.buildNumber || 'unknown',\n buildDate: metadata.releaseDate || 'unknown',\n importedAt: new Date().toISOString(),\n };\n\n const provider = new SdeDataProvider(version);\n\n const yamlFiles = SDE_FILE_REGISTRY.map((s) => s.yamlFile);\n const parsedFiles = extractor.parseFiles(resolvedPath, yamlFiles);\n const specMap = new Map(SDE_FILE_REGISTRY.map((s) => [s.yamlFile, s]));\n\n for (const file of parsedFiles) {\n const spec = specMap.get(file.filename);\n if (!spec) continue;\n\n const rawEntries: Record<string | number, Record<string, unknown>> = {};\n for (const [key, value] of file.records) {\n rawEntries[key] = value;\n }\n provider.loadRecords(spec, rawEntries);\n }\n\n return provider;\n }\n\n private loadRecords(\n spec: SdeFileSpec,\n raw: Record<string | number, Record<string, unknown>>,\n ): void {\n const records = new Map<number | string, Record<string, unknown>>();\n for (const [key, value] of Object.entries(raw)) {\n if (value == null || typeof value !== 'object') continue;\n const id = spec.idType === 'string' ? key : Number(key);\n const transformed = transformRecordNative(id, value, spec);\n records.set(id, transformed);\n }\n this.entities.set(spec.tableName, records);\n }\n\n // ---------------------------------------------------------------\n // Generic helpers\n // ---------------------------------------------------------------\n\n private getById<T>(tableName: string, id: number | string): T | null {\n const table = this.entities.get(tableName);\n if (!table) return null;\n const row = table.get(id);\n return (row as T) ?? null;\n }\n\n private getByFk<T>(\n tableName: string,\n fkField: string,\n fkValue: unknown,\n ): T[] {\n const indexKey = `${tableName}:${fkField}`;\n let index = this.fkIndexes.get(indexKey);\n if (!index) {\n index = new Map();\n const table = this.entities.get(tableName);\n if (table) {\n for (const row of table.values()) {\n const val = row[fkField];\n if (val == null) continue;\n const existing = index.get(val);\n if (existing) existing.push(row);\n else index.set(val, [row]);\n }\n }\n this.fkIndexes.set(indexKey, index);\n }\n return (index.get(fkValue) ?? []) as T[];\n }\n\n private getAllRecords<T>(tableName: string): T[] {\n const table = this.entities.get(tableName);\n if (!table) return [];\n return Array.from(table.values()) as T[];\n }\n\n private search<T>(\n tableName: string,\n field: string,\n query: string,\n limit: number,\n ): T[] {\n const table = this.entities.get(tableName);\n if (!table) return [];\n const lowerQuery = query.toLowerCase();\n const results: T[] = [];\n for (const row of table.values()) {\n const val = row[field];\n if (typeof val === 'string' && val.toLowerCase().includes(lowerQuery)) {\n results.push(row as T);\n if (results.length >= limit) break;\n }\n }\n return results;\n }\n\n private filterBy<T>(\n tableName: string,\n predicate: (row: Record<string, unknown>) => boolean,\n ): T[] {\n const table = this.entities.get(tableName);\n if (!table) return [];\n const results: T[] = [];\n for (const row of table.values()) {\n if (predicate(row)) results.push(row as T);\n }\n return results;\n }\n\n // ---------------------------------------------------------------\n // Generic entity accessors (for niche entities)\n // ---------------------------------------------------------------\n\n getEntity<T = Record<string, unknown>>(\n tableName: string,\n id: number | string,\n ): T | null {\n return this.getById<T>(tableName, id);\n }\n\n getAllEntities<T = Record<string, unknown>>(tableName: string): T[] {\n return this.getAllRecords<T>(tableName);\n }\n\n // ---------------------------------------------------------------\n // Types, Groups, Categories\n // ---------------------------------------------------------------\n\n getType(typeId: number): EveType | null {\n return this.getById<EveType>('eve_types', typeId);\n }\n\n getTypesByGroup(groupId: number): EveType[] {\n return this.getByFk<EveType>('eve_types', 'groupId', groupId);\n }\n\n getGroup(groupId: number): EveGroup | null {\n return this.getById<EveGroup>('eve_groups', groupId);\n }\n\n getGroupsByCategory(categoryId: number): EveGroup[] {\n return this.getByFk<EveGroup>('eve_groups', 'categoryId', categoryId);\n }\n\n getCategory(categoryId: number): EveCategory | null {\n return this.getById<EveCategory>('eve_categories', categoryId);\n }\n\n getAllCategories(): EveCategory[] {\n return this.getAllRecords<EveCategory>('eve_categories');\n }\n\n // ---------------------------------------------------------------\n // Regions, Constellations, Solar Systems, Stargates\n // ---------------------------------------------------------------\n\n getRegion(regionId: number): Region | null {\n return this.getById<Region>('eve_regions', regionId);\n }\n\n getAllRegions(): Region[] {\n return this.getAllRecords<Region>('eve_regions');\n }\n\n getConstellation(constellationId: number): Constellation | null {\n return this.getById<Constellation>('eve_constellations', constellationId);\n }\n\n getConstellationsByRegion(regionId: number): Constellation[] {\n return this.getByFk<Constellation>(\n 'eve_constellations',\n 'regionId',\n regionId,\n );\n }\n\n getSolarSystem(systemId: number): SolarSystem | null {\n return this.getById<SolarSystem>('eve_solar_systems', systemId);\n }\n\n getSolarSystemsByConstellation(constellationId: number): SolarSystem[] {\n return this.getByFk<SolarSystem>(\n 'eve_solar_systems',\n 'constellationId',\n constellationId,\n );\n }\n\n getStargate(stargateId: number): Stargate | null {\n return this.getById<Stargate>('eve_stargates', stargateId);\n }\n\n getStargatesBySystem(systemId: number): Stargate[] {\n return this.getByFk<Stargate>('eve_stargates', 'solarSystemId', systemId);\n }\n\n // ---------------------------------------------------------------\n // Search\n // ---------------------------------------------------------------\n\n searchTypesByName(query: string, limit = 25): EveType[] {\n return this.search<EveType>('eve_types', 'name', query, limit);\n }\n\n searchSolarSystemsByName(query: string, limit = 25): SolarSystem[] {\n return this.search<SolarSystem>('eve_solar_systems', 'name', query, limit);\n }\n\n // ---------------------------------------------------------------\n // Universe\n // ---------------------------------------------------------------\n\n getStar(starId: number): Star | null {\n return this.getById<Star>('eve_stars', starId);\n }\n\n getStarBySystem(systemId: number): Star | null {\n const stars = this.getByFk<Star>('eve_stars', 'solarSystemId', systemId);\n return stars[0] ?? null;\n }\n\n getPlanet(planetId: number): Planet | null {\n return this.getById<Planet>('eve_planets', planetId);\n }\n\n getPlanetsBySystem(systemId: number): Planet[] {\n return this.getByFk<Planet>('eve_planets', 'solarSystemId', systemId);\n }\n\n getMoon(moonId: number): Moon | null {\n return this.getById<Moon>('eve_moons', moonId);\n }\n\n getMoonsBySystem(systemId: number): Moon[] {\n return this.getByFk<Moon>('eve_moons', 'solarSystemId', systemId);\n }\n\n getAsteroidBelt(asteroidBeltId: number): AsteroidBelt | null {\n return this.getById<AsteroidBelt>('eve_asteroid_belts', asteroidBeltId);\n }\n\n getAsteroidBeltsBySystem(systemId: number): AsteroidBelt[] {\n return this.getByFk<AsteroidBelt>(\n 'eve_asteroid_belts',\n 'solarSystemId',\n systemId,\n );\n }\n\n // ---------------------------------------------------------------\n // Character/Lore\n // ---------------------------------------------------------------\n\n getFaction(factionId: number): Faction | null {\n return this.getById<Faction>('eve_factions', factionId);\n }\n\n getAllFactions(): Faction[] {\n return this.getAllRecords<Faction>('eve_factions');\n }\n\n getRace(raceId: number): Race | null {\n return this.getById<Race>('eve_races', raceId);\n }\n\n getAllRaces(): Race[] {\n return this.getAllRecords<Race>('eve_races');\n }\n\n getBloodline(bloodlineId: number): Bloodline | null {\n return this.getById<Bloodline>('eve_bloodlines', bloodlineId);\n }\n\n getBloodlinesByRace(raceId: number): Bloodline[] {\n return this.getByFk<Bloodline>('eve_bloodlines', 'raceId', raceId);\n }\n\n getAncestry(ancestryId: number): Ancestry | null {\n return this.getById<Ancestry>('eve_ancestries', ancestryId);\n }\n\n getAncestriesByBloodline(bloodlineId: number): Ancestry[] {\n return this.getByFk<Ancestry>('eve_ancestries', 'bloodlineId', bloodlineId);\n }\n\n // ---------------------------------------------------------------\n // NPC Infrastructure\n // ---------------------------------------------------------------\n\n getNpcCorporation(corporationId: number): NpcCorporation | null {\n return this.getById<NpcCorporation>('eve_npc_corporations', corporationId);\n }\n\n getNpcCorporationsByFaction(factionId: number): NpcCorporation[] {\n return this.getByFk<NpcCorporation>(\n 'eve_npc_corporations',\n 'factionId',\n factionId,\n );\n }\n\n getNpcStation(stationId: number): NpcStation | null {\n return this.getById<NpcStation>('eve_npc_stations', stationId);\n }\n\n getNpcStationsBySystem(systemId: number): NpcStation[] {\n return this.getByFk<NpcStation>(\n 'eve_npc_stations',\n 'solarSystemId',\n systemId,\n );\n }\n\n getNpcStationsByOwner(ownerId: number): NpcStation[] {\n return this.getByFk<NpcStation>('eve_npc_stations', 'ownerId', ownerId);\n }\n\n // ---------------------------------------------------------------\n // Market\n // ---------------------------------------------------------------\n\n getMarketGroup(marketGroupId: number): MarketGroup | null {\n return this.getById<MarketGroup>('eve_market_groups', marketGroupId);\n }\n\n getMarketGroupsByParent(parentGroupId: number): MarketGroup[] {\n return this.getByFk<MarketGroup>(\n 'eve_market_groups',\n 'parentGroupId',\n parentGroupId,\n );\n }\n\n getRootMarketGroups(): MarketGroup[] {\n return this.filterBy<MarketGroup>(\n 'eve_market_groups',\n (r) => r.parentGroupId == null,\n );\n }\n\n getTypesByMarketGroup(marketGroupId: number): EveType[] {\n return this.getByFk<EveType>('eve_types', 'marketGroupId', marketGroupId);\n }\n\n searchMarketGroupsByName(query: string, limit = 25): MarketGroup[] {\n return this.search<MarketGroup>('eve_market_groups', 'name', query, limit);\n }\n\n // ---------------------------------------------------------------\n // Meta/UI\n // ---------------------------------------------------------------\n\n getMetaGroup(metaGroupId: number): MetaGroup | null {\n return this.getById<MetaGroup>('eve_meta_groups', metaGroupId);\n }\n\n getAllMetaGroups(): MetaGroup[] {\n return this.getAllRecords<MetaGroup>('eve_meta_groups');\n }\n\n getIcon(iconId: number): Icon | null {\n return this.getById<Icon>('eve_icons', iconId);\n }\n\n getGraphic(graphicId: number): Graphic | null {\n return this.getById<Graphic>('eve_graphics', graphicId);\n }\n\n // ---------------------------------------------------------------\n // Dogma\n // ---------------------------------------------------------------\n\n getDogmaAttribute(attributeId: number): DogmaAttribute | null {\n return this.getById<DogmaAttribute>('eve_dogma_attributes', attributeId);\n }\n\n searchDogmaAttributesByName(query: string, limit = 25): DogmaAttribute[] {\n return this.search<DogmaAttribute>(\n 'eve_dogma_attributes',\n 'name',\n query,\n limit,\n );\n }\n\n getDogmaEffect(effectId: number): DogmaEffect | null {\n return this.getById<DogmaEffect>('eve_dogma_effects', effectId);\n }\n\n searchDogmaEffectsByName(query: string, limit = 25): DogmaEffect[] {\n return this.search<DogmaEffect>('eve_dogma_effects', 'name', query, limit);\n }\n\n // ---------------------------------------------------------------\n // Industry\n // ---------------------------------------------------------------\n\n getBlueprint(blueprintTypeId: number): Blueprint | null {\n return this.getById<Blueprint>('eve_blueprints', blueprintTypeId);\n }\n\n getPlanetSchematic(planetSchematicId: number): PlanetSchematic | null {\n return this.getById<PlanetSchematic>(\n 'eve_planet_schematics',\n planetSchematicId,\n );\n }\n\n getAllPlanetSchematics(): PlanetSchematic[] {\n return this.getAllRecords<PlanetSchematic>('eve_planet_schematics');\n }\n\n // ---------------------------------------------------------------\n // Agent System\n // ---------------------------------------------------------------\n\n getAgentType(agentTypeId: number): AgentType | null {\n return this.getById<AgentType>('eve_agent_types', agentTypeId);\n }\n\n getAllAgentTypes(): AgentType[] {\n return this.getAllRecords<AgentType>('eve_agent_types');\n }\n\n getAgentInSpace(characterId: number): AgentInSpace | null {\n return this.getById<AgentInSpace>('eve_agents_in_space', characterId);\n }\n\n getAgentsInSpaceBySystem(systemId: number): AgentInSpace[] {\n return this.getByFk<AgentInSpace>(\n 'eve_agents_in_space',\n 'solarSystemId',\n systemId,\n );\n }\n\n // ---------------------------------------------------------------\n // Certificates\n // ---------------------------------------------------------------\n\n getCertificate(certificateId: number): Certificate | null {\n return this.getById<Certificate>('eve_certificates', certificateId);\n }\n\n getAllCertificates(): Certificate[] {\n return this.getAllRecords<Certificate>('eve_certificates');\n }\n\n // ---------------------------------------------------------------\n // Character Attributes\n // ---------------------------------------------------------------\n\n getCharacterAttribute(attributeId: number): CharacterAttribute | null {\n return this.getById<CharacterAttribute>(\n 'eve_character_attributes',\n attributeId,\n );\n }\n\n getAllCharacterAttributes(): CharacterAttribute[] {\n return this.getAllRecords<CharacterAttribute>('eve_character_attributes');\n }\n\n // ---------------------------------------------------------------\n // NPC Characters\n // ---------------------------------------------------------------\n\n getNpcCharacter(characterId: number): NpcCharacter | null {\n return this.getById<NpcCharacter>('eve_npc_characters', characterId);\n }\n\n getNpcCharactersByCorporation(corporationId: number): NpcCharacter[] {\n return this.getByFk<NpcCharacter>(\n 'eve_npc_characters',\n 'corporationId',\n corporationId,\n );\n }\n\n searchNpcCharactersByName(query: string, limit = 25): NpcCharacter[] {\n return this.search<NpcCharacter>(\n 'eve_npc_characters',\n 'name',\n query,\n limit,\n );\n }\n\n // ---------------------------------------------------------------\n // Clone Grades\n // ---------------------------------------------------------------\n\n getCloneGrade(cloneGradeId: number): CloneGrade | null {\n return this.getById<CloneGrade>('eve_clone_grades', cloneGradeId);\n }\n\n getAllCloneGrades(): CloneGrade[] {\n return this.getAllRecords<CloneGrade>('eve_clone_grades');\n }\n\n // ---------------------------------------------------------------\n // Corporation Reference\n // ---------------------------------------------------------------\n\n getCorporationActivity(\n corporationActivityId: number,\n ): CorporationActivity | null {\n return this.getById<CorporationActivity>(\n 'eve_corporation_activities',\n corporationActivityId,\n );\n }\n\n getAllCorporationActivities(): CorporationActivity[] {\n return this.getAllRecords<CorporationActivity>(\n 'eve_corporation_activities',\n );\n }\n\n getNpcCorporationDivision(\n npcCorporationDivisionId: number,\n ): NpcCorporationDivision | null {\n return this.getById<NpcCorporationDivision>(\n 'eve_npc_corporation_divisions',\n npcCorporationDivisionId,\n );\n }\n\n getAllNpcCorporationDivisions(): NpcCorporationDivision[] {\n return this.getAllRecords<NpcCorporationDivision>(\n 'eve_npc_corporation_divisions',\n );\n }\n\n // ---------------------------------------------------------------\n // Dogma Reference\n // ---------------------------------------------------------------\n\n getDogmaAttributeCategory(\n attributeCategoryId: number,\n ): DogmaAttributeCategory | null {\n return this.getById<DogmaAttributeCategory>(\n 'eve_dogma_attribute_categories',\n attributeCategoryId,\n );\n }\n\n getAllDogmaAttributeCategories(): DogmaAttributeCategory[] {\n return this.getAllRecords<DogmaAttributeCategory>(\n 'eve_dogma_attribute_categories',\n );\n }\n\n getDogmaUnit(unitId: number): DogmaUnit | null {\n return this.getById<DogmaUnit>('eve_dogma_units', unitId);\n }\n\n getAllDogmaUnits(): DogmaUnit[] {\n return this.getAllRecords<DogmaUnit>('eve_dogma_units');\n }\n\n // ---------------------------------------------------------------\n // Industry Reference\n // ---------------------------------------------------------------\n\n getIndustryActivity(industryActivityId: number): IndustryActivity | null {\n return this.getById<IndustryActivity>(\n 'eve_industry_activities',\n industryActivityId,\n );\n }\n\n getAllIndustryActivities(): IndustryActivity[] {\n return this.getAllRecords<IndustryActivity>('eve_industry_activities');\n }\n\n // ---------------------------------------------------------------\n // Landmarks\n // ---------------------------------------------------------------\n\n getLandmark(landmarkId: number): Landmark | null {\n return this.getById<Landmark>('eve_landmarks', landmarkId);\n }\n\n getAllLandmarks(): Landmark[] {\n return this.getAllRecords<Landmark>('eve_landmarks');\n }\n\n // ---------------------------------------------------------------\n // Notifications\n // ---------------------------------------------------------------\n\n getNotificationType(notificationTypeId: number): NotificationType | null {\n return this.getById<NotificationType>(\n 'eve_notification_types',\n notificationTypeId,\n );\n }\n\n // ---------------------------------------------------------------\n // Schools\n // ---------------------------------------------------------------\n\n getSchool(schoolId: number): School | null {\n return this.getById<School>('eve_schools', schoolId);\n }\n\n getAllSchools(): School[] {\n return this.getAllRecords<School>('eve_schools');\n }\n\n // ---------------------------------------------------------------\n // Secondary Suns\n // ---------------------------------------------------------------\n\n getSecondarySun(secondarySunId: number): SecondarySun | null {\n return this.getById<SecondarySun>('eve_secondary_suns', secondarySunId);\n }\n\n getSecondarySunsBySystem(systemId: number): SecondarySun[] {\n return this.getByFk<SecondarySun>(\n 'eve_secondary_suns',\n 'solarSystemId',\n systemId,\n );\n }\n\n // ---------------------------------------------------------------\n // Skins\n // ---------------------------------------------------------------\n\n getSkin(skinId: number): Skin | null {\n return this.getById<Skin>('eve_skins', skinId);\n }\n\n getSkinLicense(licenseTypeId: number): SkinLicense | null {\n return this.getById<SkinLicense>('eve_skin_licenses', licenseTypeId);\n }\n\n getSkinLicensesBySkin(skinId: number): SkinLicense[] {\n return this.getByFk<SkinLicense>('eve_skin_licenses', 'skinId', skinId);\n }\n\n // ---------------------------------------------------------------\n // Station Operations & Services\n // ---------------------------------------------------------------\n\n getStationOperation(stationOperationId: number): StationOperation | null {\n return this.getById<StationOperation>(\n 'eve_station_operations',\n stationOperationId,\n );\n }\n\n getAllStationOperations(): StationOperation[] {\n return this.getAllRecords<StationOperation>('eve_station_operations');\n }\n\n getStationService(stationServiceId: number): StationService | null {\n return this.getById<StationService>(\n 'eve_station_services',\n stationServiceId,\n );\n }\n\n getAllStationServices(): StationService[] {\n return this.getAllRecords<StationService>('eve_station_services');\n }\n\n // ---------------------------------------------------------------\n // Type Properties\n // ---------------------------------------------------------------\n\n getTypeDogma(typeId: number): TypeDogma | null {\n return this.getById<TypeDogma>('eve_type_dogma', typeId);\n }\n\n getTypeMaterial(typeId: number): TypeMaterial | null {\n return this.getById<TypeMaterial>('eve_type_materials', typeId);\n }\n\n getTypeBonus(typeId: number): TypeBonus | null {\n return this.getById<TypeBonus>('eve_type_bonuses', typeId);\n }\n\n // ---------------------------------------------------------------\n // Missions & Content\n // ---------------------------------------------------------------\n\n getMission(missionId: number): Mission | null {\n return this.getById<Mission>('eve_missions', missionId);\n }\n\n getDungeon(dungeonId: number): Dungeon | null {\n return this.getById<Dungeon>('eve_dungeons', dungeonId);\n }\n\n getEpicArc(epicArcId: number): EpicArc | null {\n return this.getById<EpicArc>('eve_epic_arcs', epicArcId);\n }\n\n getAllEpicArcs(): EpicArc[] {\n return this.getAllRecords<EpicArc>('eve_epic_arcs');\n }\n\n // ---------------------------------------------------------------\n // Version & Lifecycle\n // ---------------------------------------------------------------\n\n getVersion(): SdeVersionInfo {\n return { ...this.versionInfo };\n }\n\n close(): void {\n this.entities.clear();\n this.fkIndexes.clear();\n }\n}\n","/**\n * Returned by a scalar resolver when the source does not match its tag.\n *\n * @category Tags\n */\nconst NOT_RESOLVED: unique symbol = Symbol('NOT_RESOLVED')\n\n/**\n * Options for {@link defineScalarTag}.\n *\n * @category Tags\n */\ninterface ScalarTagOptions<Result> {\n /**\n * Whether this tag participates in resolving plain scalars without an\n * explicit tag. Default: `false`.\n */\n implicit?: boolean\n\n /**\n * Whether explicit tag names are matched by prefix instead of exact equality.\n * Default: `false`.\n */\n matchByTagPrefix?: boolean\n\n /**\n * Set of `source.charAt(0)` keys for which `resolve` may succeed (a superset\n * of what it really matches). A key is either a single character or '' (empty\n * source). `null` means \"no constraint, always try\". Used by the composer to\n * dispatch implicit scalars by first character without running every resolver.\n */\n implicitFirstChars?: readonly string[] | null\n\n /**\n * Construct a value from scalar text, or return {@link NOT_RESOLVED} when it\n * is invalid for this tag. `isExplicit` is true for an explicit tag and\n * `tagName` is the actual matched name.\n */\n resolve: (source: string, isExplicit: boolean, tagName: string) => Result | typeof NOT_RESOLVED\n\n /**\n * Selects this tag for a JavaScript value when dumping. Use `() => false`\n * for load-only tags.\n */\n identify: (data: any) => boolean\n\n /**\n * A scalar's printed form is text, so `represent` always yields a string.\n * The factory supplies a `String(data)` default when a tag omits it.\n */\n represent?: (data: any) => string\n\n /** Return the tag name to emit for a prefix-matching tag. Defaults to `tagName`. */\n representTagName?: (data: any) => string\n}\n\n/**\n * Normalized scalar tag returned by {@link defineScalarTag}.\n *\n * @category Tags\n */\ninterface ScalarTagDefinition<Result = unknown> extends Required<ScalarTagOptions<Result>> {\n /** Tag name used for schema lookup. */\n tagName: string\n\n /** YAML node kind handled by this tag. */\n nodeKind: 'scalar'\n}\n\n/**\n * Options for {@link defineSequenceTag}.\n *\n * @category Tags\n */\ninterface SequenceTagOptions<Carrier, Result = Carrier> {\n /**\n * Whether explicit tag names are matched by prefix instead of exact equality.\n * Default: `false`.\n */\n matchByTagPrefix?: boolean\n\n /** Create the carrier used while constructing a sequence. */\n create: (tagName: string) => Carrier\n\n /** Add an item to the carrier. Return a non-empty error message to reject it. */\n addItem: (carrier: Carrier, item: unknown, index: number) => void | string\n\n /** Convert the completed carrier to the result. Defaults to the identity function. */\n finalize?: (carrier: Carrier) => Result\n\n /**\n * Selects this tag for a JavaScript value when dumping. Use `() => false`\n * for load-only tags.\n */\n identify: (data: any) => boolean\n\n /** Return the array-like contents to dump. Defaults to the identity function. */\n represent?: (data: any) => ArrayLike<unknown>\n\n /** Return the tag name to emit for a prefix-matching tag. Defaults to `tagName`. */\n representTagName?: (data: any) => string\n}\n\n/**\n * Normalized sequence tag returned by {@link defineSequenceTag}.\n *\n * @category Tags\n */\ninterface SequenceTagDefinition<Carrier = unknown, Result = Carrier> extends Required<SequenceTagOptions<Carrier, Result>> {\n /** Tag name used for schema lookup. */\n tagName: string\n\n /** YAML node kind handled by this tag. */\n nodeKind: 'sequence'\n\n /** Sequence tags do not participate in implicit scalar resolution. */\n implicit: false\n\n /** Whether the carrier is also the final result (`finalize` was omitted). */\n carrierIsResult: boolean\n}\n\n/**\n * Options for {@link defineMappingTag}.\n *\n * @category Tags\n */\ninterface MappingTagOptions<Carrier, Result = Carrier> {\n /**\n * Whether explicit tag names are matched by prefix instead of exact equality.\n * Default: `false`.\n */\n matchByTagPrefix?: boolean\n\n /** Create the carrier used while constructing a mapping. */\n create: (tagName: string) => Carrier\n\n /**\n * Writes a pair. Returns '' on success, a non-empty error message otherwise\n * (key does not fit the representation, value rejected, ...). Always a string\n * so the hot path never allocates an exception wrapper.\n */\n addPair: (carrier: Carrier, key: unknown, value: unknown) => string\n\n /** Return whether the carrier contains a key, for duplicate and merge checks. */\n has: (carrier: Carrier, key: unknown) => boolean\n\n /** Return the keys of a completed result for YAML merge processing. */\n keys: (result: Result) => Iterable<unknown>\n\n /** Return a value from a completed result for YAML merge processing. */\n get: (result: Result, key: unknown) => unknown\n\n /** Convert the completed carrier to the result. Defaults to the identity function. */\n finalize?: (carrier: Carrier) => Result\n\n /**\n * Selects this tag for a JavaScript value when dumping. Use `() => false`\n * for load-only tags.\n */\n identify: (data: any) => boolean\n\n /** Return the mapping entries to dump. Defaults to the identity function. */\n represent?: (data: any) => Map<unknown, unknown>\n\n /** Return the tag name to emit for a prefix-matching tag. Defaults to `tagName`. */\n representTagName?: (data: any) => string\n}\n\n/**\n * Normalized mapping tag returned by {@link defineMappingTag}.\n *\n * @category Tags\n */\ninterface MappingTagDefinition<Carrier = unknown, Result = Carrier> extends Required<MappingTagOptions<Carrier, Result>> {\n /** Tag name used for schema lookup. */\n tagName: string\n\n /** YAML node kind handled by this tag. */\n nodeKind: 'mapping'\n\n /** Mapping tags do not participate in implicit scalar resolution. */\n implicit: false\n\n /** Whether the carrier is also the final result (`finalize` was omitted). */\n carrierIsResult: boolean\n}\n\n/**\n * Any normalized tag definition accepted by {@link Schema}.\n *\n * @category Tags\n */\ntype TagDefinition =\n | ScalarTagDefinition<any>\n | SequenceTagDefinition<any, any>\n | MappingTagDefinition<any, any>\n\n/**\n * Create a normalized scalar tag definition.\n *\n * @category Tags\n */\nfunction defineScalarTag<Result> (tagName: string, options: ScalarTagOptions<Result>): ScalarTagDefinition<Result> {\n return {\n tagName,\n nodeKind: 'scalar',\n implicit: options.implicit ?? false,\n matchByTagPrefix: options.matchByTagPrefix ?? false,\n implicitFirstChars: options.implicitFirstChars ?? null,\n resolve: options.resolve,\n identify: options.identify,\n represent: options.represent ?? (data => String(data)),\n representTagName: options.representTagName ?? (() => tagName)\n }\n}\n\n/**\n * Create a normalized sequence tag definition.\n *\n * @category Tags\n */\nfunction defineSequenceTag<Carrier, Result = Carrier> (tagName: string, options: SequenceTagOptions<Carrier, Result>): SequenceTagDefinition<Carrier, Result> {\n const carrierIsResult = options.finalize === undefined\n\n return {\n tagName,\n nodeKind: 'sequence',\n implicit: false,\n matchByTagPrefix: options.matchByTagPrefix ?? false,\n create: options.create,\n addItem: options.addItem,\n finalize: options.finalize ?? (carrier => carrier as unknown as Result),\n carrierIsResult,\n identify: options.identify,\n represent: options.represent ?? (data => data as ArrayLike<unknown>),\n representTagName: options.representTagName ?? (() => tagName)\n }\n}\n\n/**\n * Create a normalized mapping tag definition.\n *\n * @category Tags\n */\nfunction defineMappingTag<Carrier, Result = Carrier> (tagName: string, options: MappingTagOptions<Carrier, Result>): MappingTagDefinition<Carrier, Result> {\n const carrierIsResult = options.finalize === undefined\n\n return {\n tagName,\n nodeKind: 'mapping',\n implicit: false,\n matchByTagPrefix: options.matchByTagPrefix ?? false,\n create: options.create,\n addPair: options.addPair,\n has: options.has,\n keys: options.keys,\n get: options.get,\n finalize: options.finalize ?? (carrier => carrier as unknown as Result),\n carrierIsResult,\n identify: options.identify,\n represent: options.represent ?? (data => data as Map<unknown, unknown>),\n representTagName: options.representTagName ?? (() => tagName)\n }\n}\n\nexport {\n NOT_RESOLVED,\n defineScalarTag,\n defineSequenceTag,\n defineMappingTag,\n\n type ScalarTagDefinition,\n type SequenceTagDefinition,\n type MappingTagDefinition,\n type TagDefinition,\n type ScalarTagOptions,\n type SequenceTagOptions,\n type MappingTagOptions\n}\n","import { defineScalarTag } from '../../tag.ts'\n\n/** @category Tags */\nconst strTag = defineScalarTag('tag:yaml.org,2002:str', {\n resolve: (source) => source,\n identify: (data) => typeof data === 'string'\n})\n\nexport { strTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst NULL_VALUES = ['', '~', 'null', 'Null', 'NULL']\n\n/** @category Tags */\nconst nullCoreTag = defineScalarTag('tag:yaml.org,2002:null', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs: '' (empty), '~', 'null'/'Null'/'NULL'.\n implicitFirstChars: ['', '~', 'n', 'N'],\n resolve: (source) => {\n if (NULL_VALUES.indexOf(source) !== -1) return null\n\n return NOT_RESOLVED\n },\n identify: (object) => object === null,\n represent: () => 'null'\n})\n\nexport { nullCoreTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\n/** @category Tags */\nconst nullJsonTag = defineScalarTag('tag:yaml.org,2002:null', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs: null.\n implicitFirstChars: ['n'],\n resolve: (source, isExplicit) => {\n if (source === 'null' || (isExplicit && source === '')) return null\n\n return NOT_RESOLVED\n },\n identify: (object) => object === null,\n represent: () => 'null'\n})\n\nexport { nullJsonTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst NULL_VALUES = ['', '~', 'null', 'Null', 'NULL']\n\n/** @category Tags */\nconst nullYaml11Tag = defineScalarTag('tag:yaml.org,2002:null', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs: '' (empty), '~', 'null'/'Null'/'NULL'.\n implicitFirstChars: ['', '~', 'n', 'N'],\n resolve: (source) => {\n if (NULL_VALUES.indexOf(source) !== -1) return null\n\n return NOT_RESOLVED\n },\n identify: (object) => object === null,\n represent: () => 'null'\n})\n\nexport { nullYaml11Tag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst TRUE_VALUES = ['true', 'True', 'TRUE']\nconst FALSE_VALUES = ['false', 'False', 'FALSE']\n\n/** @category Tags */\nconst boolCoreTag = defineScalarTag('tag:yaml.org,2002:bool', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs: true/True/TRUE, false/False/FALSE.\n implicitFirstChars: ['t', 'T', 'f', 'F'],\n resolve: (source) => {\n if (TRUE_VALUES.indexOf(source) !== -1) return true\n if (FALSE_VALUES.indexOf(source) !== -1) return false\n\n return NOT_RESOLVED\n },\n identify: (object) => Object.prototype.toString.call(object) === '[object Boolean]',\n represent: (object) => object ? 'true' : 'false'\n})\n\nexport { boolCoreTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst TRUE_VALUES = ['true']\nconst FALSE_VALUES = ['false']\n\n/** @category Tags */\nconst boolJsonTag = defineScalarTag('tag:yaml.org,2002:bool', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs: true, false.\n implicitFirstChars: ['t', 'f'],\n resolve: (source) => {\n if (TRUE_VALUES.indexOf(source) !== -1) return true\n if (FALSE_VALUES.indexOf(source) !== -1) return false\n\n return NOT_RESOLVED\n },\n identify: (object) => Object.prototype.toString.call(object) === '[object Boolean]',\n represent: (object) => object ? 'true' : 'false'\n})\n\nexport { boolJsonTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst TRUE_VALUES = ['true', 'True', 'TRUE', 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON']\nconst FALSE_VALUES = ['false', 'False', 'FALSE', 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF']\n\n/** @category Tags */\nconst boolYaml11Tag = defineScalarTag('tag:yaml.org,2002:bool', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs.\n implicitFirstChars: ['y', 'Y', 'n', 'N', 't', 'T', 'f', 'F', 'o', 'O'],\n resolve: (source) => {\n if (TRUE_VALUES.indexOf(source) !== -1) return true\n if (FALSE_VALUES.indexOf(source) !== -1) return false\n\n return NOT_RESOLVED\n },\n identify: (object) => Object.prototype.toString.call(object) === '[object Boolean]',\n represent: (object) => object ? 'true' : 'false'\n})\n\nexport { boolYaml11Tag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\n// YAML 1.2 Core schema implicit resolution:\n// [-+]? [0-9]+ | 0o [0-7]+ | 0x [0-9a-fA-F]+\nconst YAML_INTEGER_IMPLICIT_PATTERN = new RegExp(\n // 0o123\n '^(?:0o[0-7]+' +\n // 0x1A\n '|0x[0-9a-fA-F]+' +\n // 12345\n '|[-+]?[0-9]+)$')\n\n// Explicit `!!int` validation is separate from Core implicit resolution.\nconst YAML_INTEGER_EXPLICIT_PATTERN = new RegExp(\n // 0b1010\n '^(?:[-+]?0b[0-1]+' +\n // 0o123\n '|[-+]?0o[0-7]+' +\n // 0x1A\n '|[-+]?0x[0-9a-fA-F]+' +\n // 12345\n '|[-+]?[0-9]+)$')\n\nfunction parseYamlInteger (source: string) {\n let value = source\n let sign = 1\n\n if (value[0] === '-' || value[0] === '+') {\n if (value[0] === '-') sign = -1\n value = value.slice(1)\n }\n\n if (value.startsWith('0b')) return sign * parseInt(value.slice(2), 2)\n if (value.startsWith('0o')) return sign * parseInt(value.slice(2), 8)\n if (value.startsWith('0x')) return sign * parseInt(value.slice(2), 16)\n\n return sign * parseInt(value, 10)\n}\n\nfunction resolveYamlInteger (source: string, isExplicit: boolean) {\n if (isExplicit) {\n if (!YAML_INTEGER_EXPLICIT_PATTERN.test(source)) return NOT_RESOLVED\n } else if (!YAML_INTEGER_IMPLICIT_PATTERN.test(source)) {\n return NOT_RESOLVED\n }\n\n const result = parseYamlInteger(source)\n return Number.isFinite(result) ? result : NOT_RESOLVED\n}\n\n/** @category Tags */\nconst intCoreTag = defineScalarTag('tag:yaml.org,2002:int', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs: optional sign + decimal digit.\n implicitFirstChars: ['-', '+', ...'0123456789'],\n resolve: resolveYamlInteger,\n identify: (object) =>\n // No ancient boxed numbers support\n Number.isInteger(object) &&\n // Negative zero => !!float\n !Object.is(object, -0) &&\n // Exponential form => !!float, round-trip for !!int 1e21 will be broken\n object.toString(10).indexOf('e') < 0,\n represent: (object: number) => object.toString(10)\n})\n\nexport { intCoreTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\n// YAML 1.2 JSON schema implicit resolution:\n// -? ( 0 | [1-9] [0-9]* )\nconst YAML_INTEGER_IMPLICIT_PATTERN = new RegExp(\n '^-?(?:0|[1-9][0-9]*)$')\n\n// Explicit `!!int` validation is separate from JSON implicit resolution.\nconst YAML_INTEGER_EXPLICIT_PATTERN = new RegExp(\n // 0b1010\n '^(?:[-+]?0b[0-1]+' +\n // 0o123\n '|[-+]?0o[0-7]+' +\n // 0x1A\n '|[-+]?0x[0-9a-fA-F]+' +\n // 12345\n '|[-+]?[0-9]+)$')\n\nfunction parseYamlInteger (source: string) {\n let value = source\n let sign = 1\n\n if (value[0] === '-' || value[0] === '+') {\n if (value[0] === '-') sign = -1\n value = value.slice(1)\n }\n\n if (value.startsWith('0b')) return sign * parseInt(value.slice(2), 2)\n if (value.startsWith('0o')) return sign * parseInt(value.slice(2), 8)\n if (value.startsWith('0x')) return sign * parseInt(value.slice(2), 16)\n\n return sign * parseInt(value, 10)\n}\n\nfunction resolveYamlInteger (source: string, isExplicit: boolean) {\n if (isExplicit) {\n if (!YAML_INTEGER_EXPLICIT_PATTERN.test(source)) return NOT_RESOLVED\n } else if (!YAML_INTEGER_IMPLICIT_PATTERN.test(source)) {\n return NOT_RESOLVED\n }\n\n const result = parseYamlInteger(source)\n return Number.isFinite(result) ? result : NOT_RESOLVED\n}\n\n/** @category Tags */\nconst intJsonTag = defineScalarTag('tag:yaml.org,2002:int', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs: optional '-' or digit.\n implicitFirstChars: ['-', ...'0123456789'],\n resolve: resolveYamlInteger,\n identify: (object) =>\n // No ancient boxed numbers support\n Number.isInteger(object) &&\n // Negative zero => !!float\n !Object.is(object, -0) &&\n // Exponential form => !!float, round-trip for !!int 1e21 will be broken\n object.toString(10).indexOf('e') < 0,\n represent: (object: number) => object.toString(10)\n})\n\nexport { intJsonTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst YAML_INTEGER_PATTERN = new RegExp(\n // 0b1010\n '^(?:[-+]?0b[0-1_]+' +\n // 0123\n '|[-+]?0[0-7_]+' +\n // 0x1A\n '|[-+]?0x[0-9a-fA-F_]+' +\n // 1:23\n '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+' +\n // 12345\n '|[-+]?(?:0|[1-9][0-9_]*))$')\n\nfunction parseYamlInteger (source: string) {\n let value = source.replace(/_/g, '')\n let sign = 1\n\n if (value[0] === '-' || value[0] === '+') {\n if (value[0] === '-') sign = -1\n value = value.slice(1)\n }\n\n if (value.startsWith('0b')) return sign * parseInt(value.slice(2), 2)\n if (value.startsWith('0x')) return sign * parseInt(value.slice(2), 16)\n\n if (value.includes(':')) {\n let result = 0\n for (const part of value.split(':')) result = result * 60 + Number(part)\n return sign * result\n }\n\n if (value !== '0' && value[0] === '0') return sign * parseInt(value, 8)\n\n return sign * parseInt(value, 10)\n}\n\nfunction resolveYamlInteger (source: string) {\n if (!YAML_INTEGER_PATTERN.test(source)) return NOT_RESOLVED\n\n const result = parseYamlInteger(source)\n return Number.isFinite(result) ? result : NOT_RESOLVED\n}\n\n/** @category Tags */\nconst intYaml11Tag = defineScalarTag('tag:yaml.org,2002:int', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs: optional sign + decimal digit.\n implicitFirstChars: ['-', '+', ...'0123456789'],\n resolve: resolveYamlInteger,\n identify: (object) =>\n // No ancient boxed numbers support\n Number.isInteger(object) &&\n // Negative zero => !!float\n !Object.is(object, -0) &&\n // Exponential form => !!float, round-trip for !!int 1e21 will be broken\n object.toString(10).indexOf('e') < 0,\n represent: (object: number) => object.toString(10)\n})\n\nexport { intYaml11Tag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst YAML_FLOAT_PATTERN = new RegExp(\n // 2.5e4, 2.5 and integers\n '^(?:[-+]?[0-9]+(?:\\\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?' +\n // .2e4, .2\n '|[-+]?\\\\.[0-9]+(?:[eE][-+]?[0-9]+)?' +\n // .inf\n '|[-+]?\\\\.(?:inf|Inf|INF)' +\n // .nan\n '|\\\\.(?:nan|NaN|NAN))$')\n\nconst YAML_FLOAT_SPECIAL_PATTERN = new RegExp(\n '^(?:' +\n // .inf\n '[-+]?\\\\.(?:inf|Inf|INF)' +\n // .nan\n '|\\\\.(?:nan|NaN|NAN))$')\n\nfunction resolveYamlFloat (source: string) {\n if (!YAML_FLOAT_PATTERN.test(source)) return NOT_RESOLVED\n\n let value = source.toLowerCase()\n const sign = value[0] === '-' ? -1 : 1\n\n if ('+-'.includes(value[0])) value = value.slice(1)\n\n if (value === '.inf') return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY\n if (value === '.nan') return NaN\n\n const result = sign * parseFloat(value)\n\n if (Number.isFinite(result) || YAML_FLOAT_SPECIAL_PATTERN.test(source)) return result\n return NOT_RESOLVED\n}\n\nfunction representYamlFloat (object: number) {\n if (isNaN(object)) return '.nan'\n if (object === Number.POSITIVE_INFINITY) return '.inf'\n if (object === Number.NEGATIVE_INFINITY) return '-.inf'\n if (Object.is(object, -0)) return '-0.0'\n\n const result = object.toString(10)\n return /^[-+]?[0-9]+e/.test(result) ? result.replace('e', '.e') : result\n}\n\n/** @category Tags */\nconst floatCoreTag = defineScalarTag('tag:yaml.org,2002:float', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs: optional sign, '.', or digit\n // ('.inf'/'.nan' start with '.').\n implicitFirstChars: ['-', '+', '.', ...'0123456789'],\n resolve: resolveYamlFloat,\n identify: (object) =>\n // No ancient boxed numbers support\n typeof object === 'number' &&\n (\n // We land here all numbers, not handled (declined) by !!int `.identify`\n // The same condition as for !!int, but reversed.\n\n // Filter out integers...\n !Number.isInteger(object) ||\n // but allow negative zero\n Object.is(object, -0) ||\n // and integers with exponential form\n object.toString(10).indexOf('e') >= 0\n ),\n represent: representYamlFloat\n})\n\nexport { floatCoreTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\n// YAML 1.2 JSON schema implicit resolution:\n// -? ( 0 | [1-9] [0-9]* ) ( \\. [0-9]* )? ( [eE] [-+]? [0-9]+ )?\nconst YAML_FLOAT_IMPLICIT_PATTERN = new RegExp(\n // 2.5e4, 2.5 and integers\n '^-?(?:0|[1-9][0-9]*)(?:\\\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$')\n\n// Explicit `!!float` validation is separate from JSON implicit resolution.\nconst YAML_FLOAT_EXPLICIT_PATTERN = new RegExp(\n // 2.5e4, 2.5 and integers\n '^(?:[-+]?[0-9]+(?:\\\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?' +\n // .2e4, .2\n '|[-+]?\\\\.[0-9]+(?:[eE][-+]?[0-9]+)?' +\n // .inf\n '|[-+]?\\\\.(?:inf|Inf|INF)' +\n // .nan\n '|\\\\.(?:nan|NaN|NAN))$')\n\nfunction resolveYamlFloat (source: string, isExplicit: boolean) {\n if (isExplicit) {\n if (!YAML_FLOAT_EXPLICIT_PATTERN.test(source)) return NOT_RESOLVED\n\n let value = source.toLowerCase()\n const sign = value[0] === '-' ? -1 : 1\n\n if ('+-'.includes(value[0])) value = value.slice(1)\n\n if (value === '.inf') return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY\n if (value === '.nan') return NaN\n\n const result = sign * parseFloat(value)\n return Number.isFinite(result) ? result : NOT_RESOLVED\n }\n\n if (!YAML_FLOAT_IMPLICIT_PATTERN.test(source)) return NOT_RESOLVED\n\n const result = Number(source)\n\n if (Number.isFinite(result)) return result\n return NOT_RESOLVED\n}\n\nfunction representYamlFloat (object: number) {\n if (isNaN(object)) return '.nan'\n if (object === Number.POSITIVE_INFINITY) return '.inf'\n if (object === Number.NEGATIVE_INFINITY) return '-.inf'\n if (Object.is(object, -0)) return '-0.0'\n\n const result = object.toString(10)\n return /^[-+]?[0-9]+e/.test(result) ? result.replace('e', '.e') : result\n}\n\n/** @category Tags */\nconst floatJsonTag = defineScalarTag('tag:yaml.org,2002:float', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs: optional '-' or digit.\n implicitFirstChars: ['-', ...'0123456789'],\n resolve: resolveYamlFloat,\n identify: (object) =>\n // No ancient boxed numbers support\n typeof object === 'number' &&\n (\n // We land here all numbers, not handled (declined) by !!int `.identify`\n // The same condition as for !!int, but reversed.\n\n // Filter out integers...\n !Number.isInteger(object) ||\n // but allow negative zero\n Object.is(object, -0) ||\n // and integers with exponential form\n object.toString(10).indexOf('e') >= 0\n ),\n represent: representYamlFloat\n})\n\nexport { floatJsonTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst YAML_FLOAT_PATTERN = new RegExp(\n // 2.5e4, 2.5 and integers\n '^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\\\.[0-9_]*)(?:[eE][-+][0-9]+)?' +\n // 190:20:30.15\n '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\\\.[0-9_]*' +\n // .inf\n '|[-+]?\\\\.(?:inf|Inf|INF)' +\n // .nan\n '|\\\\.(?:nan|NaN|NAN))$')\n\nconst YAML_FLOAT_SPECIAL_PATTERN = new RegExp(\n '^(?:' +\n // .inf\n '[-+]?\\\\.(?:inf|Inf|INF)' +\n // .nan\n '|\\\\.(?:nan|NaN|NAN))$')\n\nfunction resolveYamlFloat (source: string) {\n if (!YAML_FLOAT_PATTERN.test(source)) return NOT_RESOLVED\n\n let value = source.toLowerCase().replace(/_/g, '')\n const sign = value[0] === '-' ? -1 : 1\n\n if ('+-'.includes(value[0])) value = value.slice(1)\n\n if (value === '.inf') return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY\n if (value === '.nan') return NaN\n\n let result = 0\n\n if (value.includes(':')) {\n for (const part of value.split(':')) result = result * 60 + Number(part)\n result *= sign\n } else {\n result = sign * parseFloat(value)\n }\n\n if (Number.isFinite(result) || YAML_FLOAT_SPECIAL_PATTERN.test(source)) return result\n return NOT_RESOLVED\n}\n\nfunction representYamlFloat (object: number) {\n if (isNaN(object)) return '.nan'\n if (object === Number.POSITIVE_INFINITY) return '.inf'\n if (object === Number.NEGATIVE_INFINITY) return '-.inf'\n if (Object.is(object, -0)) return '-0.0'\n\n const result = object.toString(10)\n return /^[-+]?[0-9]+e/.test(result) ? result.replace('e', '.e') : result\n}\n\n/** @category Tags */\nconst floatYaml11Tag = defineScalarTag('tag:yaml.org,2002:float', {\n implicit: true,\n // Superset of source.charAt(0) over all matched inputs: optional sign, '.', or digit\n // ('.inf'/'.nan' start with '.').\n implicitFirstChars: ['-', '+', '.', ...'0123456789'],\n resolve: resolveYamlFloat,\n identify: (object) =>\n // No ancient boxed numbers support\n typeof object === 'number' &&\n (\n // We land here all numbers, not handled (declined) by !!int `.identify`\n // The same condition as for !!int, but reversed.\n\n // Filter out integers...\n !Number.isInteger(object) ||\n // but allow negative zero\n Object.is(object, -0) ||\n // and integers with exponential form\n object.toString(10).indexOf('e') >= 0\n ),\n represent: representYamlFloat\n})\n\nexport { floatYaml11Tag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\n/**\n * Enables merge keys in {@link CORE_SCHEMA} when added with\n * {@link Schema.withTags}.\n *\n * @category Tags\n */\nconst mergeTag = defineScalarTag('tag:yaml.org,2002:merge', {\n implicit: true,\n // source.charAt(0) over matched implicit inputs: '<' ('<<').\n implicitFirstChars: ['<'],\n // Merge semantics live in the tag, not in the value: the constructor acts on\n // a key tagged `!!merge`, so `<<` anywhere else is just this string.\n resolve: (source, isExplicit) => {\n if (source === '<<' || (isExplicit && source === '')) return '<<'\n return NOT_RESOLVED\n },\n identify: () => false\n})\n\nexport { mergeTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst BASE64_PATTERN = /^[A-Za-z0-9+/]*={0,2}$/\n\nfunction resolveYamlBinary (source: string) {\n // Strip allowed whitespace first, so validation stays a plain base64 check.\n const input = source.replace(/\\s/g, '')\n if (input.length % 4 !== 0 || !BASE64_PATTERN.test(input)) return NOT_RESOLVED\n\n const binary = atob(input)\n const result = new Uint8Array(binary.length)\n for (let index = 0; index < binary.length; index++) {\n result[index] = binary.charCodeAt(index)\n }\n return result\n}\n\nfunction representYamlBinary (object: Uint8Array) {\n let binary = ''\n for (let index = 0; index < object.length; index++) {\n binary += String.fromCharCode(object[index])\n }\n return btoa(binary)\n}\n\n/**\n * The `!!binary` tag, represented as a `Uint8Array`.\n *\n * @category Tags\n */\nconst binaryTag = defineScalarTag('tag:yaml.org,2002:binary', {\n resolve: resolveYamlBinary,\n identify: (object) => Object.prototype.toString.call(object) === '[object Uint8Array]',\n represent: representYamlBinary\n})\n\nexport { binaryTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst YAML_DATE_REGEXP = new RegExp(\n '^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$')\n\nconst YAML_TIMESTAMP_REGEXP = new RegExp(\n '^([0-9][0-9][0-9][0-9])' +\n '-([0-9][0-9]?)' +\n '-([0-9][0-9]?)' +\n '(?:[Tt]|[ \\\\t]+)' +\n '([0-9][0-9]?)' +\n ':([0-9][0-9])' +\n ':([0-9][0-9])' +\n '(?:\\\\.([0-9]*))?' +\n '(?:[ \\\\t]*(Z|([-+])([0-9][0-9]?)' +\n '(?::([0-9][0-9]))?))?$')\n\nfunction makeUtcDate (\n year: number,\n month: number,\n day: number,\n hour = 0,\n minute = 0,\n second = 0,\n fraction = 0\n) {\n const date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction))\n\n // Date.UTC() treats years 0..99 as 1900..1999. Restore the parsed YAML year\n // before validating calendar normalization, e.g. reject 0001-02-29.\n date.setUTCFullYear(year, month, day)\n\n return date\n}\n\nfunction resolveYamlTimestamp (source: string) {\n let match = YAML_DATE_REGEXP.exec(source)\n if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(source)\n if (match === null) return NOT_RESOLVED\n\n const year = +(match[1])\n const month = +(match[2]) - 1\n const day = +(match[3])\n\n // Date-only form (`YYYY-MM-DD`) has no time captures.\n if (!match[4]) {\n const date = makeUtcDate(year, month, day)\n // Reject dates that JS would normalize, e.g. 2023-02-29 -> 2023-03-01.\n if (date.getUTCFullYear() !== year || date.getUTCMonth() !== month || date.getUTCDate() !== day) {\n return NOT_RESOLVED\n }\n return date\n }\n\n const hour = +(match[4])\n const minute = +(match[5])\n const second = +(match[6])\n let fraction = 0\n\n // Reject times that JS would normalize into the next minute/hour/day.\n if (hour > 23 || minute > 59 || second > 59) return NOT_RESOLVED\n\n if (match[7]) {\n let value = match[7].slice(0, 3)\n while (value.length < 3) value += '0'\n fraction = +value\n }\n\n const date = makeUtcDate(year, month, day, hour, minute, second, fraction)\n\n // Reject invalid calendar dates before applying timezone offset.\n if (date.getUTCFullYear() !== year || date.getUTCMonth() !== month || date.getUTCDate() !== day) {\n return NOT_RESOLVED\n }\n\n if (match[9]) {\n const offsetHour = +(match[10])\n const offsetMinute = +(match[11] || 0)\n // Reject timezone offsets that JS date arithmetic would otherwise accept.\n if (offsetHour > 23 || offsetMinute > 59) return NOT_RESOLVED\n\n const offset = (offsetHour * 60 + offsetMinute) * 60000\n date.setTime(date.getTime() - (match[9] === '-' ? -offset : offset))\n }\n\n return date\n}\n\n/**\n * The YAML 1.1 `!!timestamp` tag, represented as a JavaScript `Date`.\n *\n * @category Tags\n */\nconst timestampTag = defineScalarTag('tag:yaml.org,2002:timestamp', {\n implicit: true,\n // Both patterns start with a 4-digit year, so source.charAt(0) is always a digit.\n implicitFirstChars: [...'0123456789'],\n resolve: resolveYamlTimestamp,\n identify: (object) => object instanceof Date,\n represent: (object: Date) => object.toISOString()\n})\n\nexport { timestampTag }\n","import { defineSequenceTag } from '../../tag.ts'\n\n/** @category Tags */\nconst seqTag = defineSequenceTag('tag:yaml.org,2002:seq', {\n create: () => [] as unknown[],\n addItem: (container, item) => {\n container.push(item)\n },\n identify: Array.isArray\n})\n\nexport { seqTag }\n","function isPlainObject (data: unknown): boolean {\n if (data === null || typeof data !== 'object' || Array.isArray(data)) return false\n const prototype = Object.getPrototypeOf(data)\n return prototype === null || prototype === Object.prototype\n}\n\n// Project `object` onto `keys`. Absent keys are skipped (so the result can be\n// safely spread over defaults without clobbering them with `undefined`), hence\n// the `Partial` return.\nfunction pick<T extends object, K extends keyof T> (object: T, keys: readonly K[]): Partial<Pick<T, K>> {\n const result: Partial<Pick<T, K>> = {}\n for (const key of keys) {\n if (object[key] !== undefined) result[key] = object[key]\n }\n return result\n}\n\nexport {\n isPlainObject,\n pick\n}\n","import { defineSequenceTag } from '../../tag.ts'\nimport { isPlainObject } from '../../common/object.ts'\n\n/**\n * Provided only for YAML 1.1 compatibility and supported by the loader only.\n * JavaScript has no dedicated class to represent this type, so it cannot be\n * identified and dumped.\n *\n * ```yaml\n * !!omap\n * - one: 1\n * - two: 2\n * ```\n *\n * is loaded as\n *\n * ```javascript\n * [\n * { one: 1 },\n * { two: 2 }\n * ]\n * ```\n *\n * @category Tags\n */\nconst omapTag = defineSequenceTag('tag:yaml.org,2002:omap', {\n create: (): { list: unknown[]; seen: Set<unknown> } => ({ list: [], seen: new Set() }),\n addItem: (carrier, item) => {\n let key: unknown\n\n if (item instanceof Map) {\n if (item.size !== 1) return 'cannot resolve an ordered map item'\n key = item.keys().next().value\n } else if (isPlainObject(item)) {\n const itemKeys = Object.keys(item as Record<string, unknown>)\n if (itemKeys.length !== 1) return 'cannot resolve an ordered map item'\n key = itemKeys[0]\n } else {\n return 'cannot resolve an ordered map item'\n }\n\n if (carrier.seen.has(key)) return 'duplicate key in ordered map'\n carrier.seen.add(key)\n carrier.list.push(item)\n return ''\n },\n finalize: (carrier): unknown[] => carrier.list,\n identify: () => false\n})\n\nexport { omapTag }\n","import { defineSequenceTag } from '../../tag.ts'\n\n/**\n * Provided only for YAML 1.1 compatibility and supported by the loader only.\n * JavaScript has no dedicated class to represent this type, so it cannot be\n * identified and dumped.\n *\n * ```yaml\n * !!pairs\n * - one: 1\n * - two: 2\n * ```\n *\n * is loaded as\n *\n * ```javascript\n * [\n * ['one', 1],\n * ['two', 2]\n * ]\n * ```\n *\n * @category Tags\n */\nconst pairsTag = defineSequenceTag('tag:yaml.org,2002:pairs', {\n create: () => [] as [unknown, unknown][],\n addItem: (container, item) => {\n if (item instanceof Map) {\n if (item.size !== 1) return 'cannot resolve a pairs item'\n\n container.push(item.entries().next().value!)\n return ''\n }\n\n if (Object.prototype.toString.call(item) !== '[object Object]') {\n return 'cannot resolve a pairs item'\n }\n\n const object = item as Record<string, unknown>\n const keys = Object.keys(object)\n\n if (keys.length !== 1) return 'cannot resolve a pairs item'\n\n container.push([keys[0], object[keys[0]]])\n return ''\n },\n identify: () => false\n})\n\nexport { pairsTag }\n","import { defineMappingTag } from '../../tag.ts'\nimport { isPlainObject } from '../../common/object.ts'\n\n/**\n * This is the default mapping implementation. It uses `{}` objects and has only\n * partial functionality due to language limitations. This choice was made\n * because users expect to get JavaScript objects, and it was left unchanged to\n * avoid too many breaking changes in the v5 release.\n *\n * Side effects:\n *\n * - `Object.hasOwn()` checks or `for...of` loops are required for safe use (to\n * avoid falling through to prototypes).\n * - Only scalar string keys are supported properly.\n * - Other scalar keys, such as `null` and numbers, are converted to strings.\n * This is historical behaviour, and it can cause side effects such as\n * problems with `!!merge`.\n *\n * Note that non-string scalar keys may be deprecated in future versions.\n *\n * Ideally, use {@link realMapTag} instead.\n *\n * @category Tags\n */\nconst mapTag = defineMappingTag('tag:yaml.org,2002:map', {\n create: (): Record<string, unknown> => ({}),\n identify: isPlainObject,\n // Dump side: wrap the plain object into the canonical `Map` form the writer\n // walks. Shallow — keys/values stay references to the originals.\n represent: (o: Record<string, unknown>) => {\n const map = new Map<string, unknown>()\n for (const key of Object.keys(o)) map.set(key, o[key])\n return map\n },\n addPair: (container, key, value) => {\n if (key !== null && typeof key === 'object') {\n return 'object-based map does not support complex keys'\n }\n const normalizedKey = String(key)\n if (normalizedKey === '__proto__') {\n // Define as an own data property so a literal `__proto__` key stays data\n // and never invokes the prototype setter.\n Object.defineProperty(container, normalizedKey, {\n value, enumerable: true, configurable: true, writable: true\n })\n } else {\n container[normalizedKey] = value\n }\n return ''\n },\n // hasOwn, not `in`: a plain object inherits `toString` and friends.\n has: (container, key) => {\n if (key !== null && typeof key === 'object') return false\n return Object.prototype.hasOwnProperty.call(container, String(key))\n },\n keys: (container) => Object.keys(container),\n get: (container, key) => {\n const normalizedKey = String(key)\n // key is from `keys()` only. Strong check is not needed, but leave for sure.\n if (!Object.prototype.hasOwnProperty.call(container, normalizedKey)) return null\n return container[normalizedKey]\n }\n})\n\nexport { mapTag, isPlainObject }\n","import { defineMappingTag } from '../../tag.ts'\n\n/**\n * The YAML 1.1 `!!set` tag, represented as a JavaScript `Set`.\n *\n * @category Tags\n */\nconst setTag = defineMappingTag('tag:yaml.org,2002:set', {\n create: () => new Set<unknown>(),\n identify: (data) => data instanceof Set,\n represent: (data: Set<unknown>) => {\n const map = new Map<unknown, null>()\n for (const key of data) map.set(key, null)\n return map\n },\n addPair: (container, key, value) => {\n if (value !== null) return 'cannot resolve a set item'\n container.add(key)\n return ''\n },\n has: (container, key) => container.has(key),\n keys: (container) => container.keys(),\n get: () => null\n})\n\nexport { setTag }\n","import {\n NOT_RESOLVED,\n type MappingTagDefinition,\n type ScalarTagDefinition,\n type SequenceTagDefinition,\n type TagDefinition\n} from './tag.ts'\nimport { strTag } from './tag/scalar/str.ts'\nimport { nullCoreTag } from './tag/scalar/null_core.ts'\nimport { nullJsonTag } from './tag/scalar/null_json.ts'\nimport { nullYaml11Tag } from './tag/scalar/null_yaml11.ts'\nimport { boolCoreTag } from './tag/scalar/bool_core.ts'\nimport { boolJsonTag } from './tag/scalar/bool_json.ts'\nimport { boolYaml11Tag } from './tag/scalar/bool_yaml11.ts'\nimport { intCoreTag } from './tag/scalar/int_core.ts'\nimport { intJsonTag } from './tag/scalar/int_json.ts'\nimport { intYaml11Tag } from './tag/scalar/int_yaml11.ts'\nimport { floatCoreTag } from './tag/scalar/float_core.ts'\nimport { floatJsonTag } from './tag/scalar/float_json.ts'\nimport { floatYaml11Tag } from './tag/scalar/float_yaml11.ts'\nimport { mergeTag } from './tag/scalar/merge.ts'\nimport { binaryTag } from './tag/scalar/binary.ts'\nimport { timestampTag } from './tag/scalar/timestamp.ts'\nimport { seqTag } from './tag/sequence/seq.ts'\nimport { omapTag } from './tag/sequence/omap.ts'\nimport { pairsTag } from './tag/sequence/pairs.ts'\nimport { mapTag } from './tag/mapping/map.ts'\nimport { setTag } from './tag/mapping/set.ts'\n\ninterface TagDefinitionMap {\n scalar: Record<string, ScalarTagDefinition>\n sequence: Record<string, SequenceTagDefinition>\n mapping: Record<string, MappingTagDefinition>\n}\n\ninterface TagDefinitionListMap {\n scalar: ScalarTagDefinition[]\n sequence: SequenceTagDefinition[]\n mapping: MappingTagDefinition[]\n}\n\nfunction createTagDefinitionMap (): TagDefinitionMap {\n return {\n scalar: Object.create(null),\n sequence: Object.create(null),\n mapping: Object.create(null)\n }\n}\n\nfunction createTagDefinitionListMap (): TagDefinitionListMap {\n return {\n scalar: [],\n sequence: [],\n mapping: []\n }\n}\n\nfunction compileTags (tags: readonly TagDefinition[]) {\n const result: TagDefinition[] = []\n\n for (const tag of tags) {\n let index = result.length\n\n for (let previousIndex = 0; previousIndex < result.length; previousIndex++) {\n const previous = result[previousIndex]\n\n if (previous.nodeKind === tag.nodeKind &&\n previous.tagName === tag.tagName &&\n previous.matchByTagPrefix === tag.matchByTagPrefix) {\n index = previousIndex\n break\n }\n }\n\n result[index] = tag\n }\n\n return result\n}\n\n/**\n * Controls tag resolution when loading and type selection when dumping.\n *\n * @category Schemas\n */\nclass Schema {\n readonly tags: readonly TagDefinition[]\n /** @internal */\n readonly implicitScalarTags: readonly ScalarTagDefinition[]\n\n /**\n * Dispatch implicit scalar resolvers by `source.charAt(0)`. Each bucket holds\n * the resolvers that may match that key, in schema order; a key absent from\n * the map uses\n * {@link Schema.implicitScalarAnyFirstChar}\n * (resolvers that declared no first-char constraint, so they apply to any\n * first character).\n */\n private readonly implicitScalarByFirstChar: ReadonlyMap<string, readonly ScalarTagDefinition[]>\n private readonly implicitScalarAnyFirstChar: readonly ScalarTagDefinition[]\n\n /**\n * The default scalar tag (`!!str`), resolved once so the composer's fallback\n * for unresolved plain scalars avoids a keyed lookup per scalar.\n *\n * @internal\n */\n readonly defaultScalarTag: ScalarTagDefinition\n\n /**\n * The default container tags (`!!seq` / `!!map`), used by the dumper: when a\n * value is identified by its default tag, the tag is implicit and not\n * printed. Undefined if the schema does not define them (then such values\n * can't be dumped).\n *\n * @internal\n */\n readonly defaultSequenceTag: SequenceTagDefinition | undefined\n /** @internal */\n readonly defaultMappingTag: MappingTagDefinition | undefined\n private readonly exact: TagDefinitionMap\n private readonly prefix: TagDefinitionListMap\n\n constructor (tags: readonly TagDefinition[]) {\n const compiledTags = compileTags(tags)\n const implicitScalarTags: ScalarTagDefinition[] = []\n const exact = createTagDefinitionMap()\n const prefix = createTagDefinitionListMap()\n\n for (const tag of compiledTags) {\n if (tag.nodeKind === 'scalar' && tag.implicit) {\n if (tag.matchByTagPrefix) {\n throw new Error('Implicit scalar tags cannot match by tag prefix')\n }\n\n implicitScalarTags.push(tag)\n }\n\n switch (tag.nodeKind) {\n case 'scalar':\n if (tag.matchByTagPrefix) prefix.scalar.push(tag)\n else exact.scalar[tag.tagName] = tag\n break\n case 'sequence':\n if (tag.matchByTagPrefix) prefix.sequence.push(tag)\n else exact.sequence[tag.tagName] = tag\n break\n case 'mapping':\n if (tag.matchByTagPrefix) prefix.mapping.push(tag)\n else exact.mapping[tag.tagName] = tag\n break\n }\n }\n\n const implicitScalarAnyFirstChar = implicitScalarTags.filter(tag => tag.implicitFirstChars === null)\n\n const keys = new Set<string>()\n for (const tag of implicitScalarTags) {\n if (tag.implicitFirstChars !== null) {\n for (const key of tag.implicitFirstChars) keys.add(key)\n }\n }\n\n const implicitScalarByFirstChar = new Map<string, ScalarTagDefinition[]>()\n for (const key of keys) {\n implicitScalarByFirstChar.set(key, implicitScalarTags.filter(tag =>\n tag.implicitFirstChars === null || tag.implicitFirstChars.indexOf(key) !== -1))\n }\n\n const defaultScalarTag = exact.scalar['tag:yaml.org,2002:str']\n if (!defaultScalarTag) throw new Error('schema does not define the default scalar tag (tag:yaml.org,2002:str)')\n\n this.tags = compiledTags\n this.implicitScalarTags = implicitScalarTags\n this.implicitScalarByFirstChar = implicitScalarByFirstChar\n this.implicitScalarAnyFirstChar = implicitScalarAnyFirstChar\n this.defaultScalarTag = defaultScalarTag\n this.defaultSequenceTag = exact.sequence['tag:yaml.org,2002:seq']\n this.defaultMappingTag = exact.mapping['tag:yaml.org,2002:map']\n this.exact = exact\n this.prefix = prefix\n }\n\n /** @internal */\n lookupScalarTag (tagName: string): ScalarTagDefinition | undefined {\n const exactTag = this.exact.scalar[tagName]\n if (exactTag) return exactTag\n\n for (const tag of this.prefix.scalar) {\n if (tagName.startsWith(tag.tagName)) return tag\n }\n\n return undefined\n }\n\n /** @internal */\n lookupSequenceTag (tagName: string): SequenceTagDefinition | undefined {\n const exactTag = this.exact.sequence[tagName]\n if (exactTag) return exactTag\n\n for (const tag of this.prefix.sequence) {\n if (tagName.startsWith(tag.tagName)) return tag\n }\n\n return undefined\n }\n\n /** @internal */\n lookupMappingTag (tagName: string): MappingTagDefinition | undefined {\n const exactTag = this.exact.mapping[tagName]\n if (exactTag) return exactTag\n\n for (const tag of this.prefix.mapping) {\n if (tagName.startsWith(tag.tagName)) return tag\n }\n\n return undefined\n }\n\n /** @internal */\n resolveImplicitScalarTag (source: string): { value: unknown, tag: ScalarTagDefinition } {\n const candidates = this.implicitScalarByFirstChar.get(source.charAt(0)) ??\n this.implicitScalarAnyFirstChar\n\n for (const tag of candidates) {\n const value = tag.resolve(source, false, tag.tagName)\n if (value !== NOT_RESOLVED) return { value, tag }\n }\n\n const tag = this.defaultScalarTag\n return { value: tag.resolve(source, false, tag.tagName), tag }\n }\n\n /**\n * Creates a new schema with the specified tags added. If a tag already\n * exists, it is replaced by the specified tag.\n *\n * @example\n *\n * ```javascript\n * import { CORE_SCHEMA, mergeTag, realMapTag } from 'js-yaml'\n *\n * const schema = CORE_SCHEMA.withTags(mergeTag, realMapTag)\n * ```\n */\n withTags (...tags: Array<TagDefinition | readonly TagDefinition[]>): Schema {\n let flatTags: TagDefinition[] = []\n for (const tag of tags) flatTags = flatTags.concat(tag)\n\n return new Schema([...this.tags, ...flatTags])\n }\n}\n\n/**\n * The YAML 1.2 Failsafe Schema: strings, sequences, and mappings.\n *\n * @category Schemas\n */\nconst FAILSAFE_SCHEMA = new Schema([\n strTag,\n seqTag,\n mapTag\n])\n\n/**\n * The YAML 1.2 JSON Schema. It uses JSON scalar forms while retaining YAML\n * collection syntax.\n *\n * @category Schemas\n */\nconst JSON_SCHEMA = new Schema([\n ...FAILSAFE_SCHEMA.tags,\n nullJsonTag,\n boolJsonTag,\n intJsonTag,\n floatJsonTag\n])\n\n/**\n * The default schema for the loaders. Note, {@link CORE_SCHEMA} comes\n * without the `!!merge` tag. You can easily enable it if needed.\n *\n * @example\n * Enable {@link mergeTag}:\n *\n * ```javascript\n * import { load, CORE_SCHEMA, mergeTag } from 'js-yaml'\n *\n * try {\n * load(data, { schema: CORE_SCHEMA.withTags(mergeTag) })\n * } catch (e) {\n * console.error(e)\n * }\n * ```\n *\n * @category Schemas\n */\nconst CORE_SCHEMA = new Schema([\n ...FAILSAFE_SCHEMA.tags,\n nullCoreTag,\n boolCoreTag,\n intCoreTag,\n floatCoreTag\n])\n\n/**\n * YAML 1.1-compatible schema.\n *\n * @category Schemas\n */\nconst YAML11_SCHEMA = new Schema([\n ...FAILSAFE_SCHEMA.tags,\n nullYaml11Tag,\n boolYaml11Tag,\n intYaml11Tag,\n floatYaml11Tag,\n timestampTag,\n mergeTag,\n binaryTag,\n omapTag,\n pairsTag,\n setTag\n])\n\n/**\n * The dumper schema for maximum compatibility. It combines all supported type\n * variants from YAML 1.1 and YAML 1.2 so strings matching any of them are\n * quoted. This makes the generated YAML more compatible with other parsers.\n *\n * The schema is based on YAML 1.1, but extends `!!int` and `!!float` to accept\n * both YAML 1.1 and Core Schema forms, since Core Schema supports some forms\n * that YAML 1.1 does not.\n *\n * @category Schemas\n */\nconst DUMP_SCHEMA = YAML11_SCHEMA.withTags(\n {\n ...intYaml11Tag,\n resolve: (source, isExplicit, tagName) => {\n const result = intYaml11Tag.resolve(source, isExplicit, tagName)\n return result === NOT_RESOLVED ? intCoreTag.resolve(source, isExplicit, tagName) : result\n }\n },\n {\n ...floatYaml11Tag,\n resolve: (source, isExplicit, tagName) => {\n const result = floatYaml11Tag.resolve(source, isExplicit, tagName)\n return result === NOT_RESOLVED ? floatCoreTag.resolve(source, isExplicit, tagName) : result\n }\n }\n)\n\nexport {\n Schema,\n FAILSAFE_SCHEMA,\n JSON_SCHEMA,\n CORE_SCHEMA,\n YAML11_SCHEMA,\n DUMP_SCHEMA\n}\n","import { defineMappingTag } from '../../tag.ts'\nimport { isPlainObject } from '../../common/object.ts'\n\n/**\n * Recommended when non-string keys are actually needed. It uses native\n * JavaScript `Map` objects, so keys keep their constructed types instead of\n * being converted to strings.\n *\n * It is not the default to avoid widespread breaking changes in existing\n * projects. `Map` has a different access API and does not pass deep equality\n * checks against `{}`-based fixtures. Alongside the other changes in v5,\n * making it the default was considered too disruptive.\n *\n * If these differences are acceptable for your project, we recommend using\n * {@link realMapTag} to guarantee the absence of problems and side effects.\n *\n * @example\n * Enable {@link realMapTag}:\n *\n * ```javascript\n * import { load, CORE_SCHEMA, realMapTag } from 'js-yaml'\n *\n * try {\n * load(data, { schema: CORE_SCHEMA.withTags(realMapTag) })\n * } catch (e) {\n * console.error(e)\n * }\n * ```\n *\n * @category Tags\n */\nconst realMapTag = defineMappingTag('tag:yaml.org,2002:map', {\n create: () => new Map<unknown, unknown>(),\n addPair: (container: Map<unknown, unknown>, key, value) => {\n container.set(key, value)\n return ''\n },\n has: (container: Map<unknown, unknown>, key) => container.has(key),\n keys: (container: Map<unknown, unknown>) => container.keys(),\n get: (container: Map<unknown, unknown>, key) => container.get(key),\n // Dump side: handle both a real `Map` and a plain object, so this tag fully\n // replaces the default map representation when dumping too.\n identify: (data) => data instanceof Map || isPlainObject(data),\n // Dump side: the canonical mapping form is a `Map`. A real `Map` passes\n // through untouched (keys keep their type); a plain object is wrapped\n // shallowly. Lossless — nothing is stringified.\n represent: (data) => {\n if (data instanceof Map) return data\n const map = new Map<unknown, unknown>()\n const obj = data as Record<string, unknown>\n for (const key of Object.keys(obj)) map.set(key, obj[key])\n return map\n }\n})\n\nexport { realMapTag }\n","import { defineMappingTag } from '../../tag.ts'\nimport { isPlainObject } from '../../common/object.ts'\n\n// Coerce a constructed key into the string identity a `{}` representation uses.\n// Returns null for a nested array key (an array element that is itself an\n// array), which would otherwise blow up exponentially when stringified via\n// aliases.\nfunction normalizeKey (key: unknown): string | null {\n if (Array.isArray(key)) {\n const array = Array.prototype.slice.call(key) as unknown[]\n\n for (let index = 0; index < array.length; index++) {\n if (Array.isArray(array[index])) return null\n\n if (typeof array[index] === 'object' &&\n Object.prototype.toString.call(array[index]) === '[object Object]') {\n array[index] = '[object Object]'\n }\n }\n\n return String(array)\n }\n\n if (typeof key === 'object' &&\n Object.prototype.toString.call(key) === '[object Object]') {\n return '[object Object]'\n }\n\n return String(key)\n}\n\n/**\n * This implementation exists solely to reproduce v4 behavior exactly. Its use\n * is strongly discouraged. If complex or non-string keys are needed, use\n * {@link realMapTag} instead.\n *\n * @category Tags\n */\nconst legacyMapTag = defineMappingTag('tag:yaml.org,2002:map', {\n create: (): Record<string, unknown> => ({}),\n identify: isPlainObject,\n // Dump side: wrap the plain object into the canonical `Map` form the writer\n // walks. Shallow — keys/values stay references to the originals.\n represent: (o: Record<string, unknown>) => {\n const map = new Map<string, unknown>()\n for (const key of Object.keys(o)) map.set(key, o[key])\n return map\n },\n addPair: (container, key, value) => {\n const normalizedKey = normalizeKey(key)\n if (normalizedKey === null) return 'nested arrays are not supported inside keys'\n if (normalizedKey === '__proto__') {\n // Define as an own data property so a literal `__proto__` key stays data\n // and never invokes the prototype setter.\n Object.defineProperty(container, normalizedKey, {\n value, enumerable: true, configurable: true, writable: true\n })\n } else {\n container[normalizedKey] = value\n }\n return ''\n },\n // hasOwn, not `in`: a plain object inherits `toString` and friends.\n has: (container, key) => {\n const normalizedKey = normalizeKey(key)\n return normalizedKey !== null && Object.prototype.hasOwnProperty.call(container, normalizedKey)\n },\n keys: (container) => Object.keys(container),\n get: (container, key) => {\n const normalizedKey = String(key)\n // key is from `keys()` only. Strong check is not needed, but leave for sure.\n if (!Object.prototype.hasOwnProperty.call(container, normalizedKey)) return null\n return container[normalizedKey]\n }\n})\n\nexport { legacyMapTag, isPlainObject }\n","export interface SnippetMark {\n name?: string | null\n buffer: string\n position: number\n line: number\n column: number\n snippet?: string | null\n}\n\ninterface SnippetOptions {\n maxLength?: number\n indent?: number\n linesBefore?: number\n linesAfter?: number\n}\n\nconst DEFAULT_SNIPPET_OPTIONS: Required<SnippetOptions> = {\n maxLength: 79,\n indent: 1,\n linesBefore: 3,\n linesAfter: 2\n}\n\n// get snippet for a single line, respecting maxLength\nfunction getLine (buffer: string, lineStart: number, lineEnd: number, position: number, maxLineLength: number) {\n let head = ''\n let tail = ''\n const maxHalfLength = Math.floor(maxLineLength / 2) - 1\n\n if (position - lineStart > maxHalfLength) {\n head = ' ... '\n lineStart = position - maxHalfLength + head.length\n }\n\n if (lineEnd - position > maxHalfLength) {\n tail = ' ...'\n lineEnd = position + maxHalfLength - tail.length\n }\n\n return {\n str: head + buffer.slice(lineStart, lineEnd).replace(/\\t/g, '→') + tail,\n pos: position - lineStart + head.length // relative position\n }\n}\n\nfunction padStart (string: string, max: number) {\n // max() protects from negativa value, to avoid exception.\n return ' '.repeat(Math.max(max - string.length, 0)) + string\n}\n\nfunction makeSnippet (mark: SnippetMark, options?: SnippetOptions) {\n if (!mark.buffer) return null\n\n const opts = { ...DEFAULT_SNIPPET_OPTIONS, ...options }\n\n const re = /\\r?\\n|\\r|\\0/g\n const lineStarts = [0]\n const lineEnds: number[] = []\n let match: RegExpExecArray | null\n let foundLineNo = -1\n\n while ((match = re.exec(mark.buffer))) {\n lineEnds.push(match.index)\n lineStarts.push(match.index + match[0].length)\n\n if (mark.position <= match.index && foundLineNo < 0) {\n foundLineNo = lineStarts.length - 2\n }\n }\n\n if (foundLineNo < 0) foundLineNo = lineStarts.length - 1\n\n let result = ''\n const lineNoLength = Math.min(mark.line + opts.linesAfter, lineEnds.length).toString().length\n const maxLineLength = opts.maxLength - (opts.indent + lineNoLength + 3)\n\n for (let i = 1; i <= opts.linesBefore; i++) {\n if (foundLineNo - i < 0) break\n const line = getLine(\n mark.buffer,\n lineStarts[foundLineNo - i],\n lineEnds[foundLineNo - i],\n mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),\n maxLineLength\n )\n result = `${' '.repeat(opts.indent)}${padStart((mark.line - i + 1).toString(), lineNoLength)} | ${line.str}\\n${result}`\n }\n\n const line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength)\n result += `${' '.repeat(opts.indent)}${padStart((mark.line + 1).toString(), lineNoLength)} | ${line.str}\\n`\n result += `${'-'.repeat(opts.indent + lineNoLength + 3 + line.pos)}^\\n`\n\n for (let i = 1; i <= opts.linesAfter; i++) {\n if (foundLineNo + i >= lineEnds.length) break\n const line = getLine(\n mark.buffer,\n lineStarts[foundLineNo + i],\n lineEnds[foundLineNo + i],\n mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),\n maxLineLength\n )\n result += `${' '.repeat(opts.indent)}${padStart((mark.line + i + 1).toString(), lineNoLength)} | ${line.str}\\n`\n }\n\n return result.replace(/\\n$/, '')\n}\n\nexport default makeSnippet\n","import makeSnippet, { type SnippetMark } from './snippet.ts'\n\n// YAML error class. http://stackoverflow.com/questions/8458984\n//\nfunction formatError (exception: YAMLException, compact?: boolean) {\n let where = ''\n\n if (!exception.mark) return exception.reason\n\n if (exception.mark.name) {\n where += `in \"${exception.mark.name}\" `\n }\n\n where += `(${exception.mark.line + 1}:${exception.mark.column + 1})`\n\n if (!compact && exception.mark.snippet) {\n where += `\\n\\n${exception.mark.snippet}`\n }\n\n return `${exception.reason} ${where}`\n}\n\n/**\n * A YAML error. Unlike an ordinary `Error`, it adds a source snippet showing\n * the location of the problem to the error message, when available.\n *\n * @category Main\n */\nclass YAMLException extends Error {\n reason: string\n mark?: SnippetMark\n\n /**\n * Optional `mark` contains source snippet data. Usually, use\n * {@link YAMLException.throwAt} instead of passing it directly.\n */\n constructor (reason: string, mark?: SnippetMark) {\n super()\n\n this.name = 'YAMLException'\n this.reason = reason\n this.mark = mark\n this.message = formatError(this, false)\n\n // Guard for ancient browsers\n if (Error.captureStackTrace) {\n // Include stack trace in error object,\n Error.captureStackTrace(this, this.constructor)\n }\n }\n\n /**\n * Returns the formatted error, omitting the source snippet in compact mode.\n */\n toString (compact?: boolean) {\n return `${this.name}: ${formatError(this, compact)}`\n }\n\n /**\n * Builds a YAMLException with a source snippet and throws it. `source` is\n * the raw input text; `position` is an offset into it.\n */\n static throwAt (source: string, position: number, message: string, filename = ''): never {\n let line = 0\n let lineStart = 0\n\n for (let index = 0; index < position; index++) {\n const ch = source.charCodeAt(index)\n\n if (ch === 0x0A/* LF */) {\n line++\n lineStart = index + 1\n } else if (ch === 0x0D/* CR */) {\n line++\n if (source.charCodeAt(index + 1) === 0x0A/* LF */) index++\n lineStart = index + 1\n }\n }\n\n const mark: SnippetMark = {\n name: filename,\n buffer: source,\n position,\n line,\n column: position - lineStart\n }\n\n mark.snippet = makeSnippet(mark)\n throw new YAMLException(message, mark)\n }\n}\n\nexport { YAMLException }\n","/** @category Events */\nconst EVENT_ID = {\n DOCUMENT: 1,\n SEQUENCE: 2,\n MAPPING: 3,\n SCALAR: 4,\n ALIAS: 5,\n POP: 6\n} as const\n\n/** @category Events */\ntype EventId = typeof EVENT_ID[keyof typeof EVENT_ID]\n\n/** @category Nodes */\nconst SCALAR_STYLE = {\n PLAIN: 1,\n SINGLE_QUOTED: 2,\n DOUBLE_QUOTED: 3,\n LITERAL_BLOCK: 4,\n FOLDED_BLOCK: 5\n} as const\n\n/** @category Nodes */\ntype ScalarStyle = typeof SCALAR_STYLE[keyof typeof SCALAR_STYLE]\n\n/** @category Nodes */\nconst COLLECTION_STYLE = {\n BLOCK: 1,\n FLOW: 2\n} as const\n\n/** @category Nodes */\ntype CollectionStyle = typeof COLLECTION_STYLE[keyof typeof COLLECTION_STYLE]\n\n/** @category Nodes */\nconst CHOMPING_MODE = {\n CLIP: 1,\n STRIP: 2,\n KEEP: 3\n} as const\n\n/** @category Nodes */\ntype ChompingMode = typeof CHOMPING_MODE[keyof typeof CHOMPING_MODE]\n\n/** @category Events */\ntype DocumentDirective =\n { kind: 'yaml', version: string } |\n { kind: 'tag', handle: string, prefix: string }\n\ntype TagHandlers = Record<string, string>\n\n/** @category Events */\ninterface DocumentEvent {\n type: typeof EVENT_ID.DOCUMENT\n explicitStart: boolean\n explicitEnd: boolean\n directives: DocumentDirective[]\n}\n\n/** @category Events */\ninterface SequenceEvent {\n type: typeof EVENT_ID.SEQUENCE\n start: number\n anchorStart: number\n anchorEnd: number\n tagStart: number\n tagEnd: number\n style: CollectionStyle\n}\n\n/** @category Events */\ninterface MappingEvent {\n type: typeof EVENT_ID.MAPPING\n start: number\n anchorStart: number\n anchorEnd: number\n tagStart: number\n tagEnd: number\n style: CollectionStyle\n}\n\n/**\n * A scalar whose decoded value can be read with {@link getScalarValue}.\n *\n * @category Events\n */\ninterface ScalarEvent {\n type: typeof EVENT_ID.SCALAR\n valueStart: number\n valueEnd: number\n anchorStart: number\n anchorEnd: number\n tagStart: number\n tagEnd: number\n style: ScalarStyle\n chomping: ChompingMode\n indent: number\n fast: boolean\n}\n\n/** @category Events */\ninterface AliasEvent {\n type: typeof EVENT_ID.ALIAS\n anchorStart: number\n anchorEnd: number\n}\n\n/**\n * Closes the most recently opened document, sequence, or mapping.\n *\n * @category Events\n */\ninterface PopEvent {\n type: typeof EVENT_ID.POP\n}\n\n/**\n * Source ranges are zero-based and end-exclusive; `-1` means absent.\n *\n * @category Events\n */\ntype Event =\n DocumentEvent |\n SequenceEvent |\n MappingEvent |\n ScalarEvent |\n AliasEvent |\n PopEvent\n\nexport {\n EVENT_ID,\n SCALAR_STYLE,\n COLLECTION_STYLE,\n CHOMPING_MODE,\n\n type EventId,\n type ScalarStyle,\n type CollectionStyle,\n type ChompingMode,\n\n type DocumentDirective,\n type TagHandlers,\n type DocumentEvent,\n type SequenceEvent,\n type MappingEvent,\n type ScalarEvent,\n type AliasEvent,\n type PopEvent,\n type Event\n}\n","import {\n SCALAR_STYLE,\n CHOMPING_MODE,\n type ScalarEvent\n} from './events.ts'\n\nconst NO_RANGE = -1\n\n// --- character helpers (mirrors src/loader.ts, kept self-contained here) ---\n\nfunction simpleEscapeSequence (c: number) {\n switch (c) {\n case 0x30/* 0 */: return '\\x00'\n case 0x61/* a */: return '\\x07'\n case 0x62/* b */: return '\\x08'\n case 0x74/* t */: return '\\x09'\n case 0x09/* Tab */: return '\\x09'\n case 0x6E/* n */: return '\\x0A'\n case 0x76/* v */: return '\\x0B'\n case 0x66/* f */: return '\\x0C'\n case 0x72/* r */: return '\\x0D'\n case 0x65/* e */: return '\\x1B'\n case 0x20/* Space */: return ' '\n case 0x22/* \" */: return '\\x22'\n case 0x2F/* / */: return '/'\n case 0x5C/* \\ */: return '\\x5C'\n case 0x4E/* N */: return '\\x85'\n case 0x5F/* _ */: return '\\xA0'\n case 0x4C/* L */: return '\\u2028'\n case 0x50/* P */: return '\\u2029'\n default: return ''\n }\n}\n\nconst simpleEscapeCheck = new Array(256)\nconst simpleEscapeMap = new Array(256)\nfor (let i = 0; i < 256; i++) {\n simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0\n simpleEscapeMap[i] = simpleEscapeSequence(i)\n}\n\nfunction charFromCodepoint (c: number) {\n if (c <= 0xFFFF) {\n return String.fromCharCode(c)\n }\n return String.fromCharCode(\n ((c - 0x010000) >> 10) + 0xD800,\n ((c - 0x010000) & 0x03FF) + 0xDC00\n )\n}\n\nfunction fromHexCode (c: number) {\n if (c >= 0x30/* 0 */ && c <= 0x39/* 9 */) return c - 0x30\n const lc = c | 0x20\n // Double-quoted scalar ranges are validated by parser.ts before cooking.\n return lc - 0x61 + 10\n}\n\nfunction escapedHexLen (c: number) {\n if (c === 0x78/* x */) return 2\n if (c === 0x75/* u */) return 4\n // Double-quoted scalar ranges are validated by parser.ts before cooking.\n return 8\n}\n\n// --- line folding helpers ---\n\n// Skip a run of line breaks plus the leading whitespace of the following\n// lines, returning the number of line breaks consumed and the new position.\nfunction skipFoldedBreaks (input: string, position: number, end: number) {\n let breaks = 0\n\n while (position < end) {\n const ch = input.charCodeAt(position)\n\n if (ch === 0x0A/* LF */) {\n breaks++\n position++\n } else if (ch === 0x0D/* CR */) {\n breaks++\n position++\n if (input.charCodeAt(position) === 0x0A/* LF */) position++\n } else if (ch === 0x20/* Space */ || ch === 0x09/* Tab */) {\n position++\n } else {\n break\n }\n }\n\n return { position, breaks }\n}\n\n// Folding of line breaks between content chunks: a single break becomes a\n// space, several breaks become (count - 1) newlines.\nfunction foldedBreaks (count: number) {\n if (count === 1) return ' '\n // Called only after skipFoldedBreaks() consumed at least one line break.\n return '\\n'.repeat(count - 1)\n}\n\n// --- per-style extractors ---\n\nfunction getPlainValue (input: string, start: number, end: number) {\n let result = ''\n let position = start\n let captureStart = start\n let captureEnd = start\n\n while (position < end) {\n const ch = input.charCodeAt(position)\n\n if (ch === 0x0A/* LF */ || ch === 0x0D/* CR */) {\n result += input.slice(captureStart, captureEnd)\n const fold = skipFoldedBreaks(input, position, end)\n result += foldedBreaks(fold.breaks)\n position = captureStart = captureEnd = fold.position\n } else {\n position++\n if (ch !== 0x20/* Space */ && ch !== 0x09/* Tab */) captureEnd = position\n }\n }\n\n return result + input.slice(captureStart, captureEnd)\n}\n\nfunction getSingleQuotedValue (input: string, start: number, end: number) {\n let result = ''\n let position = start\n let captureStart = start\n let captureEnd = start\n\n while (position < end) {\n const ch = input.charCodeAt(position)\n\n if (ch === 0x27/* ' */) {\n // Within the stored range every quote is part of an escaped '' pair.\n result += input.slice(captureStart, position) + \"'\"\n position += 2\n captureStart = captureEnd = position\n } else if (ch === 0x0A/* LF */ || ch === 0x0D/* CR */) {\n result += input.slice(captureStart, captureEnd)\n const fold = skipFoldedBreaks(input, position, end)\n result += foldedBreaks(fold.breaks)\n position = captureStart = captureEnd = fold.position\n } else {\n position++\n if (ch !== 0x20/* Space */ && ch !== 0x09/* Tab */) captureEnd = position\n }\n }\n\n // Whitespace right before the closing quote is significant (it is only\n // stripped when followed by a line break).\n return result + input.slice(captureStart, end)\n}\n\nfunction getDoubleQuotedValue (input: string, start: number, end: number) {\n let result = ''\n let position = start\n let captureStart = start\n let captureEnd = start\n\n while (position < end) {\n const ch = input.charCodeAt(position)\n\n if (ch === 0x5C/* \\ */) {\n result += input.slice(captureStart, position)\n position++\n const escaped = input.charCodeAt(position)\n\n if (escaped === 0x0A/* LF */ || escaped === 0x0D/* CR */) {\n // Escaped line break: a line continuation that joins with nothing.\n position = skipFoldedBreaks(input, position, end).position\n } else if (escaped < 256 && simpleEscapeCheck[escaped]) {\n result += simpleEscapeMap[escaped]\n position++\n } else {\n // parser.ts has already rejected unknown escapes and invalid hex digits.\n let hexLength = escapedHexLen(escaped)\n let hexResult = 0\n\n for (; hexLength > 0; hexLength--) {\n position++\n const digit = fromHexCode(input.charCodeAt(position))\n hexResult = (hexResult << 4) + digit\n }\n\n result += charFromCodepoint(hexResult)\n position++\n }\n\n captureStart = captureEnd = position\n } else if (ch === 0x0A/* LF */ || ch === 0x0D/* CR */) {\n result += input.slice(captureStart, captureEnd)\n const fold = skipFoldedBreaks(input, position, end)\n result += foldedBreaks(fold.breaks)\n position = captureStart = captureEnd = fold.position\n } else {\n position++\n if (ch !== 0x20/* Space */ && ch !== 0x09/* Tab */) captureEnd = position\n }\n }\n\n return result + input.slice(captureStart, end)\n}\n\nfunction getBlockValue (\n input: string,\n start: number,\n end: number,\n indent: number,\n chomping: number,\n folded: boolean\n) {\n const textIndent = indent < 0 ? 0 : indent\n // The range starts at column 0 of the first line and includes every line\n // break, including those of trailing blank lines.\n const region = input.slice(start, end).replace(/\\r\\n?/g, '\\n')\n // An empty range is a block with no lines at all (e.g. an empty `|+`) and\n // must stay empty; a naive split would invent a phantom blank line. Otherwise\n // a trailing line break leaves a trailing '' from split() that is not a real\n // line (just the terminator of the last one), so drop it. Interior blank\n // lines are kept.\n const lines = region === ''\n ? []\n : (region.endsWith('\\n') ? region.slice(0, -1) : region).split('\\n')\n\n let result = ''\n let didReadContent = false\n let emptyLines = 0\n let atMoreIndented = false\n\n for (const line of lines) {\n // Whitespace beyond the content indentation is part of the content, so the\n // indentation scan stops at textIndent. A line is empty only when nothing\n // remains after the (capped) indentation.\n // indent < 0 means no content line was detected (a wholly blank block), so\n // every line is an empty line.\n let column = 0\n while (column < textIndent && line.charCodeAt(column) === 0x20/* Space */) column++\n\n if (indent < 0 || column >= line.length) {\n emptyLines++\n continue\n }\n\n const content = line.slice(textIndent)\n const first = content.charCodeAt(0)\n\n if (folded) {\n if (first === 0x20/* Space */ || first === 0x09/* Tab */) {\n // More-indented lines are not folded.\n atMoreIndented = true\n result += '\\n'.repeat(didReadContent ? 1 + emptyLines : emptyLines)\n } else if (atMoreIndented) {\n atMoreIndented = false\n result += '\\n'.repeat(emptyLines + 1)\n } else if (emptyLines === 0) {\n if (didReadContent) result += ' '\n } else {\n result += '\\n'.repeat(emptyLines)\n }\n } else {\n result += '\\n'.repeat(didReadContent ? 1 + emptyLines : emptyLines)\n }\n\n result += content\n didReadContent = true\n emptyLines = 0\n }\n\n if (chomping === CHOMPING_MODE.KEEP) {\n result += '\\n'.repeat(didReadContent ? 1 + emptyLines : emptyLines)\n } else if (chomping !== CHOMPING_MODE.STRIP) {\n if (didReadContent) result += '\\n'\n }\n\n return result\n}\n\n/**\n * Decodes the scalar referenced by event offsets in `input`.\n *\n * @category Events\n */\nfunction getScalarValue (input: string, scalar: ScalarEvent): string {\n if (scalar.valueStart === NO_RANGE) return ''\n\n const { valueStart, valueEnd } = scalar\n\n // Fast path: the parser marked this scalar as a verbatim slice of the input\n // (single-line plain / quoted with no escapes or folded breaks), so the\n // per-style char loop below would just reproduce the slice.\n if (scalar.fast) return input.slice(valueStart, valueEnd)\n\n switch (scalar.style) {\n case SCALAR_STYLE.SINGLE_QUOTED:\n return getSingleQuotedValue(input, valueStart, valueEnd)\n case SCALAR_STYLE.DOUBLE_QUOTED:\n return getDoubleQuotedValue(input, valueStart, valueEnd)\n case SCALAR_STYLE.LITERAL_BLOCK:\n return getBlockValue(input, valueStart, valueEnd, scalar.indent, scalar.chomping, false)\n case SCALAR_STYLE.FOLDED_BLOCK:\n return getBlockValue(input, valueStart, valueEnd, scalar.indent, scalar.chomping, true)\n default:\n return getPlainValue(input, valueStart, valueEnd)\n }\n}\n\nexport {\n getScalarValue\n}\n","const DEFAULT_TAG_HANDLERS: Readonly<Record<string, string>> = Object.assign(\n Object.create(null),\n {\n '!': '!',\n '!!': 'tag:yaml.org,2002:'\n }\n)\n\nfunction tagPercentEncode (source: string) {\n return encodeURI(source).replace(/!/g, '%21')\n}\n\nfunction tagNameFull (rawTag: string, tagHandlers?: Readonly<Record<string, string>>) {\n if (rawTag.startsWith('!<') && rawTag.endsWith('>')) {\n return decodeURIComponent(rawTag.slice(2, -1))\n }\n\n const handleEnd = rawTag.indexOf('!', 1)\n const handle = handleEnd === -1 ? '!' : rawTag.slice(0, handleEnd + 1)\n const prefix = tagHandlers?.[handle] ?? DEFAULT_TAG_HANDLERS[handle] ?? handle\n\n return decodeURIComponent(prefix) + decodeURIComponent(rawTag.slice(handle.length))\n}\n\nfunction tagNameShort (fullTag: string) {\n let tag = fullTag\n\n if (tag.charCodeAt(0) === 0x21) {\n tag = tag.slice(1)\n return `!${tagPercentEncode(tag)}`\n }\n\n if (tag.slice(0, 18) === 'tag:yaml.org,2002:') {\n return `!!${tagPercentEncode(tag.slice(18))}`\n }\n\n return `!<${tagPercentEncode(tag)}>`\n}\n\nexport {\n tagNameFull,\n tagNameShort\n}\n","import {\n EVENT_ID,\n SCALAR_STYLE,\n type Event,\n type TagHandlers,\n type MappingEvent,\n type ScalarEvent,\n type SequenceEvent\n} from './events.ts'\nimport { getScalarValue } from './parser_scalar.ts'\nimport { CORE_SCHEMA, type Schema } from '../schema.ts'\nimport {\n NOT_RESOLVED,\n type MappingTagDefinition,\n type ScalarTagDefinition,\n type SequenceTagDefinition\n} from '../tag.ts'\nimport { YAMLException } from '../common/exception.ts'\nimport { tagNameFull } from '../common/tagname.ts'\n\nconst NO_RANGE = -1\n\nconst MERGE_TAG_NAME = 'tag:yaml.org,2002:merge'\n\ninterface DocumentFrame {\n kind: 'document'\n position: number\n value: unknown\n hasValue: boolean\n}\n\ninterface SequenceFrame {\n kind: 'sequence'\n position: number\n value: any\n tag: SequenceTagDefinition<any, any>\n anchor: Anchor | null\n index: number\n}\n\ninterface MappingFrame {\n kind: 'mapping'\n position: number\n value: any\n tag: MappingTagDefinition<any, any>\n anchor: Anchor | null\n key: unknown\n keyPosition: number\n hasKey: boolean\n // The key slot drops its tag, but `<<` is recognized by tag, not by value.\n keyIsMerge: boolean\n // Keys brought in by a merge that an explicit pair is still allowed to\n // override. Lazily allocated: stays null for mappings without `<<`.\n overridable: Set<unknown> | null\n}\n\ntype Frame = DocumentFrame | SequenceFrame | MappingFrame\n\ntype AnyTag = ScalarTagDefinition | SequenceTagDefinition<any, any> | MappingTagDefinition<any, any>\n\ninterface ValueAndTag {\n value: unknown\n tag: AnyTag\n}\n\ninterface Anchor {\n value: unknown\n tag: AnyTag\n isValueFinal: boolean\n}\n\n/** @category Events */\ninterface ConstructorOptions {\n /** Source text referenced by offsets in `events`. */\n source: string\n filename?: string\n\n /**\n * Schema to use.\n *\n * @defaultValue {@link CORE_SCHEMA}\n */\n schema?: Schema\n\n /**\n * Enables compatibility with `JSON.parse` behavior. Duplicate keys in a\n * mapping override values instead of throwing an error.\n *\n * @defaultValue `false`\n */\n json?: boolean\n\n /**\n * Maximum total number of keys processed by merge (`<<`) across one load\n * call. Set to `-1` to disable the limit.\n *\n * @defaultValue `10000`\n */\n maxTotalMergeKeys?: number\n\n /**\n * Maximum number of alias nodes (`*ref`) per document. Set to `0` to reject\n * all aliases, or to `-1` for no limit.\n *\n * @defaultValue `-1`\n */\n maxAliases?: number\n}\n\n// `source` is input data, not config — so it has no default here.\nconst DEFAULT_CONSTRUCTOR_OPTIONS: Required<Omit<ConstructorOptions, 'source'>> = {\n filename: '',\n schema: CORE_SCHEMA,\n json: false,\n maxTotalMergeKeys: 10000,\n maxAliases: -1\n}\n\ninterface ConstructorState extends Required<ConstructorOptions> {\n events: Event[]\n documents: unknown[]\n eventIndex: number\n position: number\n frames: Frame[]\n anchors: Map<string, Anchor>\n // Mapping tag each sequence element was built with, keyed by the element\n // itself. Needed by `<<` merge, which sees only the finished element values.\n nodeTags: Map<unknown, MappingTagDefinition<any, any>>\n tagHandlers: TagHandlers\n totalMergeKeys: number\n aliasCount: number\n}\n\nfunction eventPosition (event: Event) {\n if ('tagStart' in event && event.tagStart !== NO_RANGE) return event.tagStart\n if ('anchorStart' in event && event.anchorStart !== NO_RANGE) return event.anchorStart\n if ('valueStart' in event && event.valueStart !== NO_RANGE) return event.valueStart\n if ('start' in event) return event.start\n return 0\n}\n\nfunction throwError (state: ConstructorState, message: string): never {\n YAMLException.throwAt(state.source, state.position, message, state.filename)\n}\n\nfunction finalizeCollection (\n state: ConstructorState,\n position: number,\n tag: SequenceTagDefinition<any, any> | MappingTagDefinition<any, any>,\n carrier: unknown\n) {\n try {\n return tag.finalize(carrier)\n } catch (error) {\n if (error instanceof YAMLException) throw error\n YAMLException.throwAt(\n state.source,\n position,\n error instanceof Error ? error.message : String(error),\n state.filename\n )\n }\n}\n\nfunction constructScalar (\n state: ConstructorState,\n event: ScalarEvent\n): ValueAndTag {\n const source = getScalarValue(state.source, event)\n const rawTag = event.tagStart === NO_RANGE\n ? ''\n : state.source.slice(event.tagStart, event.tagEnd)\n const strTag = state.schema.defaultScalarTag\n\n if (rawTag !== '') {\n if (rawTag === '!') return { value: source, tag: strTag }\n\n const tagName = tagNameFull(rawTag, state.tagHandlers)\n const scalarTag = state.schema.lookupScalarTag(tagName)\n\n if (scalarTag) {\n const result = scalarTag.resolve(source, true, tagName)\n\n if (result === NOT_RESOLVED) {\n throwError(state, `cannot resolve a node with !<${tagName}> explicit tag`)\n }\n\n return { value: result, tag: scalarTag }\n }\n\n // An empty node carrying a collection tag (e.g. `!!map`, `!!seq`) is emitted\n // by the parser as a scalar event, since there is no collection syntax to key\n // off. Resolve it here by the explicit tag's kind into an empty collection.\n const collectionTagDef =\n state.schema.lookupMappingTag(tagName) ??\n state.schema.lookupSequenceTag(tagName)\n\n if (collectionTagDef) {\n if (source !== '') {\n throwError(state, `cannot resolve a node with !<${tagName}> explicit tag`)\n }\n\n const carrier = collectionTagDef.create(tagName)\n const value = collectionTagDef.carrierIsResult\n ? carrier\n : finalizeCollection(state, state.position, collectionTagDef, carrier)\n return { value, tag: collectionTagDef }\n }\n\n throwError(state, `unknown scalar tag !<${tagName}>`)\n }\n\n if (event.style === SCALAR_STYLE.PLAIN) {\n return state.schema.resolveImplicitScalarTag(source)\n }\n\n return { value: strTag.resolve(source, false, strTag.tagName), tag: strTag }\n}\n\nfunction collectionTagName (\n state: ConstructorState,\n event: SequenceEvent | MappingEvent,\n defaultTagName: string\n) {\n const rawTag = event.tagStart === NO_RANGE\n ? ''\n : state.source.slice(event.tagStart, event.tagEnd)\n const tagName = rawTag === '' || rawTag === '!'\n ? defaultTagName\n : tagNameFull(rawTag, state.tagHandlers)\n\n return tagName\n}\n\n// A merge source must be a mapping; every mapping tag exposes the read side.\nfunction isMappingTag (tag: AnyTag): tag is MappingTagDefinition<any, any> {\n return tag.nodeKind === 'mapping'\n}\n\n// Fold the keys of one mapping source into the target frame, honoring merge\n// precedence: an already-present key (explicit or from an earlier source) wins.\nfunction mergeKeys (state: ConstructorState, frame: MappingFrame, source: unknown, sourceTag: MappingTagDefinition<any, any>) {\n for (const sourceKey of sourceTag.keys(source)) {\n if (state.maxTotalMergeKeys !== -1 && ++state.totalMergeKeys > state.maxTotalMergeKeys) {\n throwError(state, `merge keys exceeded maxTotalMergeKeys (${state.maxTotalMergeKeys})`)\n }\n\n if (frame.tag.has(frame.value, sourceKey)) continue\n\n const err = frame.tag.addPair(frame.value, sourceKey, sourceTag.get(source, sourceKey))\n if (err) throwError(state, err)\n ;(frame.overridable ??= new Set()).add(sourceKey)\n }\n}\n\n// The value of a `<<` key: either a mapping (fold its keys) or a sequence of\n// mappings (fold each). Sequence elements arrive as bare values, so the tag each\n// was built with comes from `nodeTags`; a miss means it is not a mapping (a\n// scalar, a nested sequence, or a value some sequence tag synthesized itself).\nfunction mergeSource (state: ConstructorState, frame: MappingFrame, source: unknown, sourceTag: AnyTag) {\n state.position = frame.keyPosition\n\n if (isMappingTag(sourceTag)) {\n mergeKeys(state, frame, source, sourceTag)\n } else if (sourceTag.nodeKind === 'sequence' && Array.isArray(source)) {\n for (const element of source) {\n const elementTag = state.nodeTags.get(element)\n if (!elementTag) {\n throwError(state, 'cannot merge mappings; the provided source object is unacceptable')\n }\n mergeKeys(state, frame, element, elementTag)\n }\n } else {\n throwError(state, 'cannot merge mappings; the provided source object is unacceptable')\n }\n}\n\nfunction addMappingValue (state: ConstructorState, frame: MappingFrame, key: unknown, value: unknown, tag: AnyTag) {\n state.position = frame.keyPosition\n\n // `<<` is intercepted before dedup, so a repeated merge key is allowed.\n if (frame.keyIsMerge) {\n mergeSource(state, frame, value, tag)\n return\n }\n\n if (!state.json && frame.tag.has(frame.value, key) && !frame.overridable?.has(key)) {\n throwError(state, 'duplicated mapping key')\n }\n\n const err = frame.tag.addPair(frame.value, key, value)\n if (err) throwError(state, err)\n frame.overridable?.delete(key)\n}\n\nfunction addValue (state: ConstructorState, value: unknown, tag: AnyTag) {\n const frame = state.frames[state.frames.length - 1]!\n\n if (frame.kind === 'document') {\n frame.value = value\n frame.hasValue = true\n } else if (frame.kind === 'sequence') {\n // Any element may later be folded in by a `<<` merge, which by then has no\n // way to tell what built it.\n if (isMappingTag(tag)) state.nodeTags.set(value, tag)\n const err = frame.tag.addItem(frame.value, value, frame.index++)\n if (err) throwError(state, err)\n } else if (frame.hasKey) {\n const key = frame.key\n frame.key = undefined\n frame.hasKey = false\n addMappingValue(state, frame, key, value, tag)\n } else {\n frame.key = value\n frame.keyPosition = state.position\n frame.hasKey = true\n frame.keyIsMerge = tag.tagName === MERGE_TAG_NAME\n }\n}\n\nfunction storeAnchor (\n state: ConstructorState,\n event: ScalarEvent | SequenceEvent | MappingEvent,\n value: unknown,\n tag: AnyTag,\n isValueFinal: boolean\n): Anchor | null {\n if (event.anchorStart !== NO_RANGE) {\n const anchor = {\n value,\n tag,\n isValueFinal\n }\n state.anchors.set(state.source.slice(event.anchorStart, event.anchorEnd), anchor)\n return anchor\n }\n\n return null\n}\n\n/**\n * Constructs JavaScript documents directly from parser events, without an\n * intermediate AST.\n *\n * @category Events\n */\nfunction constructFromEvents (events: Event[], options: ConstructorOptions): unknown[] {\n const state: ConstructorState = {\n ...DEFAULT_CONSTRUCTOR_OPTIONS,\n ...options,\n events,\n documents: [],\n eventIndex: 0,\n position: 0,\n frames: [],\n anchors: new Map(),\n nodeTags: new Map(),\n tagHandlers: Object.create(null),\n totalMergeKeys: 0,\n aliasCount: 0\n }\n\n while (state.eventIndex < state.events.length) {\n const event = state.events[state.eventIndex++]\n state.position = eventPosition(event)\n\n switch (event.type) {\n case EVENT_ID.DOCUMENT:\n state.anchors = new Map()\n state.nodeTags = new Map()\n state.aliasCount = 0\n state.tagHandlers = Object.create(null)\n for (const directive of event.directives) {\n if (directive.kind === 'tag') state.tagHandlers[directive.handle] = directive.prefix\n }\n state.frames.push({ kind: 'document', position: state.position, value: undefined, hasValue: false })\n break\n\n case EVENT_ID.SCALAR: {\n const { value, tag } = constructScalar(state, event)\n storeAnchor(state, event, value, tag, true)\n addValue(state, value, tag)\n break\n }\n\n case EVENT_ID.SEQUENCE: {\n const tagName = collectionTagName(state, event, 'tag:yaml.org,2002:seq')\n const tag = state.schema.lookupSequenceTag(tagName)\n if (!tag) throwError(state, `unknown sequence tag !<${tagName}>`)\n\n const value = tag.create(tagName)\n const anchor = storeAnchor(state, event, value, tag, tag.carrierIsResult)\n\n state.frames.push({\n kind: 'sequence', position: state.position, value, tag, anchor, index: 0\n })\n break\n }\n\n case EVENT_ID.MAPPING: {\n const tagName = collectionTagName(state, event, 'tag:yaml.org,2002:map')\n const tag = state.schema.lookupMappingTag(tagName)\n if (!tag) throwError(state, `unknown mapping tag !<${tagName}>`)\n\n const value = tag.create(tagName)\n const anchor = storeAnchor(state, event, value, tag, tag.carrierIsResult)\n state.frames.push({\n kind: 'mapping',\n position: state.position,\n value,\n tag,\n anchor,\n key: undefined,\n keyPosition: state.position,\n hasKey: false,\n keyIsMerge: false,\n overridable: null\n })\n break\n }\n\n case EVENT_ID.ALIAS: {\n if (state.maxAliases !== -1 && ++state.aliasCount > state.maxAliases) {\n throwError(state, `aliases exceeded maxAliases (${state.maxAliases})`)\n }\n\n const name = state.source.slice(event.anchorStart, event.anchorEnd)\n const anchor = state.anchors.get(name)\n if (!anchor) {\n throwError(state, `unidentified alias \"${name}\"`)\n }\n if (!anchor.isValueFinal) {\n throwError(state, `recursive alias \"${name}\" is not supported for tag ${anchor.tag.tagName} because it uses finalize()`)\n }\n addValue(state, anchor.value, anchor.tag)\n break\n }\n\n case EVENT_ID.POP: {\n const frame = state.frames.pop()!\n\n if (frame.kind === 'mapping' && frame.hasKey) {\n state.position = frame.keyPosition\n throwError(state, 'incomplete mapping pair in event stream')\n }\n\n if (frame.kind === 'document') {\n state.documents.push(frame.value)\n } else {\n const value = frame.tag.carrierIsResult\n ? frame.value\n : finalizeCollection(state, frame.position, frame.tag, frame.value)\n if (frame.anchor) {\n frame.anchor.value = value\n frame.anchor.isValueFinal = true\n }\n addValue(state, value, frame.tag)\n }\n break\n }\n }\n }\n\n return state.documents\n}\n\nexport {\n constructFromEvents,\n DEFAULT_CONSTRUCTOR_OPTIONS,\n type ConstructorOptions\n}\n","import {\n EVENT_ID,\n SCALAR_STYLE,\n COLLECTION_STYLE,\n CHOMPING_MODE,\n type Event,\n type ScalarStyle,\n type CollectionStyle,\n type ChompingMode,\n type DocumentDirective,\n type TagHandlers\n} from './events.ts'\nimport { YAMLException } from '../common/exception.ts'\n\nconst NO_RANGE = -1\nconst HAS_OWN = Object.prototype.hasOwnProperty\n\nconst CONTEXT_FLOW_IN = 1\nconst CONTEXT_FLOW_OUT = 2\nconst CONTEXT_BLOCK_IN = 3\nconst CONTEXT_BLOCK_OUT = 4\n\n// eslint-disable-next-line no-control-regex\nconst PATTERN_NON_PRINTABLE = /[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x84\\x86-\\x9F\\uFFFE\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/\n// eslint-disable-next-line no-useless-escape\nconst PATTERN_FLOW_INDICATORS = /[,\\[\\]{}]/\n// YAML 1.2.2, [91] c-tag-handle.\n// eslint-disable-next-line no-useless-escape\nconst PATTERN_TAG_HANDLE = /^(?:!|!!|![0-9A-Za-z-]+!)$/\n// YAML 1.2.2, [39] ns-uri-char.\n// eslint-disable-next-line no-useless-escape\nconst NS_URI_CHAR = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\\-#;/?:@&=+$,_.!~*'()\\[\\]])`\n// YAML 1.2.2, [40] ns-tag-char = ns-uri-char - \"!\" - c-flow-indicator.\n// eslint-disable-next-line no-useless-escape\nconst NS_TAG_CHAR = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\\-#;/?:@&=+$.~*'()_])`\nconst PATTERN_TAG_URI = new RegExp(`^(?:${NS_URI_CHAR})*$`)\n// YAML 1.2.2, [99] c-ns-shorthand-tag suffix part.\nconst PATTERN_TAG_SUFFIX = new RegExp(`^(?:${NS_TAG_CHAR})+$`)\n// YAML 1.2.2, [93] ns-tag-prefix.\nconst PATTERN_TAG_PREFIX = new RegExp(`^(?:!(?:${NS_URI_CHAR})*|${NS_TAG_CHAR}(?:${NS_URI_CHAR})*)$`)\n\ntype NodeContext =\n typeof CONTEXT_FLOW_IN | typeof CONTEXT_FLOW_OUT |\n typeof CONTEXT_BLOCK_IN | typeof CONTEXT_BLOCK_OUT\n\ninterface NodeProperties {\n anchorStart: number\n anchorEnd: number\n tagStart: number\n tagEnd: number\n}\n\ninterface ParserSnapshot {\n position: number\n line: number\n lineStart: number\n lineIndent: number\n firstTabInLine: number\n eventsLength: number\n}\n\n/** @category Events */\ninterface ParserOptions {\n /**\n * File path used in error messages.\n *\n * @defaultValue `null`\n */\n filename?: string\n\n /**\n * Maximum nesting depth for collections. Aliases are not taken into account.\n *\n * @defaultValue `100`\n */\n maxDepth?: number\n}\n\nconst DEFAULT_PARSER_OPTIONS: Required<ParserOptions> = {\n filename: '',\n maxDepth: 100\n}\n\ninterface ParserState extends Required<ParserOptions> {\n input: string\n length: number\n position: number\n line: number\n lineStart: number\n lineIndent: number\n firstTabInLine: number\n depth: number\n directives: DocumentDirective[]\n tagHandlers: TagHandlers\n events: Event[]\n}\n\nfunction addDocumentEvent (\n state: ParserState,\n explicitStart: boolean,\n explicitEnd: boolean\n) {\n state.events.push({\n type: EVENT_ID.DOCUMENT,\n explicitStart,\n explicitEnd,\n directives: state.directives\n })\n}\n\nfunction addSequenceEvent (\n state: ParserState,\n start: number,\n anchorStart: number,\n anchorEnd: number,\n tagStart: number,\n tagEnd: number,\n style: CollectionStyle\n) {\n state.events.push({\n type: EVENT_ID.SEQUENCE,\n start,\n anchorStart,\n anchorEnd,\n tagStart,\n tagEnd,\n style\n })\n}\n\nfunction addMappingEvent (\n state: ParserState,\n start: number,\n anchorStart: number,\n anchorEnd: number,\n tagStart: number,\n tagEnd: number,\n style: CollectionStyle\n) {\n state.events.push({\n type: EVENT_ID.MAPPING,\n start,\n anchorStart,\n anchorEnd,\n tagStart,\n tagEnd,\n style\n })\n}\n\nfunction insertFlowPairMappingEvent (state: ParserState, snapshot: ParserSnapshot) {\n state.events.splice(snapshot.eventsLength, 0, {\n type: EVENT_ID.MAPPING,\n start: snapshot.position,\n anchorStart: NO_RANGE,\n anchorEnd: NO_RANGE,\n tagStart: NO_RANGE,\n tagEnd: NO_RANGE,\n style: COLLECTION_STYLE.FLOW\n })\n}\n\nfunction addScalarEvent (\n state: ParserState,\n valueStart: number,\n valueEnd: number,\n anchorStart: number,\n anchorEnd: number,\n tagStart: number,\n tagEnd: number,\n style: ScalarStyle,\n chomping: ChompingMode = CHOMPING_MODE.CLIP,\n indent = -1,\n fast = false\n) {\n state.events.push({\n type: EVENT_ID.SCALAR,\n valueStart,\n valueEnd,\n anchorStart,\n anchorEnd,\n tagStart,\n tagEnd,\n style,\n chomping,\n indent,\n fast\n })\n}\n\nfunction addAliasEvent (\n state: ParserState,\n anchorStart: number,\n anchorEnd: number\n) {\n state.events.push({\n type: EVENT_ID.ALIAS,\n anchorStart,\n anchorEnd\n })\n}\n\nfunction addPopEvent (state: ParserState) {\n state.events.push({ type: EVENT_ID.POP })\n}\n\nfunction addEmptyScalarEvent (state: ParserState) {\n addScalarEvent(\n state,\n NO_RANGE,\n NO_RANGE,\n NO_RANGE,\n NO_RANGE,\n NO_RANGE,\n NO_RANGE,\n SCALAR_STYLE.PLAIN\n )\n}\n\nfunction emptyProperties (): NodeProperties {\n return {\n anchorStart: NO_RANGE,\n anchorEnd: NO_RANGE,\n tagStart: NO_RANGE,\n tagEnd: NO_RANGE\n }\n}\n\nfunction snapshotState (state: ParserState): ParserSnapshot {\n return {\n position: state.position,\n line: state.line,\n lineStart: state.lineStart,\n lineIndent: state.lineIndent,\n firstTabInLine: state.firstTabInLine,\n eventsLength: state.events.length\n }\n}\n\nfunction restoreState (state: ParserState, snapshot: ParserSnapshot) {\n state.position = snapshot.position\n state.line = snapshot.line\n state.lineStart = snapshot.lineStart\n state.lineIndent = snapshot.lineIndent\n state.firstTabInLine = snapshot.firstTabInLine\n state.events.length = snapshot.eventsLength\n}\n\nfunction throwError (state: ParserState, message: string): never {\n YAMLException.throwAt(state.input.slice(0, state.length), state.position, message, state.filename)\n}\n\nfunction isEol (c: number) {\n return c === 0x0A/* LF */ || c === 0x0D/* CR */\n}\n\nfunction isWhiteSpace (c: number) {\n return c === 0x09/* Tab */ || c === 0x20/* Space */\n}\n\nfunction isWsOrEol (c: number) {\n return isWhiteSpace(c) || isEol(c)\n}\n\nfunction isWsOrEolOrEnd (c: number) {\n return c === 0 || isWsOrEol(c)\n}\n\nfunction isFlowIndicator (c: number) {\n return c === 0x2C/* , */ ||\n c === 0x5B/* [ */ ||\n c === 0x5D/* ] */ ||\n c === 0x7B/* { */ ||\n c === 0x7D/* } */\n}\n\nfunction fromDecimalCode (c: number) {\n return c >= 0x30/* 0 */ && c <= 0x39/* 9 */ ? c - 0x30 : -1\n}\n\nfunction fromHexCode (c: number) {\n if (c >= 0x30/* 0 */ && c <= 0x39/* 9 */) return c - 0x30\n const lc = c | 0x20\n if (lc >= 0x61/* a */ && lc <= 0x66/* f */) return lc - 0x61 + 10\n return -1\n}\n\nfunction escapedHexLen (c: number) {\n if (c === 0x78/* x */) return 2\n if (c === 0x75/* u */) return 4\n if (c === 0x55/* U */) return 8\n return 0\n}\n\nfunction isSimpleEscape (c: number) {\n return c === 0x30/* 0 */ ||\n c === 0x61/* a */ ||\n c === 0x62/* b */ ||\n c === 0x74/* t */ ||\n c === 0x09/* Tab */ ||\n c === 0x6E/* n */ ||\n c === 0x76/* v */ ||\n c === 0x66/* f */ ||\n c === 0x72/* r */ ||\n c === 0x65/* e */ ||\n c === 0x20/* Space */ ||\n c === 0x22/* \" */ ||\n c === 0x2F/* / */ ||\n c === 0x5C/* \\ */ ||\n c === 0x4E/* N */ ||\n c === 0x5F/* _ */ ||\n c === 0x4C/* L */ ||\n c === 0x50/* P */\n}\n\n// Precondition: state.position points at LF or CR.\nfunction consumeLineBreak (state: ParserState) {\n const ch = state.input.charCodeAt(state.position)\n\n if (ch === 0x0A/* LF */) {\n state.position++\n } else {\n state.position++\n if (state.input.charCodeAt(state.position) === 0x0A/* LF */) state.position++\n }\n\n state.line++\n state.lineStart = state.position\n state.lineIndent = 0\n state.firstTabInLine = -1\n}\n\nfunction skipSeparationSpace (state: ParserState, allowComments: boolean) {\n let lineBreaks = 0\n let ch = state.input.charCodeAt(state.position)\n let hasSeparation = state.position === state.lineStart ||\n isWsOrEol(state.input.charCodeAt(state.position - 1))\n\n while (ch !== 0) {\n while (isWhiteSpace(ch)) {\n hasSeparation = true\n if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) {\n state.firstTabInLine = state.position\n }\n ch = state.input.charCodeAt(++state.position)\n }\n\n if (allowComments && hasSeparation && ch === 0x23/* # */) {\n do { ch = state.input.charCodeAt(++state.position) }\n while (!isEol(ch) && ch !== 0)\n }\n\n if (!isEol(ch)) break\n\n consumeLineBreak(state)\n lineBreaks++\n hasSeparation = true\n ch = state.input.charCodeAt(state.position)\n\n while (ch === 0x20/* Space */) {\n state.lineIndent++\n ch = state.input.charCodeAt(++state.position)\n }\n }\n\n return lineBreaks\n}\n\nfunction testDocumentSeparator (state: ParserState, position = state.position) {\n const ch = state.input.charCodeAt(position)\n\n if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&\n ch === state.input.charCodeAt(position + 1) &&\n ch === state.input.charCodeAt(position + 2)) {\n const following = state.input.charCodeAt(position + 3)\n return following === 0 || isWsOrEol(following)\n }\n\n return false\n}\n\nfunction skipUntilLineEnd (state: ParserState) {\n let ch = state.input.charCodeAt(state.position)\n\n while (ch !== 0 && !isEol(ch)) {\n ch = state.input.charCodeAt(++state.position)\n }\n}\n\nfunction checkPrintable (state: ParserState, start: number, end: number) {\n if (PATTERN_NON_PRINTABLE.test(state.input.slice(start, end))) {\n throwError(state, 'the stream contains non-printable characters')\n }\n}\n\nfunction readTagProperty (state: ParserState, props: NodeProperties, inFlow: boolean) {\n if (state.input.charCodeAt(state.position) !== 0x21/* ! */) return false\n if (props.tagStart !== NO_RANGE) throwError(state, 'duplication of a tag property')\n\n const start = state.position\n let isVerbatim = false\n let isNamed = false\n let tagHandle = '!'\n let ch = state.input.charCodeAt(++state.position)\n\n if (ch === 0x3C/* < */) {\n isVerbatim = true\n ch = state.input.charCodeAt(++state.position)\n } else if (ch === 0x21/* ! */) {\n isNamed = true\n tagHandle = '!!'\n ch = state.input.charCodeAt(++state.position)\n }\n\n let suffixStart = state.position\n let tagName\n\n if (isVerbatim) {\n while (ch !== 0 && ch !== 0x3E/* > */) ch = state.input.charCodeAt(++state.position)\n if (ch !== 0x3E/* > */) throwError(state, 'unexpected end of the stream within a verbatim tag')\n tagName = state.input.slice(suffixStart, state.position)\n state.position++\n } else {\n while (ch !== 0 && !isWsOrEol(ch) && !(inFlow && isFlowIndicator(ch))) {\n if (ch === 0x21/* ! */) {\n if (!isNamed) {\n tagHandle = state.input.slice(suffixStart - 1, state.position + 1)\n if (!PATTERN_TAG_HANDLE.test(tagHandle)) throwError(state, 'named tag handle cannot contain such characters')\n isNamed = true\n suffixStart = state.position + 1\n } else {\n throwError(state, 'tag suffix cannot contain exclamation marks')\n }\n }\n\n ch = state.input.charCodeAt(++state.position)\n }\n\n tagName = state.input.slice(suffixStart, state.position)\n if (PATTERN_FLOW_INDICATORS.test(tagName)) throwError(state, 'tag suffix cannot contain flow indicator characters')\n }\n\n if (tagName && !(isVerbatim ? PATTERN_TAG_URI.test(tagName) : PATTERN_TAG_SUFFIX.test(tagName))) {\n throwError(state, `tag name cannot contain such characters: ${tagName}`)\n }\n try {\n decodeURIComponent(tagName)\n } catch {\n throwError(state, `tag name is malformed: ${tagName}`)\n }\n\n if (!isVerbatim && tagHandle !== '!' && tagHandle !== '!!' && !HAS_OWN.call(state.tagHandlers, tagHandle)) {\n throwError(state, `undeclared tag handle \"${tagHandle}\"`)\n }\n\n props.tagStart = start\n props.tagEnd = state.position\n return true\n}\n\nfunction readAnchorProperty (state: ParserState, props: NodeProperties) {\n if (state.input.charCodeAt(state.position) !== 0x26/* & */) return false\n if (props.anchorStart !== NO_RANGE) throwError(state, 'duplication of an anchor property')\n\n state.position++\n const start = state.position\n\n while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position)) && !isFlowIndicator(state.input.charCodeAt(state.position))) {\n state.position++\n }\n\n if (state.position === start) throwError(state, 'name of an anchor node must contain at least one character')\n\n props.anchorStart = start\n props.anchorEnd = state.position\n return true\n}\n\nfunction readAlias (state: ParserState, props: NodeProperties) {\n if (state.input.charCodeAt(state.position) !== 0x2A/* * */) return false\n if (props.anchorStart !== NO_RANGE || props.tagStart !== NO_RANGE) {\n throwError(state, 'alias node should not have any properties')\n }\n\n state.position++\n const start = state.position\n\n while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position)) && !isFlowIndicator(state.input.charCodeAt(state.position))) {\n state.position++\n }\n\n if (state.position === start) throwError(state, 'name of an alias node must contain at least one character')\n\n addAliasEvent(state, start, state.position)\n return true\n}\n\nfunction readFlowScalarBreak (state: ParserState, nodeIndent: number) {\n skipSeparationSpace(state, false)\n\n if (state.lineIndent < nodeIndent) {\n throwError(state, 'deficient indentation')\n }\n}\n\nfunction readSingleQuotedScalar (state: ParserState, nodeIndent: number, props: NodeProperties) {\n if (state.input.charCodeAt(state.position) !== 0x27/* ' */) return false\n\n state.position++\n const start = state.position\n // A single-quoted scalar is sliceable verbatim when it has no '' escape pairs\n // and no folded line breaks (see getScalarValue fast path).\n let simple = true\n\n while (state.input.charCodeAt(state.position) !== 0) {\n const ch = state.input.charCodeAt(state.position)\n\n if (ch === 0x27/* ' */) {\n if (state.input.charCodeAt(state.position + 1) === 0x27/* ' */) {\n simple = false\n state.position += 2\n continue\n }\n\n const end = state.position\n state.position++\n addScalarEvent(state, start, end, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, SCALAR_STYLE.SINGLE_QUOTED, CHOMPING_MODE.CLIP, -1, simple)\n return true\n }\n\n if (isEol(ch)) {\n simple = false\n readFlowScalarBreak(state, nodeIndent)\n } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n throwError(state, 'unexpected end of the document within a single quoted scalar')\n } else if (ch !== 0x09/* Tab */ && ch < 0x20) {\n throwError(state, 'expected valid JSON character')\n } else {\n state.position++\n }\n }\n\n throwError(state, 'unexpected end of the stream within a single quoted scalar')\n}\n\nfunction readDoubleQuotedScalar (state: ParserState, nodeIndent: number, props: NodeProperties) {\n if (state.input.charCodeAt(state.position) !== 0x22/* \" */) return false\n\n state.position++\n const start = state.position\n // A double-quoted scalar is sliceable verbatim when it has no \\ escapes and\n // no folded line breaks (see getScalarValue fast path).\n let simple = true\n\n while (state.input.charCodeAt(state.position) !== 0) {\n const ch = state.input.charCodeAt(state.position)\n\n if (ch === 0x22/* \" */) {\n const end = state.position\n state.position++\n addScalarEvent(state, start, end, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, SCALAR_STYLE.DOUBLE_QUOTED, CHOMPING_MODE.CLIP, -1, simple)\n return true\n }\n\n if (ch === 0x5C/* \\ */) {\n simple = false\n const escaped = state.input.charCodeAt(++state.position)\n\n if (isEol(escaped)) {\n readFlowScalarBreak(state, nodeIndent)\n } else if (isSimpleEscape(escaped)) {\n state.position++\n } else {\n let hexLength = escapedHexLen(escaped)\n\n if (hexLength === 0) throwError(state, 'unknown escape sequence')\n\n while (hexLength-- > 0) {\n state.position++\n if (fromHexCode(state.input.charCodeAt(state.position)) < 0) {\n throwError(state, 'expected hexadecimal character')\n }\n }\n state.position++\n }\n } else if (isEol(ch)) {\n simple = false\n readFlowScalarBreak(state, nodeIndent)\n } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n throwError(state, 'unexpected end of the document within a double quoted scalar')\n } else if (ch !== 0x09/* Tab */ && ch < 0x20) {\n throwError(state, 'expected valid JSON character')\n } else {\n state.position++\n }\n }\n\n throwError(state, 'unexpected end of the stream within a double quoted scalar')\n}\n\nfunction readBlockScalar (state: ParserState, parentIndent: number, props: NodeProperties) {\n const ch = state.input.charCodeAt(state.position)\n let chomping: ChompingMode = CHOMPING_MODE.CLIP\n let indent = -1\n let detectedIndent = false\n\n if (ch !== 0x7C/* | */ && ch !== 0x3E/* > */) return false\n\n const style = ch === 0x7C/* | */ ? SCALAR_STYLE.LITERAL_BLOCK : SCALAR_STYLE.FOLDED_BLOCK\n state.position++\n\n while (state.input.charCodeAt(state.position) !== 0) {\n const current = state.input.charCodeAt(state.position)\n const digit = fromDecimalCode(current)\n\n if (current === 0x2B/* + */ || current === 0x2D/* - */) {\n if (chomping !== CHOMPING_MODE.CLIP) throwError(state, 'repeat of a chomping mode identifier')\n chomping = current === 0x2B/* + */ ? CHOMPING_MODE.KEEP : CHOMPING_MODE.STRIP\n state.position++\n } else if (digit >= 0) {\n if (digit === 0) {\n throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one')\n }\n if (detectedIndent) throwError(state, 'repeat of an indentation width identifier')\n indent = parentIndent + digit - 1\n detectedIndent = true\n state.position++\n } else {\n break\n }\n }\n\n let hadWhitespace = false\n while (isWhiteSpace(state.input.charCodeAt(state.position))) {\n hadWhitespace = true\n state.position++\n }\n if (hadWhitespace && state.input.charCodeAt(state.position) === 0x23/* # */) skipUntilLineEnd(state)\n\n if (isEol(state.input.charCodeAt(state.position))) {\n consumeLineBreak(state)\n } else if (state.input.charCodeAt(state.position) !== 0) {\n throwError(state, 'a line break is expected')\n }\n\n let contentIndent = detectedIndent ? indent : -1\n let maxLeadingIndent = 0\n const valueStart = state.position\n let valueEnd = state.position\n\n while (state.input.charCodeAt(state.position) !== 0) {\n const linePosition = state.position\n let column = 0\n\n while (state.input.charCodeAt(linePosition + column) === 0x20/* Space */) column++\n\n const first = state.input.charCodeAt(linePosition + column)\n if (first === 0) {\n // End of input acts as a line terminator, but there is no line break to\n // include here. A final all-spaces line still counts: when the block has a\n // content indent, the spaces beyond it are real content; in a wholly blank\n // block (contentIndent < 0) the spaces form a blank line that chomping must\n // see, exactly as it would if the line ended with a break. Capture the line\n // in both cases; otherwise the block ends at the start of this empty line.\n if (contentIndent >= 0) {\n if (column > contentIndent) valueEnd = linePosition + column\n } else if (column > 0) {\n valueEnd = linePosition + column\n }\n break\n }\n if (linePosition === state.lineStart && testDocumentSeparator(state, linePosition)) break\n\n if (!detectedIndent && contentIndent === -1 && isEol(first)) {\n maxLeadingIndent = Math.max(maxLeadingIndent, column)\n }\n\n if (!detectedIndent && contentIndent === -1 && !isEol(first)) {\n if (first === 0x09/* Tab */ && column < parentIndent) {\n state.position = linePosition + column\n throwError(state, 'tab characters must not be used in indentation')\n }\n if (column < maxLeadingIndent) {\n state.position = linePosition + column\n throwError(state, 'bad indentation of a mapping entry')\n }\n }\n\n if (contentIndent === -1 && first !== 0 && !isEol(first) && column < parentIndent) {\n state.lineIndent = column\n state.position = linePosition + column\n break\n }\n\n if (!detectedIndent && first !== 0 && !isEol(first) && contentIndent === -1) {\n contentIndent = column\n }\n\n const requiredIndent = contentIndent === -1 ? parentIndent + 1 : contentIndent\n if (first !== 0 && !isEol(first) && column < requiredIndent) {\n state.lineIndent = column\n state.position = linePosition + column\n break\n }\n\n skipUntilLineEnd(state)\n valueEnd = state.position\n if (isEol(state.input.charCodeAt(state.position))) {\n consumeLineBreak(state)\n // Include the line break in the range so trailing blank lines are\n // preserved. This is what lets cook tell apart an empty `|+` (range \"\",\n // value \"\") from a `|+` with one blank line (range \"\\n\", value \"\\n\").\n // De-indent and chomping are applied later in getScalarValue.\n valueEnd = state.position\n }\n }\n\n checkPrintable(state, valueStart, valueEnd)\n addScalarEvent(\n state,\n valueStart,\n valueEnd,\n props.anchorStart,\n props.anchorEnd,\n props.tagStart,\n props.tagEnd,\n style,\n chomping,\n contentIndent\n )\n return true\n}\n\nfunction canStartPlainScalar (state: ParserState, nodeContext: NodeContext) {\n const ch = state.input.charCodeAt(state.position)\n const inFlow = nodeContext === CONTEXT_FLOW_IN\n\n if (ch === 0 ||\n isWsOrEol(ch) ||\n ch === 0x23/* # */ ||\n ch === 0x26/* & */ ||\n ch === 0x2A/* * */ ||\n ch === 0x21/* ! */ ||\n ch === 0x7C/* | */ ||\n ch === 0x3E/* > */ ||\n ch === 0x27/* ' */ ||\n ch === 0x22/* \" */ ||\n ch === 0x25/* % */ ||\n ch === 0x40/* @ */ ||\n ch === 0x60/* ` */ ||\n (inFlow && isFlowIndicator(ch))) {\n return false\n }\n\n if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {\n const following = state.input.charCodeAt(state.position + 1)\n if (isWsOrEolOrEnd(following) || (inFlow && isFlowIndicator(following))) return false\n }\n\n return true\n}\n\nfunction readPlainScalar (state: ParserState, nodeIndent: number, nodeContext: NodeContext, props: NodeProperties) {\n if (!canStartPlainScalar(state, nodeContext)) return false\n\n const start = state.position\n let end = state.position\n let ch = state.input.charCodeAt(state.position)\n const inFlow = nodeContext === CONTEXT_FLOW_IN\n // A single-line plain scalar is sliceable verbatim: the parser already trims\n // trailing whitespace from the range, so no folding is needed (see\n // getScalarValue fast path). Folded line breaks make it non-simple.\n let multiline = false\n\n while (ch !== 0) {\n if (state.position === state.lineStart && testDocumentSeparator(state)) break\n\n if (ch === 0x3A/* : */) {\n const following = state.input.charCodeAt(state.position + 1)\n if (isWsOrEolOrEnd(following) || (inFlow && isFlowIndicator(following))) break\n } else if (ch === 0x23/* # */) {\n const preceding = state.input.charCodeAt(state.position - 1)\n if (isWsOrEol(preceding)) break\n } else if (inFlow && isFlowIndicator(ch)) {\n break\n } else if (isEol(ch)) {\n const savedPosition = state.position\n const savedLine = state.line\n const savedLineStart = state.lineStart\n const savedLineIndent = state.lineIndent\n\n skipSeparationSpace(state, false)\n\n if (state.lineIndent >= nodeIndent) {\n multiline = true\n ch = state.input.charCodeAt(state.position)\n continue\n }\n\n state.position = savedPosition\n state.line = savedLine\n state.lineStart = savedLineStart\n state.lineIndent = savedLineIndent\n break\n }\n\n if (!isWhiteSpace(ch)) end = state.position + 1\n ch = state.input.charCodeAt(++state.position)\n }\n\n if (end === start) return false\n\n checkPrintable(state, start, end)\n addScalarEvent(state, start, end, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, SCALAR_STYLE.PLAIN, CHOMPING_MODE.CLIP, -1, !multiline)\n return true\n}\n\nfunction findBlockMappingColon (state: ParserState) {\n let position = state.position\n let flowLevel = 0\n\n while (position < state.length) {\n const ch = state.input.charCodeAt(position)\n\n if (isEol(ch)) return -1\n if (ch === 0x23/* # */ && isWsOrEol(state.input.charCodeAt(position - 1))) return -1\n\n if ((ch === 0x2A/* * */ || ch === 0x26/* & */) && position === state.position) {\n do { position++ }\n while (state.input.charCodeAt(position) !== 0 &&\n !isWsOrEol(state.input.charCodeAt(position)) &&\n !isFlowIndicator(state.input.charCodeAt(position)))\n continue\n }\n\n if (ch === 0x5B/* [ */ || ch === 0x7B/* { */) {\n flowLevel++\n } else if (ch === 0x5D/* ] */ || ch === 0x7D/* } */) {\n if (flowLevel > 0) flowLevel--\n } else if (flowLevel === 0 && ch === 0x3A/* : */ && isWsOrEol(state.input.charCodeAt(position + 1))) {\n return position\n }\n\n if ((flowLevel > 0 || position === state.position) &&\n (ch === 0x27/* ' */ || ch === 0x22/* \" */)) {\n const quote = ch\n position++\n\n while (position < state.length && state.input.charCodeAt(position) !== quote) {\n if (state.input.charCodeAt(position) === 0x5C/* \\ */ && quote === 0x22/* \" */) position++\n position++\n }\n }\n\n position++\n }\n\n return -1\n}\n\nfunction skipFlowSeparationSpace (state: ParserState, nodeIndent: number) {\n const startLine = state.line\n skipSeparationSpace(state, true)\n\n if ((state.line > startLine && state.lineIndent < nodeIndent) ||\n (state.firstTabInLine !== -1 && state.lineIndent < nodeIndent)) {\n throwError(state, 'deficient indentation')\n }\n}\n\nfunction readFlowCollection (state: ParserState, nodeIndent: number, props: NodeProperties) {\n const ch = state.input.charCodeAt(state.position)\n const isMapping = ch === 0x7B/* { */\n const start = state.position\n let readNext = true\n\n if (ch !== 0x5B/* [ */ && ch !== 0x7B/* { */) return false\n\n const terminator = isMapping ? 0x7D/* } */ : 0x5D/* ] */\n\n if (isMapping) {\n addMappingEvent(state, start, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, COLLECTION_STYLE.FLOW)\n } else {\n addSequenceEvent(state, start, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, COLLECTION_STYLE.FLOW)\n }\n\n state.position++\n\n while (state.input.charCodeAt(state.position) !== 0) {\n skipFlowSeparationSpace(state, nodeIndent)\n\n let ch = state.input.charCodeAt(state.position)\n\n if (ch === terminator) {\n state.position++\n addPopEvent(state)\n return true\n } else if (!readNext) {\n throwError(state, 'missed comma between flow collection entries')\n } else if (ch === 0x2C/* , */) {\n throwError(state, \"expected the node content, but found ','\")\n }\n\n let isPair = false\n let isExplicitPair = false\n\n if (ch === 0x3F/* ? */ && isWsOrEol(state.input.charCodeAt(state.position + 1))) {\n isPair = isExplicitPair = true\n state.position += 1\n skipFlowSeparationSpace(state, nodeIndent)\n }\n\n const entryLine = state.line\n const entryStart = snapshotState(state)\n\n const keyWasRead = parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)\n skipFlowSeparationSpace(state, nodeIndent)\n\n ch = state.input.charCodeAt(state.position)\n\n if ((isMapping || isExplicitPair || state.line === entryLine) && ch === 0x3A/* : */) {\n isPair = true\n state.position++\n skipFlowSeparationSpace(state, nodeIndent)\n if (!isMapping) {\n insertFlowPairMappingEvent(state, entryStart)\n if (!keyWasRead) addEmptyScalarEvent(state)\n } else if (!keyWasRead) {\n addEmptyScalarEvent(state)\n }\n if (!parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)) {\n addEmptyScalarEvent(state)\n }\n skipFlowSeparationSpace(state, nodeIndent)\n if (!isMapping) addPopEvent(state)\n } else if (isMapping && isPair) {\n if (!keyWasRead) addEmptyScalarEvent(state)\n addEmptyScalarEvent(state)\n } else if (isMapping) {\n addEmptyScalarEvent(state)\n } else if (isPair) {\n insertFlowPairMappingEvent(state, entryStart)\n if (!keyWasRead) addEmptyScalarEvent(state)\n addEmptyScalarEvent(state)\n addPopEvent(state)\n }\n\n ch = state.input.charCodeAt(state.position)\n\n if (ch === 0x2C/* , */) {\n readNext = true\n state.position++\n } else {\n readNext = false\n }\n }\n\n throwError(state, 'unexpected end of the stream within a flow collection')\n}\n\nfunction readBlockSequence (state: ParserState, nodeIndent: number, props: NodeProperties) {\n if (state.firstTabInLine !== -1 || state.input.charCodeAt(state.position) !== 0x2D/* - */ || !isWsOrEolOrEnd(state.input.charCodeAt(state.position + 1))) {\n return false\n }\n\n addSequenceEvent(state, state.position, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, COLLECTION_STYLE.BLOCK)\n\n while (state.input.charCodeAt(state.position) === 0x2D/* - */ && isWsOrEolOrEnd(state.input.charCodeAt(state.position + 1))) {\n if (state.firstTabInLine !== -1) {\n state.position = state.firstTabInLine\n throwError(state, 'tab characters must not be used in indentation')\n }\n\n const entryLine = state.line\n state.position++\n\n const hadBreak = skipSeparationSpace(state, true) > 0\n if (state.firstTabInLine !== -1 &&\n state.input.charCodeAt(state.position) === 0x2D/* - */ &&\n isWsOrEolOrEnd(state.input.charCodeAt(state.position + 1))) {\n throwError(state, 'bad indentation of a sequence entry')\n }\n\n if (hadBreak && state.lineIndent <= nodeIndent) {\n addEmptyScalarEvent(state)\n } else {\n parseNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true)\n }\n\n skipSeparationSpace(state, true)\n\n if (state.lineIndent < nodeIndent || state.position >= state.length) break\n if (state.lineIndent > nodeIndent) throwError(state, 'bad indentation of a sequence entry')\n if (state.line === entryLine &&\n state.input.charCodeAt(state.position) === 0x2D/* - */ &&\n isWsOrEolOrEnd(state.input.charCodeAt(state.position + 1))) {\n throwError(state, 'bad indentation of a sequence entry')\n }\n }\n\n addPopEvent(state)\n return true\n}\n\nfunction readBlockMapping (state: ParserState, nodeIndent: number, flowIndent: number, props: NodeProperties) {\n let atExplicitKey = false\n let detected = false\n let mappingOpened = false\n let pendingExplicitKey = false\n\n if (state.firstTabInLine !== -1) return false\n\n let ch = state.input.charCodeAt(state.position)\n\n while (ch !== 0) {\n if (!atExplicitKey && state.firstTabInLine !== -1) {\n state.position = state.firstTabInLine\n throwError(state, 'tab characters must not be used in indentation')\n }\n\n const following = state.input.charCodeAt(state.position + 1)\n const entryLine = state.line\n\n if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && isWsOrEolOrEnd(following)) {\n if (!mappingOpened) {\n addMappingEvent(state, state.position, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, COLLECTION_STYLE.BLOCK)\n mappingOpened = true\n }\n\n if (ch === 0x3F/* ? */) {\n if (atExplicitKey) addEmptyScalarEvent(state)\n detected = true\n atExplicitKey = true\n } else if (atExplicitKey) {\n atExplicitKey = false\n } else {\n addEmptyScalarEvent(state)\n detected = true\n atExplicitKey = false\n }\n\n state.position += 1\n pendingExplicitKey = true\n } else {\n // An explicit key awaiting its value, followed by an implicit key, means\n // the explicit key's value is empty. Emit it now (append-only) so it is\n // ordered before the implicit key node read just below.\n if (atExplicitKey) {\n addEmptyScalarEvent(state)\n atExplicitKey = false\n }\n\n const beforeKey = snapshotState(state)\n\n if (!parseNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {\n break\n }\n\n if (state.line === entryLine) {\n ch = state.input.charCodeAt(state.position)\n\n while (isWhiteSpace(ch)) {\n ch = state.input.charCodeAt(++state.position)\n }\n\n if (ch === 0x3A/* : */) {\n ch = state.input.charCodeAt(++state.position)\n\n if (!isWsOrEolOrEnd(ch)) {\n throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping')\n }\n\n if (!mappingOpened) {\n restoreState(state, beforeKey)\n addMappingEvent(state, beforeKey.position, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, COLLECTION_STYLE.BLOCK)\n mappingOpened = true\n // The key, the `:` and the space after it were already validated\n // above, before the rollback. Re-reading the same input cannot\n // fail, so just consume it again without error checks.\n parseNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)\n\n ch = state.input.charCodeAt(state.position)\n while (isWhiteSpace(ch)) {\n ch = state.input.charCodeAt(++state.position)\n }\n\n state.position++\n }\n\n detected = true\n atExplicitKey = false\n pendingExplicitKey = false\n } else if (detected) {\n throwError(state, \"expected ':' after a mapping key\")\n } else {\n // Not a mapping. If outer properties are pending, roll back so the\n // caller re-reads this node with them attached (events are append-only).\n if (props.anchorStart !== NO_RANGE || props.tagStart !== NO_RANGE) {\n restoreState(state, beforeKey)\n return false\n }\n return true\n }\n } else if (detected) {\n throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key')\n } else {\n if (props.anchorStart !== NO_RANGE || props.tagStart !== NO_RANGE) {\n restoreState(state, beforeKey)\n return false\n }\n return true\n }\n }\n\n if (parseNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, pendingExplicitKey)) {\n pendingExplicitKey = false\n }\n\n if (!atExplicitKey) {\n if (pendingExplicitKey) {\n addEmptyScalarEvent(state)\n pendingExplicitKey = false\n }\n }\n\n skipSeparationSpace(state, true)\n ch = state.input.charCodeAt(state.position)\n\n if ((state.line === entryLine || state.lineIndent > nodeIndent) && ch !== 0) {\n throwError(state, 'bad indentation of a mapping entry')\n } else if (state.lineIndent < nodeIndent) {\n break\n }\n }\n\n if (!detected) return false\n if (atExplicitKey) addEmptyScalarEvent(state)\n if (mappingOpened) addPopEvent(state)\n return true\n}\n\nfunction parseNode (\n state: ParserState,\n parentIndent: number,\n nodeContext: NodeContext,\n allowToSeek: boolean,\n allowCompact: boolean,\n allowPropertyMapping = true\n): boolean {\n if (state.depth >= state.maxDepth) {\n throwError(state, `nesting exceeded maxDepth (${state.maxDepth})`)\n }\n\n state.depth++\n\n let indentStatus = 1\n let atNewLine = false\n let hasContent = false\n let propertyStart: ParserSnapshot | null = null\n const props = emptyProperties()\n\n let allowBlockScalars = nodeContext === CONTEXT_BLOCK_OUT || nodeContext === CONTEXT_BLOCK_IN\n let allowBlockCollections = allowBlockScalars\n const allowBlockStyles = allowBlockScalars\n\n if (allowToSeek && skipSeparationSpace(state, true)) {\n atNewLine = true\n\n if (state.lineIndent > parentIndent) {\n indentStatus = 1\n } else if (state.lineIndent === parentIndent) {\n indentStatus = 0\n } else {\n indentStatus = -1\n }\n }\n\n if (indentStatus === 1) {\n while (true) {\n const ch = state.input.charCodeAt(state.position)\n const propertyState = snapshotState(state)\n\n if (atNewLine &&\n indentStatus !== 1 &&\n (ch === 0x21/* ! */ || ch === 0x26/* & */)) {\n break\n }\n\n if (atNewLine &&\n allowBlockStyles &&\n (props.tagStart !== NO_RANGE || props.anchorStart !== NO_RANGE) &&\n (ch === 0x21/* ! */ || ch === 0x26/* & */)) {\n const fallbackState = snapshotState(state)\n const flowIndent = parentIndent + 1\n const mappingIndent = state.position - state.lineStart\n\n if (readBlockMapping(state, mappingIndent, flowIndent, props) &&\n state.events[fallbackState.eventsLength]?.type === EVENT_ID.MAPPING) {\n state.depth--\n return true\n }\n\n restoreState(state, fallbackState)\n }\n\n if (atNewLine &&\n ((ch === 0x21/* ! */ && props.tagStart !== NO_RANGE) ||\n (ch === 0x26/* & */ && props.anchorStart !== NO_RANGE))) {\n break\n }\n\n if (!readTagProperty(state, props, nodeContext === CONTEXT_FLOW_IN) && !readAnchorProperty(state, props)) {\n break\n }\n\n if (propertyStart === null) propertyStart = propertyState\n\n if (skipSeparationSpace(state, true)) {\n atNewLine = true\n allowBlockCollections = allowBlockStyles\n\n if (state.lineIndent > parentIndent) {\n indentStatus = 1\n } else if (state.lineIndent === parentIndent) {\n indentStatus = 0\n } else {\n indentStatus = -1\n }\n } else {\n allowBlockCollections = false\n }\n }\n }\n\n if (allowBlockCollections) {\n allowBlockCollections = atNewLine || allowCompact\n }\n\n if (indentStatus === 1 || nodeContext === CONTEXT_BLOCK_OUT) {\n const flowIndent = nodeContext === CONTEXT_FLOW_IN || nodeContext === CONTEXT_FLOW_OUT\n ? parentIndent\n : parentIndent + 1\n const blockIndent = state.position - state.lineStart\n\n if (indentStatus === 1) {\n if ((allowBlockCollections &&\n (readBlockSequence(state, blockIndent, props) ||\n readBlockMapping(state, blockIndent, flowIndent, props))) ||\n readFlowCollection(state, flowIndent, props)) {\n hasContent = true\n } else {\n const ch = state.input.charCodeAt(state.position)\n\n if (propertyStart !== null && allowPropertyMapping && allowBlockStyles && !allowBlockCollections &&\n ch !== 0x7C/* | */ && ch !== 0x3E/* > */) {\n const fallbackState = snapshotState(state)\n const propertyIndent = propertyStart.position - propertyStart.lineStart\n\n restoreState(state, propertyStart)\n\n if (readBlockMapping(state, propertyIndent, flowIndent, emptyProperties()) &&\n state.events[fallbackState.eventsLength]?.type === EVENT_ID.MAPPING) {\n hasContent = true\n } else {\n restoreState(state, fallbackState)\n }\n }\n\n if (!hasContent &&\n ((allowBlockScalars && readBlockScalar(state, flowIndent, props)) ||\n readSingleQuotedScalar(state, flowIndent, props) ||\n readDoubleQuotedScalar(state, flowIndent, props) ||\n readAlias(state, props) ||\n readPlainScalar(state, flowIndent, nodeContext, props))) {\n hasContent = true\n }\n }\n } else if (indentStatus === 0) {\n hasContent = allowBlockCollections && readBlockSequence(state, blockIndent, props)\n }\n }\n\n allowBlockScalars = allowBlockScalars && !hasContent\n\n if (!hasContent && (props.anchorStart !== NO_RANGE || props.tagStart !== NO_RANGE || allowBlockScalars)) {\n addScalarEvent(\n state,\n NO_RANGE,\n NO_RANGE,\n props.anchorStart,\n props.anchorEnd,\n props.tagStart,\n props.tagEnd,\n SCALAR_STYLE.PLAIN\n )\n hasContent = true\n }\n\n state.depth--\n return hasContent || props.anchorStart !== NO_RANGE || props.tagStart !== NO_RANGE\n}\n\nfunction readDirective (state: ParserState) {\n if (state.lineIndent > 0 || state.input.charCodeAt(state.position) !== 0x25/* % */) return false\n\n state.position++\n const nameStart = state.position\n\n while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position))) state.position++\n\n const name = state.input.slice(nameStart, state.position)\n const args: string[] = []\n\n if (name.length === 0) throwError(state, 'directive name must not be less than one character in length')\n\n while (state.input.charCodeAt(state.position) !== 0 && !isEol(state.input.charCodeAt(state.position))) {\n while (isWhiteSpace(state.input.charCodeAt(state.position))) state.position++\n if (state.input.charCodeAt(state.position) === 0x23/* # */ || isEol(state.input.charCodeAt(state.position)) || state.input.charCodeAt(state.position) === 0) break\n\n const start = state.position\n while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position))) state.position++\n args.push(state.input.slice(start, state.position))\n }\n\n if (isEol(state.input.charCodeAt(state.position))) consumeLineBreak(state)\n\n if (name === 'YAML') {\n if (state.directives.some(directive => directive.kind === 'yaml')) throwError(state, 'duplication of %YAML directive')\n if (args.length !== 1) throwError(state, 'YAML directive accepts exactly one argument')\n\n const match = /^([0-9]+)\\.([0-9]+)$/.exec(args[0])\n if (match === null) throwError(state, 'ill-formed argument of the YAML directive')\n if (parseInt(match[1], 10) !== 1) throwError(state, 'unacceptable YAML version of the document')\n\n state.directives.push({ kind: 'yaml', version: args[0] })\n } else if (name === 'TAG') {\n if (args.length !== 2) throwError(state, 'TAG directive accepts exactly two arguments')\n\n const [handle, prefix] = args\n if (!PATTERN_TAG_HANDLE.test(handle)) throwError(state, 'ill-formed tag handle (first argument) of the TAG directive')\n if (HAS_OWN.call(state.tagHandlers, handle)) throwError(state, `there is a previously declared suffix for \"${handle}\" tag handle`)\n if (!PATTERN_TAG_PREFIX.test(prefix)) throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive')\n try {\n decodeURIComponent(prefix)\n } catch {\n throwError(state, `tag prefix is malformed: ${prefix}`)\n }\n\n state.tagHandlers[handle] = prefix\n state.directives.push({ kind: 'tag', handle, prefix })\n }\n\n return true\n}\n\nfunction readDocument (state: ParserState) {\n state.directives = []\n state.tagHandlers = Object.create(null)\n let hasDirectives = false\n\n skipSeparationSpace(state, true)\n\n while (readDirective(state)) {\n hasDirectives = true\n skipSeparationSpace(state, true)\n }\n\n let explicitStart = false\n let explicitEnd = false\n let allowCompact = true\n\n if (state.lineIndent === 0 &&\n state.input.charCodeAt(state.position) === 0x2D/* - */ &&\n state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&\n state.input.charCodeAt(state.position + 2) === 0x2D/* - */ &&\n isWsOrEolOrEnd(state.input.charCodeAt(state.position + 3))) {\n explicitStart = true\n const markerLine = state.line\n state.position += 3\n skipSeparationSpace(state, true)\n allowCompact = state.line > markerLine\n } else if (hasDirectives) {\n throwError(state, 'directives end mark is expected')\n }\n\n const documentEventIndex = state.events.length\n if (!explicitStart &&\n state.position === state.lineStart &&\n state.input.charCodeAt(state.position) === 0x2E/* . */ &&\n testDocumentSeparator(state)) {\n state.position += 3\n skipSeparationSpace(state, true)\n return\n }\n\n addDocumentEvent(state, explicitStart, false)\n if (!parseNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, allowCompact, allowCompact)) {\n addEmptyScalarEvent(state)\n }\n skipSeparationSpace(state, true)\n\n if (state.position === state.lineStart && testDocumentSeparator(state)) {\n explicitEnd = state.input.charCodeAt(state.position) === 0x2E/* . */\n if (explicitEnd) {\n const markerLine = state.line\n state.position += 3\n skipSeparationSpace(state, true)\n if (state.line === markerLine && state.position < state.length) {\n throwError(state, 'end of the stream or a document separator is expected')\n }\n }\n }\n\n const documentEvent = state.events[documentEventIndex]\n if (documentEvent?.type === EVENT_ID.DOCUMENT) documentEvent.explicitEnd = explicitEnd\n\n addPopEvent(state)\n\n if (!explicitEnd &&\n state.position < state.length &&\n !(state.position === state.lineStart && testDocumentSeparator(state))) {\n throwError(state, 'end of the stream or a document separator is expected')\n }\n}\n\n/**\n * Parses YAML into a flat event stream referencing source text by offsets.\n *\n * @category Events\n */\nfunction parseEvents (input: string, options: ParserOptions): Event[] {\n const length = input.length\n const state: ParserState = {\n ...DEFAULT_PARSER_OPTIONS,\n ...options,\n input: `${input}\\0`,\n length,\n position: 0,\n line: 0,\n lineStart: 0,\n lineIndent: 0,\n firstTabInLine: -1,\n depth: 0,\n directives: [],\n tagHandlers: Object.create(null),\n events: []\n }\n\n const nullpos = input.indexOf('\\0')\n if (nullpos !== -1) YAMLException.throwAt(input, nullpos, 'null byte is not allowed in input', state.filename)\n\n if (state.input.charCodeAt(state.position) === 0xFEFF) state.position++\n\n while (state.position < state.length) {\n skipSeparationSpace(state, true)\n if (state.position >= state.length) break\n const documentStart = state.position\n readDocument(state)\n if (state.position === documentStart) {\n // Internal progress guard: if readDocument() ever returns without\n // consuming input, stop here instead of looping forever.\n /* c8 ignore next */\n throwError(state, 'can not read a document')\n }\n }\n\n return state.events\n}\n\nexport {\n parseEvents,\n DEFAULT_PARSER_OPTIONS,\n type ParserOptions\n}\n","import { YAMLException } from './common/exception.ts'\nimport { pick } from './common/object.ts'\nimport {\n constructFromEvents,\n DEFAULT_CONSTRUCTOR_OPTIONS,\n type ConstructorOptions\n} from './parser/constructor.ts'\nimport {\n parseEvents,\n DEFAULT_PARSER_OPTIONS,\n type ParserOptions\n} from './parser/parser.ts'\n\n// `source` is supplied by `loadDocuments` itself, not by the public caller.\n/** @category Main */\ninterface LoadOptions extends ParserOptions, Omit<ConstructorOptions, 'source'> {}\n\n/** @inline */\ntype LoadAllIterator = (document: unknown) => void\n\nconst DEFAULT_LOAD_OPTIONS: Required<LoadOptions> = {\n ...DEFAULT_PARSER_OPTIONS,\n ...DEFAULT_CONSTRUCTOR_OPTIONS\n}\n\nfunction loadDocuments (input: string, options: LoadOptions = {}) {\n const opts = { ...DEFAULT_LOAD_OPTIONS, ...options }\n const source = String(input)\n\n const PARSER_OPT_KEYS = Object.keys(DEFAULT_PARSER_OPTIONS) as\n (keyof typeof DEFAULT_PARSER_OPTIONS)[]\n const CONSTRUCTOR_OPT_KEYS = Object.keys(DEFAULT_CONSTRUCTOR_OPTIONS) as\n (keyof typeof DEFAULT_CONSTRUCTOR_OPTIONS)[]\n\n const events = parseEvents(source, pick(opts, PARSER_OPT_KEYS))\n return constructFromEvents(events, { ...pick(opts, CONSTRUCTOR_OPT_KEYS), source })\n}\n\n/**\n * Same as {@link load}, but understands multi-document sources.\n * Returns an array of documents.\n *\n * @category Main\n */\nfunction loadAll (input: string, options?: LoadOptions): unknown[]\n\n/**\n * @deprecated Iterator is not supported.\n */\nfunction loadAll (input: string, iterator: null, options?: LoadOptions): unknown[]\n\n/**\n * @deprecated Iterator is not supported.\n */\nfunction loadAll (input: string, iterator: LoadAllIterator, options?: LoadOptions): void\nfunction loadAll (\n input: string,\n iteratorOrOptions?: LoadAllIterator | LoadOptions | null,\n options?: LoadOptions\n) {\n let iterator: LoadAllIterator | null = null\n\n if (typeof iteratorOrOptions === 'function') {\n iterator = iteratorOrOptions\n } else if (iteratorOrOptions !== null && typeof iteratorOrOptions === 'object') {\n options = iteratorOrOptions\n }\n\n const documents = loadDocuments(input, options)\n\n if (iterator === null) return documents\n for (const document of documents) iterator(document)\n}\n\n/**\n * Parses `string` as a single YAML document. Throws {@link YAMLException} on\n * error. This function does not understand multi-document or empty sources; it\n * throws an exception on those.\n *\n * > [!NOTE]\n * > 1. When processing untrusted input, see the\n * > [security considerations](../docs/safety.md).\n * > 2. All exceptions MUST be caught, not just {@link YAMLException}.\n * > 3. The default {@link CORE_SCHEMA} comes without the `!!merge` tag. You can\n * > easily enable it if needed.\n * > 4. The default {@link mapTag} is `{}`-object based, with known limitations\n * > (see description). For full compatibility use {@link realMapTag}\n * > instead (it uses native JS `Map`).\n *\n * @example\n * Enable {@link mergeTag} and {@link realMapTag}:\n *\n * ```javascript\n * import { load, CORE_SCHEMA, mergeTag, realMapTag } from 'js-yaml'\n *\n * try {\n * load(data, { schema: CORE_SCHEMA.withTags(mergeTag, realMapTag) })\n * } catch (e) {\n * console.error(e)\n * }\n * ```\n *\n * @category Main\n */\nfunction load (input: string, options?: LoadOptions) {\n const documents = loadDocuments(input, options)\n\n if (documents.length === 0) throw new YAMLException('expected a document, but the input is empty')\n if (documents.length === 1) return documents[0]\n\n throw new YAMLException('expected a single document in the stream, but found more')\n}\n\nexport {\n load,\n loadAll,\n type LoadOptions\n}\n","// Plain-object discriminated union shared by the dumper (built by `jsToAst`,\n// rendered by the presenter) and, later, by load. Behaviour lives in the walkers,\n// not on the nodes.\n\nimport { type DocumentDirective } from '../parser/events.ts'\n\n/**\n * Style bitfields, defined as a class only to initialize their defaults.\n *\n * Manually assigned styles are hints; the presenter may use a fallback when\n * needed to produce valid YAML.\n *\n * @category Nodes\n */\nclass Style {\n /** Whether to print the node's tag explicitly. */\n tagged = false\n flow = false\n singleQuoted = false\n doubleQuoted = false\n literal = false\n folded = false\n}\n\n/** @category Nodes */\ninterface NodeBase {\n /**\n * YAML tag. Untagged nodes carry the semantic resolved tag; tagged nodes carry\n * the printable/verbatim tag spelling.\n */\n tag: string\n style: Style\n anchor?: string\n\n /** Reserved for the formatting layer; not populated by the dumper yet. */\n commentBefore?: string\n comment?: string\n commentAfter?: string\n blankBefore?: number\n}\n\n/** @category Nodes */\ninterface ScalarNode extends NodeBase {\n kind: 'scalar'\n value: string\n}\n\n/** @category Nodes */\ninterface SequenceNode extends NodeBase {\n kind: 'sequence'\n items: Node[]\n}\n\n/** @category Nodes */\ninterface MappingNode extends NodeBase {\n kind: 'mapping'\n items: Array<{ key: Node, value: Node }>\n}\n\n/** @category Nodes */\ninterface AliasNode extends NodeBase {\n kind: 'alias'\n /** The anchor name this alias points at (`*name`). */\n anchor: string\n}\n\n/** @category Nodes */\ntype Node = ScalarNode | SequenceNode | MappingNode | AliasNode\n\n/**\n * The layer above {@link Node}: each document wraps one content node plus its\n * own markers/directives. Not a member of {@link Node} — the fields differ.\n * Document directives are ordered presentation data.\n *\n * @category Nodes\n */\ninterface Document {\n /** null = empty document */\n contents: Node | null\n\n /** print '---' */\n explicitStart?: boolean\n\n /** print '...' */\n explicitEnd?: boolean\n\n directives: DocumentDirective[]\n}\n\nexport {\n Style,\n\n type Node,\n type Document,\n type NodeBase,\n type ScalarNode,\n type SequenceNode,\n type MappingNode,\n type AliasNode\n}\n","// JS value graph → AST. Knows tags (`identify` / `represent`). A single\n// identity-`Map` walk handles dedup: a repeat occurrence of an object (including\n// a cycle) becomes an `alias`, and the first occurrence gets an `anchor`.\n\nimport { YAMLException } from '../common/exception.ts'\nimport { type Schema } from '../schema.ts'\nimport { type TagDefinition } from '../tag.ts'\nimport { tagNameShort } from '../common/tagname.ts'\nimport {\n Style,\n type Document,\n type Node,\n type ScalarNode,\n type SequenceNode,\n type MappingNode\n} from './nodes.ts'\n\n/** @category AST */\ninterface FromJsOptions {\n /** Inlines duplicate objects instead of converting them into references. */\n noRefs?: boolean\n\n /**\n * Skips unrepresentable values instead of throwing. Invalid mapping pairs\n * and sequence items are skipped; `undefined` sequence items become `null`.\n */\n skipInvalid?: boolean\n}\n\n// A match candidate. `implicitTag` means the tag is not printed (implicit\n// scalars and the default str/seq/map tags).\ninterface RepresentType {\n tag: TagDefinition\n implicitTag: boolean\n}\n\n// Returned by `build` when no tag matched.\nconst INVALID = Symbol('INVALID')\n\ninterface FromJsState {\n representTypes: RepresentType[]\n noRefs: boolean\n skipInvalid: boolean\n\n // Already-built collection values → their node, for anchor/alias dedup.\n refs: Map<unknown, Node>\n refCounter: number\n}\n\nfunction buildRepresentTypes (schema: Schema): RepresentType[] {\n const defaultTags = new Set<TagDefinition>([\n schema.defaultScalarTag,\n schema.defaultSequenceTag,\n schema.defaultMappingTag\n ].filter((t): t is TagDefinition => t !== undefined))\n\n // Default container/str tags go last so a more specific tag identifying the\n // same JS value (e.g. a custom tag on a plain object) wins.\n const implicitScalars = schema.implicitScalarTags\n const explicitTags = schema.tags.filter(t =>\n !(t.nodeKind === 'scalar' && t.implicit) && !defaultTags.has(t))\n const defaultTagsLast = schema.tags.filter(t => defaultTags.has(t))\n\n return [\n ...implicitScalars.map(tag => ({ tag, implicitTag: true })),\n ...explicitTags.map(tag => ({ tag, implicitTag: false })),\n ...defaultTagsLast.map(tag => ({ tag, implicitTag: true }))\n ]\n}\n\n// First tag whose `identify` accepts `object`.\nfunction matchTag (state: FromJsState, object: unknown): { tag: TagDefinition, tagName: string, implicitTag: boolean } | null {\n for (let index = 0, length = state.representTypes.length; index < length; index += 1) {\n const { tag, implicitTag } = state.representTypes[index]\n\n if (tag.identify(object)) {\n let tagName: string\n if (tag.matchByTagPrefix) {\n tagName = tag.representTagName(object)\n } else {\n tagName = tag.tagName\n }\n return { tag, tagName, implicitTag }\n }\n }\n\n return null\n}\n\n// Build a node for `object`, or INVALID when no tag matches. `undefined` never\n// throws (caller decides: null in a sequence, skip in a mapping, '' at root);\n// any other unrepresentable value throws unless `skipInvalid`.\nfunction build (state: FromJsState, object: unknown): Node | typeof INVALID {\n if (!state.noRefs && object !== null && typeof object === 'object') {\n const existing = state.refs.get(object)\n if (existing) {\n if (existing.anchor === undefined) existing.anchor = `ref_${state.refCounter++}`\n return { kind: 'alias', tag: '', style: new Style(), anchor: existing.anchor }\n }\n }\n\n const matched = matchTag(state, object)\n\n if (!matched) {\n if (object === undefined) return INVALID\n if (state.skipInvalid) return INVALID\n throw new YAMLException(`unacceptable kind of an object to dump ${Object.prototype.toString.call(object)}`)\n }\n\n const { tag, tagName, implicitTag } = matched\n const nodeTagName = implicitTag ? tagName : tagNameShort(tagName)\n\n if (tag.nodeKind === 'scalar') {\n const style = new Style()\n style.tagged = !implicitTag\n const node: ScalarNode = {\n kind: 'scalar',\n tag: nodeTagName,\n style,\n value: tag.represent(object)\n }\n return node\n }\n\n if (tag.nodeKind === 'sequence') {\n const container = tag.represent(object)\n const style = new Style()\n style.tagged = !implicitTag\n const node: SequenceNode = { kind: 'sequence', tag: nodeTagName, style, items: [] }\n if (!state.noRefs) state.refs.set(object, node)\n\n for (let index = 0, length = container.length; index < length; index += 1) {\n let item = build(state, container[index])\n // An invalid element becomes null; a still-invalid null then skips/throws.\n if (item === INVALID && container[index] === undefined) item = build(state, null)\n if (item === INVALID) continue\n node.items.push(item)\n }\n return node\n }\n\n // mapping — the canonical form is always a `Map`.\n const map = tag.represent(object)\n const style = new Style()\n style.tagged = !implicitTag\n const node: MappingNode = { kind: 'mapping', tag: nodeTagName, style, items: [] }\n if (!state.noRefs) state.refs.set(object, node)\n\n for (const [objectKey, objectValue] of map) {\n const key = build(state, objectKey)\n if (key === INVALID) continue // invalid key skips the pair\n const value = build(state, objectValue)\n if (value === INVALID) continue // invalid value skips the pair\n node.items.push({ key, value })\n }\n return node\n}\n\n/**\n * Convert JS object to AST. A JS value is one YAML document. An unrepresentable\n * root becomes an empty document, which the presenter renders as an empty\n * string.\n *\n * @category AST\n */\nfunction jsToAst (input: unknown, schema: Schema, options: FromJsOptions = {}): Document[] {\n const state: FromJsState = {\n representTypes: buildRepresentTypes(schema),\n noRefs: options.noRefs ?? false,\n skipInvalid: options.skipInvalid ?? false,\n refs: new Map(),\n refCounter: 0\n }\n\n const root = build(state, input)\n return [{ contents: root === INVALID ? null : root, directives: [] }]\n}\n\nexport {\n jsToAst,\n type FromJsOptions\n}\n","// Depth-first AST traversal. Mirrors the `kind` walk of the presenter and the\n// `from_*` builders, but stays read-oriented: nodes are plain objects, so a\n// visitor mutates them in place. Control signals let it prune or stop the walk.\n\nimport {\n type Node,\n type Document\n} from './nodes.ts'\n\n// Returned by a visitor to control the walk; anything else (incl. `undefined`)\n// descends as usual.\n/**\n * Return from a visitor to stop the whole traversal.\n *\n * @category AST\n */\nconst VISIT_BREAK = Symbol('visit:break')\n\n/**\n * Return from a visitor to skip the current node's children.\n *\n * @category AST\n */\nconst VISIT_SKIP = Symbol('visit:skip')\n\n/** @inline */\ntype VisitControl = typeof VISIT_BREAK | typeof VISIT_SKIP | undefined | void\n\n/**\n * Traversal-derived position of the current node. Kept off the node itself: a\n * node may sit in several places (alias/dedup reuse), so depth/role belong to\n * the walk, not the node. {@link VisitContext.parent} `kind` +\n * {@link VisitContext.isKey} pin the exact slot.\n *\n * @category AST\n */\ninterface VisitContext {\n /** 0 = document content root */\n depth: number\n\n /** Enclosing sequence/mapping, null at the root */\n parent: Node | null\n\n /** Node sits in a mapping key position */\n isKey: boolean\n}\n\n/** @category AST */\ntype Visitor = (node: Node, ctx: VisitContext) => VisitControl\n\n// Returns `true` once `VISIT_BREAK` was seen, so callers can unwind the walk.\nfunction visitNode (node: Node, visitor: Visitor, ctx: VisitContext): boolean {\n const control = visitor(node, ctx)\n if (control === VISIT_BREAK) return true\n if (control === VISIT_SKIP) return false\n\n const depth = ctx.depth + 1\n\n switch (node.kind) {\n case 'sequence':\n for (const item of node.items) {\n if (visitNode(item, visitor, { depth, parent: node, isKey: false })) return true\n }\n break\n case 'mapping':\n for (const { key, value } of node.items) {\n if (visitNode(key, visitor, { depth, parent: node, isKey: true })) return true\n if (visitNode(value, visitor, { depth, parent: node, isKey: false })) return true\n }\n break\n }\n\n return false\n}\n\n/**\n * Walk every node in the documents, calling {@link Visitor} once per\n * node (pre-order).\n *\n * @category AST\n */\nfunction visit (documents: Document[], visitor: Visitor): void {\n for (const doc of documents) {\n if (doc.contents && visitNode(doc.contents, visitor, { depth: 0, parent: null, isKey: false })) return\n }\n}\n\nexport {\n visit,\n VISIT_BREAK,\n VISIT_SKIP,\n type Visitor,\n type VisitContext\n}\n","// AST → text. Walks the node `kind`; the scalar machinery (style selection,\n// quoting, folding) is driven by node text, not by sniffing a JS value.\n\nimport { YAMLException } from '../common/exception.ts'\nimport { tagNameShort } from '../common/tagname.ts'\nimport { type Schema } from '../schema.ts'\nimport {\n type Node,\n type Document,\n type ScalarNode,\n type SequenceNode,\n type MappingNode\n} from './nodes.ts'\n\nconst CHAR_BOM = 0xFEFF\nconst CHAR_TAB = 0x09 /* Tab */\nconst CHAR_LINE_FEED = 0x0A /* LF */\nconst CHAR_CARRIAGE_RETURN = 0x0D /* CR */\nconst CHAR_SPACE = 0x20 /* Space */\nconst CHAR_EXCLAMATION = 0x21 /* ! */\nconst CHAR_DOUBLE_QUOTE = 0x22 /* \" */\nconst CHAR_SHARP = 0x23 /* # */\nconst CHAR_PERCENT = 0x25 /* % */\nconst CHAR_AMPERSAND = 0x26 /* & */\nconst CHAR_SINGLE_QUOTE = 0x27 /* ' */\nconst CHAR_ASTERISK = 0x2A /* * */\nconst CHAR_COMMA = 0x2C /* , */\nconst CHAR_MINUS = 0x2D /* - */\nconst CHAR_COLON = 0x3A /* : */\nconst CHAR_EQUALS = 0x3D /* = */\nconst CHAR_GREATER_THAN = 0x3E /* > */\nconst CHAR_QUESTION = 0x3F /* ? */\nconst CHAR_COMMERCIAL_AT = 0x40 /* @ */\nconst CHAR_LEFT_SQUARE_BRACKET = 0x5B /* [ */\nconst CHAR_RIGHT_SQUARE_BRACKET = 0x5D /* ] */\nconst CHAR_GRAVE_ACCENT = 0x60 /* ` */\nconst CHAR_LEFT_CURLY_BRACKET = 0x7B /* { */\nconst CHAR_VERTICAL_LINE = 0x7C /* | */\nconst CHAR_RIGHT_CURLY_BRACKET = 0x7D /* } */\n\nconst ESCAPE_SEQUENCES: Record<number, string> = {}\n\nESCAPE_SEQUENCES[0x00] = '\\\\0'\nESCAPE_SEQUENCES[0x07] = '\\\\a'\nESCAPE_SEQUENCES[0x08] = '\\\\b'\nESCAPE_SEQUENCES[0x09] = '\\\\t'\nESCAPE_SEQUENCES[0x0A] = '\\\\n'\nESCAPE_SEQUENCES[0x0B] = '\\\\v'\nESCAPE_SEQUENCES[0x0C] = '\\\\f'\nESCAPE_SEQUENCES[0x0D] = '\\\\r'\nESCAPE_SEQUENCES[0x1B] = '\\\\e'\nESCAPE_SEQUENCES[0x22] = '\\\\\"'\nESCAPE_SEQUENCES[0x5C] = '\\\\\\\\'\nESCAPE_SEQUENCES[0x85] = '\\\\N'\nESCAPE_SEQUENCES[0xA0] = '\\\\_'\nESCAPE_SEQUENCES[0x2028] = '\\\\L'\nESCAPE_SEQUENCES[0x2029] = '\\\\P'\n\n/** @category AST */\ninterface PresenterOptions {\n /** Schema used when selecting a safe scalar style. */\n schema: Schema\n\n /**\n * Indentation width in spaces.\n *\n * @defaultValue `2`\n */\n indent?: number\n\n /**\n * Does not add an indentation level to array elements when enabled.\n *\n * @defaultValue `false`\n */\n seqNoIndent?: boolean\n\n /**\n * Allows a nested collection to start on the same line after `-`.\n *\n * @defaultValue `true`\n */\n seqInlineFirst?: boolean\n\n /**\n * Sorts mapping keys when `true`. A function can be provided to define the\n * sort order.\n *\n * @defaultValue `false`\n */\n sortKeys?: boolean | ((a: any, b: any) => number)\n\n /**\n * Maximum line width. Set to `-1` for unlimited width.\n *\n * @defaultValue `80`\n */\n lineWidth?: number\n\n /**\n * Adds spaces inside flow collection brackets: `{a: 1}` becomes `{ a: 1 }`.\n *\n * @defaultValue `false`\n */\n flowBracketPadding?: boolean\n\n /**\n * Omits the space after commas in flow collections: `[1, 2]` becomes\n * `[1,2]`.\n *\n * @defaultValue `false`\n */\n flowSkipCommaSpace?: boolean\n\n /**\n * Omits the space after `:` in flow mappings: `{a: 1}` becomes `{a:1}`.\n *\n * @defaultValue `false`\n */\n flowSkipColonSpace?: boolean\n\n /**\n * Quotes flow mapping keys: `{a: 1}` becomes `{\"a\": 1}`.\n *\n * @defaultValue `false`\n */\n quoteFlowKeys?: boolean\n\n /**\n * Quoting style to use when a string needs quotes.\n *\n * @defaultValue `'single'`\n */\n quoteStyle?: 'single' | 'double'\n\n /**\n * Quotes all non-key strings using {@link quoteStyle}.\n *\n * @defaultValue `false`\n */\n forceQuotes?: boolean\n\n /**\n * Prints an explicit tag before an anchor: `&ref_0 !!set` becomes\n * `!!set &ref_0`.\n *\n * @defaultValue `false`\n */\n tagBeforeAnchor?: boolean\n}\n\nconst DEFAULT_PRESENTER_OPTIONS: Required<Omit<PresenterOptions, 'schema'>> = {\n indent: 2,\n seqNoIndent: false,\n seqInlineFirst: true,\n sortKeys: false,\n lineWidth: 80,\n flowBracketPadding: false,\n flowSkipCommaSpace: false,\n flowSkipColonSpace: false,\n quoteFlowKeys: false,\n quoteStyle: 'single',\n forceQuotes: false,\n tagBeforeAnchor: false\n}\n\ninterface PresenterState extends Required<PresenterOptions> {\n defaultScalarTagName: string\n}\n\nfunction nodeTagShort (node: Node) {\n return node.style.tagged ? node.tag : tagNameShort(node.tag)\n}\n\nfunction createPresenterState (options: PresenterOptions): PresenterState {\n const opts = {\n ...DEFAULT_PRESENTER_OPTIONS,\n ...options\n }\n\n return {\n ...opts,\n defaultScalarTagName: opts.schema.defaultScalarTag.tagName\n }\n}\n\nfunction encodeNonPrintable (character: number) {\n // YAML non-printable code points are all in BMP (max FFFF);\n // astral code points are printable and can't come here.\n const string = character.toString(16).toUpperCase()\n const handle = character <= 0xFF ? 'x' : 'u'\n const length = character <= 0xFF ? 2 : 4\n\n return `\\\\${handle}${'0'.repeat(length - string.length)}${string}`\n}\n\n// Indents every line in a string. Empty lines (\\n only) are not indented.\nfunction indentString (string: string, spaces: number) {\n const ind = ' '.repeat(spaces)\n let position = 0\n let result = ''\n const length = string.length\n\n while (position < length) {\n let line\n const next = string.indexOf('\\n', position)\n if (next === -1) {\n line = string.slice(position)\n position = length\n } else {\n line = string.slice(position, next + 1)\n position = next + 1\n }\n\n if (line.length && line !== '\\n') result += ind\n\n result += line\n }\n\n return result\n}\n\nfunction generateNextLine (state: PresenterState, level: number) {\n return `\\n${' '.repeat(state.indent * level)}`\n}\n\n// Indentation/width numbers that govern how a scalar lays out at `level`.\n// Scalar-only: collections compute their own indent via `generateNextLine`.\n// indent - spaces prepended to the scalar's content (block styles)\n// blockIndent - the block indentation indicator digit (`|2` / `>2`); at the\n// document root (level 0) it is one greater than the spaces we\n// actually prepend (reader applies it relative to parent n = -1)\n// lineWidth - fold width at this depth, shrinking monotonically toward\n// min(state.lineWidth, 40) as indentation deepens; -1 = no limit\nfunction scalarLayout (state: PresenterState, level: number) {\n const indent = state.indent * Math.max(1, level) // no 0-indent scalars\n const blockIndent = level === 0 ? state.indent + 1 : state.indent\n const lineWidth = (state.lineWidth === -1)\n ? -1\n : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent)\n\n return { indent, blockIndent, lineWidth }\n}\n\n// [33] s-white ::= s-space | s-tab\nfunction isWhitespace (c: number) {\n return c === CHAR_SPACE || c === CHAR_TAB\n}\n\n// Mirrors parser.testDocumentSeparator(): `---` and `...` are document\n// markers when followed by separation whitespace, a line break, or EOF.\nfunction startsWithDocumentSeparator (string: string) {\n const marker = string.charCodeAt(0)\n\n if ((marker !== CHAR_MINUS && marker !== 0x2E/* . */) ||\n string.charCodeAt(1) !== marker || string.charCodeAt(2) !== marker) return false\n\n if (string.length === 3) return true\n\n const following = string.charCodeAt(3)\n return isWhitespace(following) ||\n following === CHAR_CARRIAGE_RETURN || following === CHAR_LINE_FEED\n}\n\n// Returns true if the character can be printed without escaping.\n// From YAML 1.2: \"any allowed characters known to be non-printable\n// should also be escaped. [However,] This isn’t mandatory\"\n// Derived from nb-char - \\t - #x85 - #xA0 - #x2028 - #x2029.\nfunction isPrintable (c: number) {\n return (c >= 0x00020 && c <= 0x00007E) ||\n ((c >= 0x000A1 && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) ||\n ((c >= 0x0E000 && c <= 0x00FFFD) && c !== CHAR_BOM) ||\n (c >= 0x10000 && c <= 0x10FFFF)\n}\n\n// [34] ns-char ::= nb-char - s-white\n// [27] nb-char ::= c-printable - b-char - c-byte-order-mark\n// [26] b-char ::= b-line-feed | b-carriage-return\n// Including s-white (for some reason, examples doesn't match specs in this aspect)\n// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark\nfunction isNsCharOrWhitespace (c: number) {\n return isPrintable(c) &&\n c !== CHAR_BOM &&\n // - b-char\n c !== CHAR_CARRIAGE_RETURN &&\n c !== CHAR_LINE_FEED\n}\n\n// [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out\n// c = flow-in ⇒ ns-plain-safe-in\n// c = block-key ⇒ ns-plain-safe-out\n// c = flow-key ⇒ ns-plain-safe-in\n// [128] ns-plain-safe-out ::= ns-char\n// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator\n// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” )\n// | ( /* An ns-char preceding */ “#” )\n// | ( “:” /* Followed by an ns-plain-safe(c) */ )\n// `prev` is the previous code point, or -1 when `c` is the first character\n// (no preceding character). -1 is not a valid code point, so it can never\n// collide with a real one and safely disables the prev-dependent cases below.\nfunction isPlainSafe (c: number, prev: number, inblock: boolean) {\n const cIsNsCharOrWhitespace = isNsCharOrWhitespace(c)\n const cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c)\n return (\n (\n // ns-plain-safe\n inblock // c = flow-in\n ? cIsNsCharOrWhitespace\n : cIsNsCharOrWhitespace &&\n // - c-flow-indicator\n c !== CHAR_COMMA &&\n c !== CHAR_LEFT_SQUARE_BRACKET &&\n c !== CHAR_RIGHT_SQUARE_BRACKET &&\n c !== CHAR_LEFT_CURLY_BRACKET &&\n c !== CHAR_RIGHT_CURLY_BRACKET\n ) &&\n // ns-plain-char\n c !== CHAR_SHARP && // false on '#'\n !(prev === CHAR_COLON && !cIsNsChar)\n ) || // false on ': '\n (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) || // change to true on '[^ ]#'\n (prev === CHAR_COLON && cIsNsChar &&\n // outside block context a following c-flow-indicator is not ns-plain-safe\n (inblock ||\n (c !== CHAR_COMMA &&\n c !== CHAR_LEFT_SQUARE_BRACKET &&\n c !== CHAR_RIGHT_SQUARE_BRACKET &&\n c !== CHAR_LEFT_CURLY_BRACKET &&\n c !== CHAR_RIGHT_CURLY_BRACKET))) // change to true on ':[^ ]'\n}\n\n// Simplified test for values allowed as the first character in plain style.\nfunction isPlainSafeFirst (c: number) {\n // Uses a subset of ns-char - c-indicator\n // where ns-char = nb-char - s-white.\n // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part\n return isPrintable(c) &&\n c !== CHAR_BOM &&\n !isWhitespace(c) && // - s-white\n // - (c-indicator ::=\n // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”\n c !== CHAR_MINUS &&\n c !== CHAR_QUESTION &&\n c !== CHAR_COLON &&\n c !== CHAR_COMMA &&\n c !== CHAR_LEFT_SQUARE_BRACKET &&\n c !== CHAR_RIGHT_SQUARE_BRACKET &&\n c !== CHAR_LEFT_CURLY_BRACKET &&\n c !== CHAR_RIGHT_CURLY_BRACKET &&\n // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “\"”\n c !== CHAR_SHARP &&\n c !== CHAR_AMPERSAND &&\n c !== CHAR_ASTERISK &&\n c !== CHAR_EXCLAMATION &&\n c !== CHAR_VERTICAL_LINE &&\n c !== CHAR_EQUALS &&\n c !== CHAR_GREATER_THAN &&\n c !== CHAR_SINGLE_QUOTE &&\n c !== CHAR_DOUBLE_QUOTE &&\n // | “%” | “@” | “`”)\n c !== CHAR_PERCENT &&\n c !== CHAR_COMMERCIAL_AT &&\n c !== CHAR_GRAVE_ACCENT\n}\n\nfunction isPlainSafeAtStart (string: string, inblock: boolean) {\n const first = codePointAt(string, 0)\n\n if (isPlainSafeFirst(first)) return true\n\n if (\n string.length > 1 &&\n (first === CHAR_MINUS || first === CHAR_QUESTION || first === CHAR_COLON)\n ) {\n const second = codePointAt(string, 1)\n\n // The relaxed isPlainSafe() accepts whitespace inside a scalar, but the\n // indicator exception in ns-plain-first requires an ns-plain-safe\n // *non-space* character. Otherwise `- value` and `? value` start block\n // collections instead of plain scalars.\n return !isWhitespace(second) && isPlainSafe(second, first, inblock)\n }\n\n return false\n}\n\n// Simplified test for values allowed as the last character in plain style.\nfunction isPlainSafeLast (c: number) {\n // just not whitespace or colon, it will be checked to be plain character later\n return !isWhitespace(c) && c !== CHAR_COLON\n}\n\n// Same as 'string'.codePointAt(pos), but works in older browsers.\nfunction codePointAt (string: string, pos: number) {\n const first = string.charCodeAt(pos)\n let second\n\n if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {\n second = string.charCodeAt(pos + 1)\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000\n }\n }\n return first\n}\n\nfunction needIndentIndicator (string: string) {\n const leadingSpaceRe = /^\\n* /\n return leadingSpaceRe.test(string)\n}\n\nconst STYLE_PLAIN = 1\nconst STYLE_SINGLE = 2\nconst STYLE_LITERAL = 3\nconst STYLE_FOLDED = 4\nconst STYLE_DOUBLE = 5\n\ntype ScalarStyleId =\n typeof STYLE_PLAIN |\n typeof STYLE_SINGLE |\n typeof STYLE_LITERAL |\n typeof STYLE_FOLDED |\n typeof STYLE_DOUBLE\n\n// Determines which scalar styles are possible and returns the preferred style.\n// lineWidth = -1 => no limit.\n// Pre-conditions: str.length > 0.\n// Post-conditions:\n// STYLE_PLAIN or STYLE_SINGLE => no \\n are in the string.\n// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).\n// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).\nfunction chooseScalarStyle (state: PresenterState, string: string, layout: ReturnType<typeof scalarLayout>,\n singleLineOnly: boolean, forceQuote: boolean, inblock: boolean): ScalarStyleId {\n const { blockIndent, lineWidth } = layout\n let i\n let char = 0\n let prevChar = -1 // -1 = no previous character yet (see isPlainSafe)\n let hasLineBreak = false\n let hasFoldableLine = false // only checked if shouldTrackWidth\n const shouldTrackWidth = lineWidth !== -1\n let previousLineBreak = -1 // count the first line correctly\n // Document markers are recognized as whole tokens at the start of a line,\n // so character-level plain-scalar checks alone cannot reject them.\n let plain = !startsWithDocumentSeparator(string) &&\n isPlainSafeAtStart(string, inblock) &&\n isPlainSafeLast(codePointAt(string, string.length - 1))\n\n if (singleLineOnly || forceQuote) {\n // Case: no block styles.\n // Check for disallowed characters to rule out plain and single.\n for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n char = codePointAt(string, i)\n if (!isPrintable(char)) {\n return STYLE_DOUBLE\n }\n plain = plain && isPlainSafe(char, prevChar, inblock)\n prevChar = char\n }\n } else {\n // Case: block styles permitted.\n for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n char = codePointAt(string, i)\n if (char === CHAR_LINE_FEED) {\n hasLineBreak = true\n // Check if any line can be folded.\n if (shouldTrackWidth) {\n hasFoldableLine = hasFoldableLine ||\n // Foldable line = too long, and not more-indented.\n (i - previousLineBreak - 1 > lineWidth &&\n !isMoreIndented(string[previousLineBreak + 1]))\n previousLineBreak = i\n }\n } else if (!isPrintable(char)) {\n return STYLE_DOUBLE\n }\n plain = plain && isPlainSafe(char, prevChar, inblock)\n prevChar = char\n }\n // in case the end is missing a \\n\n hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&\n (i - previousLineBreak - 1 > lineWidth &&\n !isMoreIndented(string[previousLineBreak + 1])))\n }\n // Although every style can represent \\n without escaping, prefer block styles\n // for multiline, since they're more readable and they don't add empty lines.\n // Also prefer folding a super-long line.\n if (!hasLineBreak && !hasFoldableLine) {\n // Syntactic verdict only: whether the bare text round-trips to the node's\n // tag is a semantic check the caller applies (see resolveScalarStyle).\n if (plain && !forceQuote) return STYLE_PLAIN\n return state.quoteStyle === 'double' ? STYLE_DOUBLE : STYLE_SINGLE\n }\n // Edge case: block indentation indicator can only have one digit.\n if (blockIndent > 9 && needIndentIndicator(string)) {\n return STYLE_DOUBLE\n }\n // At this point we know block styles are valid.\n // Prefer literal style unless we want to fold.\n return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL\n}\n\n// Renders `string` in the given numeric style with the given layout.\n// NB. We drop the last trailing newline (if any) of a returned block scalar\n// since the dumper adds its own newline. This always works:\n// • No ending newline => unaffected; already using strip \"-\" chomping.\n// • Ending newline => removed then restored.\n// Importantly, this keeps the \"+\" chomp indicator from gaining an extra line.\nfunction renderScalarStyle (string: string, style: ScalarStyleId, layout: ReturnType<typeof scalarLayout>) {\n const { indent, blockIndent, lineWidth } = layout\n\n switch (style) {\n case STYLE_PLAIN:\n return encodeFlowBreaks(string, indent)\n case STYLE_SINGLE:\n return `'${encodeFlowBreaks(string, indent).replace(/'/g, \"''\")}'`\n case STYLE_LITERAL:\n return '|' + blockHeader(string, blockIndent) +\n dropEndingNewline(indentString(string, indent))\n case STYLE_FOLDED:\n return '>' + blockHeader(string, blockIndent) +\n dropEndingNewline(indentString(foldBlockScalar(string, lineWidth), indent))\n case STYLE_DOUBLE:\n return `\"${escapeString(string)}\"`\n }\n}\n\n// Picks the scalar style for `node`: a style hint carried on the node wins,\n// otherwise the style chosen by the machinery. Returns a numeric STYLE_*.\nfunction resolveScalarStyle (state: PresenterState, node: ScalarNode,\n layout: ReturnType<typeof scalarLayout>, iskey: boolean, inblock: boolean): ScalarStyleId {\n // Without knowing if keys are implicit/explicit, assume implicit for safety.\n const singleLineOnly = iskey || !inblock\n\n // Style hints carried on the node take precedence. They were valid in their\n // original context; only a parent change can break them, and only block\n // styles in a single-line context — quoted styles survive any context. A\n // rejected block hint falls through to selection by content below.\n if (node.style.singleQuoted) return STYLE_SINGLE\n if (node.style.doubleQuoted) return STYLE_DOUBLE\n if (!singleLineOnly) {\n if (node.style.literal) return STYLE_LITERAL\n if (node.style.folded) return STYLE_FOLDED\n }\n\n const string = node.value\n\n if (string.length === 0) {\n // An empty scalar is safe when its tag is explicit or resolves back to the\n // node tag (notably, the default null representation). A real empty string\n // does neither and therefore remains quoted.\n if (node.style.tagged || state.schema.resolveImplicitScalarTag(string).tag.tagName === node.tag) return STYLE_PLAIN\n return state.quoteStyle === 'double' ? STYLE_DOUBLE : STYLE_SINGLE\n }\n\n // v4's forceQuotes deliberately excluded keys. Keys are still quoted when\n // syntax or tag resolution requires it, using quoteStyle as the preference.\n const style = chooseScalarStyle(\n state, string, layout, singleLineOnly, state.forceQuotes && !iskey, inblock)\n\n // Plain writes no tag, so it round-trips only if the bare text resolves back\n // to the node's tag (or the tag gets printed explicitly). Else downgrade.\n // Downgrade to the preferred quote style here.\n if (style === STYLE_PLAIN && !node.style.tagged &&\n state.schema.resolveImplicitScalarTag(string).tag.tagName !== node.tag) {\n return state.quoteStyle === 'double' ? STYLE_DOUBLE : STYLE_SINGLE\n }\n return style\n}\n\n// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.\nfunction blockHeader (string: string, indentPerLevel: number) {\n const indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n const clip = string[string.length - 1] === '\\n'\n const keep = clip && (string[string.length - 2] === '\\n' || string === '\\n')\n const chomp = keep ? '+' : (clip ? '' : '-')\n\n return `${indentIndicator}${chomp}\\n`\n}\n\n// Flow scalars (plain, single-quoted) fold line breaks: a run of k source line\n// breaks reparses to k-1 literal `\\n`. So a single break is just line-wrapping\n// (folds back to a space), while a literal `\\n` in the value must be emitted as\n// a blank line (two breaks). Encode each run of p literal `\\n` as p+1 breaks and\n// indent the following content line so the continuation isn't read as a new node\n// (a bare break would yield invalid \"deficient indentation\" output).\n// `foldBlockScalar` can't be reused here: it treats a leading white space as a\n// \"more-indented\" line and suppresses the doubling, which a flow scalar must not.\nfunction encodeFlowBreaks (string: string, indent: number) {\n let nextLF = string.indexOf('\\n')\n if (nextLF === -1) return string\n\n const pad = ' '.repeat(indent)\n let result = string.slice(0, nextLF) // first line follows the quote, no indent\n\n const lineRe = /(\\n+)([^\\n]*)/g\n lineRe.lastIndex = nextLF\n let match\n while ((match = lineRe.exec(string))) {\n const breaks = match[1].length\n const line = match[2]\n // line === '' only at the end (the greedy \\n+ leaves no empty line mid-string);\n // pad it so the closing quote carries indent instead of sitting at column 0.\n result += '\\n'.repeat(breaks + 1) + pad + line\n }\n\n return result\n}\n\n// Strips one trailing newline from a block scalar: the dumper adds its own,\n// so without this a \"+\" (keep) chomp would gain an extra blank line.\nfunction dropEndingNewline (string: string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string\n}\n\n// A more-indented line is one starting with white space: YAML 1.2.2 [175]\n// s-nb-spaced-text, whose [33] s-white is a space *or a tab*. Matches the\n// parser's test in getBlockValue().\nfunction isMoreIndented (char: string) {\n return char === ' ' || char === '\\t'\n}\n\n// Note: a long line without a suitable break point will exceed the width limit.\n// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.\nfunction foldBlockScalar (string: string, width: number) {\n // In folded style, $k$ consecutive newlines output as $k+1$ newlines—\n // unless they're before or after a more-indented line, or at the very\n // beginning or end, in which case $k$ maps to $k$.\n // Therefore, parse each chunk as newline(s) followed by a content line.\n const lineRe = /(\\n+)([^\\n]*)/g\n\n // first line (possibly an empty line)\n let nextLF = string.indexOf('\\n')\n if (nextLF === -1) nextLF = string.length\n lineRe.lastIndex = nextLF\n let result = foldLine(string.slice(0, nextLF), width)\n // If we haven't reached the first content line yet, don't add an extra \\n.\n let prevMoreIndented = string[0] === '\\n' || isMoreIndented(string[0])\n let moreIndented\n\n // rest of the lines\n let match\n while ((match = lineRe.exec(string))) {\n const prefix = match[1]\n const line = match[2]\n\n moreIndented = line !== '' && isMoreIndented(line[0])\n result += prefix +\n ((!prevMoreIndented && !moreIndented && line !== '') ? '\\n' : '') +\n foldLine(line, width)\n prevMoreIndented = moreIndented\n }\n\n return result\n}\n\n// Greedy line breaking.\n// Picks the longest line under the limit each time,\n// otherwise settles for the shortest line over the limit.\n// NB. More-indented lines *cannot* be folded, as that would add an extra \\n.\nfunction foldLine (line: string, width: number) {\n if (line === '' || isMoreIndented(line[0])) return line\n\n // Since a more-indented line adds a \\n, breaks can't be followed by white space.\n const breakRe = / [^ \\t]/g // note: the match index will always be <= length-2.\n let match\n // start is an inclusive index. end, curr, and next are exclusive.\n let start = 0\n let end\n let curr = 0\n let next = 0\n let result = ''\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next // derive end <= length-2\n result += `\\n${line.slice(start, end)}`\n // skip the space that was output as \\n\n start = end + 1 // derive start <= length-1\n }\n curr = next\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n'\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += `${line.slice(start, curr)}\\n${line.slice(curr + 1)}`\n } else {\n result += line.slice(start)\n }\n\n return result.slice(1) // drop extra \\n joiner\n}\n\nfunction escapeString (string: string) {\n let result = ''\n let char = 0\n\n for (let i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n char = codePointAt(string, i)\n const escapeSeq = ESCAPE_SEQUENCES[char]\n\n if (escapeSeq) {\n result += escapeSeq\n continue\n }\n\n if (isPrintable(char)) {\n result += string[i]\n if (char >= 0x10000) result += string[i + 1]\n continue\n }\n\n result += encodeNonPrintable(char)\n }\n\n return result\n}\n\nfunction writeFlowSequence (state: PresenterState, level: number, node: SequenceNode) {\n let result = ''\n\n for (let index = 0, length = node.items.length; index < length; index += 1) {\n const item = writeNode(state, level, node.items[index], {})\n if (result !== '') result += `,${!state.flowSkipCommaSpace ? ' ' : ''}`\n result += item\n }\n\n const pad = state.flowBracketPadding && result !== '' ? ' ' : ''\n return `[${pad}${result}${pad}]`\n}\n\nfunction writeBlockSequence (state: PresenterState, level: number, node: SequenceNode, compact: boolean) {\n let result = ''\n\n for (let index = 0, length = node.items.length; index < length; index += 1) {\n const item = writeNode(state, level + 1, node.items[index],\n { block: true, compact: state.seqInlineFirst, isblockseq: true })\n\n if (!compact || result !== '') {\n result += generateNextLine(state, level)\n }\n\n // No trailing space when the value renders empty (e.g. null → '').\n if (item === '' || CHAR_LINE_FEED === item.charCodeAt(0)) {\n result += '-'\n } else {\n result += '- '\n }\n\n result += item\n }\n\n return result\n}\n\nfunction writeFlowMapping (state: PresenterState, level: number, node: MappingNode) {\n let result = ''\n const items = sortMappingItems(state, node.items)\n\n for (const { key, value } of items) {\n let pairBuffer = ''\n if (result !== '') pairBuffer += `,${!state.flowSkipCommaSpace ? ' ' : ''}`\n\n const keyText = writeNode(state, level, key, { iskey: true })\n const explicitPair = keyText.length > 1024\n\n if (explicitPair) {\n pairBuffer += '? '\n } else if (state.quoteFlowKeys) {\n pairBuffer += '\"'\n }\n\n const valueText = writeNode(state, level, value, {})\n // No separating space when the value renders empty (e.g. null → '').\n const sep = state.flowSkipColonSpace || valueText === '' ? '' : ' '\n\n pairBuffer += `${keyText}${state.quoteFlowKeys && !explicitPair ? '\"' : ''}:${sep}${valueText}`\n\n result += pairBuffer\n }\n\n const pad = state.flowBracketPadding && result !== '' ? ' ' : ''\n return `{${pad}${result}${pad}}`\n}\n\n// A scalar key sorts by its text; the default sort and a custom comparator both\n// see that, matching the original keys-array sort.\nfunction sortKeyValue (key: Node): any {\n return key.kind === 'scalar' ? key.value : key\n}\n\nfunction sortMappingItems (state: PresenterState, items: MappingNode['items']) {\n if (!state.sortKeys) return items\n\n const copy = items.slice()\n\n if (state.sortKeys === true) {\n copy.sort((a, b) => {\n const x = sortKeyValue(a.key)\n const y = sortKeyValue(b.key)\n if (x < y) return -1\n if (x > y) return 1\n return 0\n })\n } else {\n const fn = state.sortKeys\n copy.sort((a, b) => fn(sortKeyValue(a.key), sortKeyValue(b.key)))\n }\n\n return copy\n}\n\nfunction writeBlockMapping (state: PresenterState, level: number, node: MappingNode, compact: boolean) {\n let result = ''\n const items = sortMappingItems(state, node.items)\n\n for (let index = 0, length = items.length; index < length; index += 1) {\n let pairBuffer = ''\n\n if (!compact || result !== '') {\n pairBuffer += generateNextLine(state, level)\n }\n\n const { key, value } = items[index]\n\n // A block key — a block collection (mapping/sequence) or a block scalar\n // (literal/folded) — can't sit on a `key:` line, so it's written with block\n // context and the pair takes the explicit `? key / : value` form. A simple\n // scalar key stays inline (flow-vs-block is invisible there).\n const keyIsBlock =\n ((key.kind === 'mapping' || key.kind === 'sequence') &&\n !key.style.flow && key.items.length !== 0) ||\n (key.kind === 'scalar' && (key.style.literal || key.style.folded))\n\n // The `?`/`:` indicators shift content right like a `-`, so a block key or\n // value that stays on the indicator line keeps its indentation under\n // seqNoIndent (`isblockseq`). One that drops to its own line (tag/anchor)\n // collapses to the parent indent, so leave the flag off there.\n const keyText = keyIsBlock\n ? writeNode(state, level + 1, key,\n { block: true, compact: true, isblockseq: !cannotBeCompact(state, key, level + 1) })\n : writeNode(state, level + 1, key, { block: true, compact: true, iskey: true })\n\n // Block key, over-long key, or multiline scalar key forces explicit form.\n // Multiline isn't a spec requirement — just matches pyyaml's simple-key rule.\n const keyHasLineBreak = key.kind === 'scalar' && key.value.indexOf('\\n') !== -1\n const explicitPair = keyIsBlock || keyHasLineBreak || keyText.length > 1024\n\n if (explicitPair) {\n if (keyText && CHAR_LINE_FEED === keyText.charCodeAt(0)) {\n pairBuffer += '?'\n } else {\n pairBuffer += '? '\n }\n }\n\n pairBuffer += keyText\n\n if (explicitPair) {\n pairBuffer += generateNextLine(state, level)\n }\n\n const valueText = writeNode(state, level + 1, value,\n { block: true, compact: explicitPair, isblockseq: explicitPair && !cannotBeCompact(state, value, level + 1) })\n\n // Keep a space before the colon when the key text ends in a leading\n // property rather than scalar content, so the colon can't be read as part\n // of it. Two cases: an inline alias key (`*b : v`), and an empty scalar key\n // whose whole text is its anchor/tag (`&a :`, `!!str :`) — without the\n // space `&a:` reparses as an anchored value, dropping the null key.\n const keyIsBareProps = key.kind === 'scalar' && key.value === '' &&\n keyText !== '' &&\n keyText.charCodeAt(keyText.length - 1) !== CHAR_SINGLE_QUOTE &&\n keyText.charCodeAt(keyText.length - 1) !== CHAR_DOUBLE_QUOTE\n const keyColonSep = !explicitPair && (key.kind === 'alias' || keyIsBareProps) ? ' ' : ''\n\n // No trailing space when the value renders empty (e.g. null → '').\n if (valueText === '' || CHAR_LINE_FEED === valueText.charCodeAt(0)) {\n pairBuffer += `${keyColonSep}:`\n } else {\n pairBuffer += `${keyColonSep}: `\n }\n\n pairBuffer += valueText\n\n result += pairBuffer\n }\n\n return result\n}\n\n// Where a node sits relative to its parent — drives layout/style decisions.\n// All flags default to false (the flow-context, non-key, non-compact case).\ninterface NodeContext {\n block?: boolean // block context (vs flow); propagates downward\n compact?: boolean // may start on the current line (no leading newline)\n iskey?: boolean // node is a mapping key\n isblockseq?: boolean // content follows an indicator (`-`, or `?`/`:` in an\n // explicit pair) that already shifted it right; keeps\n // its indentation under seqNoIndent\n}\n\n// A node can't sit compact on its parent's indicator (`-`/`?`/`:`) line when it\n// carries leading props (tag/anchor) that would collide with the indicator, or\n// when the indent step is too narrow for the 2-char indicator. Such a node drops\n// to its own line; a block collection that does so also collapses its seqNoIndent\n// indentation back to the parent.\nfunction cannotBeCompact (state: PresenterState, node: Node, level: number) {\n return node.style.tagged || node.anchor !== undefined || (state.indent < 2 && level > 0)\n}\n\nfunction writeNode (state: PresenterState, level: number, node: Node, ctx: NodeContext): string {\n if (node.kind === 'alias') return `*${node.anchor}`\n\n const { block = false, iskey = false, isblockseq = false } = ctx\n let compact = ctx.compact ?? false\n\n const hasAnchor = node.anchor !== undefined\n\n if (cannotBeCompact(state, node, level)) {\n compact = false\n }\n\n let body: string\n let shouldPrintTag = node.style.tagged\n const useBlockCollection = block &&\n (node.kind === 'mapping' || node.kind === 'sequence') &&\n !node.style.flow && node.items.length !== 0\n\n if (node.kind === 'mapping') {\n if (useBlockCollection) {\n body = writeBlockMapping(state, level, node, compact)\n } else {\n body = writeFlowMapping(state, level, node)\n }\n } else if (node.kind === 'sequence') {\n if (useBlockCollection) {\n if (state.seqNoIndent && !isblockseq && level > 0) {\n body = writeBlockSequence(state, level - 1, node, compact)\n } else {\n body = writeBlockSequence(state, level, node, compact)\n }\n } else {\n body = writeFlowSequence(state, level, node)\n }\n } else {\n const layout = scalarLayout(state, level)\n const style = resolveScalarStyle(state, node, layout, iskey, block)\n body = renderScalarStyle(node.value, style, layout)\n shouldPrintTag = node.style.tagged || (style !== STYLE_PLAIN && node.tag !== state.defaultScalarTagName)\n }\n\n // An indicator plus its mandatory separator occupies 2 columns. For wider\n // indentation, pad a compact block collection so its first item starts at\n // the same column as the following items.\n if (useBlockCollection && compact && level > 0 && state.indent > 2) {\n body = `${' '.repeat(state.indent - 2)}${body}`\n }\n\n if (shouldPrintTag || hasAnchor) {\n const props: string[] = []\n const tag = shouldPrintTag ? nodeTagShort(node) : null\n const anchor = hasAnchor ? `&${node.anchor}` : null\n\n if (state.tagBeforeAnchor) {\n if (tag !== null) props.push(tag)\n if (anchor !== null) props.push(anchor)\n } else {\n if (anchor !== null) props.push(anchor)\n if (tag !== null) props.push(tag)\n }\n\n // No separator when the body is empty (e.g. `&anchor` on a null node) or\n // already starts on its own line.\n const sep = body === '' || body.charCodeAt(0) === CHAR_LINE_FEED ? '' : ' '\n body = `${props.join(' ')}${sep}${body}`\n }\n\n return body\n}\n\n// A bare (untagged, unanchored) non-empty block collection: writeNode renders it\n// in compact form with its first item on the opening line. That works mid-stream,\n// but right after a `---` the first item must drop to the next line. A tag/anchor\n// already forces the body onto its own line, so those stay on the `---` line.\nfunction rootStartsOwnLine (node: Node) {\n return (node.kind === 'sequence' || node.kind === 'mapping') &&\n !node.style.flow &&\n node.items.length !== 0 &&\n !node.style.tagged &&\n node.anchor === undefined\n}\n\n// A document whose serialization ends with a keep-chomped (`+`) block scalar is\n// open-ended: the trailing blank line(s) would otherwise be ambiguous, so it\n// needs a `...` terminator. Mirrors the keep test in `blockHeader`.\nfunction isOpenEnded (node: Node) {\n // Descend to the last leaf, always taking the last item of a block collection\n // (a flow collection renders on one line, so it ends the document itself).\n let leaf = node\n while ((leaf.kind === 'sequence' || leaf.kind === 'mapping') &&\n !leaf.style.flow && leaf.items.length !== 0) {\n leaf = leaf.kind === 'sequence'\n ? leaf.items[leaf.items.length - 1]\n : leaf.items[leaf.items.length - 1].value\n }\n\n if (leaf.kind !== 'scalar' || !(leaf.style.literal || leaf.style.folded)) return false\n const { value } = leaf\n // Keep chomping: ends in a blank line (`\\n\\n`) or is a lone `\\n`.\n return value.endsWith('\\n\\n') || value === '\\n'\n}\n\nfunction writeDocumentDirectives (doc: Document) {\n let result = ''\n\n for (const directive of doc.directives) {\n if (directive.kind === 'yaml') {\n result += `%YAML ${directive.version}\\n`\n continue\n }\n\n const { handle, prefix } = directive\n result += `%TAG ${handle} ${prefix}\\n`\n }\n\n return result\n}\n\n/**\n * Build YAML from AST.\n *\n * @category AST\n */\nfunction present (documents: Document[], options: PresenterOptions): string {\n const state = createPresenterState(options)\n let result = ''\n let previousEnded = false\n\n for (let index = 0; index < documents.length; index += 1) {\n const doc = documents[index]\n const directives = writeDocumentDirectives(doc)\n const hasDirectives = directives !== ''\n const marker = doc.explicitStart || hasDirectives || (index > 0 && !previousEnded)\n\n result += directives\n\n if (doc.contents === null) {\n if (marker) result += '---\\n'\n } else if (marker) {\n const body = writeNode(state, 0, doc.contents, { block: true, compact: true })\n // Content shares the `---` line, except: an empty render (no separator at\n // all), a bare block collection (wraps to the next line), or directives\n // forcing `---` onto its own line.\n const sep = body === '' ? '' : (hasDirectives || rootStartsOwnLine(doc.contents) ? '\\n' : ' ')\n result += `---${sep}${body}\\n`\n } else {\n result += writeNode(state, 0, doc.contents, { block: true, compact: true }) + '\\n'\n }\n\n previousEnded = doc.explicitEnd || (doc.contents !== null && isOpenEnded(doc.contents))\n if (previousEnded) {\n result += '...\\n'\n }\n }\n\n return result\n}\n\nexport {\n DEFAULT_PRESENTER_OPTIONS,\n present,\n type PresenterOptions\n}\n","import { DUMP_SCHEMA, type Schema } from './schema.ts'\nimport { jsToAst } from './ast/from_js.ts'\nimport { visit, VISIT_SKIP } from './ast/visit.ts'\nimport { type Document } from './ast/nodes.ts'\nimport {\n DEFAULT_PRESENTER_OPTIONS,\n present,\n type PresenterOptions\n} from './ast/presenter.ts'\nimport { pick } from './common/object.ts'\n\n/** @category Main */\ninterface DumpOptions extends Omit<PresenterOptions, 'schema'> {\n /**\n * Schema to use.\n *\n * @defaultValue {@link DUMP_SCHEMA}\n */\n schema?: Schema\n\n /**\n * Skips invalid types instead of throwing. Invalid mapping pairs and sequence\n * items are skipped; `undefined` sequence items are serialized as `null`.\n *\n * @defaultValue `false`\n */\n skipInvalid?: boolean\n\n /**\n * Inlines duplicate objects instead of converting them into references.\n *\n * @defaultValue `false`\n */\n noRefs?: boolean\n\n /**\n * Nesting level at which collections switch from block to flow style. Set to\n * `-1` to never switch automatically.\n *\n * @defaultValue `-1`\n */\n flowLevel?: number\n\n /** Mutates the generated AST before it is rendered. */\n transform?: (documents: Document[]) => void\n}\n\nconst DEFAULT_DUMP_OPTIONS: Required<DumpOptions> = {\n ...DEFAULT_PRESENTER_OPTIONS,\n schema: DUMP_SCHEMA,\n skipInvalid: false,\n noRefs: false,\n flowLevel: -1,\n transform: () => {}\n}\n\n// Options that need the JS value (tags, format, dedup) go to `jsToAst`; purely\n// presentational ones go to `present`.\n/**\n * Serializes JS object as a YAML document. By default it can dump every\n * supported YAML type, so it throws an exception if you try to dump regexps or\n * functions. However, you can disable exceptions by setting the\n * {@link DumpOptions.skipInvalid} option to `true`.\n *\n * @category Main\n */\nfunction dump (input: any, options: DumpOptions = {}) {\n const opts = { ...DEFAULT_DUMP_OPTIONS, ...options }\n\n const documents = jsToAst(input, opts.schema, {\n noRefs: opts.noRefs,\n skipInvalid: opts.skipInvalid\n })\n\n // flowLevel: every node at this depth switches to flow; the presenter forces\n // everything below into flow too, so the walk stops there.\n if (opts.flowLevel >= 0) {\n visit(documents, (node, ctx) => {\n if (ctx.depth < opts.flowLevel) return\n node.style.flow = true\n return VISIT_SKIP\n })\n }\n\n opts.transform(documents)\n\n const PRESENTER_OPT_KEYS = Object.keys(DEFAULT_PRESENTER_OPTIONS) as\n (keyof typeof DEFAULT_PRESENTER_OPTIONS)[]\n\n return present(documents, { ...pick(opts, PRESENTER_OPT_KEYS), schema: opts.schema })\n}\n\nexport {\n dump,\n\n type DumpOptions\n}\n","// Parser events → AST. The second entry into the AST world (the first being\n// `jsToAst`): instead of building JS values like the constructor, it mirrors the\n// same document/sequence/mapping frame walk and emits `Node`s that keep the\n// original styles, tags and anchors, so parsed YAML can be re-dumped faithfully.\n\nimport {\n EVENT_ID,\n SCALAR_STYLE,\n COLLECTION_STYLE,\n type Event,\n type MappingEvent,\n type ScalarEvent,\n type SequenceEvent\n} from '../parser/events.ts'\nimport { getScalarValue } from '../parser/parser_scalar.ts'\nimport { type Schema } from '../schema.ts'\nimport {\n Style,\n type Node,\n type Document,\n type ScalarNode,\n type SequenceNode,\n type MappingNode,\n type AliasNode\n} from './nodes.ts'\n\nconst NO_RANGE = -1\n\ninterface DocumentFrame {\n kind: 'document'\n doc: Document\n}\n\ninterface SequenceFrame {\n kind: 'sequence'\n node: SequenceNode\n}\n\ninterface MappingFrame {\n kind: 'mapping'\n node: MappingNode\n key: Node | null\n}\n\ntype Frame = DocumentFrame | SequenceFrame | MappingFrame\n\n/** @category AST */\ninterface FromEventsOptions {\n /** Source text referenced by offsets in `events`. */\n source: string\n\n /** Schema used to resolve implicit scalar tags. */\n schema: Schema\n}\n\ninterface FromEventsState {\n source: string\n schema: Schema\n eventIndex: number\n position: number\n frames: Frame[]\n documents: Document[]\n}\n\nfunction eventPosition (event: Event) {\n if ('tagStart' in event && event.tagStart !== NO_RANGE) return event.tagStart\n if ('anchorStart' in event && event.anchorStart !== NO_RANGE) return event.anchorStart\n if ('valueStart' in event && event.valueStart !== NO_RANGE) return event.valueStart\n if ('start' in event) return event.start\n return 0\n}\n\nfunction rawTag (state: FromEventsState, event: ScalarEvent | SequenceEvent | MappingEvent) {\n return event.tagStart === NO_RANGE\n ? ''\n : state.source.slice(event.tagStart, event.tagEnd)\n}\n\nfunction anchorName (state: FromEventsState, event: ScalarEvent | SequenceEvent | MappingEvent) {\n return event.anchorStart === NO_RANGE\n ? undefined\n : state.source.slice(event.anchorStart, event.anchorEnd)\n}\n\nfunction buildScalar (state: FromEventsState, event: ScalarEvent): ScalarNode {\n const value = getScalarValue(state.source, event)\n const raw = rawTag(state, event)\n const style = new Style()\n\n switch (event.style) {\n case SCALAR_STYLE.SINGLE_QUOTED: style.singleQuoted = true; break\n case SCALAR_STYLE.DOUBLE_QUOTED: style.doubleQuoted = true; break\n case SCALAR_STYLE.LITERAL_BLOCK: style.literal = true; break\n case SCALAR_STYLE.FOLDED_BLOCK: style.folded = true; break\n }\n\n let tag: string\n if (raw !== '') {\n style.tagged = true\n tag = raw\n } else if (event.style === SCALAR_STYLE.PLAIN) {\n tag = state.schema.resolveImplicitScalarTag(value).tag.tagName\n } else {\n tag = state.schema.defaultScalarTag.tagName\n }\n\n return { kind: 'scalar', tag, style, anchor: anchorName(state, event), value }\n}\n\nfunction buildCollection (\n state: FromEventsState,\n event: SequenceEvent | MappingEvent,\n defaultTagName: string\n): { tag: string, style: Style, anchor?: string } {\n const raw = rawTag(state, event)\n const style = new Style()\n if (event.style === COLLECTION_STYLE.FLOW) style.flow = true\n\n let tag: string\n if (raw === '') {\n tag = defaultTagName\n } else {\n tag = raw\n style.tagged = true\n }\n\n return { tag, style, anchor: anchorName(state, event) }\n}\n\nfunction addNode (state: FromEventsState, node: Node) {\n const frame = state.frames[state.frames.length - 1]\n\n if (frame.kind === 'document') {\n frame.doc.contents = node\n } else if (frame.kind === 'sequence') {\n frame.node.items.push(node)\n } else if (frame.key) {\n frame.node.items.push({ key: frame.key, value: node })\n frame.key = null\n } else {\n frame.key = node\n }\n}\n\n/**\n * Builds an AST from parser events\n *\n * @category AST\n */\nfunction eventsToAst (events: Event[], options: FromEventsOptions): Document[] {\n const state: FromEventsState = {\n source: options.source,\n schema: options.schema,\n eventIndex: 0,\n position: 0,\n frames: [],\n documents: []\n }\n\n while (state.eventIndex < events.length) {\n const event = events[state.eventIndex++]\n state.position = eventPosition(event)\n\n switch (event.type) {\n case EVENT_ID.DOCUMENT: {\n const doc: Document = {\n contents: null,\n explicitStart: event.explicitStart,\n explicitEnd: event.explicitEnd,\n directives: event.directives\n }\n state.frames.push({ kind: 'document', doc })\n break\n }\n\n case EVENT_ID.SCALAR:\n addNode(state, buildScalar(state, event))\n break\n\n case EVENT_ID.SEQUENCE: {\n const { tag, style, anchor } = buildCollection(state, event, 'tag:yaml.org,2002:seq')\n const node: SequenceNode = { kind: 'sequence', tag, style, anchor, items: [] }\n state.frames.push({ kind: 'sequence', node })\n break\n }\n\n case EVENT_ID.MAPPING: {\n const { tag, style, anchor } = buildCollection(state, event, 'tag:yaml.org,2002:map')\n const node: MappingNode = { kind: 'mapping', tag, style, anchor, items: [] }\n state.frames.push({ kind: 'mapping', node, key: null })\n break\n }\n\n case EVENT_ID.ALIAS: {\n const name = state.source.slice(event.anchorStart, event.anchorEnd)\n const node: AliasNode = { kind: 'alias', tag: '', style: new Style(), anchor: name }\n addNode(state, node)\n break\n }\n\n case EVENT_ID.POP: {\n const frame = state.frames.pop()!\n if (frame.kind === 'mapping' && frame.key) {\n throw new Error('incomplete mapping pair in event stream')\n }\n if (frame.kind === 'document') {\n state.documents.push(frame.doc)\n } else {\n addNode(state, frame.node)\n }\n break\n }\n }\n }\n\n return state.documents\n}\n\nexport {\n eventsToAst,\n type FromEventsOptions\n}\n","export {\n Schema,\n FAILSAFE_SCHEMA,\n JSON_SCHEMA,\n CORE_SCHEMA,\n YAML11_SCHEMA,\n DUMP_SCHEMA\n} from './schema.ts'\n\nexport {\n NOT_RESOLVED,\n defineScalarTag,\n defineSequenceTag,\n defineMappingTag,\n type ScalarTagDefinition,\n type SequenceTagDefinition,\n type MappingTagDefinition,\n type TagDefinition,\n type ScalarTagOptions,\n type SequenceTagOptions,\n type MappingTagOptions\n} from './tag.ts'\n\nexport { strTag } from './tag/scalar/str.ts'\nexport { nullCoreTag } from './tag/scalar/null_core.ts'\nexport { nullJsonTag } from './tag/scalar/null_json.ts'\nexport { nullYaml11Tag } from './tag/scalar/null_yaml11.ts'\nexport { boolCoreTag } from './tag/scalar/bool_core.ts'\nexport { boolJsonTag } from './tag/scalar/bool_json.ts'\nexport { boolYaml11Tag } from './tag/scalar/bool_yaml11.ts'\nexport { intCoreTag } from './tag/scalar/int_core.ts'\nexport { intJsonTag } from './tag/scalar/int_json.ts'\nexport { intYaml11Tag } from './tag/scalar/int_yaml11.ts'\nexport { floatCoreTag } from './tag/scalar/float_core.ts'\nexport { floatJsonTag } from './tag/scalar/float_json.ts'\nexport { floatYaml11Tag } from './tag/scalar/float_yaml11.ts'\nexport { mergeTag } from './tag/scalar/merge.ts'\nexport { binaryTag } from './tag/scalar/binary.ts'\nexport { timestampTag } from './tag/scalar/timestamp.ts'\n\nexport { seqTag } from './tag/sequence/seq.ts'\nexport { omapTag } from './tag/sequence/omap.ts'\nexport { pairsTag } from './tag/sequence/pairs.ts'\n\nexport { mapTag } from './tag/mapping/map.ts'\nexport { realMapTag } from './tag/mapping/real_map.ts'\nexport { legacyMapTag } from './tag/mapping/legacy_map.ts'\nexport { setTag } from './tag/mapping/set.ts'\n\nexport { load, loadAll, type LoadOptions } from './load.ts'\nexport { dump, type DumpOptions } from './dump.ts'\nexport { YAMLException } from './common/exception.ts'\n\nexport {\n EVENT_ID,\n SCALAR_STYLE,\n COLLECTION_STYLE,\n CHOMPING_MODE,\n type EventId,\n type ScalarStyle,\n type CollectionStyle,\n type ChompingMode,\n\n type DocumentDirective,\n type DocumentEvent,\n type SequenceEvent,\n type MappingEvent,\n type ScalarEvent,\n type AliasEvent,\n type PopEvent,\n type Event\n} from './parser/events.ts'\n\nexport {\n parseEvents,\n type ParserOptions\n} from './parser/parser.ts'\n\nexport { getScalarValue } from './parser/parser_scalar.ts'\n\nexport {\n constructFromEvents,\n type ConstructorOptions\n} from './parser/constructor.ts'\n\nexport { eventsToAst, type FromEventsOptions } from './ast/from_events.ts'\nexport { jsToAst, type FromJsOptions } from './ast/from_js.ts'\nexport { present, type PresenterOptions } from './ast/presenter.ts'\n\nexport {\n visit,\n VISIT_BREAK,\n VISIT_SKIP,\n type Visitor,\n type VisitContext\n} from './ast/visit.ts'\n\nexport {\n Style,\n type Node,\n type Document,\n type NodeBase,\n type ScalarNode,\n type SequenceNode,\n type MappingNode,\n type AliasNode\n} from './ast/nodes.ts'\n\n// Deprecated compatibility exports\n\nimport { EVENT_ID, SCALAR_STYLE, COLLECTION_STYLE, CHOMPING_MODE } from './parser/events.ts'\n\n/** @deprecated Use `EVENT_ID.DOCUMENT` instead. @internal */\nexport const EVENT_DOCUMENT = EVENT_ID.DOCUMENT\n/** @deprecated Use `EVENT_ID.SEQUENCE` instead. @internal */\nexport const EVENT_SEQUENCE = EVENT_ID.SEQUENCE\n/** @deprecated Use `EVENT_ID.MAPPING` instead. @internal */\nexport const EVENT_MAPPING = EVENT_ID.MAPPING\n/** @deprecated Use `EVENT_ID.SCALAR` instead. @internal */\nexport const EVENT_SCALAR = EVENT_ID.SCALAR\n/** @deprecated Use `EVENT_ID.ALIAS` instead. @internal */\nexport const EVENT_ALIAS = EVENT_ID.ALIAS\n/** @deprecated Use `EVENT_ID.POP` instead. @internal */\nexport const EVENT_POP = EVENT_ID.POP\n/** @deprecated Use `SCALAR_STYLE.PLAIN` instead. @internal */\nexport const SCALAR_STYLE_PLAIN = SCALAR_STYLE.PLAIN\n/** @deprecated Use `SCALAR_STYLE.SINGLE_QUOTED` instead. @internal */\nexport const SCALAR_STYLE_SINGLE_QUOTED = SCALAR_STYLE.SINGLE_QUOTED\n/** @deprecated Use `SCALAR_STYLE.DOUBLE_QUOTED` instead. @internal */\nexport const SCALAR_STYLE_DOUBLE_QUOTED = SCALAR_STYLE.DOUBLE_QUOTED\n/** @deprecated Use `SCALAR_STYLE.LITERAL_BLOCK` instead. @internal */\nexport const SCALAR_STYLE_LITERAL_BLOCK = SCALAR_STYLE.LITERAL_BLOCK\n/** @deprecated Use `SCALAR_STYLE.FOLDED_BLOCK` instead. @internal */\nexport const SCALAR_STYLE_FOLDED_BLOCK = SCALAR_STYLE.FOLDED_BLOCK\n/** @deprecated Use `COLLECTION_STYLE.BLOCK` instead. @internal */\nexport const COLLECTION_STYLE_BLOCK = COLLECTION_STYLE.BLOCK\n/** @deprecated Use `COLLECTION_STYLE.FLOW` instead. @internal */\nexport const COLLECTION_STYLE_FLOW = COLLECTION_STYLE.FLOW\n/** @deprecated Use `CHOMPING_MODE.CLIP` instead. @internal */\nexport const CHOMPING_CLIP = CHOMPING_MODE.CLIP\n/** @deprecated Use `CHOMPING_MODE.STRIP` instead. @internal */\nexport const CHOMPING_STRIP = CHOMPING_MODE.STRIP\n/** @deprecated Use `CHOMPING_MODE.KEEP` instead. @internal */\nexport const CHOMPING_KEEP = CHOMPING_MODE.KEEP\n","export const SDE_DOWNLOAD_URL =\n 'https://developers.eveonline.com/static-data/eve-online-static-data-latest-yaml.zip';\n\nexport const SDE_LATEST_BUILD_URL =\n 'https://developers.eveonline.com/static-data/tranquility/latest.jsonl';\n\nexport const SDE_BUILD_NUMBER_HEADER = 'x-sde-build-number';\n\nexport const SDE_METADATA_FILENAME = '_sde.yaml';\n\nexport interface SdeFileSpec {\n readonly yamlFile: string;\n readonly tableName: string;\n readonly idAttribute: string;\n readonly idType: 'number' | 'string';\n readonly injectId: boolean;\n}\n\nexport const SDE_FILE_REGISTRY: readonly SdeFileSpec[] = [\n // --- Universe / Map ---\n {\n yamlFile: 'mapRegions.yaml',\n tableName: 'eve_regions',\n idAttribute: 'regionId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'mapConstellations.yaml',\n tableName: 'eve_constellations',\n idAttribute: 'constellationId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'mapSolarSystems.yaml',\n tableName: 'eve_solar_systems',\n idAttribute: 'systemId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'mapStargates.yaml',\n tableName: 'eve_stargates',\n idAttribute: 'stargateId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'mapStars.yaml',\n tableName: 'eve_stars',\n idAttribute: 'starId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'mapPlanets.yaml',\n tableName: 'eve_planets',\n idAttribute: 'planetId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'mapMoons.yaml',\n tableName: 'eve_moons',\n idAttribute: 'moonId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'mapAsteroidBelts.yaml',\n tableName: 'eve_asteroid_belts',\n idAttribute: 'asteroidBeltId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'mapSecondarySuns.yaml',\n tableName: 'eve_secondary_suns',\n idAttribute: 'secondarySunId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Type System ---\n {\n yamlFile: 'types.yaml',\n tableName: 'eve_types',\n idAttribute: 'typeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'groups.yaml',\n tableName: 'eve_groups',\n idAttribute: 'groupId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'categories.yaml',\n tableName: 'eve_categories',\n idAttribute: 'categoryId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'metaGroups.yaml',\n tableName: 'eve_meta_groups',\n idAttribute: 'metaGroupId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'typeDogma.yaml',\n tableName: 'eve_type_dogma',\n idAttribute: 'typeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'typeBonus.yaml',\n tableName: 'eve_type_bonuses',\n idAttribute: 'typeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'typeElements.yaml',\n tableName: 'eve_type_elements',\n idAttribute: 'typeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'typeLists.yaml',\n tableName: 'eve_type_lists',\n idAttribute: 'typeListId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'typeMaterials.yaml',\n tableName: 'eve_type_materials',\n idAttribute: 'typeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'compressibleTypes.yaml',\n tableName: 'eve_compressible_types',\n idAttribute: 'typeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'contrabandTypes.yaml',\n tableName: 'eve_contraband_types',\n idAttribute: 'typeId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Dogma ---\n {\n yamlFile: 'dogmaAttributes.yaml',\n tableName: 'eve_dogma_attributes',\n idAttribute: 'attributeId',\n idType: 'number',\n injectId: false,\n },\n {\n yamlFile: 'dogmaEffects.yaml',\n tableName: 'eve_dogma_effects',\n idAttribute: 'effectId',\n idType: 'number',\n injectId: false,\n },\n {\n yamlFile: 'dogmaAttributeCategories.yaml',\n tableName: 'eve_dogma_attribute_categories',\n idAttribute: 'attributeCategoryId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'dogmaUnits.yaml',\n tableName: 'eve_dogma_units',\n idAttribute: 'unitId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Industry ---\n {\n yamlFile: 'blueprints.yaml',\n tableName: 'eve_blueprints',\n idAttribute: 'blueprintTypeId',\n idType: 'number',\n injectId: false,\n },\n {\n yamlFile: 'planetSchematics.yaml',\n tableName: 'eve_planet_schematics',\n idAttribute: 'planetSchematicId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'planetResources.yaml',\n tableName: 'eve_planet_resources',\n idAttribute: 'planetId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Market ---\n {\n yamlFile: 'marketGroups.yaml',\n tableName: 'eve_market_groups',\n idAttribute: 'marketGroupId',\n idType: 'number',\n injectId: true,\n },\n\n // --- NPCs / Agents ---\n {\n yamlFile: 'agentTypes.yaml',\n tableName: 'eve_agent_types',\n idAttribute: 'agentTypeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'agentsInSpace.yaml',\n tableName: 'eve_agents_in_space',\n idAttribute: 'characterId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'npcCharacters.yaml',\n tableName: 'eve_npc_characters',\n idAttribute: 'characterId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'npcCorporations.yaml',\n tableName: 'eve_npc_corporations',\n idAttribute: 'corporationId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'npcCorporationDivisions.yaml',\n tableName: 'eve_npc_corporation_divisions',\n idAttribute: 'npcCorporationDivisionId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'npcStations.yaml',\n tableName: 'eve_npc_stations',\n idAttribute: 'stationId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'factions.yaml',\n tableName: 'eve_factions',\n idAttribute: 'factionId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Character / Lore ---\n {\n yamlFile: 'races.yaml',\n tableName: 'eve_races',\n idAttribute: 'raceId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'bloodlines.yaml',\n tableName: 'eve_bloodlines',\n idAttribute: 'bloodlineId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'ancestries.yaml',\n tableName: 'eve_ancestries',\n idAttribute: 'ancestryId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'characterAttributes.yaml',\n tableName: 'eve_character_attributes',\n idAttribute: 'attributeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'characterTitles.yaml',\n tableName: 'eve_character_titles',\n idAttribute: 'characterTitleId',\n idType: 'string',\n injectId: false,\n },\n {\n yamlFile: 'cloneGrades.yaml',\n tableName: 'eve_clone_grades',\n idAttribute: 'cloneGradeId',\n idType: 'number',\n injectId: true,\n },\n\n // --- SKINs ---\n {\n yamlFile: 'skins.yaml',\n tableName: 'eve_skins',\n idAttribute: 'skinId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'skinLicenses.yaml',\n tableName: 'eve_skin_licenses',\n idAttribute: 'licenseTypeId',\n idType: 'number',\n injectId: false,\n },\n {\n yamlFile: 'skinMaterials.yaml',\n tableName: 'eve_skin_materials',\n idAttribute: 'skinMaterialId',\n idType: 'number',\n injectId: false,\n },\n\n // --- SKINR ---\n {\n yamlFile: 'skinrComponents.yaml',\n tableName: 'eve_skinr_components',\n idAttribute: 'skinrComponentId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'skinrComponentCategories.yaml',\n tableName: 'eve_skinr_component_categories',\n idAttribute: 'skinrComponentCategoryId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'skinrComponentRarities.yaml',\n tableName: 'eve_skinr_component_rarities',\n idAttribute: 'skinrComponentRarityId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'skinrComponentPointValues.yaml',\n tableName: 'eve_skinr_component_point_values',\n idAttribute: 'skinrComponentCategoryId',\n idType: 'number',\n injectId: false,\n },\n {\n yamlFile: 'skinrSlots.yaml',\n tableName: 'eve_skinr_slots',\n idAttribute: 'skinrSlotId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'skinrSlotCategories.yaml',\n tableName: 'eve_skinr_slot_categories',\n idAttribute: 'skinrSlotCategoryId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'skinrSlotConfigurations.yaml',\n tableName: 'eve_skinr_slot_configurations',\n idAttribute: 'skinrSlotConfigurationId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'skinrSlotNames.yaml',\n tableName: 'eve_skinr_slot_names',\n idAttribute: 'skinrSlotNameId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'skinrTierThresholds.yaml',\n tableName: 'eve_skinr_tier_thresholds',\n idAttribute: 'shipTreeGroupId',\n idType: 'number',\n injectId: false,\n },\n\n // --- Ship Tree ---\n {\n yamlFile: 'shipTreeElements.yaml',\n tableName: 'eve_ship_tree_elements',\n idAttribute: 'shipTreeElementId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'shipTreeFactions.yaml',\n tableName: 'eve_ship_tree_factions',\n idAttribute: 'factionId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'shipTreeGroups.yaml',\n tableName: 'eve_ship_tree_groups',\n idAttribute: 'shipTreeGroupId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Graphics ---\n {\n yamlFile: 'graphics.yaml',\n tableName: 'eve_graphics',\n idAttribute: 'graphicId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'graphicMaterialSets.yaml',\n tableName: 'eve_graphic_material_sets',\n idAttribute: 'materialSetId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'icons.yaml',\n tableName: 'eve_icons',\n idAttribute: 'iconId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Stations ---\n {\n yamlFile: 'stationOperations.yaml',\n tableName: 'eve_station_operations',\n idAttribute: 'stationOperationId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'stationServices.yaml',\n tableName: 'eve_station_services',\n idAttribute: 'stationServiceId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Sovereignty ---\n {\n yamlFile: 'sovereigntyUpgrades.yaml',\n tableName: 'eve_sovereignty_upgrades',\n idAttribute: 'typeId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Certificates / Masteries ---\n {\n yamlFile: 'certificates.yaml',\n tableName: 'eve_certificates',\n idAttribute: 'certificateId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'masteries.yaml',\n tableName: 'eve_masteries',\n idAttribute: 'typeId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Misc ---\n {\n yamlFile: 'archetypes.yaml',\n tableName: 'eve_archetypes',\n idAttribute: 'archetypeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'controlTowerResources.yaml',\n tableName: 'eve_control_tower_resources',\n idAttribute: 'typeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'corporationActivities.yaml',\n tableName: 'eve_corporation_activities',\n idAttribute: 'corporationActivityId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'dbuffCollections.yaml',\n tableName: 'eve_dbuff_collections',\n idAttribute: 'dbuffCollectionId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'dungeons.yaml',\n tableName: 'eve_dungeons',\n idAttribute: 'dungeonId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'dynamicItemAttributes.yaml',\n tableName: 'eve_dynamic_item_attributes',\n idAttribute: 'dynamicItemAttributeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'epicArcs.yaml',\n tableName: 'eve_epic_arcs',\n idAttribute: 'epicArcId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'freelanceJobSchemas.yaml',\n tableName: 'eve_freelance_job_schemas',\n idAttribute: 'freelanceJobSchemaGroupId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'landmarks.yaml',\n tableName: 'eve_landmarks',\n idAttribute: 'landmarkId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'mercenaryTacticalOperations.yaml',\n tableName: 'eve_mercenary_tactical_operations',\n idAttribute: 'mercenaryTacticalOperationId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'militaryCampaigns.yaml',\n tableName: 'eve_military_campaigns',\n idAttribute: 'militaryCampaignId',\n idType: 'string',\n injectId: true,\n },\n {\n yamlFile: 'militaryCampaignObjectives.yaml',\n tableName: 'eve_military_campaign_objectives',\n idAttribute: 'militaryCampaignObjectiveId',\n idType: 'string',\n injectId: true,\n },\n {\n yamlFile: 'missions.yaml',\n tableName: 'eve_missions',\n idAttribute: 'missionId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Translation ---\n {\n yamlFile: 'translationLanguages.yaml',\n tableName: 'eve_translation_languages',\n idAttribute: 'translationLanguageId',\n idType: 'string',\n injectId: true,\n },\n\n // --- Industry (extended) ---\n {\n yamlFile: 'industryActivities.yaml',\n tableName: 'eve_industry_activities',\n idAttribute: 'industryActivityId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'industryAssemblyLines.yaml',\n tableName: 'eve_industry_assembly_lines',\n idAttribute: 'assemblyLineId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'industryInstallationTypes.yaml',\n tableName: 'eve_industry_installation_types',\n idAttribute: 'installationTypeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'industryModifierSources.yaml',\n tableName: 'eve_industry_modifier_sources',\n idAttribute: 'modifierSourceId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'industryTargetFilters.yaml',\n tableName: 'eve_industry_target_filters',\n idAttribute: 'targetFilterId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Fighters ---\n {\n yamlFile: 'fighterAbilities.yaml',\n tableName: 'eve_fighter_abilities',\n idAttribute: 'fighterAbilityId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'fighterAbilitiesByType.yaml',\n tableName: 'eve_fighter_abilities_by_type',\n idAttribute: 'typeId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Corporation ---\n {\n yamlFile: 'corporationRoles.yaml',\n tableName: 'eve_corporation_roles',\n idAttribute: 'corporationRoleId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'corporationRoleGroups.yaml',\n tableName: 'eve_corporation_role_groups',\n idAttribute: 'corporationRoleGroupId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Schools / Education ---\n {\n yamlFile: 'schools.yaml',\n tableName: 'eve_schools',\n idAttribute: 'schoolId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'schoolMap.yaml',\n tableName: 'eve_school_map',\n idAttribute: 'schoolMapId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'skillPlans.yaml',\n tableName: 'eve_skill_plans',\n idAttribute: 'skillPlanId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'expertSystems.yaml',\n tableName: 'eve_expert_systems',\n idAttribute: 'expertSystemId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Notifications ---\n {\n yamlFile: 'notificationTypes.yaml',\n tableName: 'eve_notification_types',\n idAttribute: 'notificationTypeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'accountingEntryTypes.yaml',\n tableName: 'eve_accounting_entry_types',\n idAttribute: 'accountingEntryTypeId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Effects / Traps / Dbuffs ---\n {\n yamlFile: 'appliedProximityEffects.yaml',\n tableName: 'eve_applied_proximity_effects',\n idAttribute: 'appliedProximityEffectId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'proximityTrap.yaml',\n tableName: 'eve_proximity_traps',\n idAttribute: 'proximityTrapId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'systemDbuffEmitters.yaml',\n tableName: 'eve_system_dbuff_emitters',\n idAttribute: 'systemDbuffEmitterId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'systemWideEffects.yaml',\n tableName: 'eve_system_wide_effects',\n idAttribute: 'systemWideEffectId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'linkWithShip.yaml',\n tableName: 'eve_link_with_ship',\n idAttribute: 'linkWithShipId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Station (extended) ---\n {\n yamlFile: 'stationStandingsRestrictions.yaml',\n tableName: 'eve_station_standings_restrictions',\n idAttribute: 'stationStandingsRestrictionId',\n idType: 'number',\n injectId: true,\n },\n\n // --- SKINR (extended) ---\n {\n yamlFile: 'skinrSlotsToMaterials.yaml',\n tableName: 'eve_skinr_slots_to_materials',\n idAttribute: 'skinrSlotToMaterialId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Metenox ---\n {\n yamlFile: 'metenoxMoonDrill.yaml',\n tableName: 'eve_metenox_moon_drill',\n idAttribute: 'metenoxMoonDrillId',\n idType: 'number',\n injectId: true,\n },\n] as const;\n","import AdmZip from 'adm-zip';\nimport * as yaml from 'js-yaml';\nimport { SDE_METADATA_FILENAME } from './constants';\nimport { SdeError } from '../errors';\n\nexport interface SdeMetadata {\n buildNumber: string;\n releaseDate: string;\n}\n\nexport interface ParsedSdeFile {\n filename: string;\n records: Map<string | number, Record<string, unknown>>;\n}\n\nfunction findEntry(\n zip: AdmZip,\n filename: string,\n): AdmZip.IZipEntry | undefined {\n const basename = filename.replace(/^.*[\\\\/]/, '');\n return zip.getEntries().find((entry) => {\n if (entry.isDirectory) return false;\n const entryBasename = entry.entryName.replace(/^.*[\\\\/]/, '');\n return (\n entryBasename === basename ||\n entry.entryName === filename ||\n entry.entryName === `sde/${filename}`\n );\n });\n}\n\nfunction readEntryAsString(entry: AdmZip.IZipEntry): string {\n const buffer = entry.getData();\n return buffer.toString('utf-8');\n}\n\nexport class SdeExtractor {\n readMetadata(zipPath: string): SdeMetadata {\n const zip = new AdmZip(zipPath);\n const entry = findEntry(zip, SDE_METADATA_FILENAME);\n\n if (!entry) {\n throw new SdeError(\n `Metadata file '${SDE_METADATA_FILENAME}' not found in archive: ${zipPath}`,\n );\n }\n\n const content = readEntryAsString(entry);\n const parsed = yaml.load(content) as Record<string, unknown>;\n\n const bn = parsed.buildNumber;\n const rd = parsed.releaseDate;\n return {\n buildNumber:\n typeof bn === 'string' || typeof bn === 'number' ? String(bn) : '',\n releaseDate:\n typeof rd === 'string' || typeof rd === 'number' ? String(rd) : '',\n };\n }\n\n parseFile(zipPath: string, filename: string): ParsedSdeFile {\n const zip = new AdmZip(zipPath);\n return this.parseFileFromZip(zip, filename);\n }\n\n parseFiles(zipPath: string, filenames: string[]): ParsedSdeFile[] {\n const zip = new AdmZip(zipPath);\n const results: ParsedSdeFile[] = [];\n\n for (const filename of filenames) {\n const entry = findEntry(zip, filename);\n if (!entry) {\n // File not present in this SDE build — skip silently\n continue;\n }\n results.push(this.parseEntryAsFile(entry, filename));\n }\n\n return results;\n }\n\n extractAll(zipPath: string, outputDir: string): void {\n const zip = new AdmZip(zipPath);\n zip.extractAllTo(outputDir, true);\n }\n\n listFiles(zipPath: string): string[] {\n const zip = new AdmZip(zipPath);\n return zip\n .getEntries()\n .filter(\n (entry) => !entry.isDirectory && entry.entryName.endsWith('.yaml'),\n )\n .map((entry) => entry.entryName);\n }\n\n private parseFileFromZip(zip: AdmZip, filename: string): ParsedSdeFile {\n const entry = findEntry(zip, filename);\n\n if (!entry) {\n throw new SdeError(`File '${filename}' not found in archive`);\n }\n\n return this.parseEntryAsFile(entry, filename);\n }\n\n private parseEntryAsFile(\n entry: AdmZip.IZipEntry,\n filename: string,\n ): ParsedSdeFile {\n const content = readEntryAsString(entry);\n const parsed = yaml.load(content) as Record<\n string | number,\n Record<string, unknown>\n >;\n const records = new Map<string | number, Record<string, unknown>>(\n Object.entries(parsed).map(([key, value]) => {\n const numKey = Number(key);\n return [Number.isNaN(numKey) ? key : numKey, value];\n }),\n );\n\n return { filename, records };\n }\n}\n","export class SdeError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'SdeError';\n }\n}\n\nexport class SdeDatabaseError extends SdeError {\n public override readonly cause: unknown;\n\n constructor(message: string, cause?: unknown) {\n super(message);\n this.name = 'SdeDatabaseError';\n this.cause = cause;\n }\n}\n\nexport class SdeValidationError extends SdeError {\n public readonly validationError: unknown;\n public readonly entityType: string;\n public readonly entityId?: number;\n\n constructor(entityType: string, validationError: unknown, entityId?: number) {\n const idSuffix = entityId !== undefined ? ` (id: ${entityId})` : '';\n super(`SDE validation failed for ${entityType}${idSuffix}`);\n this.name = 'SdeValidationError';\n this.validationError = validationError;\n this.entityType = entityType;\n this.entityId = entityId;\n }\n}\n\nexport class SdeVersionMismatchError extends SdeError {\n public readonly expected: string;\n public readonly actual: string;\n\n constructor(expected: string, actual: string) {\n super(`SDE version mismatch: expected ${expected}, got ${actual}`);\n this.name = 'SdeVersionMismatchError';\n this.expected = expected;\n this.actual = actual;\n }\n}\n\nexport function isSdeError(error: unknown): error is SdeError {\n return error instanceof SdeError;\n}\n\nexport function isSdeDatabaseError(error: unknown): error is SdeDatabaseError {\n return error instanceof SdeDatabaseError;\n}\n\nexport function isSdeValidationError(\n error: unknown,\n): error is SdeValidationError {\n return error instanceof SdeValidationError;\n}\n\nexport function isSdeVersionMismatch(\n error: unknown,\n): error is SdeVersionMismatchError {\n return error instanceof SdeVersionMismatchError;\n}\n","export type SqliteValue = string | number | null;\n\nexport function extractLocale(\n field: unknown,\n locale: string = 'en',\n fallback: string = '',\n): string {\n if (field == null) return fallback;\n if (typeof field === 'string') return field;\n if (typeof field === 'object' && !Array.isArray(field)) {\n const map = field as Record<string, unknown>;\n // eslint-disable-next-line security/detect-object-injection\n const value = map[locale];\n if (typeof value === 'string') return value;\n return fallback;\n }\n return fallback;\n}\n\nexport function normalizeSdeFieldName(name: string): string {\n return name.replace(/ID(?=[A-Z]|$)/g, 'Id');\n}\n\n// eslint-disable-next-line sonarjs/function-return-type -- union return is intentional\nexport function toSqliteValue(value: unknown): SqliteValue {\n if (value == null) return null;\n if (typeof value === 'boolean') return value ? 1 : 0;\n if (typeof value === 'number') return value;\n if (typeof value === 'string') return value;\n if (typeof value === 'object') return JSON.stringify(value);\n return null;\n}\n\nfunction isLocaleMap(value: unknown): value is Record<string, string> {\n if (value == null || typeof value !== 'object' || Array.isArray(value)) {\n return false;\n }\n return 'en' in (value as Record<string, unknown>);\n}\n\nexport function transformRecord(\n entityId: number | string,\n raw: Record<string, unknown>,\n spec: { idAttribute: string; injectId: boolean },\n): Record<string, SqliteValue> {\n const row: Record<string, SqliteValue> = {};\n\n if (spec.injectId) {\n row[spec.idAttribute] =\n typeof entityId === 'string' ? entityId : Number(entityId);\n }\n\n for (const [key, value] of Object.entries(raw)) {\n const normalizedKey = normalizeSdeFieldName(key);\n\n if (isLocaleMap(value)) {\n row[normalizedKey] = extractLocale(value);\n } else {\n row[normalizedKey] = toSqliteValue(value);\n }\n }\n\n return row;\n}\n\nfunction normalizeNested(value: unknown): unknown {\n if (value == null || typeof value !== 'object') return value;\n if (Array.isArray(value)) return value.map(normalizeNested);\n const obj = value as Record<string, unknown>;\n if (isLocaleMap(obj)) return extractLocale(obj);\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(obj)) {\n out[normalizeSdeFieldName(k)] = normalizeNested(v);\n }\n return out;\n}\n\nexport function transformRecordNative(\n entityId: number | string,\n raw: Record<string, unknown>,\n spec: { idAttribute: string; injectId: boolean },\n): Record<string, unknown> {\n const row: Record<string, unknown> = {};\n\n if (spec.injectId) {\n row[spec.idAttribute] =\n typeof entityId === 'string' ? entityId : Number(entityId);\n }\n\n for (const [key, value] of Object.entries(raw)) {\n const normalizedKey = normalizeSdeFieldName(key);\n\n if (isLocaleMap(value)) {\n row[normalizedKey] = extractLocale(value);\n } else {\n row[normalizedKey] = normalizeNested(value);\n }\n }\n\n return row;\n}\n","import type { IStaticDataProvider } from './IStaticDataProvider';\nimport type {\n EveType,\n EveGroup,\n EveCategory,\n Region,\n Constellation,\n SolarSystem,\n Stargate,\n Star,\n Planet,\n Moon,\n AsteroidBelt,\n Faction,\n Race,\n Bloodline,\n Ancestry,\n NpcCorporation,\n NpcStation,\n MarketGroup,\n MetaGroup,\n Icon,\n Graphic,\n DogmaAttribute,\n DogmaEffect,\n Blueprint,\n PlanetSchematic,\n AgentType,\n AgentInSpace,\n Certificate,\n CharacterAttribute,\n CloneGrade,\n CorporationActivity,\n DogmaAttributeCategory,\n DogmaUnit,\n IndustryActivity,\n Landmark,\n NotificationType,\n NpcCharacter,\n NpcCorporationDivision,\n School,\n SecondarySun,\n Skin,\n SkinLicense,\n StationOperation,\n StationService,\n TypeDogma,\n TypeMaterial,\n TypeBonus,\n Mission,\n Dungeon,\n EpicArc,\n} from './types';\nimport type { SdeVersionInfo } from './version';\n\nexport interface MemorySdeData {\n types?: EveType[];\n groups?: EveGroup[];\n categories?: EveCategory[];\n regions?: Region[];\n constellations?: Constellation[];\n solarSystems?: SolarSystem[];\n stargates?: Stargate[];\n stars?: Star[];\n planets?: Planet[];\n moons?: Moon[];\n asteroidBelts?: AsteroidBelt[];\n factions?: Faction[];\n races?: Race[];\n bloodlines?: Bloodline[];\n ancestries?: Ancestry[];\n npcCorporations?: NpcCorporation[];\n npcStations?: NpcStation[];\n marketGroups?: MarketGroup[];\n metaGroups?: MetaGroup[];\n icons?: Icon[];\n graphics?: Graphic[];\n dogmaAttributes?: DogmaAttribute[];\n dogmaEffects?: DogmaEffect[];\n blueprints?: Blueprint[];\n planetSchematics?: PlanetSchematic[];\n agentTypes?: AgentType[];\n agentsInSpace?: AgentInSpace[];\n certificates?: Certificate[];\n characterAttributes?: CharacterAttribute[];\n cloneGrades?: CloneGrade[];\n corporationActivities?: CorporationActivity[];\n dogmaAttributeCategories?: DogmaAttributeCategory[];\n dogmaUnits?: DogmaUnit[];\n industryActivities?: IndustryActivity[];\n landmarks?: Landmark[];\n notificationTypes?: NotificationType[];\n npcCharacters?: NpcCharacter[];\n npcCorporationDivisions?: NpcCorporationDivision[];\n schools?: School[];\n secondarySuns?: SecondarySun[];\n skins?: Skin[];\n skinLicenses?: SkinLicense[];\n stationOperations?: StationOperation[];\n stationServices?: StationService[];\n typeDogma?: TypeDogma[];\n typeMaterials?: TypeMaterial[];\n typeBonuses?: TypeBonus[];\n missions?: Mission[];\n dungeons?: Dungeon[];\n epicArcs?: EpicArc[];\n version?: Partial<SdeVersionInfo>;\n}\n\nexport class MemorySdeProvider implements IStaticDataProvider {\n private data: Map<string, Map<number | string, unknown>> = new Map();\n private versionInfo: SdeVersionInfo;\n\n constructor(data: MemorySdeData = {}) {\n const register = <T>(\n key: string,\n items: T[] | undefined,\n idFn: (item: T) => number | string,\n ): void => {\n this.data.set(\n key,\n new Map((items ?? []).map((item) => [idFn(item), item])),\n );\n };\n\n register('eve_types', data.types, (t) => t.typeId);\n register('eve_groups', data.groups, (g) => g.groupId);\n register('eve_categories', data.categories, (c) => c.categoryId);\n register('eve_regions', data.regions, (r) => r.regionId);\n register(\n 'eve_constellations',\n data.constellations,\n (c) => c.constellationId,\n );\n register('eve_solar_systems', data.solarSystems, (s) => s.systemId);\n register('eve_stargates', data.stargates, (s) => s.stargateId);\n register('eve_stars', data.stars, (s) => s.starId);\n register('eve_planets', data.planets, (p) => p.planetId);\n register('eve_moons', data.moons, (m) => m.moonId);\n register('eve_asteroid_belts', data.asteroidBelts, (a) => a.asteroidBeltId);\n register('eve_factions', data.factions, (f) => f.factionId);\n register('eve_races', data.races, (r) => r.raceId);\n register('eve_bloodlines', data.bloodlines, (b) => b.bloodlineId);\n register('eve_ancestries', data.ancestries, (a) => a.ancestryId);\n register(\n 'eve_npc_corporations',\n data.npcCorporations,\n (c) => c.corporationId,\n );\n register('eve_npc_stations', data.npcStations, (s) => s.stationId);\n register('eve_market_groups', data.marketGroups, (g) => g.marketGroupId);\n register('eve_meta_groups', data.metaGroups, (g) => g.metaGroupId);\n register('eve_icons', data.icons, (i) => i.iconId);\n register('eve_graphics', data.graphics, (g) => g.graphicId);\n register(\n 'eve_dogma_attributes',\n data.dogmaAttributes,\n (a) => a.attributeId,\n );\n register('eve_dogma_effects', data.dogmaEffects, (e) => e.effectId);\n register('eve_blueprints', data.blueprints, (b) => b.blueprintTypeId);\n register(\n 'eve_planet_schematics',\n data.planetSchematics,\n (s) => s.planetSchematicId,\n );\n register('eve_agent_types', data.agentTypes, (a) => a.agentTypeId);\n register('eve_agents_in_space', data.agentsInSpace, (a) => a.characterId);\n register('eve_certificates', data.certificates, (c) => c.certificateId);\n register(\n 'eve_character_attributes',\n data.characterAttributes,\n (c) => c.attributeId,\n );\n register('eve_clone_grades', data.cloneGrades, (c) => c.cloneGradeId);\n register(\n 'eve_corporation_activities',\n data.corporationActivities,\n (c) => c.corporationActivityId,\n );\n register(\n 'eve_dogma_attribute_categories',\n data.dogmaAttributeCategories,\n (d) => d.attributeCategoryId,\n );\n register('eve_dogma_units', data.dogmaUnits, (d) => d.unitId);\n register(\n 'eve_industry_activities',\n data.industryActivities,\n (i) => i.industryActivityId,\n );\n register('eve_landmarks', data.landmarks, (l) => l.landmarkId);\n register(\n 'eve_notification_types',\n data.notificationTypes,\n (n) => n.notificationTypeId,\n );\n register('eve_npc_characters', data.npcCharacters, (n) => n.characterId);\n register(\n 'eve_npc_corporation_divisions',\n data.npcCorporationDivisions,\n (n) => n.npcCorporationDivisionId,\n );\n register('eve_schools', data.schools, (s) => s.schoolId);\n register('eve_secondary_suns', data.secondarySuns, (s) => s.secondarySunId);\n register('eve_skins', data.skins, (s) => s.skinId);\n register('eve_skin_licenses', data.skinLicenses, (s) => s.licenseTypeId);\n register(\n 'eve_station_operations',\n data.stationOperations,\n (s) => s.stationOperationId,\n );\n register(\n 'eve_station_services',\n data.stationServices,\n (s) => s.stationServiceId,\n );\n register('eve_type_dogma', data.typeDogma, (t) => t.typeId);\n register('eve_type_materials', data.typeMaterials, (t) => t.typeId);\n register('eve_type_bonuses', data.typeBonuses, (t) => t.typeId);\n register('eve_missions', data.missions, (m) => m.missionId);\n register('eve_dungeons', data.dungeons, (d) => d.dungeonId);\n register('eve_epic_arcs', data.epicArcs, (e) => e.epicArcId);\n\n this.versionInfo = {\n version: data.version?.version ?? '1.0.0-test',\n buildDate: data.version?.buildDate ?? '2024-01-01T00:00:00Z',\n importedAt: data.version?.importedAt ?? '2024-01-01T00:00:00Z',\n checksum: data.version?.checksum,\n };\n }\n\n private getById<T>(table: string, id: number | string): T | null {\n return (this.data.get(table)?.get(id) as T) ?? null;\n }\n\n private getAllFrom<T>(table: string): T[] {\n const map = this.data.get(table);\n return map ? (Array.from(map.values()) as T[]) : [];\n }\n\n private filterBy<T>(table: string, field: string, value: unknown): T[] {\n return this.getAllFrom<T>(table).filter(\n (item) => (item as Record<string, unknown>)[field] === value,\n );\n }\n\n private searchBy<T>(\n table: string,\n field: string,\n query: string,\n limit = 25,\n ): T[] {\n const lowerQuery = query.toLowerCase();\n const results: T[] = [];\n for (const item of this.getAllFrom<T>(table)) {\n const val = (item as Record<string, unknown>)[field];\n if (typeof val === 'string' && val.toLowerCase().includes(lowerQuery)) {\n results.push(item);\n if (results.length >= limit) break;\n }\n }\n return results;\n }\n\n // --- Types, Groups, Categories ---\n getType(typeId: number): EveType | null {\n return this.getById('eve_types', typeId);\n }\n getTypesByGroup(groupId: number): EveType[] {\n return this.filterBy('eve_types', 'groupId', groupId);\n }\n getGroup(groupId: number): EveGroup | null {\n return this.getById('eve_groups', groupId);\n }\n getGroupsByCategory(categoryId: number): EveGroup[] {\n return this.filterBy('eve_groups', 'categoryId', categoryId);\n }\n getCategory(categoryId: number): EveCategory | null {\n return this.getById('eve_categories', categoryId);\n }\n getAllCategories(): EveCategory[] {\n return this.getAllFrom('eve_categories');\n }\n\n // --- Regions, Constellations, Solar Systems, Stargates ---\n getRegion(regionId: number): Region | null {\n return this.getById('eve_regions', regionId);\n }\n getAllRegions(): Region[] {\n return this.getAllFrom('eve_regions');\n }\n getConstellation(constellationId: number): Constellation | null {\n return this.getById('eve_constellations', constellationId);\n }\n getConstellationsByRegion(regionId: number): Constellation[] {\n return this.filterBy('eve_constellations', 'regionId', regionId);\n }\n getSolarSystem(systemId: number): SolarSystem | null {\n return this.getById('eve_solar_systems', systemId);\n }\n getSolarSystemsByConstellation(constellationId: number): SolarSystem[] {\n return this.filterBy(\n 'eve_solar_systems',\n 'constellationId',\n constellationId,\n );\n }\n getStargate(stargateId: number): Stargate | null {\n return this.getById('eve_stargates', stargateId);\n }\n getStargatesBySystem(systemId: number): Stargate[] {\n return this.filterBy('eve_stargates', 'solarSystemId', systemId);\n }\n\n // --- Search ---\n searchTypesByName(query: string, limit = 25): EveType[] {\n return this.searchBy('eve_types', 'name', query, limit);\n }\n searchSolarSystemsByName(query: string, limit = 25): SolarSystem[] {\n return this.searchBy('eve_solar_systems', 'name', query, limit);\n }\n\n // --- Universe ---\n getStar(starId: number): Star | null {\n return this.getById('eve_stars', starId);\n }\n getStarBySystem(systemId: number): Star | null {\n return (\n this.filterBy<Star>('eve_stars', 'solarSystemId', systemId)[0] ?? null\n );\n }\n getPlanet(planetId: number): Planet | null {\n return this.getById('eve_planets', planetId);\n }\n getPlanetsBySystem(systemId: number): Planet[] {\n return this.filterBy('eve_planets', 'solarSystemId', systemId);\n }\n getMoon(moonId: number): Moon | null {\n return this.getById('eve_moons', moonId);\n }\n getMoonsBySystem(systemId: number): Moon[] {\n return this.filterBy('eve_moons', 'solarSystemId', systemId);\n }\n getAsteroidBelt(asteroidBeltId: number): AsteroidBelt | null {\n return this.getById('eve_asteroid_belts', asteroidBeltId);\n }\n getAsteroidBeltsBySystem(systemId: number): AsteroidBelt[] {\n return this.filterBy('eve_asteroid_belts', 'solarSystemId', systemId);\n }\n\n // --- Character/Lore ---\n getFaction(factionId: number): Faction | null {\n return this.getById('eve_factions', factionId);\n }\n getAllFactions(): Faction[] {\n return this.getAllFrom('eve_factions');\n }\n getRace(raceId: number): Race | null {\n return this.getById('eve_races', raceId);\n }\n getAllRaces(): Race[] {\n return this.getAllFrom('eve_races');\n }\n getBloodline(bloodlineId: number): Bloodline | null {\n return this.getById('eve_bloodlines', bloodlineId);\n }\n getBloodlinesByRace(raceId: number): Bloodline[] {\n return this.filterBy('eve_bloodlines', 'raceId', raceId);\n }\n getAncestry(ancestryId: number): Ancestry | null {\n return this.getById('eve_ancestries', ancestryId);\n }\n getAncestriesByBloodline(bloodlineId: number): Ancestry[] {\n return this.filterBy('eve_ancestries', 'bloodlineId', bloodlineId);\n }\n\n // --- NPC Infrastructure ---\n getNpcCorporation(corporationId: number): NpcCorporation | null {\n return this.getById('eve_npc_corporations', corporationId);\n }\n getNpcCorporationsByFaction(factionId: number): NpcCorporation[] {\n return this.filterBy('eve_npc_corporations', 'factionId', factionId);\n }\n getNpcStation(stationId: number): NpcStation | null {\n return this.getById('eve_npc_stations', stationId);\n }\n getNpcStationsBySystem(systemId: number): NpcStation[] {\n return this.filterBy('eve_npc_stations', 'solarSystemId', systemId);\n }\n getNpcStationsByOwner(ownerId: number): NpcStation[] {\n return this.filterBy('eve_npc_stations', 'ownerId', ownerId);\n }\n\n // --- Market ---\n getMarketGroup(marketGroupId: number): MarketGroup | null {\n return this.getById('eve_market_groups', marketGroupId);\n }\n getMarketGroupsByParent(parentGroupId: number): MarketGroup[] {\n return this.filterBy('eve_market_groups', 'parentGroupId', parentGroupId);\n }\n getRootMarketGroups(): MarketGroup[] {\n return this.getAllFrom<MarketGroup>('eve_market_groups').filter(\n (g) => g.parentGroupId === null,\n );\n }\n getTypesByMarketGroup(marketGroupId: number): EveType[] {\n return this.filterBy('eve_types', 'marketGroupId', marketGroupId);\n }\n searchMarketGroupsByName(query: string, limit = 25): MarketGroup[] {\n return this.searchBy('eve_market_groups', 'name', query, limit);\n }\n\n // --- Meta/UI ---\n getMetaGroup(metaGroupId: number): MetaGroup | null {\n return this.getById('eve_meta_groups', metaGroupId);\n }\n getAllMetaGroups(): MetaGroup[] {\n return this.getAllFrom('eve_meta_groups');\n }\n getIcon(iconId: number): Icon | null {\n return this.getById('eve_icons', iconId);\n }\n getGraphic(graphicId: number): Graphic | null {\n return this.getById('eve_graphics', graphicId);\n }\n\n // --- Dogma ---\n getDogmaAttribute(attributeId: number): DogmaAttribute | null {\n return this.getById('eve_dogma_attributes', attributeId);\n }\n searchDogmaAttributesByName(query: string, limit = 25): DogmaAttribute[] {\n return this.searchBy('eve_dogma_attributes', 'name', query, limit);\n }\n getDogmaEffect(effectId: number): DogmaEffect | null {\n return this.getById('eve_dogma_effects', effectId);\n }\n searchDogmaEffectsByName(query: string, limit = 25): DogmaEffect[] {\n return this.searchBy('eve_dogma_effects', 'name', query, limit);\n }\n getDogmaAttributeCategory(\n attributeCategoryId: number,\n ): DogmaAttributeCategory | null {\n return this.getById('eve_dogma_attribute_categories', attributeCategoryId);\n }\n getAllDogmaAttributeCategories(): DogmaAttributeCategory[] {\n return this.getAllFrom('eve_dogma_attribute_categories');\n }\n getDogmaUnit(unitId: number): DogmaUnit | null {\n return this.getById('eve_dogma_units', unitId);\n }\n getAllDogmaUnits(): DogmaUnit[] {\n return this.getAllFrom('eve_dogma_units');\n }\n\n // --- Industry ---\n getBlueprint(blueprintTypeId: number): Blueprint | null {\n return this.getById('eve_blueprints', blueprintTypeId);\n }\n getPlanetSchematic(planetSchematicId: number): PlanetSchematic | null {\n return this.getById('eve_planet_schematics', planetSchematicId);\n }\n getAllPlanetSchematics(): PlanetSchematic[] {\n return this.getAllFrom('eve_planet_schematics');\n }\n getIndustryActivity(industryActivityId: number): IndustryActivity | null {\n return this.getById('eve_industry_activities', industryActivityId);\n }\n getAllIndustryActivities(): IndustryActivity[] {\n return this.getAllFrom('eve_industry_activities');\n }\n\n // --- Agent System ---\n getAgentType(agentTypeId: number): AgentType | null {\n return this.getById('eve_agent_types', agentTypeId);\n }\n getAllAgentTypes(): AgentType[] {\n return this.getAllFrom('eve_agent_types');\n }\n getAgentInSpace(characterId: number): AgentInSpace | null {\n return this.getById('eve_agents_in_space', characterId);\n }\n getAgentsInSpaceBySystem(systemId: number): AgentInSpace[] {\n return this.filterBy('eve_agents_in_space', 'solarSystemId', systemId);\n }\n\n // --- Certificates ---\n getCertificate(certificateId: number): Certificate | null {\n return this.getById('eve_certificates', certificateId);\n }\n getAllCertificates(): Certificate[] {\n return this.getAllFrom('eve_certificates');\n }\n\n // --- Character Attributes ---\n getCharacterAttribute(attributeId: number): CharacterAttribute | null {\n return this.getById('eve_character_attributes', attributeId);\n }\n getAllCharacterAttributes(): CharacterAttribute[] {\n return this.getAllFrom('eve_character_attributes');\n }\n\n // --- NPC Characters ---\n getNpcCharacter(characterId: number): NpcCharacter | null {\n return this.getById('eve_npc_characters', characterId);\n }\n getNpcCharactersByCorporation(corporationId: number): NpcCharacter[] {\n return this.filterBy('eve_npc_characters', 'corporationId', corporationId);\n }\n searchNpcCharactersByName(query: string, limit = 25): NpcCharacter[] {\n return this.searchBy('eve_npc_characters', 'name', query, limit);\n }\n\n // --- Clone Grades ---\n getCloneGrade(cloneGradeId: number): CloneGrade | null {\n return this.getById('eve_clone_grades', cloneGradeId);\n }\n getAllCloneGrades(): CloneGrade[] {\n return this.getAllFrom('eve_clone_grades');\n }\n\n // --- Corporation Reference ---\n getCorporationActivity(\n corporationActivityId: number,\n ): CorporationActivity | null {\n return this.getById('eve_corporation_activities', corporationActivityId);\n }\n getAllCorporationActivities(): CorporationActivity[] {\n return this.getAllFrom('eve_corporation_activities');\n }\n getNpcCorporationDivision(\n npcCorporationDivisionId: number,\n ): NpcCorporationDivision | null {\n return this.getById(\n 'eve_npc_corporation_divisions',\n npcCorporationDivisionId,\n );\n }\n getAllNpcCorporationDivisions(): NpcCorporationDivision[] {\n return this.getAllFrom('eve_npc_corporation_divisions');\n }\n\n // --- Landmarks ---\n getLandmark(landmarkId: number): Landmark | null {\n return this.getById('eve_landmarks', landmarkId);\n }\n getAllLandmarks(): Landmark[] {\n return this.getAllFrom('eve_landmarks');\n }\n\n // --- Notifications ---\n getNotificationType(notificationTypeId: number): NotificationType | null {\n return this.getById('eve_notification_types', notificationTypeId);\n }\n\n // --- Schools ---\n getSchool(schoolId: number): School | null {\n return this.getById('eve_schools', schoolId);\n }\n getAllSchools(): School[] {\n return this.getAllFrom('eve_schools');\n }\n\n // --- Secondary Suns ---\n getSecondarySun(secondarySunId: number): SecondarySun | null {\n return this.getById('eve_secondary_suns', secondarySunId);\n }\n getSecondarySunsBySystem(systemId: number): SecondarySun[] {\n return this.filterBy('eve_secondary_suns', 'solarSystemId', systemId);\n }\n\n // --- Skins ---\n getSkin(skinId: number): Skin | null {\n return this.getById('eve_skins', skinId);\n }\n getSkinLicense(licenseTypeId: number): SkinLicense | null {\n return this.getById('eve_skin_licenses', licenseTypeId);\n }\n getSkinLicensesBySkin(skinId: number): SkinLicense[] {\n return this.filterBy('eve_skin_licenses', 'skinId', skinId);\n }\n\n // --- Station Operations & Services ---\n getStationOperation(stationOperationId: number): StationOperation | null {\n return this.getById('eve_station_operations', stationOperationId);\n }\n getAllStationOperations(): StationOperation[] {\n return this.getAllFrom('eve_station_operations');\n }\n getStationService(stationServiceId: number): StationService | null {\n return this.getById('eve_station_services', stationServiceId);\n }\n getAllStationServices(): StationService[] {\n return this.getAllFrom('eve_station_services');\n }\n\n // --- Type Extensions ---\n getTypeDogma(typeId: number): TypeDogma | null {\n return this.getById('eve_type_dogma', typeId);\n }\n getTypeMaterial(typeId: number): TypeMaterial | null {\n return this.getById('eve_type_materials', typeId);\n }\n getTypeBonus(typeId: number): TypeBonus | null {\n return this.getById('eve_type_bonuses', typeId);\n }\n\n // --- Missions & Content ---\n getMission(missionId: number): Mission | null {\n return this.getById('eve_missions', missionId);\n }\n getDungeon(dungeonId: number): Dungeon | null {\n return this.getById('eve_dungeons', dungeonId);\n }\n getEpicArc(epicArcId: number): EpicArc | null {\n return this.getById('eve_epic_arcs', epicArcId);\n }\n getAllEpicArcs(): EpicArc[] {\n return this.getAllFrom('eve_epic_arcs');\n }\n\n // --- Generic accessor ---\n getEntity<T = Record<string, unknown>>(\n tableName: string,\n id: number | string,\n ): T | null {\n return this.getById<T>(tableName, id);\n }\n\n getAllEntities<T = Record<string, unknown>>(tableName: string): T[] {\n return this.getAllFrom<T>(tableName);\n }\n\n // --- Version & Lifecycle ---\n getVersion(): SdeVersionInfo {\n return { ...this.versionInfo };\n }\n\n close(): void {\n this.data.clear();\n }\n}\n","import type {\n EveType,\n EveGroup,\n EveCategory,\n Region,\n Constellation,\n SolarSystem,\n Stargate,\n Star,\n Planet,\n Moon,\n AsteroidBelt,\n Faction,\n Race,\n Bloodline,\n Ancestry,\n NpcCorporation,\n NpcStation,\n MarketGroup,\n MetaGroup,\n Icon,\n Graphic,\n DogmaAttribute,\n DogmaEffect,\n Blueprint,\n PlanetSchematic,\n} from './types';\nimport type { SdeVersionInfo } from './version';\nimport type { MemorySdeData } from './MemorySdeProvider';\n\nexport class SdeTestDataFactory {\n static createEveType(overrides: Partial<EveType> = {}): EveType {\n return {\n typeId: 34,\n groupId: 18,\n mass: 1,\n name: 'Tritanium',\n portionSize: 1,\n published: true,\n packagedVolume: null,\n volume: 0.01,\n radius: null,\n description: 'The most common mineral in the known universe.',\n graphicId: 20,\n soundId: null,\n iconId: null,\n raceId: null,\n basePrice: 4,\n marketGroupId: 1857,\n capacity: null,\n isRepackable: null,\n ...overrides,\n };\n }\n\n static createEveGroup(overrides: Partial<EveGroup> = {}): EveGroup {\n return {\n groupId: 18,\n anchorable: false,\n anchored: false,\n categoryId: 4,\n fittableNonSingleton: false,\n name: 'Mineral',\n published: true,\n useBasePrice: true,\n iconId: null,\n ...overrides,\n };\n }\n\n static createEveCategory(overrides: Partial<EveCategory> = {}): EveCategory {\n return {\n categoryId: 4,\n name: 'Material',\n published: true,\n iconId: null,\n ...overrides,\n };\n }\n\n static createRegion(overrides: Partial<Region> = {}): Region {\n return {\n regionId: 10000002,\n constellationIDs: [20000020],\n description: 'The Forge is the industrial heart of the Caldari State.',\n factionId: 500001,\n name: 'The Forge',\n nebulaId: 10,\n position: { x: -9.6e16, y: 6.0e16, z: -1.1e17 },\n wormholeClassId: 0,\n ...overrides,\n };\n }\n\n static createConstellation(\n overrides: Partial<Constellation> = {},\n ): Constellation {\n return {\n constellationId: 20000020,\n factionId: 500001,\n name: 'Kimotoro',\n position: { x: -9.7e16, y: 6.1e16, z: -1.15e17 },\n regionId: 10000002,\n solarSystemIDs: [30000142, 30000144],\n wormholeClassId: 0,\n ...overrides,\n };\n }\n\n static createSolarSystem(overrides: Partial<SolarSystem> = {}): SolarSystem {\n return {\n systemId: 30000142,\n border: false,\n constellationId: 20000020,\n hub: true,\n international: false,\n luminosity: 0.02142,\n name: 'Jita',\n planetIDs: [40009077],\n position: { x: -1.29e17, y: 6.07e16, z: -1.12e17 },\n position2D: { x: -1.29e17, y: -1.12e17 },\n radius: 4.67e12,\n regionId: 10000002,\n regional: false,\n securityClass: 'B',\n securityStatus: 0.9459991455078125,\n starId: 40009082,\n stargateIDs: [50001248],\n corridor: null,\n fringe: null,\n wormholeClassId: null,\n visualEffect: null,\n ...overrides,\n };\n }\n\n static createStargate(overrides: Partial<Stargate> = {}): Stargate {\n return {\n stargateId: 50001248,\n destination: { solarSystemId: 30000144, stargateId: 50001249 },\n position: { x: 1.5e12, y: 3.2e11, z: -8.7e11 },\n solarSystemId: 30000142,\n typeId: 16,\n ...overrides,\n };\n }\n\n static createStar(overrides: Partial<Star> = {}): Star {\n return {\n starId: 40009082,\n radius: 346600000,\n solarSystemId: 30000142,\n statistics: {\n age: 76000000000,\n life: 100000000000,\n luminosity: 0.02142,\n locked: false,\n spectralClass: 'K7 V',\n temperature: 4000,\n },\n typeId: 3796,\n ...overrides,\n };\n }\n\n static createPlanet(overrides: Partial<Planet> = {}): Planet {\n return {\n planetId: 40009077,\n asteroidBeltIDs: [40009079],\n attributes: {},\n celestialIndex: 1,\n moonIDs: [40009078],\n orbitId: 40009082,\n position: { x: 1.2e13, y: 1e11, z: -3.5e12 },\n radius: 2330000,\n solarSystemId: 30000142,\n statistics: {},\n typeId: 2015,\n npcStationIDs: null,\n ...overrides,\n };\n }\n\n static createMoon(overrides: Partial<Moon> = {}): Moon {\n return {\n moonId: 40009078,\n attributes: {},\n celestialIndex: 1,\n orbitId: 40009077,\n orbitIndex: 1,\n position: { x: 1.21e13, y: 1.01e11, z: -3.51e12 },\n radius: 240000,\n solarSystemId: 30000142,\n statistics: {},\n typeId: 14,\n npcStationIDs: null,\n ...overrides,\n };\n }\n\n static createAsteroidBelt(\n overrides: Partial<AsteroidBelt> = {},\n ): AsteroidBelt {\n return {\n asteroidBeltId: 40009079,\n celestialIndex: 1,\n orbitId: 40009077,\n orbitIndex: 1,\n position: { x: 1.19e13, y: 9.9e10, z: -3.49e12 },\n radius: 50000,\n solarSystemId: 30000142,\n statistics: {},\n typeId: 15,\n ...overrides,\n };\n }\n\n static createFaction(overrides: Partial<Faction> = {}): Faction {\n return {\n factionId: 500001,\n corporationId: 1000035,\n description: 'The Caldari State is a corporate dictatorship.',\n flatLogo: 'res:/ui/texture/corps/caldari.png',\n flatLogoWithName: 'res:/ui/texture/corps/caldari_name.png',\n iconId: 1439,\n memberRaces: [1],\n militiaCorporationId: 1000180,\n name: 'Caldari State',\n shortDescription: 'Caldari',\n sizeFactor: 5,\n solarSystemId: 30000142,\n uniqueName: true,\n ...overrides,\n };\n }\n\n static createRace(overrides: Partial<Race> = {}): Race {\n return {\n raceId: 1,\n description: 'The Caldari State is a corporate dictatorship.',\n iconId: 1439,\n name: 'Caldari',\n shipTypeId: 601,\n skills: {},\n ...overrides,\n };\n }\n\n static createBloodline(overrides: Partial<Bloodline> = {}): Bloodline {\n return {\n bloodlineId: 1,\n charisma: 3,\n corporationId: 1000006,\n description: 'The Deteis are regarded as the face of the Caldari State.',\n iconId: 1383,\n intelligence: 7,\n memory: 7,\n name: 'Deteis',\n perception: 5,\n raceId: 1,\n willpower: 5,\n ...overrides,\n };\n }\n\n static createAncestry(overrides: Partial<Ancestry> = {}): Ancestry {\n return {\n ancestryId: 1,\n bloodlineId: 1,\n charisma: 0,\n description: 'Born and raised in a capsule.',\n iconId: 1664,\n intelligence: 0,\n memory: 0,\n name: 'Tube Child',\n perception: 0,\n shortDescription: 'Raised in a capsule.',\n willpower: 2,\n ...overrides,\n };\n }\n\n static createNpcCorporation(\n overrides: Partial<NpcCorporation> = {},\n ): NpcCorporation {\n return {\n corporationId: 1000035,\n ceoId: 3004451,\n deleted: false,\n description: 'The Caldari Navy is the armed forces of the Caldari State.',\n extent: 'G',\n hasPlayerPersonnelManager: false,\n initialPrice: 0,\n memberLimit: 0,\n minSecurity: 0,\n minimumJoinStanding: 0,\n name: 'Caldari Navy',\n sendCharTerminationMessage: true,\n shares: 100000,\n size: 'H',\n stationId: 60003760,\n taxRate: 0,\n tickerName: 'CN',\n uniqueName: true,\n allowedMemberRaces: null,\n corporationTrades: null,\n divisions: null,\n enemyId: null,\n factionId: 500001,\n friendId: null,\n iconId: 1439,\n investors: null,\n lpOfferTables: null,\n mainActivityId: null,\n raceId: 1,\n sizeFactor: null,\n solarSystemId: 30000142,\n secondaryActivityId: null,\n ...overrides,\n };\n }\n\n static createNpcStation(overrides: Partial<NpcStation> = {}): NpcStation {\n return {\n stationId: 60003760,\n celestialIndex: 4,\n operationId: 1,\n orbitId: 40009081,\n orbitIndex: 4,\n ownerId: 1000035,\n position: { x: 1.58e14, y: 9.63e12, z: 1.06e14 },\n reprocessingEfficiency: 0.5,\n reprocessingHangarFlag: 4,\n reprocessingStationsTake: 0.05,\n solarSystemId: 30000142,\n typeId: 1529,\n useOperationName: true,\n ...overrides,\n };\n }\n\n static createMarketGroup(overrides: Partial<MarketGroup> = {}): MarketGroup {\n return {\n marketGroupId: 1857,\n description: 'Refined minerals used in manufacturing.',\n hasTypes: true,\n iconId: 22,\n name: 'Minerals',\n parentGroupId: 1031,\n ...overrides,\n };\n }\n\n static createMetaGroup(overrides: Partial<MetaGroup> = {}): MetaGroup {\n return {\n metaGroupId: 1,\n color: { r: 255, g: 255, b: 255, a: 255 },\n name: 'Tech I',\n iconId: null,\n iconSuffix: null,\n description: null,\n ...overrides,\n };\n }\n\n static createIcon(overrides: Partial<Icon> = {}): Icon {\n return {\n iconId: 22,\n iconFile: 'res:/UI/Texture/Icons/22_32_2.png',\n ...overrides,\n };\n }\n\n static createGraphic(overrides: Partial<Graphic> = {}): Graphic {\n return {\n graphicId: 20,\n graphicFile: 'res:/dx9/model/worldobject/asteroid/oreveld001.red',\n iconFolder: null,\n sofFactionName: null,\n sofHullName: null,\n sofRaceName: null,\n ...overrides,\n };\n }\n\n static createDogmaAttribute(\n overrides: Partial<DogmaAttribute> = {},\n ): DogmaAttribute {\n return {\n attributeId: 9,\n attributeCategoryId: 1,\n dataType: 2,\n defaultValue: 0,\n description: 'Hit points for a ship.',\n displayWhenZero: false,\n highIsGood: true,\n name: 'hp',\n published: true,\n stackable: false,\n displayName: null,\n iconId: null,\n tooltipDescription: null,\n tooltipTitle: null,\n unitId: 1,\n chargeRechargeTimeId: null,\n maxAttributeId: null,\n minAttributeId: null,\n ...overrides,\n };\n }\n\n static createDogmaEffect(overrides: Partial<DogmaEffect> = {}): DogmaEffect {\n return {\n effectId: 11,\n disallowAutoRepeat: false,\n dischargeAttributeId: 0,\n durationAttributeId: 0,\n effectCategoryId: 0,\n electronicChance: false,\n guid: 'effects.LowSlotModifier',\n isAssistance: false,\n isOffensive: false,\n isWarpSafe: true,\n name: 'lowSlotModifier',\n propulsionChance: false,\n published: true,\n rangeChance: false,\n distribution: null,\n falloffAttributeId: null,\n rangeAttributeId: null,\n trackingSpeedAttributeId: null,\n description: null,\n displayName: null,\n iconId: null,\n modifierInfo: null,\n ...overrides,\n };\n }\n\n static createBlueprint(overrides: Partial<Blueprint> = {}): Blueprint {\n return {\n activities: {\n manufacturing: {\n time: 6000,\n materials: [\n { typeId: 34, quantity: 100 },\n { typeId: 35, quantity: 50 },\n ],\n products: [{ typeId: 587, quantity: 1 }],\n },\n },\n blueprintTypeId: 787,\n maxProductionLimit: 10,\n ...overrides,\n };\n }\n\n static createPlanetSchematic(\n overrides: Partial<PlanetSchematic> = {},\n ): PlanetSchematic {\n return {\n planetSchematicId: 65,\n cycleTime: 1800,\n name: 'Bacteria',\n pins: [],\n types: [],\n ...overrides,\n };\n }\n\n static createVersionInfo(\n overrides: Partial<SdeVersionInfo> = {},\n ): SdeVersionInfo {\n return {\n version: '2024-01-15.1',\n buildDate: '2024-01-15T00:00:00Z',\n importedAt: '2024-01-16T12:00:00Z',\n checksum: 'abc123def456',\n ...overrides,\n };\n }\n\n static createHierarchicalTestData(): MemorySdeData {\n const category = this.createEveCategory();\n const group = this.createEveGroup({ categoryId: category.categoryId });\n const type1 = this.createEveType({\n typeId: 34,\n name: 'Tritanium',\n groupId: group.groupId,\n });\n const type2 = this.createEveType({\n typeId: 35,\n name: 'Pyerite',\n groupId: group.groupId,\n });\n const type3 = this.createEveType({\n typeId: 36,\n name: 'Mexallon',\n groupId: group.groupId,\n });\n\n const region = this.createRegion();\n const constellation = this.createConstellation({\n regionId: region.regionId,\n });\n const system1 = this.createSolarSystem({\n systemId: 30000142,\n name: 'Jita',\n constellationId: constellation.constellationId,\n regionId: region.regionId,\n });\n const system2 = this.createSolarSystem({\n systemId: 30000144,\n name: 'Perimeter',\n constellationId: constellation.constellationId,\n regionId: region.regionId,\n securityStatus: 0.9,\n });\n const stargate = this.createStargate({\n solarSystemId: system1.systemId,\n destination: { solarSystemId: system2.systemId, stargateId: 50001249 },\n });\n\n const star = this.createStar({ solarSystemId: system1.systemId });\n const planet = this.createPlanet({ solarSystemId: system1.systemId });\n const moon = this.createMoon({ solarSystemId: system1.systemId });\n const asteroidBelt = this.createAsteroidBelt({\n solarSystemId: system1.systemId,\n });\n\n const race = this.createRace();\n const faction = this.createFaction({ memberRaces: [race.raceId] });\n const bloodline = this.createBloodline({ raceId: race.raceId });\n const ancestry = this.createAncestry({\n bloodlineId: bloodline.bloodlineId,\n });\n const npcCorp = this.createNpcCorporation({\n factionId: faction.factionId,\n raceId: race.raceId,\n });\n const npcStation = this.createNpcStation({\n solarSystemId: system1.systemId,\n ownerId: npcCorp.corporationId,\n });\n\n const rootMarketGroup = this.createMarketGroup({\n marketGroupId: 1031,\n name: 'Manufacture & Research',\n parentGroupId: null,\n hasTypes: false,\n });\n const marketGroup = this.createMarketGroup({\n parentGroupId: rootMarketGroup.marketGroupId,\n });\n const metaGroup = this.createMetaGroup();\n const icon = this.createIcon();\n const graphic = this.createGraphic();\n\n const dogmaAttribute = this.createDogmaAttribute();\n const dogmaEffect = this.createDogmaEffect();\n const blueprint = this.createBlueprint();\n const planetSchematic = this.createPlanetSchematic();\n\n return {\n categories: [category],\n groups: [group],\n types: [type1, type2, type3],\n regions: [region],\n constellations: [constellation],\n solarSystems: [system1, system2],\n stargates: [stargate],\n stars: [star],\n planets: [planet],\n moons: [moon],\n asteroidBelts: [asteroidBelt],\n factions: [faction],\n races: [race],\n bloodlines: [bloodline],\n ancestries: [ancestry],\n npcCorporations: [npcCorp],\n npcStations: [npcStation],\n marketGroups: [rootMarketGroup, marketGroup],\n metaGroups: [metaGroup],\n icons: [icon],\n graphics: [graphic],\n dogmaAttributes: [dogmaAttribute],\n dogmaEffects: [dogmaEffect],\n blueprints: [blueprint],\n planetSchematics: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vC,UAAM,OAAO,KAAK,WAAW;AAC7B,UAAM,UAAU,KAAK,cAAc;AAEnC,UAAM,iBAAiB,KAAK,qBAAqB;AACjD,UAAM,cAAc,KAAK,kBAAkB;AAC3C,UAAM,YAAY,KAAK,gBAAgB;AACvC,UAAM,kBAAkB,KAAK,sBAAsB;AAEnD,WAAO;AAAA,MACL,YAAY,CAAC,QAAQ;AAAA,MACrB,QAAQ,CAAC,KAAK;AAAA,MACd,OAAO,CAAC,OAAO,OAAO,KAAK;AAAA,MAC3B,SAAS,CAAC,MAAM;AAAA,MAChB,gBAAgB,CAAC,aAAa;AAAA,MAC9B,cAAc,CAAC,SAAS,OAAO;AAAA,MAC/B,WAAW,CAAC,QAAQ;AAAA,MACpB,OAAO,CAAC,IAAI;AAAA,MACZ,SAAS,CAAC,MAAM;AAAA,MAChB,OAAO,CAAC,IAAI;AAAA,MACZ,eAAe,CAAC,YAAY;AAAA,MAC5B,UAAU,CAAC,OAAO;AAAA,MAClB,OAAO,CAAC,IAAI;AAAA,MACZ,YAAY,CAAC,SAAS;AAAA,MACtB,YAAY,CAAC,QAAQ;AAAA,MACrB,iBAAiB,CAAC,OAAO;AAAA,MACzB,aAAa,CAAC,UAAU;AAAA,MACxB,cAAc,CAAC,iBAAiB,WAAW;AAAA,MAC3C,YAAY,CAAC,SAAS;AAAA,MACtB,OAAO,CAAC,IAAI;AAAA,MACZ,UAAU,CAAC,OAAO;AAAA,MAClB,iBAAiB,CAAC,cAAc;AAAA,MAChC,cAAc,CAAC,WAAW;AAAA,MAC1B,YAAY,CAAC,SAAS;AAAA,MACtB,kBAAkB,CAAC,eAAe;AAAA,MAClC,SAAS,KAAK,kBAAkB;AAAA,IAClC;AAAA,EACF;AACF;","names":["exports","module","exports","exports","module","path","err","fd","dir","exports","module","path","fs","exports","module","exports","module","exports","module","exports","module","exports","exports","module","exports","module","exports","module","exports","exports","module","exports","module","exports","module","join","options","err","resolve","content","fileAttr","result","date","Schema","tag","line","YAMLException","strTag","ch","AdmZip"]}
1
+ {"version":3,"sources":["../../src/sde/index.ts","../../src/sde/SdeDataProvider.ts","../../src/sde/ingestion/constants.ts","../../src/sde/ingestion/SdeExtractor.ts","../../src/sde/errors.ts","../../src/sde/ingestion/transforms.ts","../../src/sde/MemorySdeProvider.ts","../../src/sde/SdeTestDataFactory.ts"],"sourcesContent":["export type { IStaticDataProvider } from './IStaticDataProvider';\n\nexport { SdeDataProvider } from './SdeDataProvider';\nexport { MemorySdeProvider } from './MemorySdeProvider';\nexport type { MemorySdeData } from './MemorySdeProvider';\n\nexport type {\n Position3D,\n Position2D,\n StarStatistics,\n StargateDestination,\n BlueprintMaterial,\n BlueprintProduct,\n BlueprintActivity,\n BlueprintActivities,\n AccountingEntryType,\n AgentType,\n AgentInSpace,\n Ancestry,\n AppliedProximityEffect,\n Archetype,\n AsteroidBelt,\n Bloodline,\n Blueprint,\n EveCategory,\n Certificate,\n CharacterAttribute,\n CharacterTitle,\n CloneGrade,\n CompressibleType,\n Constellation,\n ContrabandType,\n ControlTowerResource,\n CorporationActivity,\n CorporationRoleGroup,\n CorporationRole,\n DbuffCollection,\n DogmaAttributeCategory,\n DogmaAttribute,\n DogmaEffect,\n DogmaUnit,\n Dungeon,\n DynamicItemAttribute,\n EpicArc,\n ExpertSystem,\n Faction,\n FighterAbility,\n FighterAbilityByType,\n FreelanceJobSchema,\n GraphicMaterialSet,\n Graphic,\n EveGroup,\n Icon,\n IndustryActivity,\n IndustryAssemblyLine,\n IndustryInstallationType,\n IndustryModifierSource,\n IndustryTargetFilter,\n Landmark,\n LinkWithShip,\n MarketGroup,\n Mastery,\n MercenaryTacticalOperation,\n MetaGroup,\n MetenoxMoonDrill,\n MilitaryCampaignObjective,\n MilitaryCampaign,\n Mission,\n Moon,\n NotificationType,\n NpcCharacter,\n NpcCorporationDivision,\n NpcCorporation,\n NpcStation,\n PlanetResource,\n PlanetSchematic,\n Planet,\n ProximityTrap,\n Race,\n Region,\n SchoolMap,\n School,\n SecondarySun,\n ShipTreeElement,\n ShipTreeFaction,\n ShipTreeGroup,\n SkillPlan,\n SkinLicense,\n SkinMaterial,\n SkinrComponentCategory,\n SkinrComponentPointValue,\n SkinrComponentRarity,\n SkinrComponent,\n SkinrSlotCategory,\n SkinrSlotConfiguration,\n SkinrSlotName,\n SkinrSlot,\n SkinrSlotToMaterial,\n SkinrTierThreshold,\n Skin,\n SolarSystem,\n SovereigntyUpgrade,\n Stargate,\n Star,\n StationOperation,\n StationService,\n StationStandingsRestriction,\n SystemDbuffEmitter,\n SystemWideEffect,\n TranslationLanguage,\n TypeBonus,\n TypeDogma,\n TypeElement,\n TypeList,\n TypeMaterial,\n EveType,\n} from './types';\n\nexport type { SdeVersionInfo } from './version';\n\nexport {\n SdeError,\n SdeDatabaseError,\n SdeValidationError,\n SdeVersionMismatchError,\n isSdeError,\n isSdeDatabaseError,\n isSdeValidationError,\n isSdeVersionMismatch,\n} from './errors';\n\nexport { SdeTestDataFactory } from './SdeTestDataFactory';\n","import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport * as yaml from 'js-yaml';\nimport type { IStaticDataProvider } from './IStaticDataProvider';\nimport type {\n EveType,\n EveGroup,\n EveCategory,\n Region,\n Constellation,\n SolarSystem,\n Stargate,\n Star,\n Planet,\n Moon,\n AsteroidBelt,\n Faction,\n Race,\n Bloodline,\n Ancestry,\n NpcCorporation,\n NpcStation,\n MarketGroup,\n MetaGroup,\n Icon,\n Graphic,\n DogmaAttribute,\n DogmaEffect,\n Blueprint,\n PlanetSchematic,\n AgentType,\n AgentInSpace,\n Certificate,\n CharacterAttribute,\n CloneGrade,\n CorporationActivity,\n DogmaAttributeCategory,\n DogmaUnit,\n IndustryActivity,\n Landmark,\n NotificationType,\n NpcCharacter,\n NpcCorporationDivision,\n School,\n SecondarySun,\n Skin,\n SkinLicense,\n StationOperation,\n StationService,\n TypeDogma,\n TypeMaterial,\n TypeBonus,\n Mission,\n Dungeon,\n EpicArc,\n} from './types';\nimport type { SdeVersionInfo } from './version';\nimport { SDE_FILE_REGISTRY } from './ingestion/constants';\nimport type { SdeFileSpec } from './ingestion/constants';\nimport { SdeExtractor } from './ingestion/SdeExtractor';\nimport { transformRecordNative } from './ingestion/transforms';\nimport { SdeError } from './errors';\n\nexport class SdeDataProvider implements IStaticDataProvider {\n private entities = new Map<\n string,\n Map<number | string, Record<string, unknown>>\n >();\n private fkIndexes = new Map<\n string,\n Map<unknown, Record<string, unknown>[]>\n >();\n private versionInfo: SdeVersionInfo;\n\n private constructor(version: SdeVersionInfo) {\n this.versionInfo = version;\n }\n\n static fromDirectory(dirPath: string): SdeDataProvider {\n const resolvedDir = path.resolve(dirPath);\n if (!fs.existsSync(resolvedDir)) {\n throw new SdeError(`SDE directory not found: ${resolvedDir}`);\n }\n\n let version: SdeVersionInfo = {\n version: 'unknown',\n buildDate: 'unknown',\n importedAt: new Date().toISOString(),\n };\n\n const metaPath = path.join(resolvedDir, '_sde.yaml');\n if (fs.existsSync(metaPath)) {\n const metaContent = fs.readFileSync(metaPath, 'utf-8');\n const parsed = yaml.load(metaContent) as Record<string, unknown>;\n const sdeBlock = (parsed.sde ?? parsed) as Record<string, unknown>;\n const bn = sdeBlock.buildNumber;\n const rd = sdeBlock.releaseDate;\n version = {\n version:\n typeof bn === 'string' || typeof bn === 'number'\n ? String(bn)\n : 'unknown',\n buildDate:\n typeof rd === 'string' || typeof rd === 'number'\n ? String(rd)\n : 'unknown',\n importedAt: new Date().toISOString(),\n };\n }\n\n const provider = new SdeDataProvider(version);\n\n for (const spec of SDE_FILE_REGISTRY) {\n const filePath = path.join(resolvedDir, spec.yamlFile);\n if (!fs.existsSync(filePath)) continue;\n\n const content = fs.readFileSync(filePath, 'utf-8');\n const parsed = yaml.load(content) as Record<\n string | number,\n Record<string, unknown>\n > | null;\n if (!parsed || typeof parsed !== 'object') continue;\n\n provider.loadRecords(spec, parsed);\n }\n\n return provider;\n }\n\n static fromZip(zipPath: string): SdeDataProvider {\n const resolvedPath = path.resolve(zipPath);\n if (!fs.existsSync(resolvedPath)) {\n throw new SdeError(`SDE ZIP file not found: ${resolvedPath}`);\n }\n\n const extractor = new SdeExtractor();\n const metadata = extractor.readMetadata(resolvedPath);\n\n const version: SdeVersionInfo = {\n version: metadata.buildNumber || 'unknown',\n buildDate: metadata.releaseDate || 'unknown',\n importedAt: new Date().toISOString(),\n };\n\n const provider = new SdeDataProvider(version);\n\n const yamlFiles = SDE_FILE_REGISTRY.map((s) => s.yamlFile);\n const parsedFiles = extractor.parseFiles(resolvedPath, yamlFiles);\n const specMap = new Map(SDE_FILE_REGISTRY.map((s) => [s.yamlFile, s]));\n\n for (const file of parsedFiles) {\n const spec = specMap.get(file.filename);\n if (!spec) continue;\n\n const rawEntries: Record<string | number, Record<string, unknown>> = {};\n for (const [key, value] of file.records) {\n rawEntries[key] = value;\n }\n provider.loadRecords(spec, rawEntries);\n }\n\n return provider;\n }\n\n private loadRecords(\n spec: SdeFileSpec,\n raw: Record<string | number, Record<string, unknown>>,\n ): void {\n const records = new Map<number | string, Record<string, unknown>>();\n for (const [key, value] of Object.entries(raw)) {\n if (value == null || typeof value !== 'object') continue;\n const id = spec.idType === 'string' ? key : Number(key);\n const transformed = transformRecordNative(id, value, spec);\n records.set(id, transformed);\n }\n this.entities.set(spec.tableName, records);\n }\n\n // ---------------------------------------------------------------\n // Generic helpers\n // ---------------------------------------------------------------\n\n private getById<T>(tableName: string, id: number | string): T | null {\n const table = this.entities.get(tableName);\n if (!table) return null;\n const row = table.get(id);\n return (row as T) ?? null;\n }\n\n private getByFk<T>(\n tableName: string,\n fkField: string,\n fkValue: unknown,\n ): T[] {\n const indexKey = `${tableName}:${fkField}`;\n let index = this.fkIndexes.get(indexKey);\n if (!index) {\n index = new Map();\n const table = this.entities.get(tableName);\n if (table) {\n for (const row of table.values()) {\n const val = row[fkField];\n if (val == null) continue;\n const existing = index.get(val);\n if (existing) existing.push(row);\n else index.set(val, [row]);\n }\n }\n this.fkIndexes.set(indexKey, index);\n }\n return (index.get(fkValue) ?? []) as T[];\n }\n\n private getAllRecords<T>(tableName: string): T[] {\n const table = this.entities.get(tableName);\n if (!table) return [];\n return Array.from(table.values()) as T[];\n }\n\n private search<T>(\n tableName: string,\n field: string,\n query: string,\n limit: number,\n ): T[] {\n const table = this.entities.get(tableName);\n if (!table) return [];\n const lowerQuery = query.toLowerCase();\n const results: T[] = [];\n for (const row of table.values()) {\n const val = row[field];\n if (typeof val === 'string' && val.toLowerCase().includes(lowerQuery)) {\n results.push(row as T);\n if (results.length >= limit) break;\n }\n }\n return results;\n }\n\n private filterBy<T>(\n tableName: string,\n predicate: (row: Record<string, unknown>) => boolean,\n ): T[] {\n const table = this.entities.get(tableName);\n if (!table) return [];\n const results: T[] = [];\n for (const row of table.values()) {\n if (predicate(row)) results.push(row as T);\n }\n return results;\n }\n\n // ---------------------------------------------------------------\n // Generic entity accessors (for niche entities)\n // ---------------------------------------------------------------\n\n getEntity<T = Record<string, unknown>>(\n tableName: string,\n id: number | string,\n ): T | null {\n return this.getById<T>(tableName, id);\n }\n\n getAllEntities<T = Record<string, unknown>>(tableName: string): T[] {\n return this.getAllRecords<T>(tableName);\n }\n\n // ---------------------------------------------------------------\n // Types, Groups, Categories\n // ---------------------------------------------------------------\n\n getType(typeId: number): EveType | null {\n return this.getById<EveType>('eve_types', typeId);\n }\n\n getTypesByGroup(groupId: number): EveType[] {\n return this.getByFk<EveType>('eve_types', 'groupId', groupId);\n }\n\n getGroup(groupId: number): EveGroup | null {\n return this.getById<EveGroup>('eve_groups', groupId);\n }\n\n getGroupsByCategory(categoryId: number): EveGroup[] {\n return this.getByFk<EveGroup>('eve_groups', 'categoryId', categoryId);\n }\n\n getCategory(categoryId: number): EveCategory | null {\n return this.getById<EveCategory>('eve_categories', categoryId);\n }\n\n getAllCategories(): EveCategory[] {\n return this.getAllRecords<EveCategory>('eve_categories');\n }\n\n // ---------------------------------------------------------------\n // Regions, Constellations, Solar Systems, Stargates\n // ---------------------------------------------------------------\n\n getRegion(regionId: number): Region | null {\n return this.getById<Region>('eve_regions', regionId);\n }\n\n getAllRegions(): Region[] {\n return this.getAllRecords<Region>('eve_regions');\n }\n\n getConstellation(constellationId: number): Constellation | null {\n return this.getById<Constellation>('eve_constellations', constellationId);\n }\n\n getConstellationsByRegion(regionId: number): Constellation[] {\n return this.getByFk<Constellation>(\n 'eve_constellations',\n 'regionId',\n regionId,\n );\n }\n\n getSolarSystem(systemId: number): SolarSystem | null {\n return this.getById<SolarSystem>('eve_solar_systems', systemId);\n }\n\n getSolarSystemsByConstellation(constellationId: number): SolarSystem[] {\n return this.getByFk<SolarSystem>(\n 'eve_solar_systems',\n 'constellationId',\n constellationId,\n );\n }\n\n getStargate(stargateId: number): Stargate | null {\n return this.getById<Stargate>('eve_stargates', stargateId);\n }\n\n getStargatesBySystem(systemId: number): Stargate[] {\n return this.getByFk<Stargate>('eve_stargates', 'solarSystemId', systemId);\n }\n\n // ---------------------------------------------------------------\n // Search\n // ---------------------------------------------------------------\n\n searchTypesByName(query: string, limit = 25): EveType[] {\n return this.search<EveType>('eve_types', 'name', query, limit);\n }\n\n searchSolarSystemsByName(query: string, limit = 25): SolarSystem[] {\n return this.search<SolarSystem>('eve_solar_systems', 'name', query, limit);\n }\n\n // ---------------------------------------------------------------\n // Universe\n // ---------------------------------------------------------------\n\n getStar(starId: number): Star | null {\n return this.getById<Star>('eve_stars', starId);\n }\n\n getStarBySystem(systemId: number): Star | null {\n const stars = this.getByFk<Star>('eve_stars', 'solarSystemId', systemId);\n return stars[0] ?? null;\n }\n\n getPlanet(planetId: number): Planet | null {\n return this.getById<Planet>('eve_planets', planetId);\n }\n\n getPlanetsBySystem(systemId: number): Planet[] {\n return this.getByFk<Planet>('eve_planets', 'solarSystemId', systemId);\n }\n\n getMoon(moonId: number): Moon | null {\n return this.getById<Moon>('eve_moons', moonId);\n }\n\n getMoonsBySystem(systemId: number): Moon[] {\n return this.getByFk<Moon>('eve_moons', 'solarSystemId', systemId);\n }\n\n getAsteroidBelt(asteroidBeltId: number): AsteroidBelt | null {\n return this.getById<AsteroidBelt>('eve_asteroid_belts', asteroidBeltId);\n }\n\n getAsteroidBeltsBySystem(systemId: number): AsteroidBelt[] {\n return this.getByFk<AsteroidBelt>(\n 'eve_asteroid_belts',\n 'solarSystemId',\n systemId,\n );\n }\n\n // ---------------------------------------------------------------\n // Character/Lore\n // ---------------------------------------------------------------\n\n getFaction(factionId: number): Faction | null {\n return this.getById<Faction>('eve_factions', factionId);\n }\n\n getAllFactions(): Faction[] {\n return this.getAllRecords<Faction>('eve_factions');\n }\n\n getRace(raceId: number): Race | null {\n return this.getById<Race>('eve_races', raceId);\n }\n\n getAllRaces(): Race[] {\n return this.getAllRecords<Race>('eve_races');\n }\n\n getBloodline(bloodlineId: number): Bloodline | null {\n return this.getById<Bloodline>('eve_bloodlines', bloodlineId);\n }\n\n getBloodlinesByRace(raceId: number): Bloodline[] {\n return this.getByFk<Bloodline>('eve_bloodlines', 'raceId', raceId);\n }\n\n getAncestry(ancestryId: number): Ancestry | null {\n return this.getById<Ancestry>('eve_ancestries', ancestryId);\n }\n\n getAncestriesByBloodline(bloodlineId: number): Ancestry[] {\n return this.getByFk<Ancestry>('eve_ancestries', 'bloodlineId', bloodlineId);\n }\n\n // ---------------------------------------------------------------\n // NPC Infrastructure\n // ---------------------------------------------------------------\n\n getNpcCorporation(corporationId: number): NpcCorporation | null {\n return this.getById<NpcCorporation>('eve_npc_corporations', corporationId);\n }\n\n getNpcCorporationsByFaction(factionId: number): NpcCorporation[] {\n return this.getByFk<NpcCorporation>(\n 'eve_npc_corporations',\n 'factionId',\n factionId,\n );\n }\n\n getNpcStation(stationId: number): NpcStation | null {\n return this.getById<NpcStation>('eve_npc_stations', stationId);\n }\n\n getNpcStationsBySystem(systemId: number): NpcStation[] {\n return this.getByFk<NpcStation>(\n 'eve_npc_stations',\n 'solarSystemId',\n systemId,\n );\n }\n\n getNpcStationsByOwner(ownerId: number): NpcStation[] {\n return this.getByFk<NpcStation>('eve_npc_stations', 'ownerId', ownerId);\n }\n\n // ---------------------------------------------------------------\n // Market\n // ---------------------------------------------------------------\n\n getMarketGroup(marketGroupId: number): MarketGroup | null {\n return this.getById<MarketGroup>('eve_market_groups', marketGroupId);\n }\n\n getMarketGroupsByParent(parentGroupId: number): MarketGroup[] {\n return this.getByFk<MarketGroup>(\n 'eve_market_groups',\n 'parentGroupId',\n parentGroupId,\n );\n }\n\n getRootMarketGroups(): MarketGroup[] {\n return this.filterBy<MarketGroup>(\n 'eve_market_groups',\n (r) => r.parentGroupId == null,\n );\n }\n\n getTypesByMarketGroup(marketGroupId: number): EveType[] {\n return this.getByFk<EveType>('eve_types', 'marketGroupId', marketGroupId);\n }\n\n searchMarketGroupsByName(query: string, limit = 25): MarketGroup[] {\n return this.search<MarketGroup>('eve_market_groups', 'name', query, limit);\n }\n\n // ---------------------------------------------------------------\n // Meta/UI\n // ---------------------------------------------------------------\n\n getMetaGroup(metaGroupId: number): MetaGroup | null {\n return this.getById<MetaGroup>('eve_meta_groups', metaGroupId);\n }\n\n getAllMetaGroups(): MetaGroup[] {\n return this.getAllRecords<MetaGroup>('eve_meta_groups');\n }\n\n getIcon(iconId: number): Icon | null {\n return this.getById<Icon>('eve_icons', iconId);\n }\n\n getGraphic(graphicId: number): Graphic | null {\n return this.getById<Graphic>('eve_graphics', graphicId);\n }\n\n // ---------------------------------------------------------------\n // Dogma\n // ---------------------------------------------------------------\n\n getDogmaAttribute(attributeId: number): DogmaAttribute | null {\n return this.getById<DogmaAttribute>('eve_dogma_attributes', attributeId);\n }\n\n searchDogmaAttributesByName(query: string, limit = 25): DogmaAttribute[] {\n return this.search<DogmaAttribute>(\n 'eve_dogma_attributes',\n 'name',\n query,\n limit,\n );\n }\n\n getDogmaEffect(effectId: number): DogmaEffect | null {\n return this.getById<DogmaEffect>('eve_dogma_effects', effectId);\n }\n\n searchDogmaEffectsByName(query: string, limit = 25): DogmaEffect[] {\n return this.search<DogmaEffect>('eve_dogma_effects', 'name', query, limit);\n }\n\n // ---------------------------------------------------------------\n // Industry\n // ---------------------------------------------------------------\n\n getBlueprint(blueprintTypeId: number): Blueprint | null {\n return this.getById<Blueprint>('eve_blueprints', blueprintTypeId);\n }\n\n getPlanetSchematic(planetSchematicId: number): PlanetSchematic | null {\n return this.getById<PlanetSchematic>(\n 'eve_planet_schematics',\n planetSchematicId,\n );\n }\n\n getAllPlanetSchematics(): PlanetSchematic[] {\n return this.getAllRecords<PlanetSchematic>('eve_planet_schematics');\n }\n\n // ---------------------------------------------------------------\n // Agent System\n // ---------------------------------------------------------------\n\n getAgentType(agentTypeId: number): AgentType | null {\n return this.getById<AgentType>('eve_agent_types', agentTypeId);\n }\n\n getAllAgentTypes(): AgentType[] {\n return this.getAllRecords<AgentType>('eve_agent_types');\n }\n\n getAgentInSpace(characterId: number): AgentInSpace | null {\n return this.getById<AgentInSpace>('eve_agents_in_space', characterId);\n }\n\n getAgentsInSpaceBySystem(systemId: number): AgentInSpace[] {\n return this.getByFk<AgentInSpace>(\n 'eve_agents_in_space',\n 'solarSystemId',\n systemId,\n );\n }\n\n // ---------------------------------------------------------------\n // Certificates\n // ---------------------------------------------------------------\n\n getCertificate(certificateId: number): Certificate | null {\n return this.getById<Certificate>('eve_certificates', certificateId);\n }\n\n getAllCertificates(): Certificate[] {\n return this.getAllRecords<Certificate>('eve_certificates');\n }\n\n // ---------------------------------------------------------------\n // Character Attributes\n // ---------------------------------------------------------------\n\n getCharacterAttribute(attributeId: number): CharacterAttribute | null {\n return this.getById<CharacterAttribute>(\n 'eve_character_attributes',\n attributeId,\n );\n }\n\n getAllCharacterAttributes(): CharacterAttribute[] {\n return this.getAllRecords<CharacterAttribute>('eve_character_attributes');\n }\n\n // ---------------------------------------------------------------\n // NPC Characters\n // ---------------------------------------------------------------\n\n getNpcCharacter(characterId: number): NpcCharacter | null {\n return this.getById<NpcCharacter>('eve_npc_characters', characterId);\n }\n\n getNpcCharactersByCorporation(corporationId: number): NpcCharacter[] {\n return this.getByFk<NpcCharacter>(\n 'eve_npc_characters',\n 'corporationId',\n corporationId,\n );\n }\n\n searchNpcCharactersByName(query: string, limit = 25): NpcCharacter[] {\n return this.search<NpcCharacter>(\n 'eve_npc_characters',\n 'name',\n query,\n limit,\n );\n }\n\n // ---------------------------------------------------------------\n // Clone Grades\n // ---------------------------------------------------------------\n\n getCloneGrade(cloneGradeId: number): CloneGrade | null {\n return this.getById<CloneGrade>('eve_clone_grades', cloneGradeId);\n }\n\n getAllCloneGrades(): CloneGrade[] {\n return this.getAllRecords<CloneGrade>('eve_clone_grades');\n }\n\n // ---------------------------------------------------------------\n // Corporation Reference\n // ---------------------------------------------------------------\n\n getCorporationActivity(\n corporationActivityId: number,\n ): CorporationActivity | null {\n return this.getById<CorporationActivity>(\n 'eve_corporation_activities',\n corporationActivityId,\n );\n }\n\n getAllCorporationActivities(): CorporationActivity[] {\n return this.getAllRecords<CorporationActivity>(\n 'eve_corporation_activities',\n );\n }\n\n getNpcCorporationDivision(\n npcCorporationDivisionId: number,\n ): NpcCorporationDivision | null {\n return this.getById<NpcCorporationDivision>(\n 'eve_npc_corporation_divisions',\n npcCorporationDivisionId,\n );\n }\n\n getAllNpcCorporationDivisions(): NpcCorporationDivision[] {\n return this.getAllRecords<NpcCorporationDivision>(\n 'eve_npc_corporation_divisions',\n );\n }\n\n // ---------------------------------------------------------------\n // Dogma Reference\n // ---------------------------------------------------------------\n\n getDogmaAttributeCategory(\n attributeCategoryId: number,\n ): DogmaAttributeCategory | null {\n return this.getById<DogmaAttributeCategory>(\n 'eve_dogma_attribute_categories',\n attributeCategoryId,\n );\n }\n\n getAllDogmaAttributeCategories(): DogmaAttributeCategory[] {\n return this.getAllRecords<DogmaAttributeCategory>(\n 'eve_dogma_attribute_categories',\n );\n }\n\n getDogmaUnit(unitId: number): DogmaUnit | null {\n return this.getById<DogmaUnit>('eve_dogma_units', unitId);\n }\n\n getAllDogmaUnits(): DogmaUnit[] {\n return this.getAllRecords<DogmaUnit>('eve_dogma_units');\n }\n\n // ---------------------------------------------------------------\n // Industry Reference\n // ---------------------------------------------------------------\n\n getIndustryActivity(industryActivityId: number): IndustryActivity | null {\n return this.getById<IndustryActivity>(\n 'eve_industry_activities',\n industryActivityId,\n );\n }\n\n getAllIndustryActivities(): IndustryActivity[] {\n return this.getAllRecords<IndustryActivity>('eve_industry_activities');\n }\n\n // ---------------------------------------------------------------\n // Landmarks\n // ---------------------------------------------------------------\n\n getLandmark(landmarkId: number): Landmark | null {\n return this.getById<Landmark>('eve_landmarks', landmarkId);\n }\n\n getAllLandmarks(): Landmark[] {\n return this.getAllRecords<Landmark>('eve_landmarks');\n }\n\n // ---------------------------------------------------------------\n // Notifications\n // ---------------------------------------------------------------\n\n getNotificationType(notificationTypeId: number): NotificationType | null {\n return this.getById<NotificationType>(\n 'eve_notification_types',\n notificationTypeId,\n );\n }\n\n // ---------------------------------------------------------------\n // Schools\n // ---------------------------------------------------------------\n\n getSchool(schoolId: number): School | null {\n return this.getById<School>('eve_schools', schoolId);\n }\n\n getAllSchools(): School[] {\n return this.getAllRecords<School>('eve_schools');\n }\n\n // ---------------------------------------------------------------\n // Secondary Suns\n // ---------------------------------------------------------------\n\n getSecondarySun(secondarySunId: number): SecondarySun | null {\n return this.getById<SecondarySun>('eve_secondary_suns', secondarySunId);\n }\n\n getSecondarySunsBySystem(systemId: number): SecondarySun[] {\n return this.getByFk<SecondarySun>(\n 'eve_secondary_suns',\n 'solarSystemId',\n systemId,\n );\n }\n\n // ---------------------------------------------------------------\n // Skins\n // ---------------------------------------------------------------\n\n getSkin(skinId: number): Skin | null {\n return this.getById<Skin>('eve_skins', skinId);\n }\n\n getSkinLicense(licenseTypeId: number): SkinLicense | null {\n return this.getById<SkinLicense>('eve_skin_licenses', licenseTypeId);\n }\n\n getSkinLicensesBySkin(skinId: number): SkinLicense[] {\n return this.getByFk<SkinLicense>('eve_skin_licenses', 'skinId', skinId);\n }\n\n // ---------------------------------------------------------------\n // Station Operations & Services\n // ---------------------------------------------------------------\n\n getStationOperation(stationOperationId: number): StationOperation | null {\n return this.getById<StationOperation>(\n 'eve_station_operations',\n stationOperationId,\n );\n }\n\n getAllStationOperations(): StationOperation[] {\n return this.getAllRecords<StationOperation>('eve_station_operations');\n }\n\n getStationService(stationServiceId: number): StationService | null {\n return this.getById<StationService>(\n 'eve_station_services',\n stationServiceId,\n );\n }\n\n getAllStationServices(): StationService[] {\n return this.getAllRecords<StationService>('eve_station_services');\n }\n\n // ---------------------------------------------------------------\n // Type Properties\n // ---------------------------------------------------------------\n\n getTypeDogma(typeId: number): TypeDogma | null {\n return this.getById<TypeDogma>('eve_type_dogma', typeId);\n }\n\n getTypeMaterial(typeId: number): TypeMaterial | null {\n return this.getById<TypeMaterial>('eve_type_materials', typeId);\n }\n\n getTypeBonus(typeId: number): TypeBonus | null {\n return this.getById<TypeBonus>('eve_type_bonuses', typeId);\n }\n\n // ---------------------------------------------------------------\n // Missions & Content\n // ---------------------------------------------------------------\n\n getMission(missionId: number): Mission | null {\n return this.getById<Mission>('eve_missions', missionId);\n }\n\n getDungeon(dungeonId: number): Dungeon | null {\n return this.getById<Dungeon>('eve_dungeons', dungeonId);\n }\n\n getEpicArc(epicArcId: number): EpicArc | null {\n return this.getById<EpicArc>('eve_epic_arcs', epicArcId);\n }\n\n getAllEpicArcs(): EpicArc[] {\n return this.getAllRecords<EpicArc>('eve_epic_arcs');\n }\n\n // ---------------------------------------------------------------\n // Version & Lifecycle\n // ---------------------------------------------------------------\n\n getVersion(): SdeVersionInfo {\n return { ...this.versionInfo };\n }\n\n close(): void {\n this.entities.clear();\n this.fkIndexes.clear();\n }\n}\n","export const SDE_DOWNLOAD_URL =\n 'https://developers.eveonline.com/static-data/eve-online-static-data-latest-yaml.zip';\n\nexport const SDE_LATEST_BUILD_URL =\n 'https://developers.eveonline.com/static-data/tranquility/latest.jsonl';\n\nexport const SDE_BUILD_NUMBER_HEADER = 'x-sde-build-number';\n\nexport const SDE_METADATA_FILENAME = '_sde.yaml';\n\nexport interface SdeFileSpec {\n readonly yamlFile: string;\n readonly tableName: string;\n readonly idAttribute: string;\n readonly idType: 'number' | 'string';\n readonly injectId: boolean;\n}\n\nexport const SDE_FILE_REGISTRY: readonly SdeFileSpec[] = [\n // --- Universe / Map ---\n {\n yamlFile: 'mapRegions.yaml',\n tableName: 'eve_regions',\n idAttribute: 'regionId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'mapConstellations.yaml',\n tableName: 'eve_constellations',\n idAttribute: 'constellationId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'mapSolarSystems.yaml',\n tableName: 'eve_solar_systems',\n idAttribute: 'systemId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'mapStargates.yaml',\n tableName: 'eve_stargates',\n idAttribute: 'stargateId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'mapStars.yaml',\n tableName: 'eve_stars',\n idAttribute: 'starId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'mapPlanets.yaml',\n tableName: 'eve_planets',\n idAttribute: 'planetId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'mapMoons.yaml',\n tableName: 'eve_moons',\n idAttribute: 'moonId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'mapAsteroidBelts.yaml',\n tableName: 'eve_asteroid_belts',\n idAttribute: 'asteroidBeltId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'mapSecondarySuns.yaml',\n tableName: 'eve_secondary_suns',\n idAttribute: 'secondarySunId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Type System ---\n {\n yamlFile: 'types.yaml',\n tableName: 'eve_types',\n idAttribute: 'typeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'groups.yaml',\n tableName: 'eve_groups',\n idAttribute: 'groupId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'categories.yaml',\n tableName: 'eve_categories',\n idAttribute: 'categoryId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'metaGroups.yaml',\n tableName: 'eve_meta_groups',\n idAttribute: 'metaGroupId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'typeDogma.yaml',\n tableName: 'eve_type_dogma',\n idAttribute: 'typeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'typeBonus.yaml',\n tableName: 'eve_type_bonuses',\n idAttribute: 'typeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'typeElements.yaml',\n tableName: 'eve_type_elements',\n idAttribute: 'typeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'typeLists.yaml',\n tableName: 'eve_type_lists',\n idAttribute: 'typeListId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'typeMaterials.yaml',\n tableName: 'eve_type_materials',\n idAttribute: 'typeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'compressibleTypes.yaml',\n tableName: 'eve_compressible_types',\n idAttribute: 'typeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'contrabandTypes.yaml',\n tableName: 'eve_contraband_types',\n idAttribute: 'typeId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Dogma ---\n {\n yamlFile: 'dogmaAttributes.yaml',\n tableName: 'eve_dogma_attributes',\n idAttribute: 'attributeId',\n idType: 'number',\n injectId: false,\n },\n {\n yamlFile: 'dogmaEffects.yaml',\n tableName: 'eve_dogma_effects',\n idAttribute: 'effectId',\n idType: 'number',\n injectId: false,\n },\n {\n yamlFile: 'dogmaAttributeCategories.yaml',\n tableName: 'eve_dogma_attribute_categories',\n idAttribute: 'attributeCategoryId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'dogmaUnits.yaml',\n tableName: 'eve_dogma_units',\n idAttribute: 'unitId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Industry ---\n {\n yamlFile: 'blueprints.yaml',\n tableName: 'eve_blueprints',\n idAttribute: 'blueprintTypeId',\n idType: 'number',\n injectId: false,\n },\n {\n yamlFile: 'planetSchematics.yaml',\n tableName: 'eve_planet_schematics',\n idAttribute: 'planetSchematicId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'planetResources.yaml',\n tableName: 'eve_planet_resources',\n idAttribute: 'planetId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Market ---\n {\n yamlFile: 'marketGroups.yaml',\n tableName: 'eve_market_groups',\n idAttribute: 'marketGroupId',\n idType: 'number',\n injectId: true,\n },\n\n // --- NPCs / Agents ---\n {\n yamlFile: 'agentTypes.yaml',\n tableName: 'eve_agent_types',\n idAttribute: 'agentTypeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'agentsInSpace.yaml',\n tableName: 'eve_agents_in_space',\n idAttribute: 'characterId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'npcCharacters.yaml',\n tableName: 'eve_npc_characters',\n idAttribute: 'characterId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'npcCorporations.yaml',\n tableName: 'eve_npc_corporations',\n idAttribute: 'corporationId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'npcCorporationDivisions.yaml',\n tableName: 'eve_npc_corporation_divisions',\n idAttribute: 'npcCorporationDivisionId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'npcStations.yaml',\n tableName: 'eve_npc_stations',\n idAttribute: 'stationId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'factions.yaml',\n tableName: 'eve_factions',\n idAttribute: 'factionId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Character / Lore ---\n {\n yamlFile: 'races.yaml',\n tableName: 'eve_races',\n idAttribute: 'raceId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'bloodlines.yaml',\n tableName: 'eve_bloodlines',\n idAttribute: 'bloodlineId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'ancestries.yaml',\n tableName: 'eve_ancestries',\n idAttribute: 'ancestryId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'characterAttributes.yaml',\n tableName: 'eve_character_attributes',\n idAttribute: 'attributeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'characterTitles.yaml',\n tableName: 'eve_character_titles',\n idAttribute: 'characterTitleId',\n idType: 'string',\n injectId: false,\n },\n {\n yamlFile: 'cloneGrades.yaml',\n tableName: 'eve_clone_grades',\n idAttribute: 'cloneGradeId',\n idType: 'number',\n injectId: true,\n },\n\n // --- SKINs ---\n {\n yamlFile: 'skins.yaml',\n tableName: 'eve_skins',\n idAttribute: 'skinId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'skinLicenses.yaml',\n tableName: 'eve_skin_licenses',\n idAttribute: 'licenseTypeId',\n idType: 'number',\n injectId: false,\n },\n {\n yamlFile: 'skinMaterials.yaml',\n tableName: 'eve_skin_materials',\n idAttribute: 'skinMaterialId',\n idType: 'number',\n injectId: false,\n },\n\n // --- SKINR ---\n {\n yamlFile: 'skinrComponents.yaml',\n tableName: 'eve_skinr_components',\n idAttribute: 'skinrComponentId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'skinrComponentCategories.yaml',\n tableName: 'eve_skinr_component_categories',\n idAttribute: 'skinrComponentCategoryId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'skinrComponentRarities.yaml',\n tableName: 'eve_skinr_component_rarities',\n idAttribute: 'skinrComponentRarityId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'skinrComponentPointValues.yaml',\n tableName: 'eve_skinr_component_point_values',\n idAttribute: 'skinrComponentCategoryId',\n idType: 'number',\n injectId: false,\n },\n {\n yamlFile: 'skinrSlots.yaml',\n tableName: 'eve_skinr_slots',\n idAttribute: 'skinrSlotId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'skinrSlotCategories.yaml',\n tableName: 'eve_skinr_slot_categories',\n idAttribute: 'skinrSlotCategoryId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'skinrSlotConfigurations.yaml',\n tableName: 'eve_skinr_slot_configurations',\n idAttribute: 'skinrSlotConfigurationId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'skinrSlotNames.yaml',\n tableName: 'eve_skinr_slot_names',\n idAttribute: 'skinrSlotNameId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'skinrTierThresholds.yaml',\n tableName: 'eve_skinr_tier_thresholds',\n idAttribute: 'shipTreeGroupId',\n idType: 'number',\n injectId: false,\n },\n\n // --- Ship Tree ---\n {\n yamlFile: 'shipTreeElements.yaml',\n tableName: 'eve_ship_tree_elements',\n idAttribute: 'shipTreeElementId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'shipTreeFactions.yaml',\n tableName: 'eve_ship_tree_factions',\n idAttribute: 'factionId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'shipTreeGroups.yaml',\n tableName: 'eve_ship_tree_groups',\n idAttribute: 'shipTreeGroupId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Graphics ---\n {\n yamlFile: 'graphics.yaml',\n tableName: 'eve_graphics',\n idAttribute: 'graphicId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'graphicMaterialSets.yaml',\n tableName: 'eve_graphic_material_sets',\n idAttribute: 'materialSetId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'icons.yaml',\n tableName: 'eve_icons',\n idAttribute: 'iconId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Stations ---\n {\n yamlFile: 'stationOperations.yaml',\n tableName: 'eve_station_operations',\n idAttribute: 'stationOperationId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'stationServices.yaml',\n tableName: 'eve_station_services',\n idAttribute: 'stationServiceId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Sovereignty ---\n {\n yamlFile: 'sovereigntyUpgrades.yaml',\n tableName: 'eve_sovereignty_upgrades',\n idAttribute: 'typeId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Certificates / Masteries ---\n {\n yamlFile: 'certificates.yaml',\n tableName: 'eve_certificates',\n idAttribute: 'certificateId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'masteries.yaml',\n tableName: 'eve_masteries',\n idAttribute: 'typeId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Misc ---\n {\n yamlFile: 'archetypes.yaml',\n tableName: 'eve_archetypes',\n idAttribute: 'archetypeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'controlTowerResources.yaml',\n tableName: 'eve_control_tower_resources',\n idAttribute: 'typeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'corporationActivities.yaml',\n tableName: 'eve_corporation_activities',\n idAttribute: 'corporationActivityId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'dbuffCollections.yaml',\n tableName: 'eve_dbuff_collections',\n idAttribute: 'dbuffCollectionId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'dungeons.yaml',\n tableName: 'eve_dungeons',\n idAttribute: 'dungeonId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'dynamicItemAttributes.yaml',\n tableName: 'eve_dynamic_item_attributes',\n idAttribute: 'dynamicItemAttributeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'epicArcs.yaml',\n tableName: 'eve_epic_arcs',\n idAttribute: 'epicArcId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'freelanceJobSchemas.yaml',\n tableName: 'eve_freelance_job_schemas',\n idAttribute: 'freelanceJobSchemaGroupId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'landmarks.yaml',\n tableName: 'eve_landmarks',\n idAttribute: 'landmarkId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'mercenaryTacticalOperations.yaml',\n tableName: 'eve_mercenary_tactical_operations',\n idAttribute: 'mercenaryTacticalOperationId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'militaryCampaigns.yaml',\n tableName: 'eve_military_campaigns',\n idAttribute: 'militaryCampaignId',\n idType: 'string',\n injectId: true,\n },\n {\n yamlFile: 'militaryCampaignObjectives.yaml',\n tableName: 'eve_military_campaign_objectives',\n idAttribute: 'militaryCampaignObjectiveId',\n idType: 'string',\n injectId: true,\n },\n {\n yamlFile: 'missions.yaml',\n tableName: 'eve_missions',\n idAttribute: 'missionId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Translation ---\n {\n yamlFile: 'translationLanguages.yaml',\n tableName: 'eve_translation_languages',\n idAttribute: 'translationLanguageId',\n idType: 'string',\n injectId: true,\n },\n\n // --- Industry (extended) ---\n {\n yamlFile: 'industryActivities.yaml',\n tableName: 'eve_industry_activities',\n idAttribute: 'industryActivityId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'industryAssemblyLines.yaml',\n tableName: 'eve_industry_assembly_lines',\n idAttribute: 'assemblyLineId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'industryInstallationTypes.yaml',\n tableName: 'eve_industry_installation_types',\n idAttribute: 'installationTypeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'industryModifierSources.yaml',\n tableName: 'eve_industry_modifier_sources',\n idAttribute: 'modifierSourceId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'industryTargetFilters.yaml',\n tableName: 'eve_industry_target_filters',\n idAttribute: 'targetFilterId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Fighters ---\n {\n yamlFile: 'fighterAbilities.yaml',\n tableName: 'eve_fighter_abilities',\n idAttribute: 'fighterAbilityId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'fighterAbilitiesByType.yaml',\n tableName: 'eve_fighter_abilities_by_type',\n idAttribute: 'typeId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Corporation ---\n {\n yamlFile: 'corporationRoles.yaml',\n tableName: 'eve_corporation_roles',\n idAttribute: 'corporationRoleId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'corporationRoleGroups.yaml',\n tableName: 'eve_corporation_role_groups',\n idAttribute: 'corporationRoleGroupId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Schools / Education ---\n {\n yamlFile: 'schools.yaml',\n tableName: 'eve_schools',\n idAttribute: 'schoolId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'schoolMap.yaml',\n tableName: 'eve_school_map',\n idAttribute: 'schoolMapId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'skillPlans.yaml',\n tableName: 'eve_skill_plans',\n idAttribute: 'skillPlanId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'expertSystems.yaml',\n tableName: 'eve_expert_systems',\n idAttribute: 'expertSystemId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Notifications ---\n {\n yamlFile: 'notificationTypes.yaml',\n tableName: 'eve_notification_types',\n idAttribute: 'notificationTypeId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'accountingEntryTypes.yaml',\n tableName: 'eve_accounting_entry_types',\n idAttribute: 'accountingEntryTypeId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Effects / Traps / Dbuffs ---\n {\n yamlFile: 'appliedProximityEffects.yaml',\n tableName: 'eve_applied_proximity_effects',\n idAttribute: 'appliedProximityEffectId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'proximityTrap.yaml',\n tableName: 'eve_proximity_traps',\n idAttribute: 'proximityTrapId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'systemDbuffEmitters.yaml',\n tableName: 'eve_system_dbuff_emitters',\n idAttribute: 'systemDbuffEmitterId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'systemWideEffects.yaml',\n tableName: 'eve_system_wide_effects',\n idAttribute: 'systemWideEffectId',\n idType: 'number',\n injectId: true,\n },\n {\n yamlFile: 'linkWithShip.yaml',\n tableName: 'eve_link_with_ship',\n idAttribute: 'linkWithShipId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Station (extended) ---\n {\n yamlFile: 'stationStandingsRestrictions.yaml',\n tableName: 'eve_station_standings_restrictions',\n idAttribute: 'stationStandingsRestrictionId',\n idType: 'number',\n injectId: true,\n },\n\n // --- SKINR (extended) ---\n {\n yamlFile: 'skinrSlotsToMaterials.yaml',\n tableName: 'eve_skinr_slots_to_materials',\n idAttribute: 'skinrSlotToMaterialId',\n idType: 'number',\n injectId: true,\n },\n\n // --- Metenox ---\n {\n yamlFile: 'metenoxMoonDrill.yaml',\n tableName: 'eve_metenox_moon_drill',\n idAttribute: 'metenoxMoonDrillId',\n idType: 'number',\n injectId: true,\n },\n] as const;\n","import AdmZip from 'adm-zip';\nimport * as yaml from 'js-yaml';\nimport { SDE_METADATA_FILENAME } from './constants';\nimport { SdeError } from '../errors';\n\nexport interface SdeMetadata {\n buildNumber: string;\n releaseDate: string;\n}\n\nexport interface ParsedSdeFile {\n filename: string;\n records: Map<string | number, Record<string, unknown>>;\n}\n\nfunction findEntry(\n zip: AdmZip,\n filename: string,\n): AdmZip.IZipEntry | undefined {\n const basename = filename.replace(/^.*[\\\\/]/, '');\n return zip.getEntries().find((entry) => {\n if (entry.isDirectory) return false;\n const entryBasename = entry.entryName.replace(/^.*[\\\\/]/, '');\n return (\n entryBasename === basename ||\n entry.entryName === filename ||\n entry.entryName === `sde/${filename}`\n );\n });\n}\n\nfunction readEntryAsString(entry: AdmZip.IZipEntry): string {\n const buffer = entry.getData();\n return buffer.toString('utf-8');\n}\n\nexport class SdeExtractor {\n readMetadata(zipPath: string): SdeMetadata {\n const zip = new AdmZip(zipPath);\n const entry = findEntry(zip, SDE_METADATA_FILENAME);\n\n if (!entry) {\n throw new SdeError(\n `Metadata file '${SDE_METADATA_FILENAME}' not found in archive: ${zipPath}`,\n );\n }\n\n const content = readEntryAsString(entry);\n const parsed = yaml.load(content) as Record<string, unknown>;\n\n const bn = parsed.buildNumber;\n const rd = parsed.releaseDate;\n return {\n buildNumber:\n typeof bn === 'string' || typeof bn === 'number' ? String(bn) : '',\n releaseDate:\n typeof rd === 'string' || typeof rd === 'number' ? String(rd) : '',\n };\n }\n\n parseFile(zipPath: string, filename: string): ParsedSdeFile {\n const zip = new AdmZip(zipPath);\n return this.parseFileFromZip(zip, filename);\n }\n\n parseFiles(zipPath: string, filenames: string[]): ParsedSdeFile[] {\n const zip = new AdmZip(zipPath);\n const results: ParsedSdeFile[] = [];\n\n for (const filename of filenames) {\n const entry = findEntry(zip, filename);\n if (!entry) {\n // File not present in this SDE build — skip silently\n continue;\n }\n results.push(this.parseEntryAsFile(entry, filename));\n }\n\n return results;\n }\n\n extractAll(zipPath: string, outputDir: string): void {\n const zip = new AdmZip(zipPath);\n zip.extractAllTo(outputDir, true);\n }\n\n listFiles(zipPath: string): string[] {\n const zip = new AdmZip(zipPath);\n return zip\n .getEntries()\n .filter(\n (entry) => !entry.isDirectory && entry.entryName.endsWith('.yaml'),\n )\n .map((entry) => entry.entryName);\n }\n\n private parseFileFromZip(zip: AdmZip, filename: string): ParsedSdeFile {\n const entry = findEntry(zip, filename);\n\n if (!entry) {\n throw new SdeError(`File '${filename}' not found in archive`);\n }\n\n return this.parseEntryAsFile(entry, filename);\n }\n\n private parseEntryAsFile(\n entry: AdmZip.IZipEntry,\n filename: string,\n ): ParsedSdeFile {\n const content = readEntryAsString(entry);\n const parsed = yaml.load(content) as Record<\n string | number,\n Record<string, unknown>\n >;\n const records = new Map<string | number, Record<string, unknown>>(\n Object.entries(parsed).map(([key, value]) => {\n const numKey = Number(key);\n return [Number.isNaN(numKey) ? key : numKey, value];\n }),\n );\n\n return { filename, records };\n }\n}\n","export class SdeError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'SdeError';\n }\n}\n\nexport class SdeDatabaseError extends SdeError {\n public override readonly cause: unknown;\n\n constructor(message: string, cause?: unknown) {\n super(message);\n this.name = 'SdeDatabaseError';\n this.cause = cause;\n }\n}\n\nexport class SdeValidationError extends SdeError {\n public readonly validationError: unknown;\n public readonly entityType: string;\n public readonly entityId?: number;\n\n constructor(entityType: string, validationError: unknown, entityId?: number) {\n const idSuffix = entityId !== undefined ? ` (id: ${entityId})` : '';\n super(`SDE validation failed for ${entityType}${idSuffix}`);\n this.name = 'SdeValidationError';\n this.validationError = validationError;\n this.entityType = entityType;\n this.entityId = entityId;\n }\n}\n\nexport class SdeVersionMismatchError extends SdeError {\n public readonly expected: string;\n public readonly actual: string;\n\n constructor(expected: string, actual: string) {\n super(`SDE version mismatch: expected ${expected}, got ${actual}`);\n this.name = 'SdeVersionMismatchError';\n this.expected = expected;\n this.actual = actual;\n }\n}\n\nexport function isSdeError(error: unknown): error is SdeError {\n return error instanceof SdeError;\n}\n\nexport function isSdeDatabaseError(error: unknown): error is SdeDatabaseError {\n return error instanceof SdeDatabaseError;\n}\n\nexport function isSdeValidationError(\n error: unknown,\n): error is SdeValidationError {\n return error instanceof SdeValidationError;\n}\n\nexport function isSdeVersionMismatch(\n error: unknown,\n): error is SdeVersionMismatchError {\n return error instanceof SdeVersionMismatchError;\n}\n","export type SqliteValue = string | number | null;\n\nexport function extractLocale(\n field: unknown,\n locale: string = 'en',\n fallback: string = '',\n): string {\n if (field == null) return fallback;\n if (typeof field === 'string') return field;\n if (typeof field === 'object' && !Array.isArray(field)) {\n const map = field as Record<string, unknown>;\n // eslint-disable-next-line security/detect-object-injection\n const value = map[locale];\n if (typeof value === 'string') return value;\n return fallback;\n }\n return fallback;\n}\n\nexport function normalizeSdeFieldName(name: string): string {\n return name.replace(/ID(?=[A-Z]|$)/g, 'Id');\n}\n\n// eslint-disable-next-line sonarjs/function-return-type -- union return is intentional\nexport function toSqliteValue(value: unknown): SqliteValue {\n if (value == null) return null;\n if (typeof value === 'boolean') return value ? 1 : 0;\n if (typeof value === 'number') return value;\n if (typeof value === 'string') return value;\n if (typeof value === 'object') return JSON.stringify(value);\n return null;\n}\n\nfunction isLocaleMap(value: unknown): value is Record<string, string> {\n if (value == null || typeof value !== 'object' || Array.isArray(value)) {\n return false;\n }\n return 'en' in (value as Record<string, unknown>);\n}\n\nexport function transformRecord(\n entityId: number | string,\n raw: Record<string, unknown>,\n spec: { idAttribute: string; injectId: boolean },\n): Record<string, SqliteValue> {\n const row: Record<string, SqliteValue> = {};\n\n if (spec.injectId) {\n row[spec.idAttribute] =\n typeof entityId === 'string' ? entityId : Number(entityId);\n }\n\n for (const [key, value] of Object.entries(raw)) {\n const normalizedKey = normalizeSdeFieldName(key);\n\n if (isLocaleMap(value)) {\n row[normalizedKey] = extractLocale(value);\n } else {\n row[normalizedKey] = toSqliteValue(value);\n }\n }\n\n return row;\n}\n\nfunction normalizeNested(value: unknown): unknown {\n if (value == null || typeof value !== 'object') return value;\n if (Array.isArray(value)) return value.map(normalizeNested);\n const obj = value as Record<string, unknown>;\n if (isLocaleMap(obj)) return extractLocale(obj);\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(obj)) {\n out[normalizeSdeFieldName(k)] = normalizeNested(v);\n }\n return out;\n}\n\nexport function transformRecordNative(\n entityId: number | string,\n raw: Record<string, unknown>,\n spec: { idAttribute: string; injectId: boolean },\n): Record<string, unknown> {\n const row: Record<string, unknown> = {};\n\n if (spec.injectId) {\n row[spec.idAttribute] =\n typeof entityId === 'string' ? entityId : Number(entityId);\n }\n\n for (const [key, value] of Object.entries(raw)) {\n const normalizedKey = normalizeSdeFieldName(key);\n\n if (isLocaleMap(value)) {\n row[normalizedKey] = extractLocale(value);\n } else {\n row[normalizedKey] = normalizeNested(value);\n }\n }\n\n return row;\n}\n","import type { IStaticDataProvider } from './IStaticDataProvider';\nimport type {\n EveType,\n EveGroup,\n EveCategory,\n Region,\n Constellation,\n SolarSystem,\n Stargate,\n Star,\n Planet,\n Moon,\n AsteroidBelt,\n Faction,\n Race,\n Bloodline,\n Ancestry,\n NpcCorporation,\n NpcStation,\n MarketGroup,\n MetaGroup,\n Icon,\n Graphic,\n DogmaAttribute,\n DogmaEffect,\n Blueprint,\n PlanetSchematic,\n AgentType,\n AgentInSpace,\n Certificate,\n CharacterAttribute,\n CloneGrade,\n CorporationActivity,\n DogmaAttributeCategory,\n DogmaUnit,\n IndustryActivity,\n Landmark,\n NotificationType,\n NpcCharacter,\n NpcCorporationDivision,\n School,\n SecondarySun,\n Skin,\n SkinLicense,\n StationOperation,\n StationService,\n TypeDogma,\n TypeMaterial,\n TypeBonus,\n Mission,\n Dungeon,\n EpicArc,\n} from './types';\nimport type { SdeVersionInfo } from './version';\n\nexport interface MemorySdeData {\n types?: EveType[];\n groups?: EveGroup[];\n categories?: EveCategory[];\n regions?: Region[];\n constellations?: Constellation[];\n solarSystems?: SolarSystem[];\n stargates?: Stargate[];\n stars?: Star[];\n planets?: Planet[];\n moons?: Moon[];\n asteroidBelts?: AsteroidBelt[];\n factions?: Faction[];\n races?: Race[];\n bloodlines?: Bloodline[];\n ancestries?: Ancestry[];\n npcCorporations?: NpcCorporation[];\n npcStations?: NpcStation[];\n marketGroups?: MarketGroup[];\n metaGroups?: MetaGroup[];\n icons?: Icon[];\n graphics?: Graphic[];\n dogmaAttributes?: DogmaAttribute[];\n dogmaEffects?: DogmaEffect[];\n blueprints?: Blueprint[];\n planetSchematics?: PlanetSchematic[];\n agentTypes?: AgentType[];\n agentsInSpace?: AgentInSpace[];\n certificates?: Certificate[];\n characterAttributes?: CharacterAttribute[];\n cloneGrades?: CloneGrade[];\n corporationActivities?: CorporationActivity[];\n dogmaAttributeCategories?: DogmaAttributeCategory[];\n dogmaUnits?: DogmaUnit[];\n industryActivities?: IndustryActivity[];\n landmarks?: Landmark[];\n notificationTypes?: NotificationType[];\n npcCharacters?: NpcCharacter[];\n npcCorporationDivisions?: NpcCorporationDivision[];\n schools?: School[];\n secondarySuns?: SecondarySun[];\n skins?: Skin[];\n skinLicenses?: SkinLicense[];\n stationOperations?: StationOperation[];\n stationServices?: StationService[];\n typeDogma?: TypeDogma[];\n typeMaterials?: TypeMaterial[];\n typeBonuses?: TypeBonus[];\n missions?: Mission[];\n dungeons?: Dungeon[];\n epicArcs?: EpicArc[];\n version?: Partial<SdeVersionInfo>;\n}\n\nexport class MemorySdeProvider implements IStaticDataProvider {\n private data: Map<string, Map<number | string, unknown>> = new Map();\n private versionInfo: SdeVersionInfo;\n\n constructor(data: MemorySdeData = {}) {\n const register = <T>(\n key: string,\n items: T[] | undefined,\n idFn: (item: T) => number | string,\n ): void => {\n this.data.set(\n key,\n new Map((items ?? []).map((item) => [idFn(item), item])),\n );\n };\n\n register('eve_types', data.types, (t) => t.typeId);\n register('eve_groups', data.groups, (g) => g.groupId);\n register('eve_categories', data.categories, (c) => c.categoryId);\n register('eve_regions', data.regions, (r) => r.regionId);\n register(\n 'eve_constellations',\n data.constellations,\n (c) => c.constellationId,\n );\n register('eve_solar_systems', data.solarSystems, (s) => s.systemId);\n register('eve_stargates', data.stargates, (s) => s.stargateId);\n register('eve_stars', data.stars, (s) => s.starId);\n register('eve_planets', data.planets, (p) => p.planetId);\n register('eve_moons', data.moons, (m) => m.moonId);\n register('eve_asteroid_belts', data.asteroidBelts, (a) => a.asteroidBeltId);\n register('eve_factions', data.factions, (f) => f.factionId);\n register('eve_races', data.races, (r) => r.raceId);\n register('eve_bloodlines', data.bloodlines, (b) => b.bloodlineId);\n register('eve_ancestries', data.ancestries, (a) => a.ancestryId);\n register(\n 'eve_npc_corporations',\n data.npcCorporations,\n (c) => c.corporationId,\n );\n register('eve_npc_stations', data.npcStations, (s) => s.stationId);\n register('eve_market_groups', data.marketGroups, (g) => g.marketGroupId);\n register('eve_meta_groups', data.metaGroups, (g) => g.metaGroupId);\n register('eve_icons', data.icons, (i) => i.iconId);\n register('eve_graphics', data.graphics, (g) => g.graphicId);\n register(\n 'eve_dogma_attributes',\n data.dogmaAttributes,\n (a) => a.attributeId,\n );\n register('eve_dogma_effects', data.dogmaEffects, (e) => e.effectId);\n register('eve_blueprints', data.blueprints, (b) => b.blueprintTypeId);\n register(\n 'eve_planet_schematics',\n data.planetSchematics,\n (s) => s.planetSchematicId,\n );\n register('eve_agent_types', data.agentTypes, (a) => a.agentTypeId);\n register('eve_agents_in_space', data.agentsInSpace, (a) => a.characterId);\n register('eve_certificates', data.certificates, (c) => c.certificateId);\n register(\n 'eve_character_attributes',\n data.characterAttributes,\n (c) => c.attributeId,\n );\n register('eve_clone_grades', data.cloneGrades, (c) => c.cloneGradeId);\n register(\n 'eve_corporation_activities',\n data.corporationActivities,\n (c) => c.corporationActivityId,\n );\n register(\n 'eve_dogma_attribute_categories',\n data.dogmaAttributeCategories,\n (d) => d.attributeCategoryId,\n );\n register('eve_dogma_units', data.dogmaUnits, (d) => d.unitId);\n register(\n 'eve_industry_activities',\n data.industryActivities,\n (i) => i.industryActivityId,\n );\n register('eve_landmarks', data.landmarks, (l) => l.landmarkId);\n register(\n 'eve_notification_types',\n data.notificationTypes,\n (n) => n.notificationTypeId,\n );\n register('eve_npc_characters', data.npcCharacters, (n) => n.characterId);\n register(\n 'eve_npc_corporation_divisions',\n data.npcCorporationDivisions,\n (n) => n.npcCorporationDivisionId,\n );\n register('eve_schools', data.schools, (s) => s.schoolId);\n register('eve_secondary_suns', data.secondarySuns, (s) => s.secondarySunId);\n register('eve_skins', data.skins, (s) => s.skinId);\n register('eve_skin_licenses', data.skinLicenses, (s) => s.licenseTypeId);\n register(\n 'eve_station_operations',\n data.stationOperations,\n (s) => s.stationOperationId,\n );\n register(\n 'eve_station_services',\n data.stationServices,\n (s) => s.stationServiceId,\n );\n register('eve_type_dogma', data.typeDogma, (t) => t.typeId);\n register('eve_type_materials', data.typeMaterials, (t) => t.typeId);\n register('eve_type_bonuses', data.typeBonuses, (t) => t.typeId);\n register('eve_missions', data.missions, (m) => m.missionId);\n register('eve_dungeons', data.dungeons, (d) => d.dungeonId);\n register('eve_epic_arcs', data.epicArcs, (e) => e.epicArcId);\n\n this.versionInfo = {\n version: data.version?.version ?? '1.0.0-test',\n buildDate: data.version?.buildDate ?? '2024-01-01T00:00:00Z',\n importedAt: data.version?.importedAt ?? '2024-01-01T00:00:00Z',\n checksum: data.version?.checksum,\n };\n }\n\n private getById<T>(table: string, id: number | string): T | null {\n return (this.data.get(table)?.get(id) as T) ?? null;\n }\n\n private getAllFrom<T>(table: string): T[] {\n const map = this.data.get(table);\n return map ? (Array.from(map.values()) as T[]) : [];\n }\n\n private filterBy<T>(table: string, field: string, value: unknown): T[] {\n return this.getAllFrom<T>(table).filter(\n (item) => (item as Record<string, unknown>)[field] === value,\n );\n }\n\n private searchBy<T>(\n table: string,\n field: string,\n query: string,\n limit = 25,\n ): T[] {\n const lowerQuery = query.toLowerCase();\n const results: T[] = [];\n for (const item of this.getAllFrom<T>(table)) {\n const val = (item as Record<string, unknown>)[field];\n if (typeof val === 'string' && val.toLowerCase().includes(lowerQuery)) {\n results.push(item);\n if (results.length >= limit) break;\n }\n }\n return results;\n }\n\n // --- Types, Groups, Categories ---\n getType(typeId: number): EveType | null {\n return this.getById('eve_types', typeId);\n }\n getTypesByGroup(groupId: number): EveType[] {\n return this.filterBy('eve_types', 'groupId', groupId);\n }\n getGroup(groupId: number): EveGroup | null {\n return this.getById('eve_groups', groupId);\n }\n getGroupsByCategory(categoryId: number): EveGroup[] {\n return this.filterBy('eve_groups', 'categoryId', categoryId);\n }\n getCategory(categoryId: number): EveCategory | null {\n return this.getById('eve_categories', categoryId);\n }\n getAllCategories(): EveCategory[] {\n return this.getAllFrom('eve_categories');\n }\n\n // --- Regions, Constellations, Solar Systems, Stargates ---\n getRegion(regionId: number): Region | null {\n return this.getById('eve_regions', regionId);\n }\n getAllRegions(): Region[] {\n return this.getAllFrom('eve_regions');\n }\n getConstellation(constellationId: number): Constellation | null {\n return this.getById('eve_constellations', constellationId);\n }\n getConstellationsByRegion(regionId: number): Constellation[] {\n return this.filterBy('eve_constellations', 'regionId', regionId);\n }\n getSolarSystem(systemId: number): SolarSystem | null {\n return this.getById('eve_solar_systems', systemId);\n }\n getSolarSystemsByConstellation(constellationId: number): SolarSystem[] {\n return this.filterBy(\n 'eve_solar_systems',\n 'constellationId',\n constellationId,\n );\n }\n getStargate(stargateId: number): Stargate | null {\n return this.getById('eve_stargates', stargateId);\n }\n getStargatesBySystem(systemId: number): Stargate[] {\n return this.filterBy('eve_stargates', 'solarSystemId', systemId);\n }\n\n // --- Search ---\n searchTypesByName(query: string, limit = 25): EveType[] {\n return this.searchBy('eve_types', 'name', query, limit);\n }\n searchSolarSystemsByName(query: string, limit = 25): SolarSystem[] {\n return this.searchBy('eve_solar_systems', 'name', query, limit);\n }\n\n // --- Universe ---\n getStar(starId: number): Star | null {\n return this.getById('eve_stars', starId);\n }\n getStarBySystem(systemId: number): Star | null {\n return (\n this.filterBy<Star>('eve_stars', 'solarSystemId', systemId)[0] ?? null\n );\n }\n getPlanet(planetId: number): Planet | null {\n return this.getById('eve_planets', planetId);\n }\n getPlanetsBySystem(systemId: number): Planet[] {\n return this.filterBy('eve_planets', 'solarSystemId', systemId);\n }\n getMoon(moonId: number): Moon | null {\n return this.getById('eve_moons', moonId);\n }\n getMoonsBySystem(systemId: number): Moon[] {\n return this.filterBy('eve_moons', 'solarSystemId', systemId);\n }\n getAsteroidBelt(asteroidBeltId: number): AsteroidBelt | null {\n return this.getById('eve_asteroid_belts', asteroidBeltId);\n }\n getAsteroidBeltsBySystem(systemId: number): AsteroidBelt[] {\n return this.filterBy('eve_asteroid_belts', 'solarSystemId', systemId);\n }\n\n // --- Character/Lore ---\n getFaction(factionId: number): Faction | null {\n return this.getById('eve_factions', factionId);\n }\n getAllFactions(): Faction[] {\n return this.getAllFrom('eve_factions');\n }\n getRace(raceId: number): Race | null {\n return this.getById('eve_races', raceId);\n }\n getAllRaces(): Race[] {\n return this.getAllFrom('eve_races');\n }\n getBloodline(bloodlineId: number): Bloodline | null {\n return this.getById('eve_bloodlines', bloodlineId);\n }\n getBloodlinesByRace(raceId: number): Bloodline[] {\n return this.filterBy('eve_bloodlines', 'raceId', raceId);\n }\n getAncestry(ancestryId: number): Ancestry | null {\n return this.getById('eve_ancestries', ancestryId);\n }\n getAncestriesByBloodline(bloodlineId: number): Ancestry[] {\n return this.filterBy('eve_ancestries', 'bloodlineId', bloodlineId);\n }\n\n // --- NPC Infrastructure ---\n getNpcCorporation(corporationId: number): NpcCorporation | null {\n return this.getById('eve_npc_corporations', corporationId);\n }\n getNpcCorporationsByFaction(factionId: number): NpcCorporation[] {\n return this.filterBy('eve_npc_corporations', 'factionId', factionId);\n }\n getNpcStation(stationId: number): NpcStation | null {\n return this.getById('eve_npc_stations', stationId);\n }\n getNpcStationsBySystem(systemId: number): NpcStation[] {\n return this.filterBy('eve_npc_stations', 'solarSystemId', systemId);\n }\n getNpcStationsByOwner(ownerId: number): NpcStation[] {\n return this.filterBy('eve_npc_stations', 'ownerId', ownerId);\n }\n\n // --- Market ---\n getMarketGroup(marketGroupId: number): MarketGroup | null {\n return this.getById('eve_market_groups', marketGroupId);\n }\n getMarketGroupsByParent(parentGroupId: number): MarketGroup[] {\n return this.filterBy('eve_market_groups', 'parentGroupId', parentGroupId);\n }\n getRootMarketGroups(): MarketGroup[] {\n return this.getAllFrom<MarketGroup>('eve_market_groups').filter(\n (g) => g.parentGroupId === null,\n );\n }\n getTypesByMarketGroup(marketGroupId: number): EveType[] {\n return this.filterBy('eve_types', 'marketGroupId', marketGroupId);\n }\n searchMarketGroupsByName(query: string, limit = 25): MarketGroup[] {\n return this.searchBy('eve_market_groups', 'name', query, limit);\n }\n\n // --- Meta/UI ---\n getMetaGroup(metaGroupId: number): MetaGroup | null {\n return this.getById('eve_meta_groups', metaGroupId);\n }\n getAllMetaGroups(): MetaGroup[] {\n return this.getAllFrom('eve_meta_groups');\n }\n getIcon(iconId: number): Icon | null {\n return this.getById('eve_icons', iconId);\n }\n getGraphic(graphicId: number): Graphic | null {\n return this.getById('eve_graphics', graphicId);\n }\n\n // --- Dogma ---\n getDogmaAttribute(attributeId: number): DogmaAttribute | null {\n return this.getById('eve_dogma_attributes', attributeId);\n }\n searchDogmaAttributesByName(query: string, limit = 25): DogmaAttribute[] {\n return this.searchBy('eve_dogma_attributes', 'name', query, limit);\n }\n getDogmaEffect(effectId: number): DogmaEffect | null {\n return this.getById('eve_dogma_effects', effectId);\n }\n searchDogmaEffectsByName(query: string, limit = 25): DogmaEffect[] {\n return this.searchBy('eve_dogma_effects', 'name', query, limit);\n }\n getDogmaAttributeCategory(\n attributeCategoryId: number,\n ): DogmaAttributeCategory | null {\n return this.getById('eve_dogma_attribute_categories', attributeCategoryId);\n }\n getAllDogmaAttributeCategories(): DogmaAttributeCategory[] {\n return this.getAllFrom('eve_dogma_attribute_categories');\n }\n getDogmaUnit(unitId: number): DogmaUnit | null {\n return this.getById('eve_dogma_units', unitId);\n }\n getAllDogmaUnits(): DogmaUnit[] {\n return this.getAllFrom('eve_dogma_units');\n }\n\n // --- Industry ---\n getBlueprint(blueprintTypeId: number): Blueprint | null {\n return this.getById('eve_blueprints', blueprintTypeId);\n }\n getPlanetSchematic(planetSchematicId: number): PlanetSchematic | null {\n return this.getById('eve_planet_schematics', planetSchematicId);\n }\n getAllPlanetSchematics(): PlanetSchematic[] {\n return this.getAllFrom('eve_planet_schematics');\n }\n getIndustryActivity(industryActivityId: number): IndustryActivity | null {\n return this.getById('eve_industry_activities', industryActivityId);\n }\n getAllIndustryActivities(): IndustryActivity[] {\n return this.getAllFrom('eve_industry_activities');\n }\n\n // --- Agent System ---\n getAgentType(agentTypeId: number): AgentType | null {\n return this.getById('eve_agent_types', agentTypeId);\n }\n getAllAgentTypes(): AgentType[] {\n return this.getAllFrom('eve_agent_types');\n }\n getAgentInSpace(characterId: number): AgentInSpace | null {\n return this.getById('eve_agents_in_space', characterId);\n }\n getAgentsInSpaceBySystem(systemId: number): AgentInSpace[] {\n return this.filterBy('eve_agents_in_space', 'solarSystemId', systemId);\n }\n\n // --- Certificates ---\n getCertificate(certificateId: number): Certificate | null {\n return this.getById('eve_certificates', certificateId);\n }\n getAllCertificates(): Certificate[] {\n return this.getAllFrom('eve_certificates');\n }\n\n // --- Character Attributes ---\n getCharacterAttribute(attributeId: number): CharacterAttribute | null {\n return this.getById('eve_character_attributes', attributeId);\n }\n getAllCharacterAttributes(): CharacterAttribute[] {\n return this.getAllFrom('eve_character_attributes');\n }\n\n // --- NPC Characters ---\n getNpcCharacter(characterId: number): NpcCharacter | null {\n return this.getById('eve_npc_characters', characterId);\n }\n getNpcCharactersByCorporation(corporationId: number): NpcCharacter[] {\n return this.filterBy('eve_npc_characters', 'corporationId', corporationId);\n }\n searchNpcCharactersByName(query: string, limit = 25): NpcCharacter[] {\n return this.searchBy('eve_npc_characters', 'name', query, limit);\n }\n\n // --- Clone Grades ---\n getCloneGrade(cloneGradeId: number): CloneGrade | null {\n return this.getById('eve_clone_grades', cloneGradeId);\n }\n getAllCloneGrades(): CloneGrade[] {\n return this.getAllFrom('eve_clone_grades');\n }\n\n // --- Corporation Reference ---\n getCorporationActivity(\n corporationActivityId: number,\n ): CorporationActivity | null {\n return this.getById('eve_corporation_activities', corporationActivityId);\n }\n getAllCorporationActivities(): CorporationActivity[] {\n return this.getAllFrom('eve_corporation_activities');\n }\n getNpcCorporationDivision(\n npcCorporationDivisionId: number,\n ): NpcCorporationDivision | null {\n return this.getById(\n 'eve_npc_corporation_divisions',\n npcCorporationDivisionId,\n );\n }\n getAllNpcCorporationDivisions(): NpcCorporationDivision[] {\n return this.getAllFrom('eve_npc_corporation_divisions');\n }\n\n // --- Landmarks ---\n getLandmark(landmarkId: number): Landmark | null {\n return this.getById('eve_landmarks', landmarkId);\n }\n getAllLandmarks(): Landmark[] {\n return this.getAllFrom('eve_landmarks');\n }\n\n // --- Notifications ---\n getNotificationType(notificationTypeId: number): NotificationType | null {\n return this.getById('eve_notification_types', notificationTypeId);\n }\n\n // --- Schools ---\n getSchool(schoolId: number): School | null {\n return this.getById('eve_schools', schoolId);\n }\n getAllSchools(): School[] {\n return this.getAllFrom('eve_schools');\n }\n\n // --- Secondary Suns ---\n getSecondarySun(secondarySunId: number): SecondarySun | null {\n return this.getById('eve_secondary_suns', secondarySunId);\n }\n getSecondarySunsBySystem(systemId: number): SecondarySun[] {\n return this.filterBy('eve_secondary_suns', 'solarSystemId', systemId);\n }\n\n // --- Skins ---\n getSkin(skinId: number): Skin | null {\n return this.getById('eve_skins', skinId);\n }\n getSkinLicense(licenseTypeId: number): SkinLicense | null {\n return this.getById('eve_skin_licenses', licenseTypeId);\n }\n getSkinLicensesBySkin(skinId: number): SkinLicense[] {\n return this.filterBy('eve_skin_licenses', 'skinId', skinId);\n }\n\n // --- Station Operations & Services ---\n getStationOperation(stationOperationId: number): StationOperation | null {\n return this.getById('eve_station_operations', stationOperationId);\n }\n getAllStationOperations(): StationOperation[] {\n return this.getAllFrom('eve_station_operations');\n }\n getStationService(stationServiceId: number): StationService | null {\n return this.getById('eve_station_services', stationServiceId);\n }\n getAllStationServices(): StationService[] {\n return this.getAllFrom('eve_station_services');\n }\n\n // --- Type Extensions ---\n getTypeDogma(typeId: number): TypeDogma | null {\n return this.getById('eve_type_dogma', typeId);\n }\n getTypeMaterial(typeId: number): TypeMaterial | null {\n return this.getById('eve_type_materials', typeId);\n }\n getTypeBonus(typeId: number): TypeBonus | null {\n return this.getById('eve_type_bonuses', typeId);\n }\n\n // --- Missions & Content ---\n getMission(missionId: number): Mission | null {\n return this.getById('eve_missions', missionId);\n }\n getDungeon(dungeonId: number): Dungeon | null {\n return this.getById('eve_dungeons', dungeonId);\n }\n getEpicArc(epicArcId: number): EpicArc | null {\n return this.getById('eve_epic_arcs', epicArcId);\n }\n getAllEpicArcs(): EpicArc[] {\n return this.getAllFrom('eve_epic_arcs');\n }\n\n // --- Generic accessor ---\n getEntity<T = Record<string, unknown>>(\n tableName: string,\n id: number | string,\n ): T | null {\n return this.getById<T>(tableName, id);\n }\n\n getAllEntities<T = Record<string, unknown>>(tableName: string): T[] {\n return this.getAllFrom<T>(tableName);\n }\n\n // --- Version & Lifecycle ---\n getVersion(): SdeVersionInfo {\n return { ...this.versionInfo };\n }\n\n close(): void {\n this.data.clear();\n }\n}\n","import type {\n EveType,\n EveGroup,\n EveCategory,\n Region,\n Constellation,\n SolarSystem,\n Stargate,\n Star,\n Planet,\n Moon,\n AsteroidBelt,\n Faction,\n Race,\n Bloodline,\n Ancestry,\n NpcCorporation,\n NpcStation,\n MarketGroup,\n MetaGroup,\n Icon,\n Graphic,\n DogmaAttribute,\n DogmaEffect,\n Blueprint,\n PlanetSchematic,\n} from './types';\nimport type { SdeVersionInfo } from './version';\nimport type { MemorySdeData } from './MemorySdeProvider';\n\nexport class SdeTestDataFactory {\n static createEveType(overrides: Partial<EveType> = {}): EveType {\n return {\n typeId: 34,\n groupId: 18,\n mass: 1,\n name: 'Tritanium',\n portionSize: 1,\n published: true,\n packagedVolume: null,\n volume: 0.01,\n radius: null,\n description: 'The most common mineral in the known universe.',\n graphicId: 20,\n soundId: null,\n iconId: null,\n raceId: null,\n basePrice: 4,\n marketGroupId: 1857,\n capacity: null,\n isRepackable: null,\n ...overrides,\n };\n }\n\n static createEveGroup(overrides: Partial<EveGroup> = {}): EveGroup {\n return {\n groupId: 18,\n anchorable: false,\n anchored: false,\n categoryId: 4,\n fittableNonSingleton: false,\n name: 'Mineral',\n published: true,\n useBasePrice: true,\n iconId: null,\n ...overrides,\n };\n }\n\n static createEveCategory(overrides: Partial<EveCategory> = {}): EveCategory {\n return {\n categoryId: 4,\n name: 'Material',\n published: true,\n iconId: null,\n ...overrides,\n };\n }\n\n static createRegion(overrides: Partial<Region> = {}): Region {\n return {\n regionId: 10000002,\n constellationIDs: [20000020],\n description: 'The Forge is the industrial heart of the Caldari State.',\n factionId: 500001,\n name: 'The Forge',\n nebulaId: 10,\n position: { x: -9.6e16, y: 6.0e16, z: -1.1e17 },\n wormholeClassId: 0,\n ...overrides,\n };\n }\n\n static createConstellation(\n overrides: Partial<Constellation> = {},\n ): Constellation {\n return {\n constellationId: 20000020,\n factionId: 500001,\n name: 'Kimotoro',\n position: { x: -9.7e16, y: 6.1e16, z: -1.15e17 },\n regionId: 10000002,\n solarSystemIDs: [30000142, 30000144],\n wormholeClassId: 0,\n ...overrides,\n };\n }\n\n static createSolarSystem(overrides: Partial<SolarSystem> = {}): SolarSystem {\n return {\n systemId: 30000142,\n border: false,\n constellationId: 20000020,\n hub: true,\n international: false,\n luminosity: 0.02142,\n name: 'Jita',\n planetIDs: [40009077],\n position: { x: -1.29e17, y: 6.07e16, z: -1.12e17 },\n position2D: { x: -1.29e17, y: -1.12e17 },\n radius: 4.67e12,\n regionId: 10000002,\n regional: false,\n securityClass: 'B',\n securityStatus: 0.9459991455078125,\n starId: 40009082,\n stargateIDs: [50001248],\n corridor: null,\n fringe: null,\n wormholeClassId: null,\n visualEffect: null,\n ...overrides,\n };\n }\n\n static createStargate(overrides: Partial<Stargate> = {}): Stargate {\n return {\n stargateId: 50001248,\n destination: { solarSystemId: 30000144, stargateId: 50001249 },\n position: { x: 1.5e12, y: 3.2e11, z: -8.7e11 },\n solarSystemId: 30000142,\n typeId: 16,\n ...overrides,\n };\n }\n\n static createStar(overrides: Partial<Star> = {}): Star {\n return {\n starId: 40009082,\n radius: 346600000,\n solarSystemId: 30000142,\n statistics: {\n age: 76000000000,\n life: 100000000000,\n luminosity: 0.02142,\n locked: false,\n spectralClass: 'K7 V',\n temperature: 4000,\n },\n typeId: 3796,\n ...overrides,\n };\n }\n\n static createPlanet(overrides: Partial<Planet> = {}): Planet {\n return {\n planetId: 40009077,\n asteroidBeltIDs: [40009079],\n attributes: {},\n celestialIndex: 1,\n moonIDs: [40009078],\n orbitId: 40009082,\n position: { x: 1.2e13, y: 1e11, z: -3.5e12 },\n radius: 2330000,\n solarSystemId: 30000142,\n statistics: {},\n typeId: 2015,\n npcStationIDs: null,\n ...overrides,\n };\n }\n\n static createMoon(overrides: Partial<Moon> = {}): Moon {\n return {\n moonId: 40009078,\n attributes: {},\n celestialIndex: 1,\n orbitId: 40009077,\n orbitIndex: 1,\n position: { x: 1.21e13, y: 1.01e11, z: -3.51e12 },\n radius: 240000,\n solarSystemId: 30000142,\n statistics: {},\n typeId: 14,\n npcStationIDs: null,\n ...overrides,\n };\n }\n\n static createAsteroidBelt(\n overrides: Partial<AsteroidBelt> = {},\n ): AsteroidBelt {\n return {\n asteroidBeltId: 40009079,\n celestialIndex: 1,\n orbitId: 40009077,\n orbitIndex: 1,\n position: { x: 1.19e13, y: 9.9e10, z: -3.49e12 },\n radius: 50000,\n solarSystemId: 30000142,\n statistics: {},\n typeId: 15,\n ...overrides,\n };\n }\n\n static createFaction(overrides: Partial<Faction> = {}): Faction {\n return {\n factionId: 500001,\n corporationId: 1000035,\n description: 'The Caldari State is a corporate dictatorship.',\n flatLogo: 'res:/ui/texture/corps/caldari.png',\n flatLogoWithName: 'res:/ui/texture/corps/caldari_name.png',\n iconId: 1439,\n memberRaces: [1],\n militiaCorporationId: 1000180,\n name: 'Caldari State',\n shortDescription: 'Caldari',\n sizeFactor: 5,\n solarSystemId: 30000142,\n uniqueName: true,\n ...overrides,\n };\n }\n\n static createRace(overrides: Partial<Race> = {}): Race {\n return {\n raceId: 1,\n description: 'The Caldari State is a corporate dictatorship.',\n iconId: 1439,\n name: 'Caldari',\n shipTypeId: 601,\n skills: {},\n ...overrides,\n };\n }\n\n static createBloodline(overrides: Partial<Bloodline> = {}): Bloodline {\n return {\n bloodlineId: 1,\n charisma: 3,\n corporationId: 1000006,\n description: 'The Deteis are regarded as the face of the Caldari State.',\n iconId: 1383,\n intelligence: 7,\n memory: 7,\n name: 'Deteis',\n perception: 5,\n raceId: 1,\n willpower: 5,\n ...overrides,\n };\n }\n\n static createAncestry(overrides: Partial<Ancestry> = {}): Ancestry {\n return {\n ancestryId: 1,\n bloodlineId: 1,\n charisma: 0,\n description: 'Born and raised in a capsule.',\n iconId: 1664,\n intelligence: 0,\n memory: 0,\n name: 'Tube Child',\n perception: 0,\n shortDescription: 'Raised in a capsule.',\n willpower: 2,\n ...overrides,\n };\n }\n\n static createNpcCorporation(\n overrides: Partial<NpcCorporation> = {},\n ): NpcCorporation {\n return {\n corporationId: 1000035,\n ceoId: 3004451,\n deleted: false,\n description: 'The Caldari Navy is the armed forces of the Caldari State.',\n extent: 'G',\n hasPlayerPersonnelManager: false,\n initialPrice: 0,\n memberLimit: 0,\n minSecurity: 0,\n minimumJoinStanding: 0,\n name: 'Caldari Navy',\n sendCharTerminationMessage: true,\n shares: 100000,\n size: 'H',\n stationId: 60003760,\n taxRate: 0,\n tickerName: 'CN',\n uniqueName: true,\n allowedMemberRaces: null,\n corporationTrades: null,\n divisions: null,\n enemyId: null,\n factionId: 500001,\n friendId: null,\n iconId: 1439,\n investors: null,\n lpOfferTables: null,\n mainActivityId: null,\n raceId: 1,\n sizeFactor: null,\n solarSystemId: 30000142,\n secondaryActivityId: null,\n ...overrides,\n };\n }\n\n static createNpcStation(overrides: Partial<NpcStation> = {}): NpcStation {\n return {\n stationId: 60003760,\n celestialIndex: 4,\n operationId: 1,\n orbitId: 40009081,\n orbitIndex: 4,\n ownerId: 1000035,\n position: { x: 1.58e14, y: 9.63e12, z: 1.06e14 },\n reprocessingEfficiency: 0.5,\n reprocessingHangarFlag: 4,\n reprocessingStationsTake: 0.05,\n solarSystemId: 30000142,\n typeId: 1529,\n useOperationName: true,\n ...overrides,\n };\n }\n\n static createMarketGroup(overrides: Partial<MarketGroup> = {}): MarketGroup {\n return {\n marketGroupId: 1857,\n description: 'Refined minerals used in manufacturing.',\n hasTypes: true,\n iconId: 22,\n name: 'Minerals',\n parentGroupId: 1031,\n ...overrides,\n };\n }\n\n static createMetaGroup(overrides: Partial<MetaGroup> = {}): MetaGroup {\n return {\n metaGroupId: 1,\n color: { r: 255, g: 255, b: 255, a: 255 },\n name: 'Tech I',\n iconId: null,\n iconSuffix: null,\n description: null,\n ...overrides,\n };\n }\n\n static createIcon(overrides: Partial<Icon> = {}): Icon {\n return {\n iconId: 22,\n iconFile: 'res:/UI/Texture/Icons/22_32_2.png',\n ...overrides,\n };\n }\n\n static createGraphic(overrides: Partial<Graphic> = {}): Graphic {\n return {\n graphicId: 20,\n graphicFile: 'res:/dx9/model/worldobject/asteroid/oreveld001.red',\n iconFolder: null,\n sofFactionName: null,\n sofHullName: null,\n sofRaceName: null,\n ...overrides,\n };\n }\n\n static createDogmaAttribute(\n overrides: Partial<DogmaAttribute> = {},\n ): DogmaAttribute {\n return {\n attributeId: 9,\n attributeCategoryId: 1,\n dataType: 2,\n defaultValue: 0,\n description: 'Hit points for a ship.',\n displayWhenZero: false,\n highIsGood: true,\n name: 'hp',\n published: true,\n stackable: false,\n displayName: null,\n iconId: null,\n tooltipDescription: null,\n tooltipTitle: null,\n unitId: 1,\n chargeRechargeTimeId: null,\n maxAttributeId: null,\n minAttributeId: null,\n ...overrides,\n };\n }\n\n static createDogmaEffect(overrides: Partial<DogmaEffect> = {}): DogmaEffect {\n return {\n effectId: 11,\n disallowAutoRepeat: false,\n dischargeAttributeId: 0,\n durationAttributeId: 0,\n effectCategoryId: 0,\n electronicChance: false,\n guid: 'effects.LowSlotModifier',\n isAssistance: false,\n isOffensive: false,\n isWarpSafe: true,\n name: 'lowSlotModifier',\n propulsionChance: false,\n published: true,\n rangeChance: false,\n distribution: null,\n falloffAttributeId: null,\n rangeAttributeId: null,\n trackingSpeedAttributeId: null,\n description: null,\n displayName: null,\n iconId: null,\n modifierInfo: null,\n ...overrides,\n };\n }\n\n static createBlueprint(overrides: Partial<Blueprint> = {}): Blueprint {\n return {\n activities: {\n manufacturing: {\n time: 6000,\n materials: [\n { typeId: 34, quantity: 100 },\n { typeId: 35, quantity: 50 },\n ],\n products: [{ typeId: 587, quantity: 1 }],\n },\n },\n blueprintTypeId: 787,\n maxProductionLimit: 10,\n ...overrides,\n };\n }\n\n static createPlanetSchematic(\n overrides: Partial<PlanetSchematic> = {},\n ): PlanetSchematic {\n return {\n planetSchematicId: 65,\n cycleTime: 1800,\n name: 'Bacteria',\n pins: [],\n types: [],\n ...overrides,\n };\n }\n\n static createVersionInfo(\n overrides: Partial<SdeVersionInfo> = {},\n ): SdeVersionInfo {\n return {\n version: '2024-01-15.1',\n buildDate: '2024-01-15T00:00:00Z',\n importedAt: '2024-01-16T12:00:00Z',\n checksum: 'abc123def456',\n ...overrides,\n };\n }\n\n static createHierarchicalTestData(): MemorySdeData {\n const category = this.createEveCategory();\n const group = this.createEveGroup({ categoryId: category.categoryId });\n const type1 = this.createEveType({\n typeId: 34,\n name: 'Tritanium',\n groupId: group.groupId,\n });\n const type2 = this.createEveType({\n typeId: 35,\n name: 'Pyerite',\n groupId: group.groupId,\n });\n const type3 = this.createEveType({\n typeId: 36,\n name: 'Mexallon',\n groupId: group.groupId,\n });\n\n const region = this.createRegion();\n const constellation = this.createConstellation({\n regionId: region.regionId,\n });\n const system1 = this.createSolarSystem({\n systemId: 30000142,\n name: 'Jita',\n constellationId: constellation.constellationId,\n regionId: region.regionId,\n });\n const system2 = this.createSolarSystem({\n systemId: 30000144,\n name: 'Perimeter',\n constellationId: constellation.constellationId,\n regionId: region.regionId,\n securityStatus: 0.9,\n });\n const stargate = this.createStargate({\n solarSystemId: system1.systemId,\n destination: { solarSystemId: system2.systemId, stargateId: 50001249 },\n });\n\n const star = this.createStar({ solarSystemId: system1.systemId });\n const planet = this.createPlanet({ solarSystemId: system1.systemId });\n const moon = this.createMoon({ solarSystemId: system1.systemId });\n const asteroidBelt = this.createAsteroidBelt({\n solarSystemId: system1.systemId,\n });\n\n const race = this.createRace();\n const faction = this.createFaction({ memberRaces: [race.raceId] });\n const bloodline = this.createBloodline({ raceId: race.raceId });\n const ancestry = this.createAncestry({\n bloodlineId: bloodline.bloodlineId,\n });\n const npcCorp = this.createNpcCorporation({\n factionId: faction.factionId,\n raceId: race.raceId,\n });\n const npcStation = this.createNpcStation({\n solarSystemId: system1.systemId,\n ownerId: npcCorp.corporationId,\n });\n\n const rootMarketGroup = this.createMarketGroup({\n marketGroupId: 1031,\n name: 'Manufacture & Research',\n parentGroupId: null,\n hasTypes: false,\n });\n const marketGroup = this.createMarketGroup({\n parentGroupId: rootMarketGroup.marketGroupId,\n });\n const metaGroup = this.createMetaGroup();\n const icon = this.createIcon();\n const graphic = this.createGraphic();\n\n const dogmaAttribute = this.createDogmaAttribute();\n const dogmaEffect = this.createDogmaEffect();\n const blueprint = this.createBlueprint();\n const planetSchematic = this.createPlanetSchematic();\n\n return {\n categories: [category],\n groups: [group],\n types: [type1, type2, type3],\n regions: [region],\n constellations: [constellation],\n solarSystems: [system1, system2],\n stargates: [stargate],\n stars: [star],\n planets: [planet],\n moons: [moon],\n asteroidBelts: [asteroidBelt],\n factions: [faction],\n races: [race],\n bloodlines: [bloodline],\n ancestries: [ancestry],\n npcCorporations: [npcCorp],\n npcStations: [npcStation],\n marketGroups: [rootMarketGroup, marketGroup],\n metaGroups: [metaGroup],\n icons: [icon],\n graphics: [graphic],\n dogmaAttributes: [dogmaAttribute],\n dogmaEffects: [dogmaEffect],\n blueprints: [blueprint],\n planetSchematics: [planetSchematic],\n version: this.createVersionInfo(),\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,SAAoB;AACpB,WAAsB;AACtB,IAAAA,QAAsB;;;ACMf,IAAM,wBAAwB;AAU9B,IAAM,oBAA4C;AAAA;AAAA,EAEvD;AAAA,IACE,UAAU;AAAA,IACV,WAAW;AAAA,IACX,aAAa;AAAA,IACb,QAAQ;AAAA,IACR,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,UAAU;AAAA,IACV,WAAW;AAAA,IACX,aAAa;AAAA,IACb,QAAQ;AAAA,IACR,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,UAAU;AAAA,IACV,WAAW;AAAA,IACX,aAAa;AAAA,IACb,QAAQ;AAAA,IACR,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,UAAU;AAAA,IACV,WAAW;AAAA,IACX,aAAa;AAAA,IACb,QAAQ;AAAA,IACR,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,UAAU;AAAA,IACV,WAAW;AAAA,IACX,aAAa;AAAA,IACb,QAAQ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