{
  "schemaVersion": 1,
  "slug": "luggage-weight-calculator",
  "category": "travel",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "5342389bb61b7cae60601a011724f427e15dbecd1fee85d01c26b76e0c72c2ed",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/luggage-weight-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "total = bag × bagCount + items; kg = total × 0.45359237; overage = max(0, total/bagCount − limit); fee = overage > 0 ? overageFee × bagCount : 0",
    "vars": [
      [
        "bag",
        "Empty bag weight per piece (lb)"
      ],
      [
        "items",
        "Total contents weight across bags (lb)"
      ],
      [
        "bagCount",
        "Number of bags"
      ],
      [
        "total",
        "Combined weight (lb)"
      ],
      [
        "limit",
        "Illustrative limit per bag (lb)"
      ],
      [
        "overage",
        "Average excess per bag (lb)"
      ],
      [
        "overageFee",
        "Fee per overweight checked bag (USD)"
      ]
    ],
    "note": "Contents are distributed evenly to estimate average bag weight. Estimated checked-bag fees assume every bag has a similar load; actual fees depend on each bag and current airline rules. Presets are examples; money inputs and fees are USD."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const bags=Math.max(1,Math.min(10,Math.round(bagCount))); const totalChecked=bagWeight*bags+itemsWeight; const averageBagWeight=totalChecked/bags; const limits={us:50,international:50.7,europe:44.1,premium:70.5,carryOn:22}; const limit=limits[airline]||50; const overage=Math.max(0,averageBagWeight-limit); const carryOnMoveWeight=airline==='carryOn'?Math.min(overage,carryOnWeight):0; return {totalChecked,totalCheckedKg:totalChecked*0.45359237,averageBagWeight,limit,overage,fee:overage>0?overageFee*bags:0,carryOnMoveWeight};",
    "inputs": [
      {
        "name": "bagWeight",
        "type": "number",
        "default": 8,
        "min": 0,
        "max": 30,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "itemsWeight",
        "type": "number",
        "default": 30,
        "min": 0,
        "max": 300,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "carryOnWeight",
        "type": "number",
        "default": 12,
        "min": 0,
        "max": 100,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "bagCount",
        "type": "number",
        "default": 1,
        "min": 1,
        "max": 10,
        "step": 1
      },
      {
        "name": "airline",
        "type": "select",
        "default": "us",
        "options": [
          {
            "value": "us"
          },
          {
            "value": "international"
          },
          {
            "value": "europe"
          },
          {
            "value": "premium"
          },
          {
            "value": "carryOn"
          }
        ]
      },
      {
        "name": "overageFee",
        "type": "number",
        "default": 100,
        "min": 0,
        "max": 500,
        "step": 10,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "totalChecked",
        "precision": 2,
        "unit": "lb"
      },
      {
        "name": "totalCheckedKg",
        "precision": 2,
        "unit": "kg"
      },
      {
        "name": "limit",
        "precision": 1,
        "unit": "lb"
      },
      {
        "name": "overage",
        "precision": 2,
        "unit": "lb"
      },
      {
        "name": "fee",
        "precision": 0,
        "unit": "$"
      },
      {
        "name": "averageBagWeight",
        "precision": 1,
        "unit": "lb"
      },
      {
        "name": "carryOnMoveWeight",
        "precision": 1,
        "unit": "lb"
      }
    ],
    "interpret": null
  }
}
