@elite-dangerous-almanac/core 0.2.11 → 0.2.12

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 (80) hide show
  1. package/PROVENANCE/astro/SOURCES.md +18 -0
  2. package/PROVENANCE/commodities/SOURCES.md +2 -1
  3. package/PROVENANCE/i18n/SOURCES.md +66 -2
  4. package/PROVENANCE/ships/SOURCES.md +58 -51
  5. package/README.md +2 -2
  6. package/THIRD_PARTY_NOTICES.md +2 -1
  7. package/dist/astro/codex-region-lookup.js +1 -1
  8. package/dist/astro/codex-region.d.ts +5 -1
  9. package/dist/astro/codex-region.js +1 -1
  10. package/dist/astro/index.js +1 -1
  11. package/dist/chunk-25EECUZ2.js +1 -0
  12. package/dist/chunk-25EECUZ2.js.map +1 -0
  13. package/dist/{chunk-2TY42PTF.js → chunk-6MQOPQAA.js} +1 -1
  14. package/dist/{chunk-RA6SY445.js → chunk-7UF4XRIR.js} +1 -1
  15. package/dist/{chunk-K5JK3XQB.js → chunk-ARG6ESYB.js} +1 -1
  16. package/dist/{chunk-K5JK3XQB.js.map → chunk-ARG6ESYB.js.map} +1 -1
  17. package/dist/{chunk-ADLVPKUV.js → chunk-ATD32GCX.js} +1 -1
  18. package/dist/{chunk-ADLVPKUV.js.map → chunk-ATD32GCX.js.map} +1 -1
  19. package/dist/{chunk-A6QTYK2D.js → chunk-BUQLUEQS.js} +1 -1
  20. package/dist/{chunk-A6QTYK2D.js.map → chunk-BUQLUEQS.js.map} +1 -1
  21. package/dist/{chunk-SFEQXUIA.js → chunk-CCJPWDMA.js} +1 -1
  22. package/dist/{chunk-ZWT5Y3JR.js → chunk-DEY44PHF.js} +1 -1
  23. package/dist/chunk-DEY44PHF.js.map +1 -0
  24. package/dist/chunk-EXHZ4CFB.js +1 -0
  25. package/dist/{chunk-AUBV6S7V.js.map → chunk-EXHZ4CFB.js.map} +1 -1
  26. package/dist/chunk-FRG7MKSJ.js +1 -0
  27. package/dist/{chunk-T7IQHFQ2.js.map → chunk-FRG7MKSJ.js.map} +1 -1
  28. package/dist/chunk-KLC5XT6F.js +1 -0
  29. package/dist/chunk-KLC5XT6F.js.map +1 -0
  30. package/dist/chunk-KR664YI3.js +1 -0
  31. package/dist/{chunk-UI5RROGI.js.map → chunk-KR664YI3.js.map} +1 -1
  32. package/dist/{chunk-Q647OXON.js → chunk-LOWKWUNS.js} +1 -1
  33. package/dist/{chunk-Q647OXON.js.map → chunk-LOWKWUNS.js.map} +1 -1
  34. package/dist/chunk-O4NIJDL4.js +1 -0
  35. package/dist/chunk-O4NIJDL4.js.map +1 -0
  36. package/dist/{chunk-C3YZ5KTA.js → chunk-P6HCQ2YE.js} +1 -1
  37. package/dist/chunk-P6HCQ2YE.js.map +1 -0
  38. package/dist/chunk-WDAYRHXR.js +1 -0
  39. package/dist/{chunk-AYAKU4YA.js.map → chunk-WDAYRHXR.js.map} +1 -1
  40. package/dist/commodities/commodities-all.js +1 -1
  41. package/dist/commodities/commodities-standard.d.ts +1 -1
  42. package/dist/commodities/commodities-standard.js +1 -1
  43. package/dist/commodities/commodities.js +1 -1
  44. package/dist/commodities/index.js +1 -1
  45. package/dist/i18n/blueprints.js +1 -1
  46. package/dist/i18n/codex-regions.d.ts +33 -0
  47. package/dist/i18n/codex-regions.js +1 -0
  48. package/dist/i18n/codex-regions.js.map +1 -0
  49. package/dist/i18n/index.d.ts +10 -8
  50. package/dist/i18n/index.js +1 -1
  51. package/dist/i18n/pre-engineered.d.ts +4 -0
  52. package/dist/i18n/pre-engineered.js +1 -1
  53. package/dist/materials/index.js +1 -1
  54. package/dist/materials/micro-resources-all.js +1 -1
  55. package/dist/materials/micro-resources.js +1 -1
  56. package/dist/ships/blueprint-costs.js +1 -1
  57. package/dist/ships/blueprints.d.ts +1 -2
  58. package/dist/ships/blueprints.js +1 -1
  59. package/dist/ships/build-metrics.js +1 -1
  60. package/dist/ships/index.js +1 -1
  61. package/dist/ships/pre-engineered-stats.d.ts +5 -9
  62. package/dist/ships/pre-engineered-stats.js +1 -1
  63. package/dist/ships/pre-engineered.d.ts +12 -6
  64. package/dist/ships/pre-engineered.js +1 -1
  65. package/dist/ships/ship-loadout.d.ts +16 -18
  66. package/dist/ships/ship-loadout.js +1 -1
  67. package/package.json +10 -5
  68. package/dist/chunk-4WC5NHBJ.js +0 -1
  69. package/dist/chunk-4WC5NHBJ.js.map +0 -1
  70. package/dist/chunk-53EBUFVU.js +0 -1
  71. package/dist/chunk-53EBUFVU.js.map +0 -1
  72. package/dist/chunk-AUBV6S7V.js +0 -1
  73. package/dist/chunk-AYAKU4YA.js +0 -1
  74. package/dist/chunk-C3YZ5KTA.js.map +0 -1
  75. package/dist/chunk-T7IQHFQ2.js +0 -1
  76. package/dist/chunk-UI5RROGI.js +0 -1
  77. package/dist/chunk-ZWT5Y3JR.js.map +0 -1
  78. /package/dist/{chunk-2TY42PTF.js.map → chunk-6MQOPQAA.js.map} +0 -0
  79. /package/dist/{chunk-RA6SY445.js.map → chunk-7UF4XRIR.js.map} +0 -0
  80. /package/dist/{chunk-SFEQXUIA.js.map → chunk-CCJPWDMA.js.map} +0 -0
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * Sparse, source-backed localized display names and descriptions for Elite Dangerous
3
- * outfitting, personal-equipment, engineering, material and market-commodity
4
- * catalogues.
3
+ * outfitting, personal-equipment, engineering, material, market-commodity and galactic
4
+ * codex-region catalogues.
5
5
  *
6
6
  * Each lookup takes the identifier its owning catalogue is keyed by — a Frontier symbol,
7
- * or the library id where the game publishes none, as for a suit tool and a BCP 47
8
- * locale. English is complete: for a name catalogue it is exactly the owning record's
9
- * `name`, and for a description catalogue it is the game's own display prose, which no
10
- * catalogue otherwise publishes.
7
+ * the library id where the game publishes none, as for a suit tool, or the region id for
8
+ * a galactic codex region — and a BCP 47 locale. English is complete: for a name
9
+ * catalogue it is exactly the owning record's `name`, and for a description catalogue it
10
+ * is the game's own display prose, which no catalogue otherwise publishes.
11
11
  * Other locales are intentionally sparse: the function returns `null` when its pinned
12
12
  * sources carry no translation, leaving the application in control of fallback policy.
13
13
  * A source-backed localized spelling can be identical to English; the lookup returns
@@ -28,7 +28,8 @@
28
28
  * <!-- generated by scripts/i18n-coverage.mjs -->
29
29
  * | Lookup | Keys | en | de | es | fr | pt | ru |
30
30
  * | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
31
- * | `getBlueprintName` | 107 | 100 | 100 | 100 | 100 | 100 | 100 |
31
+ * | `getBlueprintName` | 111 | 100 | 100 | 100 | 100 | 100 | 100 |
32
+ * | `getCodexRegionName` | 42 | 100 | 100 | 100 | 100 | 100 | 100 |
32
33
  * | `getCommodityName` | 412 | 100 | 100 | 100 | 100 | 100 | 100 |
33
34
  * | `getExperimentalEffectDescription` | 86 | 100 | 100 | 100 | 100 | 100 | 100 |
34
35
  * | `getExperimentalEffectName` | 86 | 100 | 100 | 100 | 100 | 100 | 100 |
@@ -41,7 +42,7 @@
41
42
  * | `getPersonalWeaponDescription` | 11 | 100 | 100 | 100 | 100 | 100 | 100 |
42
43
  * | `getSuitDescription` | 19 | 100 | 100 | 100 | 100 | 100 | 100 |
43
44
  * | `getSuitName` | 19 | 100 | 100 | 100 | 100 | 100 | 100 |
44
- * | `getPreEngineeredVariantName` | 76 | 100 | 92 | 89 | 89 | 100 | 100 |
45
+ * | `getPreEngineeredVariantName` | 79 | 100 | 92 | 89 | 89 | 100 | 100 |
45
46
  * | `getOutfittingFamilyName` | 77 | 100 | 75 | 75 | 75 | 75 | 75 |
46
47
  * <!-- end generated -->
47
48
  *
@@ -81,6 +82,7 @@ export { getBlueprintName } from './blueprints.js';
81
82
  export { getExperimentalEffectName } from './experimental-effects.js';
82
83
  export { getExperimentalEffectDescription } from './experimental-effect-descriptions.js';
83
84
  export { getCommodityName } from './commodities.js';
85
+ export { getCodexRegionName } from './codex-regions.js';
84
86
  export { getMaterialName } from './materials.js';
85
87
  export { getMicroResourceName } from './micro-resources.js';
86
88
  export { getPersonalMountName, getSuitDescription, getSuitName } from './suits.js';
@@ -1 +1 @@
1
- export{getModuleName}from"../chunk-URRPEUIK.js";export{getPersonalModificationDescription,getPersonalModificationName}from"../chunk-SS7HVNP5.js";export{getPersonalToolName}from"../chunk-E2HDF6PJ.js";export{getPersonalWeaponDescription}from"../chunk-7C7NJWCF.js";export{getPreEngineeredVariantName}from"../chunk-T7IQHFQ2.js";export{getLoadoutSlotName,getSlotRestrictionLabel}from"../chunk-ZRG35JSH.js"; export{getPersonalMountName,getSuitDescription,getSuitName}from"../chunk-RA4YJBU5.js";export{getCommodityName}from"../chunk-TRGHPX2O.js";export{getCalculationIssueMessage,getLoadoutEditErrorMessage,getLoadoutIssueMessage,getSlefDiagnosticMessage}from"../chunk-6G6TYW2D.js";export{getExperimentalEffectDescription}from"../chunk-RJ3ZLQRB.js";export{getExperimentalEffectName}from"../chunk-QPT2WJYN.js";export{getMaterialName}from"../chunk-UE22QU7A.js";export{getMicroResourceName}from"../chunk-WZIBBJHA.js";export{getOutfittingFamilyName}from"../chunk-YBE5M27G.js";export{getBlueprintName}from"../chunk-UI5RROGI.js"; //# sourceMappingURL=index.js.map
1
+ export{getOutfittingFamilyName}from"../chunk-YBE5M27G.js";export{getModuleName}from"../chunk-URRPEUIK.js";export{getPersonalModificationDescription,getPersonalModificationName}from"../chunk-SS7HVNP5.js";export{getPersonalToolName}from"../chunk-E2HDF6PJ.js";export{getPersonalWeaponDescription}from"../chunk-7C7NJWCF.js";export{getPreEngineeredVariantName}from"../chunk-FRG7MKSJ.js";export{getLoadoutSlotName,getSlotRestrictionLabel}from"../chunk-ZRG35JSH.js"; export{getPersonalMountName,getSuitDescription,getSuitName}from"../chunk-RA4YJBU5.js";export{getCodexRegionName}from"../chunk-O4NIJDL4.js";export{getCommodityName}from"../chunk-TRGHPX2O.js";export{getCalculationIssueMessage,getLoadoutEditErrorMessage,getLoadoutIssueMessage,getSlefDiagnosticMessage}from"../chunk-6G6TYW2D.js";export{getExperimentalEffectDescription}from"../chunk-RJ3ZLQRB.js";export{getExperimentalEffectName}from"../chunk-QPT2WJYN.js";export{getMaterialName}from"../chunk-UE22QU7A.js";export{getMicroResourceName}from"../chunk-WZIBBJHA.js";export{getBlueprintName}from"../chunk-KR664YI3.js"; //# sourceMappingURL=index.js.map
@@ -1,4 +1,8 @@
1
1
  import { PreEngineeredAcquisition } from '../ships/pre-engineered.js';
2
+ import '../ships/modules.js';
3
+ import '../ships/engineering-options.js';
4
+ import '../ships/module-families.js';
5
+ import '../ships/slots.js';
2
6
 
3
7
  /** Localized pre-engineered variant names, isolated from module and modifier statistics. */
4
8
 
