(function(global, factory) {
  typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.PQWebComponents = {}));
})(this, function(exports2) {
  "use strict";/**
 * physical-quantity v1.3.0
 * A web component bundle to represent physical quantities with automated unit conversion.
 * @license MIT
 * @author E3d - Don Wen <don.wen@calcslive.com>
 */

  const meta = {
    warning: "DO NOT EDIT — generated by units-export.py from Excel master source. Regenerate: python .e3d/chat-logs/data/units-export.py --uom-data",
    version: "2.0.29",
    generated: {
      timestamp: "2026-04-01T22:32:36.380733",
      source: {
        fileName: "constants_categories_units_full.xlsm",
        lastModified: "2026-04-01T22:16:43.302987"
      }
    },
    stats: {
      totalCategories: 67,
      totalUnits: 571
    }
  };
  const categories = [
    {
      id: "900",
      description: "Unitless"
    },
    {
      id: "901",
      description: "Length"
    },
    {
      id: "902",
      description: "Mass"
    },
    {
      id: "903",
      description: "Time"
    },
    {
      id: "904",
      description: "Electric Current"
    },
    {
      id: "905",
      description: "Temperature"
    },
    {
      id: "906",
      description: "Amount of Substance"
    },
    {
      id: "907",
      description: "Luminous Intensity"
    },
    {
      id: "100",
      description: "Acceleration"
    },
    {
      id: "105",
      description: "Gravitational Constant"
    },
    {
      id: "110",
      description: "Angle"
    },
    {
      id: "115",
      description: "Velocity Angular"
    },
    {
      id: "120",
      description: "Acceleration Angular"
    },
    {
      id: "125",
      description: "Illuminance"
    },
    {
      id: "130",
      description: "Frequency"
    },
    {
      id: "135",
      description: "Area"
    },
    {
      id: "140",
      description: "Volume / Section Modulus"
    },
    {
      id: "145",
      description: "Polar Moment of Inertia"
    },
    {
      id: "150",
      description: "Moment of Inertia"
    },
    {
      id: "155",
      description: "Force"
    },
    {
      id: "160",
      description: "Solid Angle"
    },
    {
      id: "165",
      description: "BMI-Body Mass Index/Ballistic Coefficient"
    },
    {
      id: "170",
      description: "Density"
    },
    {
      id: "171",
      description: "Linear Mass Density"
    },
    {
      id: "175",
      description: "Energy"
    },
    {
      id: "180",
      description: "Power"
    },
    {
      id: "181",
      description: "Apparent Power"
    },
    {
      id: "182",
      description: "Reactive Power"
    },
    {
      id: "185",
      description: "Torque, Moment of Force"
    },
    {
      id: "190",
      description: "Pressure/Stress/ShearModulus"
    },
    {
      id: "195",
      description: "Pressure Drop per Unit Length"
    },
    {
      id: "200",
      description: "Uniformly Distributed (Uniform Line) Load/Stiffness of Linear Spring"
    },
    {
      id: "205",
      description: "Stiffness of Rotary Spring"
    },
    {
      id: "210",
      description: "Flow Rate (Volume)"
    },
    {
      id: "215",
      description: "Flow Rate (Mass)"
    },
    {
      id: "220",
      description: "Speed / Velocity (Linear)"
    },
    {
      id: "224",
      description: "Energy per Unit Area | Heat Flux"
    },
    {
      id: "225",
      description: "Energy per Unit Volume | Volumetric Energy Density | Fuel Heat Value (Volume)"
    },
    {
      id: "230",
      description: "Energy per Unit Mass | Gravimetric Energy Density |Fuel Heat Value (Mass)"
    },
    {
      id: "235",
      description: "Mass Heat Capacity"
    },
    {
      id: "240",
      description: "Viscosity - Absolute/Dynamic(μ)"
    },
    {
      id: "245",
      description: "Viscosity - Kinematic"
    },
    {
      id: "249",
      description: "Temperature Difference"
    },
    {
      id: "250",
      description: "Linear Thermal Expansion Coefficient"
    },
    {
      id: "255",
      description: "Thermal Conductivity"
    },
    {
      id: "260",
      description: "Electrical Charge"
    },
    {
      id: "265",
      description: "Electrical Potential Difference (Voltage)"
    },
    {
      id: "270",
      description: "Electrical Resistance(Impedance)"
    },
    {
      id: "275",
      description: "Electrical Capacitance"
    },
    {
      id: "280",
      description: "Electrical Inductance"
    },
    {
      id: "285",
      description: "Electrical Conductance"
    },
    {
      id: "290",
      description: "Magnetic Flux"
    },
    {
      id: "295",
      description: "Luminous Flux"
    },
    {
      id: "300",
      description: "Magnetic Flux Density"
    },
    {
      id: "305",
      description: "Katalytic Activity"
    },
    {
      id: "310",
      description: "Radioactivity"
    },
    {
      id: "315",
      description: "Absorbed Dose of Ionizing Radiation"
    },
    {
      id: "320",
      description: "Equivalent Dose of Ionizing Radiation"
    },
    {
      id: "325",
      description: "Volumetric Displacement"
    },
    {
      id: "330",
      description: "Fuel Economy"
    },
    {
      id: "335",
      description: "Fuel Consumption"
    },
    {
      id: "340",
      description: "New Energy Economy (MPGe)"
    },
    {
      id: "345",
      description: "New Energy Consumption"
    },
    {
      id: "355",
      description: "Currency"
    },
    {
      id: "360",
      description: "Impulse / Momentum"
    },
    {
      id: "365",
      description: "Digital Storage"
    },
    {
      id: "370",
      description: "Data Transfer Rate"
    }
  ];
  const units = [
    {
      unit: "ul",
      categoryId: "900",
      c0: 1
    },
    {
      unit: "ea",
      categoryId: "900",
      c0: 1
    },
    {
      unit: "%",
      categoryId: "900",
      c0: 0.01
    },
    {
      unit: "‰",
      categoryId: "900",
      c0: 1e-3
    },
    {
      unit: "m",
      categoryId: "901",
      c0: 1
    },
    {
      unit: "cm",
      categoryId: "901",
      c0: 0.01
    },
    {
      unit: "mm",
      categoryId: "901",
      c0: 1e-3
    },
    {
      unit: "in",
      categoryId: "901",
      c0: 0.0254
    },
    {
      unit: "nm",
      categoryId: "901",
      c0: 1e-9
    },
    {
      unit: "µm",
      categoryId: "901",
      c0: 1e-6
    },
    {
      unit: "dm",
      categoryId: "901",
      c0: 0.1
    },
    {
      unit: "km",
      categoryId: "901",
      c0: 1e3
    },
    {
      unit: "thou",
      categoryId: "901",
      c0: 254e-7
    },
    {
      unit: "ft-in",
      categoryId: "901",
      c0: 0.0254
    },
    {
      unit: "ft",
      categoryId: "901",
      c0: 0.30479999999999996
    },
    {
      unit: "yd",
      categoryId: "901",
      c0: 0.9143999999999999
    },
    {
      unit: "mi",
      categoryId: "901",
      c0: 1609.3439999999998
    },
    {
      unit: "NM",
      categoryId: "901",
      c0: 1852
    },
    {
      unit: "kg",
      categoryId: "902",
      c0: 1
    },
    {
      unit: "g",
      categoryId: "902",
      c0: 1e-3
    },
    {
      unit: "mg",
      categoryId: "902",
      c0: 1e-6
    },
    {
      unit: "µg",
      categoryId: "902",
      c0: 1e-9
    },
    {
      unit: "slug",
      categoryId: "902",
      c0: 14.59390294
    },
    {
      unit: "blob",
      categoryId: "902",
      c0: 175.12683528
    },
    {
      unit: "lbm",
      categoryId: "902",
      c0: 0.45359237
    },
    {
      unit: "oz",
      categoryId: "902",
      c0: 0.028349523125
    },
    {
      unit: "ton(US/short)",
      categoryId: "902",
      c0: 907.18474
    },
    {
      unit: "ton(UK-Imperial/long)",
      categoryId: "902",
      c0: 1016.0469088000001
    },
    {
      unit: "tonne",
      categoryId: "902",
      c0: 1e3
    },
    {
      unit: "s",
      categoryId: "903",
      c0: 1
    },
    {
      unit: "min",
      categoryId: "903",
      c0: 60
    },
    {
      unit: "h",
      categoryId: "903",
      c0: 3600
    },
    {
      unit: "d",
      categoryId: "903",
      c0: 86400
    },
    {
      unit: "wk",
      categoryId: "903",
      c0: 604800
    },
    {
      unit: "A",
      categoryId: "904",
      c0: 1
    },
    {
      unit: "mA",
      categoryId: "904",
      c0: 1e-3
    },
    {
      unit: "µA",
      categoryId: "904",
      c0: 1e-6
    },
    {
      unit: "kA",
      categoryId: "904",
      c0: 1e3
    },
    {
      unit: "MA",
      categoryId: "904",
      c0: 1e6
    },
    {
      unit: "esu/s",
      categoryId: "904",
      c0: 3333333333333333e-25
    },
    {
      unit: "K",
      categoryId: "905",
      c0: 1
    },
    {
      unit: "°C",
      categoryId: "905",
      c0: 1,
      c1: 273.15
    },
    {
      unit: "°F",
      categoryId: "905",
      c0: 0.5555555555555556,
      c1: 255.3722222
    },
    {
      unit: "°Ra",
      categoryId: "905",
      c0: 0.5555555555555556,
      c1: 0
    },
    {
      unit: "mol",
      categoryId: "906",
      c0: 1
    },
    {
      unit: "mmol",
      categoryId: "906",
      c0: 1e-3
    },
    {
      unit: "kmol",
      categoryId: "906",
      c0: 1e3
    },
    {
      unit: "molecular entity",
      categoryId: "906",
      c0: 16605390671738466e-40
    },
    {
      unit: "cd",
      categoryId: "907",
      c0: 1
    },
    {
      unit: "lm/sr",
      categoryId: "907",
      c0: 1
    },
    {
      unit: "cp",
      categoryId: "907",
      c0: 1
    },
    {
      unit: "cp(candlepower before 1948)",
      categoryId: "907",
      c0: 0.981
    },
    {
      unit: "m/s²",
      categoryId: "100",
      c0: 1
    },
    {
      unit: "m/min²",
      categoryId: "100",
      c0: 2777777777777778e-19
    },
    {
      unit: "mm/s²",
      categoryId: "100",
      c0: 1e-3
    },
    {
      unit: "ft/s²",
      categoryId: "100",
      c0: 0.30479999999999996
    },
    {
      unit: "ft/min²",
      categoryId: "100",
      c0: 8466666666666666e-20
    },
    {
      unit: "in/s²",
      categoryId: "100",
      c0: 0.0254
    },
    {
      unit: "m³/kg/s²",
      categoryId: "105",
      c0: 1
    },
    {
      unit: "N⋅m²/kg²",
      categoryId: "105",
      c0: 1
    },
    {
      unit: "dyn⋅cm²/g²",
      categoryId: "105",
      c0: 1e3
    },
    {
      unit: "rad",
      categoryId: "110",
      c0: 1
    },
    {
      unit: "deg°",
      categoryId: "110",
      c0: 0.017453292519943295
    },
    {
      unit: "rev",
      categoryId: "110",
      c0: 6.283185307179586
    },
    {
      unit: "rad/s",
      categoryId: "115",
      c0: 1
    },
    {
      unit: "rad/min",
      categoryId: "115",
      c0: 0.016666666666666666
    },
    {
      unit: "rad/h",
      categoryId: "115",
      c0: 2777777777777778e-19
    },
    {
      unit: "deg°/s",
      categoryId: "115",
      c0: 0.017453292519943295
    },
    {
      unit: "deg°/min",
      categoryId: "115",
      c0: 2908882086657216e-19
    },
    {
      unit: "deg°/h",
      categoryId: "115",
      c0: 484813681109536e-20
    },
    {
      unit: "rev/min",
      categoryId: "115",
      c0: 0.10471975511965977
    },
    {
      unit: "rev/s",
      categoryId: "115",
      c0: 6.283185307179586
    },
    {
      unit: "rad/s²",
      categoryId: "120",
      c0: 1
    },
    {
      unit: "rad/min²",
      categoryId: "120",
      c0: 2777777777777778e-19
    },
    {
      unit: "deg°/s²",
      categoryId: "120",
      c0: 0.017453292519943295
    },
    {
      unit: "deg°/min²",
      categoryId: "120",
      c0: 484813681109536e-20
    },
    {
      unit: "lux",
      categoryId: "125",
      c0: 1
    },
    {
      unit: "lm/m²",
      categoryId: "125",
      c0: 1
    },
    {
      unit: "m·cd",
      categoryId: "125",
      c0: 1
    },
    {
      unit: "ph",
      categoryId: "125",
      c0: 1e4
    },
    {
      unit: "fc",
      categoryId: "125",
      c0: 10.763910416709725
    },
    {
      unit: "lm/ft²",
      categoryId: "125",
      c0: 10.763910416709725
    },
    {
      unit: "Hz",
      categoryId: "130",
      c0: 1
    },
    {
      unit: "1/min",
      categoryId: "130",
      c0: 0.016666666666666666
    },
    {
      unit: "cycle/min",
      categoryId: "130",
      c0: 0.016666666666666666
    },
    {
      unit: "1/h",
      categoryId: "130",
      c0: 2777777777777778e-19
    },
    {
      unit: "mHz",
      categoryId: "130",
      c0: 1e-3
    },
    {
      unit: "kHz",
      categoryId: "130",
      c0: 1e3
    },
    {
      unit: "MHz",
      categoryId: "130",
      c0: 1e6
    },
    {
      unit: "GHz",
      categoryId: "130",
      c0: 1e9
    },
    {
      unit: "m²",
      categoryId: "135",
      c0: 1
    },
    {
      unit: "µm²",
      categoryId: "135",
      c0: 1e-12
    },
    {
      unit: "mm²",
      categoryId: "135",
      c0: 1e-6
    },
    {
      unit: "cm²",
      categoryId: "135",
      c0: 1e-4
    },
    {
      unit: "km²",
      categoryId: "135",
      c0: 1e6
    },
    {
      unit: "hectare",
      categoryId: "135",
      c0: 1e4
    },
    {
      unit: "in²",
      categoryId: "135",
      c0: 64516e-8
    },
    {
      unit: "ft²",
      categoryId: "135",
      c0: 0.09290303999999998
    },
    {
      unit: "yd²",
      categoryId: "135",
      c0: 0.8361273599999998
    },
    {
      unit: "acre",
      categoryId: "135",
      c0: 4046.8564223999992
    },
    {
      unit: "mile²",
      categoryId: "135",
      c0: 2.5899881103359996e6
    },
    {
      unit: "m³",
      categoryId: "140",
      c0: 1
    },
    {
      unit: "µm³",
      categoryId: "140",
      c0: 9999999999999999e-34
    },
    {
      unit: "mm³",
      categoryId: "140",
      c0: 1e-9
    },
    {
      unit: "cm³",
      categoryId: "140",
      c0: 10000000000000002e-22
    },
    {
      unit: "L",
      categoryId: "140",
      c0: 1e-3
    },
    {
      unit: "km³",
      categoryId: "140",
      c0: 1e9
    },
    {
      unit: "in³",
      categoryId: "140",
      c0: 16387064e-12
    },
    {
      unit: "ft³",
      categoryId: "140",
      c0: 0.02831684659199999
    },
    {
      unit: "yd³",
      categoryId: "140",
      c0: 0.7645548579839997
    },
    {
      unit: "gal(UK-imperial)",
      categoryId: "140",
      c0: 454609e-8
    },
    {
      unit: "gal(US-liquid)",
      categoryId: "140",
      c0: 0.0037854117839999997
    },
    {
      unit: "gal(US-dry)",
      categoryId: "140",
      c0: 0.00440488377086
    },
    {
      unit: "pint(UK-imperial)",
      categoryId: "140",
      c0: 56826125e-11
    },
    {
      unit: "pint(US-liquid)",
      categoryId: "140",
      c0: 47317647299999996e-20
    },
    {
      unit: "pint(US-dry)",
      categoryId: "140",
      c0: 5506104713575e-16
    },
    {
      unit: "fluid ounce(UK-imperial)",
      categoryId: "140",
      c0: 284130625e-13
    },
    {
      unit: "fluid ounce(US-liquid)",
      categoryId: "140",
      c0: 29573529562499998e-21
    },
    {
      unit: "bushel(UK-imperial)",
      categoryId: "140",
      c0: 0.03636872
    },
    {
      unit: "bushel(US-dry)",
      categoryId: "140",
      c0: 0.03523907016688
    },
    {
      unit: "m⁴",
      categoryId: "145",
      c0: 1
    },
    {
      unit: "mm⁴",
      categoryId: "145",
      c0: 1e-12
    },
    {
      unit: "cm⁴",
      categoryId: "145",
      c0: 1e-8
    },
    {
      unit: "in⁴",
      categoryId: "145",
      c0: 41623142559999997e-23
    },
    {
      unit: "ft⁴",
      categoryId: "145",
      c0: 0.008630974841241597
    },
    {
      unit: "kg⋅m²",
      categoryId: "150",
      c0: 1
    },
    {
      unit: "g⋅cm²",
      categoryId: "150",
      c0: 10000000000000001e-23
    },
    {
      unit: "g⋅mm²",
      categoryId: "150",
      c0: 9999999999999999e-25
    },
    {
      unit: "lbm⋅ft²",
      categoryId: "150",
      c0: 0.04214011009380479
    },
    {
      unit: "lbm⋅in²",
      categoryId: "150",
      c0: 2926396534292e-16
    },
    {
      unit: "oz⋅in²",
      categoryId: "150",
      c0: 18289978339325e-18
    },
    {
      unit: "N",
      categoryId: "155",
      c0: 1
    },
    {
      unit: "kN",
      categoryId: "155",
      c0: 1e3
    },
    {
      unit: "MN",
      categoryId: "155",
      c0: 1e6
    },
    {
      unit: "kgf",
      categoryId: "155",
      c0: 9.80665
    },
    {
      unit: "lbf",
      categoryId: "155",
      c0: 4.4482216152605
    },
    {
      unit: "kip",
      categoryId: "155",
      c0: 4448.2216152605
    },
    {
      unit: "sr",
      categoryId: "160",
      c0: 1
    },
    {
      unit: "m²/m²",
      categoryId: "160",
      c0: 1
    },
    {
      unit: "kg/m²",
      categoryId: "165",
      c0: 1
    },
    {
      unit: "g/cm²",
      categoryId: "165",
      c0: 10
    },
    {
      unit: "g/mm²",
      categoryId: "165",
      c0: 1000.0000000000001
    },
    {
      unit: "tonne/m²",
      categoryId: "165",
      c0: 1e3
    },
    {
      unit: "lbm/yd²",
      categoryId: "165",
      c0: 0.5424919595981169
    },
    {
      unit: "lbm/ft²",
      categoryId: "165",
      c0: 4.882427636383052
    },
    {
      unit: "lbm/in²",
      categoryId: "165",
      c0: 703.0695796391593
    },
    {
      unit: "oz/yd²",
      categoryId: "165",
      c0: 0.03390574747488231
    },
    {
      unit: "oz/ft²",
      categoryId: "165",
      c0: 0.30515172727394074
    },
    {
      unit: "oz/in²",
      categoryId: "165",
      c0: 43.94184872744746
    },
    {
      unit: "kg/m³",
      categoryId: "170",
      c0: 1
    },
    {
      unit: "kg/L",
      categoryId: "170",
      c0: 1e3
    },
    {
      unit: "kg/mm³",
      categoryId: "170",
      c0: 9999999999999999e-7
    },
    {
      unit: "g/cm³",
      categoryId: "170",
      c0: 999.9999999999999
    },
    {
      unit: "g/mm³",
      categoryId: "170",
      c0: 1e6
    },
    {
      unit: "tonne/m³",
      categoryId: "170",
      c0: 1e3
    },
    {
      unit: "lbm/yd³",
      categoryId: "170",
      c0: 0.5932764212577832
    },
    {
      unit: "lbm/ft³",
      categoryId: "170",
      c0: 16.018463373960145
    },
    {
      unit: "lbm/in³",
      categoryId: "170",
      c0: 27679.904710203125
    },
    {
      unit: "lbm/gal(US)",
      categoryId: "170",
      c0: 119.82642731689664
    },
    {
      unit: "oz/yd³",
      categoryId: "170",
      c0: 0.03707977632861145
    },
    {
      unit: "oz/ft³",
      categoryId: "170",
      c0: 1.001153960872509
    },
    {
      unit: "oz/in³",
      categoryId: "170",
      c0: 1729.9940443876953
    },
    {
      unit: "oz/gal(US)",
      categoryId: "170",
      c0: 7.48915170730604
    },
    {
      unit: "kg/m",
      categoryId: "171",
      c0: 1
    },
    {
      unit: "g/cm",
      categoryId: "171",
      c0: 0.1
    },
    {
      unit: "g/mm",
      categoryId: "171",
      c0: 1
    },
    {
      unit: "g/km",
      categoryId: "171",
      c0: 1e-3
    },
    {
      unit: "denier",
      categoryId: "171",
      c0: 11111111111111112e-20
    },
    {
      unit: "decitex",
      categoryId: "171",
      c0: 1e-4
    },
    {
      unit: "lbm/ft",
      categoryId: "171",
      c0: 1.4881639435695542
    },
    {
      unit: "lbm/in",
      categoryId: "171",
      c0: 17.857967322834646
    },
    {
      unit: "lbm/yd",
      categoryId: "171",
      c0: 0.49605464785651804
    },
    {
      unit: "oz/ft",
      categoryId: "171",
      c0: 0.09301024647309714
    },
    {
      unit: "oz/in",
      categoryId: "171",
      c0: 1.1161229576771654
    },
    {
      unit: "J",
      categoryId: "175",
      c0: 1
    },
    {
      unit: "kJ",
      categoryId: "175",
      c0: 1e3
    },
    {
      unit: "MJ",
      categoryId: "175",
      c0: 1e6
    },
    {
      unit: "GJ",
      categoryId: "175",
      c0: 1e9
    },
    {
      unit: "kiloton",
      categoryId: "175",
      c0: 4184e6
    },
    {
      unit: "Btu",
      categoryId: "175",
      c0: 1055.05585262
    },
    {
      unit: "kBtu",
      categoryId: "175",
      c0: 105505585262e-5
    },
    {
      unit: "MMBtu",
      categoryId: "175",
      c0: 105505585262e-2
    },
    {
      unit: "calorie(IT)",
      categoryId: "175",
      c0: 4.1868
    },
    {
      unit: "kilo-calorie(IT)",
      categoryId: "175",
      c0: 4186.8
    },
    {
      unit: "calorie(TH)",
      categoryId: "175",
      c0: 4.184
    },
    {
      unit: "kilo-calorie(TH)",
      categoryId: "175",
      c0: 4184
    },
    {
      unit: "HP Hour",
      categoryId: "175",
      c0: 2684519537696172e-9
    },
    {
      unit: "Wh",
      categoryId: "175",
      c0: 3600
    },
    {
      unit: "kWh",
      categoryId: "175",
      c0: 36e5
    },
    {
      unit: "eV",
      categoryId: "175",
      c0: 16021764631580947e-35
    },
    {
      unit: "W",
      categoryId: "180",
      c0: 1
    },
    {
      unit: "kW",
      categoryId: "180",
      c0: 1e3
    },
    {
      unit: "MW",
      categoryId: "180",
      c0: 1e6
    },
    {
      unit: "GW",
      categoryId: "180",
      c0: 1e9
    },
    {
      unit: "Btu/h",
      categoryId: "180",
      c0: 0.2930710701722222
    },
    {
      unit: "Btu(AC)",
      categoryId: "180",
      c0: 0.2930710701722222
    },
    {
      unit: "Btu/min",
      categoryId: "180",
      c0: 17.584264210333334
    },
    {
      unit: "kBtu/h",
      categoryId: "180",
      c0: 17.584264210333334
    },
    {
      unit: "MMBtu/h",
      categoryId: "180",
      c0: 293071.0701722222
    },
    {
      unit: "MMBtu/yr",
      categoryId: "180",
      c0: 33.45560161783359
    },
    {
      unit: "TR",
      categoryId: "180",
      c0: 3516.8528420666667
    },
    {
      unit: "calorie(IT)/second",
      categoryId: "180",
      c0: 4.1868
    },
    {
      unit: "calorie(IT)/minute",
      categoryId: "180",
      c0: 0.06978
    },
    {
      unit: "kilo-calorie(IT)/hour",
      categoryId: "180",
      c0: 1.163
    },
    {
      unit: "calorie(TH)/second",
      categoryId: "180",
      c0: 4.184
    },
    {
      unit: "calorie(TH)/minute",
      categoryId: "180",
      c0: 0.06973333333333334
    },
    {
      unit: "kilo-calorie(TH)/hour",
      categoryId: "180",
      c0: 1.1622222222222223
    },
    {
      unit: "lb-ft/second",
      categoryId: "180",
      c0: 1.3558179483314001
    },
    {
      unit: "lb-ft/minute",
      categoryId: "180",
      c0: 0.022596965805523336
    },
    {
      unit: "HP",
      categoryId: "180",
      c0: 745.69987158227
    },
    {
      unit: "J/s",
      categoryId: "180",
      c0: 1
    },
    {
      unit: "J/min",
      categoryId: "180",
      c0: 0.016666666666666666
    },
    {
      unit: "J/h",
      categoryId: "180",
      c0: 2777777777777778e-19
    },
    {
      unit: "MJ/h",
      categoryId: "180",
      c0: 277.77777777777777
    },
    {
      unit: "kJ/min",
      categoryId: "180",
      c0: 16.666666666666668
    },
    {
      unit: "VA",
      categoryId: "181",
      c0: 1
    },
    {
      unit: "kVA",
      categoryId: "181",
      c0: 1e3
    },
    {
      unit: "MVA",
      categoryId: "181",
      c0: 1e6
    },
    {
      unit: "GVA",
      categoryId: "181",
      c0: 1e9
    },
    {
      unit: "mVA",
      categoryId: "181",
      c0: 1e-3
    },
    {
      unit: "VAr",
      categoryId: "182",
      c0: 1
    },
    {
      unit: "kVAr",
      categoryId: "182",
      c0: 1e3
    },
    {
      unit: "MVAr",
      categoryId: "182",
      c0: 1e6
    },
    {
      unit: "GVAr",
      categoryId: "182",
      c0: 1e9
    },
    {
      unit: "mVAr",
      categoryId: "182",
      c0: 1e-3
    },
    {
      unit: "Nm",
      categoryId: "185",
      c0: 1
    },
    {
      unit: "kNm",
      categoryId: "185",
      c0: 1e3
    },
    {
      unit: "lb-in",
      categoryId: "185",
      c0: 0.11298482902761668
    },
    {
      unit: "kip-in",
      categoryId: "185",
      c0: 112.98482902761668
    },
    {
      unit: "lb-ft",
      categoryId: "185",
      c0: 1.3558179483314001
    },
    {
      unit: "oz-in",
      categoryId: "185",
      c0: 0.007061551814226043
    },
    {
      unit: "oz-ft",
      categoryId: "185",
      c0: 0.08473862177071251
    },
    {
      unit: "Pa",
      categoryId: "190",
      c0: 1
    },
    {
      unit: "hPa",
      categoryId: "190",
      c0: 100
    },
    {
      unit: "kPa",
      categoryId: "190",
      c0: 1e3
    },
    {
      unit: "MPa",
      categoryId: "190",
      c0: 1e6
    },
    {
      unit: "GPa",
      categoryId: "190",
      c0: 1e9
    },
    {
      unit: "bar",
      categoryId: "190",
      c0: 1e5
    },
    {
      unit: "mbar",
      categoryId: "190",
      c0: 100
    },
    {
      unit: "kgf/m²",
      categoryId: "190",
      c0: 9.80665
    },
    {
      unit: "kgf/cm²",
      categoryId: "190",
      c0: 98066.49999999999
    },
    {
      unit: "atm",
      categoryId: "190",
      c0: 101325
    },
    {
      unit: "mm HG",
      categoryId: "190",
      c0: 133.322387415
    },
    {
      unit: "cm HG",
      categoryId: "190",
      c0: 1333.22387415
    },
    {
      unit: "in HG",
      categoryId: "190",
      c0: 3386.388640341
    },
    {
      unit: "mm W.C.",
      categoryId: "190",
      c0: 9.80665
    },
    {
      unit: "m W.C.",
      categoryId: "190",
      c0: 9806.65
    },
    {
      unit: "in W.C.",
      categoryId: "190",
      c0: 249.08890999999997
    },
    {
      unit: "psf",
      categoryId: "190",
      c0: 47.88025898033585
    },
    {
      unit: "psi",
      categoryId: "190",
      c0: 6894.757293168361
    },
    {
      unit: "ozf/in²",
      categoryId: "190",
      c0: 430.92233082302255
    },
    {
      unit: "ksi",
      categoryId: "190",
      c0: 6894757293168361e-9
    },
    {
      unit: "Torr",
      categoryId: "190",
      c0: 133.32236842105263
    },
    {
      unit: "mTorr",
      categoryId: "190",
      c0: 0.13332236842105263
    },
    {
      unit: "Pa/m",
      categoryId: "195",
      c0: 1
    },
    {
      unit: "kPa/m",
      categoryId: "195",
      c0: 1e3
    },
    {
      unit: "MPa/km",
      categoryId: "195",
      c0: 1e3
    },
    {
      unit: "bar/m",
      categoryId: "195",
      c0: 1e5
    },
    {
      unit: "mbar/mm",
      categoryId: "195",
      c0: 1e5
    },
    {
      unit: "atm/m",
      categoryId: "195",
      c0: 101325
    },
    {
      unit: "mm HG/m",
      categoryId: "195",
      c0: 133.322387415
    },
    {
      unit: "in HG/ft",
      categoryId: "195",
      c0: 11110.198951250002
    },
    {
      unit: "mm W.C./m",
      categoryId: "195",
      c0: 9.80665
    },
    {
      unit: "m W.C./m",
      categoryId: "195",
      c0: 9806.65
    },
    {
      unit: "in W.C./ft",
      categoryId: "195",
      c0: 817.2208333333333
    },
    {
      unit: "in W.C./100 ft",
      categoryId: "195",
      c0: 8.172208333333334
    },
    {
      unit: "psf/in",
      categoryId: "195",
      c0: 1885.0495661549548
    },
    {
      unit: "psi/ft",
      categoryId: "195",
      c0: 22620.594793859455
    },
    {
      unit: "ksi/ft",
      categoryId: "195",
      c0: 22620594793859456e-9
    },
    {
      unit: "Torr/ft",
      categoryId: "195",
      c0: 437.40934521342734
    },
    {
      unit: "mTorr/m",
      categoryId: "195",
      c0: 0.13332236842105263
    },
    {
      unit: "N/m",
      categoryId: "200",
      c0: 1
    },
    {
      unit: "N/mm",
      categoryId: "200",
      c0: 1e3
    },
    {
      unit: "kN/m",
      categoryId: "200",
      c0: 1e3
    },
    {
      unit: "lb/ft",
      categoryId: "200",
      c0: 14.593902937206366
    },
    {
      unit: "kips/ft",
      categoryId: "200",
      c0: 14593.902937206365
    },
    {
      unit: "lb/in",
      categoryId: "200",
      c0: 175.12683524647636
    },
    {
      unit: "N⋅m/rad",
      categoryId: "205",
      c0: 1
    },
    {
      unit: "N⋅m/deg°",
      categoryId: "205",
      c0: 57.29577951308232
    },
    {
      unit: "N⋅mm/rad",
      categoryId: "205",
      c0: 1e-3
    },
    {
      unit: "N⋅mm/deg°",
      categoryId: "205",
      c0: 0.057295779513082325
    },
    {
      unit: "lb-ft/rad",
      categoryId: "205",
      c0: 1.3558179483314001
    },
    {
      unit: "lb-ft/deg°",
      categoryId: "205",
      c0: 77.68264622747554
    },
    {
      unit: "lb-in/rad",
      categoryId: "205",
      c0: 0.11298482902761668
    },
    {
      unit: "lb-in/deg°",
      categoryId: "205",
      c0: 6.473553852289629
    },
    {
      unit: "m³/s",
      categoryId: "210",
      c0: 1
    },
    {
      unit: "m³/min",
      categoryId: "210",
      c0: 0.016666666666666666
    },
    {
      unit: "m³/h",
      categoryId: "210",
      c0: 2777777777777778e-19
    },
    {
      unit: "L/s",
      categoryId: "210",
      c0: 1e-3
    },
    {
      unit: "L/min",
      categoryId: "210",
      c0: 16666666666666667e-21
    },
    {
      unit: "L/h",
      categoryId: "210",
      c0: 27777777777777776e-23
    },
    {
      unit: "cm³/s",
      categoryId: "210",
      c0: 1e-6
    },
    {
      unit: "cm³/min",
      categoryId: "210",
      c0: 16666666666666667e-24
    },
    {
      unit: "mm³/s",
      categoryId: "210",
      c0: 1e-9
    },
    {
      unit: "in³/s",
      categoryId: "210",
      c0: 16387064e-12
    },
    {
      unit: "in³/min",
      categoryId: "210",
      c0: 27311773333333333e-23
    },
    {
      unit: "ft³/s",
      categoryId: "210",
      c0: 0.02831684659199999
    },
    {
      unit: "CFM",
      categoryId: "210",
      c0: 4719474431999998e-19
    },
    {
      unit: "CFH",
      categoryId: "210",
      c0: 7865790719999997e-21
    },
    {
      unit: "yd³/min",
      categoryId: "210",
      c0: 0.012742580966399995
    },
    {
      unit: "yd³/h",
      categoryId: "210",
      c0: 21237634943999993e-20
    },
    {
      unit: "gpm(US)",
      categoryId: "210",
      c0: 6309019639999999e-20
    },
    {
      unit: "bushel(UK-imperial)/h",
      categoryId: "210",
      c0: 10102422222222223e-21
    },
    {
      unit: "bushel(US)/h",
      categoryId: "210",
      c0: 9788630601911111e-21
    },
    {
      unit: "kg/s",
      categoryId: "215",
      c0: 1
    },
    {
      unit: "kg/min",
      categoryId: "215",
      c0: 0.016666666666666666
    },
    {
      unit: "kg/h",
      categoryId: "215",
      c0: 2777777777777778e-19
    },
    {
      unit: "g/s",
      categoryId: "215",
      c0: 1e-3
    },
    {
      unit: "g/min",
      categoryId: "215",
      c0: 16666666666666667e-21
    },
    {
      unit: "g/h",
      categoryId: "215",
      c0: 27777777777777776e-23
    },
    {
      unit: "slug/s",
      categoryId: "215",
      c0: 14.59390294
    },
    {
      unit: "slug/min",
      categoryId: "215",
      c0: 0.24323171566666665
    },
    {
      unit: "slug/h",
      categoryId: "215",
      c0: 0.004053861927777778
    },
    {
      unit: "lbm/s",
      categoryId: "215",
      c0: 0.45359237
    },
    {
      unit: "lbm/min",
      categoryId: "215",
      c0: 0.007559872833333333
    },
    {
      unit: "lbm/h",
      categoryId: "215",
      c0: 12599788055555556e-20
    },
    {
      unit: "oz/s",
      categoryId: "215",
      c0: 0.028349523125
    },
    {
      unit: "oz/min",
      categoryId: "215",
      c0: 47249205208333334e-20
    },
    {
      unit: "oz/h",
      categoryId: "215",
      c0: 7874867534722223e-21
    },
    {
      unit: "tonne/h",
      categoryId: "215",
      c0: 0.2777777777777778
    },
    {
      unit: "short ton/h",
      categoryId: "215",
      c0: 0.2519957611111111
    },
    {
      unit: "long ton/h",
      categoryId: "215",
      c0: 0.2822352524444445
    },
    {
      unit: "m/s",
      categoryId: "220",
      c0: 1
    },
    {
      unit: "mm/s",
      categoryId: "220",
      c0: 1e-3
    },
    {
      unit: "km/s",
      categoryId: "220",
      c0: 1e3
    },
    {
      unit: "mm/min",
      categoryId: "220",
      c0: 16666666666666667e-21
    },
    {
      unit: "m/min",
      categoryId: "220",
      c0: 0.016666666666666666
    },
    {
      unit: "km/min",
      categoryId: "220",
      c0: 16.666666666666668
    },
    {
      unit: "mm/h",
      categoryId: "220",
      c0: 27777777777777776e-23
    },
    {
      unit: "m/h",
      categoryId: "220",
      c0: 2777777777777778e-19
    },
    {
      unit: "km/h",
      categoryId: "220",
      c0: 0.2777777777777778
    },
    {
      unit: "in/s",
      categoryId: "220",
      c0: 0.0254
    },
    {
      unit: "fps",
      categoryId: "220",
      c0: 0.30479999999999996
    },
    {
      unit: "ft/s",
      categoryId: "220",
      c0: 0.30479999999999996
    },
    {
      unit: "fpm",
      categoryId: "220",
      c0: 0.0050799999999999994
    },
    {
      unit: "mph",
      categoryId: "220",
      c0: 0.44703999999999994
    },
    {
      unit: "knot",
      categoryId: "220",
      c0: 0.5144444444444445
    },
    {
      unit: "J/m²",
      categoryId: "224",
      c0: 1
    },
    {
      unit: "kJ/m²",
      categoryId: "224",
      c0: 1e3
    },
    {
      unit: "cal/cm²",
      categoryId: "224",
      c0: 41840000000000003e-20
    },
    {
      unit: "kcal/m²",
      categoryId: "224",
      c0: 4184
    },
    {
      unit: "Wh/m²",
      categoryId: "224",
      c0: 3600
    },
    {
      unit: "kWh/m²",
      categoryId: "224",
      c0: 36e5
    },
    {
      unit: "Btu/yd²",
      categoryId: "224",
      c0: 1261.8362980252198
    },
    {
      unit: "Btu/ft²",
      categoryId: "224",
      c0: 11356.526682226979
    },
    {
      unit: "Btu/in²",
      categoryId: "224",
      c0: 1.6353398422406844e6
    },
    {
      unit: "J/m³",
      categoryId: "225",
      c0: 1
    },
    {
      unit: "J/L",
      categoryId: "225",
      c0: 1e3
    },
    {
      unit: "kJ/L",
      categoryId: "225",
      c0: 1e6
    },
    {
      unit: "kJ/m³",
      categoryId: "225",
      c0: 1e3
    },
    {
      unit: "MJ/m³",
      categoryId: "225",
      c0: 1e6
    },
    {
      unit: "GJ/m³",
      categoryId: "225",
      c0: 1e9
    },
    {
      unit: "cal(IT)/L",
      categoryId: "225",
      c0: 4186.8
    },
    {
      unit: "kcal(IT)/m³",
      categoryId: "225",
      c0: 4186.8
    },
    {
      unit: "cal(TH)/L",
      categoryId: "225",
      c0: 4184
    },
    {
      unit: "kcal(TH)/m³",
      categoryId: "225",
      c0: 4184
    },
    {
      unit: "Wh/L",
      categoryId: "225",
      c0: 36e5
    },
    {
      unit: "Wh/m³",
      categoryId: "225",
      c0: 3600
    },
    {
      unit: "kWh/m³",
      categoryId: "225",
      c0: 36e5
    },
    {
      unit: "HP Hour/ft³",
      categoryId: "225",
      c0: 9480291278106497e-8
    },
    {
      unit: "Btu/gal(US)",
      categoryId: "225",
      c0: 278716.2699391016
    },
    {
      unit: "Btu/ft³",
      categoryId: "225",
      c0: 37258.9458078313
    },
    {
      unit: "MMBtu/ft³",
      categoryId: "225",
      c0: 372589458078313e-4
    },
    {
      unit: "J/kg",
      categoryId: "230",
      c0: 1
    },
    {
      unit: "J/g",
      categoryId: "230",
      c0: 1e3
    },
    {
      unit: "kJ/kg",
      categoryId: "230",
      c0: 1e3
    },
    {
      unit: "MJ/kg",
      categoryId: "230",
      c0: 1e6
    },
    {
      unit: "GJ/kg",
      categoryId: "230",
      c0: 1e9
    },
    {
      unit: "cal(IT)/g",
      categoryId: "230",
      c0: 4186.8
    },
    {
      unit: "kcal(IT)/kg",
      categoryId: "230",
      c0: 4186.8
    },
    {
      unit: "cal(TH)/g",
      categoryId: "230",
      c0: 4184
    },
    {
      unit: "kcal(TH)/kg",
      categoryId: "230",
      c0: 4184
    },
    {
      unit: "Wh/g",
      categoryId: "230",
      c0: 36e5
    },
    {
      unit: "Wh/kg",
      categoryId: "230",
      c0: 3600
    },
    {
      unit: "kWh/kg",
      categoryId: "230",
      c0: 36e5
    },
    {
      unit: "HP Hour/lbm",
      categoryId: "230",
      c0: 5918352501599998e-9
    },
    {
      unit: "Btu/lbm",
      categoryId: "230",
      c0: 2326
    },
    {
      unit: "MMBtu/lbm",
      categoryId: "230",
      c0: 2326e6
    },
    {
      unit: "Btu/ton(short)",
      categoryId: "230",
      c0: 1.163
    },
    {
      unit: "J/(kg·K)",
      categoryId: "235",
      c0: 1
    },
    {
      unit: "J/(kg·°C)",
      categoryId: "235",
      c0: 1
    },
    {
      unit: "J/(g·K)",
      categoryId: "235",
      c0: 1e3
    },
    {
      unit: "J/(g·°C)",
      categoryId: "235",
      c0: 1e3
    },
    {
      unit: "Btu/(lbm·°F)",
      categoryId: "235",
      c0: 4186.799999999999
    },
    {
      unit: "Pa·s",
      categoryId: "240",
      c0: 1
    },
    {
      unit: "N·s/m²",
      categoryId: "240",
      c0: 1
    },
    {
      unit: "kg/m/s",
      categoryId: "240",
      c0: 1
    },
    {
      unit: "P",
      categoryId: "240",
      c0: 0.1
    },
    {
      unit: "cP",
      categoryId: "240",
      c0: 1e-3
    },
    {
      unit: "lb·s/ft²",
      categoryId: "240",
      c0: 47.88025898033585
    },
    {
      unit: "lbm/ft/s",
      categoryId: "240",
      c0: 1.4881639435695542
    },
    {
      unit: "m²/s",
      categoryId: "245",
      c0: 1
    },
    {
      unit: "m²/min",
      categoryId: "245",
      c0: 0.016666666666666666
    },
    {
      unit: "m²/hr",
      categoryId: "245",
      c0: 2777777777777778e-19
    },
    {
      unit: "St",
      categoryId: "245",
      c0: 1e-4
    },
    {
      unit: "cm²/min",
      categoryId: "245",
      c0: 16666666666666667e-22
    },
    {
      unit: "cm²/hr",
      categoryId: "245",
      c0: 2777777777777778e-23
    },
    {
      unit: "cSt",
      categoryId: "245",
      c0: 1e-6
    },
    {
      unit: "mm²/min",
      categoryId: "245",
      c0: 16666666666666667e-24
    },
    {
      unit: "mm²/hr",
      categoryId: "245",
      c0: 27777777777777777e-26
    },
    {
      unit: "ft²/s",
      categoryId: "245",
      c0: 0.09290303999999998
    },
    {
      unit: "ft²/min",
      categoryId: "245",
      c0: 0.0015483839999999997
    },
    {
      unit: "ft²/hr",
      categoryId: "245",
      c0: 25806399999999994e-21
    },
    {
      unit: "in²/s",
      categoryId: "245",
      c0: 64516e-8
    },
    {
      unit: "in²/min",
      categoryId: "245",
      c0: 10752666666666666e-21
    },
    {
      unit: "in²/hr",
      categoryId: "245",
      c0: 17921111111111112e-23
    },
    {
      unit: "ΔK",
      categoryId: "249",
      c0: 1
    },
    {
      unit: "Δ°C",
      categoryId: "249",
      c0: 1
    },
    {
      unit: "Δ°F",
      categoryId: "249",
      c0: 0.5555555555555556
    },
    {
      unit: "Δ°Ra",
      categoryId: "249",
      c0: 0.5555555555555556
    },
    {
      unit: "1/K",
      categoryId: "250",
      c0: 1
    },
    {
      unit: "1/°C",
      categoryId: "250",
      c0: 1
    },
    {
      unit: "1/°F",
      categoryId: "250",
      c0: 1.8
    },
    {
      unit: "1/°Ra",
      categoryId: "250",
      c0: 1.8
    },
    {
      unit: "W/(m⋅K)",
      categoryId: "255",
      c0: 1
    },
    {
      unit: "W/(cm⋅K)",
      categoryId: "255",
      c0: 100
    },
    {
      unit: "BTU/(h⋅ft⋅°F)",
      categoryId: "255",
      c0: 1.7307346663713914
    },
    {
      unit: "BTU/(h⋅in⋅°F)",
      categoryId: "255",
      c0: 20.76881599645669
    },
    {
      unit: "A⋅s",
      categoryId: "260",
      c0: 1
    },
    {
      unit: "C",
      categoryId: "260",
      c0: 1
    },
    {
      unit: "Ah",
      categoryId: "260",
      c0: 3600
    },
    {
      unit: "mAh",
      categoryId: "260",
      c0: 3.6
    },
    {
      unit: "e",
      categoryId: "260",
      c0: 1602307322544464e-34
    },
    {
      unit: "faraday",
      categoryId: "260",
      c0: 96493.20237141484
    },
    {
      unit: "V",
      categoryId: "265",
      c0: 1
    },
    {
      unit: "µV",
      categoryId: "265",
      c0: 1e-6
    },
    {
      unit: "mV",
      categoryId: "265",
      c0: 1e-3
    },
    {
      unit: "kV",
      categoryId: "265",
      c0: 1e3
    },
    {
      unit: "MV",
      categoryId: "265",
      c0: 1e6
    },
    {
      unit: "J/C",
      categoryId: "265",
      c0: 1
    },
    {
      unit: "Ω",
      categoryId: "270",
      c0: 1
    },
    {
      unit: "µΩ",
      categoryId: "270",
      c0: 1e-6
    },
    {
      unit: "mΩ",
      categoryId: "270",
      c0: 1e-3
    },
    {
      unit: "kΩ",
      categoryId: "270",
      c0: 1e3
    },
    {
      unit: "MΩ",
      categoryId: "270",
      c0: 1e6
    },
    {
      unit: "F",
      categoryId: "275",
      c0: 1
    },
    {
      unit: "pF",
      categoryId: "275",
      c0: 1e-12
    },
    {
      unit: "nF",
      categoryId: "275",
      c0: 1e-9
    },
    {
      unit: "µF",
      categoryId: "275",
      c0: 1e-6
    },
    {
      unit: "mF",
      categoryId: "275",
      c0: 1e-3
    },
    {
      unit: "H",
      categoryId: "280",
      c0: 1
    },
    {
      unit: "µH",
      categoryId: "280",
      c0: 1e-6
    },
    {
      unit: "mH",
      categoryId: "280",
      c0: 1e-3
    },
    {
      unit: "S",
      categoryId: "285",
      c0: 1
    },
    {
      unit: "℧",
      categoryId: "285",
      c0: 1
    },
    {
      unit: "µS",
      categoryId: "285",
      c0: 1e-6
    },
    {
      unit: "mS",
      categoryId: "285",
      c0: 1e-3
    },
    {
      unit: "kS",
      categoryId: "285",
      c0: 1e3
    },
    {
      unit: "Wb",
      categoryId: "290",
      c0: 1
    },
    {
      unit: "nWb",
      categoryId: "290",
      c0: 1e-9
    },
    {
      unit: "µWb",
      categoryId: "290",
      c0: 1e-6
    },
    {
      unit: "mWb",
      categoryId: "290",
      c0: 1e-3
    },
    {
      unit: "cWb",
      categoryId: "290",
      c0: 0.01
    },
    {
      unit: "dWb",
      categoryId: "290",
      c0: 0.1
    },
    {
      unit: "lm",
      categoryId: "295",
      c0: 1
    },
    {
      unit: "cd⋅sr",
      categoryId: "295",
      c0: 1
    },
    {
      unit: "T",
      categoryId: "300",
      c0: 1
    },
    {
      unit: "Wb/m²",
      categoryId: "300",
      c0: 1
    },
    {
      unit: "µT",
      categoryId: "300",
      c0: 1e-6
    },
    {
      unit: "G",
      categoryId: "300",
      c0: 1e-4
    },
    {
      unit: "mT",
      categoryId: "300",
      c0: 1e-3
    },
    {
      unit: "kat",
      categoryId: "305",
      c0: 1
    },
    {
      unit: "mol/s",
      categoryId: "305",
      c0: 1
    },
    {
      unit: "µkat",
      categoryId: "305",
      c0: 1e-6
    },
    {
      unit: "mkat",
      categoryId: "305",
      c0: 1e-3
    },
    {
      unit: "kkat",
      categoryId: "305",
      c0: 1e3
    },
    {
      unit: "Mkat",
      categoryId: "305",
      c0: 1e6
    },
    {
      unit: "Bq",
      categoryId: "310",
      c0: 1
    },
    {
      unit: "µBq",
      categoryId: "310",
      c0: 1e-6
    },
    {
      unit: "mBq",
      categoryId: "310",
      c0: 1e-3
    },
    {
      unit: "kBq",
      categoryId: "310",
      c0: 1e3
    },
    {
      unit: "MBq",
      categoryId: "310",
      c0: 1e6
    },
    {
      unit: "Rd",
      categoryId: "310",
      c0: 1e6
    },
    {
      unit: "Ci",
      categoryId: "310",
      c0: 37e9
    },
    {
      unit: "Gy",
      categoryId: "315",
      c0: 1
    },
    {
      unit: "µGy",
      categoryId: "315",
      c0: 1e-6
    },
    {
      unit: "mGy",
      categoryId: "315",
      c0: 1e-3
    },
    {
      unit: "kGy",
      categoryId: "315",
      c0: 1e3
    },
    {
      unit: "MGy",
      categoryId: "315",
      c0: 1e6
    },
    {
      unit: "Sv",
      categoryId: "320",
      c0: 1
    },
    {
      unit: "µSv",
      categoryId: "320",
      c0: 1e-6
    },
    {
      unit: "mSv",
      categoryId: "320",
      c0: 1e-3
    },
    {
      unit: "kSv",
      categoryId: "320",
      c0: 1e3
    },
    {
      unit: "MSv",
      categoryId: "320",
      c0: 1e6
    },
    {
      unit: "m³/rad",
      categoryId: "325",
      c0: 1
    },
    {
      unit: "m³/rev",
      categoryId: "325",
      c0: 0.15915494309189535
    },
    {
      unit: "L/rev",
      categoryId: "325",
      c0: 15915494309189535e-20
    },
    {
      unit: "cc/rev",
      categoryId: "325",
      c0: 15915494309189532e-23
    },
    {
      unit: "ft³/rev",
      categoryId: "325",
      c0: 0.004506766107891689
    },
    {
      unit: "in³/rev",
      categoryId: "325",
      c0: 2608082238363247e-21
    },
    {
      unit: "gal(US-liquid)/rev",
      categoryId: "325",
      c0: 60246699706191e-17
    },
    {
      unit: "m/m³",
      categoryId: "330",
      c0: 1
    },
    {
      unit: "km/L",
      categoryId: "330",
      c0: 1e6
    },
    {
      unit: "mpg(US)",
      categoryId: "330",
      c0: 425143.707430272
    },
    {
      unit: "mpg(UK)",
      categoryId: "330",
      c0: 354006.1899346471
    },
    {
      unit: "mile/L",
      categoryId: "330",
      c0: 1.6093439999999998e6
    },
    {
      unit: "m³/m",
      categoryId: "335",
      c0: 1
    },
    {
      unit: "L/km",
      categoryId: "335",
      c0: 1e-6
    },
    {
      unit: "L/100km",
      categoryId: "335",
      c0: 1e-8
    },
    {
      unit: "L/mile",
      categoryId: "335",
      c0: 6213711922373341e-22
    },
    {
      unit: "L/100mile",
      categoryId: "335",
      c0: 62137119223733416e-25
    },
    {
      unit: "gal(US-liquid)/mile",
      categoryId: "335",
      c0: 23521458333333333e-22
    },
    {
      unit: "gal(US-liquid)/100mile",
      categoryId: "335",
      c0: 23521458333333335e-24
    },
    {
      unit: "gal(UK-imperial)/mile",
      categoryId: "335",
      c0: 2824809363318222e-21
    },
    {
      unit: "gal(UK-imperial)/100mile",
      categoryId: "335",
      c0: 2824809363318222e-23
    },
    {
      unit: "m/J",
      categoryId: "340",
      c0: 1
    },
    {
      unit: "km/kWh",
      categoryId: "340",
      c0: 2777777777777778e-19
    },
    {
      unit: "km/MJ",
      categoryId: "340",
      c0: 1e-3
    },
    {
      unit: "MPGe",
      categoryId: "340",
      c0: 13267469084913437e-21
    },
    {
      unit: "mile/MJ",
      categoryId: "340",
      c0: 0.0016093439999999997
    },
    {
      unit: "mile/kWh",
      categoryId: "340",
      c0: 44703999999999995e-20
    },
    {
      unit: "mile/MMBtu",
      categoryId: "340",
      c0: 1525363795673515e-21
    },
    {
      unit: "J/m",
      categoryId: "345",
      c0: 1
    },
    {
      unit: "Wh/km",
      categoryId: "345",
      c0: 3.6
    },
    {
      unit: "Wh/mile",
      categoryId: "345",
      c0: 2.2369362920544025
    },
    {
      unit: "kWh/km",
      categoryId: "345",
      c0: 3600
    },
    {
      unit: "kWh/100km",
      categoryId: "345",
      c0: 36
    },
    {
      unit: "kWh/mile",
      categoryId: "345",
      c0: 2236.9362920544027
    },
    {
      unit: "kWh/100mile",
      categoryId: "345",
      c0: 22.369362920544027
    },
    {
      unit: "MJ/km",
      categoryId: "345",
      c0: 1e3
    },
    {
      unit: "MJ/100km",
      categoryId: "345",
      c0: 10
    },
    {
      unit: "MJ/mile",
      categoryId: "345",
      c0: 621.3711922373341
    },
    {
      unit: "MJ/100mile",
      categoryId: "345",
      c0: 6.213711922373341
    },
    {
      unit: "MMBtu/km",
      categoryId: "345",
      c0: 105505585262e-5
    },
    {
      unit: "MMBtu/100km",
      categoryId: "345",
      c0: 10550.5585262
    },
    {
      unit: "MMBtu/mile",
      categoryId: "345",
      c0: 655581.3130194664
    },
    {
      unit: "MMBtu/100mile",
      categoryId: "345",
      c0: 6555.813130194665
    },
    {
      unit: "$",
      categoryId: "355",
      c0: 1
    },
    {
      unit: "¢",
      categoryId: "355",
      c0: 0.01
    },
    {
      unit: "$1K",
      categoryId: "355",
      c0: 1e3
    },
    {
      unit: "$1M",
      categoryId: "355",
      c0: 1e6
    },
    {
      unit: "$1B",
      categoryId: "355",
      c0: 1e9
    },
    {
      unit: "$1T",
      categoryId: "355",
      c0: 1e12
    },
    {
      unit: "N·s",
      categoryId: "360",
      c0: 1
    },
    {
      unit: "lb·s",
      categoryId: "360",
      c0: 4.4482216152605
    },
    {
      unit: "kg·m/s",
      categoryId: "360",
      c0: 1
    },
    {
      unit: "lbm·fps",
      categoryId: "360",
      c0: 0.138254954376
    },
    {
      unit: "lbm·fpm",
      categoryId: "360",
      c0: 0.0023042492396
    },
    {
      unit: "bit",
      categoryId: "365",
      c0: 1
    },
    {
      unit: "kilobit",
      categoryId: "365",
      c0: 1e3
    },
    {
      unit: "kibibit",
      categoryId: "365",
      c0: 1024
    },
    {
      unit: "megabit",
      categoryId: "365",
      c0: 1e6
    },
    {
      unit: "mebibit",
      categoryId: "365",
      c0: 1048576
    },
    {
      unit: "gigabit",
      categoryId: "365",
      c0: 1e9
    },
    {
      unit: "gibibit",
      categoryId: "365",
      c0: 1073741824
    },
    {
      unit: "terabit",
      categoryId: "365",
      c0: 1e12
    },
    {
      unit: "tebibit",
      categoryId: "365",
      c0: 1099511627776
    },
    {
      unit: "petabit",
      categoryId: "365",
      c0: 1e15
    },
    {
      unit: "pebibit",
      categoryId: "365",
      c0: 1125899906842624
    },
    {
      unit: "byte",
      categoryId: "365",
      c0: 8
    },
    {
      unit: "kilobyte",
      categoryId: "365",
      c0: 8e3
    },
    {
      unit: "kibibyte",
      categoryId: "365",
      c0: 8192
    },
    {
      unit: "megabyte",
      categoryId: "365",
      c0: 8e6
    },
    {
      unit: "mebibyte",
      categoryId: "365",
      c0: 8388608
    },
    {
      unit: "gigabyte",
      categoryId: "365",
      c0: 8e9
    },
    {
      unit: "gibibyte",
      categoryId: "365",
      c0: 8589934592
    },
    {
      unit: "terabyte",
      categoryId: "365",
      c0: 8e12
    },
    {
      unit: "tebibyte",
      categoryId: "365",
      c0: 8796093022208
    },
    {
      unit: "petabyte",
      categoryId: "365",
      c0: 8e15
    },
    {
      unit: "pebibyte",
      categoryId: "365",
      c0: 9007199254740992
    },
    {
      unit: "bit/s",
      categoryId: "370",
      c0: 1
    },
    {
      unit: "kilobit/s",
      categoryId: "370",
      c0: 1e3
    },
    {
      unit: "kibibit/s",
      categoryId: "370",
      c0: 1024
    },
    {
      unit: "megabit/s",
      categoryId: "370",
      c0: 1e6
    },
    {
      unit: "mebibit/s",
      categoryId: "370",
      c0: 1048576
    },
    {
      unit: "gigabit/s",
      categoryId: "370",
      c0: 1e9
    },
    {
      unit: "gibibit/s",
      categoryId: "370",
      c0: 1073741824
    },
    {
      unit: "terabit/s",
      categoryId: "370",
      c0: 1099511627776
    },
    {
      unit: "tebibit/s",
      categoryId: "370",
      c0: 1099511627776
    },
    {
      unit: "petabit/s",
      categoryId: "370",
      c0: 1e15
    },
    {
      unit: "pebibit/s",
      categoryId: "370",
      c0: 1125899906842624
    }
  ];
  const data = {
    meta,
    categories,
    units
  };
  const grouped = /* @__PURE__ */ new Map();
  for (const u of data.units) {
    if (!grouped.has(u.categoryId))
      grouped.set(u.categoryId, []);
    grouped.get(u.categoryId).push(u);
  }
  const UNITS = {};
  const CONVERSION_FACTORS = {};
  for (const cat of data.categories) {
    const units2 = grouped.get(cat.id) ?? [];
    const key = cat.description;
    const isAffine = units2.some((u) => u.c1 != null);
    UNITS[key] = units2.map((u) => u.unit);
    if (isAffine) {
      CONVERSION_FACTORS[key] = Object.fromEntries(
        units2.map((u) => [u.unit, { c0: u.c0, c1: u.c1 ?? 0 }])
      );
    } else {
      CONVERSION_FACTORS[key] = Object.fromEntries(
        units2.map((u) => [u.unit, u.c0])
      );
    }
  }
  const getUnitCategory = (unit) => {
    console.log("getUnitCategory called with unit:", unit);
    if (!unit) {
      console.warn("Unit is undefined or null");
      return "Custom";
    }
    for (const category in UNITS) {
      if (UNITS[category].includes(unit)) {
        console.log(`Category found for unit ${unit}:`, category);
        return category;
      }
    }
    console.warn(`No category found for unit: ${unit}`);
    return "Custom";
  };
  const convertValue = (value, fromUnit, toUnit, unitCategory) => {
    if (fromUnit === "ft-in" && toUnit !== "ft-in") {
      return convertFromFeetInches(value, toUnit);
    } else if (fromUnit !== "ft-in" && toUnit === "ft-in") {
      return convertToFeetInches(value, fromUnit);
    } else if (unitCategory !== "Temperature") {
      const c = CONVERSION_FACTORS[unitCategory][fromUnit] / CONVERSION_FACTORS[unitCategory][toUnit];
      return value * c;
    } else {
      const Cf0 = CONVERSION_FACTORS[unitCategory][fromUnit].c0;
      const Cf1 = CONVERSION_FACTORS[unitCategory][fromUnit].c1;
      const Ct0 = CONVERSION_FACTORS[unitCategory][toUnit].c0;
      const Ct1 = CONVERSION_FACTORS[unitCategory][toUnit].c1;
      return (value * Cf0 + Cf1 - Ct1) / Ct0;
    }
  };
  const formatValue = (value, decimalPlaces) => {
    let formattedValue;
    if (Number.isInteger(value)) {
      formattedValue = value.toString();
    } else {
      formattedValue = value.toFixed(decimalPlaces).replace(/\.?0+$/, "");
    }
    if (Math.abs(parseFloat(formattedValue)) >= 1e3) {
      const parts = formattedValue.split(".");
      parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
      formattedValue = parts.join(".");
    }
    return formattedValue;
  };
  const parseFeetInchesValue = (valueString) => {
    const regexFeetInches = /(\d+)\'(\s*-\s*)?(\d+)?(\s+)?(\d+)?\/?(\d+)?/;
    const regexFeet = /(\d+)\'/;
    const regexInches = /(\d+)/;
    let match = valueString.match(regexFeetInches);
    if (match) {
      const feet = parseInt(match[1]) || 0;
      const inches = parseInt(match[3]) || 0;
      const numerator = parseInt(match[5]) || 0;
      const denominator = parseInt(match[6]) || 1;
      return calculateTotalInches(feet, inches, numerator, denominator);
    }
    match = valueString.match(regexFeet);
    if (match) {
      const feet = parseInt(match[1]) || 0;
      return calculateTotalInches(feet, 0, 0, 1);
    }
    match = valueString.match(regexInches);
    if (match) {
      const inches = parseInt(match[1]) || 0;
      return calculateTotalInches(0, inches, 0, 1);
    }
    return parseFloat(valueString);
  };
  const calculateTotalInches = (feet, inches, numerator, denominator) => {
    return feet * 12 + inches + numerator / denominator;
  };
  const formatFeetInchesValue = (totalInches, inchPrecision = '1/16"') => {
    if (totalInches < 0) {
      return `-${formatFeetInchesValue(-totalInches, inchPrecision)}`;
    }
    const precisionDenominator = parseInt(inchPrecision.split("/")[1].replace('"', ""));
    let feet = Math.floor(totalInches / 12);
    let inches = Math.floor(totalInches % 12);
    const fractionalInches = totalInches - Math.floor(totalInches);
    let fractionStr = "";
    if (fractionalInches > 0) {
      if (inchPrecision !== 0) {
        let numerator = Math.round(fractionalInches * precisionDenominator);
        const gcd = (a, b) => b ? gcd(b, a % b) : a;
        const commonDivisor = gcd(numerator, precisionDenominator);
        fractionStr = ` ${numerator / commonDivisor}/${precisionDenominator / commonDivisor}`;
        if (fractionStr.trim() === "1/1") {
          inches++;
          if (inches >= 12) {
            feet++;
            inches -= 12;
          }
          fractionStr = "";
        }
      }
    }
    let output = "";
    if (feet > 0) {
      output += `${feet}'`;
    }
    if (feet > 0 && (inches > 0 || fractionStr !== "")) {
      output += `-`;
    }
    if (inches > 0) {
      output += `${inches}`;
    }
    if (fractionStr !== "") {
      output += fractionStr;
    }
    if (inches > 0 || fractionStr !== "") {
      output += '"';
    }
    return output.trim();
  };
  const convertFromFeetInches = (totalInches, toUnit) => {
    const inchesInMeters = totalInches * 0.0254;
    return convertValue(inchesInMeters, "m", toUnit, "Length");
  };
  const convertToFeetInches = (value, fromUnit) => {
    const valueInMeters = convertValue(value, fromUnit, "m", "Length");
    return valueInMeters / 0.0254;
  };
  class PhysicalQuantity extends HTMLElement {
    constructor() {
      super();
      this.attachShadow({ mode: "open" });
      this.unitCategory = "";
      console.log("PhysicalQuantity constructor called");
    }
    connectedCallback() {
      console.log("connectedCallback called");
      this.unit = this.getAttribute("unit");
      console.log("Initial unit:", this.unit);
      this.updateUnitCategory();
      this.inputValue = this.getAttribute("value");
      console.log("Initial inputValue:", this.inputValue);
      this.value = this.parseValue(this.inputValue, this.unit);
      console.log("Parsed value:", this.value);
      this.decimalPlaces = parseInt(this.getAttribute("decimal-places")) || 2;
      this.showUnitArrow = !this.hasAttribute("show-unit-arrow") || this.getAttribute("show-unit-arrow") === "true";
      console.log("Initial state:", { unit: this.unit, value: this.value, unitCategory: this.unitCategory, decimalPlaces: this.decimalPlaces, showUnitArrow: this.showUnitArrow });
      this.render();
      this.attachEventListeners();
    }
    disconnectedCallback() {
      this.removeEventListeners();
    }
    static get observedAttributes() {
      return ["value", "unit", "decimal-places", "show-unit-arrow"];
    }
    attributeChangedCallback(name, oldValue, newValue) {
      console.log(`attributeChangedCallback called: ${name}`, { oldValue, newValue });
      if (name === "value") {
        this.inputValue = newValue || "0";
        this.value = this.parseValue(this.inputValue, this.unit);
        console.log("New value parsed:", this.value);
      } else if (name === "unit") {
        const oldUnit = this.unit;
        const oldCategory = this.unitCategory;
        this.unit = newValue || "mm";
        this.updateUnitCategory();
        if (oldUnit !== this.unit) {
          if (oldCategory === this.unitCategory) {
            console.log("Converting value:", { from: oldUnit, to: this.unit, value: this.value, unitCategory: this.unitCategory });
            this.value = convertValue({
              value: this.value,
              fromUnit: oldUnit,
              toUnit: this.unit,
              unitCategory: this.unitCategory
            });
          } else {
            console.log("Unit category changed, keeping original value");
          }
          console.log("New value:", this.value);
        }
      } else if (name === "decimal-places") {
        this.decimalPlaces = parseInt(newValue) || 2;
        console.log("New decimal places:", this.decimalPlaces);
      } else if (name === "show-unit-arrow") {
        this.showUnitArrow = newValue === null || newValue === "true";
        console.log("Show unit arrow:", this.showUnitArrow);
      }
      this.render();
    }
    updateUnitCategory() {
      console.log("updateUnitCategory called with unit:", this.unit);
      this.unitCategory = getUnitCategory(this.unit);
      console.log("Updated unit category:", this.unitCategory);
    }
    parseValue(value, unit) {
      console.log("parseValue called with:", { value, unit });
      if (typeof value === "string" && value.trim() === "") {
        console.log("Empty string value, returning 0");
        return 0;
      }
      const parsedValue = unit === "ft-in" ? parseFeetInchesValue(value) : parseFloat(value) || 0;
      console.log("Parsed value:", parsedValue);
      return parsedValue;
    }
    formatDisplayValue() {
      if (this.unit === "ft-in") {
        return formatFeetInchesValue(this.value);
      } else {
        return formatValue(this.value, this.decimalPlaces);
      }
    }
    handleUnitChange(event) {
      if (event.target.tagName === "SELECT") {
        const newUnit = event.target.value;
        console.log("handleUnitChange:", { from: this.unit, to: newUnit, value: this.value, unitCategory: this.unitCategory });
        this.value = convertValue(this.value, this.unit, newUnit, this.unitCategory);
        console.log("Converted value:", this.value);
        this.unit = newUnit;
        this.updateUnitCategory();
        this.render();
      }
      this.updateDropdownWidth();
    }
    render() {
      const formattedValue = this.formatDisplayValue();
      this.shadowRoot.innerHTML = `
      <style>
        :host {
          display: inline-flex;
          align-items: baseline;
          vertical-align: baseline;
        }
        .quantity {
          display: inline-flex;
          align-items: baseline;
          position: relative;
        }
        .value {
          margin-right: 2px;
          margin-left: 2px;
          position: relative;
        }
        .unit-container {
          position: relative;
          display: inline-flex;
          align-items: baseline;
        }
        .unit-container select {
          appearance: ${this.showUnitArrow ? "auto" : "none"};
          -webkit-appearance: ${this.showUnitArrow ? "auto" : "none"};
          -moz-appearance: ${this.showUnitArrow ? "auto" : "none"};
          border-radius: 0.15em;
          border: none;
          margin: 0;
          padding: 0 0.1em 0 0.2em;
          color: blue;
          background-color: lightgray;
          font-family: inherit;
          font-size: 0.9em;
          line-height: normal;
          cursor: pointer;
          text-align: left;
          text-align-last: center;
          /* height: 1.1em; */
          vertical-align: baseline;
          min-width: 2.5em;
        }
        .unit-container select::-ms-expand {
          display: ${this.showUnitArrow ? "block" : "none"};
        }
      </style>
      
      <div class="quantity">
        <span class="value">${formattedValue}</span>
        <div class="unit-container">
          <select>
            ${(UNITS[this.unitCategory] || [this.unit]).map((unit) => `<option value="${unit}" ${unit === this.unit ? "selected" : ""}>
                ${unit}</option>`).join("")}
          </select>
        </div>        
      </div> 
    `;
      this.updateDropdownWidth();
    }
    updateDropdownWidth() {
      const selectElement = this.shadowRoot.querySelector("select");
      if (!selectElement)
        return;
      const tempSpan = document.createElement("span");
      tempSpan.style.visibility = "hidden";
      tempSpan.style.position = "absolute";
      tempSpan.style.whiteSpace = "nowrap";
      tempSpan.style.font = window.getComputedStyle(selectElement).font;
      document.body.appendChild(tempSpan);
      tempSpan.textContent = this.unit;
      const textWidth = tempSpan.offsetWidth;
      document.body.removeChild(tempSpan);
      const selectPadding = this.showUnitArrow ? 16 : 6;
      const arrowWidth = this.showUnitArrow ? 8 : 0;
      const extraPadding = 2;
      let finalWidth = textWidth + selectPadding + arrowWidth + extraPadding;
      finalWidth = Math.max(finalWidth, 30);
      selectElement.style.width = `${finalWidth}px`;
    }
    attachEventListeners() {
      this.shadowRoot.addEventListener("change", this.handleUnitChange.bind(this));
    }
    removeEventListeners() {
      this.shadowRoot.removeEventListener("change", this.handleUnitChange.bind(this));
    }
  }
  class UcQtyPair extends HTMLElement {
    constructor() {
      super();
      this.attachShadow({ mode: "open" });
      this.values = [];
      this.unit = "";
      this.unitCategory = "";
      this.decimalPlaces = 2;
      this.showUnitArrow = true;
      this.format = "";
    }
    connectedCallback() {
      this.unit = this.getAttribute("unit") || "cm";
      this.parsePairValues(this.getAttribute("values"));
      this.unitCategory = getUnitCategory(this.unit);
      this.decimalPlaces = parseInt(this.getAttribute("decimal-places")) || 2;
      this.showUnitArrow = !this.hasAttribute("show-unit-arrow") || this.getAttribute("show-unit-arrow") === "true";
      this.render();
      this.attachEventListeners();
    }
    static get observedAttributes() {
      return ["values", "unit", "decimal-places", "show-unit-arrow"];
    }
    attributeChangedCallback(name, oldValue, newValue) {
      if (name === "values") {
        this.parsePairValues(newValue);
      } else if (name === "unit") {
        const oldUnit = this.unit;
        this.unit = newValue;
        this.unitCategory = getUnitCategory(newValue);
        if (oldUnit !== newValue) {
          this.values = this.values.map((value) => convertValue(value, oldUnit, newValue, this.unitCategory));
        }
      } else if (name === "decimal-places") {
        this.decimalPlaces = parseInt(newValue) || 2;
      } else if (name === "show-unit-arrow") {
        this.showUnitArrow = newValue === null || newValue === "true";
      }
      this.render();
    }
    render() {
      const formattedValues = this.values.map((value) => this.formatPairValue(value));
      let valuesHtml;
      if (this.format === "x") {
        valuesHtml = `${formattedValues[0]} <span class="unit-text">${this.unit}</span> x ${formattedValues[1]}`;
      } else {
        valuesHtml = `(${formattedValues.join(", ")})`;
      }
      this.shadowRoot.innerHTML = `
      <style>
        :host {
          display: inline-flex;
          align-items: baseline;
          vertical-align: baseline;
        }
        .quantity-pair {
          display: inline-flex;
          align-items: baseline;
          position: relative;
        }
        .values {
          margin-right: 2px;
          margin-left: 2px;
          position: relative;
        }
        .unit-text {
          color: blue;
          background-color: lightgray;
          font-family: inherit;
          font-size: 0.9em;
          line-height: normal;
          border-radius: 0.15em;
          padding: 0 0.2em;
        }
        .unit-container {
          position: relative;
          display: inline-flex;
          align-items: baseline;
        }
        .unit-container select {
          appearance: ${this.showUnitArrow ? "auto" : "none"};
          -webkit-appearance: ${this.showUnitArrow ? "auto" : "none"};
          -moz-appearance: ${this.showUnitArrow ? "auto" : "none"};
          border-radius: 0.15em;
          border: none;
          margin: 0;
          padding: 0 0.1em 0 0.2em;
          color: blue;
          background-color: lightgray;
          font-family: inherit;
          font-size: 0.9em;
          line-height: normal;
          cursor: pointer;
          text-align: left;
          text-align-last: center;
          vertical-align: baseline;
          min-width: 2.5em;
        }
      </style>

      <div class="quantity-pair">
        <span class="values">${valuesHtml}</span>
        <div class="unit-container">
          <select>
            ${(UNITS[this.unitCategory] || [this.unit]).map((unit) => `<option value="${unit}" ${unit === this.unit ? "selected" : ""}>${unit}</option>`).join("")}
          </select>
        </div>
      </div>
    `;
      this.updateDropdownWidth();
    }
    updateDropdownWidth() {
      const selectElement = this.shadowRoot.querySelector("select");
      if (!selectElement)
        return;
      const tempSpan = document.createElement("span");
      tempSpan.style.visibility = "hidden";
      tempSpan.style.position = "absolute";
      tempSpan.style.whiteSpace = "nowrap";
      tempSpan.style.font = window.getComputedStyle(selectElement).font;
      document.body.appendChild(tempSpan);
      tempSpan.textContent = this.unit;
      const textWidth = tempSpan.offsetWidth;
      document.body.removeChild(tempSpan);
      const selectPadding = this.showUnitArrow ? 16 : 6;
      const arrowWidth = this.showUnitArrow ? 8 : 0;
      const extraPadding = 2;
      let finalWidth = textWidth + selectPadding + arrowWidth + extraPadding;
      finalWidth = Math.max(finalWidth, 30);
      selectElement.style.width = `${finalWidth}px`;
    }
    attachEventListeners() {
      this.shadowRoot.addEventListener("change", this.handleUnitChange.bind(this));
    }
    parsePairValues(valuesString) {
      this.format = "";
      if (!valuesString)
        return;
      if (valuesString.startsWith("(") && valuesString.endsWith(")")) {
        valuesString = valuesString.slice(1, -1);
      }
      if (valuesString.includes("x")) {
        this.values = valuesString.split("x").map((v) => this.parseValue(v, this.unit));
        this.format = "x";
      } else if (valuesString.includes(",")) {
        this.values = valuesString.split(",").map((s) => s.trim()).map((v) => this.parseValue(v, this.unit));
        this.format = "tuple";
      }
    }
    parseValue(value, unit) {
      return unit === "ft-in" ? parseFeetInchesValue(value) : parseFloat(value);
    }
    formatPairValue(value) {
      if (this.unit === "ft-in") {
        return formatFeetInchesValue(value);
      } else {
        return formatValue(value, this.decimalPlaces);
      }
    }
    handleUnitChange(event) {
      if (event.target.tagName === "SELECT") {
        const newUnit = event.target.value;
        this.values = this.values.map((value) => convertValue(value, this.unit, newUnit, this.unitCategory));
        this.unit = newUnit;
        this.render();
      }
      this.updateDropdownWidth();
    }
  }
  class UcQtyTriplet extends HTMLElement {
    constructor() {
      super();
      this.attachShadow({ mode: "open" });
      this.values = [];
      this.unit = "";
      this.unitCategory = "";
      this.decimalPlaces = 2;
      this.showUnitArrow = true;
      this.format = "";
    }
    connectedCallback() {
      this.unit = this.getAttribute("unit") || "cm";
      this.parseTripletValues(this.getAttribute("values"));
      this.unitCategory = getUnitCategory(this.unit);
      this.decimalPlaces = parseInt(this.getAttribute("decimal-places")) || 2;
      this.showUnitArrow = !this.hasAttribute("show-unit-arrow") || this.getAttribute("show-unit-arrow") === "true";
      this.render();
      this.attachEventListeners();
    }
    static get observedAttributes() {
      return ["values", "unit", "decimal-places", "show-unit-arrow"];
    }
    attributeChangedCallback(name, oldValue, newValue) {
      if (name === "values") {
        this.parseTripletValues(newValue);
      } else if (name === "unit") {
        const oldUnit = this.unit;
        this.unit = newValue;
        this.unitCategory = getUnitCategory(newValue);
        if (oldUnit !== newValue) {
          this.values = this.values.map((value) => convertValue(value, oldUnit, newValue, this.unitCategory));
        }
      } else if (name === "decimal-places") {
        this.decimalPlaces = parseInt(newValue) || 2;
      } else if (name === "show-unit-arrow") {
        this.showUnitArrow = newValue === null || newValue === "true";
      }
      this.render();
    }
    parseValue(value, unit) {
      return unit === "ft-in" ? parseFeetInchesValue(value) : parseFloat(value);
    }
    parseTripletValues(valuesString) {
      this.format = "";
      if (!valuesString)
        return;
      if (valuesString.startsWith("(") && valuesString.endsWith(")")) {
        valuesString = valuesString.slice(1, -1);
      }
      if (valuesString.includes("x")) {
        this.values = valuesString.split("x").map((v) => this.parseValue(v, this.unit));
        this.format = "x";
      } else if (valuesString.includes(",")) {
        this.values = valuesString.split(",").map((s) => s.trim()).map((v) => this.parseValue(v, this.unit));
        this.format = "tuple";
      }
    }
    formatTripletValue(value) {
      if (this.unit === "ft-in") {
        return formatFeetInchesValue(value);
      } else {
        return formatValue(value, this.decimalPlaces);
      }
    }
    formatTriplet(values) {
      let result = "";
      const formattedValues = values.map((value) => this.formatTripletValue(value));
      if (this.format === "x") {
        result = `${formattedValues[0]} <span class="unit-text">${this.unit}</span> x ${formattedValues[1]} <span class="unit-text">${this.unit}</span> x ${formattedValues[2]}`;
      } else if (this.format === "tuple") {
        result = "(" + formattedValues.join(", ") + ")";
      }
      return result;
    }
    render() {
      const formattedTriplet = this.formatTriplet(this.values);
      this.shadowRoot.innerHTML = `
      <style>
        :host {
          display: inline-flex;
          align-items: baseline;
          vertical-align: baseline;
        }
        .quantity-triplet {
          display: inline-flex;
          align-items: baseline;
          position: relative;
        }
        .values {
          margin-right: 2px;
          position: relative;
        }
        .unit-text,
        .unit-container,
        .unit-container select {
          color: blue;
          background-color: lightgray;
          font-family: inherit;
          font-size: 0.9em;
          line-height: normal;
          border-radius: 0.15em;
          padding: 0 0.2em;
        }
        .unit-container {
          position: relative;
          display: inline-flex;
          align-items: baseline;
        }
        .unit-container select {
          appearance: ${this.showUnitArrow ? "auto" : "none"};
          -webkit-appearance: ${this.showUnitArrow ? "auto" : "none"};
          -moz-appearance: ${this.showUnitArrow ? "auto" : "none"};
          border: none;
          margin: 0;
          cursor: pointer;
          text-align: left;
          text-align-last: center;
          min-width: 2.5em;
        }
      </style>
      
      <span class="quantity-triplet">
        <span class="values">${formattedTriplet}</span>
        <div class="unit-container">
          <select>
            ${(UNITS[this.unitCategory] || [this.unit]).map((unit) => `<option value="${unit}" ${unit === this.unit ? "selected" : ""}>
                ${unit}</option>`).join("")}
          </select>
        </div>
      </span>     
    `;
      this.updateDropdownWidth();
    }
    updateDropdownWidth() {
      const selectElement = this.shadowRoot.querySelector("select");
      if (!selectElement)
        return;
      const tempSpan = document.createElement("span");
      tempSpan.style.visibility = "hidden";
      tempSpan.style.position = "absolute";
      tempSpan.style.whiteSpace = "nowrap";
      tempSpan.style.font = window.getComputedStyle(selectElement).font;
      document.body.appendChild(tempSpan);
      tempSpan.textContent = this.unit;
      const textWidth = tempSpan.offsetWidth;
      document.body.removeChild(tempSpan);
      const selectPadding = this.showUnitArrow ? 16 : 6;
      const arrowWidth = this.showUnitArrow ? 8 : 0;
      const extraPadding = 2;
      let finalWidth = textWidth + selectPadding + arrowWidth + extraPadding;
      finalWidth = Math.max(finalWidth, 30);
      selectElement.style.width = `${finalWidth}px`;
    }
    attachEventListeners() {
      this.shadowRoot.addEventListener("change", this.handleUnitChange.bind(this));
    }
    handleUnitChange(event) {
      if (event.target.tagName === "SELECT") {
        const newUnit = event.target.value;
        this.values = this.values.map((value) => convertValue(value, this.unit, newUnit, this.unitCategory));
        this.unit = newUnit;
        this.render();
      }
      this.updateDropdownWidth();
    }
  }
  const defineCustomElement = (name, component) => {
    if (typeof window !== "undefined" && !customElements.get(name)) {
      customElements.define(name, component);
    }
  };
  defineCustomElement("physical-quantity", PhysicalQuantity);
  defineCustomElement("uc-qty", class extends PhysicalQuantity {
  });
  defineCustomElement("uc-qty-pair", UcQtyPair);
  defineCustomElement("uc-qty-triplet", UcQtyTriplet);
  exports2.PhysicalQuantity = PhysicalQuantity;
  exports2.UcQtyPair = UcQtyPair;
  exports2.UcQtyTriplet = UcQtyTriplet;
  Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
});
