'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.createPlanckTemperature = exports.createPlanckCharge = exports.createPlanckTime = exports.createPlanckMass = exports.createPlanckLength = exports.createGravity = exports.createMolarMassC12 = exports.createMolarMass = exports.createWienDisplacement = exports.createStefanBoltzmann = exports.createSecondRadiation = exports.createSackurTetrode = exports.createMolarVolume = exports.createMolarPlanckConstant = exports.createGasConstant = exports.createLoschmidt = exports.createFirstRadiation = exports.createFaraday = exports.createBoltzmann = exports.createAvogadro = exports.createAtomicMass = exports.createEfimovFactor = exports.createWeakMixingAngle = exports.createThomsonCrossSection = exports.createRydberg = exports.createQuantumOfCirculation = exports.createNeutronMass = exports.createDeuteronMass = exports.createProtonMass = exports.createHartreeEnergy = exports.createFineStructure = exports.createFermiCoupling = exports.createElectronMass = exports.createClassicalElectronRadius = exports.createBohrRadius = exports.createKlitzing = exports.createNuclearMagneton = exports.createMagneticFluxQuantum = exports.createInverseConductanceQuantum = exports.createConductanceQuantum = exports.createBohrMagneton = exports.createElementaryCharge = exports.createCoulomb = exports.createVacuumImpedance = exports.createElectricConstant = exports.createMagneticConstant = exports.createReducedPlanckConstant = exports.createPlanckConstant = exports.createGravitationConstant = exports.createSpeedOfLight = void 0;

var _factory = require("../../utils/factory");

// Source: https://en.wikipedia.org/wiki/Physical_constant
// Universal constants
var createSpeedOfLight =
/* #__PURE__ */
unitFactory('speedOfLight', '299792458', 'm s^-1');
exports.createSpeedOfLight = createSpeedOfLight;
var createGravitationConstant =
/* #__PURE__ */
unitFactory('gravitationConstant', '6.6738480e-11', 'm^3 kg^-1 s^-2');
exports.createGravitationConstant = createGravitationConstant;
var createPlanckConstant =
/* #__PURE__ */
unitFactory('planckConstant', '6.626069311e-34', 'J s');
exports.createPlanckConstant = createPlanckConstant;
var createReducedPlanckConstant =
/* #__PURE__ */
unitFactory('reducedPlanckConstant', '1.05457172647e-34', 'J s'); // Electromagnetic constants

exports.createReducedPlanckConstant = createReducedPlanckConstant;
var createMagneticConstant =
/* #__PURE__ */
unitFactory('magneticConstant', '1.2566370614e-6', 'N A^-2');
exports.createMagneticConstant = createMagneticConstant;
var createElectricConstant =
/* #__PURE__ */
unitFactory('electricConstant', '8.854187817e-12', 'F m^-1');
exports.createElectricConstant = createElectricConstant;
var createVacuumImpedance =
/* #__PURE__ */
unitFactory('vacuumImpedance', '376.730313461', 'ohm');
exports.createVacuumImpedance = createVacuumImpedance;
var createCoulomb =
/* #__PURE__ */
unitFactory('coulomb', '8.9875517873681764e9', 'N m^2 C^-2');
exports.createCoulomb = createCoulomb;
var createElementaryCharge =
/* #__PURE__ */
unitFactory('elementaryCharge', '1.60217656535e-19', 'C');
exports.createElementaryCharge = createElementaryCharge;
var createBohrMagneton =
/* #__PURE__ */
unitFactory('bohrMagneton', '9.2740096820e-24', 'J T^-1');
exports.createBohrMagneton = createBohrMagneton;
var createConductanceQuantum =
/* #__PURE__ */
unitFactory('conductanceQuantum', '7.748091734625e-5', 'S');
exports.createConductanceQuantum = createConductanceQuantum;
var createInverseConductanceQuantum =
/* #__PURE__ */
unitFactory('inverseConductanceQuantum', '12906.403721742', 'ohm');
exports.createInverseConductanceQuantum = createInverseConductanceQuantum;
var createMagneticFluxQuantum =
/* #__PURE__ */
unitFactory('magneticFluxQuantum', '2.06783375846e-15', 'Wb');
exports.createMagneticFluxQuantum = createMagneticFluxQuantum;
var createNuclearMagneton =
/* #__PURE__ */
unitFactory('nuclearMagneton', '5.0507835311e-27', 'J T^-1');
exports.createNuclearMagneton = createNuclearMagneton;
var createKlitzing =
/* #__PURE__ */
unitFactory('klitzing', '25812.807443484', 'ohm'); // export const createJosephson = /* #__PURE__ */ unitFactory('josephson', '4.8359787011e-14 Hz V^-1') // TODO: support for Hz needed
// Atomic and nuclear constants