@@ -1 +1 @@
1
- export{getPreEngineeredVariantName}from"../chunk-T7IQHFQ2.js"; //# sourceMappingURL=pre-engineered.js.map
1
+ export{getPreEngineeredVariantName}from"../chunk-FRG7MKSJ.js"; //# sourceMappingURL=pre-engineered.js.map
@@ -1 +1 @@
1
- export{getMicroResourceByName,getMicroResourceBySymbol,microResourcesInCategory}from"../chunk-RA6SY445.js";export{MaterialGrade,MaterialLine,getMaterialByElementSymbol,getMaterialByName,getMaterialBySymbol,materialsByGrade,materialsInCategory,materialsInLine}from"../chunk-ETREYN5U.js";export{ALL_MATERIALS}from"../chunk-FP2TQJZP.js";export{ENCODED_MATERIALS}from"../chunk-A5TCT2AJ.js";export{MANUFACTURED_MATERIALS}from"../chunk-PF3HZ73R.js";export{RAW_MATERIALS}from"../chunk-GZLD7RTK.js"; export{ALL_MICRO_RESOURCES}from"../chunk-4WC5NHBJ.js";export{DATA_MICRO_RESOURCES}from"../chunk-GVLDFJEY.js";export{ITEM_MICRO_RESOURCES}from"../chunk-WHWFKHV3.js";export{COMPONENT_MICRO_RESOURCES}from"../chunk-HTB52N6S.js";export{CONSUMABLE_MICRO_RESOURCES}from"../chunk-K7L7SMIR.js"; //# sourceMappingURL=index.js.map
1
+ export{getMicroResourceByName,getMicroResourceBySymbol,microResourcesInCategory}from"../chunk-7UF4XRIR.js";export{MaterialGrade,MaterialLine,getMaterialByElementSymbol,getMaterialByName,getMaterialBySymbol,materialsByGrade,materialsInCategory,materialsInLine}from"../chunk-ETREYN5U.js";export{ALL_MATERIALS}from"../chunk-FP2TQJZP.js";export{ENCODED_MATERIALS}from"../chunk-A5TCT2AJ.js";export{MANUFACTURED_MATERIALS}from"../chunk-PF3HZ73R.js";export{RAW_MATERIALS}from"../chunk-GZLD7RTK.js"; export{ALL_MICRO_RESOURCES}from"../chunk-KLC5XT6F.js";export{CONSUMABLE_MICRO_RESOURCES}from"../chunk-K7L7SMIR.js";export{DATA_MICRO_RESOURCES}from"../chunk-GVLDFJEY.js";export{ITEM_MICRO_RESOURCES}from"../chunk-WHWFKHV3.js";export{COMPONENT_MICRO_RESOURCES}from"../chunk-HTB52N6S.js"; //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- export{ALL_MICRO_RESOURCES}from"../chunk-4WC5NHBJ.js"; //# sourceMappingURL=micro-resources-all.js.map
1
+ export{ALL_MICRO_RESOURCES}from"../chunk-KLC5XT6F.js"; //# sourceMappingURL=micro-resources-all.js.map
@@ -1 +1 @@
1
- export{getMicroResourceByName,getMicroResourceBySymbol,microResourcesInCategory}from"../chunk-RA6SY445.js"; //# sourceMappingURL=micro-resources.js.map
1
+ export{getMicroResourceByName,getMicroResourceBySymbol,microResourcesInCategory}from"../chunk-7UF4XRIR.js"; //# sourceMappingURL=micro-resources.js.map
@@ -1 +1 @@
1
- export{BLUEPRINT_COSTS,BLUEPRINT_MERC_COIN_COSTS,getBlueprintCost,getBlueprintCosts,getBlueprintGradeCost}from"../chunk-K5JK3XQB.js"; //# sourceMappingURL=blueprint-costs.js.map
1
+ export{BLUEPRINT_COSTS,BLUEPRINT_MERC_COIN_COSTS,getBlueprintCost,getBlueprintCosts,getBlueprintGradeCost}from"../chunk-ARG6ESYB.js"; //# sourceMappingURL=blueprint-costs.js.map
@@ -30,10 +30,9 @@ import './slots.js';
30
30
  * full mechanics catalogue and resolves one against a module.
31
31
  *
32
32
  * Further keys are the **Operations** ids: recipes a module is *sold*
33
- * carrying (`ships/pre-engineered`) and the four Operations recipes a player rolls at an
33
+ * carrying (`ships/pre-engineered`) and the Operations recipes a player rolls at an
34
34
  * engineer (`ships/engineering-options`). No journal spelling has been observed for those
35
35
  * Operations ids — a gap in the evidence, not a claim that the game writes none.
36
- *
37
36
  * **Every recipe is keyed once.** Anti-Guardian Zone Resistance is
38
37
  * `GuardianModule_Sturdy`, the id the game writes on Guardian weapons as well as on
39
38
  * Guardian modules; the Inara registry's `recipe_guardianmodule_sturdy` and
@@ -1 +1 @@
1
- export{BLUEPRINTS,getBlueprint,getBlueprintGrade}from"../chunk-AYAKU4YA.js"; //# sourceMappingURL=blueprints.js.map
1
+ export{BLUEPRINTS,getBlueprint,getBlueprintGrade}from"../chunk-WDAYRHXR.js"; //# sourceMappingURL=blueprints.js.map
@@ -1 +1 @@
1
- export{BuildMetrics}from"../chunk-ZWT5Y3JR.js"; //# sourceMappingURL=build-metrics.js.map
1
+ export{BuildMetrics}from"../chunk-DEY44PHF.js"; //# sourceMappingURL=build-metrics.js.map
@@ -1 +1 @@
1
- export{LoadoutEditError,ShipLoadout}from"../chunk-53EBUFVU.js";export{OUTFITTING_FAMILIES}from"../chunk-M6G3UDTX.js";export{validateLoadout}from"../chunk-3GNYPM6J.js";export{SHIP_MODULE_LIMITS,calculateModuleLimits}from"../chunk-KPETDYQX.js";export{hasFrameShiftDriveJumpStats,hasMassCurveStats,hasPowerDistributorStats,hasPowerGenerationStats,hasShieldRegenerationStats,hasWeaponDamageStats}from"../chunk-JTQVWIGL.js";export{BuildMetrics}from"../chunk-ZWT5Y3JR.js";export{weaponsCapacitorMetrics}from"../chunk-M4FZRDAH.js";export{powerBudget}from"../chunk-GGQMIQPC.js";export{shieldCapacitorMetrics}from"../chunk-XQJERZUS.js";export{cellBankSummary,shieldRecovery}from"../chunk-JMAXSXXQ.js"; export{SHIPS,getShipByName,getShipBySymbol,getShipSlots}from"../chunk-C4FUV6GF.js";export{getLoadoutModifier,inspectSlef,parseSlef,stringifySlef,toSlef}from"../chunk-T4MKUKYS.js";export{getSourceModuleValue,sourcePurchaseFromLoadout,sumSourceModuleValues}from"../chunk-NIURLW2F.js";export{armourPiercingFactor,combinedRateOfFire,damageFalloff,damagePerSecond,energyPerSecond,heatPerSecond,splitDamage,sumWeaponMetrics,sustainedDamagePerSecond,sustainedFireFactor,weaponMetrics}from"../chunk-AAU7OM47.js";export{getPreEngineeredJournalModifiers,getPreEngineeredModifiers,getPreEngineeredStats,identifyPreEngineeredVariant,unresolvedModifiers}from"../chunk-C3YZ5KTA.js";export{PRE_ENGINEERED_MODULES,getPreEngineeredVariants,isPreEngineered}from"../chunk-AUBV6S7V.js";export{shieldMassCurveMultiplier,shieldMetrics,shieldStrength}from"../chunk-DBJKLXLS.js";export{getBulkheadsForShip,getModuleBySymbol,getModulesByName}from"../chunk-OSMBAFRW.js"; export{OVERHEAT_HEAT_LEVEL,effectiveWeaponThermalLoad,equilibriumHeatLevel,heatLevelAtTime,heatMetrics,secondsToHeatLevel}from"../chunk-6HA2YIKW.js";export{frameShiftDriveMassFactor,fuelPerJump,singleJumpRange,totalRange}from"../chunk-VTMCSCXV.js";export{calculateCargoCapacity,calculateFuelCapacity,calculatePassengerCapacity,calculateUnladenMass}from"../chunk-C3LLPLLD.js"; export{mobilityCapacitorMetrics}from"../chunk-VEEBJFJ7.js";export{mobilityMetrics,thrusterMassCurveMultiplier}from"../chunk-A4QKXXZD.js"; export{distributorMetrics}from"../chunk-M2TCZKRT.js"; export{EXPERIMENTAL_EFFECTS,getExperimentalEffect}from"../chunk-77I24V6B.js";export{SHIP_GUNSIGHTS,getShipGunsight,projectGunsight}from"../chunk-XSN53F7W.js";export{ammunitionCapacity}from"../chunk-AA3K5XUE.js";export{armourMetrics}from"../chunk-Q5ALV3DI.js";export{effectiveHitPoints,mapDamageTypes,stackArmourResistance,stackShieldResistance,systemsResistance}from"../chunk-F44QX47A.js"; export{computeModifiers,sumMaterials}from"../chunk-U73MBQ45.js"; export{resolveBlueprintForModule}from"../chunk-2J6NNI3Y.js";export{ENGINEERING_OPTION_GROUPS,getBlueprintsForModule,getEngineeringGroup,getExperimentalsForBlueprint,getExperimentalsForModule}from"../chunk-M4STXLXO.js";export{BLUEPRINTS,getBlueprint,getBlueprintGrade}from"../chunk-AYAKU4YA.js"; export{SLOT_RESTRICTION_LABELS,enumerateSlots,parseSlotName}from"../chunk-RAO35XDF.js"; //# sourceMappingURL=index.js.map
1
+ export{LoadoutEditError,ShipLoadout}from"../chunk-25EECUZ2.js";export{hasFrameShiftDriveJumpStats,hasMassCurveStats,hasPowerDistributorStats,hasPowerGenerationStats,hasShieldRegenerationStats,hasWeaponDamageStats}from"../chunk-JTQVWIGL.js";export{OUTFITTING_FAMILIES}from"../chunk-M6G3UDTX.js";export{SHIP_GUNSIGHTS,getShipGunsight,projectGunsight}from"../chunk-XSN53F7W.js";export{validateLoadout}from"../chunk-3GNYPM6J.js";export{SHIP_MODULE_LIMITS,calculateModuleLimits}from"../chunk-KPETDYQX.js";export{BuildMetrics}from"../chunk-DEY44PHF.js"; export{SHIPS,getShipByName,getShipBySymbol,getShipSlots}from"../chunk-C4FUV6GF.js";export{getLoadoutModifier,inspectSlef,parseSlef,stringifySlef,toSlef}from"../chunk-T4MKUKYS.js";export{getSourceModuleValue,sourcePurchaseFromLoadout,sumSourceModuleValues}from"../chunk-NIURLW2F.js";export{weaponsCapacitorMetrics}from"../chunk-M4FZRDAH.js";export{armourPiercingFactor,combinedRateOfFire,damageFalloff,damagePerSecond,energyPerSecond,heatPerSecond,splitDamage,sumWeaponMetrics,sustainedDamagePerSecond,sustainedFireFactor,weaponMetrics}from"../chunk-AAU7OM47.js";export{powerBudget}from"../chunk-GGQMIQPC.js";export{getPreEngineeredJournalModifiers,getPreEngineeredModifiers,getPreEngineeredStats,identifyPreEngineeredVariant,unresolvedModifiers}from"../chunk-P6HCQ2YE.js";export{getBulkheadsForShip,getModuleBySymbol,getModulesByName}from"../chunk-OSMBAFRW.js";export{PRE_ENGINEERED_MODULES,getPreEngineeredVariants,isPreEngineered}from"../chunk-EXHZ4CFB.js";export{shieldCapacitorMetrics}from"../chunk-XQJERZUS.js";export{cellBankSummary,shieldRecovery}from"../chunk-JMAXSXXQ.js";export{shieldMassCurveMultiplier,shieldMetrics,shieldStrength}from"../chunk-DBJKLXLS.js"; export{OVERHEAT_HEAT_LEVEL,effectiveWeaponThermalLoad,equilibriumHeatLevel,heatLevelAtTime,heatMetrics,secondsToHeatLevel}from"../chunk-6HA2YIKW.js";export{frameShiftDriveMassFactor,fuelPerJump,singleJumpRange,totalRange}from"../chunk-VTMCSCXV.js";export{calculateCargoCapacity,calculateFuelCapacity,calculatePassengerCapacity,calculateUnladenMass}from"../chunk-C3LLPLLD.js"; export{mobilityCapacitorMetrics}from"../chunk-VEEBJFJ7.js";export{mobilityMetrics,thrusterMassCurveMultiplier}from"../chunk-A4QKXXZD.js"; export{BLUEPRINTS,getBlueprint,getBlueprintGrade}from"../chunk-WDAYRHXR.js"; export{distributorMetrics}from"../chunk-M2TCZKRT.js"; export{EXPERIMENTAL_EFFECTS,getExperimentalEffect}from"../chunk-77I24V6B.js";export{ammunitionCapacity}from"../chunk-AA3K5XUE.js";export{armourMetrics}from"../chunk-Q5ALV3DI.js";export{effectiveHitPoints,mapDamageTypes,stackArmourResistance,stackShieldResistance,systemsResistance}from"../chunk-F44QX47A.js"; export{computeModifiers,sumMaterials}from"../chunk-U73MBQ45.js"; export{resolveBlueprintForModule}from"../chunk-2J6NNI3Y.js";export{ENGINEERING_OPTION_GROUPS,getBlueprintsForModule,getEngineeringGroup,getExperimentalsForBlueprint,getExperimentalsForModule}from"../chunk-M4STXLXO.js"; export{SLOT_RESTRICTION_LABELS,enumerateSlots,parseSlotName}from"../chunk-RAO35XDF.js"; //# sourceMappingURL=index.js.map
@@ -44,8 +44,7 @@ import './slots.js';
44
44
  *
