@elite-dangerous-almanac/core 0.1.0-beta.5 → 0.1.0-beta.7
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.
- package/PROVENANCE/ships/SOURCES.md +45 -23
- package/README.md +12 -1
- package/dist/chunk-2YPWFAWM.js +1 -0
- package/dist/chunk-2YPWFAWM.js.map +1 -0
- package/dist/chunk-43LFDZ4T.js +1 -0
- package/dist/chunk-43LFDZ4T.js.map +1 -0
- package/dist/chunk-4TXQWLIQ.js +1 -0
- package/dist/chunk-4TXQWLIQ.js.map +1 -0
- package/dist/chunk-BSOIPL4A.js +1 -0
- package/dist/{chunk-IHHS5Q5S.js.map → chunk-BSOIPL4A.js.map} +1 -1
- package/dist/chunk-IAWTRADE.js +1 -0
- package/dist/chunk-IAWTRADE.js.map +1 -0
- package/dist/{chunk-6LUEKHO5.js → chunk-OHGOVZ7U.js} +1 -1
- package/dist/{chunk-6LUEKHO5.js.map → chunk-OHGOVZ7U.js.map} +1 -1
- package/dist/{chunk-ECBYOHPF.js → chunk-PRQELBIC.js} +1 -1
- package/dist/chunk-SQJMIEAQ.js +1 -0
- package/dist/chunk-SQJMIEAQ.js.map +1 -0
- package/dist/{chunk-VZZ2XIRE.js → chunk-SVZARHWP.js} +1 -1
- package/dist/chunk-SVZARHWP.js.map +1 -0
- package/dist/chunk-TH4S5MVD.js +1 -0
- package/dist/{chunk-BNILZXJD.js.map → chunk-TH4S5MVD.js.map} +1 -1
- package/dist/chunk-W7XI3WVA.js +1 -0
- package/dist/{chunk-XSFGRMJC.js.map → chunk-W7XI3WVA.js.map} +1 -1
- package/dist/chunk-WCIK2WB7.js +1 -0
- package/dist/chunk-WCIK2WB7.js.map +1 -0
- package/dist/{chunk-GJCB2Z72.js → chunk-XYK6DYVQ.js} +1 -1
- package/dist/{chunk-GJCB2Z72.js.map → chunk-XYK6DYVQ.js.map} +1 -1
- package/dist/{chunk-L2ZZXEZM.js → chunk-ZJB5UYNE.js} +1 -1
- package/dist/{ship-loadout-D27yT2y2.d.ts → ship-loadout-DBTsp5g-.d.ts} +79 -12
- package/dist/ships/blueprint-costs.js +1 -1
- package/dist/ships/blueprint-journal.js +1 -1
- package/dist/ships/decorative-modification-stats.d.ts +112 -0
- package/dist/ships/decorative-modification-stats.js +1 -0
- package/dist/ships/decorative-modification-stats.js.map +1 -0
- package/dist/ships/decorative-modifications.d.ts +7 -4
- package/dist/ships/decorative-modifications.js +1 -1
- package/dist/ships/engineering-options.d.ts +44 -41
- package/dist/ships/engineering-options.js +1 -1
- package/dist/ships/engineering.d.ts +15 -12
- package/dist/ships/engineering.js +1 -1
- package/dist/ships/index.d.ts +8 -4
- package/dist/ships/index.js +1 -1
- package/dist/ships/modules-all.js +1 -1
- package/dist/ships/modules-hardpoint.js +1 -1
- package/dist/ships/modules.d.ts +2 -2
- package/dist/ships/modules.js +1 -1
- package/dist/ships/pre-engineered-stats.d.ts +5 -3
- package/dist/ships/pre-engineered-stats.js +1 -1
- package/dist/ships/pre-engineered.d.ts +6 -4
- package/dist/ships/pre-engineered.js +1 -1
- package/dist/ships/ship-loadout.d.ts +1 -1
- package/dist/ships/ship-loadout.js +1 -1
- package/dist/ships/slef.d.ts +57 -18
- package/dist/ships/slef.js +1 -1
- package/package.json +5 -1
- package/dist/chunk-7MKYFCFF.js +0 -1
- package/dist/chunk-7MKYFCFF.js.map +0 -1
- package/dist/chunk-AUHDXSQL.js +0 -1
- package/dist/chunk-AUHDXSQL.js.map +0 -1
- package/dist/chunk-BNILZXJD.js +0 -1
- package/dist/chunk-IHHS5Q5S.js +0 -1
- package/dist/chunk-JBR4PTCM.js +0 -1
- package/dist/chunk-JBR4PTCM.js.map +0 -1
- package/dist/chunk-VZZ2XIRE.js.map +0 -1
- package/dist/chunk-XSFGRMJC.js +0 -1
- /package/dist/{chunk-ECBYOHPF.js.map → chunk-PRQELBIC.js.map} +0 -0
- /package/dist/{chunk-L2ZZXEZM.js.map → chunk-ZJB5UYNE.js.map} +0 -0
|
@@ -379,10 +379,12 @@ FDevIDs, stats from coriolis-data and EDSY, joined on `symbol`.
|
|
|
379
379
|
II's `Int_MkIIAgileBoost_Engine_*` thrusters.
|
|
380
380
|
- **A fuel tank is the one module built for two kinds of mount:** it is `fuelTank`
|
|
381
381
|
and also fits any optional slot large enough, exactly as the game sells it.
|
|
382
|
-
- **`kind` is the engineering family.** The
|
|
382
|
+
- **`kind` is the ordinary engineering-menu family.** The 1026 records mapped by
|
|
383
383
|
`engineering-options.jsonc` repeat that map's group key in the compact on-disk `kind`
|
|
384
|
-
field.
|
|
385
|
-
no engineering family for them
|
|
384
|
+
field. Of the remaining 173 records, 171 carry no `kind` because the pinned sources
|
|
385
|
+
publish no engineering family for them; the fixed Mining Laser and Abrasion Blaster
|
|
386
|
+
omit the family as the in-game correction documented under Engineering options below.
|
|
387
|
+
The group source, derivation, split
|
|
386
388
|
Guardian families and coverage are documented under Engineering options below; this
|
|
387
389
|
field is a projection of that map, not a separate classification source.
|
|
388
390
|
- **Stats source:** coriolis-data `modules/**` for the mechanical, defence, power and
|
|
@@ -1344,7 +1346,7 @@ up straight through with no disambiguation at all. Both paths are evidence that
|
|
|
1344
1346
|
- **Availability is a property of the module, not of the blueprint.** A Pulse Laser and a
|
|
1345
1347
|
Rail Gun both take the Efficient blueprint but offer different experimental effects, so
|
|
1346
1348
|
"which experimentals go with blueprint X" has no single answer. Modules are therefore
|
|
1347
|
-
grouped (
|
|
1349
|
+
grouped (52 groups covering 1026 ordinary engineering menus) and each group lists the
|
|
1348
1350
|
`blueprints` and `experimentals` it offers.
|
|
1349
1351
|
- **Source:** EDSY `eddb.js`, whose module-group tables carry each group's `blueprints`
|
|
1350
1352
|
and `expeffects` lists and which modules belong to each group, and whose module records
|
|
@@ -1352,8 +1354,10 @@ up straight through with no disambiguation at all. Both paths are evidence that
|
|
|
1352
1354
|
denials that narrow either list. Second registry: coriolis-data
|
|
1353
1355
|
`modifications/modules.json`, which carries the same per-group lists keyed by the
|
|
1354
1356
|
journal `BlueprintName`s this catalogue joins on.
|
|
1355
|
-
- **Coverage: every group EDSY's `mtype` table gives a `blueprints:` key.**
|
|
1356
|
-
|
|
1357
|
+
- **Coverage: every retained group EDSY's `mtype` table gives a `blueprints:` key.** After
|
|
1358
|
+
the Mining Laser and Abrasion Blaster corrections below, that is 52 groups over 1026
|
|
1359
|
+
modules, including
|
|
1360
|
+
bulkheads (the 241 ship armour records), life
|
|
1357
1361
|
support, sensors, the Detailed Surface Scanner, cargo racks, refineries, AFMUs, fuel
|
|
1358
1362
|
scoops, FSD interdictors and boosters, Guardian module and shield reinforcement, the
|
|
1359
1363
|
four engineerable limpet controllers, chaff, heat sink and caustic sink launchers,
|
|
@@ -1380,18 +1384,25 @@ up straight through with no disambiguation at all. Both paths are evidence that
|
|
|
1380
1384
|
- **14 modules are absent because upstream denies them every blueprint:** eight AX
|
|
1381
1385
|
multi-cannons (all but the two gimballed), five of the seven mining tools, and the
|
|
1382
1386
|
Mk II Plasma Shock Accelerator — which is why `antiXenoMultiCannons` holds 2 of that
|
|
1383
|
-
family's 10 modules
|
|
1387
|
+
family's 10 modules and `plasmaAccelerators` 4 of its 5. The other two mining tools
|
|
1388
|
+
are the manually corrected Mining Laser and Abrasion Blaster below, so all seven lack
|
|
1389
|
+
an ordinary menu and the empty `miningToolsLasers` group is not retained.
|
|
1384
1390
|
The ten plain Module Reinforcement Packages are denied their family's only recipe
|
|
1385
1391
|
and are absent too, which leaves `moduleReinforcements` holding the ten Guardian
|
|
1386
1392
|
packages.
|
|
1387
|
-
- **The
|
|
1393
|
+
- **The 173 modules absent have no ordinary engineering menu.** For 171 this comes from
|
|
1394
|
+
the pinned registries. Whole families first, both registries
|
|
1388
1395
|
agreeing: fuel tanks, passenger cabins, the repair/recon/research/decontamination and
|
|
1389
1396
|
multi-limpet controllers, meta-alloy and ordinary module reinforcement, the Pulse Wave
|
|
1390
1397
|
Analyser, the mining launchers, Shock Cannons, Nanite Torpedo Pylons, fighter and
|
|
1391
1398
|
vehicle hangars, the docking computers and Supercruise Assist, the module stabilisers,
|
|
1392
1399
|
the planetary approach suites, the cargo hatch and
|
|
1393
1400
|
the AX utility modules (Xeno Scanners, Shutdown Field Neutralisers), followed by the
|
|
1394
|
-
individually denied modules described above.
|
|
1401
|
+
individually denied modules described above. The other two are the fixed Mining Laser
|
|
1402
|
+
and Abrasion Blaster, corrected from the registry-derived result below. They and the
|
|
1403
|
+
size-5 class-2 Module Reinforcement Package within the registry-derived 171 have no
|
|
1404
|
+
stock menu, but their purchased Mercenary articles remain upgradeable through their
|
|
1405
|
+
bespoke recipes.
|
|
1395
1406
|
- **EDSY's `_X_` prefix means "not applicable" and is honoured**, not stripped: the
|
|
1396
1407
|
Detailed Surface Scanner's group lists only `iss_er` (`Sensor_Expanded`), because its
|
|
1397
1408
|
three other entries are `_X_`-marked. The `Decorative_*` entries on the remote-release
|
|
@@ -1417,14 +1428,14 @@ up straight through with no disambiguation at all. Both paths are evidence that
|
|
|
1417
1428
|
the nine further groups it carries a list for —
|
|
1418
1429
|
20 in all, every one an exact match. Chaff, heat sink, point defence and ECMs keep the
|
|
1419
1430
|
generic `Misc_*` ids: there coriolis agrees with EDSY.
|
|
1420
|
-
- **
|
|
1431
|
+
- **12 retained groups rest on EDSY alone**, because coriolis carries no blueprint list for
|
|
1421
1432
|
them at all: the nine Guardian-only groups (`guardianPowerPlants`,
|
|
1422
1433
|
`guardianPowerDistributors`, `guardianHullReinforcements`, `moduleReinforcements`,
|
|
1423
1434
|
`shieldReinforcements`, `fsdBoosters`, `guardianGauss`, `guardianPlasma`,
|
|
1424
|
-
`guardianShard`), `antiXenoMissileRacks`, `experimentalWeapons
|
|
1425
|
-
`
|
|
1435
|
+
`guardianShard`), `antiXenoMissileRacks`, `experimentalWeapons` and
|
|
1436
|
+
`antiXenoMultiCannons`. That is coriolis being
|
|
1426
1437
|
silent rather than contradicting — its Guardian and anti-xeno groups are empty
|
|
1427
|
-
objects — but it means the second registry corroborates 40 of the
|
|
1438
|
+
objects — but it means the second registry corroborates 40 of the 52 groups, not
|
|
1428
1439
|
all of them. The Guardian-weapon menus are independently settled by the in-game
|
|
1429
1440
|
observations below: stock weapons take Anti-Guardian Zone Resistance alone, while
|
|
1430
1441
|
the pre-engineered articles are final.
|
|
@@ -1454,19 +1465,30 @@ up straight through with no disambiguation at all. Both paths are evidence that
|
|
|
1454
1465
|
- **File order is derivable:** `modules` is written group by group in the order `groups`
|
|
1455
1466
|
declares them, and within a group in module-catalogue order, so a re-derivation from the
|
|
1456
1467
|
same sources reproduces the file rather than reshuffling it.
|
|
1457
|
-
- **`exclusions` are the exceptions, and they are real.**
|
|
1468
|
+
- **`exclusions` are the exceptions, and they are real.** 23 modules take their group's
|
|
1458
1469
|
blueprints but not all of its experimental effects: 13 Multi-cannons cannot take Phasing
|
|
1459
1470
|
Sequence, six dumbfire racks cannot take Drag Munitions, four missile racks are short of
|
|
1460
|
-
Penetrator Munitions or FSD Interrupt
|
|
1461
|
-
|
|
1462
|
-
the wildcard is expanded to the explicit list. A module absent from `exclusions` takes
|
|
1463
|
-
its whole group's list. Five mining tools
|
|
1471
|
+
Penetrator Munitions or FSD Interrupt. Upstream these are an exclusion map. A module
|
|
1472
|
+
absent from `exclusions` takes its whole group's list. All seven mining tools
|
|
1464
1473
|
that would otherwise be listed here are absent from the catalogue entirely, taking no
|
|
1465
|
-
blueprint either.
|
|
1466
|
-
- **
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1474
|
+
ordinary blueprint either.
|
|
1475
|
+
- **The fixed Mining Laser and Abrasion Blaster have no ordinary engineering menu.** Both
|
|
1476
|
+
are removed from `modules`, despite EDSY assigning them to `miningToolsLasers` with
|
|
1477
|
+
`Weapon_LongRange`; the Abrasion Blaster is also removed from `exclusions`, where EDSY
|
|
1478
|
+
denies the group's experimental effect. Direct in-game menu confirmation recorded
|
|
1479
|
+
2026-08-15 UTC establishes that neither stock article can receive ordinary engineering;
|
|
1480
|
+
there is no immutable revision for an in-game observation. Their `Weapon_LongRange`
|
|
1481
|
+
grade-5 states are separately catalogued reward articles with hand-set modifiers that
|
|
1482
|
+
identify rather than reproduce them. This does not remove the Mercenary routes: both
|
|
1483
|
+
are acquired at grade 1 with bespoke recipes (`MiningLaser_LongRange` and
|
|
1484
|
+
`AbrasionBlaster_FarReaching`), whose sourced grades 2–5 remain applicable through the
|
|
1485
|
+
`pre-engineered.jsonc` purchase records. A re-derivation from EDSY must reapply this
|
|
1486
|
+
correction by dropping both module mappings, the now-empty `miningToolsLasers` group,
|
|
1487
|
+
both projected `kind` fields in `modules-hardpoint.jsonc`, and the Abrasion Blaster's
|
|
1488
|
+
now-unreachable experimental exclusion.
|
|
1489
|
+
- **An empty experimental menu is still distinct from no menu.** 30 of the 52 groups offer
|
|
1490
|
+
no experimental at all, so 387 of the 1026 grouped modules have an empty experimental
|
|
1491
|
+
list while retaining blueprints.
|
|
1470
1492
|
- **Key form:** the Anti-Guardian blueprint is listed under `GuardianModule_Sturdy`, the id
|
|
1471
1493
|
a Loadout writes and the one EDSY uses — the same and only spelling `blueprints.jsonc`
|
|
1472
1494
|
keys it under.
|
package/README.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
Tree-shakeable Elite Dangerous static data and calculations for TypeScript and
|
|
4
4
|
JavaScript applications.
|
|
5
5
|
|
|
6
|
+
## Project status
|
|
7
|
+
|
|
8
|
+
**This library is a work in progress.** Until version 1.0, backwards compatibility is
|
|
9
|
+
not ensured and breaking changes are very likely: exported names, signatures, subpath
|
|
10
|
+
exports and data shapes can change in any release. Pin an exact version if your
|
|
11
|
+
application needs a stable surface, and read the release notes before upgrading.
|
|
12
|
+
|
|
6
13
|
## Install
|
|
7
14
|
|
|
8
15
|
```bash
|
|
@@ -141,7 +148,11 @@ normally writes that id in its `Engineering` block, but a few blueprint aliases
|
|
|
141
148
|
collide across module families; `resolveBlueprintForModule` resolves those journal
|
|
142
149
|
spellings. Functions that ask what engineering a module accepts therefore take the
|
|
143
150
|
module's `symbol`; functions that look up a recipe, effect or modification take its
|
|
144
|
-
`fdname`.
|
|
151
|
+
`fdname`. `getDecorativeModifiers` takes both identities to reconstruct the
|
|
152
|
+
journal-style stat block of a fitted decorative transformation;
|
|
153
|
+
`unresolvedDecorativeModifiers` reports any authored labels the module catalogue could
|
|
154
|
+
not compute. `ShipLoadout.applyDecorativeModification` installs that fixed block on one
|
|
155
|
+
fitted slot and exports it without fabricating an engineering grade or quality roll.
|
|
145
156
|
|
|
146
157
|
Personal-equipment modifications are keyed by their recipe symbol, just as ship
|
|
147
158
|
blueprints and experimental effects are keyed by `fdname`; there is no second synthetic
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{fixedModifierFeatures}from"./chunk-4TXQWLIQ.js";import{builtInModuleBySymbol}from"./chunk-PRQELBIC.js";import{getPreEngineeredVariants}from"./chunk-XYK6DYVQ.js";import{EXPERIMENTAL_EFFECTS}from"./chunk-PMJG7PHU.js";import{fieldForLabel,preciseModifierValue,computeModifiers,baseStats}from"./chunk-SVZARHWP.js";import{resolveBlueprintForModule}from"./chunk-ZJB5UYNE.js";import{getBlueprintsForModule,getExperimentalsForModule,getEngineeringGroup}from"./chunk-TH4S5MVD.js";import{getBlueprint,BLUEPRINTS}from"./chunk-Q5MR36RW.js";import{normalizeKey}from"./chunk-S4DBNX2B.js";import{deepFreeze}from"./chunk-DURKO7JU.js";var FITTED_ITEM="ShipLoadout: fitted module Item";function isNonOutfittingSlot(slotKey){return/^(paintjob|shipname\d+|shipid\d+|bobble\d+|decal\d+|shipkit.+|weaponcolour|enginecolour|vesselvoice|shipcockpit|stringlights)$/i.test(slotKey)}function isBuiltInHullModule(module){return module.Slot.toLowerCase()==="cargohatch"&&module.Item.toLowerCase().startsWith("modularcargobaydoor")}function cloneLoadoutModule(module){return{Slot:module.Slot,Item:module.Item,...module.On===void 0?{}:{On:module.On},...module.Priority===void 0?{}:{Priority:module.Priority},...module.Health===void 0?{}:{Health:module.Health},...module.Value===void 0?{}:{Value:module.Value},...module.Engineering===void 0?{}:{Engineering:{BlueprintName:module.Engineering.BlueprintName,...module.Engineering.Level===void 0?{}:{Level:module.Engineering.Level},...module.Engineering.Quality===void 0?{}:{Quality:module.Engineering.Quality},...module.Engineering.ExperimentalEffect===void 0?{}:{ExperimentalEffect:module.Engineering.ExperimentalEffect},...module.Engineering.ExperimentalEffect_Localised===void 0?{}:{ExperimentalEffect_Localised:module.Engineering.ExperimentalEffect_Localised},...module.Engineering.Modifiers===void 0?{}:{Modifiers:module.Engineering.Modifiers.map(modifier=>({...modifier}))}}}}}function matchingKeyIn(keyed,slotKey){if(keyed.has(slotKey))return slotKey;const wanted=slotKey.toLowerCase();for(const key of keyed.keys()){if(key.toLowerCase()===wanted)return key}return null}function cloneModuleStats(module){return deepFreeze({...module,...module.restrictedToShips===void 0?{}:{restrictedToShips:[...module.restrictedToShips]},...module.limitIncrease===void 0?{}:{limitIncrease:{...module.limitIncrease}},...module.damageDistribution===void 0?{}:{damageDistribution:{...module.damageDistribution}},...module.damageComponents===void 0?{}:{damageComponents:{...module.damageComponents,...module.damageComponents.unclassified===void 0?{}:{unclassified:[...module.damageComponents.unclassified]}}},...module.projectileRange===void 0?{}:{projectileRange:{...module.projectileRange}}})}var GUARDIAN_WEAPON_GROUPS=/* @__PURE__ */new Set(["guardianGauss","guardianPlasma","guardianShard"]);function missingBaseLabels(stats,base,features,experimental){const contributions=[...features,...experimental??[]];return[...new Set(contributions.map(contribution=>contribution.label).filter(label=>{if(base[label]!==void 0)return false;return fieldForLabel(label,stats)===null}))]}function recipeSignature(fdname){const blueprint=getBlueprint(fdname);if(!blueprint)return null;const grades=Object.entries(blueprint.grades).map(([grade,{features:features}])=>`${grade}:${features.map(feature=>`${feature.label}/${feature.method??""}`).sort().join(",")}`).sort().join(";");return`${blueprint.name.toLowerCase()}|${grades}`}var isGenericSpelling=fdname=>fdname.toLowerCase().startsWith("misc_");function isSoldWithBlueprint(item,wanted){return getPreEngineeredVariants(item).some(variant=>variant.acquisition==="mercenary"&&variant.blueprint.toLowerCase()===wanted)}function blueprintRoutesFor(item){const routes=/* @__PURE__ */new Map;for(const fdname of getBlueprintsForModule(item))routes.set(fdname,"ordinary");for(const variant of getPreEngineeredVariants(item)){if(variant.acquisition==="mercenary"&&!routes.has(variant.blueprint)){routes.set(variant.blueprint,"mercenary")}}return routes}function blueprintAvailableFor(item,fdname){const offered=getBlueprintsForModule(item);const asWritten=normalizeKey(fdname,"ShipLoadout.applyBlueprint: fdname");const resolved=resolveBlueprintForModule(item,fdname).trim();const wanted=resolved.toLowerCase();if(offered.some(id=>id.toLowerCase()===wanted))return true;if(isSoldWithBlueprint(item,wanted)||isSoldWithBlueprint(item,asWritten))return true;if(!isGenericSpelling(wanted))return false;const signature=recipeSignature(resolved);if(signature===null)return false;return offered.some(id=>recipeSignature(id)===signature&&!isGenericSpelling(id))}function experimentalAvailableFor(item,fdname){const wanted=normalizeKey(fdname,"ShipLoadout.applyBlueprint: options.experimental");return getExperimentalsForModule(item).some(id=>id.toLowerCase()===wanted)}function primitiveLabelFor(stats,label){if(label==="MaximumRange"&&stats.maximumRange!==void 0)return"Range";if(label==="DamageFalloffRange"&&stats.falloffRange!==void 0){return"FalloffRange"}if(label==="Range"&&stats.scannerRange!==void 0)return"ScannerRange";if(label==="DSS_PatchRadius")return"ProbeRadius";if(label==="FuelScoopRate")return"RefuelRate";if(label==="EnergyPerRegen"&&stats.shieldRegenRate!==void 0){return"DistributorDraw"}return label}function primitiveEngineeringInputsFor(stats,grade,experimental){const canonicalGrade={...grade,features:grade.features.map(feature=>{const label=primitiveLabelFor(stats,feature.label);return label===feature.label?feature:{...feature,label:label}})};if(!experimental)return{grade:canonicalGrade};return{grade:canonicalGrade,experimental:{...experimental,modifiers:experimental.modifiers.map(modifier=>{const label=primitiveLabelFor(stats,modifier.label);return label===modifier.label?modifier:{...modifier,label:label}})}}}var round6=value=>{const rounded=Math.round(value*1e6)/1e6;return Object.is(rounded,-0)?0:rounded};function float32FiringCycle(interval,burstRounds,burstRateOfFire){if(interval<=0)return void 0;const withinBurst=burstRounds>1?Math.fround(Math.fround(burstRounds-1)/Math.fround(burstRateOfFire)):0;const cycle=Math.fround(withinBurst+Math.fround(interval));return cycle>0?cycle:void 0}function float32RateOfFire(interval,burstRounds,burstRateOfFire){const cycle=float32FiringCycle(interval,burstRounds,burstRateOfFire);return cycle===void 0?void 0:Math.fround(Math.fround(burstRounds)/cycle)}function float32DamagePerSecond(damage,rounds,rate,burstRounds,cycle){if(cycle!==void 0&&(rounds!==1||burstRounds!==1)){const damagePerCycle=Math.fround(Math.fround(Math.fround(damage)*Math.fround(rounds))*Math.fround(burstRounds));return Math.fround(damagePerCycle/cycle)}return Math.fround(Math.fround(Math.fround(damage)*Math.fround(rounds))*Math.fround(rate))}var JOURNAL_MODIFIER_ORDER=["CargoCapacity","GuardianModuleResistance","Mass","Integrity","PowerDraw","BootTime","PowerCapacity","HeatEfficiency","FSDOptimalMass","MaxFuelPerJump","FSDHeatRate","EngineOptimalMass","EngineOptPerformance","EngineHeatRate","ShieldGenOptimalMass","ShieldGenStrength","DamagePerSecond","Damage","DistributorDraw","ThermalLoad","ArmourPenetration","MaximumRange","ShotSpeed","RateOfFire","DamageType","$Kinetic;","$Thermal;","$Explosive;","$Absolute;","AmmoClipSize","AmmoMaximum","ReloadTime","Jitter","DamageFalloffRange","DefenceModifierShieldMultiplier","DefenceModifierHealthMultiplier","DefenceModifierHealthAddition","DefenceModifierShieldAddition","RegenRate","BrokenRegenRate","EnergyPerRegen","KineticResistance","ThermicResistance","ExplosiveResistance","CausticResistance","DamageProtection","ModuleDefenceAbsorption","WeaponsCapacity","WeaponsRecharge","EnginesCapacity","EnginesRecharge","SystemsCapacity","SystemsRecharge","ShieldBankSpinUp","ShieldBankDuration","ShieldBankReinforcement","ShieldBankHeat","FSDInterdictorRange","FSDInterdictorFacingLimit","SensorTargetScanAngle","MaxAngle","ScannerTimeToScan","Range","DSS_PatchRadius","FuelScoopRate","FuelCapacity"];var JOURNAL_MODIFIER_RANK=new Map(JOURNAL_MODIFIER_ORDER.map((label,index)=>[label,index]));function sortJournalModifiers(modifiers){return modifiers.map((modifier,index)=>({modifier:modifier,index:index})).sort((a,b)=>(JOURNAL_MODIFIER_RANK.get(a.modifier.Label)??JOURNAL_MODIFIER_ORDER.length)-(JOURNAL_MODIFIER_RANK.get(b.modifier.Label)??JOURNAL_MODIFIER_ORDER.length)||a.index-b.index).map(({modifier:modifier})=>modifier)}function journalModifiersFor(stats,modifiers){const weapon=stats.damage!==void 0;const valueFor=(label,fallback)=>{const modifier=modifiers.find(candidate=>candidate.Label===label);return(modifier&&preciseModifierValue(modifier))??Math.fround(fallback)};const burstTouched=["BurstInterval","BurstSize","BurstRateOfFire"].some(label=>modifiers.some(modifier=>modifier.Label===label));const damageTouched=modifiers.some(modifier=>modifier.Label==="Damage");const rateTouched=burstTouched||modifiers.some(modifier=>modifier.Label==="RateOfFire");let damagePerSecond;let derivedRate;if(weapon&&(damageTouched||rateTouched)){const continuous=stats.burstInterval===void 0&&stats.rateOfFire===void 0;const baseDamage=Math.fround(stats.damage);const effectiveDamage=valueFor("Damage",stats.damage);if(continuous){damagePerSecond={Label:"DamagePerSecond",Value:round6(effectiveDamage),OriginalValue:round6(baseDamage)}}else{const burstRounds=valueFor("BurstSize",stats.burstRounds??1);const burstRate=valueFor("BurstRateOfFire",stats.burstRateOfFire??1);const baseBurstRounds=Math.fround(stats.burstRounds??1);const baseBurstRate=Math.fround(stats.burstRateOfFire??1);const baseInterval=stats.burstInterval===void 0?void 0:Math.fround(stats.burstInterval);const baseCycle=baseInterval===void 0?void 0:float32FiringCycle(baseInterval,baseBurstRounds,baseBurstRate);const baseRate=baseInterval!==void 0?float32RateOfFire(baseInterval,baseBurstRounds,baseBurstRate):stats.rateOfFire===void 0?void 0:Math.fround(stats.rateOfFire);const rateModifier=modifiers.find(modifier=>modifier.Label==="RateOfFire");const effectiveRate=rateModifier&&preciseModifierValue(rateModifier);const effectiveInterval=valueFor("BurstInterval",stats.burstInterval??0);const effectiveCycle=effectiveRate===void 0?float32FiringCycle(effectiveInterval,burstRounds,burstRate):void 0;const rate=effectiveRate??(effectiveCycle===void 0?void 0:Math.fround(Math.fround(burstRounds)/effectiveCycle));if(baseRate!==void 0&&rate!==void 0){const stockRounds=Math.fround(stats.roundsPerShot??1);const effectiveRounds=Math.fround(modifiers.find(modifier=>modifier.Label==="Rounds"||modifier.Label==="RoundsPerShot")?.Value??stockRounds);damagePerSecond={Label:"DamagePerSecond",Value:round6(float32DamagePerSecond(effectiveDamage,effectiveRounds,rate,burstRounds,effectiveCycle)),OriginalValue:round6(float32DamagePerSecond(baseDamage,stockRounds,baseRate,baseBurstRounds,baseCycle))};if(burstTouched){derivedRate={Label:"RateOfFire",Value:round6(rate),OriginalValue:round6(baseRate)}}}}}const result=[];for(const modifier of modifiers){const label=modifier.Label;if(weapon&&["BurstInterval","BurstSize","BurstRateOfFire"].includes(label))continue;if(weapon&&label==="Damage"&&stats.rateOfFire===void 0)continue;let journalLabel=label;if(label==="Range"&&stats.maximumRange!==void 0)journalLabel="MaximumRange";else if(label==="FalloffRange"&&stats.falloffRange!==void 0){journalLabel="DamageFalloffRange"}else if(label==="ScannerRange"&&stats.scannerRange!==void 0){journalLabel="Range"}else if(label==="ProbeRadius")journalLabel="DSS_PatchRadius";else if(label==="RefuelRate")journalLabel="FuelScoopRate";else if(label==="DistributorDraw"&&stats.shieldRegenRate!==void 0){journalLabel="EnergyPerRegen"}result.push(journalLabel===label?modifier:{...modifier,Label:journalLabel})}if(damagePerSecond)result.push(damagePerSecond);if(derivedRate){const direct=result.findIndex(modifier=>modifier.Label==="RateOfFire");if(direct>=0)result[direct]=derivedRate;else result.push(derivedRate)}return sortJournalModifiers(result)}function isFinalGuardianWeaponEngineering(item,blueprint){const group=getEngineeringGroup(item);if(group===null||!GUARDIAN_WEAPON_GROUPS.has(group))return false;const resolved=resolveBlueprintForModule(item,blueprint);return getBlueprint(resolved)!==null&&!blueprintAvailableFor(item,blueprint)}function engineerableBase(item,statsOverride){const stats=statsOverride??builtInModuleBySymbol(item,FITTED_ITEM);if(!stats||stats.engineeringLocked)return null;return{stats:stats,base:baseStats(stats)}}function availableBlueprintsFor(item,statsOverride){const engineerable=engineerableBase(item,statsOverride);if(!engineerable)return[];const{stats:stats,base:base}=engineerable;const available=[];for(const[fdname,route]of blueprintRoutesFor(item)){const blueprint=BLUEPRINTS[fdname];if(!blueprint)continue;const grades=Object.entries(blueprint.grades).filter(([,grade])=>missingBaseLabels(stats,base,grade.features).length===0).map(([grade])=>Number(grade)).filter(Number.isFinite).sort((a,b)=>a-b);if(grades.length>0)available.push({fdname:fdname,grades:grades,route:route})}return available}function availableExperimentalsFor(item,statsOverride){const engineerable=engineerableBase(item,statsOverride);if(!engineerable)return[];const{stats:stats,base:base}=engineerable;return getExperimentalsForModule(item).filter(fdname=>{const effect=EXPERIMENTAL_EFFECTS[fdname];return effect!==void 0&&missingBaseLabels(stats,base,effect.modifiers).length===0})}function resolveDecorativeModificationStats(stats,modification){const primitiveModifiers=computeModifiers(baseStats(stats),fixedModifierFeatures(modification.modifiers));const resolvedLabels=new Set(primitiveModifiers.map(modifier=>modifier.Label));return{primitiveModifiers:primitiveModifiers,modifiers:journalModifiersFor(stats,primitiveModifiers),unresolved:modification.modifiers.map(modifier=>modifier.label).filter(label=>!resolvedLabels.has(label))}}export{FITTED_ITEM,availableBlueprintsFor,availableExperimentalsFor,blueprintAvailableFor,blueprintRoutesFor,cloneLoadoutModule,cloneModuleStats,experimentalAvailableFor,isBuiltInHullModule,isFinalGuardianWeaponEngineering,isNonOutfittingSlot,journalModifiersFor,matchingKeyIn,missingBaseLabels,primitiveEngineeringInputsFor,resolveDecorativeModificationStats};//# sourceMappingURL=chunk-2YPWFAWM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ships/internal/loadout-state.ts","../src/ships/internal/loadout-engineering.ts","../src/ships/internal/decorative-modification-resolution.ts"],"names":["fixedModifierFeatures","builtInModuleBySymbol","getPreEngineeredVariants","EXPERIMENTAL_EFFECTS","fieldForLabel","preciseModifierValue","computeModifiers","baseStats","resolveBlueprintForModule","getBlueprintsForModule","getExperimentalsForModule","getEngineeringGroup","getBlueprint","BLUEPRINTS","normalizeKey","deepFreeze","FITTED_ITEM","isNonOutfittingSlot","slotKey","test","isBuiltInHullModule","module","Slot","toLowerCase","Item","startsWith","cloneLoadoutModule","On","Priority","Health","Value","Engineering","BlueprintName","Level","Quality","ExperimentalEffect","ExperimentalEffect_Localised","Modifiers","map","modifier","matchingKeyIn","keyed","has","wanted","key","keys","cloneModuleStats","restrictedToShips","limitIncrease","damageDistribution","damageComponents","unclassified","projectileRange","GUARDIAN_WEAPON_GROUPS","Set","missingBaseLabels","stats","base","features","experimental","contributions","contribution","label","filter","recipeSignature","fdname","blueprint","grades","Object","entries","grade","feature","method","sort","join","name","isGenericSpelling","isSoldWithBlueprint","item","some","variant","acquisition","blueprintRoutesFor","routes","Map","set","blueprintAvailableFor","offered","asWritten","resolved","trim","id","signature","experimentalAvailableFor","primitiveLabelFor","maximumRange","falloffRange","scannerRange","shieldRegenRate","primitiveEngineeringInputsFor","canonicalGrade","modifiers","round6","value","rounded","Math","round","is","float32FiringCycle","interval","burstRounds","burstRateOfFire","withinBurst","fround","cycle","float32RateOfFire","float32DamagePerSecond","damage","rounds","rate","damagePerCycle","JOURNAL_MODIFIER_ORDER","JOURNAL_MODIFIER_RANK","index","sortJournalModifiers","a","b","get","Label","length","journalModifiersFor","weapon","valueFor","fallback","find","candidate","burstTouched","damageTouched","rateTouched","damagePerSecond","derivedRate","continuous","burstInterval","rateOfFire","baseDamage","effectiveDamage","OriginalValue","burstRate","baseBurstRounds","baseBurstRate","baseInterval","baseCycle","baseRate","rateModifier","effectiveRate","effectiveInterval","effectiveCycle","stockRounds","roundsPerShot","effectiveRounds","result","includes","journalLabel","push","direct","findIndex","isFinalGuardianWeaponEngineering","group","engineerableBase","statsOverride","engineeringLocked","availableBlueprintsFor","engineerable","available","route","Number","isFinite","availableExperimentalsFor","effect","resolveDecorativeModificationStats","modification","primitiveModifiers","resolvedLabels","unresolved"],"mappings":"O,0mBAYO,IAAMgB,YAAc,kCAGpB,SAASC,oBAAoBC,SAChC,MAAO,kIAAkIC,KACrID,QAER,CAGO,SAASE,oBAAoBC,QAChC,OACIA,OAAOC,KAAKC,gBAAkB,cAC9BF,OAAOG,KAAKD,cAAcE,WAAW,sBAE7C,CAGO,SAASC,mBAAmBL,QAC/B,MAAO,CACHC,KAAMD,OAAOC,KACbE,KAAMH,OAAOG,QACTH,OAAOM,UAAO,EAAY,CAAA,EAAK,CAAEA,GAAIN,OAAOM,OAC5CN,OAAOO,gBAAa,EAAY,CAAA,EAAK,CAAEA,SAAUP,OAAOO,aACxDP,OAAOQ,cAAW,EAAY,CAAA,EAAK,CAAEA,OAAQR,OAAOQ,WACpDR,OAAOS,aAAU,EAAY,CAAA,EAAK,CAAEA,MAAOT,OAAOS,UAClDT,OAAOU,mBAAgB,EACrB,CAAA,EACA,CACIA,YAAa,CACTC,cAAeX,OAAOU,YAAYC,iBAC9BX,OAAOU,YAAYE,aAAU,EAC3B,CAAA,EACA,CAAEA,MAAOZ,OAAOU,YAAYE,UAC9BZ,OAAOU,YAAYG,eAAY,EAC7B,CAAA,EACA,CAAEA,QAASb,OAAOU,YAAYG,YAChCb,OAAOU,YAAYI,0BAAuB,EACxC,CAAA,EACA,CAAEA,mBAAoBd,OAAOU,YAAYI,uBAC3Cd,OAAOU,YAAYK,oCAAiC,EAClD,CAAA,EACA,CACIA,6BACIf,OAAOU,YAAYK,iCAE7Bf,OAAOU,YAAYM,iBAAc,EAC/B,CAAA,EACA,CACIA,UAAWhB,OAAOU,YAAYM,UAAUC,IAAKC,WAAA,IACtCA,eAMvC,CAaO,SAASC,cAAcC,MAAqCvB,SAC/D,GAAIuB,MAAMC,IAAIxB,SAAU,OAAOA,QAC/B,MAAMyB,OAASzB,QAAQK,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,MAAOC,KAAMa,MAAMZ,UAAUuE,SAAW,GAChF3F,IAAI,EAAEgC,SAAWyG,OAAOzG,QACxBP,OAAOgH,OAAOC,UACdvG,KAAK,CAACoD,EAAGC,IAAMD,EAAIC,GACxB,GAAI3D,OAAO8D,OAAS,EAAG4C,UAAUV,KAAK,CAAElG,cAAQE,cAAQ2G,aAC5D,CACA,OAAOD,SACX,CAGO,SAASI,0BACZnG,KACA2F,eAEA,MAAMG,aAAeJ,iBAAiB1F,KAAM2F,eAC5C,IAAKG,aAAc,MAAO,GAC1B,MAAMpH,MAAEA,MAAAC,KAAOA,MAASmH,aACxB,OAAOlK,0BAA0BoE,MAAMf,OAAQE,SAC3C,MAAMiH,OAAS/K,qBAAqB8D,QACpC,OACIiH,cAAW,GAAa3H,kBAAkBC,MAAOC,KAAMyH,OAAO7E,WAAW4B,SAAW,GAGhG,CCxmBO,SAASkD,mCACZ3H,MACA4H,cAEA,MAAMC,mBAAqB/K,iBACvBC,UAAUiD,OACVxD,sBAAsBoL,aAAa/E,YAEvC,MAAMiF,eAAiB,IAAIhI,IAAI+H,mBAAmB/I,IAAKC,UAAaA,SAASyF,QAC7E,MAAO,CACHqD,sCACAhF,UAAW6B,oBAAoB1E,MAAO6H,oBACtCE,WAAYH,aAAa/E,UACpB/D,IAAKC,UAAaA,SAASuB,OAC3BC,OAAQD,QAAWwH,eAAe5I,IAAIoB,QAEnD,QAAA9C,YAAA2J,uBAAAM,0BAAA3F,sBAAAJ,mBAAAxD,mBAAAoB,iBAAA+C,yBAAAzE,oBAAAkJ,iCAAArJ,oBAAAiH,oBAAA1F,cAAAe,kBAAA4C,8BAAAgF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{shieldRecovery,cellBankSummary}from"./chunk-MPZGCTRG.js";import{shieldMetrics}from"./chunk-2FHHMYDC.js";import{getShipSlots,getShipBySymbol,getShipByName}from"./chunk-IJRKEODR.js";import{parseSlef,toSlef,stringifySlef,getLoadoutModifier}from"./chunk-IAWTRADE.js";import{enumerateSlots,parseSlotName,SLOT_RESTRICTION_LABELS}from"./chunk-I7PIDRMU.js";import{sourcePurchaseFromLoadout,getSourceModuleValue}from"./chunk-QTDBO7R2.js";import{weaponsCapacitorMetrics}from"./chunk-FMPRCYKY.js";import{powerBudget}from"./chunk-76XKY2Y2.js";import{identifyPreEngineeredVariant,getPreEngineeredStats,scaleDamageComponents}from"./chunk-WCIK2WB7.js";import{weaponMetrics,sumWeaponMetrics,combinedRateOfFire}from"./chunk-LJI7VXJD.js";import{singleJumpRange,frameShiftDriveMassFactor,fuelPerJump,totalRange}from"./chunk-GQ5GX5TB.js";import{completeResult,calculateUnladenMass,calculateCargoCapacity,calculateFuelCapacity}from"./chunk-RF2IKLWQ.js";import{validateLoadout}from"./chunk-5W43EQEQ.js";import{mobilityMetrics}from"./chunk-24INI4U7.js";import{calculateModuleLimits}from"./chunk-KPETDYQX.js";import{getDefaultLoadout}from"./chunk-V3DW67W2.js";import{heatMetrics}from"./chunk-QMQHIZGS.js";import{ammunitionCapacity}from"./chunk-AA3K5XUE.js";import{armourMetrics}from"./chunk-FGXWVFN6.js";import{isNonOutfittingSlot,isBuiltInHullModule,cloneLoadoutModule,cloneModuleStats,availableBlueprintsFor,availableExperimentalsFor,blueprintAvailableFor,blueprintRoutesFor,experimentalAvailableFor,primitiveEngineeringInputsFor,missingBaseLabels,journalModifiersFor,resolveDecorativeModificationStats,matchingKeyIn,FITTED_ITEM,isFinalGuardianWeaponEngineering}from"./chunk-2YPWFAWM.js";import{builtInModuleBySymbol,getBulkheadsForShip}from"./chunk-PRQELBIC.js";import{getPreEngineeredVariants}from"./chunk-XYK6DYVQ.js";import{ALL_MODULES}from"./chunk-W7XI3WVA.js";import{CORE_MODULES}from"./chunk-O72KI7RP.js";import{getExperimentalEffect}from"./chunk-PMJG7PHU.js";import{baseStats,computeModifiers,labelsForDamageType,scaleForLabel,fieldForLabel,labelsForField,capabilityValueForLabel,damageTypeForLabel}from"./chunk-SVZARHWP.js";import{resolveBlueprintForModule}from"./chunk-ZJB5UYNE.js";import{getExperimentalsForModule}from"./chunk-TH4S5MVD.js";import{getBlueprintGrade}from"./chunk-Q5MR36RW.js";import{isDecorativeModification,getDecorativeModification}from"./chunk-OHGOVZ7U.js";import{normalizeKey}from"./chunk-S4DBNX2B.js";import{truncate,describeValue,requireString,requireStringIfPresent}from"./chunk-B5TT26XE.js";import{deepFreeze}from"./chunk-DURKO7JU.js";var PREFIX={powerPlant:["int_powerplant","int_guardianpowerplant"],thrusters:["int_engine","int_mkiiagileboost_engine"],frameShiftDrive:["int_hyperdrive"],powerDistributor:["int_powerdistributor","int_guardianpowerdistributor"],shieldGenerator:["int_shieldgenerator"],shieldCellBank:["int_shieldcellbank"],shieldBooster:["hpt_shieldbooster"],shieldReinforcement:["int_guardianshieldreinforcement"],hullReinforcement:["int_hullreinforcement","int_guardianhullreinforcement","int_metaalloyhullreinforcement"],moduleReinforcement:["int_modulereinforcement","int_guardianmodulereinforcement"]};var startsWithAny=(symbol,prefixes)=>prefixes.some(prefix=>symbol.toLowerCase().startsWith(prefix));function isPowerDistributor(module,stats){return stats?.slot?stats.slot==="powerDistributor":startsWithAny(module.Item,PREFIX.powerDistributor)}function isEnabled(module){return module.On!==false}function priorityOf(module){return(module.Priority??0)+1}function effectiveStat(module,field,stats){const stated=statedModifier(module,field);if(stated!==void 0)return stated;const base=stats?.[field];return typeof base==="number"?base:void 0}function statedModifier(module,field){for(const label of labelsForField(field)){if(capabilityValueForLabel(label)!==null)continue;const modified=getLoadoutModifier(module,label);if(modified!==null)return modified/scaleForLabel(label)}return void 0}function effectiveCapability(module,field,stats){for(const label of labelsForField(field)){if(capabilityValueForLabel(label)===null)continue;if(module.Engineering?.Modifiers?.some(modifier=>modifier.Label.toLowerCase()===label.toLowerCase())){return true}}const base=stats[field];return typeof base==="boolean"?base:void 0}function effectiveDamageDistribution(module,stats){const fromEffect=module.Engineering?.ExperimentalEffect?getExperimentalEffect(module.Engineering.ExperimentalEffect)?.damageDistribution:void 0;const distribution={...fromEffect??stats.damageDistribution};let resolved=fromEffect!==void 0||stats.damageDistribution!==void 0;for(const modifier of module.Engineering?.Modifiers??[]){if(modifier.Value===void 0)continue;const type=damageTypeForLabel(modifier.Label);if(type===null)continue;distribution[type]=modifier.Value/scaleForLabel(modifier.Label);resolved=true}return resolved?distribution:void 0}function convertsDamage(module){if(module.Engineering?.ExperimentalEffect&&getExperimentalEffect(module.Engineering.ExperimentalEffect)?.damageDistribution){return true}return(module.Engineering?.Modifiers??[]).some(modifier=>damageTypeForLabel(modifier.Label)!==null)}function modifierRatio(module,stats,field){const base=stats?.[field];if(typeof base!=="number"||base===0)return 1;const effective=effectiveStat(module,field,stats);return effective===void 0?1:effective/base}function relatedStat(module,stats,field,ratio){const stated=statedModifier(module,field);if(stated!==void 0)return stated;const base=stats?.[field];return typeof base==="number"?base*ratio:void 0}function effectiveModule(module,stats){if(!stats||!module.Engineering)return stats;const merged={...stats};const fields=new Set(Object.keys(stats));for(const modifier of module.Engineering.Modifiers??[]){const field=fieldForLabel(modifier.Label,stats);if(field)fields.add(field)}for(const key of fields){const capability=effectiveCapability(module,key,stats);if(capability!==void 0){merged[key]=capability;continue}const value=effectiveStat(module,key,stats);if(value!==void 0)merged[key]=value}if(stats.engineeringGroup==="thrusters"){const massRatio=modifierRatio(module,stats,"optMass");const minMass=relatedStat(module,stats,"minMass",massRatio);const maxMass=relatedStat(module,stats,"maxMass",massRatio);if(minMass!==void 0)merged.minMass=minMass;if(maxMass!==void 0)merged.maxMass=maxMass}if(stats.engineeringGroup==="thrusters"||stats.engineeringGroup==="shieldGenerators"){const performanceRatio=modifierRatio(module,stats,"optMultiplier");const minMultiplier=relatedStat(module,stats,"minMultiplier",performanceRatio);const maxMultiplier=relatedStat(module,stats,"maxMultiplier",performanceRatio);if(minMultiplier!==void 0)merged.minMultiplier=minMultiplier;if(maxMultiplier!==void 0)merged.maxMultiplier=maxMultiplier;if(stats.engineeringGroup==="thrusters"){for(const field of["minSpeedMultiplier","optSpeedMultiplier","maxSpeedMultiplier","minRotationMultiplier","optRotationMultiplier","maxRotationMultiplier"]){const value=stats[field];if(value!==void 0)merged[field]=value*performanceRatio}}}const damageDistribution=effectiveDamageDistribution(module,stats);if(damageDistribution)merged.damageDistribution=damageDistribution;if(stats.category==="hardpoint")normalizeEffectiveWeapon(module,merged);if(convertsDamage(module)){delete merged.damageComponents}else if(stats.damageComponents){merged.damageComponents=scaleDamageComponents(stats.damageComponents,stats.damage,typeof merged.damage==="number"?merged.damage:void 0)}return merged}function powerConsumerFor(module,stats){const draw=effectiveStat(module,"powerDraw",stats);const parsedSlot=parseSlotName(module.Slot);const mounted=stats?.category==="hardpoint"||stats?.category==="utility";const deployedOnly=stats!==null?mounted&&stats.alwaysPowered!==true:parsedSlot?.kind==="hardpoint"?true:parsedSlot?.kind==="utility"?void 0:false;const common={priority:priorityOf(module),enabled:isEnabled(module),...deployedOnly===void 0?{}:{deployedOnly:deployedOnly},label:module.Slot};if(draw===void 0){const inherentlyPassiveSlot=parsedSlot?.kind==="armour"||parsedSlot?.kind==="core"&&(parsedSlot.core==="powerPlant"||parsedSlot.core==="fuelTank");if(stats!==null||inherentlyPassiveSlot||isNonOutfittingSlot(module.Slot))return null;return{drawUnknown:true,...common}}if(draw===0)return null;return{draw:draw,...common}}function powerAvailable(modules,statsFor){for(const module of modules){const stats=statsFor(module);const isPlant=stats?.slot?stats.slot==="powerPlant":startsWithAny(module.Item,PREFIX.powerPlant);if(!isPlant)continue;if(!isEnabled(module))return 0;return effectiveStat(module,"powerCapacity",stats)??0}return 0}function mapResistanceFields(read){return{kineticResistance:read("kineticResistance")??0,thermalResistance:read("thermalResistance")??0,explosiveResistance:read("explosiveResistance")??0,causticResistance:read("causticResistance")??0}}function resistancesOf(module,stats){return mapResistanceFields(field=>effectiveStat(module,field,stats))}function shieldInputFor(shipSymbol,modules,systemsPips,statsFor){const hull=getShipBySymbol(shipSymbol);let generator=null;const boosters=[];let reinforcement=0;for(const module of modules){if(!isEnabled(module))continue;const stats=statsFor(module);if(!generator&&startsWithAny(module.Item,PREFIX.shieldGenerator)){const massRatio=modifierRatio(module,stats,"optMass");const strengthRatio=modifierRatio(module,stats,"optMultiplier");const optMass=effectiveStat(module,"optMass",stats);const minMass=relatedStat(module,stats,"minMass",massRatio);const maxMass=relatedStat(module,stats,"maxMass",Math.max(1,massRatio));const optMultiplier=effectiveStat(module,"optMultiplier",stats);const minMultiplier=relatedStat(module,stats,"minMultiplier",strengthRatio);const maxMultiplier=relatedStat(module,stats,"maxMultiplier",strengthRatio);generator={...optMass===void 0?{}:{optMass:optMass},...minMass===void 0?{}:{minMass:minMass},...maxMass===void 0?{}:{maxMass:maxMass},...optMultiplier===void 0?{}:{optMultiplier:optMultiplier},...minMultiplier===void 0?{}:{minMultiplier:minMultiplier},...maxMultiplier===void 0?{}:{maxMultiplier:maxMultiplier},...resistancesOf(module,stats)}}else if(startsWithAny(module.Item,PREFIX.shieldBooster)){boosters.push({shieldBoost:effectiveStat(module,"shieldBoost",stats)??0,...resistancesOf(module,stats)})}else if(startsWithAny(module.Item,PREFIX.shieldReinforcement)){reinforcement+=effectiveStat(module,"shieldAddition",stats)??0}}return{hullMass:hull?.hullMass??0,baseShieldStrength:hull?.baseShieldStrength??0,generator:generator,boosters:boosters,reinforcement:reinforcement,systemsPips:systemsPips}}function mobilityInputFor(shipSymbol,modules,mass,enginesPips,statsFor){const hull=getShipBySymbol(shipSymbol);if(!hull)return null;let thrusters=null;for(const module of modules){const stats=statsFor(module);const isThruster=stats?.slot?stats.slot==="thrusters":startsWithAny(module.Item,PREFIX.thrusters);if(!isThruster)continue;if(!isEnabled(module))return null;const effective=effectiveModule(module,stats);const minMass=effective?.minMass;const optMass=effective?.optMass;const maxMass=effective?.maxMass;const minMultiplier=effective?.minMultiplier;const optMultiplier=effective?.optMultiplier;const maxMultiplier=effective?.maxMultiplier;if(minMass===void 0||optMass===void 0||maxMass===void 0||minMultiplier===void 0||optMultiplier===void 0||maxMultiplier===void 0){return null}thrusters={minMass:minMass,optMass:optMass,maxMass:maxMass,minMultiplier:minMultiplier,optMultiplier:optMultiplier,maxMultiplier:maxMultiplier,...effective?.optSpeedMultiplier===void 0?{}:{speedCurve:{minMass:minMass,optMass:optMass,maxMass:maxMass,minMultiplier:effective.minSpeedMultiplier??minMultiplier,optMultiplier:effective.optSpeedMultiplier,maxMultiplier:effective.maxSpeedMultiplier??maxMultiplier}},...effective?.optRotationMultiplier===void 0?{}:{rotationCurve:{minMass:minMass,optMass:optMass,maxMass:maxMass,minMultiplier:effective.minRotationMultiplier??minMultiplier,optMultiplier:effective.optRotationMultiplier,maxMultiplier:effective.maxRotationMultiplier??maxMultiplier}}};break}if(!thrusters)return null;return{minimumSpeed:hull.minimumSpeed,maximumSpeed:hull.maximumSpeed,boost:hull.boost,minPitch:hull.minPitch,pitch:hull.pitch,minRoll:hull.minRoll,roll:hull.roll,minYaw:hull.minYaw,yaw:hull.yaw,mass:typeof mass==="function"?mass():mass,thrusters:thrusters,enginesPips:enginesPips}}function shieldRecoveryInputFor(shipSymbol,modules,systemsPips,statsFor){let generator=null;let distributor=null;for(const module of modules){const stats=statsFor(module);if(!generator&&startsWithAny(module.Item,PREFIX.shieldGenerator)){if(!isEnabled(module))return null;generator=module}if(isPowerDistributor(module,stats)&&isEnabled(module))distributor=module}if(!generator)return null;const generatorStats=statsFor(generator);const distributorStats=distributor?statsFor(distributor):null;const strength=shieldMetrics(shieldInputFor(shipSymbol,modules,0,statsFor)).strength;return{strength:strength,regenRate:effectiveStat(generator,"shieldRegenRate",generatorStats)??0,brokenRegenRate:effectiveStat(generator,"shieldBrokenRegenRate",generatorStats)??0,distributorDraw:effectiveStat(generator,"distributorDraw",generatorStats)??.6,systemsCapacity:distributor?effectiveStat(distributor,"systemsCapacity",distributorStats)??0:0,systemsRecharge:distributor?effectiveStat(distributor,"systemsRecharge",distributorStats)??0:0,systemsPips:systemsPips}}function weaponsCapacitorInputFor(modules,weaponsPips,budget,statsFor){let weaponsCapacity=0;let weaponsRecharge=0;let sustainedEnergyPerSecond=0;for(const module of modules){if(!isEnabled(module))continue;const stats=statsFor(module);if(!poweredStates(module,stats,budget).deployed)continue;if(isPowerDistributor(module,stats)){weaponsCapacity=effectiveStat(module,"weaponsCapacity",stats)??0;weaponsRecharge=effectiveStat(module,"weaponsRecharge",stats)??0}const weapon=weaponStatsFor(module,stats);if(weapon){sustainedEnergyPerSecond+=weaponMetrics(weapon).sustainedEnergyPerSecond}}return{weaponsCapacity:weaponsCapacity,weaponsRecharge:weaponsRecharge,sustainedEnergyPerSecond:sustainedEnergyPerSecond,weaponsPips:weaponsPips}}function heatInputFor(shipSymbol,modules,budget,statsFor){const hull=getShipBySymbol(shipSymbol);if(!hull)return null;let heatEfficiency;let thrusterHeatRate=0;let deployedThrusterHeatRate=0;let fsdHeatRate=0;let weaponsCapacity=0;const weapons=[];for(const module of modules){const stats=statsFor(module);const isPlant=stats?.slot?stats.slot==="powerPlant":startsWithAny(module.Item,PREFIX.powerPlant);if(isPlant){if(!isEnabled(module))return null;heatEfficiency=effectiveStat(module,"heatEfficiency",stats);continue}if(!isEnabled(module))continue;const running=poweredStates(module,stats,budget);if(stats?.slot?stats.slot==="thrusters":startsWithAny(module.Item,PREFIX.thrusters)){const heat=effectiveStat(module,"engineHeatRate",stats)??0;if(running.retracted)thrusterHeatRate+=heat;if(running.deployed)deployedThrusterHeatRate+=heat}else if(stats?.slot?stats.slot==="frameShiftDrive":startsWithAny(module.Item,PREFIX.frameShiftDrive)){if(running.retracted)fsdHeatRate+=effectiveStat(module,"fsdHeatRate",stats)??0}else if(isPowerDistributor(module,stats)){if(running.deployed){weaponsCapacity=effectiveStat(module,"weaponsCapacity",stats)??0}}const weapon=weaponStatsFor(module,stats);if(!weapon||!running.deployed)continue;weapons.push({heatPerSecond:weaponMetrics(weapon).sustainedHeatPerSecond,distributorDraw:weapon.distributorDraw??0})}if(heatEfficiency===void 0)return null;return{heatCapacity:hull.heatCapacity,heatDissipation:hull.heatDissipation,heatEfficiency:heatEfficiency,retractedPowerDraw:poweredDraw(budget,"retracted"),deployedPowerDraw:poweredDraw(budget,"deployed"),thrusterHeatRate:thrusterHeatRate,deployedThrusterHeatRate:deployedThrusterHeatRate,fsdHeatRate:fsdHeatRate,weaponsCapacity:weaponsCapacity,weapons:weapons,unknownDraws:budget.unknownDraws.map(consumer=>consumer.label??"(unnamed module)")}}function poweredDraw(budget,state){const powered=state==="retracted"?"poweredRetracted":"poweredDeployed";return budget.bands.reduce((total,band)=>band[powered]?total+band[state]:total,0)}function poweredStates(module,stats,budget){const draw=effectiveStat(module,"powerDraw",stats);if(draw===void 0||draw===0)return{retracted:true,deployed:true};const band=budget.bands[Math.min(budget.bands.length,Math.max(1,priorityOf(module)))-1];if(!band)return{retracted:true,deployed:true};return{retracted:band.poweredRetracted,deployed:band.poweredDeployed}}function cellBankInputsFor(modules,statsFor){const banks=[];for(const module of modules){if(!startsWithAny(module.Item,PREFIX.shieldCellBank))continue;const effective=effectiveModule(module,statsFor(module));const ammunition=effective?ammunitionCapacity(effective):null;banks.push({slot:module.Slot,symbol:module.Item,reinforcementRate:effective?.shieldBankReinforcement??0,cells:ammunition?.total??0,spinUp:effective?.shieldBankSpinUp??0,duration:effective?.shieldBankDuration??0,heat:effective?.shieldBankHeat??0})}return banks}function stockBulkhead(shipSymbol){const hull=getShipBySymbol(shipSymbol);if(!hull)return null;const variants=getBulkheadsForShip(hull.name,CORE_MODULES);return variants.find(v=>v.symbol.toLowerCase().endsWith("_default"))??variants.find(v=>v.mass===0)??variants[0]??null}function armourInputFor(shipSymbol,modules,statsFor){const hull=getShipBySymbol(shipSymbol);const reinforcements=[];const moduleReinforcements=[];let bulkhead=null;for(const module of modules){if(!isEnabled(module))continue;const stats=statsFor(module);if(module.Slot.toLowerCase()==="armour"){bulkhead={hullBoost:effectiveStat(module,"hullBoost",stats)??0,...resistancesOf(module,stats)}}else if(startsWithAny(module.Item,PREFIX.hullReinforcement)){const boost=getLoadoutModifier(module,"DefenceModifierHealthMultiplier");reinforcements.push({hullReinforcement:effectiveStat(module,"hullReinforcement",stats)??0,hullBoost:boost===null?0:boost/scaleForLabel("DefenceModifierHealthMultiplier"),...resistancesOf(module,stats)})}else if(startsWithAny(module.Item,PREFIX.moduleReinforcement)){moduleReinforcements.push({moduleProtection:effectiveStat(module,"moduleProtection",stats)??0,integrity:effectiveStat(module,"integrity",stats)??0})}}if(!bulkhead){const stock=stockBulkhead(shipSymbol);bulkhead=stock?{hullBoost:stock.hullBoost??0,...mapResistanceFields(field=>stock[field])}:null}return{baseArmour:hull?.baseArmour??0,bulkhead:bulkhead,reinforcements:reinforcements,moduleReinforcements:moduleReinforcements}}var WEAPON_FIELDS=["damage","roundsPerShot","rateOfFire","burstInterval","burstRounds","burstRateOfFire","chargeTime","clipSize","ammoMaximum","reloadTime","distributorDraw","thermalLoad","powerDraw","maximumRange","falloffRange","armourPiercing"];function weaponStatsFor(module,stats){if(!stats||stats.category!=="hardpoint")return null;const weapon={};for(const field of WEAPON_FIELDS){const value=effectiveStat(module,field,stats);if(value!==void 0)weapon[field]=value}normalizeEffectiveWeapon(module,weapon);const damageDistribution=effectiveDamageDistribution(module,stats);if(damageDistribution)weapon.damageDistribution=damageDistribution;if(stats.damageComponents&&!convertsDamage(module)){weapon.damageComponents=scaleDamageComponents(stats.damageComponents,stats.damage,typeof weapon.damage==="number"?weapon.damage:void 0)}if(stats.projectileRange)weapon.projectileRange={...stats.projectileRange};return weapon}function burstAdjustedRateOfFire(module,weapon){if(getLoadoutModifier(module,"RateOfFire")!==null)return void 0;const touched=["BurstSize","BurstRateOfFire","BurstInterval"].some(label=>getLoadoutModifier(module,label)!==null);if(!touched)return void 0;return combinedRateOfFire(weapon)}function normalizeEffectiveWeapon(module,weapon){const rate=burstAdjustedRateOfFire(module,weapon);if(rate!==void 0)weapon.rateOfFire=rate;const statedDamagePerSecond=getLoadoutModifier(module,"DamagePerSecond");const firingFactor=Number(weapon.roundsPerShot??1)*Number(weapon.rateOfFire??1);if(statedDamagePerSecond!==null&&firingFactor>0){weapon.damage=statedDamagePerSecond/firingFactor}const{maximumRange:maximumRange,falloffRange:falloffRange}=weapon;if(maximumRange!==void 0&&falloffRange!==void 0&&falloffRange>maximumRange){weapon.falloffRange=maximumRange}}var CORE_NAMES={powerPlant:"Power Plant",thrusters:"Thrusters",frameShiftDrive:"Frame Shift Drive",lifeSupport:"Life Support",powerDistributor:"Power Distributor",sensors:"Sensors",fuelTank:"Fuel Tank"};var RESTRICTED_OPTIONAL_NAMES={military:"Military Slot",cargo:"Cargo Slot",limpetController:"Limpet Controller Slot",vesselHangar:"Vessel Hangar Slot",passenger:"Passenger Slot"};function trailingDigits(key){let start=key.length;while(start>0){const code=key.charCodeAt(start-1);if(code<48||code>57)break;start--}return start===key.length?null:key.slice(start)}function loadoutSlotName(slot){switch(slot.kind){case"core":return CORE_NAMES[slot.core];case"hardpoint":{const match=/^(Small|Medium|Large|Huge)(Mining)?Hardpoint(\d+)$/.exec(slot.key);if(!match)return slot.key;return`${match[1]}${match[2]?" Mining":""} Hardpoint ${Number(match[3])}`}case"utility":{const match=/^TinyHardpoint(\d+)$/.exec(slot.key);return match?`Utility Mount ${Number(match[1])}`:slot.key}case"optional":{if(slot.restriction==="planetaryApproachSuite")return"Planetary Approach Suite";if(slot.restriction){const numbered=trailingDigits(slot.key);const label=RESTRICTED_OPTIONAL_NAMES[slot.restriction];return label&&numbered?`${label} ${Number(numbered)}`:slot.key}const optional=/^Slot(\d+)_Size(\d+)$/.exec(slot.key);return optional?`Optional Internal ${Number(optional[1])} (Size ${slot.size})`:slot.key}case"armour":return"Armour";case"cargoHatch":return"Cargo Hatch"}}var MILITARY_PREFIXES=["int_hullreinforcement","int_metaalloyhullreinforcement","int_modulereinforcement","int_shieldcellbank","int_guardianhullreinforcement","int_guardianmodulereinforcement","int_guardianshieldreinforcement"];var MINING_PREFIXES=["hpt_mininglaser","hpt_mining_abrblstr","hpt_mining_seismchrgwarhd","hpt_mining_subsurfdispmisle","hpt_human_extraction","hpt_miningtoolv2"];var CARGO_PREFIXES=["int_cargorack","int_largecargorack","int_corrosionproofcargorack","int_fueltank"];var RESTRICTED_SLOT_PREFIXES={mining:MINING_PREFIXES,military:MILITARY_PREFIXES,cargo:CARGO_PREFIXES,limpetController:["int_dronecontrol","int_multidronecontrol"],vesselHangar:["int_fighterbay"],passenger:["int_passengercabin","int_mkii_passengercabin"],planetaryApproachSuite:["int_planetapproachsuite"]};var problem=(constraint,message,params)=>({constraint:constraint,message:message,...params===void 0?{}:{params:params}});function restrictionProblem(slot,symbol){const restriction=slot.restriction;if(!restriction)return null;if(RESTRICTED_SLOT_PREFIXES[restriction].some(prefix=>symbol.startsWith(prefix))){return null}return problem("restrictedMount",`slot only takes ${SLOT_RESTRICTION_LABELS[restriction]}`,{restriction:restriction})}function moduleSlotProblem(slot,module){const required=module.restrictedToSlot;if(!required||slot.restriction===required)return null;return problem("restrictedMount",`module only fits a mount that takes ${SLOT_RESTRICTION_LABELS[required]}`,{restriction:required})}function moduleFitProblem(shipSymbol,slot,module){if(slot.kind==="cargoHatch"){return problem("immutableSlot","the cargoHatch slot cannot be changed")}if(slot.kind==="armour"){const hull=getShipBySymbol(shipSymbol);if(module.slot!=="armour"||module.ship===void 0){return problem("armourRequired","not a ship armour module")}if(!hull||module.ship.toLowerCase()!==hull.name.toLowerCase()){const armourHull=getShipByName(module.ship);return problem("wrongHullArmour",`armour belongs to ${truncate(module.ship)}, not ${truncate(hull?.name??shipSymbol)}`,{armourShipName:module.ship,...armourHull===null?{}:{armourShipSymbol:armourHull.symbol},shipSymbol:shipSymbol,...hull===null?{}:{shipName:hull.name}})}return null}const restricted=module.restrictedToShips;if(restricted&&!restricted.some(symbol2=>symbol2.toLowerCase()===shipSymbol.toLowerCase())){const allowedShipNames=restricted.map(symbol2=>{const hull=getShipBySymbol(symbol2);return hull?.name??symbol2});const labels=restricted.map((symbol2,index)=>{const name=allowedShipNames[index];return name===symbol2?symbol2:`${name} (${symbol2})`});return problem("restrictedHull",`module is restricted to ${truncate(labels.join(", "))}`,{allowedShipNames:allowedShipNames,allowedShipSymbols:[...restricted],shipSymbol:shipSymbol})}const wrongMount=moduleSlotProblem(slot,module);if(wrongMount)return wrongMount;const symbol=module.symbol.toLowerCase();const moduleSlot=module.slot;switch(slot.kind){case"core":if(moduleSlot!==slot.core){return problem("wrongCoreType",`not a ${slot.core} module`,{requiredCore:slot.core,moduleSlot:moduleSlot??"none"})}break;case"hardpoint":{if(module.category!=="hardpoint"){return problem("hardpointRequired","not a hardpoint weapon")}const restricted2=restrictionProblem(slot,symbol);if(restricted2)return restricted2;break}case"utility":if(module.category!=="utility"){return problem("utilityRequired","not a utility module")}return null;case"optional":{const isFuelTank=moduleSlot==="fuelTank";if(module.category!=="internal"&&!isFuelTank){return problem("optionalInternalRequired","not an optional-internal module")}if(moduleSlot&&!isFuelTank){return problem("coreModuleInOptionalSlot","a core module only fits its core slot")}const restricted2=restrictionProblem(slot,symbol);if(restricted2)return restricted2;break}}return module.class>slot.size?problem("oversized",`module size ${truncate(module.class)} exceeds slot size ${slot.size}`,{moduleClass:module.class,slotSize:slot.size}):null}function moduleFitError(shipSymbol,slot,module){return moduleFitProblem(shipSymbol,slot,module)?.message??null}var REBUY_FRACTION=.05;function exportLoadoutEvent(input,options){const fromSource=options.credits==="source";const source=fromSource?input.sourcePurchase:null;const totals=source!==null&&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{event:"Loadout",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},...input.unladenMass===null?{}:{UnladenMass:input.unladenMass},...input.cargoCapacity===null?{}:{CargoCapacity:input.cargoCapacity},...input.maxJumpRange===null?{}:{MaxJumpRange:input.maxJumpRange},...input.fuelCapacity===null?{}:{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.shipSymbol,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(shipSymbol,modules,layout){if(!layout){throw new TypeError(`ShipLoadout.toLoadoutEvent: no slot layout for hull "${truncate(shipSymbol)}", so modules cannot be ordered by slot`)}const remaining=new Map(modules);const ordered=[];for(const slot of layout){const key=matchingKeyIn(remaining,slot.key);const module=key===null?void 0:remaining.get(key);if(module&&key!==null){ordered.push(module);remaining.delete(key)}}return[...ordered,...remaining.values()]}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||normalizeKey(fitted.Item,FITTED_ITEM)!==normalizeKey(entry.item,SOURCE_ITEM)){return false}}return true}function captureLoadoutEvent(event){const modules=event.Modules;const shipName=event.ShipName;const shipIdent=event.ShipIdent;const hullValue=event.HullValue;const modulesValue=event.ModulesValue;const rebuy=event.Rebuy;const unladenMass=event.UnladenMass;const cargoCapacity=event.CargoCapacity;const fuelCapacity=event.FuelCapacity;return{Ship:event.Ship,Modules:Array.isArray(modules)?captureEach(modules,captureModule):modules,...shipName===void 0?{}:{ShipName:shipName},...shipIdent===void 0?{}:{ShipIdent:shipIdent},...hullValue===void 0?{}:{HullValue:hullValue},...modulesValue===void 0?{}:{ModulesValue:modulesValue},...rebuy===void 0?{}:{Rebuy:rebuy},...unladenMass===void 0?{}:{UnladenMass:unladenMass},...cargoCapacity===void 0?{}:{CargoCapacity:cargoCapacity},...fuelCapacity===void 0?{}:{FuelCapacity:{...fuelCapacity}}}}function captureEach(values,capture){const captured=[];const{length:length}=values;for(let index=0;index<length;index++)captured.push(capture(values[index]));return captured}function captureModule(module){if(module===null||typeof module!=="object")return module;const on=module.On;const priority=module.Priority;const health=module.Health;const value=module.Value;const engineering=module.Engineering;return{Slot:module.Slot,Item:module.Item,...on===void 0?{}:{On:on},...priority===void 0?{}:{Priority:priority},...health===void 0?{}:{Health:health},...value===void 0?{}:{Value:value},...engineering===void 0?{}:{Engineering:captureEngineering(engineering)}}}function captureEngineering(engineering){if(engineering===null||typeof engineering!=="object")return engineering;const experimental=engineering.ExperimentalEffect;const experimentalLocalised=engineering.ExperimentalEffect_Localised;const modifiers=engineering.Modifiers;return{BlueprintName:engineering.BlueprintName,...engineering.Level===void 0?{}:{Level:engineering.Level},...engineering.Quality===void 0?{}:{Quality:engineering.Quality},...experimental===void 0?{}:{ExperimentalEffect:experimental},...experimentalLocalised===void 0?{}:{ExperimentalEffect_Localised:experimentalLocalised},...modifiers===void 0?{}:{Modifiers:Array.isArray(modifiers)?captureEach(modifiers,modifier=>modifier!==null&&typeof modifier==="object"?{...modifier}:modifier):modifiers}}}function normalizeLoadoutEvent(rawEvent){const event=captureLoadoutEvent(rawEvent);requireStringIfPresent(event.Ship,"ShipLoadout.fromLoadout: event.Ship");if(!Array.isArray(event.Modules)){throw new TypeError(`ShipLoadout.fromLoadout: event.Modules must be an array, received ${describeValue(event.Modules)}`)}const modules=/* @__PURE__ */new Map;const slots=/* @__PURE__ */new Set;for(const module of event.Modules){if(module===null||typeof module!=="object"){throw new TypeError(`ShipLoadout.fromLoadout: event.Modules[] must hold module objects, received ${describeValue(module)}`)}requireString(module.Slot,"ShipLoadout.fromLoadout: module.Slot");requireString(module.Item,"ShipLoadout.fromLoadout: module.Item");if(module.Engineering!==void 0){if(module.Engineering===null||typeof module.Engineering!=="object"){throw new TypeError(`ShipLoadout.fromLoadout: module.Engineering must be an object, received ${describeValue(module.Engineering)}`)}requireStringIfPresent(module.Engineering.BlueprintName,"ShipLoadout.fromLoadout: module.Engineering.BlueprintName");requireStringIfPresent(module.Engineering.ExperimentalEffect,"ShipLoadout.fromLoadout: module.Engineering.ExperimentalEffect");if(module.Engineering.Modifiers!==void 0&&!Array.isArray(module.Engineering.Modifiers)){throw new TypeError(`ShipLoadout.fromLoadout: module.Engineering.Modifiers must be an array, received ${describeValue(module.Engineering.Modifiers)}`)}for(const[index,modifier]of(module.Engineering.Modifiers??[]).entries()){if(modifier===null||typeof modifier!=="object"){throw new TypeError(`ShipLoadout.fromLoadout: module.Engineering.Modifiers[${index}] must be an object, received ${describeValue(modifier)}`)}requireString(modifier.Label,`ShipLoadout.fromLoadout: module.Engineering.Modifiers[${index}].Label`)}}const normalizedSlot=module.Slot.toLowerCase();if(slots.has(normalizedSlot)){throw new TypeError(`ShipLoadout.fromLoadout: duplicate slot "${truncate(module.Slot)}"`)}slots.add(normalizedSlot);modules.set(module.Slot,cloneLoadoutModule(module))}const top={};if(event.ShipName!==void 0)top.ShipName=event.ShipName;if(event.ShipIdent!==void 0)top.ShipIdent=event.ShipIdent;if(event.HullValue!==void 0)top.HullValue=event.HullValue;if(event.ModulesValue!==void 0)top.ModulesValue=event.ModulesValue;if(event.Rebuy!==void 0)top.Rebuy=event.Rebuy;if(event.UnladenMass!==void 0)top.UnladenMass=event.UnladenMass;if(event.CargoCapacity!==void 0)top.CargoCapacity=event.CargoCapacity;if(event.FuelCapacity!==void 0)top.FuelCapacity={...event.FuelCapacity};const moduleStats=/* @__PURE__ */new Map;for(const module of modules.values()){const engineering=module.Engineering;const variant=identifyPreEngineeredVariant(module);const variantStats=variant?getPreEngineeredStats(variant):null;if(variantStats)moduleStats.set(module.Slot,cloneModuleStats(variantStats));if(variantStats?.engineeringLocked||typeof engineering?.BlueprintName!=="string"||!isFinalGuardianWeaponEngineering(module.Item,engineering.BlueprintName)){continue}const normalizedBlueprint=normalizeKey(engineering.BlueprintName,"ShipLoadout.fromLoadout: module.Engineering.BlueprintName");const normalizedExperimental=normalizeKey(engineering.ExperimentalEffect,"ShipLoadout.fromLoadout: module.Engineering.ExperimentalEffect");const exact=getPreEngineeredVariants(module.Item).find(candidate=>candidate.blueprint.toLowerCase()===normalizedBlueprint&&candidate.grade===engineering.Level&&candidate.experimental?.toLowerCase()===normalizedExperimental);const stats=exact?getPreEngineeredStats(exact):builtInModuleBySymbol(module.Item,"ShipLoadout.fromLoadout: module.Item");if(stats){moduleStats.set(module.Slot,cloneModuleStats({...stats,engineeringLocked:true}))}}return{shipSymbol:event.Ship,modules:modules,moduleStats:moduleStats,top:top,sourcePurchase:sourcePurchaseFromLoadout(event)}}var SLOT_KEY="ShipLoadout: slotKey";var requireLoadOptions=(scope,options)=>{for(const field of["fuel","cargo"]){const value=options[field];if(value!==void 0&&(!Number.isFinite(value)||value<0)){throw new RangeError(`${scope}: ${field} must be a finite non-negative number`)}}};var LoadoutEditError=class extends TypeError{code;constraint;params;constructor(message,code,params,constraint){super(message);this.code=code;this.params=deepFreeze(Object.fromEntries(Object.entries(params).map(([key,value])=>[key,Array.isArray(value)?[...value]:value])));if(constraint!==void 0)this.constraint=constraint}};var FSD_PREFIX="int_hyperdrive";var BOOSTER_PREFIX="int_guardianfsdbooster";var FUEL_TANK_PREFIX="int_fueltank";var ShipLoadout=class _ShipLoadout{#shipSymbol;#modules;#moduleStats;#primitiveModifiers=/* @__PURE__ */new Map;#top;#sourcePurchase;#version=0;#viewVersion=0;#layoutCache;#calculationCache=null;#validationCache=null;#fittedModuleCache=null;#slotCache=null;constructor(shipSymbol,modules,top,sourcePurchase=null,moduleStats=/* @__PURE__ */new Map){this.#shipSymbol=shipSymbol;this.#modules=modules;this.#top=top;this.#sourcePurchase=sourcePurchase;this.#moduleStats=moduleStats}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})`)}return _ShipLoadout.fromLoadout(entry.data)}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);return new _ShipLoadout(imported.shipSymbol,imported.modules,imported.top,imported.sourcePurchase,imported.moduleStats)}static empty(shipSymbol){const layout=getShipSlots(requireString(shipSymbol,"ShipLoadout.empty: shipSymbol"));if(!layout){throw new TypeError(`ShipLoadout.empty: no slot layout for hull "${truncate(shipSymbol)}"`)}return new _ShipLoadout(layout.symbol,/* @__PURE__ */new Map,{})}static default(shipSymbol){const requested=requireString(shipSymbol,"ShipLoadout.default: shipSymbol");const loadout=getDefaultLoadout(requested);if(!loadout){throw new TypeError(`ShipLoadout.default: no default loadout for hull "${truncate(shipSymbol)}"`)}return new _ShipLoadout(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.unladenMassResult.value}get unladenMassResult(){return this.#top.UnladenMass===void 0?this.#computedUnladenMass():completeResult(this.#top.UnladenMass)}#computedUnladenMass(){return calculateUnladenMass(getShipBySymbol(this.#shipSymbol)?.hullMass??null,this.#calculationModules())}get fuelCapacity(){return this.fuelCapacityResult.value}get fuelCapacityResult(){const cap=this.#top.FuelCapacity;if(cap?.Main!==void 0&&cap.Reserve!==void 0){return completeResult(Object.freeze({main:cap.Main,reserve:cap.Reserve}))}const computed=this.#computedFuelCapacity();if(computed.value===null)return computed;return completeResult(Object.freeze({main:cap?.Main??computed.value.main,reserve:cap?.Reserve??computed.value.reserve}))}get cargoCapacity(){return this.cargoCapacityResult.value}get cargoCapacityResult(){return this.#top.CargoCapacity===void 0?this.#computedCargoCapacity():completeResult(this.#top.CargoCapacity)}#computedCargoCapacity(){return calculateCargoCapacity(this.#calculationModules())}#computedFuelCapacity(){return calculateFuelCapacity(getShipBySymbol(this.#shipSymbol)?.reserveFuelCapacity??null,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 validation(){const cached=this.#validationCache;if(cached!==null&&cached.version===this.#version)return cached.value;const slots=this.#layoutOrNull();const byKey=new Map(slots?.map(slot=>[slot.key.toLowerCase(),slot])??[]);const modules=[...this.#modules.values()].map(module=>{const stats=this.#statsFor(module);const slot=byKey.get(module.Slot.toLowerCase());const builtIn=stats===null&&isNonOutfittingSlot(module.Slot)||isBuiltInHullModule(module);const fitProblem=stats&&slot&&!builtIn?moduleFitProblem(this.#shipSymbol,slot,stats):null;return{slot:module.Slot,symbol:module.Item,known:stats!==null||builtIn,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}}});const value=validateLoadout({shipSymbol:this.#shipSymbol,slots:slots,modules:modules});this.#validationCache={version:this.#version,value:value};return value}slots(kind){let cached=this.#slotCache;if(cached===null||cached.version!==this.#viewVersion){cached={version:this.#viewVersion,value:/* @__PURE__ */new Map};this.#slotCache=cached}const existing=cached.value.get(kind);if(existing!==void 0)return existing;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 immovableReason=slot.key.toLowerCase()==="cargohatch"?"cargoHatch":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}}}));cached.value.set(kind,value);return value}fittedModuleAt(slotKey){const module=this.#fittedModuleFor(slotKey);if(!module)return null;let cached=this.#fittedModuleCache;if(cached===null||cached.version!==this.#viewVersion){cached={version:this.#viewVersion,value:/* @__PURE__ */new Map};this.#fittedModuleCache=cached}const existing=cached.value.get(module.Slot);if(existing!==void 0)return existing;const raw=cloneLoadoutModule(module);const stats=this.#statsFor(module);const effective=effectiveModule(this.#moduleForEffectiveStats(module),stats);const value=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:identifyPreEngineeredVariant(raw)});cached.value.set(module.Slot,value);return value}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(fitted.Slot.toLowerCase()===slot.key.toLowerCase())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=>moduleFitError(this.#shipSymbol,slot,module)===null&&(module.exclusionGroup===void 0||!occupied.has(module.exclusionGroup))&&this.#moduleLimitRegression(slot.key,module,currentLimits,currentStats)===null)}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)}`)}const problem2=moduleFitProblem(this.#shipSymbol,slot,module);if(problem2){if(problem2.constraint==="immutableSlot"){throw new LoadoutEditError(`ShipLoadout.setModule: ${truncate(module.symbol)} → ${truncate(slotKey)}: ${problem2.message}`,"immutableSlot",{slot:slot.key})}throw new LoadoutEditError(`ShipLoadout.setModule: ${truncate(module.symbol)} → ${truncate(slotKey)}: ${problem2.message}`,"incompatibleModule",{...problem2.params,slot:slot.key,symbol:module.symbol,constraint:problem2.constraint},problem2.constraint)}if(module.exclusionGroup!==void 0){const conflict=[...this.#modules.values()].find(fitted=>fitted.Slot.toLowerCase()!==slot.key.toLowerCase()&&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},cloneModuleStats(module));return this}removeModule(slotKey){if(requireString(slotKey,SLOT_KEY).toLowerCase()==="cargohatch"){throw new LoadoutEditError("ShipLoadout.removeModule: the cargoHatch slot cannot be changed","immutableSlot",{slot:"CargoHatch"})}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,fdname,options){requireString(fdname,"ShipLoadout.applyBlueprint: fdname");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.experimental??void 0;requireStringIfPresent(wantedExperimental,"ShipLoadout.applyBlueprint: options.experimental");const module=this.#fittedModuleFor(slotKey);if(!module){throw new RangeError(`ShipLoadout.applyBlueprint: slot "${truncate(slotKey)}" is empty`)}const stats=this.#statsFor(module);if(!stats){throw new TypeError(`ShipLoadout.applyBlueprint: no stats for module "${truncate(module.Item)}"`)}const recipe=resolveBlueprintForModule(module.Item,fdname);const named=recipe===fdname?`"${truncate(fdname)}"`:`"${truncate(fdname)}" (${truncate(recipe)} on this module)`;if(isDecorativeModification(recipe)){throw new TypeError(`ShipLoadout.applyBlueprint: ${named} is a decorative modification, not a blueprint; use applyDecorativeModification to fit its fixed stat changes`)}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(stats.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,fdname)){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 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:fdname,Level:wantedGrade,Quality:quality,...wantedExperimental!==void 0?{ExperimentalEffect:wantedExperimental}:{},Modifiers:modifiers};this.#replaceModule(module.Slot,{...module,Engineering:engineering},void 0,primitiveModifiers);return this}applyDecorativeModification(slotKey,fdname){requireString(fdname,"ShipLoadout.applyDecorativeModification: fdname");const module=this.#fittedModuleFor(slotKey);if(!module){throw new RangeError(`ShipLoadout.applyDecorativeModification: slot "${truncate(slotKey)}" is empty`)}const modification=getDecorativeModification(fdname);if(!modification){throw new RangeError(`ShipLoadout.applyDecorativeModification: unknown decorative modification "${truncate(fdname)}"`)}const stats=this.#statsFor(module);if(!stats){throw new TypeError(`ShipLoadout.applyDecorativeModification: no stats for module "${truncate(module.Item)}"`)}if(stats.engineeringLocked){throw new TypeError(`ShipLoadout.applyDecorativeModification: module "${truncate(module.Item)}" is a final pre-engineered article and accepts no further modification`)}const{modifiers:modifiers,primitiveModifiers:primitiveModifiers,unresolved:unresolved}=resolveDecorativeModificationStats(stats,modification);if(unresolved.length>0){throw new TypeError(`ShipLoadout.applyDecorativeModification: cannot compute decorative modification "${truncate(fdname)}" for module "${truncate(module.Item)}"; missing base stats for ${unresolved.join(", ")}`)}const engineering={BlueprintName:fdname,Modifiers:modifiers};this.#replaceModule(module.Slot,{...module,Engineering:engineering},void 0,primitiveModifiers);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 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)}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.#viewVersion++}toLoadoutEvent(options={}){const hull=getShipBySymbol(this.#shipSymbol);const unladenMass=this.#computedUnladenMass().value;const cargoCapacity=this.#computedCargoCapacity().value;const fuel=this.#computedFuelCapacity().value;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,...options.moduleOrder==="slots"?{layout:this.#layoutOrNull()}:{},sourcePurchase:this.#sourcePurchase,retailHullValue:hull?.hullCost??null,unladenMass:unladenMass,cargoCapacity:cargoCapacity,fuelCapacity:fuel,maxJumpRange:maxJumpRange,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){if(unladenMass===null)return null;let drive;try{drive=this.#resolveDrive()}catch{return null}if(drive===null)return null;const tank=this.#computedFuelCapacity().value;if(tank===null)return null;return singleJumpRange(unladenMass,Math.min(tank.main,drive.maxFuel),drive)}get frameShiftDrive(){const drive=this.#resolveDrive();if(drive===null)throw new TypeError("ShipLoadout: build has no frame shift drive");return drive}frameShiftDriveMassFactor(options={}){requireLoadOptions("ShipLoadout.frameShiftDriveMassFactor",options);const fuel=options.fuel??this.#requireFuelCapacity().main;return frameShiftDriveMassFactor(this.#requireMass(options.cargo??0),fuel,this.frameShiftDrive)}maxJumpRange(){const fsd=this.frameShiftDrive;const fuel=Math.min(this.#requireFuelCapacity().main,fsd.maxFuel);return singleJumpRange(this.#requireMass(0),fuel,fsd)}jumpRange(options={}){requireLoadOptions("ShipLoadout.jumpRange",options);const fsd=this.frameShiftDrive;const fuel=options.fuel??this.#requireFuelCapacity().main;return singleJumpRange(this.#requireMass(options.cargo??0),fuel,fsd)}ladenJumpRange(){return this.jumpRange({cargo:this.#requireCargoCapacity()})}fuelPerJump(distance,options={}){requireLoadOptions("ShipLoadout.fuelPerJump",options);const fsd=this.frameShiftDrive;const fuel=options.fuel??this.#requireFuelCapacity().main;return fuelPerJump(distance,this.#requireMass(options.cargo??0),fuel,fsd)}totalRange(options={}){requireLoadOptions("ShipLoadout.totalRange",options);return totalRange(this.#requireMass(options.cargo??0),this.#requireFuelCapacity().main,this.frameShiftDrive)}jumpRangeSummary(){const cargo=this.#requireCargoCapacity();return{max:this.maxJumpRange(),unladen:this.jumpRange(),laden:this.jumpRange({cargo:cargo}),totalUnladen:this.totalRange(),totalLaden:this.totalRange({cargo:cargo})}}powerBudget(){const modules=[...this.#modules.values()];const consumers=[];for(const module of modules){const consumer=powerConsumerFor(module,this.#statsFor(module));if(consumer)consumers.push(consumer)}return powerBudget(powerAvailable(modules,module=>this.#statsFor(module)),consumers)}heatMetrics(){const input=heatInputFor(this.#shipSymbol,this.#modulesForEffectiveStats(),this.powerBudget(),module=>this.#statsFor(module));return input?heatMetrics(input):null}mobilityMetrics(options={}){const enginesPips=options.enginesPips??4;if(!Number.isFinite(enginesPips)||enginesPips<0||enginesPips>4){throw new RangeError("ShipLoadout.mobilityMetrics: enginesPips must be a finite number from 0 to 4")}requireLoadOptions("ShipLoadout.mobilityMetrics",options);const input=mobilityInputFor(this.#shipSymbol,[...this.#modules.values()],()=>{const main=options.fuel??this.#top.FuelCapacity?.Main??this.#requireFuelCapacity().main;return this.#requireMass(options.cargo??0)+main},enginesPips,module=>this.#statsFor(module));return input?mobilityMetrics(input):null}shieldMetrics(options={}){const input=shieldInputFor(this.#shipSymbol,[...this.#modules.values()],options.systemsPips??0,module=>this.#statsFor(module));if(!input.generator)return null;return shieldMetrics(input)}shieldRecovery(options={}){const systemsPips=options.systemsPips??4;if(!Number.isFinite(systemsPips)||systemsPips<0||systemsPips>4){throw new RangeError("ShipLoadout.shieldRecovery: systemsPips must be a finite number from 0 to 4")}const input=shieldRecoveryInputFor(this.#shipSymbol,[...this.#modules.values()],systemsPips,module=>this.#statsFor(module));return input?shieldRecovery(input):null}cellBanks(){const banks=cellBankInputsFor([...this.#modules.values()],module=>this.#statsFor(module));const layout=this.#layoutOrNull();if(layout){const order=new Map(layout.map((slot,index)=>[slot.key.toLowerCase(),index]));banks.sort((left,right)=>(order.get(left.slot.toLowerCase())??Number.MAX_SAFE_INTEGER)-(order.get(right.slot.toLowerCase())??Number.MAX_SAFE_INTEGER))}return cellBankSummary(banks)}retailCredits(){const hull=getShipBySymbol(this.#shipSymbol)?.hullCost??null;let modules=0;const unpriced=[];for(const module of this.#modules.values()){const stats=this.#statsFor(module);if(stats?.cost!==void 0){modules+=stats.cost}else if(stats!==null||!isNonOutfittingSlot(module.Slot)&&!isBuiltInHullModule(module)){unpriced.push({slot:module.Slot,symbol:module.Item})}}return deepFreeze({hull:hull,modules:modules,rebuy:hull===null?null:Math.trunc((hull+modules)*.05),unpriced:unpriced})}armourMetrics(){return armourMetrics(armourInputFor(this.#shipSymbol,[...this.#modules.values()],module=>this.#statsFor(module)))}weaponMetrics(){const weapons=[];for(const module of this.#modules.values()){const record=this.#statsFor(module);const stats=weaponStatsFor(this.#moduleForEffectiveStats(module),record);if(!stats)continue;weapons.push({slot:module.Slot,symbol:module.Item,name:record?.name??module.Item,enabled:module.On!==false,metrics:weaponMetrics(stats),ammunition:ammunitionCapacity(stats)})}return{weapons:weapons,total:sumWeaponMetrics(weapons.filter(weapon=>weapon.enabled).map(weapon=>weapon.metrics))}}weaponsCapacitorMetrics(options={}){const weaponsPips=options.weaponsPips??4;if(!Number.isFinite(weaponsPips)||weaponsPips<0||weaponsPips>4){throw new RangeError("ShipLoadout.weaponsCapacitorMetrics: weaponsPips must be a finite number from 0 to 4")}return weaponsCapacitorMetrics(weaponsCapacitorInputFor(this.#modulesForEffectiveStats(),weaponsPips,this.powerBudget(),module=>this.#statsFor(module)))}#layoutOrNull(){if(this.#layoutCache===void 0){const layout=getShipSlots(this.#shipSymbol);this.#layoutCache=layout===null?null:Object.freeze(enumerateSlots(layout))}return this.#layoutCache}#invalidate(){this.#version++;this.#viewVersion++}#layout(){const layout=this.#layoutOrNull();if(!layout){throw new TypeError(`ShipLoadout: no slot layout for hull "${truncate(this.#shipSymbol)}"`)}return layout}#requireSlot(slotKey){const wanted=requireString(slotKey,SLOT_KEY).toLowerCase();const slot=this.#layout().find(s=>s.key.toLowerCase()===wanted);if(!slot){throw new RangeError(`ShipLoadout: hull "${truncate(this.#shipSymbol)}" has no slot "${truncate(slotKey)}"`)}return slot}#fittedKey(slotKey){return matchingKeyIn(this.#modules,requireString(slotKey,SLOT_KEY))}#fittedModuleFor(slotKey){const key=this.#fittedKey(slotKey);return key===null?void 0:this.#modules.get(key)}#require(result,what){if(result.value===null){throw new TypeError(`ShipLoadout: cannot determine ${what} (${result.issues.map(i=>i.message).join("; ")})`)}return result.value}#requireMass(cargo){return this.#require(this.unladenMassResult,"mass")+cargo}#requireFuelCapacity(){return this.#require(this.fuelCapacityResult,"fuel capacity")}#requireCargoCapacity(){return this.#require(this.cargoCapacityResult,"cargo capacity")}#calculationModules(){const cached=this.#calculationCache;if(cached!==null&&cached.version===this.#version)return cached.value;const value=this.#resolveCalculationModules();this.#calculationCache={version:this.#version,value:value};return value}#resolveCalculationModules(){return[...this.#modules.values()].map(module=>{const stats=this.#statsFor(module);const symbol=module.Item.toLowerCase();const parsedSlot=parseSlotName(module.Slot);const unresolvedOutfitting=stats===null&&!isNonOutfittingSlot(module.Slot)&&!isBuiltInHullModule(module);const isCargoRack=stats?.cargoCapacity!==void 0||stats?.engineeringGroup==="cargoRacks"||symbol.includes("cargorack");const isFuelTank=stats?.fuelCapacity!==void 0||stats?.slot==="fuelTank"||symbol.startsWith(FUEL_TANK_PREFIX);const mayCarryCapacity=unresolvedOutfitting&&(parsedSlot===null||parsedSlot.kind==="optional");const mayCarryFuel=mayCarryCapacity||unresolvedOutfitting&&parsedSlot?.kind==="core"&&parsedSlot.core==="fuelTank";return{slot:module.Slot,symbol:module.Item,mass:this.#moduleMass(module),...isCargoRack||mayCarryCapacity?{cargoCapacity:isCargoRack?this.#moduleCapacity(module,"CargoCapacity","cargoCapacity"):null}:{},...isFuelTank||mayCarryFuel?{fuelCapacity:isFuelTank?this.#moduleCapacity(module,"FuelCapacity","fuelCapacity"):null}:{}}})}#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)}#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.#invalidate()}#adjustImportedFigures(previous,next,nextStats){const previousMass=this.#moduleMass(previous);const nextMass=this.#moduleMass(next,nextStats);if(this.#top.UnladenMass!==void 0){if(previousMass===null||nextMass===null)delete this.#top.UnladenMass;else this.#top.UnladenMass+=nextMass-previousMass}const previousCargo=this.#moduleCapacity(previous,"CargoCapacity","cargoCapacity");const nextCargo=this.#moduleCapacity(next,"CargoCapacity","cargoCapacity",nextStats);if(this.#top.CargoCapacity!==void 0){if(previousCargo===null||nextCargo===null)delete this.#top.CargoCapacity;else this.#top.CargoCapacity+=nextCargo-previousCargo}const previousFuel=this.#moduleCapacity(previous,"FuelCapacity","fuelCapacity");const nextFuel=this.#moduleCapacity(next,"FuelCapacity","fuelCapacity",nextStats);if(this.#top.FuelCapacity?.Main!==void 0){const reserve=this.#top.FuelCapacity.Reserve;if(previousFuel===null||nextFuel===null){if(reserve===void 0)delete this.#top.FuelCapacity;else this.#top.FuelCapacity={Reserve:reserve}}else{this.#top.FuelCapacity={Main:this.#top.FuelCapacity.Main+nextFuel-previousFuel,...reserve===void 0?{}:{Reserve:reserve}}}}if(normalizeKey(previous?.Item,FITTED_ITEM)===normalizeKey(next?.Item,FITTED_ITEM)){return}delete this.#top.ModulesValue;delete this.#top.Rebuy}#moduleMass(module,statsOverride){if(module===null)return 0;const modified=getLoadoutModifier(module,"Mass");if(modified!==null)return modified;const stats=statsOverride??this.#statsFor(module);if(stats?.mass!==void 0)return stats.mass;if(isBuiltInHullModule(module))return 0;return stats===null&&isNonOutfittingSlot(module.Slot)?0:null}#moduleCapacity(module,modifierLabel,field,statsOverride){if(module===null)return 0;const modified=getLoadoutModifier(module,modifierLabel);if(modified!==null)return modified;const stats=statsOverride??this.#statsFor(module);if(stats?.[field]!==void 0)return stats[field];const symbol=module.Item.toLowerCase();const isFuelTank=stats?.slot?stats.slot==="fuelTank":symbol.startsWith(FUEL_TANK_PREFIX);const shouldCarryCapacity=field==="cargoCapacity"?symbol.includes("cargorack"):isFuelTank;return shouldCarryCapacity?null:0}#resolveDrive(){let fsdModule;for(const m of this.#modules.values()){const stats=this.#statsFor(m);const isDrive=stats?.slot?stats.slot==="frameShiftDrive":m.Item.toLowerCase().startsWith(FSD_PREFIX);if(isDrive){fsdModule=m;break}}if(!fsdModule)return null;const base=this.#statsFor(fsdModule);if(!base||base.fuelMul===void 0||base.fuelPower===void 0){throw new TypeError(`ShipLoadout: no jump constants in the stats catalogue for frame shift drive "${truncate(fsdModule.Item)}"`)}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: frame shift drive "${truncate(fsdModule.Item)}" has no ${missing.join(" or ")} in the stats catalogue`)}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"&&!m.Item.toLowerCase().startsWith(BOOSTER_PREFIX)){continue}if(m.On===false)continue;if(stats?.jumpBoost===void 0){throw new TypeError(`ShipLoadout: FSD booster "${truncate(m.Item)}" has no jumpBoost in the stats catalogue`)}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("ModularCargoBayDoor","ShipLoadout: built-in module"):null}};export{LoadoutEditError,ShipLoadout};//# sourceMappingURL=chunk-43LFDZ4T.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ships/internal/loadout-metrics.ts","../src/ships/internal/loadout-views.ts","../src/ships/internal/loadout-fitting.ts","../src/ships/internal/loadout-export.ts","../src/ships/internal/loadout-import.ts","../src/ships/ship-loadout.ts"],"names":["shieldRecovery","cellBankSummary","shieldMetrics","getShipSlots","getShipBySymbol","getShipByName","parseSlef","toSlef","stringifySlef","getLoadoutModifier","enumerateSlots","parseSlotName","SLOT_RESTRICTION_LABELS","sourcePurchaseFromLoadout","getSourceModuleValue","weaponsCapacitorMetrics","powerBudget","identifyPreEngineeredVariant","getPreEngineeredStats","scaleDamageComponents","weaponMetrics","sumWeaponMetrics","combinedRateOfFire","singleJumpRange","frameShiftDriveMassFactor","fuelPerJump","totalRange","completeResult","calculateUnladenMass","calculateCargoCapacity","calculateFuelCapacity","validateLoadout","mobilityMetrics","calculateModuleLimits","getDefaultLoadout","heatMetrics","ammunitionCapacity","armourMetrics","isNonOutfittingSlot","isBuiltInHullModule","cloneLoadoutModule","cloneModuleStats","availableBlueprintsFor","availableExperimentalsFor","blueprintAvailableFor","blueprintRoutesFor","experimentalAvailableFor","primitiveEngineeringInputsFor","missingBaseLabels","journalModifiersFor","resolveDecorativeModificationStats","matchingKeyIn","FITTED_ITEM","isFinalGuardianWeaponEngineering","builtInModuleBySymbol","getBulkheadsForShip","getPreEngineeredVariants","ALL_MODULES","CORE_MODULES","getExperimentalEffect","baseStats","computeModifiers","labelsForDamageType","scaleForLabel","fieldForLabel","labelsForField","capabilityValueForLabel","damageTypeForLabel","resolveBlueprintForModule","getExperimentalsForModule","getBlueprintGrade","isDecorativeModification","getDecorativeModification","normalizeKey","truncate","describeValue","requireString","requireStringIfPresent","deepFreeze","PREFIX","powerPlant","thrusters","frameShiftDrive","powerDistributor","shieldGenerator","shieldCellBank","shieldBooster","shieldReinforcement","hullReinforcement","moduleReinforcement","startsWithAny","symbol","prefixes","some","prefix","toLowerCase","startsWith","isPowerDistributor","module","stats","slot","Item","isEnabled","On","priorityOf","Priority","effectiveStat","field","stated","statedModifier","base","label","modified","effectiveCapability","Engineering","Modifiers","modifier","Label","effectiveDamageDistribution","fromEffect","ExperimentalEffect","damageDistribution","distribution","resolved","Value","type","convertsDamage","modifierRatio","effective","relatedStat","ratio","effectiveModule","merged","fields","Set","Object","keys","add","key","capability","value","engineeringGroup","massRatio","minMass","maxMass","performanceRatio","minMultiplier","maxMultiplier","category","normalizeEffectiveWeapon","damageComponents","damage","powerConsumerFor","draw","parsedSlot","Slot","mounted","deployedOnly","alwaysPowered","kind","common","priority","enabled","inherentlyPassiveSlot","core","drawUnknown","powerAvailable","modules","statsFor","isPlant","mapResistanceFields","read","kineticResistance","thermalResistance","explosiveResistance","causticResistance","resistancesOf","shieldInputFor","shipSymbol","systemsPips","hull","generator","boosters","reinforcement","strengthRatio","optMass","Math","max","optMultiplier","push","shieldBoost","hullMass","baseShieldStrength","mobilityInputFor","mass","enginesPips","isThruster","optSpeedMultiplier","speedCurve","minSpeedMultiplier","maxSpeedMultiplier","optRotationMultiplier","rotationCurve","minRotationMultiplier","maxRotationMultiplier","minimumSpeed","maximumSpeed","boost","minPitch","pitch","minRoll","roll","minYaw","yaw","shieldRecoveryInputFor","distributor","generatorStats","distributorStats","strength","regenRate","brokenRegenRate","distributorDraw","systemsCapacity","systemsRecharge","weaponsCapacitorInputFor","weaponsPips","budget","weaponsCapacity","weaponsRecharge","sustainedEnergyPerSecond","poweredStates","deployed","weapon","weaponStatsFor","heatInputFor","heatEfficiency","thrusterHeatRate","deployedThrusterHeatRate","fsdHeatRate","weapons","running","heat","retracted","heatPerSecond","sustainedHeatPerSecond","heatCapacity","heatDissipation","retractedPowerDraw","poweredDraw","deployedPowerDraw","unknownDraws","map","consumer","state","powered","bands","reduce","total","band","min","length","poweredRetracted","poweredDeployed","cellBankInputsFor","banks","ammunition","reinforcementRate","shieldBankReinforcement","cells","spinUp","shieldBankSpinUp","duration","shieldBankDuration","shieldBankHeat","stockBulkhead","variants","name","find","v","endsWith","armourInputFor","reinforcements","moduleReinforcements","bulkhead","hullBoost","moduleProtection","integrity","stock","baseArmour","WEAPON_FIELDS","projectileRange","burstAdjustedRateOfFire","touched","rate","rateOfFire","statedDamagePerSecond","firingFactor","Number","roundsPerShot","maximumRange","falloffRange","CORE_NAMES","lifeSupport","sensors","fuelTank","RESTRICTED_OPTIONAL_NAMES","military","cargo","limpetController","vesselHangar","passenger","trailingDigits","start","code","charCodeAt","slice","loadoutSlotName","match","exec","restriction","numbered","optional","size","MILITARY_PREFIXES","MINING_PREFIXES","CARGO_PREFIXES","RESTRICTED_SLOT_PREFIXES","mining","planetaryApproachSuite","problem","constraint","message","params","restrictionProblem","moduleSlotProblem","required","restrictedToSlot","moduleFitProblem","ship","armourHull","armourShipName","armourShipSymbol","shipName","restricted","restrictedToShips","allowedShipNames","labels","index","join","allowedShipSymbols","wrongMount","moduleSlot","requiredCore","isFuelTank","class","moduleClass","slotSize","moduleFitError","REBUY_FRACTION","exportLoadoutEvent","input","options","fromSource","credits","source","sourcePurchase","totals","sourceTotalsHold","hullValue","retailHullValue","modulesValue","computedModulesValue","rebuy","trunc","event","Ship","ShipName","shipIdent","ShipIdent","HullValue","ModulesValue","unladenMass","UnladenMass","cargoCapacity","CargoCapacity","maxJumpRange","MaxJumpRange","fuelCapacity","FuelCapacity","Main","main","Reserve","reserve","Rebuy","Modules","exportModules","ordered","moduleOrder","slotOrderedModules","layout","values","on","explicitPower","sourceModuleValue","moduleValue","Health","TypeError","remaining","Map","get","delete","sum","cost","SOURCE_ITEM","entry","item","moduleValues","fitted","captureLoadoutEvent","Array","isArray","captureEach","captureModule","capture","captured","health","engineering","captureEngineering","experimental","experimentalLocalised","ExperimentalEffect_Localised","modifiers","BlueprintName","Level","Quality","normalizeLoadoutEvent","rawEvent","slots","entries","normalizedSlot","has","set","top","moduleStats","variant","variantStats","engineeringLocked","normalizedBlueprint","normalizedExperimental","exact","candidate","blueprint","grade","SLOT_KEY","requireLoadOptions","scope","isFinite","RangeError","LoadoutEditError","constructor","super","this","fromEntries","FSD_PREFIX","BOOSTER_PREFIX","FUEL_TANK_PREFIX","ShipLoadout","_ShipLoadout","primitiveModifiers","version","viewVersion","layoutCache","calculationCache","validationCache","fittedModuleCache","slotCache","fromSlef","fromLoadout","data","imported","empty","requested","loadout","unladenMassResult","computedUnladenMass","calculationModules","fuelCapacityResult","cap","freeze","computed","computedFuelCapacity","cargoCapacityResult","computedCargoCapacity","reserveFuelCapacity","validation","cached","layoutOrNull","byKey","builtIn","fitProblem","known","requiresKnownSlot","fitError","fitConstraint","fitParams","exclusionGroup","limitGroup","limitIncrease","existing","filter","currentLimits","moduleLimits","moduleStatsAt","immovableReason","moduleLimitRegression","fittedModuleAt","removable","slotKey","fittedModuleFor","raw","moduleForEffectiveStats","effectiveStats","preEngineeredVariant","fittedModules","flatMap","availableBlueprints","availableExperimentalEffects","modulesForSlot","requireSlot","occupied","group","currentStats","setModule","conflict","previousSlot","previousSymbol","limitProblem","count","limit","fittedKey","replaceModule","removeModule","applyBlueprint","fdname","wantedGrade","wantedQuality","quality","wantedExperimental","recipe","named","isInteger","offered","route","canonical","missing","features","damageModifier","OriginalValue","applyDecorativeModification","modification","unresolved","clearEngineering","bare","setModuleEnabled","patchModule","setModulePriority","patch","toLoadoutEvent","fuel","exportableJumpRange","hullCost","header","toSlefString","indent","drive","resolveDrive","tank","maxFuel","requireFuelCapacity","requireMass","fsd","jumpRange","ladenJumpRange","requireCargoCapacity","distance","jumpRangeSummary","unladen","laden","totalUnladen","totalLaden","consumers","modulesForEffectiveStats","cellBanks","order","sort","left","right","MAX_SAFE_INTEGER","retailCredits","unpriced","record","metrics","invalidate","wanted","s","require","result","what","issues","i","resolveCalculationModules","unresolvedOutfitting","isCargoRack","includes","mayCarryCapacity","mayCarryFuel","moduleMass","moduleCapacity","replacement","current","previous","usage","increase","amount","baseLimit","excess","replacementStats","adjustImportedFigures","next","nextStats","previousMass","nextMass","previousCargo","nextCargo","previousFuel","nextFuel","statsOverride","modifierLabel","shouldCarryCapacity","fsdModule","m","isDrive","fuelMul","fuelPower","jumpBoost","resolveJumpBoost"],"mappings":"O,m/EAiEA,IAAM+E,OAAS,CACXC,WAAY,CAAC,iBAAkB,0BAC/BC,UAAW,CAAC,aAAc,6BAC1BC,gBAAiB,CAAC,kBAClBC,iBAAkB,CAAC,uBAAwB,gCAC3CC,gBAAiB,CAAC,uBAClBC,eAAgB,CAAC,sBACjBC,cAAe,CAAC,qBAChBC,oBAAqB,CAAC,mCACtBC,kBAAmB,CACf,wBACA,gCACA,kCAEJC,oBAAqB,CAAC,0BAA2B,oCAGrD,IAAMC,cAAgB,CAACC,OAAgBC,WACnCA,SAASC,KAAMC,QAAWH,OAAOI,cAAcC,WAAWF,SAG9D,SAASG,mBAAmBC,OAAuBC,OAC/C,OAAOA,OAAOC,KACRD,MAAMC,OAAS,mBACfV,cAAcQ,OAAOG,KAAMtB,OAAOI,iBAC5C,CAG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MAAO,OAAOA,MAIlB,OAAO5D,oBAAoB2D,QACrB5C,sBAAsB,sBAAuB,gCAC7C,IACV,UACJoZ,iBAAAQ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function fixedModifierFeatures(modifiers){return modifiers.map(modifier=>({label:modifier.label,method:modifier.method,min:modifier.value,max:modifier.value}))}export{fixedModifierFeatures};//# sourceMappingURL=chunk-4TXQWLIQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ships/internal/fixed-modifier-features.ts"],"names":["fixedModifierFeatures","modifiers","map","modifier","label","method","min","value","max"],"mappings":"AAgBO,SAASA,sBACZC,WAEA,OAAOA,UAAUC,IAAKC,WAAA,CAClBC,MAAOD,SAASC,MAChBC,OAAQF,SAASE,OACjBC,IAAKH,SAASI,MACdC,IAAKL,SAASI,QAEtB,QAAAP"}
|