exports.createKlitzing = createKlitzing;
var createBohrRadius =
/* #__PURE__ */
unitFactory('bohrRadius', '5.291772109217e-11', 'm');
exports.createBohrRadius = createBohrRadius;
var createClassicalElectronRadius =
/* #__PURE__ */
unitFactory('classicalElectronRadius', '2.817940326727e-15', 'm');
exports.createClassicalElectronRadius = createClassicalElectronRadius;
var createElectronMass =
/* #__PURE__ */
unitFactory('electronMass', '9.1093829140e-31', 'kg');
exports.createElectronMass = createElectronMass;
var createFermiCoupling =
/* #__PURE__ */
unitFactory('fermiCoupling', '1.1663645e-5', 'GeV^-2');
exports.createFermiCoupling = createFermiCoupling;
var createFineStructure = numberFactory('fineStructure', 7.297352569824e-3);
exports.createFineStructure = createFineStructure;
var createHartreeEnergy =
/* #__PURE__ */
unitFactory('hartreeEnergy', '4.3597443419e-18', 'J');
exports.createHartreeEnergy = createHartreeEnergy;
var createProtonMass =
/* #__PURE__ */
unitFactory('protonMass', '1.67262177774e-27', 'kg');
exports.createProtonMass = createProtonMass;
var createDeuteronMass =
/* #__PURE__ */
unitFactory('deuteronMass', '3.3435830926e-27', 'kg');
exports.createDeuteronMass = createDeuteronMass;
var createNeutronMass =
/* #__PURE__ */
unitFactory('neutronMass', '1.6749271613e-27', 'kg');
exports.createNeutronMass = createNeutronMass;
var createQuantumOfCirculation =
/* #__PURE__ */
unitFactory('quantumOfCirculation', '3.636947552024e-4', 'm^2 s^-1');
exports.createQuantumOfCirculation = createQuantumOfCirculation;
var createRydberg =
/* #__PURE__ */
unitFactory('rydberg', '10973731.56853955', 'm^-1');
exports.createRydberg = createRydberg;
var createThomsonCrossSection =
/* #__PURE__ */
unitFactory('thomsonCrossSection', '6.65245873413e-29', 'm^2');
exports.createThomsonCrossSection = createThomsonCrossSection;
var createWeakMixingAngle = numberFactory('weakMixingAngle', 0.222321);
exports.createWeakMixingAngle = createWeakMixingAngle;
var createEfimovFactor = numberFactory('efimovFactor', 22.7); // Physico-chemical constants

exports.createEfimovFactor = createEfimovFactor;
var createAtomicMass =
/* #__PURE__ */
unitFactory('atomicMass', '1.66053892173e-27', 'kg');
exports.createAtomicMass = createAtomicMass;
var createAvogadro =
/* #__PURE__ */
unitFactory('avogadro', '6.0221412927e23', 'mol^-1');
exports.createAvogadro = createAvogadro;
var createBoltzmann =
/* #__PURE__ */
unitFactory('boltzmann', '1.380648813e-23', 'J K^-1');
exports.createBoltzmann = createBoltzmann;
var createFaraday =
/* #__PURE__ */
unitFactory('faraday', '96485.336521', 'C mol^-1');
exports.createFaraday = createFaraday;
var createFirstRadiation =
/* #__PURE__ */
unitFactory('firstRadiation', '3.7417715317e-16', 'W m^2'); // export const createSpectralRadiance = /* #__PURE__ */ unitFactory('spectralRadiance', '1.19104286953e-16', 'W m^2 sr^-1') // TODO spectralRadiance