45
45
  * @param variant - A pre-engineered variant.
46
46
  * @returns One modifier per computable label, or an empty array when the variant carries
47
- * neither a stat block nor a baked effect that moves a stat (a `mercenary` row carries no
48
- * stat block, so only its baked effect contributes) or its symbol is unknown.
47
+ * neither a stat block nor a baked effect that moves a stat, or its symbol is unknown.
49
48
  *
50
49
  * @example
51
50
  * ```ts
@@ -69,9 +68,8 @@ declare function getPreEngineeredModifiers(variant: PreEngineeredVariant): Engin
69
68
  *
70
69
  * @param variant - A pre-engineered variant.
71
70
  * @returns Its computable fixed modifiers in journal representation, or an empty array
72
- * when its symbol is unknown or it moves no stat the catalogue carries. A `mercenary` row
73
- * publishes no stat block, so what its baked experimental effect moves is the whole of
74
- * what it reports — the same block `ShipLoadout.setPreEngineeredVariant` fits.
71
+ * when its symbol is unknown or it moves no stat the catalogue carries. A measured
72
+ * Mercenary row combines its fixed block with its baked experimental effect.
75
73
  *
76
74
  * @example
77
75
  * ```ts
@@ -178,10 +176,8 @@ declare function unresolvedModifiers(variant: PreEngineeredVariant): string[];
178
176
  * Exact damage components scale with an engineered `damage` value so their proportions
179
177
  * and the anti-xeno overlay remain coherent with the resolved scalar.
180
178
  *
181
- * A variant with no stat block (every `mercenary` row) resolves to a copy of the base
182
- * record with only its baked experimental effect applied, which is the honest answer —
183
- * the effect is published, the grade-1 pre-engineering those arrive with is not, so the
184
- * catalogue does not guess at it.
179
+ * A caller-supplied variant with no stat block resolves to a copy of the base record with only
180
+ * its baked experimental effect applied.
185
181
  *
186
182
  * `rateOfFire` follows a moved firing cycle even though no recipe names it: an article
187
183
  * whose burst interval, burst size or within-burst rate moves — by its own stat block or
@@ -1 +1 @@
1
- export{getPreEngineeredJournalModifiers,getPreEngineeredModifiers,getPreEngineeredStats,identifyPreEngineeredVariant,unresolvedModifiers}from"../chunk-C3YZ5KTA.js"; //# sourceMappingURL=pre-engineered-stats.js.map
1
+ export{getPreEngineeredJournalModifiers,getPreEngineeredModifiers,getPreEngineeredStats,identifyPreEngineeredVariant,unresolvedModifiers}from"../chunk-P6HCQ2YE.js"; //# sourceMappingURL=pre-engineered-stats.js.map
@@ -1,3 +1,8 @@
1
+ import { DamageDistribution } from './modules.js';
2
+ import './engineering-options.js';
3
+ import './module-families.js';
4
+ import './slots.js';
5
+
1
6
  /**
2
7
  * The **pre-engineered module catalogue** — the outfitting rows you buy or receive
3
8
  * already modified, each paired with the base module it fits as and the engineering
@@ -18,10 +23,9 @@
18
23
  * grade already applied. Most blueprint ids join to `BLUEPRINTS`; the festive
19
24
  * `Decorative_*` ids instead identify fixed grade-5 reward articles with no craftable
20
25
  * recipe or material cost.
21
- * Mercenary entries are bought at grade 1 and their bespoke recipes start at
22
- * grade 2 price the remaining upgrade with `getBlueprintCost(blueprint, target,
23
- * grade)` from `ships/blueprint-costs`, which answers with the materials and the Merc
24
- * Coin the climb costs.
26
+ * Mercenary entries are bought at grade 1. Measured bespoke recipes start at grade 2.
27
+ * Price a measured upgrade with `getBlueprintCost(blueprint, target, grade)` from
28
+ * `ships/blueprint-costs`. It returns `null` when numeric grades and costs are not measured.
25
29
  * Community-goal and tech-broker entries instead identify fixed reward articles; their
26
30
  * blueprint ids do not grant a recipe to the stock module.
27
31
  *
@@ -41,6 +45,7 @@
41
45
  *
42
46
  * @packageDocumentation
43
47
  */
48
+
44
49
  /**
45
50
  * Where a pre-engineered variant is obtained.
46
51
  *
@@ -130,11 +135,12 @@ interface PreEngineeredVariant {
130
135
  * {@link ships/blueprint-costs!getBlueprintCost | getBlueprintCost}.
131
136
  */
132
137
  readonly mercCoinCost?: number;
138
+ /** The fixed damage-type shares the variant arrives with. */
139
+ readonly damageDistribution?: DamageDistribution;
133
140
  /**
134
141
  * The hand-set stat block the variant arrives with, sorted by `label`.
135
142
  *
136
- * Absent on every `mercenary` row: no registry publishes the grade-1 pre-engineering
137
- * those arrive with. Present on all community-goal, tech-broker and event-reward rows.
143
+ * Every catalogued variant carries this block.
138
144
  */
139
145
  readonly modifiers?: readonly PreEngineeredModifier[];
140
146
  }
@@ -1 +1 @@
1
- export{PRE_ENGINEERED_MODULES,getPreEngineeredVariants,isPreEngineered}from"../chunk-AUBV6S7V.js"; //# sourceMappingURL=pre-engineered.js.map
1
+ export{PRE_ENGINEERED_MODULES,getPreEngineeredVariants,isPreEngineered}from"../chunk-EXHZ4CFB.js"; //# sourceMappingURL=pre-engineered.js.map
@@ -975,7 +975,8 @@ declare class ShipLoadout {
975
975
  *
976
976
  * @param slotKey - Slot key, matched case-insensitively.
977
977
  * @returns Frozen Frontier effect ids in engineering-menu order, or an empty array
978
- * when the slot is empty, unresolved, final, or has no experimental menu.
978
+ * when the slot is empty, unresolved, final, has no experimental menu, or holds a
979
+ * Mercenary hardpoint with a fixed experimental state.
979
980
  * @throws {TypeError} If `slotKey` is not a string.
980
981
  * @example
981
982
  * ```ts
@@ -1109,6 +1110,8 @@ declare class ShipLoadout {
1109
1110
  * (`MaximumRange`, `Range`); recipe-only values a journal serializes no label for
1110
1111
  * stay available through {@link FittedModule.effectiveStats}, which is what keeps
1111
1112
  * burst and reload-cycle calculations faithful.
1113
+ * A Mercenary hardpoint keeps the experimental state it is sold with when its grade
1114
+ * changes. The caller cannot add, remove or replace that effect.
1112
1115
  *
1113
1116
  * **Which recipe an id names can depend on the module.** The game writes
1114
1117
  * `Sensor_LongRange` for both a sensor suite's modification and a utility scanner's,
@@ -1122,7 +1125,8 @@ declare class ShipLoadout {
1122
1125
  * @param blueprintSymbol - The blueprint recipe's Frontier symbol, e.g. `"FSD_LongRange"`.
1123
1126
  * @param options - {@link ApplyBlueprintOptions}: `grade` (1–5), optional `quality`
1124
1127
  * (0–1, default 1), and optional `experimental` effect symbol. A nullish
1125
- * `experimental` means no effect, the same as leaving it out. Each is read once,
1128
+ * `experimental` means no effect, the same as leaving it out. A Mercenary hardpoint
1129
+ * instead retains its fixed state when this option is absent. Each value is read once,
1126
1130
  * before anything is checked, so an accessor cannot answer the check and the use
1127
1131
  * differently.
1128
1132
  * @returns `this`, for chaining.
@@ -1132,8 +1136,8 @@ declare class ShipLoadout {
1132
1136
  * object, or `options.experimentalEffectSymbol` carries a value that is not a string — a nullish
1133
1137
  * one is no effect, not a wrong type. Also if the fitted module has no stats to
1134
1138
  * engineer, is final and accepts no further engineering, is not offered the blueprint
1135
- * by its own menu, is not offered the experimental effect by it, or the id names a
1136
- * fixed event-reward identity rather than a craftable recipe — use
1139
+ * by its own menu, is not offered the experimental effect by it, tries to change a
1140
+ * Mercenary hardpoint's fixed effect, or names a fixed event-reward identity — use
1137
1141
  * {@link setPreEngineeredVariant} for those. Finally, if the catalogue does not carry
1138
1142
  * every base stat the recipe modifies: incomplete engineering is rejected rather than
1139
1143
  * stored as a partial journal modifier block.
@@ -1160,19 +1164,13 @@ declare class ShipLoadout {
1160
1164
  /**
1161
1165
  * Add, replace or remove only the fitted module's experimental effect.
1162
1166
  *
1163
- * Ordinary and Mercenary engineering is recomputed at its current blueprint, grade
1164
- * and quality. A fixed reward instead retains its hand-authored modifiers and
1167
+ * Ordinary engineering is recomputed at its current blueprint, grade and quality.
1168
+ * A fixed reward instead retains its hand-authored modifiers and
1165
1169
  * purchase identity while the requested effect is composed with them. Refused edits
1166
1170
  * leave the build unchanged and return stable structured data.
1167
1171
  *
1168
- * A Mercenary article is recomputed rather than composed, and that limits what can be
1169
- * done to the effect some of those rows are sold carrying. At its purchase grade there
1170
- * is no recipe to recompute from — the bespoke recipe starts at grade 2 — so every
1171
- * edit is refused with `unsupportedEngineering`. Once engineered to grade 2 or above
1172
- * an edit recomputes normally, but only to an effect the module's own menu offers:
1173
- * the Merc Mining Laser's Incendiary Rounds is not one, so re-stating it is refused
1174
- * with `unsupportedExperimentalEffect`. Both refusals are lossless like any other, and
1175
- * the baked effect stays where it is.
1172
+ * A Mercenary hardpoint keeps the experimental state it is sold with. An effect cannot
1173
+ * be added, removed or replaced at any grade. Re-stating the same state is a no-op.
1176
1174
  *
1177
1175
  * @param slotKey - The engineered slot, matched case-insensitively.
1178
1176
  * @param experimental - Experimental-effect symbol, or `null` to remove the effect.
@@ -1237,10 +1235,10 @@ declare class ShipLoadout {
1237
1235
  * {@link getPreEngineeredJournalModifiers} for the same variant, and the module's
1238
1236
  * {@link FittedModule.effectiveStats | effectiveStats} resolve to the figures it
1239
1237
  * states — including a rate of fire, which no recipe names and both the block and the
1240
- * stats derive from the article's firing cycle. A Mercenary variant
1241
- * publishes no fixed stat block of its own, so it keeps the stock catalogue stats
1242
- * apart from its baked experimental effect, and states that effect's modifiers and
1243
- * no others. An article that moves no stat at all carries no `Modifiers` key, rather
1238
+ * stats derive from the article's firing cycle. A Mercenary variant uses its observed
1239
+ * fixed stat block when one is available. Otherwise, it keeps the stock catalogue
1240
+ * stats apart from its baked experimental effect and states only that effect's
1241
+ * modifiers. An article that moves no stat at all carries no `Modifiers` key, rather
1244
1242
  * than an empty array claiming it changes none.
1245
1243
  *
1246
1244
  * @param slotKey - The slot key to fit into, matched case-insensitively.
@@ -1 +1 @@
1
- export{LoadoutEditError,ShipLoadout}from"../chunk-53EBUFVU.js"; //# sourceMappingURL=ship-loadout.js.map
1
+ export{LoadoutEditError,ShipLoadout}from"../chunk-25EECUZ2.js"; //# sourceMappingURL=ship-loadout.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elite-dangerous-almanac/core",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "description": "Elite Dangerous static data and calculations: astronomy, ships and outfitting, personal equipment and engineering, materials, and market commodities.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -211,6 +211,10 @@
211
211
  "types": "./dist/i18n/index.d.ts",
212
212
  "import": "./dist/i18n/index.js"
213
213
  },
214
+ "./i18n/codex-regions": {
215
+ "types": "./dist/i18n/codex-regions.d.ts",
216
+ "import": "./dist/i18n/codex-regions.js"
217
+ },
214
218
  "./i18n/blueprints": {
215
219
  "types": "./dist/i18n/blueprints.d.ts",
216
220
  "import": "./dist/i18n/blueprints.js"
@@ -506,18 +510,19 @@
506
510
  "scripts": {
507
511
  "audit": "pnpm audit --audit-level=low",
508
512
  "build": "node scripts/copy-notices.mjs && node scripts/copy-assets.mjs && tsup && node scripts/prune-sourcemap-sources.mjs && node scripts/prune-barrel-imports.mjs && node scripts/attach-barrel-docs.mjs",
509
- "check": "pnpm run check:fixtures && pnpm run check:i18n-coverage && pnpm run lint && pnpm run format:check && pnpm run typecheck && pnpm run check:examples && pnpm test",
513
+ "check": "pnpm run check:fixtures && pnpm run check:i18n-coverage && pnpm run lint && pnpm run format:check && pnpm run typecheck && pnpm run check:examples && pnpm run test:wiki && pnpm test",
510
514
  "check:fixtures": "node ../scripts/fixtures/generate-schema-and-types.mjs --check",
511
515
  "check:i18n-coverage": "node scripts/i18n-coverage.mjs --check",
512
- "format": "prettier --write . ../README.md ../CONTRIBUTING.md ../SECURITY.md ../schemas/**/*.{json,md} ../scripts/**/*.mjs ../.github/*.{md,yml} ../.github/workflows/*.yml ../.github/ISSUE_TEMPLATE/*.yml",
513
- "format:check": "prettier --check . ../README.md ../CONTRIBUTING.md ../SECURITY.md ../schemas/**/*.{json,md} ../scripts/**/*.mjs ../.github/*.{md,yml} ../.github/workflows/*.yml ../.github/ISSUE_TEMPLATE/*.yml",
516
+ "format": "prettier --write . ../README.md ../CONTRIBUTING.md ../SECURITY.md ../docs/*.md ../dotnet/docs/**/*.md ../schemas/**/*.{json,md} ../scripts/**/*.mjs ../.github/*.{md,yml} ../.github/workflows/*.yml ../.github/ISSUE_TEMPLATE/*.yml",
517
+ "format:check": "prettier --check . ../README.md ../CONTRIBUTING.md ../SECURITY.md ../docs/*.md ../dotnet/docs/**/*.md ../schemas/**/*.{json,md} ../scripts/**/*.mjs ../.github/*.{md,yml} ../.github/workflows/*.yml ../.github/ISSUE_TEMPLATE/*.yml",
514
518
  "generate:fixtures": "node ../scripts/fixtures/generate-schema-and-types.mjs",
515
519
  "generate:i18n-coverage": "node scripts/i18n-coverage.mjs",
516
520
  "lint": "eslint .",
517
521
  "prepublishOnly": "pnpm run check && pnpm run build && pnpm run test:package",
518
522
  "test": "node --experimental-test-coverage --test-coverage-include=\"src/internal/**/*.ts\" --test-coverage-include=\"src/astro/**/*.ts\" --test-coverage-include=\"src/materials/**/*.ts\" --test-coverage-include=\"src/equipment/**/*.ts\" --test-coverage-include=\"src/i18n/**/*.ts\" --test-coverage-include=\"src/ships/**/*.ts\" --test-coverage-include=\"src/commodities/**/*.ts\" --test-coverage-exclude=\"src/**/*.test.ts\" --test-coverage-lines=80 --test-coverage-branches=80 --test-coverage-functions=80 --import tsx --import ./scripts/register-jsonc.mjs --test \"src/**/*.test.ts\"",
519
523
  "typecheck": "tsc --noEmit",
520
- "docs": "typedoc && node scripts/build-wiki-sidebar.mjs && node scripts/postprocess-wiki.mjs",
524
+ "docs": "typedoc && node ../scripts/wiki/build.mjs",
525
+ "test:wiki": "node --test ../scripts/wiki/*.test.mjs",
521
526
  "check:examples": "node --test scripts/example-claims.test.mjs scripts/example-runtime.test.mjs && node scripts/check-examples.mjs",
522
527
  "test:package": "node --test package.test.mjs"
523
528
  },
@@ -1 +0,0 @@
1
- import{DATA_MICRO_RESOURCES}from"./chunk-GVLDFJEY.js";import{ITEM_MICRO_RESOURCES}from"./chunk-WHWFKHV3.js";import{COMPONENT_MICRO_RESOURCES}from"./chunk-HTB52N6S.js";import{CONSUMABLE_MICRO_RESOURCES}from"./chunk-K7L7SMIR.js";var ALL_MICRO_RESOURCES=Object.freeze([...COMPONENT_MICRO_RESOURCES,...CONSUMABLE_MICRO_RESOURCES,...DATA_MICRO_RESOURCES,...ITEM_MICRO_RESOURCES]);export{ALL_MICRO_RESOURCES};//# sourceMappingURL=chunk-4WC5NHBJ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/materials/micro-resources-all.ts"],"names":["DATA_MICRO_RESOURCES","ITEM_MICRO_RESOURCES","COMPONENT_MICRO_RESOURCES","CONSUMABLE_MICRO_RESOURCES","ALL_MICRO_RESOURCES","Object","freeze"],"mappings":"O,4NA6BO,IAAMI,oBAAgDC,OAAOC,OAAO,IACpEJ,6BACAC,8BACAH,wBACAC,8BACNG"}
@@ -1 +0,0 @@
1
- import{validateLoadout}from"./chunk-3GNYPM6J.js";import{calculateModuleLimits}from"./chunk-KPETDYQX.js";import{publishLoadoutInternals,normalizeLoadoutEvent,preEngineeredVariantFor,moduleFitProblem,effectiveModule,moduleFitError}from"./chunk-A6QTYK2D.js";import{getShipBySymbol}from"./chunk-C4FUV6GF.js";import{parseSlef,toSlef,stringifySlef,getLoadoutModifier}from"./chunk-T4MKUKYS.js";import{getSourceModuleValue}from"./chunk-NIURLW2F.js";import{statesInertModifiers,rolledOverFixedArticle,isNonOutfittingSlot,isBuiltInHullModule,cloneLoadoutModule,cloneModuleStats,availableBlueprintsFor,availableExperimentalsFor,ownKeyIn,BUILT_IN_HULL_SYMBOL,FITTED_ITEM,blueprintAvailableFor,blueprintRoutesFor,experimentalAvailableFor,primitiveEngineeringInputsFor,missingBaseLabels,journalModifiersFor,getPreEngineeredStats,getPreEngineeredJournalModifiers,getPreEngineeredModifiers,ordinaryEngineeringProof,unresolvedModifiers,matchingKeyIn,isCargoHatchSlot,orderBySlotLayout}from"./chunk-C3YZ5KTA.js";import{getPreEngineeredVariants}from"./chunk-AUBV6S7V.js";import{builtInModuleBySymbol}from"./chunk-OSMBAFRW.js";import{ALL_MODULES}from"./chunk-UVX7RCMP.js";import{singleJumpRange}from"./chunk-VTMCSCXV.js";import{calculateUnladenMass,calculatePassengerCapacity,calculateCargoCapacity,calculateFuelCapacity}from"./chunk-C3LLPLLD.js";import{fixedSlotReason,stockedMountKind}from"./chunk-M6J7KP7G.js";import{getDefaultLoadout}from"./chunk-KY7KSPU6.js";import{getExperimentalEffect}from"./chunk-77I24V6B.js";import{ammunitionCapacity}from"./chunk-AA3K5XUE.js";import{baseStats,computeModifiers,labelsForDamageType,scaleForLabel}from"./chunk-U73MBQ45.js";import{resolveBlueprintForModule}from"./chunk-2J6NNI3Y.js";import{getExperimentalsForModule}from"./chunk-M4STXLXO.js";import{getBlueprintGrade}from"./chunk-AYAKU4YA.js";import{loadoutSlotName}from"./chunk-KAA4VOOB.js";import{parseSlotName,enumerateSlots}from"./chunk-RAO35XDF.js";import{normalizeKey,CATALOGUE_KEY}from"./chunk-BKWLI44T.js";import{truncate,describeValue,requireString,requireStringIfPresent}from"./chunk-PKWVG2JY.js";import{deepFreeze}from"./chunk-DURKO7JU.js";var REBUY_FRACTION=.05;function exportLoadoutEvent(input,options){const fromSource=options.credits==="source";const source=fromSource?input.sourcePurchase:null;const totals=source!==null&&!input.sourceTotalsVoided&&sourceTotalsHold(input.modules,source)?source:null;const hullValue=fromSource?source?.hullValue??null:input.retailHullValue;const modulesValue=fromSource?totals?.modulesValue??null:computedModulesValue(input.modules,input.statsFor);const rebuy=fromSource?totals?.rebuy??null:hullValue===null||modulesValue===null?null:Math.trunc((hullValue+modulesValue)*REBUY_FRACTION);return{Ship:input.shipSymbol.toLowerCase(),...input.shipName===void 0?{}:{ShipName:input.shipName},...input.shipIdent===void 0?{}:{ShipIdent:input.shipIdent},...hullValue===null?{}:{HullValue:hullValue},...modulesValue===null?{}:{ModulesValue:modulesValue},UnladenMass:input.unladenMass,CargoCapacity:input.cargoCapacity,...input.maxJumpRange===null?{}:{MaxJumpRange:input.maxJumpRange},FuelCapacity:{Main:input.fuelCapacity.main,Reserve:input.fuelCapacity.reserve},...rebuy===null?{}:{Rebuy:rebuy},Modules:exportModules(input,options,fromSource)}}function exportModules(input,options,fromSource){const ordered=options.moduleOrder==="slots"?slotOrderedModules(input.modules,input.layout):[...input.modules.values()];return ordered.map(module=>{const on=module.On??(options.explicitPower?true:void 0);const priority=module.Priority??(options.explicitPower?0:void 0);const value=fromSource?sourceModuleValue(module,input.sourcePurchase):moduleValue(module,input.statsFor);return{Slot:module.Slot,Item:module.Item.toLowerCase(),...on===void 0?{}:{On:on},...priority===void 0?{}:{Priority:priority},...module.Health===void 0?{}:{Health:module.Health},...typeof value==="number"?{Value:value}:{},...module.Engineering===void 0?{}:{Engineering:cloneLoadoutModule(module).Engineering}}})}function slotOrderedModules(modules,layout){return orderBySlotLayout([...modules.values()],layout,module=>module.Slot)}function computedModulesValue(modules,statsFor){let sum=0;for(const module of modules.values()){const value=moduleValue(module,statsFor);if(value==="unknown")return null;if(value!=="free")sum+=value}return sum}function moduleValue(module,statsFor){const stats=statsFor(module);if(stats!==null)return stats.cost??"unknown";return isNonOutfittingSlot(module.Slot)||isBuiltInHullModule(module)?"free":"unknown"}var SOURCE_ITEM="ShipLoadout: sourcePurchase moduleValues[].item";function sourceModuleValue(module,source){const entry=source===null?null:getSourceModuleValue(source,module.Slot);if(entry===null)return"unknown";return normalizeKey(entry.item,SOURCE_ITEM)===normalizeKey(module.Item,FITTED_ITEM)?entry.value:"unknown"}function sourceTotalsHold(modules,source){for(const entry of source.moduleValues){const key=matchingKeyIn(modules,entry.slot);const fitted=key===null?void 0:modules.get(key);if(!fitted)return false;if(isCargoHatchSlot(entry.slot)&&entry.value===0)continue;if(normalizeKey(fitted.Item,FITTED_ITEM)!==normalizeKey(entry.item,SOURCE_ITEM)){return false}}return true}var SLOT_KEY="ShipLoadout: slotKey";var FITTED_SLOT="ShipLoadout: fitted module Slot";var LoadoutEditError=class extends TypeError{code;constraint;params;constructor(message,code,params,constraint){super(message);this.code=code;this.params=deepFreeze(structuredClone(params));if(constraint!==void 0)this.constraint=constraint}};var experimentalEffectUnsupported=(code,params)=>deepFreeze({kind:"unsupported",code:code,params:params});var engineeringNormalizationUnsupported=(code,params)=>deepFreeze({kind:"unsupported",code:code,params:params});function weighable(tonnes){return tonnes!==void 0&&Number.isFinite(tonnes)&&tonnes>=0?tonnes:void 0}var AGGREGATE_STATS=["mass","cargoCapacity","cabinCapacity","fuelCapacity"];var ShipLoadout=class _ShipLoadout{#ship;#shipSymbol;#modules;#moduleStats;#primitiveModifiers;#top;#sourcePurchase;#importOutcomes;#slotCache=/* @__PURE__ */new Map;#layoutCache;constructor(ship,shipSymbol,modules,top,sourcePurchase=null,moduleStats=/* @__PURE__ */new Map,primitiveModifiers=/* @__PURE__ */new Map,importOutcomes=deepFreeze([])){this.#ship=ship;this.#shipSymbol=shipSymbol;this.#modules=modules;this.#top=top;this.#sourcePurchase=sourcePurchase;this.#moduleStats=moduleStats;this.#primitiveModifiers=primitiveModifiers;this.#importOutcomes=importOutcomes;publishLoadoutInternals(this,{ship:ship,modules:()=>[...this.#modules.values()],effectiveModules:()=>this.#modulesForEffectiveStats(),effectiveModule:module=>this.#moduleForEffectiveStats(module),statsFor:module=>this.#statsFor(module),layout:()=>this.#layout(),resolveDrive:()=>this.#resolveDrive(),frameShiftDriveModule:()=>this.#frameShiftDrive()?.module,calculationModules:()=>this.#calculationModules(),statedMainFuel:()=>this.#top.FuelCapacity?.Main})}static fromSlef(input,index=0){const entries=parseSlef(input);const entry=entries[index];if(!entry){throw new TypeError(`ShipLoadout.fromSlef: no entry at index ${truncate(index)} (have ${entries.length})`)}const imported=normalizeLoadoutEvent(entry.data);const ship=getShipBySymbol(imported.shipSymbol);if(!ship){throw new TypeError(`ShipLoadout.fromSlef: unknown hull "${truncate(imported.shipSymbol)}"`)}return _ShipLoadout.#fromImported(imported,ship)}static fromLoadout(event){if(event===null||typeof event!=="object"){throw new TypeError(`ShipLoadout.fromLoadout: event must be a Loadout event, received ${describeValue(event)}`)}const imported=normalizeLoadoutEvent(event);const ship=getShipBySymbol(imported.shipSymbol);if(!ship){throw new TypeError(`ShipLoadout.fromLoadout: unknown hull "${truncate(imported.shipSymbol)}"`)}return _ShipLoadout.#fromImported(imported,ship)}static#fromImported(imported,ship){const outcomes=[...imported.outcomes];const loadout=new _ShipLoadout(ship,imported.shipSymbol,imported.modules,imported.top,imported.sourcePurchase,imported.moduleStats,imported.primitiveModifiers,outcomes);const{UnladenMass:UnladenMass,CargoCapacity:CargoCapacity,FuelCapacity:FuelCapacity}=imported.top;for(const module of[...imported.modules.values()]){const unresolved=loadout.#rollStatedRecipe(module);if(unresolved!==null)outcomes.push(unresolved)}if(UnladenMass!==void 0)loadout.#top.UnladenMass=UnladenMass;if(CargoCapacity!==void 0)loadout.#top.CargoCapacity=CargoCapacity;if(FuelCapacity!==void 0)loadout.#top.FuelCapacity=FuelCapacity;deepFreeze(outcomes);return loadout}#rollStatedRecipe(module){const engineering=module.Engineering;if(!engineering||typeof engineering.BlueprintName!=="string")return null;const stated=engineering.Modifiers;const stats=this.#statsFor(module);if(stated!==void 0&&(this.#moduleStats.has(module.Slot)||stats===null||!statesInertModifiers(stats,stated))){return null}if(stated===void 0&&this.#moduleStats.has(module.Slot)){const variant=preEngineeredVariantFor(module);if(variant?.acquisition!=="mercenary"||engineering.Level<=variant.grade){return null}}try{this.applyBlueprint(module.Slot,engineering.BlueprintName,{grade:engineering.Level,quality:engineering.Quality??1,...typeof engineering.ExperimentalEffect==="string"?{experimentalEffectSymbol:engineering.ExperimentalEffect}:{}});if(stated!==void 0){return{action:"rerolledEngineering",slot:module.Slot,sourceSymbol:module.Item,blueprintSymbol:engineering.BlueprintName}}const passedOver=rolledOverFixedArticle(module.Item,engineering);return passedOver===null?null:{action:"ambiguousEngineering",slot:module.Slot,sourceSymbol:module.Item,blueprintSymbol:engineering.BlueprintName,preEngineeredVariant:passedOver}}catch(error){if(!(error instanceof TypeError)&&!(error instanceof RangeError))throw error;return{action:"unresolvedEngineering",slot:module.Slot,sourceSymbol:module.Item,blueprintSymbol:engineering.BlueprintName}}}static empty(shipSymbol){const requested=requireString(shipSymbol,"ShipLoadout.empty: shipSymbol");const ship=getShipBySymbol(requested);if(!ship){throw new TypeError(`ShipLoadout.empty: no slot layout for hull "${truncate(shipSymbol)}"`)}const fitted=(getDefaultLoadout(ship.symbol)?.modules??[]).filter(module=>{const parsed=parseSlotName(module.slot);return parsed!==null&&fixedSlotReason(parsed)!==null});return new _ShipLoadout(ship,ship.symbol,new Map(fitted.map(module=>[module.slot,{Slot:module.slot,Item:module.symbol}])),{})}static default(shipSymbol){const requested=requireString(shipSymbol,"ShipLoadout.default: shipSymbol");const ship=getShipBySymbol(requested);if(!ship){throw new TypeError(`ShipLoadout.default: no default loadout for hull "${truncate(shipSymbol)}"`)}const loadout=getDefaultLoadout(ship.symbol);return new _ShipLoadout(ship,loadout.symbol,new Map(loadout.modules.map(module=>[module.slot,{Slot:module.slot,Item:module.symbol}])),{})}get shipSymbol(){return this.#shipSymbol}get shipName(){return this.#top.ShipName??null}get shipIdent(){return this.#top.ShipIdent??null}get unladenMass(){return this.#top.UnladenMass??this.#computedUnladenMass()}#computedUnladenMass(){return calculateUnladenMass(this.#ship.hullMass,this.#calculationModules())}get fuelCapacity(){const cap=this.#top.FuelCapacity;if(cap?.Main!==void 0&&cap.Reserve!==void 0){return Object.freeze({main:cap.Main,reserve:cap.Reserve})}const computed=this.#computedFuelCapacity();return Object.freeze({main:cap?.Main??computed.main,reserve:cap?.Reserve??computed.reserve})}get cargoCapacity(){return this.#top.CargoCapacity??this.#computedCargoCapacity()}get passengerCapacity(){return calculatePassengerCapacity(this.#calculationModules())}#computedCargoCapacity(){return calculateCargoCapacity(this.#calculationModules())}#computedFuelCapacity(){return calculateFuelCapacity(this.#ship.reserveFuelCapacity,this.#calculationModules())}get hullValue(){return this.#top.HullValue??null}get modulesValue(){return this.#top.ModulesValue??null}get rebuy(){return this.#top.Rebuy??null}get sourcePurchase(){return this.#sourcePurchase}get importOutcomes(){return this.#importOutcomes}validation(){const slots=this.#layout();const byKey=new Map(slots.map(slot=>[normalizeKey(slot.key,CATALOGUE_KEY),slot]));const modules=[...this.#modules.values()].map(module=>{const stats=this.#statsFor(module);const slot=byKey.get(normalizeKey(module.Slot,FITTED_SLOT));const builtIn=stats===null&&isNonOutfittingSlot(module.Slot)||isBuiltInHullModule(module);const fitProblem=stats&&slot&&!builtIn?moduleFitProblem(this.#shipSymbol,slot,stats):null;const thrusterMaxMass=weighable(stats?.slot==="thrusters"?effectiveModule(this.#moduleForEffectiveStats(module),stats)?.maxMass:void 0);return{slot:module.Slot,symbol:module.Item,requiresKnownSlot:!builtIn,fitError:fitProblem?.message??null,...fitProblem===null?{}:{fitConstraint:fitProblem.constraint},...fitProblem?.params===void 0?{}:{fitParams:fitProblem.params},...stats?.exclusionGroup===void 0?{}:{exclusionGroup:stats.exclusionGroup},...stats?.limitGroup===void 0?{}:{limitGroup:stats.limitGroup},...stats?.limitIncrease===void 0?{}:{limitIncrease:stats.limitIncrease},...thrusterMaxMass===void 0?{}:{thrusterMaxMass:thrusterMaxMass}}});const dry=weighable(this.unladenMass);const fuel=weighable(this.fuelCapacity.main);const cargo=weighable(this.cargoCapacity);const mass=dry===void 0?void 0:{dry:dry,...fuel===void 0?{}:{fuel:fuel},...fuel===void 0||cargo===void 0?{}:{cargo:cargo}};return validateLoadout({shipSymbol:this.#shipSymbol,slots:slots,modules:modules,...mass===void 0?{}:{mass:mass}})}slots(kind){const cached=this.#slotCache.get(kind);if(cached!==void 0)return cached;const slots=kind===void 0?this.#layout():this.#layout().filter(slot=>slot.kind===kind);const currentLimits=this.#moduleLimits();const value=deepFreeze(slots.map(slot=>{const stats=this.#moduleStatsAt(slot.key);const fixedReason=fixedSlotReason(slot);const immovableReason=fixedReason!==null?fixedReason:stats?.limitIncrease!==void 0&&this.#moduleLimitRegression(slot.key,null,currentLimits,stats)!==null?"moduleLimit":null;return{...slot,name:loadoutSlotName(slot),module:this.fittedModuleAt(slot.key),removable:immovableReason===null,...immovableReason===null?{}:{immovableReason:immovableReason}}}));this.#slotCache.set(kind,value);return value}fittedModuleAt(slotKey){const module=this.#fittedModuleFor(slotKey);if(!module)return null;const raw=cloneLoadoutModule(module);const stats=this.#statsFor(module);const effective=effectiveModule(this.#moduleForEffectiveStats(module),stats);return deepFreeze({slot:module.Slot,symbol:raw.Item,on:raw.On,priority:raw.Priority,health:raw.Health,value:raw.Value,engineering:raw.Engineering,raw:raw,stats:stats===null?null:cloneModuleStats(stats),effectiveStats:effective===null?null:cloneModuleStats(effective),ammunition:ammunitionCapacity(effective),preEngineeredVariant:preEngineeredVariantFor(raw)})}fittedModules(){return deepFreeze([...this.#modules.keys()].flatMap(key=>{const fitted=this.fittedModuleAt(key);return fitted===null?[]:[fitted]}))}availableBlueprints(slotKey){const module=this.#fittedModuleFor(slotKey);return deepFreeze(module?availableBlueprintsFor(module.Item,this.#statsFor(module)):[])}availableExperimentalEffects(slotKey){const module=this.#fittedModuleFor(slotKey);return deepFreeze(module?availableExperimentalsFor(module.Item,this.#statsFor(module)):[])}modulesForSlot(slotKey){const slot=this.#requireSlot(slotKey);const occupied=new Set([...this.#modules.values()].flatMap(fitted=>{if(normalizeKey(fitted.Slot,FITTED_SLOT)===normalizeKey(slot.key,CATALOGUE_KEY))return[];const group=this.#statsFor(fitted)?.exclusionGroup;return group===void 0?[]:[group]}));const currentLimits=this.#moduleLimits();const currentStats=this.#moduleStatsAt(slot.key);return ALL_MODULES.filter(module=>module.grantOnly===void 0&&moduleFitError(this.#shipSymbol,slot,module)===null&&(module.exclusionGroup===void 0||!occupied.has(module.exclusionGroup))&&this.#moduleLimitRegression(slot.key,module,currentLimits,currentStats)===null)}repairFixedMount(slotKey){const requested=requireString(slotKey,SLOT_KEY);const wanted=normalizeKey(requested,SLOT_KEY);const slot=this.#requireSlot(requested);const fittedKey=this.#fittedKey(requested);const resultSlot=fittedKey??requested;const canonicalKey=slot.key;if(fixedSlotReason(slot)===null){return deepFreeze({status:"refused",slot:resultSlot,reason:"notFixedMount"})}const current=this.#fittedModuleFor(requested);const currentStats=current?this.#statsFor(current):null;const valid=current!==void 0&&currentStats!==null&&(slot.kind==="cargoHatch"?isBuiltInHullModule(current):moduleFitProblem(this.#shipSymbol,slot,currentStats)===null);if(valid){return deepFreeze({status:"unchanged",slot:current.Slot,symbol:current.Item})}const defaultModule=getDefaultLoadout(this.#shipSymbol)?.modules.find(module=>normalizeKey(module.slot,CATALOGUE_KEY)===wanted);if(!defaultModule){return deepFreeze({status:"defaultUnavailable",slot:resultSlot})}const ownKey=ownKeyIn(this.#modules,canonicalKey);const replacement={Slot:ownKey,Item:defaultModule.symbol,...current?.On===void 0?{}:{On:current.On},...current?.Priority===void 0?{}:{Priority:current.Priority},...current?.Health===void 0?{}:{Health:current.Health}};const replacementStats=builtInModuleBySymbol(defaultModule.symbol,"ShipLoadout.repairFixedMount")??(isBuiltInHullModule(replacement)?builtInModuleBySymbol(BUILT_IN_HULL_SYMBOL,"ShipLoadout.repairFixedMount"):null);if(!replacementStats){return deepFreeze({status:"defaultUnavailable",slot:resultSlot,symbol:defaultModule.symbol})}this.#replaceModule(ownKey,replacement,replacementStats);return deepFreeze({status:"repaired",slot:ownKey,symbol:defaultModule.symbol})}setModule(slotKey,module){const slot=this.#requireSlot(slotKey);if(module===null||module===void 0){throw new TypeError(`ShipLoadout.setModule: no module supplied for "${truncate(slotKey)}" (did the module lookup return undefined?)`)}if(typeof module.symbol!=="string"){throw new TypeError(`ShipLoadout.setModule: module for "${truncate(slotKey)}" must be an outfitting module, received ${describeValue(module)}`)}module=cloneModuleStats(module);const catalogued=builtInModuleBySymbol(module.symbol,FITTED_ITEM);if(catalogued===null){throw new TypeError(`ShipLoadout.setModule: no module is catalogued as "${truncate(module.symbol)}"`)}for(const field of AGGREGATE_STATS){const stated=module[field];if(stated===void 0){if(catalogued[field]===void 0)continue;throw new TypeError(`ShipLoadout.setModule: the supplied record for "${truncate(module.symbol)}" has no ${field}`)}if(typeof stated!=="number"||!Number.isFinite(stated)){throw new TypeError(`ShipLoadout.setModule: the supplied record for "${truncate(module.symbol)}" states a ${field} of ${describeValue(stated)}`)}}const problem=moduleFitProblem(this.#shipSymbol,slot,module);if(problem){if(problem.constraint==="immutableSlot"){throw new LoadoutEditError(`ShipLoadout.setModule: ${truncate(module.symbol)} → ${truncate(slotKey)}: ${problem.message}`,"immutableSlot",{slot:slot.key})}throw new LoadoutEditError(`ShipLoadout.setModule: ${truncate(module.symbol)} → ${truncate(slotKey)}: ${problem.message}`,"incompatibleModule",{...problem.params,slot:slot.key,symbol:module.symbol,constraint:problem.constraint},problem.constraint)}if(module.exclusionGroup!==void 0){const conflict=[...this.#modules.values()].find(fitted=>normalizeKey(fitted.Slot,FITTED_SLOT)!==normalizeKey(slot.key,CATALOGUE_KEY)&&this.#statsFor(fitted)?.exclusionGroup===module.exclusionGroup);if(conflict){throw new LoadoutEditError(`ShipLoadout.setModule: ${truncate(module.symbol)} → ${truncate(slotKey)}: ${module.exclusionGroup} is limited to one per ship (already fitted in ${truncate(conflict.Slot)})`,"duplicateExclusiveModule",{exclusionGroup:module.exclusionGroup,slot:slot.key,symbol:module.symbol,previousSlot:conflict.Slot,previousSymbol:conflict.Item})}}const limitProblem=this.#moduleLimitRegression(slot.key,module);if(limitProblem!==null){throw new LoadoutEditError(`ShipLoadout.setModule: ${truncate(module.symbol)} → ${truncate(slotKey)}: ${limitProblem.group} would have ${limitProblem.count} modules but the ship allows ${limitProblem.limit}`,"moduleLimitExceeded",{group:limitProblem.group,count:limitProblem.count,limit:limitProblem.limit,slot:slot.key,symbol:module.symbol})}const key=this.#fittedKey(slotKey)??slot.key;this.#replaceModule(key,{Slot:key,Item:module.symbol},module);return this}removeModule(slotKey){const wanted=normalizeKey(slotKey,SLOT_KEY);if(wanted==="cargohatch"){throw new LoadoutEditError("ShipLoadout.removeModule: the cargoHatch slot cannot be changed","immutableSlot",{slot:"CargoHatch"})}const parsed=parseSlotName(slotKey);const slot=this.#layout().find(candidate=>normalizeKey(candidate.key,CATALOGUE_KEY)===wanted);if(parsed!==null&&fixedSlotReason(parsed)==="requiredSlot"){const fittedKey=this.#fittedKey(slotKey);const key2=slot?.key??fittedKey??slotKey;throw new LoadoutEditError(`ShipLoadout.removeModule: the ${truncate(key2)} slot is required and cannot be emptied`,"requiredSlot",{slot:key2})}const key=this.#fittedKey(slotKey);if(key!==null){const limitProblem=this.#moduleLimitRegression(key,null);if(limitProblem!==null){const fitted=this.#modules.get(key);throw new LoadoutEditError(`ShipLoadout.removeModule: ${truncate(slotKey)}: ${limitProblem.group} would have ${limitProblem.count} modules but the ship allows ${limitProblem.limit}`,"moduleLimitExceeded",{group:limitProblem.group,count:limitProblem.count,limit:limitProblem.limit,slot:key,...fitted===void 0?{}:{symbol:fitted.Item}})}this.#replaceModule(key,null)}return this}applyBlueprint(slotKey,blueprintSymbol,options){requireString(blueprintSymbol,"ShipLoadout.applyBlueprint: blueprintSymbol");if(options===null||typeof options!=="object"){throw new TypeError(`ShipLoadout.applyBlueprint: options must be an object with a grade, received ${describeValue(options)}`)}const wantedGrade=options.grade;const wantedQuality=options.quality;const wantedExperimental=options.experimentalEffectSymbol??void 0;requireStringIfPresent(wantedExperimental,"ShipLoadout.applyBlueprint: options.experimentalEffectSymbol");const module=this.#fittedModuleFor(slotKey);if(!module){throw new RangeError(`ShipLoadout.applyBlueprint: slot "${truncate(slotKey)}" is empty`)}const fittedStats=this.#statsFor(module);if(!fittedStats){throw new TypeError(`ShipLoadout.applyBlueprint: no stats for module "${truncate(module.Item)}"`)}const recipe=resolveBlueprintForModule(module.Item,blueprintSymbol);const named=recipe===blueprintSymbol?`"${truncate(blueprintSymbol)}"`:`"${truncate(blueprintSymbol)}" (${truncate(recipe)} on this module)`;const written=blueprintSymbol.trim().toLowerCase();const resolved=recipe.trim().toLowerCase();if(getPreEngineeredVariants(module.Item).some(variant=>variant.acquisition==="eventReward"&&(variant.blueprintSymbol.toLowerCase()===written||variant.blueprintSymbol.toLowerCase()===resolved))){throw new TypeError(`ShipLoadout.applyBlueprint: ${named} is a fixed pre-engineered identity, not a craftable blueprint; use setPreEngineeredVariant to fit its fixed article`)}if(!Number.isInteger(wantedGrade)||wantedGrade<1||wantedGrade>5){throw new RangeError(`ShipLoadout.applyBlueprint: no blueprint ${named} grade ${truncate(wantedGrade)}`)}const grade=getBlueprintGrade(recipe,wantedGrade);if(!grade){throw new RangeError(`ShipLoadout.applyBlueprint: no blueprint ${named} grade ${truncate(wantedGrade)}`)}let experimental;if(wantedExperimental!==void 0){experimental=getExperimentalEffect(wantedExperimental);if(!experimental){throw new RangeError(`ShipLoadout.applyBlueprint: unknown experimental effect "${truncate(wantedExperimental)}"`)}}const quality=wantedQuality??1;if(!Number.isFinite(quality)||quality<0||quality>1){throw new RangeError(`ShipLoadout.applyBlueprint: quality must be a finite number in [0, 1]`)}if(fittedStats.engineeringLocked){throw new TypeError(`ShipLoadout.applyBlueprint: module "${truncate(module.Item)}" is a final pre-engineered article and accepts no further engineering`)}if(!blueprintAvailableFor(module.Item,blueprintSymbol)){const offered=[...blueprintRoutesFor(module.Item)].map(([blueprint,route])=>`${blueprint} (${route})`);throw new TypeError(offered.length>0?`ShipLoadout.applyBlueprint: module "${truncate(module.Item)}" is not offered blueprint ${named}; available candidates are ${offered.join(", ")}`:`ShipLoadout.applyBlueprint: no registry lists an engineering menu for module "${truncate(module.Item)}"`)}if(wantedExperimental!==void 0&&!experimentalAvailableFor(module.Item,wantedExperimental)){const offered=getExperimentalsForModule(module.Item);throw new TypeError(`ShipLoadout.applyBlueprint: module "${truncate(module.Item)}" is not offered experimental effect "${truncate(wantedExperimental)}"; it takes ${offered.length>0?offered.join(", "):"no experimental effect"}`)}const stats=this.#engineeringBaseStats(module)??fittedStats;const base=baseStats(stats);const canonical=primitiveEngineeringInputsFor(stats,grade,experimental);const missing=missingBaseLabels(stats,base,canonical.grade.features,canonical.experimental?.modifiers);if(missing.length>0){throw new TypeError(`ShipLoadout.applyBlueprint: cannot compute ${named} for module "${truncate(module.Item)}"; missing base stats for ${missing.join(", ")}`)}const damageDistribution=experimental?.damageDistribution??grade.damageDistribution;const primitiveModifiers=computeModifiers(base,canonical.grade,quality,canonical.experimental);const modifiers=journalModifiersFor(stats,primitiveModifiers);if(damageDistribution){for(const type of["kinetic","thermal","explosive","absolute"]){const value=damageDistribution[type];if(value===void 0)continue;const label=labelsForDamageType(type)[0];if(label===void 0)continue;const damageModifier={Label:label,Value:value*scaleForLabel(label),OriginalValue:(stats.damageDistribution?.[type]??0)*scaleForLabel(label)};modifiers.push(damageModifier);primitiveModifiers.push(damageModifier)}}const engineering={BlueprintName:blueprintSymbol,Level:wantedGrade,Quality:quality,...wantedExperimental!==void 0?{ExperimentalEffect:wantedExperimental}:{},Modifiers:modifiers};this.#replaceModule(module.Slot,{...module,Engineering:engineering},stats,primitiveModifiers);return this}setExperimentalEffect(slotKey,experimental){if(experimental!==null){requireString(experimental,"ShipLoadout.setExperimentalEffect: experimental")}const wanted=experimental;const module=this.#fittedModuleFor(slotKey);if(!module)return experimentalEffectUnsupported("emptySlot",{slot:slotKey});const stats=this.#statsFor(module);if(!stats){return experimentalEffectUnsupported("unsupportedEngineering",{slot:module.Slot,symbol:module.Item})}const engineering=module.Engineering;if(!engineering){return experimentalEffectUnsupported("notEngineered",{slot:module.Slot,symbol:module.Item})}if(stats.engineeringLocked){return experimentalEffectUnsupported("finalArticle",{slot:module.Slot,symbol:module.Item})}const previous=engineering.ExperimentalEffect??null;if(previous===null&&wanted===null||previous!==null&&wanted!==null&&previous.trim().toLowerCase()===wanted.trim().toLowerCase()){return deepFreeze({kind:"unchanged",experimentalEffectSymbol:previous})}const variant=preEngineeredVariantFor(module);let effect;if(wanted!==null){effect=getExperimentalEffect(wanted);if(!effect){return experimentalEffectUnsupported("unknownExperimentalEffect",{slot:module.Slot,symbol:module.Item,experimental:wanted})}const restoresBakedEffect=variant?.experimentalEffectSymbol!==void 0&&variant.acquisition!=="mercenary"&&variant.experimentalEffectSymbol.trim().toLowerCase()===wanted.trim().toLowerCase();if(!experimentalAvailableFor(module.Item,wanted)&&!restoresBakedEffect){return experimentalEffectUnsupported("unsupportedExperimentalEffect",{slot:module.Slot,symbol:module.Item,experimental:wanted})}}if(variant&&variant.acquisition!=="mercenary"){const stock=this.#engineeringBaseStats(module);if(!stock){return experimentalEffectUnsupported("unsupportedEngineering",{slot:module.Slot,symbol:module.Item})}const missing=missingBaseLabels(stock,baseStats(stock),[],effect?.modifiers);if(missing.length>0){return experimentalEffectUnsupported("unresolvedModifiers",{slot:module.Slot,symbol:module.Item,labels:missing})}const{experimentalEffectSymbol:originalEffect,...withoutEffect}=variant;const adjusted=wanted===null?withoutEffect:{...withoutEffect,experimentalEffectSymbol:wanted};const resolved=getPreEngineeredStats(withoutEffect);if(!resolved){return experimentalEffectUnsupported("unsupportedEngineering",{slot:module.Slot,symbol:module.Item})}const replacement={BlueprintName:engineering.BlueprintName,Level:engineering.Level,Quality:engineering.Quality,...wanted===null?{}:{ExperimentalEffect:wanted},Modifiers:getPreEngineeredJournalModifiers(adjusted)};this.#replaceModule(module.Slot,{...module,Engineering:replacement},cloneModuleStats(resolved),getPreEngineeredModifiers(adjusted))}else{const blueprint=engineering.BlueprintName;const grade=engineering.Level;const quality=engineering.Quality;if(typeof blueprint!=="string"||!Number.isInteger(grade)||grade<1||grade>5){return experimentalEffectUnsupported("unsupportedEngineering",{slot:module.Slot,symbol:module.Item})}const currentEffect=previous===null?void 0:getExperimentalEffect(previous)??null;if(ordinaryEngineeringProof(module.Item,engineering,currentEffect)==="unproven"){return experimentalEffectUnsupported("unidentifiedPreEngineeredVariant",{slot:module.Slot,symbol:module.Item,blueprint:blueprint})}const recipe=resolveBlueprintForModule(module.Item,blueprint);const blueprintGrade=getBlueprintGrade(recipe,grade);if(!blueprintGrade||!blueprintAvailableFor(module.Item,blueprint)||!Number.isFinite(quality)||quality<0||quality>1){return experimentalEffectUnsupported("unsupportedEngineering",{slot:module.Slot,symbol:module.Item,blueprint:blueprint,grade:grade})}const base=this.#engineeringBaseStats(module)??stats;const canonical=primitiveEngineeringInputsFor(base,blueprintGrade,effect);const missing=missingBaseLabels(base,baseStats(base),canonical.grade.features,canonical.experimental?.modifiers);if(missing.length>0){return experimentalEffectUnsupported("unresolvedModifiers",{slot:module.Slot,symbol:module.Item,labels:missing})}this.applyBlueprint(module.Slot,blueprint,{grade:grade,quality:quality,...wanted===null?{}:{experimentalEffectSymbol:wanted}})}return deepFreeze({kind:"updated",previousExperimentalEffectSymbol:previous,experimentalEffectSymbol:wanted})}completeEngineeringGrade(slotKey){const module=this.#fittedModuleFor(slotKey);if(!module)return engineeringNormalizationUnsupported("emptySlot",{slot:slotKey});const stats=this.#statsFor(module);if(!stats){return engineeringNormalizationUnsupported("unsupportedEngineering",{slot:module.Slot,symbol:module.Item})}const engineering=module.Engineering;if(!engineering){return engineeringNormalizationUnsupported("notEngineered",{slot:module.Slot,symbol:module.Item})}if(stats.engineeringLocked){return engineeringNormalizationUnsupported("finalArticle",{slot:module.Slot,symbol:module.Item})}if(engineering.Quality===1&&engineering.Modifiers!==void 0){return deepFreeze({kind:"unchanged"})}const previousQuality=engineering.Quality;if(!Number.isFinite(previousQuality)||previousQuality<0||previousQuality>1){return engineeringNormalizationUnsupported("invalidQuality",{slot:module.Slot,symbol:module.Item})}const experimental=engineering.ExperimentalEffect??null;const effect=experimental===null?void 0:getExperimentalEffect(experimental)??void 0;if(experimental!==null&&!effect){return engineeringNormalizationUnsupported("unknownExperimentalEffect",{slot:module.Slot,symbol:module.Item,experimental:experimental})}const blueprint=engineering.BlueprintName;const grade=engineering.Level;if(typeof blueprint!=="string"||!Number.isInteger(grade)||grade<1||grade>5){return engineeringNormalizationUnsupported("unsupportedEngineering",{slot:module.Slot,symbol:module.Item})}const variant=preEngineeredVariantFor(module);const restoresBakedEffect=variant?.experimentalEffectSymbol!==void 0&&variant.acquisition!=="mercenary"&&variant.experimentalEffectSymbol.trim().toLowerCase()===experimental?.trim().toLowerCase();if(experimental!==null&&!experimentalAvailableFor(module.Item,experimental)&&!restoresBakedEffect){return engineeringNormalizationUnsupported("unsupportedExperimentalEffect",{slot:module.Slot,symbol:module.Item,experimental:experimental})}if(variant&&variant.acquisition!=="mercenary"){const stock=this.#engineeringBaseStats(module);if(!stock){return engineeringNormalizationUnsupported("unsupportedEngineering",{slot:module.Slot,symbol:module.Item})}const missing=missingBaseLabels(stock,baseStats(stock),[],effect?.modifiers);if(missing.length>0){return engineeringNormalizationUnsupported("unresolvedModifiers",{slot:module.Slot,symbol:module.Item,labels:missing})}const{experimentalEffectSymbol:originalEffect,...withoutEffect}=variant;const adjusted=experimental===null?withoutEffect:{...withoutEffect,experimentalEffectSymbol:experimental};const resolved=getPreEngineeredStats(withoutEffect);if(!resolved){return engineeringNormalizationUnsupported("unsupportedEngineering",{slot:module.Slot,symbol:module.Item})}const replacement={BlueprintName:engineering.BlueprintName,Level:engineering.Level,Quality:1,...experimental===null?{}:{ExperimentalEffect:experimental},Modifiers:getPreEngineeredJournalModifiers(adjusted)};this.#replaceModule(module.Slot,{...module,Engineering:replacement},cloneModuleStats(resolved),getPreEngineeredModifiers(adjusted))}else{const proof=ordinaryEngineeringProof(module.Item,engineering,effect);if(proof==="unproven"||proof==="proven"&&!blueprintAvailableFor(module.Item,blueprint)){return engineeringNormalizationUnsupported("unidentifiedPreEngineeredVariant",{slot:module.Slot,symbol:module.Item,blueprint:blueprint})}const recipe=resolveBlueprintForModule(module.Item,blueprint);const blueprintGrade=getBlueprintGrade(recipe,grade);if(!blueprintGrade||!blueprintAvailableFor(module.Item,blueprint)){return engineeringNormalizationUnsupported("unsupportedEngineering",{slot:module.Slot,symbol:module.Item,blueprint:blueprint,grade:grade})}const base=this.#engineeringBaseStats(module)??stats;const canonical=primitiveEngineeringInputsFor(base,blueprintGrade,effect);const missing=missingBaseLabels(base,baseStats(base),canonical.grade.features,canonical.experimental?.modifiers);if(missing.length>0){return engineeringNormalizationUnsupported("unresolvedModifiers",{slot:module.Slot,symbol:module.Item,labels:missing})}this.applyBlueprint(module.Slot,blueprint,{grade:grade,quality:1,...experimental===null?{}:{experimentalEffectSymbol:experimental}})}return deepFreeze({kind:"normalized",previousQuality:previousQuality,quality:1})}setPreEngineeredVariant(slotKey,variant){if(variant===null||typeof variant!=="object"){throw new TypeError(`ShipLoadout.setPreEngineeredVariant: variant must be a pre-engineered variant, received ${describeValue(variant)}`)}requireString(variant.symbol,"ShipLoadout.setPreEngineeredVariant: variant.symbol");requireString(variant.blueprintSymbol,"ShipLoadout.setPreEngineeredVariant: variant.blueprintSymbol");requireString(variant.acquisition,"ShipLoadout.setPreEngineeredVariant: variant.acquisition");requireStringIfPresent(variant.experimentalEffectSymbol,"ShipLoadout.setPreEngineeredVariant: variant.experimentalEffectSymbol");const known=getPreEngineeredVariants(variant.symbol).find(candidate=>candidate.blueprintSymbol.toLowerCase()===variant.blueprintSymbol.toLowerCase()&&candidate.grade===variant.grade&&(candidate.experimentalEffectSymbol?.toLowerCase()??"")===(variant.experimentalEffectSymbol?.toLowerCase()??"")&&candidate.acquisition===variant.acquisition);if(!known){throw new RangeError(`ShipLoadout.setPreEngineeredVariant: no catalogued variant "${truncate(variant.blueprintSymbol)}" for module "${truncate(variant.symbol)}"`)}const stats=getPreEngineeredStats(known);const unresolved=unresolvedModifiers(known);if(unresolved.length>0){throw new TypeError(`ShipLoadout.setPreEngineeredVariant: cannot resolve "${truncate(variant.blueprintSymbol)}" for module "${truncate(variant.symbol)}"; missing base stats for ${unresolved.join(", ")}`)}this.setModule(slotKey,stats);const module=this.#fittedModuleFor(slotKey);const journalModifiers=getPreEngineeredJournalModifiers(known);const engineering={BlueprintName:known.blueprintSymbol,Level:known.grade,Quality:1,...known.experimentalEffectSymbol===void 0?{}:{ExperimentalEffect:known.experimentalEffectSymbol},...journalModifiers.length>0?{Modifiers:journalModifiers}:{}};this.#replaceModule(module.Slot,{...module,Engineering:engineering},cloneModuleStats(stats),getPreEngineeredModifiers(known));return this}clearEngineering(slotKey){const module=this.#fittedModuleFor(slotKey);if(module&&this.#statsFor(module)?.engineeringLocked){throw new TypeError(`ShipLoadout.clearEngineering: module "${truncate(module.Item)}" is a final pre-engineered article and its engineering cannot be removed`)}if(module?.Engineering){const baseStats2=this.#engineeringBaseStats(module);const bare={Slot:module.Slot,Item:module.Item};if(module.On!==void 0)bare.On=module.On;if(module.Priority!==void 0){bare.Priority=module.Priority}if(module.Health!==void 0)bare.Health=module.Health;if(module.Value!==void 0)bare.Value=module.Value;this.#replaceModule(module.Slot,bare,baseStats2??void 0)}return this}setModuleEnabled(slotKey,on){this.#patchModule(slotKey,{On:on});return this}setModulePriority(slotKey,priority){if(!Number.isInteger(priority)||priority<0||priority>4){throw new RangeError(`ShipLoadout: power priority must be an integer 0-4, got ${truncate(priority)}`)}this.#patchModule(slotKey,{Priority:priority});return this}#patchModule(slotKey,patch){const module=this.#fittedModuleFor(slotKey);if(!module){throw new RangeError(`ShipLoadout: slot "${truncate(slotKey)}" is empty`)}this.#modules.set(module.Slot,cloneLoadoutModule({...module,...patch}));this.#slotCache.clear()}toLoadoutEvent(options={}){const unladenMass=this.#computedUnladenMass();const cargoCapacity=this.#computedCargoCapacity();const fuel=this.#computedFuelCapacity();const maxJumpRange=this.#exportableJumpRange(unladenMass);return exportLoadoutEvent({shipSymbol:this.#shipSymbol,...this.#top.ShipName===void 0?{}:{shipName:this.#top.ShipName},...this.#top.ShipIdent===void 0?{}:{shipIdent:this.#top.ShipIdent},modules:this.#modules,layout:this.#layout(),sourcePurchase:this.#sourcePurchase,retailHullValue:this.#ship.hullCost,unladenMass:unladenMass,cargoCapacity:cargoCapacity,fuelCapacity:fuel,maxJumpRange:maxJumpRange,sourceTotalsVoided:this.#importOutcomes.some(outcome=>{if(outcome.sourceSymbol!==null)return false;const parsed=parseSlotName(outcome.slot);return parsed!==null&&stockedMountKind(parsed)==="core"}),statsFor:module=>this.#statsFor(module)},options)}toSlef(options){return toSlef(this.toLoadoutEvent(options),options.header)}toSlefString(options){return stringifySlef(this.toSlef(options),{indent:options.indent??0})}#exportableJumpRange(unladenMass){let drive;try{drive=this.#resolveDrive()}catch{return null}if(drive===null)return null;const tank=this.#computedFuelCapacity();return singleJumpRange(unladenMass,Math.min(tank.main,drive.maxFuel),drive)}#layout(){if(this.#layoutCache===void 0){this.#layoutCache=Object.freeze(enumerateSlots(this.#ship))}return this.#layoutCache}#requireSlot(slotKey){const wanted=normalizeKey(slotKey,SLOT_KEY);const slot=this.#layout().find(s=>normalizeKey(s.key,CATALOGUE_KEY)===wanted);if(!slot){throw new RangeError(`ShipLoadout: hull "${truncate(this.#shipSymbol)}" has no slot "${truncate(slotKey)}"`)}return slot}#fittedKey(slotKey){return matchingKeyIn(this.#modules,normalizeKey(slotKey,SLOT_KEY))}#fittedModuleFor(slotKey){const key=this.#fittedKey(slotKey);return key===null?void 0:this.#modules.get(key)}#calculationModules(){return[...this.#modules.values()].map(module=>({mass:this.#moduleMass(module),cargoCapacity:this.#moduleCapacity(module,"CargoCapacity","cargoCapacity"),cabinCapacity:this.#moduleCapacity(module,"CabinCapacity","cabinCapacity"),fuelCapacity:this.#moduleCapacity(module,"FuelCapacity","fuelCapacity")}))}#moduleLimits(){const entries=[...this.#modules.values()].flatMap(module=>{const stats=this.#statsFor(module);return stats===null?[]:[stats]});return calculateModuleLimits(entries)}#moduleStatsAt(slotKey){const fitted=this.#fittedModuleFor(slotKey);return fitted===void 0?null:this.#statsFor(fitted)}#engineeringBaseStats(module){const fitted=this.#statsFor(module);if(!module.Engineering||preEngineeredVariantFor(module)===null)return fitted;const stock=builtInModuleBySymbol(module.Item,FITTED_ITEM);if(!stock)return fitted;return fitted?.engineeringLocked?cloneModuleStats({...stock,engineeringLocked:true}):stock}#moduleForEffectiveStats(module){const modifiers=this.#primitiveModifiers.get(module.Slot);if(modifiers===void 0||module.Engineering===void 0)return module;return{...module,Engineering:{...module.Engineering,Modifiers:modifiers}}}#modulesForEffectiveStats(){return[...this.#modules.values()].map(module=>this.#moduleForEffectiveStats(module))}#moduleLimitRegression(slotKey,replacement,current=this.#moduleLimits(),previous=this.#moduleStatsAt(slotKey)){if(previous?.limitGroup===void 0&&previous?.limitIncrease===void 0&&replacement?.limitGroup===void 0&&replacement?.limitIncrease===void 0){return null}for(const usage of current){const count=usage.count-Number(previous?.limitGroup===usage.group)+Number(replacement?.limitGroup===usage.group);const increase=usage.increase-(previous?.limitIncrease?.group===usage.group?previous.limitIncrease.amount:0)+(replacement?.limitIncrease?.group===usage.group?replacement.limitIncrease.amount:0);const limit=usage.baseLimit+increase;const excess=Math.max(0,count-limit);if(excess>usage.excess){return{...usage,increase:increase,limit:limit,count:count,excess:excess}}}return null}#replaceModule(slotKey,replacement,replacementStats,primitiveModifiers){const previous=this.#modules.get(slotKey)??null;this.#adjustImportedFigures(previous,replacement,replacementStats);if(replacement===null){this.#modules.delete(slotKey);this.#moduleStats.delete(slotKey);this.#primitiveModifiers.delete(slotKey)}else{this.#modules.set(slotKey,cloneLoadoutModule(replacement));if(replacementStats!==void 0)this.#moduleStats.set(slotKey,replacementStats);if(primitiveModifiers===void 0)this.#primitiveModifiers.delete(slotKey);else this.#primitiveModifiers.set(slotKey,primitiveModifiers)}this.#slotCache.clear()}#adjustImportedFigures(previous,next,nextStats){if(this.#top.UnladenMass!==void 0){this.#top.UnladenMass+=this.#moduleMass(next,nextStats)-this.#moduleMass(previous)}if(this.#top.CargoCapacity!==void 0){this.#top.CargoCapacity+=this.#moduleCapacity(next,"CargoCapacity","cargoCapacity",nextStats)-this.#moduleCapacity(previous,"CargoCapacity","cargoCapacity")}if(this.#top.FuelCapacity?.Main!==void 0){const reserve=this.#top.FuelCapacity.Reserve;this.#top.FuelCapacity={Main:this.#top.FuelCapacity.Main+this.#moduleCapacity(next,"FuelCapacity","fuelCapacity",nextStats)-this.#moduleCapacity(previous,"FuelCapacity","fuelCapacity"),...reserve===void 0?{}:{Reserve:reserve}}}if(normalizeKey(previous?.Item,FITTED_ITEM)===normalizeKey(next?.Item,FITTED_ITEM)){return}if(previous!==null&&isCargoHatchSlot(previous.Slot)||next!==null&&isCargoHatchSlot(next.Slot)){return}delete this.#top.ModulesValue;delete this.#top.Rebuy}#moduleMass(module,statsOverride){if(module===null)return 0;if(isCargoHatchSlot(module.Slot))return 0;const modified=getLoadoutModifier(module,"Mass");if(modified!==null)return modified;return(statsOverride??this.#statsFor(module))?.mass??0}#moduleCapacity(module,modifierLabel,field,statsOverride){if(module===null)return 0;if(isCargoHatchSlot(module.Slot))return 0;const modified=getLoadoutModifier(module,modifierLabel);if(modified!==null)return modified;return(statsOverride??this.#statsFor(module))?.[field]??0}#frameShiftDrive(){for(const m of this.#modules.values()){const stats=this.#statsFor(m);if(stats?.slot==="frameShiftDrive")return{module:m,stats:stats}}return void 0}#resolveDrive(){const fsd=this.#frameShiftDrive();if(!fsd)return null;const{module:fsdModule,stats:base}=fsd;if(base.fuelMul===void 0||base.fuelPower===void 0){throw new TypeError(`ShipLoadout: the fitted record for frame shift drive "${truncate(fsdModule.Item)}" has no jump constants`)}const optMass=getLoadoutModifier(fsdModule,"FSDOptimalMass")??base.optMass;const maxFuel=getLoadoutModifier(fsdModule,"MaxFuelPerJump")??base.maxFuel;if(optMass===void 0||maxFuel===void 0){const missing=[...optMass===void 0?["optMass"]:[],...maxFuel===void 0?["maxFuel"]:[]];throw new TypeError(`ShipLoadout: the fitted record for frame shift drive "${truncate(fsdModule.Item)}" has no ${missing.join(" or ")}`)}return{optMass:optMass,maxFuel:maxFuel,fuelMul:base.fuelMul,fuelPower:base.fuelPower,jumpBoost:this.#resolveJumpBoost()}}#resolveJumpBoost(){for(const m of this.#modules.values()){const stats=this.#statsFor(m);if(stats?.engineeringGroup!=="fsdBoosters"&&(stats?.jumpBoost===void 0||stats.jumpBoost===0)){continue}if(m.On===false)continue;if(stats?.jumpBoost===void 0){throw new TypeError(`ShipLoadout: the fitted record for FSD booster "${truncate(m.Item)}" has no jumpBoost`)}return stats.jumpBoost}return 0}#statsFor(module){if(module===null)return null;const stats=this.#moduleStats.get(module.Slot)??builtInModuleBySymbol(module.Item,FITTED_ITEM);if(stats)return stats;return isBuiltInHullModule(module)?builtInModuleBySymbol(BUILT_IN_HULL_SYMBOL,"ShipLoadout: built-in module"):null}};export{LoadoutEditError,ShipLoadout};//# sourceMappingURL=chunk-53EBUFVU.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/ships/internal/loadout-export.ts","../src/ships/ship-loadout.ts"],"names":["validateLoadout","calculateModuleLimits","publishLoadoutInternals","normalizeLoadoutEvent","preEngineeredVariantFor","moduleFitProblem","effectiveModule","moduleFitError","getShipBySymbol","parseSlef","toSlef","stringifySlef","getLoadoutModifier","getSourceModuleValue","statesInertModifiers","rolledOverFixedArticle","isNonOutfittingSlot","isBuiltInHullModule","cloneLoadoutModule","cloneModuleStats","availableBlueprintsFor","availableExperimentalsFor","ownKeyIn","BUILT_IN_HULL_SYMBOL","FITTED_ITEM","blueprintAvailableFor","blueprintRoutesFor","experimentalAvailableFor","primitiveEngineeringInputsFor","missingBaseLabels","journalModifiersFor","getPreEngineeredStats","getPreEngineeredJournalModifiers","getPreEngineeredModifiers","ordinaryEngineeringProof","unresolvedModifiers","matchingKeyIn","isCargoHatchSlot","orderBySlotLayout","getPreEngineeredVariants","builtInModuleBySymbol","ALL_MODULES","singleJumpRange","calculateUnladenMass","calculatePassengerCapacity","calculateCargoCapacity","calculateFuelCapacity","fixedSlotReason","stockedMountKind","getDefaultLoadout","getExperimentalEffect","ammunitionCapacity","baseStats","computeModifiers","labelsForDamageType","scaleForLabel","resolveBlueprintForModule","getExperimentalsForModule","getBlueprintGrade","loadoutSlotName","parseSlotName","enumerateSlots","normalizeKey","CATALOGUE_KEY","truncate","describeValue","requireString","requireStringIfPresent","deepFreeze","REBUY_FRACTION","exportLoadoutEvent","input","options","fromSource","credits","source","sourcePurchase","totals","sourceTotalsVoided","sourceTotalsHold","modules","hullValue","retailHullValue","modulesValue","computedModulesValue","statsFor","rebuy","Math","trunc","Ship","shipSymbol","toLowerCase","shipName","ShipName","shipIdent","ShipIdent","HullValue","ModulesValue","UnladenMass","unladenMass","CargoCapacity","cargoCapacity","maxJumpRange","MaxJumpRange","FuelCapacity","Main","fuelCapacity","main","Reserve","reserve","Rebuy","Modules","exportModules","ordered","moduleOrder","slotOrderedModules","layout","values","map","module","on","On","explicitPower","priority","Priority","value","sourceModuleValue","moduleValue","Slot","Item","Health","Value","Engineering","sum","stats","cost","SOURCE_ITEM","entry","item","moduleValues","key","slot","fitted","get","SLOT_KEY","FITTED_SLOT","LoadoutEditError","TypeError","code","constraint","params","constructor","message","super","this","structuredClone","experimentalEffectUnsupported","kind","engineeringNormalizationUnsupported","weighable","tonnes","Number","isFinite","AGGREGATE_STATS","ShipLoadout","_ShipLoadout","ship","moduleStats","primitiveModifiers","top","importOutcomes","slotCache","Map","layoutCache","effectiveModules","modulesForEffectiveStats","moduleForEffectiveStats","resolveDrive","frameShiftDriveModule","frameShiftDrive","calculationModules","statedMainFuel","fromSlef","index","entries","length","imported","data","fromImported","fromLoadout","event","outcomes","loadout","unresolved","rollStatedRecipe","push","engineering","BlueprintName","stated","Modifiers","has","variant","acquisition","Level","grade","applyBlueprint","quality","Quality","ExperimentalEffect","experimentalEffectSymbol","action","sourceSymbol","blueprintSymbol","passedOver","preEngineeredVariant","error","RangeError","empty","requested","symbol","filter","parsed","computedUnladenMass","hullMass","cap","Object","freeze","computed","computedFuelCapacity","computedCargoCapacity","passengerCapacity","reserveFuelCapacity","validation","slots","byKey","builtIn","fitProblem","thrusterMaxMass","maxMass","requiresKnownSlot","fitError","fitConstraint","fitParams","exclusionGroup","limitGroup","limitIncrease","dry","fuel","cargo","mass","cached","currentLimits","moduleLimits","moduleStatsAt","fixedReason","immovableReason","moduleLimitRegression","name","fittedModuleAt","removable","set","slotKey","fittedModuleFor","raw","effective","health","effectiveStats","ammunition","fittedModules","keys","flatMap","availableBlueprints","availableExperimentalEffects","modulesForSlot","requireSlot","occupied","Set","group","currentStats","grantOnly","repairFixedMount","wanted","fittedKey","resultSlot","canonicalKey","status","reason","current","valid","defaultModule","find","ownKey","replacement","replacementStats","replaceModule","setModule","catalogued","field","problem","conflict","previousSlot","previousSymbol","limitProblem","count","limit","removeModule","candidate","wantedGrade","wantedQuality","wantedExperimental","fittedStats","recipe","named","written","trim","resolved","some","isInteger","experimental","engineeringLocked","offered","blueprint","route","join","engineeringBaseStats","base","canonical","missing","features","modifiers","damageDistribution","type","label","damageModifier","Label","OriginalValue","setExperimentalEffect","previous","effect","restoresBakedEffect","stock","labels","originalEffect","withoutEffect","adjusted","currentEffect","blueprintGrade","previousExperimentalEffectSymbol","completeEngineeringGrade","previousQuality","proof","setPreEngineeredVariant","known","journalModifiers","clearEngineering","bare","setModuleEnabled","patchModule","setModulePriority","patch","clear","toLoadoutEvent","exportableJumpRange","hullCost","outcome","header","toSlefString","indent","drive","tank","min","maxFuel","s","moduleMass","moduleCapacity","cabinCapacity","usage","increase","amount","baseLimit","excess","max","adjustImportedFigures","delete","next","nextStats","statsOverride","modified","modifierLabel","m","fsd","fsdModule","fuelMul","fuelPower","optMass","jumpBoost","resolveJumpBoost","engineeringGroup"],"mappings":"O,mkEAmDA,IAAMqE,eAAiB,IAGhB,SAASC,mBACZC,MACAC,SAEA,MAAMC,WAAaD,QAAQE,UAAY,SACvC,MAAMC,OAASF,WAAaF,MAAMK,eAAiB,KACnD,MAAMC,OACFF,SAAW,OAASJ,MAAMO,oBAAsBC,iBAAiBR,MAAMS,QAASL,QAC1EA,OACA,KACV,MAAMM,UAAYR,WAAcE,QAAQM,WAAa,KAAQV,MAAMW,gBACnE,MAAMC,aAAeV,WACdI,QAAQM,cAAgB,KACzBC,qBAAqBb,MAAMS,QAAST,MAAMc,UAChD,MAAMC,MAAQb,WACPI,QAAQS,OAAS,KAClBL,YAAc,MAAQE,eAAiB,KACrC,KACAI,KAAKC,OAAOP,UAAYE,cAAgBd,gBAEhD,MAAO,CACHoB,KAAMlB,MAAMmB,WAAWC,iBACnBpB,MAAMqB,gBAAa,EAAY,CAAA,EAAK,CAAEC,SAAUtB,MAAMqB,aACtDrB,MAAMuB,iBAAc,EAAY,CAAA,EAAK,CAAEC,UAAWxB,MAAMuB,cACxDb,YAAc,KAAO,CAAA,EAAK,CAAEe,UAAWf,cACvCE,eAAiB,KAAO,CAAA,EAAK,CAAEc,aAAcd,cACjDe,YAAa3B,MAAM4B,YACnBC,cAAe7B,MAAM8B,iBACjB9B,MAAM+B,eAAiB,KAAO,CAAA,EAAK,CAAEC,aAAchC,MAAM+B,cAC7DE,aAAc,CAAEC,KAAMlC,MAAMmC,aAAaC,KAAMC,QAASrC,MAAMmC,aAAaG,YACvEvB,QAAU,KAAO,CAAA,EAAK,CAAEwB,MAAOxB,OACnCyB,Q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