exports.createFirstRadiation = createFirstRadiation;
var createLoschmidt =
/* #__PURE__ */
unitFactory('loschmidt', '2.686780524e25', 'm^-3');
exports.createLoschmidt = createLoschmidt;
var createGasConstant =
/* #__PURE__ */
unitFactory('gasConstant', '8.314462175', 'J K^-1 mol^-1');
exports.createGasConstant = createGasConstant;
var createMolarPlanckConstant =
/* #__PURE__ */
unitFactory('molarPlanckConstant', '3.990312717628e-10', 'J s mol^-1');
exports.createMolarPlanckConstant = createMolarPlanckConstant;
var createMolarVolume =
/* #__PURE__ */
unitFactory('molarVolume', '2.241396820e-10', 'm^3 mol^-1');
exports.createMolarVolume = createMolarVolume;
var createSackurTetrode = numberFactory('sackurTetrode', -1.164870823);
exports.createSackurTetrode = createSackurTetrode;
var createSecondRadiation =
/* #__PURE__ */
unitFactory('secondRadiation', '1.438777013e-2', 'm K');
exports.createSecondRadiation = createSecondRadiation;
var createStefanBoltzmann =
/* #__PURE__ */
unitFactory('stefanBoltzmann', '5.67037321e-8', 'W m^-2 K^-4');
exports.createStefanBoltzmann = createStefanBoltzmann;
var createWienDisplacement =
/* #__PURE__ */
unitFactory('wienDisplacement', '2.897772126e-3', 'm K'); // Adopted values

exports.createWienDisplacement = createWienDisplacement;
var createMolarMass =
/* #__PURE__ */
unitFactory('molarMass', '1e-3', 'kg mol^-1');
exports.createMolarMass = createMolarMass;
var createMolarMassC12 =
/* #__PURE__ */
unitFactory('molarMassC12', '1.2e-2', 'kg mol^-1');
exports.createMolarMassC12 = createMolarMassC12;
var createGravity =
/* #__PURE__ */
unitFactory('gravity', '9.80665', 'm s^-2'); // atm is defined in Unit.js
// Natural units

exports.createGravity = createGravity;
var createPlanckLength =
/* #__PURE__ */
unitFactory('planckLength', '1.61619997e-35', 'm');
exports.createPlanckLength = createPlanckLength;
var createPlanckMass =
/* #__PURE__ */
unitFactory('planckMass', '2.1765113e-8', 'kg');
exports.createPlanckMass = createPlanckMass;
var createPlanckTime =
/* #__PURE__ */
unitFactory('planckTime', '5.3910632e-44', 's');
exports.createPlanckTime = createPlanckTime;
var createPlanckCharge =
/* #__PURE__ */
unitFactory('planckCharge', '1.87554595641e-18', 'C');
exports.createPlanckCharge = createPlanckCharge;
var createPlanckTemperature =
/* #__PURE__ */
unitFactory('planckTemperature', '1.41683385e+32', 'K'); // helper function to create a factory function which creates a physical constant,
// a Unit with either a number value or a BigNumber value depending on the configuration

exports.createPlanckTemperature = createPlanckTemperature;

function unitFactory(name, valueStr, unitStr) {
  var dependencies = ['config', 'Unit', 'BigNumber'];
  return (0, _factory.factory)(name, dependencies, function (_ref) {
    var config = _ref.config,
        Unit = _ref.Unit,
        BigNumber = _ref.BigNumber;
    // Note that we can parse into number or BigNumber.
    // We do not parse into Fractions as that doesn't make sense: we would lose precision of the values
    // Therefore we dont use Unit.parse()
    var value = config.number === 'BigNumber' ? new BigNumber(valueStr) : parseFloat(valueStr);
    var unit = new Unit(value, unitStr);
    unit.fixPrefix = true;
    return unit;
  });
} // helper function to create a factory function which creates a numeric constant,
// either a number or BigNumber depending on the configuration


function numberFactory(name, value) {
  var dependencies = ['config', 'BigNumber'];
  return (0, _factory.factory)(name, dependencies, function (_ref2) {
    var config = _ref2.config,
        BigNumber = _ref2.BigNumber;
    return config.number === 'BigNumber' ? new BigNumber(value) : value;
  });
}