{"version":3,"file":"js-joda.js","sources":["../src/errors.js","../src/assert.js","../src/MathUtil.js","../src/Enum.js","../src/temporal/TemporalAmount.js","../src/temporal/TemporalUnit.js","../src/Duration.js","../src/YearConstants.js","../src/temporal/ChronoUnit.js","../src/temporal/TemporalField.js","../src/temporal/ValueRange.js","../src/temporal/ChronoField.js","../src/temporal/TemporalQueries.js","../src/temporal/TemporalAccessor.js","../src/temporal/TemporalQuery.js","../src/DayOfWeek.js","../src/Month.js","../src/Period.js","../src/format/ParsePosition.js","../src/format/EnumMap.js","../src/format/ResolverStyle.js","../src/temporal/TemporalAdjuster.js","../src/temporal/Temporal.js","../src/temporal/DefaultInterfaceTemporal.js","../src/chrono/ChronoLocalDate.js","../src/StringUtil.js","../src/ZoneId.js","../src/zone/ZoneRules.js","../src/ZoneOffset.js","../src/format/DateTimeBuilder.js","../src/format/DateTimeParseContext.js","../src/format/DateTimePrintContext.js","../src/temporal/IsoFields.js","../src/format/DecimalStyle.js","../src/format/SignStyle.js","../src/format/TextStyle.js","../src/format/parser/CharLiteralPrinterParser.js","../src/format/parser/CompositePrinterParser.js","../src/format/parser/FractionPrinterParser.js","../src/format/parser/NumberPrinterParser.js","../src/format/parser/OffsetIdPrinterParser.js","../src/format/parser/PadPrinterParserDecorator.js","../src/format/parser/SettingsParser.js","../src/format/parser/StringLiteralPrinterParser.js","../src/zone/ZoneRulesProvider.js","../src/ZoneRegion.js","../src/format/parser/ZoneIdPrinterParser.js","../src/format/DateTimeFormatterBuilder.js","../src/format/StringBuilder.js","../src/format/DateTimeFormatter.js","../src/MonthDay.js","../src/YearMonth.js","../src/Year.js","../src/temporal/TemporalAdjusters.js","../src/chrono/IsoChronology.js","../src/OffsetTime.js","../src/chrono/ChronoZonedDateTime.js","../src/ZonedDateTime.js","../src/OffsetDateTime.js","../src/LocalDate.js","../src/chrono/ChronoLocalDateTime.js","../src/LocalDateTime.js","../src/LocalTime.js","../src/Instant.js","../src/Clock.js","../src/zone/ZoneOffsetTransition.js","../src/temporal/TemporalQueriesFactory.js","../src/zone/SystemDefaultZoneRules.js","../src/zone/SystemDefaultZoneId.js","../src/ZoneIdFactory.js","../src/_init.js","../src/convert.js","../src/temporal/NativeJsTemporal.js","../src/use.js","../src/js-joda.js"],"sourcesContent":["/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nfunction createErrorType(name, init, superErrorClass = Error) {\n function JsJodaException(message) {\n if (!Error.captureStackTrace) {\n this.stack = (new Error()).stack;\n } else {\n Error.captureStackTrace(this, this.constructor);\n }\n this.message = message;\n init && init.apply(this, arguments);\n this.toString = function () {\n return `${this.name}: ${this.message}`;\n };\n }\n JsJodaException.prototype = Object.create(superErrorClass.prototype);\n JsJodaException.prototype.name = name;\n JsJodaException.prototype.constructor = JsJodaException;\n return JsJodaException;\n}\n\nexport const DateTimeException = createErrorType('DateTimeException', messageWithCause);\nexport const DateTimeParseException = createErrorType('DateTimeParseException', messageForDateTimeParseException);\nexport const UnsupportedTemporalTypeException = createErrorType('UnsupportedTemporalTypeException', null, DateTimeException);\nexport const ArithmeticException = createErrorType('ArithmeticException');\nexport const IllegalArgumentException = createErrorType('IllegalArgumentException');\nexport const IllegalStateException = createErrorType('IllegalStateException');\nexport const NullPointerException = createErrorType('NullPointerException');\n\nfunction messageWithCause(message, cause = null) {\n let msg = message || this.name;\n if (cause !== null && cause instanceof Error) {\n msg += '\\n-------\\nCaused by: ' + cause.stack + '\\n-------\\n';\n }\n this.message = msg;\n}\n\nfunction messageForDateTimeParseException(message, text = '', index = 0, cause = null) {\n let msg = message || this.name;\n msg += ': ' + text + ', at index: ' + index;\n if (cause !== null && cause instanceof Error) {\n msg += '\\n-------\\nCaused by: ' + cause.stack + '\\n-------\\n';\n }\n this.message = msg;\n this.parsedString = () => {\n return text;\n };\n this.errorIndex = () => {\n return index;\n };\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\nimport {NullPointerException, IllegalArgumentException} from './errors';\n\nexport function assert(assertion, msg, error) {\n if(!assertion){\n if (error) {\n throw new error(msg);\n } else {\n throw new Error(msg);\n }\n }\n}\n\nexport function requireNonNull(value, parameterName) {\n if (value == null) {\n throw new NullPointerException(parameterName + ' must not be null');\n }\n return value;\n}\n\nexport function requireInstance(value, _class, parameterName) {\n if (!(value instanceof _class)) {\n throw new IllegalArgumentException(parameterName + ' must be an instance of ' + (_class.name ? _class.name : _class) + (value && value.constructor && value.constructor.name ? ', but is ' + value.constructor.name : ''));\n }\n return value;\n}\n\nexport function abstractMethodFail(methodName){\n throw new TypeError('abstract method \"' + methodName + '\" is not implemented');\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\nimport {ArithmeticException} from './errors';\n\nexport const MAX_SAFE_INTEGER = 9007199254740991;\nexport const MIN_SAFE_INTEGER = -9007199254740991;\n\n/**\n * Math helper with static function for integer operations\n */\nexport class MathUtil {\n /**\n *\n * @param {number} x\n * @param {number} y\n * @returns {number}\n */\n static intDiv(x, y) {\n let r = x/y;\n r = MathUtil.roundDown(r);\n return MathUtil.safeZero(r);\n }\n\n /**\n *\n * @param {number} x\n * @param {number} y\n * @returns {number}\n */\n static intMod(x, y) {\n let r = x - MathUtil.intDiv(x, y) * y;\n r = MathUtil.roundDown(r);\n return MathUtil.safeZero(r);\n }\n\n /**\n *\n * @param {number} r\n * @returns {number}\n */\n static roundDown(r){\n if (r < 0) {\n return Math.ceil(r);\n } else {\n return Math.floor(r);\n }\n }\n\n /**\n *\n * @param {number} x\n * @param {number} y\n * @returns {number}\n */\n static floorDiv(x, y){\n const r = Math.floor(x / y);\n return MathUtil.safeZero(r);\n }\n\n /**\n *\n * @param {number} x\n * @param {number} y\n * @returns {number}\n */\n static floorMod(x, y){\n const r = x - MathUtil.floorDiv(x, y) * y;\n return MathUtil.safeZero(r);\n }\n\n /**\n *\n * @param {number} x\n * @param {number} y\n * @returns {number}\n */\n static safeAdd(x, y) {\n MathUtil.verifyInt(x);\n MathUtil.verifyInt(y);\n if (x === 0) {\n return MathUtil.safeZero(y);\n }\n if (y === 0) {\n return MathUtil.safeZero(x);\n }\n const r = MathUtil.safeToInt(x + y);\n if (r === x || r === y) {\n throw new ArithmeticException('Invalid addition beyond MAX_SAFE_INTEGER!');\n }\n return r;\n }\n\n /**\n *\n * @param {number} x\n * @param {number} y\n * @returns {number}\n */\n static safeSubtract(x, y) {\n MathUtil.verifyInt(x);\n MathUtil.verifyInt(y);\n if (x === 0 && y === 0) {\n return 0;\n } else if (x === 0) {\n return MathUtil.safeZero(-1 * y);\n } else if (y === 0) {\n return MathUtil.safeZero(x);\n }\n return MathUtil.safeToInt(x - y);\n }\n\n /**\n *\n * @param {number} x\n * @param {number} y\n * @returns {number}\n */\n static safeMultiply(x, y) {\n MathUtil.verifyInt(x);\n MathUtil.verifyInt(y);\n if (x === 1) {\n return MathUtil.safeZero(y);\n }\n if (y === 1) {\n return MathUtil.safeZero(x);\n }\n if (x === 0 || y === 0) {\n return 0;\n }\n const r = MathUtil.safeToInt(x * y);\n if (r / y !== x || (x === MIN_SAFE_INTEGER && y === -1) || (y === MIN_SAFE_INTEGER && x === -1)) {\n throw new ArithmeticException('Multiplication overflows: ' + x + ' * ' + y);\n }\n return r;\n }\n\n /**\n *\n * @param {number} value\n * @returns {number}\n */\n static parseInt(value) {\n const r = parseInt(value);\n return MathUtil.safeToInt(r);\n }\n\n /**\n *\n * @param {number} value\n * @returns {number}\n */\n static safeToInt(value) {\n MathUtil.verifyInt(value);\n return MathUtil.safeZero(value);\n }\n\n /**\n *\n * @param {number} value\n */\n static verifyInt(value){\n if (value == null) {\n throw new ArithmeticException(`Invalid value: '${value}', using null or undefined as argument`);\n }\n if (isNaN(value)) {\n throw new ArithmeticException('Invalid int value, using NaN as argument');\n }\n if ((value % 1) !== 0) {\n throw new ArithmeticException(`Invalid value: '${value}' is a float`);\n }\n if (value > MAX_SAFE_INTEGER || value < MIN_SAFE_INTEGER) {\n throw new ArithmeticException('Calculation overflows an int: ' + value);\n }\n }\n\n /**\n * convert -0 to 0 and int as string to a number ( '1' -> 1 )\n *\n * @param {number} value\n * @returns {number}\n */\n static safeZero(value){\n return value === 0 ? 0 : +value;\n }\n\n /**\n * Compares two Numbers.\n *\n * @param {number} a the first value\n * @param {number} b the second value\n * @return {number} the result\n */\n static compareNumbers(a, b) {\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n }\n\n // convert to small integer for v8 optimisation\n static smi(int) {\n return ((int >>> 1) & 0x40000000) | (int & 0xBFFFFFFF);\n }\n\n // calculate 32 bit hash of a number and convert to SMI\n static hash(number) {\n if (number !== number || number === Infinity) {\n return 0;\n }\n let result = number;\n while (number > 0xFFFFFFFF) {\n number /= 0xFFFFFFFF;\n result ^= number;\n }\n return MathUtil.smi(result);\n }\n\n // default hashCode calculation for a number sequence as mentioned by Joshua Bloch\n static hashCode(...numbers) {\n let result = 17;\n for (const n of numbers) {\n result = (result << 5) - result + MathUtil.hash(n);\n }\n return MathUtil.hash(result);\n }\n}\n\nMathUtil.MAX_SAFE_INTEGER = MAX_SAFE_INTEGER;\nMathUtil.MIN_SAFE_INTEGER = MIN_SAFE_INTEGER;\n\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n/***\n * Base class for a pseudo enum\n */\nexport class Enum {\n constructor(name){\n this._name = name;\n }\n\n equals(other){\n return this === other;\n }\n\n toString() {\n return this._name;\n }\n\n /**\n * toJSON() use by JSON.stringify\n * delegates to toString()\n *\n * @return {string}\n */\n toJSON() {\n return this.toString();\n }\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {abstractMethodFail} from '../assert';\n\n/**\n * Framework-level interface defining an amount of time, such as\n * \"6 hours\", \"8 days\" or \"2 years and 3 months\".\n *\n * This is the base interface type for amounts of time.\n * An amount is distinct from a date or time-of-day in that it is not tied\n * to any specific point on the time-line.\n *\n * The amount can be thought of as a {@link Map} of {@link TemporalUnit} to\n * `long`, exposed via {@link getUnits} and {@link get}.\n * A simple case might have a single unit-value pair, such as \"6 hours\".\n * A more complex case may have multiple unit-value pairs, such as\n * \"7 years, 3 months and 5 days\".\n *\n * There are two common implementations.\n * {@link Period} is a date-based implementation, storing years, months and days.\n * {@link Duration} is a time-based implementation, storing seconds and nanoseconds,\n * but providing some access using other duration based units such as minutes,\n * hours and fixed 24-hour days.\n *\n * This interface is a framework-level interface that should not be widely\n * used in application code. Instead, applications should create and pass\n * around instances of concrete types, such as {@link Period} and {@link Duration}.\n *\n * @interface\n */\nexport class TemporalAmount {\n /**\n * Returns the value of the requested unit.\n * The units returned from {@link getUnits} uniquely define the\n * value of the {@link TemporalAmount}. A value must be returned\n * for each unit listed in {@link getUnits}.\n *\n * @implSpec\n * Implementations may declare support for units not listed by {@link getUnits}.\n * Typically, the implementation would define additional units\n * as conversions for the convenience of developers.\n *\n * @param {TemporalUnit} unit - the {@link TemporalUnit} for which to return the value\n * @return {number} the long value of the unit\n * @throws DateTimeException if a value for the unit cannot be obtained\n * @throws UnsupportedTemporalTypeException if the {@link unit} is not supported\n */\n // eslint-disable-next-line no-unused-vars\n get(unit) {\n abstractMethodFail('get');\n }\n \n /**\n * Returns the list of units uniquely defining the value of this TemporalAmount.\n * The list of {@link TemporalUnits} is defined by the implementation class.\n * The list is a snapshot of the units at the time {@link getUnits}\n * is called and is not mutable.\n * The units are ordered from longest duration to the shortest duration\n * of the unit.\n *\n * @implSpec\n * The list of units completely and uniquely represents the\n * state of the object without omissions, overlaps or duplication.\n * The units are in order from longest duration to shortest.\n *\n * @return {TemporalUnit[]} the List of {@link TemporalUnits}; not null\n */\n units() {\n abstractMethodFail('units');\n }\n \n /**\n * Adds to the specified temporal object.\n *\n * Adds the amount to the specified temporal object using the logic\n * encapsulated in the implementing class.\n *\n * There are two equivalent ways of using this method.\n * The first is to invoke this method directly.\n * The second is to use {@link Temporal#plus}:\n *
\n     *   // These two lines are equivalent, but the second approach is recommended\n     *   dateTime = amount.addTo(dateTime);\n     *   dateTime = dateTime.plus(adder);\n     * 
\n * It is recommended to use the second approach, {@link plus},\n * as it is a lot clearer to read in code.\n *\n * @implSpec\n * The implementation must take the input object and add to it.\n * The implementation defines the logic of the addition and is responsible for\n * documenting that logic. It may use any method on {@link Temporal} to\n * query the temporal object and perform the addition.\n * The returned object must have the same observable type as the input object\n *\n * The input object must not be altered.\n * Instead, an adjusted copy of the original must be returned.\n * This provides equivalent, safe behavior for immutable and mutable temporal objects.\n *\n * The input temporal object may be in a calendar system other than ISO.\n * Implementations may choose to document compatibility with other calendar systems,\n * or reject non-ISO temporal objects by querying the chronology (see {@link TemporalQueries#chronology}).\n *\n * This method may be called from multiple threads in parallel.\n * It must be thread-safe when invoked.\n *\n * @param {Temporal} temporal - the temporal object to add the amount to, not null\n * @return {Temporal} an object of the same observable type with the addition made, not null\n * @throws DateTimeException if unable to add\n * @throws ArithmeticException if numeric overflow occurs\n */\n // eslint-disable-next-line no-unused-vars\n addTo(temporal) {\n abstractMethodFail('addTo');\n }\n \n /**\n * Subtracts this object from the specified temporal object.\n *\n * Subtracts the amount from the specified temporal object using the logic\n * encapsulated in the implementing class.\n *\n * There are two equivalent ways of using this method.\n * The first is to invoke this method directly.\n * The second is to use {@link Temporal#minus}:\n *
\n     *   // these two lines are equivalent, but the second approach is recommended\n     *   dateTime = amount.subtractFrom(dateTime);\n     *   dateTime = dateTime.minus(amount);\n     * 
\n * It is recommended to use the second approach, {@link minus},\n * as it is a lot clearer to read in code.\n *\n * @implSpec\n * The implementation must take the input object and subtract from it.\n * The implementation defines the logic of the subtraction and is responsible for\n * documenting that logic. It may use any method on {@link Temporal} to\n * query the temporal object and perform the subtraction.\n * The returned object must have the same observable type as the input object\n *\n * The input object must not be altered.\n * Instead, an adjusted copy of the original must be returned.\n * This provides equivalent, safe behavior for immutable and mutable temporal objects.\n *\n * The input temporal object may be in a calendar system other than ISO.\n * Implementations may choose to document compatibility with other calendar systems,\n * or reject non-ISO temporal objects by querying the chronology (see {@link TemporalQueries#chronology}).\n *\n * This method may be called from multiple threads in parallel.\n * It must be thread-safe when invoked.\n *\n * @param {Temporal} temporal - the temporal object to subtract the amount from, not null\n * @return {Temporal} an object of the same observable type with the subtraction made, not null\n * @throws DateTimeException if unable to subtract\n * @throws ArithmeticException if numeric overflow occurs\n */\n // eslint-disable-next-line no-unused-vars\n subtractFrom(temporal) {\n abstractMethodFail('subtractFrom');\n }\n \n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {abstractMethodFail} from '../assert';\n\n/**\n * A unit of date-time, such as Days or Hours.\n *\n * Measurement of time is built on units, such as years, months, days, hours, minutes and seconds.\n * Implementations of this interface represent those units.\n *\n * An instance of this interface represents the unit itself, rather than an amount of the unit.\n * See {@link Period} for a class that represents an amount in terms of the common units.\n *\n * The most commonly used units are defined in {@link ChronoUnit}.\n * Further units are supplied in {@link IsoFields}.\n * Units can also be written by application code by implementing this interface.\n *\n * The unit works using double dispatch. Client code calls methods on a date-time like\n * {@link LocalDateTime} which check if the unit is a {@link ChronoUnit}.\n * If it is, then the date-time must handle it.\n * Otherwise, the method call is re-dispatched to the matching method in this interface.\n *\n * @interface\n */\nexport class TemporalUnit {\n /**\n * Gets the duration of this unit, which may be an estimate.\n *\n * All units return a duration measured in standard nanoseconds from this method.\n * The duration will be positive and non-zero.\n * For example, an hour has a duration of `60 * 60 * 1,000,000,000 ns`.\n *\n * Some units may return an accurate duration while others return an estimate.\n * For example, days have an estimated duration due to the possibility of\n * daylight saving time changes.\n * To determine if the duration is an estimate, use {@link isDurationEstimated}.\n *\n * @return {Duration} the duration of this unit, which may be an estimate.\n */\n duration() {\n abstractMethodFail('duration');\n }\n\n /**\n * Checks if the duration of the unit is an estimate.\n *\n * All units have a duration, however the duration is not always accurate.\n * For example, days have an estimated duration due to the possibility of\n * daylight saving time changes.\n * This method returns true if the duration is an estimate and false if it is\n * accurate. Note that accurate/estimated ignores leap seconds.\n *\n * @return {boolean} `true` if the duration is estimated, `false` if accurate.\n */\n isDurationEstimated() {\n abstractMethodFail('isDurationEstimated');\n }\n\n /**\n * Checks if this unit is date-based.\n *\n * @return {boolean} `true` if date unit, `false` if a time unit.\n */\n isDateBased() {\n abstractMethodFail('isDateBased');\n }\n\n /**\n * Checks if this unit is time-based.\n *\n * @return {boolean} `true` if time unit, `false` if a date unit.\n */\n isTimeBased() {\n abstractMethodFail('isTimeBased');\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this unit is supported by the specified temporal object.\n *\n * This checks that the implementing date-time can add/subtract this unit.\n * This can be used to avoid throwing an exception.\n *\n * @param {!Temporal} temporal the temporal object to check.\n * @return {boolean} `true` if the unit is supported.\n */\n // eslint-disable-next-line no-unused-vars\n isSupportedBy(temporal) {\n abstractMethodFail('isSupportedBy');\n }\n\n /**\n * Returns a copy of the specified temporal object with the specified period added.\n *\n * The period added is a multiple of this unit. For example, this method\n * could be used to add \"3 days\" to a date by calling this method on the\n * instance representing \"days\", passing the date and the period \"3\".\n * The period to be added may be negative, which is equivalent to subtraction.\n *\n * There are two equivalent ways of using this method.\n * The first is to invoke this method directly.\n * The second is to use {@link Temporal#plus}:\n *
\n     *   // these two lines are equivalent, but the second approach is recommended\n     *   temporal = thisUnit.doPlus(temporal);\n     *   temporal = temporal.plus(thisUnit);\n     * 
\n * It is recommended to use the second approach, {@link plus},\n * as it is a lot clearer to read in code.\n *\n * Implementations should perform any queries or calculations using the units\n * available in {@link ChronoUnit} or the fields available in {@link ChronoField}.\n * If the field is not supported a {@link DateTimeException} must be thrown.\n *\n * Implementations must not alter the specified temporal object.\n * Instead, an adjusted copy of the original must be returned.\n * This provides equivalent, safe behavior for immutable and mutable implementations.\n *\n * @param {!Temporal} dateTime the temporal object to adjust.\n * @param {number} periodToAdd the period of this unit to add, positive or negative.\n * @return {Temporal} the adjusted temporal object.\n * @throws DateTimeException if the period cannot be added.\n */\n // eslint-disable-next-line no-unused-vars\n addTo(dateTime, periodToAdd) {\n abstractMethodFail('addTo');\n }\n\n //-----------------------------------------------------------------------\n /**\n * Calculates the period in terms of this unit between two temporal objects of the same type.\n *\n * This calculates the period between two temporals in terms of this unit.\n * The start and end points are supplied as temporal objects and must be of the same type.\n * The result will be negative if the end is before the start.\n * For example, the period in hours between two temporal objects can be calculated\n * using {@link HOURS.between}.\n *\n * The calculation returns a whole number, representing the number of complete units between the two temporals.\n * For example, the period in hours between the times 11:30 and 13:29 will only be\n * one hour as it is one minute short of two hours.\n *\n * There are two equivalent ways of using this method.\n * The first is to invoke this method directly.\n * The second is to use {@link Temporal#until}:\n *
\n     *   // these two lines are equivalent\n     *   between = thisUnit.between(start, end);\n     *   between = start.until(end, thisUnit);\n     * 
\n * The choice should be made based on which makes the code more readable.\n *\n * For example, this method allows the number of days between two dates to be calculated:\n *
\n     *   long daysBetween = DAYS.between(start, end);\n     *   // or alternatively\n     *   long daysBetween = start.until(end, DAYS);\n     * 
\n * Implementations should perform any queries or calculations using the units available in\n * {@link ChronoUnit} or the fields available in {@link ChronoField}.\n * If the unit is not supported a {@link DateTimeException} must be thrown.\n * Implementations must not alter the specified temporal objects.\n *\n * @param {!Temporal} temporal1 the base temporal object.\n * @param {!Temporal} temporal2 the other temporal object.\n * @return {number} the period between temporal1 and temporal2 in terms of this unit;\n * positive if temporal2 is later than temporal1, negative if earlier.\n * @throws DateTimeException if the period cannot be calculated.\n * @throws ArithmeticException if numeric overflow occurs.\n */\n // eslint-disable-next-line no-unused-vars\n between(temporal1, temporal2) {\n abstractMethodFail('between');\n }\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\nimport {requireNonNull, requireInstance} from './assert';\nimport {ArithmeticException, DateTimeParseException, UnsupportedTemporalTypeException} from './errors';\nimport {MathUtil, MAX_SAFE_INTEGER, MIN_SAFE_INTEGER} from './MathUtil';\n\nimport {ChronoField} from './temporal/ChronoField';\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {TemporalAmount} from './temporal/TemporalAmount';\nimport {TemporalUnit} from './temporal/TemporalUnit';\n\nimport {LocalTime} from './LocalTime';\n\n/**\n * A time-based amount of time, such as '34.5 seconds'.\n *\n * This class models a quantity or amount of time in terms of seconds and nanoseconds.\n * It can be accessed using other duration-based units, such as minutes and hours.\n * In addition, the {@link ChronoUnit#DAYS} unit can be used and is treated as\n * exactly equal to 24 hours, thus ignoring daylight savings effects.\n * See {@link Period} for the date-based equivalent to this class.\n *\n * A physical duration could be of infinite length.\n * For practicality, the duration is stored with constraints similar to {@link Instant}.\n * The duration uses nanosecond resolution with a maximum value of the seconds that can\n * be held in a `long`. This is greater than the current estimated age of the universe.\n *\n * The range of a duration requires the storage of a number larger than a `long`.\n * To achieve this, the class stores a `long` representing seconds and an `int`\n * representing nanosecond-of-second, which will always be between 0 and 999,999,999.\n *\n * The duration is measured in \"seconds\", but these are not necessarily identical to\n * the scientific \"SI second\" definition based on atomic clocks.\n * This difference only impacts durations measured near a leap-second and should not affect\n * most applications.\n * See {@link Instant} for a discussion as to the meaning of the second and time-scales.\n *\n * ### Static properties of Class {@link Duration}\n *\n * Duration.ZERO\n *\n * Constant for a duration of zero.\n *\n */\nexport class Duration extends TemporalAmount /*implements TemporalAmount, Comparable, Serializable */ {\n\n /**\n * Constructs an instance of {@link Duration} using seconds and nanoseconds.\n *\n * @param {Number} seconds - the length of the duration in seconds, positive or negative\n * @param {Number} nanos - the nanoseconds within the second, from 0 to 999,999,999\n * @private\n */\n constructor(seconds, nanos) {\n super();\n this._seconds = MathUtil.safeToInt(seconds);\n this._nanos = MathUtil.safeToInt(nanos);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link Duration} from a number of standard 24 hour days.\n *\n * The seconds are calculated based on the standard definition of a day,\n * where each day is 86400 seconds which implies a 24 hour day.\n * The nanosecond in second field is set to zero.\n *\n * @param {Number} days - the number of days, positive or negative\n * @return {!Duration}\n * @throws ArithmeticException if the input days exceeds the capacity of {@link Duration}\n */\n static ofDays(days) {\n return Duration._create(MathUtil.safeMultiply(days, LocalTime.SECONDS_PER_DAY), 0);\n }\n\n /**\n * Obtains an instance of {@link Duration} from a number of standard hours.\n *\n * The seconds are calculated based on the standard definition of an hour,\n * where each hour is 3600 seconds.\n * The nanosecond in second field is set to zero.\n *\n * @param {Number} hours - the number of hours, positive or negative\n * @return {!Duration}\n * @throws ArithmeticException if the input hours exceeds the capacity of {@link Duration}\n */\n static ofHours(hours) {\n return Duration._create(MathUtil.safeMultiply(hours, LocalTime.SECONDS_PER_HOUR), 0);\n }\n\n /**\n * Obtains an instance of {@link Duration} from a number of standard minutes.\n *\n * The seconds are calculated based on the standard definition of a minute,\n * where each minute is 60 seconds.\n * The nanosecond in second field is set to zero.\n *\n * @param {Number} minutes - the number of minutes, positive or negative\n * @return {!Duration}\n * @throws ArithmeticException if the input minutes exceeds the capacity of {@link Duration}\n */\n static ofMinutes(minutes) {\n return Duration._create(MathUtil.safeMultiply(minutes, LocalTime.SECONDS_PER_MINUTE), 0);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link Duration} from a number of seconds\n * and an adjustment in nanoseconds.\n *\n * This method allows an arbitrary number of nanoseconds to be passed in.\n * The factory will alter the values of the second and nanosecond in order\n * to ensure that the stored nanosecond is in the range 0 to 999,999,999.\n * For example, the following will result in the exactly the same duration:\n *
\n     *  Duration.ofSeconds(3, 1);\n     *  Duration.ofSeconds(4, -999_999_999);\n     *  Duration.ofSeconds(2, 1000_000_001);\n     * 
\n *\n * @param {Number} seconds - the number of seconds, positive or negative\n * @param {Number} nanoAdjustment the nanosecond adjustment to the number of seconds, positive or negative\n * @return {!Duration}\n * @throws ArithmeticException if the adjustment causes the seconds to exceed the capacity of {@link Duration}\n */\n static ofSeconds(seconds, nanoAdjustment = 0) {\n const secs = MathUtil.safeAdd(seconds, MathUtil.floorDiv(nanoAdjustment, LocalTime.NANOS_PER_SECOND));\n const nos = MathUtil.floorMod(nanoAdjustment, LocalTime.NANOS_PER_SECOND);\n return Duration._create(secs, nos);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link Duration} from a number of milliseconds.\n *\n * The seconds and nanoseconds are extracted from the specified milliseconds.\n *\n * @param {Number} millis - the number of milliseconds, positive or negative\n * @return {!Duration}\n */\n static ofMillis(millis) {\n let secs = MathUtil.intDiv(millis, 1000);\n let mos = MathUtil.intMod(millis, 1000);\n if (mos < 0) {\n mos += 1000;\n secs--;\n }\n return Duration._create(secs, mos * 1000000);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link Duration} from a number of nanoseconds.\n *\n * The seconds and nanoseconds are extracted from the specified nanoseconds.\n *\n * @param {Number} nanos - the number of nanoseconds, positive or negative\n * @return {!Duration}\n */\n static ofNanos(nanos) {\n let secs = MathUtil.intDiv(nanos, LocalTime.NANOS_PER_SECOND);\n let nos = MathUtil.intMod(nanos, LocalTime.NANOS_PER_SECOND);\n if (nos < 0) {\n nos += LocalTime.NANOS_PER_SECOND;\n secs--;\n }\n return this._create(secs, nos);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link Duration} from a duration in the specified unit.\n *\n * The parameters represent the two parts of a phrase like '6 Hours'. For example:\n *
\n     *  Duration.of(3, SECONDS);\n     *  Duration.of(465, HOURS);\n     * 
\n * Only a subset of units are accepted by this method.\n * The unit must either have an exact duration (see {@link TemporalUnit#isDurationEstimated}) or\n * be {@link ChronoUnit#DAYS} which is treated as 24 hours. Other units throw an exception.\n *\n * @param {Number} amount - the amount of the duration, measured in terms of the unit, positive or negative\n * @param {TemporalUnit} unit - the unit that the duration is measured in, must have an exact duration, not null\n * @return {!Duration}\n * @throws DateTimeException if the period unit has an estimated duration\n * @throws ArithmeticException if a numeric overflow occurs\n */\n static of(amount, unit) {\n return Duration.ZERO.plus(amount, unit);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link Duration} from an amount.\n *\n * This obtains a duration based on the specified amount.\n * A TemporalAmount represents an amount of time, which may be date-based\n * or time-based, which this factory extracts to a duration.\n *\n * The conversion loops around the set of units from the amount and uses\n * the duration of the unit to calculate the total Duration.\n * Only a subset of units are accepted by this method.\n * The unit must either have an exact duration or be ChronoUnit.DAYS which\n * is treated as 24 hours. If any other units are found then an exception is thrown.\n *\n * @param {TemporalAmount} amount - the temporal amount to convert, not null\n * @return {Duration} the resulting duration, not null\n * @throws DateTimeException if the amount cannot be converted\n * @throws ArithmeticException if a numeric overflow occurs\n */\n static from(amount) {\n requireNonNull(amount, 'amount');\n requireInstance(amount, TemporalAmount);\n let duration = Duration.ZERO;\n amount.units().forEach((unit) => {\n duration = duration.plus(amount.get(unit), unit);\n });\n return duration;\n }\n\n /**\n * Obtains an instance of {@link Duration} representing the duration between two instants.\n *\n * Obtains a {@link Duration} representing the duration between two instants.\n * This calculates the duration between two temporal objects of the same type.\n * The difference in seconds is calculated using {@link Temporal#until}.\n * The difference in nanoseconds is calculated using by querying the\n * {@link ChronoField#NANO_OF_SECOND} field.\n *\n * The result of this method can be a negative period if the end is before the start.\n * To guarantee to obtain a positive duration call abs() on the result.\n *\n * @param {Temporal} startInclusive - the start instant, inclusive, not null\n * @param {Temporal} endExclusive - the end instant, exclusive, not null\n * @return {!Duration}\n * @throws DateTimeException if the seconds between the temporals cannot be obtained\n * @throws ArithmeticException if the calculation exceeds the capacity of {@link Duration}\n */\n static between(startInclusive, endExclusive) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(endExclusive, 'endExclusive');\n let secs = startInclusive.until(endExclusive, ChronoUnit.SECONDS);\n let nanos = 0;\n if (startInclusive.isSupported(ChronoField.NANO_OF_SECOND) && endExclusive.isSupported(ChronoField.NANO_OF_SECOND)) {\n try {\n const startNos = startInclusive.getLong(ChronoField.NANO_OF_SECOND);\n nanos = endExclusive.getLong(ChronoField.NANO_OF_SECOND) - startNos;\n if (secs > 0 && nanos < 0) {\n nanos += LocalTime.NANOS_PER_SECOND;\n } else if (secs < 0 && nanos > 0) {\n nanos -= LocalTime.NANOS_PER_SECOND;\n } else if (secs === 0 && nanos !== 0) {\n // two possible meanings for result, so recalculate secs\n const adjustedEnd = endExclusive.with(ChronoField.NANO_OF_SECOND, startNos);\n secs = startInclusive.until(adjustedEnd, ChronoUnit.SECONDS);\n }\n } catch (e) {\n // ignore and only use seconds\n }\n }\n return this.ofSeconds(secs, nanos);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains a {@link Duration} from a text string such as {@link PnDTnHnMn.nS}.\n *\n * This will parse a textual representation of a duration, including the\n * string produced by {@link toString}. The formats accepted are based\n * on the ISO-8601 duration format {@link PnDTnHnMn.nS} with days\n * considered to be exactly 24 hours.\n *\n * The string starts with an optional sign, denoted by the ASCII negative\n * or positive symbol. If negative, the whole period is negated.\n * The ASCII letter \"P\" is next in upper or lower case.\n * There are then four sections, each consisting of a number and a suffix.\n * The sections have suffixes in ASCII of \"D\", \"H\", \"M\" and \"S\" for\n * days, hours, minutes and seconds, accepted in upper or lower case.\n * The suffixes must occur in order. The ASCII letter \"T\" must occur before\n * the first occurrence, if any, of an hour, minute or second section.\n * At least one of the four sections must be present, and if \"T\" is present\n * there must be at least one section after the \"T\".\n * The number part of each section must consist of one or more ASCII digits.\n * The number may be prefixed by the ASCII negative or positive symbol.\n * The number of days, hours and minutes must parse to a `long`.\n * The number of seconds must parse to a `long` with optional fraction.\n * The decimal point may be either a dot or a comma.\n * The fractional part may have from zero to 9 digits.\n *\n * The leading plus/minus sign, and negative values for other units are\n * not part of the ISO-8601 standard.\n *\n * Examples:\n *
\n     *    \"PT20.345S\" -> parses as \"20.345 seconds\"\n     *    \"PT15M\"     -> parses as \"15 minutes\" (where a minute is 60 seconds)\n     *    \"PT10H\"     -> parses as \"10 hours\" (where an hour is 3600 seconds)\n     *    \"P2D\"       -> parses as \"2 days\" (where a day is 24 hours or 86400 seconds)\n     *    \"P2DT3H4M\"  -> parses as \"2 days, 3 hours and 4 minutes\"\n     *    \"P-6H3M\"    -> parses as \"-6 hours and +3 minutes\"\n     *    \"-P6H3M\"    -> parses as \"-6 hours and -3 minutes\"\n     *    \"-P-6H+3M\"  -> parses as \"+6 hours and -3 minutes\"\n     * 
\n *\n * @param {String} text - the text to parse, not null\n * @return {Duration} the parsed duration, not null\n * @throws DateTimeParseException if the text cannot be parsed to a duration\n */\n static parse(text) {\n requireNonNull(text, 'text');\n /**\n * The pattern for parsing.\n */\n const PATTERN = new RegExp('([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)?', 'i');\n const matches = PATTERN.exec(text);\n if (matches !== null) {\n // check for letter T but no time sections\n if ('T' === matches[3] === false) {\n const negate = '-' === matches[1];\n const dayMatch = matches[2];\n const hourMatch = matches[4];\n const minuteMatch = matches[5];\n const secondMatch = matches[6];\n const fractionMatch = matches[7];\n if (dayMatch != null || hourMatch != null || minuteMatch != null || secondMatch != null) {\n const daysAsSecs = Duration._parseNumber(text, dayMatch, LocalTime.SECONDS_PER_DAY, 'days');\n const hoursAsSecs = Duration._parseNumber(text, hourMatch, LocalTime.SECONDS_PER_HOUR, 'hours');\n const minsAsSecs = Duration._parseNumber(text, minuteMatch, LocalTime.SECONDS_PER_MINUTE, 'minutes');\n const seconds = Duration._parseNumber(text, secondMatch, 1, 'seconds');\n const negativeSecs = secondMatch != null && secondMatch.charAt(0) === '-';\n const nanos = Duration._parseFraction(text, fractionMatch, negativeSecs ? -1 : 1);\n try {\n return Duration._create(negate, daysAsSecs, hoursAsSecs, minsAsSecs, seconds, nanos);\n } catch (ex) {\n throw new DateTimeParseException('Text cannot be parsed to a Duration: overflow', text, 0, ex);\n }\n }\n }\n }\n throw new DateTimeParseException('Text cannot be parsed to a Duration', text, 0);\n }\n\n static _parseNumber(text, parsed, multiplier, errorText) {\n // regex limits to [-+]?[0-9]+\n if (parsed == null) {\n return 0;\n }\n try {\n if (parsed[0] === '+') {\n parsed = parsed.substring(1);\n }\n return MathUtil.safeMultiply(parseFloat(parsed), multiplier);\n } catch (ex) {\n throw new DateTimeParseException('Text cannot be parsed to a Duration: ' + errorText, text, 0, ex);\n }\n }\n\n static _parseFraction(text, parsed, negate) {\n // regex limits to [0-9]{0,9}\n if (parsed == null || parsed.length === 0) {\n return 0;\n }\n parsed = (parsed + '000000000').substring(0, 9);\n return parseFloat(parsed) * negate;\n }\n\n //-----------------------------------------------------------------------\n /**\n * to handle function overriding this function accepts any number of arguments, checks their type and delegates to the appropriate\n * function\n *\n * @return {Duration}\n */\n static _create() {\n if (arguments.length <= 2) {\n return Duration._createSecondsNanos(arguments[0], arguments[1]);\n } else {\n return Duration._createNegateDaysHoursMinutesSecondsNanos(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);\n }\n }\n\n static _createNegateDaysHoursMinutesSecondsNanos(negate, daysAsSecs, hoursAsSecs, minsAsSecs, secs, nanos) {\n const seconds = MathUtil.safeAdd(daysAsSecs, MathUtil.safeAdd(hoursAsSecs, MathUtil.safeAdd(minsAsSecs, secs)));\n if (negate) {\n return Duration.ofSeconds(seconds, nanos).negated();\n }\n return Duration.ofSeconds(seconds, nanos);\n }\n\n /**\n * Obtains an instance of {@link Duration} using seconds and nanoseconds.\n *\n * @param {Number} seconds - the length of the duration in seconds, positive or negative\n * @param {Number} nanoAdjustment - the nanosecond adjustment within the second, from 0 to 999,999,999\n */\n static _createSecondsNanos(seconds = 0, nanoAdjustment = 0) {\n if (seconds === 0 && nanoAdjustment === 0) {\n return Duration.ZERO;\n }\n return new Duration(seconds, nanoAdjustment);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the value of the requested unit.\n *\n * This returns a value for each of the two supported units,\n * {@link ChronoUnit#SECONDS} and {@link ChronoUnit#NANOS}.\n * All other units throw an exception.\n *\n * @param {TemporalUnit} unit the {@link TemporalUnit} for which to return the value\n * @return {number} the const value of the unit\n * @throws DateTimeException if the unit is not supported\n * @throws UnsupportedTemporalTypeException if the unit is not supported\n */\n get(unit) {\n if (unit === ChronoUnit.SECONDS) {\n return this._seconds;\n } else if (unit === ChronoUnit.NANOS) {\n return this._nanos;\n } else {\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n }\n\n units() {\n return [ChronoUnit.SECONDS, ChronoUnit.NANOS];\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this duration is zero length.\n *\n * A {@link Duration} represents a directed distance between two points on\n * the time-line and can therefore be positive, zero or negative.\n * This method checks whether the length is zero.\n *\n * @return {boolean} true if this duration has a total length equal to zero\n */\n isZero() {\n return this._seconds === 0 && this._nanos === 0;\n }\n\n /**\n * Checks if this duration is negative, excluding zero.\n *\n * A {@link Duration} represents a directed distance between two points on\n * the time-line and can therefore be positive, zero or negative.\n * This method checks whether the length is less than zero.\n *\n * @return {boolean} true if this duration has a total length less than zero\n */\n isNegative() {\n return this._seconds < 0;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the number of seconds in this duration.\n *\n * The length of the duration is stored using two fields - seconds and nanoseconds.\n * The nanoseconds part is a value from 0 to 999,999,999 that is an adjustment to\n * the length in seconds.\n * The total duration is defined by calling this method and {@link getNano}.\n *\n * A {@link Duration} represents a directed distance between two points on the time-line.\n * A negative duration is expressed by the negative sign of the seconds part.\n * A duration of -1 nanosecond is stored as -1 seconds plus 999,999,999 nanoseconds.\n *\n * @return {number} the whole seconds part of the length of the duration, positive or negative\n */\n seconds() {\n return this._seconds;\n }\n\n /**\n * Gets the number of nanoseconds within the second in this duration.\n *\n * The length of the duration is stored using two fields - seconds and nanoseconds.\n * The nanoseconds part is a value from 0 to 999,999,999 that is an adjustment to\n * the length in seconds.\n * The total duration is defined by calling this method and {@link getSeconds}.\n *\n * A {@link Duration} represents a directed distance between two points on the time-line.\n * A negative duration is expressed by the negative sign of the seconds part.\n * A duration of -1 nanosecond is stored as -1 seconds plus 999,999,999 nanoseconds.\n *\n * @return {number} the nanoseconds within the second part of the length of the duration, from 0 to 999,999,999\n */\n nano() {\n return this._nanos;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this duration with the specified amount of seconds.\n *\n * This returns a duration with the specified seconds, retaining the\n * nano-of-second part of this duration.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} seconds - the seconds to represent, may be negative\n * @return {Duration} based on this period with the requested seconds, not null\n */\n withSeconds(seconds) {\n return Duration._create(seconds, this._nanos);\n }\n\n /**\n * Returns a copy of this duration with the specified nano-of-second.\n *\n * This returns a duration with the specified nano-of-second, retaining the\n * seconds part of this duration.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} nanoOfSecond - the nano-of-second to represent, from 0 to 999,999,999\n * @return {Duration} based on this period with the requested nano-of-second, not null\n * @throws DateTimeException if the nano-of-second is invalid\n */\n withNanos(nanoOfSecond) {\n ChronoField.NANO_OF_SECOND.checkValidIntValue(nanoOfSecond);\n return Duration._create(this._seconds, nanoOfSecond);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this duration with the specified duration added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Duration} duration - the duration to add, positive or negative, not null\n * @return {Duration} based on this duration with the specified duration added, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusDuration(duration) {\n requireNonNull(duration, 'duration');\n return this.plus(duration.seconds(), duration.nano());\n }\n\n\n /**\n * function overloading for {@link Duration.plus}\n *\n * if called with 1 arguments, then {@link Duration.plusDuration} is executed.\n *\n * if called with 2 arguments and second argument is an instance of TemporalUnit, then {@link Duration.plusAmountUnit} is executed.\n *\n * Otherwise {@link Duration.plusSecondsNanos} is executed.\n *\n * @param {!(Duration|number)} durationOrNumber\n * @param {!TemporalUnit|number} unitOrNumber\n * @returns {Duration}\n */\n plus(durationOrNumber, unitOrNumber) {\n if (arguments.length === 1) {\n return this.plusDuration(durationOrNumber);\n }\n else if (arguments.length === 2 && unitOrNumber instanceof TemporalUnit) {\n return this.plusAmountUnit(durationOrNumber, unitOrNumber);\n } else {\n return this.plusSecondsNanos(durationOrNumber, unitOrNumber);\n }\n }\n\n /**\n * Returns a copy of this duration with the specified duration added.\n *\n * The duration amount is measured in terms of the specified unit.\n * Only a subset of units are accepted by this method.\n * The unit must either have an exact duration (see {@link TemporalUnit#isDurationEstimated}) or\n * be {@link ChronoUnit#DAYS} which is treated as 24 hours. Other units throw an exception.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} amountToAdd - the amount to add, measured in terms of the unit, positive or negative\n * @param {TemporalUnit} unit - the unit that the amount is measured in, must have an exact duration, not null\n * @return {Duration} based on this duration with the specified duration added, not null\n * @throws UnsupportedTemporalTypeException if the unit is not supported\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusAmountUnit(amountToAdd, unit) {\n requireNonNull(amountToAdd, 'amountToAdd');\n requireNonNull(unit, 'unit');\n if (unit === ChronoUnit.DAYS) {\n return this.plusSecondsNanos(MathUtil.safeMultiply(amountToAdd, LocalTime.SECONDS_PER_DAY), 0);\n }\n if (unit.isDurationEstimated()) {\n throw new UnsupportedTemporalTypeException('Unit must not have an estimated duration');\n }\n if (amountToAdd === 0) {\n return this;\n }\n if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.NANOS: return this.plusNanos(amountToAdd);\n case ChronoUnit.MICROS: return this.plusSecondsNanos(MathUtil.intDiv(amountToAdd, (1000000 * 1000)) * 1000, MathUtil.intMod(amountToAdd, (1000000 * 1000)) * 1000);\n case ChronoUnit.MILLIS: return this.plusMillis(amountToAdd);\n case ChronoUnit.SECONDS: return this.plusSeconds(amountToAdd);\n }\n return this.plusSecondsNanos(MathUtil.safeMultiply(unit.duration().seconds(), amountToAdd), 0);\n }\n const duration = unit.duration().multipliedBy(amountToAdd);\n return this.plusSecondsNanos(duration.seconds(), duration.nano());\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this duration with the specified duration in 24 hour days added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} daysToAdd - the days to add, positive or negative\n * @return {Duration} based on this duration with the specified days added, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusDays(daysToAdd) {\n return this.plusSecondsNanos(MathUtil.safeMultiply(daysToAdd, LocalTime.SECONDS_PER_DAY), 0);\n }\n\n /**\n * Returns a copy of this duration with the specified duration in hours added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} hoursToAdd - the hours to add, positive or negative\n * @return {Duration} based on this duration with the specified hours added, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusHours(hoursToAdd) {\n return this.plusSecondsNanos(MathUtil.safeMultiply(hoursToAdd, LocalTime.SECONDS_PER_HOUR), 0);\n }\n\n /**\n * Returns a copy of this duration with the specified duration in minutes added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} minutesToAdd - the minutes to add, positive or negative\n * @return {Duration} based on this duration with the specified minutes added, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusMinutes(minutesToAdd) {\n return this.plusSecondsNanos(MathUtil.safeMultiply(minutesToAdd, LocalTime.SECONDS_PER_MINUTE), 0);\n }\n\n /**\n * Returns a copy of this duration with the specified duration in seconds added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} secondsToAdd - the seconds to add, positive or negative\n * @return {Duration} based on this duration with the specified seconds added, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusSeconds(secondsToAdd) {\n return this.plusSecondsNanos(secondsToAdd, 0);\n }\n\n /**\n * Returns a copy of this duration with the specified duration in milliseconds added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} millisToAdd - the milliseconds to add, positive or negative\n * @return {Duration} based on this duration with the specified milliseconds added, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusMillis(millisToAdd) {\n return this.plusSecondsNanos(MathUtil.intDiv(millisToAdd, 1000), MathUtil.intMod(millisToAdd, 1000) * 1000000);\n }\n\n /**\n * Returns a copy of this duration with the specified duration in nanoseconds added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} nanosToAdd - the nanoseconds to add, positive or negative\n * @return {Duration} based on this duration with the specified nanoseconds added, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusNanos(nanosToAdd) {\n return this.plusSecondsNanos(0, nanosToAdd);\n }\n\n /**\n * Returns a copy of this duration with the specified duration added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} secondsToAdd - the seconds to add, positive or negative\n * @param {Number} nanosToAdd - the nanos to add, positive or negative\n * @return {Duration} based on this duration with the specified seconds added, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusSecondsNanos(secondsToAdd, nanosToAdd) {\n requireNonNull(secondsToAdd, 'secondsToAdd');\n requireNonNull(nanosToAdd, 'nanosToAdd');\n if (secondsToAdd === 0 && nanosToAdd === 0) {\n return this;\n }\n let epochSec = MathUtil.safeAdd(this._seconds, secondsToAdd);\n epochSec = MathUtil.safeAdd(epochSec, MathUtil.intDiv(nanosToAdd, LocalTime.NANOS_PER_SECOND));\n nanosToAdd = MathUtil.intMod(nanosToAdd, LocalTime.NANOS_PER_SECOND);\n const nanoAdjustment = MathUtil.safeAdd(this._nanos, nanosToAdd); // safe int+LocalTime.NANOS_PER_SECOND\n return Duration.ofSeconds(epochSec, nanoAdjustment);\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link Duration.minus}\n *\n * if called with 1 arguments and first argument is an instance of Duration, then {@link Duration.minusDuration} is executed.\n *\n * Otherwise {@link Duration.minusAmountUnit} is executed.\n *\n * @param {!(Duration|number)} durationOrNumber\n * @param {?TemporalUnit} unit\n * @return {Duration}\n */\n minus(durationOrNumber, unit) {\n if (arguments.length === 1) {\n return this.minusDuration(durationOrNumber);\n } else {\n return this.minusAmountUnit(durationOrNumber, unit);\n }\n }\n\n /**\n * Returns a copy of this duration with the specified duration subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Duration} duration - the duration to subtract, positive or negative, not null\n * @return {Duration} based on this duration with the specified duration subtracted, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusDuration(duration) {\n requireNonNull(duration, 'duration');\n const secsToSubtract = duration.seconds();\n const nanosToSubtract = duration.nano();\n if (secsToSubtract === MIN_SAFE_INTEGER) {\n return this.plus(MAX_SAFE_INTEGER, -nanosToSubtract);\n }\n return this.plus(-secsToSubtract, -nanosToSubtract);\n }\n\n /**\n * Returns a copy of this duration with the specified duration subtracted.\n *\n * The duration amount is measured in terms of the specified unit.\n * Only a subset of units are accepted by this method.\n * The unit must either have an exact duration (see {@link TemporalUnit#isDurationEstimated}) or\n * be {@link ChronoUnit#DAYS} which is treated as 24 hours. Other units throw an exception.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} amountToSubtract - the amount to subtract, measured in terms of the unit, positive or negative\n * @param {TemporalUnit} unit - the unit that the amount is measured in, must have an exact duration, not null\n * @return {Duration} based on this duration with the specified duration subtracted, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusAmountUnit(amountToSubtract, unit) {\n requireNonNull(amountToSubtract, 'amountToSubtract');\n requireNonNull(unit, 'unit');\n return (amountToSubtract === MIN_SAFE_INTEGER ? this.plusAmountUnit(MAX_SAFE_INTEGER, unit) : this.plusAmountUnit(-amountToSubtract, unit));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this duration with the specified duration in 24 hour days subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} daysToSubtract - the days to subtract, positive or negative\n * @return {Duration} based on this duration with the specified days subtracted, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusDays(daysToSubtract) {\n return (daysToSubtract === MIN_SAFE_INTEGER ? this.plusDays(MAX_SAFE_INTEGER) : this.plusDays(-daysToSubtract));\n }\n\n /**\n * Returns a copy of this duration with the specified duration in hours subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} hoursToSubtract - the hours to subtract, positive or negative\n * @return {Duration} based on this duration with the specified hours subtracted, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusHours(hoursToSubtract) {\n return (hoursToSubtract === MIN_SAFE_INTEGER ? this.plusHours(MAX_SAFE_INTEGER) : this.plusHours(-hoursToSubtract));\n }\n\n /**\n * Returns a copy of this duration with the specified duration in minutes subtracted.\n *\n * The number of hours is multiplied by 60 to obtain the number of seconds to subtract.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} minutesToSubtract - the minutes to subtract, positive or negative\n * @return {Duration} based on this duration with the specified minutes subtracted, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusMinutes(minutesToSubtract) {\n return (minutesToSubtract === MIN_SAFE_INTEGER ? this.plusMinutes(MAX_SAFE_INTEGER) : this.plusMinutes(-minutesToSubtract));\n }\n\n /**\n * Returns a copy of this duration with the specified duration in seconds subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} secondsToSubtract - the seconds to subtract, positive or negative\n * @return {Duration} based on this duration with the specified seconds subtracted, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusSeconds(secondsToSubtract) {\n return (secondsToSubtract === MIN_SAFE_INTEGER ? this.plusSeconds(MAX_SAFE_INTEGER) : this.plusSeconds(-secondsToSubtract));\n }\n\n /**\n * Returns a copy of this duration with the specified duration in milliseconds subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} millisToSubtract - the milliseconds to subtract, positive or negative\n * @return {Duration} based on this duration with the specified milliseconds subtracted, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusMillis(millisToSubtract) {\n return (millisToSubtract === MIN_SAFE_INTEGER ? this.plusMillis(MAX_SAFE_INTEGER) : this.plusMillis(-millisToSubtract));\n }\n\n /**\n * Returns a copy of this duration with the specified duration in nanoseconds subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} nanosToSubtract - the nanoseconds to subtract, positive or negative\n * @return {Duration} based on this duration with the specified nanoseconds subtracted, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusNanos(nanosToSubtract) {\n return (nanosToSubtract === MIN_SAFE_INTEGER ? this.plusNanos(MAX_SAFE_INTEGER) : this.plusNanos(-nanosToSubtract));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this duration multiplied by the scalar.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} multiplicand - the value to multiply the duration by, positive or negative\n * @return {Duration} based on this duration multiplied by the specified scalar, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n multipliedBy(multiplicand) {\n if (multiplicand === 0) {\n return Duration.ZERO;\n }\n if (multiplicand === 1) {\n return this;\n }\n let secs = MathUtil.safeMultiply(this._seconds, multiplicand);\n let nos = MathUtil.safeMultiply(this._nanos, multiplicand);\n secs = secs + MathUtil.intDiv(nos, LocalTime.NANOS_PER_SECOND);\n nos = MathUtil.intMod(nos, LocalTime.NANOS_PER_SECOND);\n return Duration.ofSeconds(secs, nos);\n }\n\n /**\n * Returns a copy of this duration divided by the specified value.\n *\n * In opposite to the threeten implementation the division is realized by floating point not by\n * fixed point arithmetic. Expect floating point rounding errors for {@link Duration.dividedBy}.\n *\n * @param {Number} divisor - the value to divide the duration by, positive or negative, not zero\n * @return {Duration} based on this duration divided by the specified divisor, not null\n * @throws ArithmeticException if the divisor is zero or if numeric overflow occurs\n */\n dividedBy(divisor) {\n if (divisor === 0) {\n throw new ArithmeticException('Cannot divide by zero');\n }\n if (divisor === 1) {\n return this;\n }\n const secs = MathUtil.intDiv(this._seconds, divisor);\n const secsMod = MathUtil.roundDown(((this._seconds/ divisor) - secs) * LocalTime.NANOS_PER_SECOND);\n let nos = MathUtil.intDiv(this._nanos, divisor);\n nos = secsMod + nos;\n return Duration.ofSeconds(secs, nos);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this duration with the length negated.\n *\n * This method swaps the sign of the total length of this duration.\n * For example, {@link PT1.3S} will be returned as {@link PT-1.3S}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @return {Duration} based on this duration with the amount negated, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n negated() {\n return this.multipliedBy(-1);\n }\n\n /**\n * Returns a copy of this duration with a positive length.\n *\n * This method returns a positive duration by effectively removing the sign from any negative total length.\n * For example, {@link PT-1.3S} will be returned as {@link PT1.3S}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @return {Duration} based on this duration with an absolute length, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n abs() {\n return this.isNegative() ? this.negated() : this;\n }\n\n //-------------------------------------------------------------------------\n /**\n * Adds this duration to the specified temporal object.\n *\n * This returns a temporal object of the same observable type as the input\n * with this duration added.\n *\n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal#plus}.\n *
\n     *   // these two lines are equivalent, but the second approach is recommended\n     *   dateTime = thisDuration.addTo(dateTime);\n     *   dateTime = dateTime.plus(thisDuration);\n     * 
\n *\n * The calculation will add the seconds, then nanos.\n * Only non-zero amounts will be added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal - the temporal object to adjust, not null\n * @return {Temporal} an object of the same type with the adjustment made, not null\n * @throws DateTimeException if unable to add\n * @throws ArithmeticException if numeric overflow occurs\n */\n addTo(temporal) {\n requireNonNull(temporal, 'temporal');\n if (this._seconds !== 0) {\n temporal = temporal.plus(this._seconds, ChronoUnit.SECONDS);\n }\n if (this._nanos !== 0) {\n temporal = temporal.plus(this._nanos, ChronoUnit.NANOS);\n }\n return temporal;\n }\n\n /**\n * Subtracts this duration from the specified temporal object.\n *\n * This returns a temporal object of the same observable type as the input\n * with this duration subtracted.\n *\n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal#minus}.\n *
\n     *   // these two lines are equivalent, but the second approach is recommended\n     *   dateTime = thisDuration.subtractFrom(dateTime);\n     *   dateTime = dateTime.minus(thisDuration);\n     * 
\n *\n * The calculation will subtract the seconds, then nanos.\n * Only non-zero amounts will be added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal - the temporal object to adjust, not null\n * @return {Temporal} an object of the same type with the adjustment made, not null\n * @throws DateTimeException if unable to subtract\n * @throws ArithmeticException if numeric overflow occurs\n */\n subtractFrom(temporal) {\n requireNonNull(temporal, 'temporal');\n if (this._seconds !== 0) {\n temporal = temporal.minus(this._seconds, ChronoUnit.SECONDS);\n }\n if (this._nanos !== 0) {\n temporal = temporal.minus(this._nanos, ChronoUnit.NANOS);\n }\n return temporal;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the number of days in this duration.\n *\n * This returns the total number of days in the duration by dividing the\n * number of seconds by 86400.\n * This is based on the standard definition of a day as 24 hours.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @return {number} the number of days in the duration, may be negative\n */\n toDays() {\n return MathUtil.intDiv(this._seconds, LocalTime.SECONDS_PER_DAY);\n }\n\n /**\n * Gets the number of hours in this duration.\n *\n * This returns the total number of hours in the duration by dividing the\n * number of seconds by 3600.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @return {number} the number of hours in the duration, may be negative\n */\n toHours() {\n return MathUtil.intDiv(this._seconds, LocalTime.SECONDS_PER_HOUR);\n }\n\n /**\n * Gets the number of minutes in this duration.\n *\n * This returns the total number of minutes in the duration by dividing the\n * number of seconds by 60.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @return {number} the number of minutes in the duration, may be negative\n */\n toMinutes() {\n return MathUtil.intDiv(this._seconds, LocalTime.SECONDS_PER_MINUTE);\n }\n\n /**\n * Converts this duration to the total length in milliseconds.\n *\n * If this duration is too large to fit in a `long` milliseconds, then an\n * exception is thrown.\n *\n * If this duration has greater than millisecond precision, then the conversion\n * will drop any excess precision information as though the amount in nanoseconds\n * was subject to integer division by one million.\n *\n * @return {number} the total length of the duration in milliseconds\n * @throws ArithmeticException if numeric overflow occurs\n */\n toMillis() {\n let millis = Math.round(MathUtil.safeMultiply(this._seconds, 1000));\n millis = MathUtil.safeAdd(millis, MathUtil.intDiv(this._nanos, 1000000));\n return millis;\n }\n\n /**\n * Converts this duration to the total length in nanoseconds expressed as a `long`.\n *\n * If this duration is too large to fit in a `long` nanoseconds, then an\n * exception is thrown.\n *\n * @return {number} the total length of the duration in nanoseconds\n * @throws ArithmeticException if numeric overflow occurs\n */\n toNanos() {\n let totalNanos = MathUtil.safeMultiply(this._seconds, LocalTime.NANOS_PER_SECOND);\n totalNanos = MathUtil.safeAdd(totalNanos, this._nanos);\n return totalNanos;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this duration to the specified {@link Duration}.\n *\n * The comparison is based on the total length of the durations.\n *\n * @param {Duration} otherDuration - the other duration to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */\n compareTo(otherDuration) {\n requireNonNull(otherDuration, 'otherDuration');\n requireInstance(otherDuration, Duration, 'otherDuration');\n const cmp = MathUtil.compareNumbers(this._seconds, otherDuration.seconds());\n if (cmp !== 0) {\n return cmp;\n }\n return this._nanos - otherDuration.nano();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this duration is equal to the specified {@link Duration}.\n *\n * The comparison is based on the total length of the durations.\n *\n * @param {*} otherDuration - the other duration, null returns false\n * @return {boolean} true if the other duration is equal to this one\n */\n equals(otherDuration) {\n if (this === otherDuration) {\n return true;\n }\n if (otherDuration instanceof Duration) {\n return this.seconds() === otherDuration.seconds() &&\n this.nano() === otherDuration.nano();\n }\n return false;\n }\n\n //-----------------------------------------------------------------------\n /**\n * A string representation of this duration using ISO-8601 seconds\n * based representation, such as {@link PT8H6M12.345S}.\n *\n * The format of the returned string will be {@link PTnHnMnS}, where n is\n * the relevant hours, minutes or seconds part of the duration.\n * Any fractional seconds are placed after a decimal point in the seconds section.\n * If a section has a zero value, it is omitted.\n * The hours, minutes and seconds will all have the same sign.\n *\n * Examples:\n *
\n     *    \"20.345 seconds\"                 -> \"PT20.345S\n     *    \"15 minutes\" (15 * 60 seconds)   -> \"PT15M\"\n     *    \"10 hours\" (10 * 3600 seconds)   -> \"PT10H\"\n     *    \"2 days\" (2 * 86400 seconds)     -> \"PT48H\"\n     * 
\n * Note that multiples of 24 hours are not output as days to avoid confusion\n * with {@link Period}.\n *\n * @return {string} an ISO-8601 representation of this duration, not null\n */\n toString() {\n if (this === Duration.ZERO) {\n return 'PT0S';\n }\n const hours = MathUtil.intDiv(this._seconds, LocalTime.SECONDS_PER_HOUR);\n const minutes = MathUtil.intDiv(MathUtil.intMod(this._seconds, LocalTime.SECONDS_PER_HOUR), LocalTime.SECONDS_PER_MINUTE);\n const secs = MathUtil.intMod(this._seconds, LocalTime.SECONDS_PER_MINUTE);\n let rval = 'PT';\n if (hours !== 0) {\n rval += hours + 'H';\n }\n if (minutes !== 0) {\n rval += minutes + 'M';\n }\n if (secs === 0 && this._nanos === 0 && rval.length > 2) {\n return rval;\n }\n if (secs < 0 && this._nanos > 0) {\n if (secs === -1) {\n rval += '-0';\n } else {\n rval += secs + 1;\n }\n } else {\n rval += secs;\n }\n if (this._nanos > 0) {\n rval += '.';\n let nanoString;\n if (secs < 0) {\n nanoString = '' + (2 * LocalTime.NANOS_PER_SECOND - this._nanos);\n } else {\n nanoString = '' + (LocalTime.NANOS_PER_SECOND + this._nanos);\n }\n // remove the leading '1'\n nanoString = nanoString.slice(1, nanoString.length);\n rval += nanoString;\n while (rval.charAt(rval.length - 1) === '0') {\n rval = rval.slice(0, rval.length - 1);\n }\n }\n rval += 'S';\n return rval;\n }\n\n /**\n *\n * @return {string} same as {@link Duration.toString}\n */\n toJSON() {\n return this.toString();\n }\n\n}\n\nexport function _init() {\n /**\n * Constant for a duration of zero.\n */\n Duration.ZERO = new Duration(0, 0);\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\n/**\n * attempt to avoid dependency cycles... define all constants here and they could be used\n * so instead of using e.g. Year.MAX_VALUE we could use YearConstants.MAX_VALUE to avoid the cycle\n */\nexport class YearConstants {}\n\nexport function _init() {\n /**\n * The minimum supported year\n */\n YearConstants.MIN_VALUE = -999999;\n /**\n * The maximum supported year\n */\n YearConstants.MAX_VALUE = 999999;\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {MathUtil} from '../MathUtil';\n\nimport {Duration} from '../Duration';\nimport {YearConstants} from '../YearConstants';\nimport {TemporalUnit} from './TemporalUnit';\n\n/**\n * A standard set of date periods units.\n *\n * This set of units provide unit-based access to manipulate a date, time or date-time.\n * The standard set of units can be extended by implementing {@link TemporalUnit}.\n *\n * These units are intended to be applicable in multiple calendar systems.\n * For example, most non-ISO calendar systems define units of years, months and days,\n * just with slightly different rules.\n * The documentation of each unit explains how it operates.\n *\n * ### Static properties:\n * \n * - `ChronoUnit.CENTURIES`: Unit that represents the concept of a century. For the ISO calendar\n * system, it is equal to 100 years.\n * \n * - `ChronoUnit.DAYS`: Unit that represents the concept of a day. For the ISO calendar system, it\n * is the standard day from midnight to midnight. The estimated duration of a day is 24 Hours.\n * \n * - `ChronoUnit.DECADES`: Unit that represents the concept of a decade. For the ISO calendar system,\n * it is equal to 10 years.\n * \n * - `ChronoUnit.ERAS`: Unit that represents the concept of an era. The ISO calendar system doesn't\n * have eras thus it is impossible to add an era to a date or date-time. The estimated duration of the\n * era is artificially defined as 1,000,000,000 Years.\n * \n * - `ChronoUnit.FOREVER`: Artificial unit that represents the concept of forever. This is primarily\n * used with {@link TemporalField} to represent unbounded fields such as the year or era. The\n * estimated duration of the era is artificially defined as the largest duration supported by\n * {@link Duration}.\n * \n * - `ChronoUnit.HALF_DAYS`: Unit that represents the concept of half a day, as used in AM/PM. For\n * the ISO calendar system, it is equal to 12 hours.\n *\n * - `ChronoUnit.HOURS`: Unit that represents the concept of an hour. For the ISO calendar system,\n * it is equal to 60 minutes.\n * \n * - `ChronoUnit.MICROS`: Unit that represents the concept of a microsecond. For the ISO calendar\n * system, it is equal to the 1,000,000th part of the second unit.\n * \n * - `ChronoUnit.MILLENNIA`: Unit that represents the concept of a millennium. For the ISO calendar\n * system, it is equal to 1,000 years.\n * \n * - `ChronoUnit.MILLIS`: Unit that represents the concept of a millisecond. For the ISO calendar\n * system, it is equal to the 1000th part of the second unit.\n * \n * - `ChronoUnit.MINUTES`: Unit that represents the concept of a minute. For the ISO calendar system,\n * it is equal to 60 seconds.\n * \n * - `ChronoUnit.MONTHS`: Unit that represents the concept of a month. For the ISO calendar system,\n * the length of the month varies by month-of-year. The estimated duration of a month is one twelfth\n * of 365.2425 Days.\n * \n * - `ChronoUnit.NANOS`: Unit that represents the concept of a nanosecond, the smallest supported unit\n * of time. For the ISO calendar system, it is equal to the 1,000,000,000th part of the second unit.\n * \n * - `ChronoUnit.SECONDS`: Unit that represents the concept of a second. For the ISO calendar system,\n * it is equal to the second in the SI system of units, except around a leap-second.\n * \n * - `ChronoUnit.WEEKS`: Unit that represents the concept of a week. For the ISO calendar system,\n * it is equal to 7 Days.\n * \n * - `ChronoUnit.YEARS`: Unit that represents the concept of a year. For the ISO calendar system, it\n * is equal to 12 months. The estimated duration of a year is 365.2425 Days.\n */\nexport class ChronoUnit extends TemporalUnit {\n\n /**\n *\n * @param {String} name\n * @param {Duration} estimatedDuration\n * @private\n */\n constructor (name, estimatedDuration) {\n super();\n this._name = name;\n this._duration = estimatedDuration;\n }\n\n //-----------------------------------------------------------------------\n /**\n * @return {Duration} the duration of this unit, which may be an estimate.\n */\n duration() {\n return this._duration;\n }\n\n /**\n * @return {boolean} `true` if the duration is estimated, `false` if accurate.\n */\n isDurationEstimated() {\n return this.isDateBased() || this === ChronoUnit.FOREVER;\n }\n\n //-----------------------------------------------------------------------\n /**\n * @return {boolean} `true` if date unit, `false` if a time unit.\n */\n isDateBased() {\n return this.compareTo(ChronoUnit.DAYS) >= 0 && this !== ChronoUnit.FOREVER;\n }\n\n /**\n * Checks if this unit is a time unit.\n *\n * @return {boolean} `true` if time unit, `false` if a date unit.\n */\n isTimeBased() {\n return this.compareTo(ChronoUnit.DAYS) < 0;\n }\n\n //-----------------------------------------------------------------------\n /**\n * @param {!Temporal} temporal the temporal object to check.\n * @return {boolean} `true` if the unit is supported.\n */\n isSupportedBy(temporal) {\n if (this === ChronoUnit.FOREVER) {\n return false;\n }\n /* TODO: classes not implemented yet */\n /*\n if (temporal instanceof ChronoLocalDate) {\n return isDateBased();\n }\n if (temporal instanceof ChronoLocalDateTime || temporal instanceof ChronoZonedDateTime) {\n return true;\n }\n*/\n try {\n temporal.plus(1, this);\n return true;\n } catch (e) {\n try {\n temporal.plus(-1, this);\n return true;\n } catch (e2) {\n return false;\n }\n }\n }\n\n /**\n * @param {!Temporal} dateTime the temporal object to adjust.\n * @param {number} periodToAdd the period of this unit to add, positive or negative.\n * @return {Temporal} the adjusted temporal object.\n * @throws DateTimeException if the period cannot be added.\n */\n addTo(temporal, amount) {\n return temporal.plus(amount, this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * @param {!Temporal} temporal1 the base temporal object.\n * @param {!Temporal} temporal2 the other temporal object.\n * @return {number} the period between temporal1 and temporal2 in terms of this unit;\n * positive if temporal2 is later than temporal1, negative if earlier.\n * @throws DateTimeException if the period cannot be calculated.\n * @throws ArithmeticException if numeric overflow occurs.\n */\n between(temporal1, temporal2) {\n return temporal1.until(temporal2, this);\n }\n\n //-----------------------------------------------------------------------\n toString() {\n return this._name;\n }\n\n /**\n * Compares this ChronoUnit to the specified {@link TemporalUnit}.\n *\n * The comparison is based on the total length of the durations.\n *\n * @param {!TemporalUnit} other the other unit to compare to.\n * @return the comparator value, negative if less, positive if greater.\n */\n compareTo(other) {\n return this.duration().compareTo(other.duration());\n }\n\n}\n\nexport function _init() {\n /**\n * Unit that represents the concept of a nanosecond, the smallest supported unit of time.\n * For the ISO calendar system, it is equal to the 1,000,000,000th part of the second unit.\n */\n ChronoUnit.NANOS = new ChronoUnit('Nanos', Duration.ofNanos(1));\n /**\n * Unit that represents the concept of a microsecond.\n * For the ISO calendar system, it is equal to the 1,000,000th part of the second unit.\n */\n ChronoUnit.MICROS = new ChronoUnit('Micros', Duration.ofNanos(1000));\n /**\n * Unit that represents the concept of a millisecond.\n * For the ISO calendar system, it is equal to the 1000th part of the second unit.\n */\n ChronoUnit.MILLIS = new ChronoUnit('Millis', Duration.ofNanos(1000000));\n /**\n * Unit that represents the concept of a second.\n * For the ISO calendar system, it is equal to the second in the SI system\n * of units, except around a leap-second.\n */\n ChronoUnit.SECONDS = new ChronoUnit('Seconds', Duration.ofSeconds(1));\n /**\n * Unit that represents the concept of a minute.\n * For the ISO calendar system, it is equal to 60 seconds.\n */\n ChronoUnit.MINUTES = new ChronoUnit('Minutes', Duration.ofSeconds(60));\n /**\n * Unit that represents the concept of an hour.\n * For the ISO calendar system, it is equal to 60 minutes.\n */\n ChronoUnit.HOURS = new ChronoUnit('Hours', Duration.ofSeconds(3600));\n /**\n * Unit that represents the concept of half a day, as used in AM/PM.\n * For the ISO calendar system, it is equal to 12 hours.\n */\n ChronoUnit.HALF_DAYS = new ChronoUnit('HalfDays', Duration.ofSeconds(43200));\n /**\n * Unit that represents the concept of a day.\n * For the ISO calendar system, it is the standard day from midnight to midnight.\n * The estimated duration of a day is 24 hours.\n *\n * When used with other calendar systems it must correspond to the day defined by\n * the rising and setting of the Sun on Earth. It is not required that days begin\n * at midnight - when converting between calendar systems, the date should be\n * equivalent at midday.\n */\n ChronoUnit.DAYS = new ChronoUnit('Days', Duration.ofSeconds(86400));\n /**\n * Unit that represents the concept of a week.\n * For the ISO calendar system, it is equal to 7 days.\n *\n * When used with other calendar systems it must correspond to an integral number of days.\n */\n ChronoUnit.WEEKS = new ChronoUnit('Weeks', Duration.ofSeconds(7 * 86400));\n /**\n * Unit that represents the concept of a month.\n * For the ISO calendar system, the length of the month varies by month-of-year.\n * The estimated duration of a month is one twelfth of 365.2425 days.\n *\n * When used with other calendar systems it must correspond to an integral number of days.\n */\n ChronoUnit.MONTHS = new ChronoUnit('Months', Duration.ofSeconds(31556952 / 12));\n /**\n * Unit that represents the concept of a year.\n * For the ISO calendar system, it is equal to 12 months.\n * The estimated duration of a year is 365.2425 days.\n *\n * When used with other calendar systems it must correspond to an integral number of days\n * or months roughly equal to a year defined by the passage of the Earth around the Sun.\n */\n ChronoUnit.YEARS = new ChronoUnit('Years', Duration.ofSeconds(31556952));\n /**\n * Unit that represents the concept of a decade.\n * For the ISO calendar system, it is equal to 10 years.\n *\n * When used with other calendar systems it must correspond to an integral number of days\n * and is normally an integral number of years.\n */\n ChronoUnit.DECADES = new ChronoUnit('Decades', Duration.ofSeconds(31556952 * 10));\n /**\n * Unit that represents the concept of a century.\n * For the ISO calendar system, it is equal to 100 years.\n *\n * When used with other calendar systems it must correspond to an integral number of days\n * and is normally an integral number of years.\n */\n ChronoUnit.CENTURIES = new ChronoUnit('Centuries', Duration.ofSeconds(31556952 * 100));\n /**\n * Unit that represents the concept of a millennium.\n * For the ISO calendar system, it is equal to 1000 years.\n *\n * When used with other calendar systems it must correspond to an integral number of days\n * and is normally an integral number of years.\n */\n ChronoUnit.MILLENNIA = new ChronoUnit('Millennia', Duration.ofSeconds(31556952 * 1000));\n /**\n * Unit that represents the concept of an era.\n * The ISO calendar system doesn't have eras thus it is impossible to add\n * an era to a date or date-time.\n * The estimated duration of the era is artificially defined as {Year.MAX_VALUE} + 1.\n *\n * When used with other calendar systems there are no restrictions on the unit.\n */\n ChronoUnit.ERAS = new ChronoUnit('Eras', Duration.ofSeconds(31556952 * (YearConstants.MAX_VALUE + 1)));\n /**\n * Artificial unit that represents the concept of forever.\n * This is primarily used with {@link TemporalField} to represent unbounded fields\n * such as the year or era.\n * The estimated duration of the era is artificially defined as the largest duration\n * supported by {@link Duration}.\n */\n ChronoUnit.FOREVER = new ChronoUnit('Forever', Duration.ofSeconds(MathUtil.MAX_SAFE_INTEGER, 999999999));\n}\n","import { abstractMethodFail } from '../assert';\n\n/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\n/**\n * A field of date-time, such as month-of-year or hour-of-minute.\n *\n * Date and time is expressed using fields which partition the time-line into something\n * meaningful for humans. Implementations of this interface represent those fields.\n *\n * The most commonly used units are defined in {@link ChronoField}.\n * Further fields are supplied in {@link IsoFields}, {@link WeekFields} and {@link JulianFields}.\n * Fields can also be written by application code by implementing this interface.\n *\n * The field works using double dispatch. Client code calls methods on a date-time like\n * {@link LocalDateTime} which check if the field is a {@link ChronoField}.\n * If it is, then the date-time must handle it.\n * Otherwise, the method call is re-dispatched to the matching method in this interface.\n *\n * @interface\n */\nexport class TemporalField {\n /**\n * Checks if this field represents a component of a date.\n *\n * @return {boolean} `true` if it is a component of a date, `false` otherwise.\n */\n isDateBased() {\n abstractMethodFail('isDateBased');\n }\n\n /**\n * Checks if this field represents a component of a time.\n *\n * @return {boolean} `true` if it is a component of a time, `false` otherwise.\n */\n isTimeBased() {\n abstractMethodFail('isTimeBased');\n }\n\n /**\n * Gets the unit that the field is measured in.\n *\n * The unit of the field is the period that varies within the range.\n * For example, in the field 'MonthOfYear', the unit is 'Months'.\n * See also {@link rangeUnit}.\n *\n * @return {TemporalUnit} the period unit defining the base unit of the field.\n */\n baseUnit() {\n abstractMethodFail('baseUnit');\n }\n\n /**\n * Gets the range that the field is bound by.\n * \n * The range of the field is the period that the field varies within.\n * For example, in the field 'MonthOfYear', the range is 'Years'.\n * See also {@link baseUnit}.\n * \n * The range is never null. For example, the 'Year' field is shorthand for\n * 'YearOfForever'. It therefore has a unit of 'Years' and a range of 'Forever'.\n *\n * @return {TemporalUnit} the period unit defining the range of the field.\n */\n rangeUnit() {\n abstractMethodFail('rangeUnit');\n }\n\n /**\n * Gets the range of valid values for the field.\n *\n * All fields can be expressed as an integer.\n * This method returns an object that describes the valid range for that value.\n * This method is generally only applicable to the ISO-8601 calendar system.\n *\n * Note that the result only describes the minimum and maximum valid values\n * and it is important not to read too much into them. For example, there\n * could be values within the range that are invalid for the field.\n *\n * @return {ValueRange} the range of valid values for the field.\n */\n range() {\n abstractMethodFail('range');\n }\n\n /**\n * Get the range of valid values for this field using the temporal object to\n * refine the result.\n *\n * This uses the temporal object to find the range of valid values for the field.\n * This is similar to {@link range}, however this method refines the result\n * using the temporal. For example, if the field is {@link DAY_OF_MONTH} the\n * {@link range} method is not accurate as there are four possible month lengths,\n * 28, 29, 30 and 31 days. Using this method with a date allows the range to be\n * accurate, returning just one of those four options.\n *\n * There are two equivalent ways of using this method.\n * The first is to invoke this method directly.\n * The second is to use {@link TemporalAccessor#range}:\n *
\n     *   // these two lines are equivalent, but the second approach is recommended\n     *   temporal = thisField.rangeRefinedBy(temporal);\n     *   temporal = temporal.range(thisField);\n     * 
\n * It is recommended to use the second approach, {@link range},\n * as it is a lot clearer to read in code.\n *\n * Implementations should perform any queries or calculations using the fields\n * available in {@link ChronoField}.\n * If the field is not supported a {@link DateTimeException} must be thrown.\n *\n * @param {!TemporalAccessor} temporal the temporal object used to refine the result.\n * @return {ValueRange} the range of valid values for this field.\n * @throws {DateTimeException} if the range for the field cannot be obtained.\n * \n */\n // eslint-disable-next-line no-unused-vars\n rangeRefinedBy(temporal) {\n abstractMethodFail('rangeRefinedBy');\n }\n\n /**\n * Gets the value of this field from the specified temporal object.\n *\n * This queries the temporal object for the value of this field.\n *\n * There are two equivalent ways of using this method.\n * The first is to invoke this method directly.\n * The second is to use {@link TemporalAccessor#get}:\n *
\n     *   // these two lines are equivalent, but the second approach is recommended\n     *   temporal = thisField.getFrom(temporal);\n     *   temporal = temporal.get(thisField);\n     * 
\n * It is recommended to use the second approach, as it is a lot clearer to read in code.\n *\n * Implementations should perform any queries or calculations using the fields\n * available in {@link ChronoField}.\n * If the field is not supported a {@link DateTimeException} must be thrown.\n *\n * @param {!TemporalAccesor} temporal the temporal object to query.\n * @return {number} the value of this field.\n * @throws {DateTimeException} if a value for the field cannot be obtained.\n */\n // eslint-disable-next-line no-unused-vars\n getFrom(temporal) {\n abstractMethodFail('getFrom');\n }\n\n /**\n * Returns a copy of the specified temporal object with the value of this field set.\n *\n * This returns a new temporal object based on the specified one with the value for\n * this field changed. For example, on a {@link LocalDate}, this could be used to\n * set the year, month or day-of-month.\n * The returned object has the same observable type as the specified object.\n *\n * In some cases, changing a field is not fully defined. For example, if the target object is\n * a date representing the 31st January, then changing the month to February would be unclear.\n * In cases like this, the implementation is responsible for resolving the result.\n * Typically it will choose the previous valid date, which would be the last valid\n * day of February in this example.\n *\n * There are two equivalent ways of using this method.\n * The first is to invoke this method directly.\n * The second is to use {@link Temporal#with}:\n *
\n     *   // these two lines are equivalent, but the second approach is recommended\n     *   temporal = thisField.adjustInto(temporal);\n     *   temporal = temporal.with(thisField);\n     * 
\n * It is recommended to use the second approach, `with(temporal)`,\n * as it is a lot clearer to read in code.\n *\n * Implementations should perform any queries or calculations using the fields\n * available in {@link ChronoField}.\n * If the field is not supported a {@link DateTimeException} must be thrown.\n *\n * Implementations must not alter the specified temporal object.\n * Instead, an adjusted copy of the original must be returned.\n * This provides equivalent, safe behavior for immutable and mutable implementations.\n *\n * @param {!Temporal} temporal the temporal object to adjust.\n * @param {!number} newValue the new value of the field.\n * @return {Temporal} the adjusted temporal object.\n * @throws {DateTimeException} if the field cannot be set.\n */\n // eslint-disable-next-line no-unused-vars\n adjustInto(temporal, newValue) {\n abstractMethodFail('adjustInto');\n }\n\n /**\n * Checks if this field is supported by the temporal object.\n *\n * This determines whether the temporal accessor supports this field.\n * If this returns false, the the temporal cannot be queried for this field.\n *\n * There are two equivalent ways of using this method.\n * The first is to invoke this method directly.\n * The second is to use {@link TemporalAccessor#isSupported}:\n *
\n     *   // these two lines are equivalent, but the second approach is recommended\n     *   temporal = thisField.isSupportedBy(temporal);\n     *   temporal = temporal.isSupported(thisField);\n     * 
\n * It is recommended to use the second approach, `isSupported(temporal)`,\n * as it is a lot clearer to read in code.\n *\n * Implementations should determine whether they are supported using the fields\n * available in {@link ChronoField}.\n *\n * @param {!TemporalAccesor} temporal the temporal object to query.\n * @return {boolean} `true` if the date-time can be queried for this field, `false` if not.\n */\n // eslint-disable-next-line no-unused-vars\n isSupportedBy(temporal) {\n abstractMethodFail('isSupportedBy');\n }\n\n /**\n * @return {string}\n */\n displayName(/* TODO: locale */) {\n abstractMethodFail('displayName');\n }\n\n /**\n * @param {*} other\n * @returns {boolean}\n */\n // eslint-disable-next-line no-unused-vars\n equals(other) {\n abstractMethodFail('equals');\n }\n\n /**\n * @returns {string}\n */\n name() {\n abstractMethodFail('name');\n }\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {assert} from '../assert';\nimport {DateTimeException, IllegalArgumentException} from '../errors';\nimport {MathUtil} from '../MathUtil';\n\n/**\n * The range of valid values for a date-time field.\n *\n * All TemporalField instances have a valid range of values.\n * For example, the ISO day-of-month runs from 1 to somewhere between 28 and 31.\n * This class captures that valid range.\n *\n * It is important to be aware of the limitations of this class.\n * Only the minimum and maximum values are provided.\n * It is possible for there to be invalid values within the outer range.\n * For example, a weird field may have valid values of 1, 2, 4, 6, 7, thus\n * have a range of '1 - 7', despite that fact that values 3 and 5 are invalid.\n *\n * Instances of this class are not tied to a specific field.\n */\nexport class ValueRange {\n\n /**\n *\n * @param {!number} minSmallest\n * @param {!number} minLargest\n * @param {!number} maxSmallest\n * @param {!number} maxLargest\n * @private\n */\n constructor(minSmallest, minLargest, maxSmallest, maxLargest) {\n assert(!(minSmallest > minLargest), 'Smallest minimum value \\'' + minSmallest +\n '\\' must be less than largest minimum value \\'' + minLargest + '\\'', IllegalArgumentException);\n assert(!(maxSmallest > maxLargest), 'Smallest maximum value \\'' + maxSmallest +\n '\\' must be less than largest maximum value \\'' + maxLargest + '\\'', IllegalArgumentException);\n assert(!(minLargest > maxLargest), 'Minimum value \\'' + minLargest +\n '\\' must be less than maximum value \\'' + maxLargest + '\\'', IllegalArgumentException);\n\n this._minSmallest = minSmallest;\n this._minLargest = minLargest;\n this._maxLargest = maxLargest;\n this._maxSmallest = maxSmallest;\n }\n\n /**\n * Is the value range fixed and fully known.\n *\n * For example, the ISO day-of-month runs from 1 to between 28 and 31.\n * Since there is uncertainty about the maximum value, the range is not fixed.\n * However, for the month of January, the range is always 1 to 31, thus it is fixed.\n *\n * @return {boolean} true if the set of values is fixed\n */\n isFixed() {\n return this._minSmallest === this._minLargest && this._maxSmallest === this._maxLargest;\n }\n\n /**\n *\n * @returns {number}\n */\n minimum(){\n return this._minSmallest;\n }\n\n /**\n *\n * @returns {number}\n */\n largestMinimum(){\n return this._minLargest;\n }\n\n /**\n *\n * @returns {number}\n */\n maximum(){\n return this._maxLargest;\n }\n\n /**\n *\n * @returns {number}\n */\n smallestMaximum(){\n return this._maxSmallest;\n }\n\n /**\n *\n * @returns {boolean}\n */\n isValidValue(value) {\n return (this.minimum() <= value && value <= this.maximum());\n }\n\n /**\n *\n * @param {number} value\n * @param {TemporalField} field\n */\n checkValidValue(value, field) {\n let msg;\n if (!this.isValidValue(value)) {\n if (field != null) {\n msg = ('Invalid value for ' + field + ' (valid values ' + (this.toString()) + '): ') + value;\n } else {\n msg = ('Invalid value (valid values ' + (this.toString()) + '): ') + value;\n }\n return assert(false, msg, DateTimeException);\n }\n return value;\n }\n\n /**\n * Checks that the specified value is valid and fits in an `int`.\n *\n * This validates that the value is within the valid range of values and that\n * all valid values are within the bounds of an `int`.\n * The field is only used to improve the error message.\n *\n * @param {number} value - the value to check\n * @param {TemporalField} field - the field being checked, may be null\n * @return {number} the value that was passed in\n * @see #isValidIntValue(long)\n */\n checkValidIntValue(value, field) {\n if (this.isValidIntValue(value) === false) {\n throw new DateTimeException('Invalid int value for ' + field + ': ' + value);\n }\n return value;\n }\n\n /**\n * Checks if the value is within the valid range and that all values\n * in the range fit in an `int`.\n *\n * This method combines {@link isIntValue} and {@link isValidValue}.\n *\n * @param {number} value - the value to check\n * @return true if the value is valid and fits in an `int`\n */\n isValidIntValue(value) {\n return this.isIntValue() && this.isValidValue(value);\n }\n\n /**\n * Checks if all values in the range fit in an `int`.\n *\n * This checks that all valid values are within the bounds of an `int`.\n *\n * For example, the ISO month-of-year has values from 1 to 12, which fits in an `int`.\n * By comparison, ISO nano-of-day runs from 1 to 86,400,000,000,000 which does not fit in an `int`.\n *\n * This implementation uses {@link getMinimum} and {@link getMaximum}.\n *\n * @return boolean if a valid value always fits in an `int`\n */\n isIntValue() { // should be isSafeIntegerValue\n return this.minimum() >= MathUtil.MIN_SAFE_INTEGER && this.maximum() <= MathUtil.MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if this range is equal to another range.\n *\n * The comparison is based on the four values, minimum, largest minimum,\n * smallest maximum and maximum.\n * Only objects of type {@link ValueRange} are compared, other types return false.\n *\n * @param {*} other - the object to check, null returns false\n * @return {boolean} true if this is equal to the other range\n */\n equals(other) {\n if (other === this) {\n return true;\n }\n if (other instanceof ValueRange) {\n return this._minSmallest === other._minSmallest && this._minLargest === other._minLargest &&\n this._maxSmallest === other._maxSmallest && this._maxLargest === other._maxLargest;\n }\n return false;\n }\n\n /**\n * A hash code for this range.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return MathUtil.hashCode(this._minSmallest, this._minLargest, this._maxSmallest, this._maxLargest);\n }\n\n /*\n * Outputs this range as a String.\n *\n * The format will be '{min}/{largestMin} - {smallestMax}/{max}',\n * where the largestMin or smallestMax sections may be omitted, together\n * with associated slash, if they are the same as the min or max.\n *\n * @return {string} a string representation of this range, not null\n */\n toString() {\n let str = this.minimum() + (this.minimum() !== this.largestMinimum() ? '/' + (this.largestMinimum()) : '');\n str += ' - ';\n str += this.smallestMaximum() + (this.smallestMaximum() !== this.maximum() ? '/' + (this.maximum()) : '');\n return str;\n }\n\n /*\n * called with 2 params: Obtains a fixed value range.\n *\n * This factory obtains a range where the minimum and maximum values are fixed.\n * For example, the ISO month-of-year always runs from 1 to 12.\n *\n * @param min the minimum value\n * @param max the maximum value\n * @return the ValueRange for min, max, not null\n\n * called with 3 params: Obtains a variable value range.\n *\n * This factory obtains a range where the minimum value is fixed and the maximum value may vary.\n * For example, the ISO day-of-month always starts at 1, but ends between 28 and 31.\n *\n * @param min the minimum value\n * @param maxSmallest the smallest maximum value\n * @param maxLargest the largest maximum value\n * @return the ValueRange for min, smallest max, largest max, not null\n\n * called with 4 params: Obtains a fully variable value range.\n *\n * This factory obtains a range where both the minimum and maximum value may vary.\n *\n * @param minSmallest the smallest minimum value\n * @param minLargest the largest minimum value\n * @param maxSmallest the smallest maximum value\n * @param maxLargest the largest maximum value\n *\n * @return {ValueRange} the ValueRange for smallest min, largest min, smallest max, largest max, not null\n */\n static of() {\n if (arguments.length === 2) {\n return new ValueRange(arguments[0], arguments[0], arguments[1], arguments[1]);\n } else if (arguments.length === 3) {\n return new ValueRange(arguments[0], arguments[0], arguments[1], arguments[2]);\n } else if (arguments.length === 4) {\n return new ValueRange(arguments[0], arguments[1], arguments[2], arguments[3]);\n } else {\n return assert(false, 'Invalid number of arguments ' + arguments.length, IllegalArgumentException);\n }\n }\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {MAX_SAFE_INTEGER, MIN_SAFE_INTEGER} from '../MathUtil';\n\nimport {ChronoUnit} from './ChronoUnit';\nimport {TemporalField} from './TemporalField';\nimport {ValueRange} from './ValueRange';\nimport {YearConstants} from '../YearConstants';\n\n/**\n * A standard set of fields.\n *\n * This set of fields provide field-based access to manipulate a date, time or date-time.\n * The standard set of fields can be extended by implementing {@link TemporalField}.\n *\n * These fields are intended to be applicable in multiple calendar systems.\n * For example, most non-ISO calendar systems define dates as a year, month and day,\n * just with slightly different rules.\n * The documentation of each field explains how it operates.\n *\n * ### Static properties:\n *\n * - `ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH`: This represents concept of the count of\n * days within the period of a week where the weeks are aligned to the start of the month.\n * This field is typically used with `ALIGNED_WEEK_OF_MONTH`.\n * \n * - `ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR`: This represents concept of the count of days\n * within the period of a week where the weeks are aligned to the start of the year.\n * This field is typically used with `ALIGNED_WEEK_OF_YEAR`.\n * \n * - `ChronoField.ALIGNED_WEEK_OF_MONTH`: This represents concept of the count of weeks within\n * the period of a month where the weeks are aligned to the start of the month. This field\n * is typically used with `ALIGNED_DAY_OF_WEEK_IN_MONTH`.\n * \n * - `ChronoField.ALIGNED_WEEK_OF_YEAR`: This represents concept of the count of weeks within\n * the period of a year where the weeks are aligned to the start of the year. This field\n * is typically used with `ALIGNED_DAY_OF_WEEK_IN_YEAR`.\n * \n * - `ChronoField.AMPM_OF_DAY`: This counts the AM/PM within the day, from 0 (AM) to 1 (PM).\n * \n * - `ChronoField.CLOCK_HOUR_OF_AMPM`: This counts the hour within the AM/PM, from 1 to 12.\n * This is the hour that would be observed on a standard 12-hour analog wall clock.\n * \n * - `ChronoField.CLOCK_HOUR_OF_DAY`: This counts the hour within the AM/PM, from 1 to 24.\n * This is the hour that would be observed on a 24-hour analog wall clock.\n * \n * - `ChronoField.DAY_OF_MONTH`: This represents the concept of the day within the month.\n * In the default ISO calendar system, this has values from 1 to 31 in most months.\n * April, June, September, November have days from 1 to 30, while February has days from\n * 1 to 28, or 29 in a leap year.\n * \n * - `ChronoField.DAY_OF_WEEK`: This represents the standard concept of the day of the week.\n * In the default ISO calendar system, this has values from Monday (1) to Sunday (7).\n * The {@link DayOfWeek} class can be used to interpret the result.\n * \n * - `ChronoField.DAY_OF_YEAR`: This represents the concept of the day within the year.\n * In the default ISO calendar system, this has values from 1 to 365 in standard years and\n * 1 to 366 in leap years.\n * \n * - `ChronoField.EPOCH_DAY`: This field is the sequential count of days where\n * 1970-01-01 (ISO) is zero. Note that this uses the local time-line, ignoring offset and\n * time-zone.\n * \n * - `ChronoField.ERA`: This represents the concept of the era, which is the largest\n * division of the time-line. This field is typically used with `YEAR_OF_ERA`.\n * \n * In the default ISO calendar system, there are two eras defined, 'BCE' and 'CE'. The era\n * 'CE' is the one currently in use and year-of-era runs from 1 to the maximum value.\n * The era 'BCE' is the previous era, and the year-of-era runs backwards.\n * \n * - `ChronoField.HOUR_OF_AMPM`: This counts the hour within the AM/PM, from 0 to 11.\n * This is the hour that would be observed on a standard 12-hour digital clock.\n * \n * - `ChronoField.HOUR_OF_DAY`: This counts the hour within the day, from 0 to 23. This is\n * the hour that would be observed on a standard 24-hour digital clock.\n * \n * - `ChronoField.INSTANT_SECONDS`: This represents the concept of the sequential count of\n * seconds where 1970-01-01T00:00Z (ISO) is zero. This field may be used with `NANO_OF_DAY`\n * to represent the fraction of the day.\n * \n * An Instant represents an instantaneous point on the time-line. On their own they have\n * no elements which allow a local date-time to be obtained. Only when paired with an offset\n * or time-zone can the local date or time be found. This field allows the seconds part of\n * the instant to be queried.\n * \n * - `ChronoField.MICRO_OF_DAY`: This counts the microsecond within the day, from 0 to\n * (24 * 60 * 60 * 1,000,000) - 1.\n * \n * This field is used to represent the micro-of-day handling any fraction of the second.\n * Implementations of {@link TemporalAccessor} should provide a value for this field if they\n * can return a value for `SECOND_OF_DAY` filling unknown precision with zero.\n * \n * When this field is used for setting a value, it should behave in the same way as\n * setting `NANO_OF_DAY` with the value multiplied by 1,000.\n * \n * - `ChronoField.MICRO_OF_SECOND`: This counts the microsecond within the second, from 0\n * to 999,999.\n * \n * This field is used to represent the micro-of-second handling any fraction of the second.\n * Implementations of {@link TemporalAccessor} should provide a value for this field if they\n * can return a value for `SECOND_OF_MINUTE`, `SECOND_OF_DAY` or `INSTANT_SECONDS` filling\n * unknown precision with zero.\n * \n * - `ChronoField.MILLI_OF_DAY`: This counts the millisecond within the day, from 0 to\n * (24 * 60 * 60 * 1,000) - 1.\n * \n * This field is used to represent the milli-of-day handling any fraction of the second.\n * Implementations of {@link TemporalAccessor} should provide a value for this field if they\n * can return a value for `SECOND_OF_DAY` filling unknown precision with zero.\n * \n * When this field is used for setting a value, it should behave in the same way as\n * setting `NANO_OF_DAY` with the value multiplied by 1,000,000.\n * \n * - `ChronoField.MILLI_OF_SECOND`: This counts the millisecond within the second, from 0 to\n * 999.\n * \n * This field is used to represent the milli-of-second handling any fraction of the second.\n * Implementations of {@link TemporalAccessor} should provide a value for this field if they can\n * return a value for `SECOND_OF_MINUTE`, `SECOND_OF_DAY` or `INSTANT_SECONDS` filling unknown\n * precision with zero.\n * \n * When this field is used for setting a value, it should behave in the same way as\n * setting `NANO_OF_SECOND` with the value multiplied by 1,000,000.\n * \n * - `ChronoField.MINUTE_OF_DAY`: This counts the minute within the day, from 0 to (24 * 60) - 1.\n * \n * - `ChronoField.MINUTE_OF_HOUR`: This counts the minute within the hour, from 0 to 59.\n * \n * - `ChronoField.MONTH_OF_YEAR`: The month-of-year, such as March. This represents the concept\n * of the month within the year. In the default ISO calendar system, this has values from\n * January (1) to December (12).\n * \n * - `ChronoField.NANO_OF_DAY`: This counts the nanosecond within the day, from 0 to\n * (24 * 60 * 60 * 1,000,000,000) - 1.\n * \n * This field is used to represent the nano-of-day handling any fraction of the second.\n * Implementations of {@link TemporalAccessor} should provide a value for this field if they\n * can return a value for `SECOND_OF_DAY` filling unknown precision with zero.\n * \n * - `ChronoField.NANO_OF_SECOND`: This counts the nanosecond within the second, from 0\n * to 999,999,999.\n * \n * This field is used to represent the nano-of-second handling any fraction of the second.\n * Implementations of {@link TemporalAccessor} should provide a value for this field if they\n * can return a value for `SECOND_OF_MINUTE`, `SECOND_OF_DAY` or `INSTANT_SECONDS` filling\n * unknown precision with zero.\n * \n * When this field is used for setting a value, it should set as much precision as the\n * object stores, using integer division to remove excess precision. For example, if the\n * {@link TemporalAccessor} stores time to millisecond precision, then the nano-of-second must\n * be divided by 1,000,000 before replacing the milli-of-second.\n * \n * - `ChronoField.OFFSET_SECONDS`: This represents the concept of the offset in seconds of\n * local time from UTC/Greenwich.\n * \n * A {@link ZoneOffset} represents the period of time that local time differs from\n * UTC/Greenwich. This is usually a fixed number of hours and minutes. It is equivalent to\n * the total amount of the offset in seconds. For example, during the winter Paris has an\n * offset of +01:00, which is 3600 seconds.\n * \n * - `ChronoField.PROLEPTIC_MONTH`: The proleptic-month, which counts months sequentially\n * from year 0.\n * \n * The first month in year zero has the value zero. The value increase for later months\n * and decrease for earlier ones. Note that this uses the local time-line, ignoring offset\n * and time-zone.\n * \n * - `ChronoField.SECOND_OF_DAY`: This counts the second within the day, from 0 to\n * (24 * 60 * 60) - 1.\n * \n * - `ChronoField.SECOND_OF_MINUTE`: This counts the second within the minute, from 0 to 59.\n * \n * - `ChronoField.YEAR`: The proleptic year, such as 2012. This represents the concept of\n * the year, counting sequentially and using negative numbers. The proleptic year is not\n * interpreted in terms of the era.\n * \n * The standard mental model for a date is based on three concepts - year, month and day.\n * These map onto the `YEAR`, `MONTH_OF_YEAR` and `DAY_OF_MONTH` fields. Note that there is no\n * reference to eras. The full model for a date requires four concepts - era, year, month and\n * day. These map onto the `ERA`, `YEAR_OF_ERA`, `MONTH_OF_YEAR` and `DAY_OF_MONTH` fields.\n * Whether this field or `YEAR_OF_ERA` is used depends on which mental model is being used.\n * \n * - `ChronoField.YEAR_OF_ERA`: This represents the concept of the year within the era. This\n * field is typically used with `ERA`. The standard mental model for a date is based on three\n * concepts - year, month and day. These map onto the `YEAR`, `MONTH_OF_YEAR` and\n * `DAY_OF_MONTH` fields. Note that there is no reference to eras. The full model for a date\n * requires four concepts - era, year, month and day. These map onto the `ERA`, `YEAR_OF_ERA`,\n * `MONTH_OF_YEAR` and `DAY_OF_MONTH` fields. Whether this field or `YEAR` is used depends on\n * which mental model is being used.\n * \n * In the default ISO calendar system, there are two eras defined, 'BCE' and 'CE'.\n * The era 'CE' is the one currently in use and year-of-era runs from 1 to the maximum value.\n * The era 'BCE' is the previous era, and the year-of-era runs backwards.\n * \n * For example, subtracting a year each time yield the following:\n * - year-proleptic 2 = 'CE' year-of-era 2\n * - year-proleptic 1 = 'CE' year-of-era 1\n * - year-proleptic 0 = 'BCE' year-of-era 1\n * - year-proleptic -1 = 'BCE' year-of-era 2\n * \n * Note that the ISO-8601 standard does not actually define eras. Note also that the\n * ISO eras do not align with the well-known AD/BC eras due to the change between the Julian\n * and Gregorian calendar systems.\n */\nexport class ChronoField extends TemporalField {\n\n /**\n * helper function to get one of the static ChronoField defines by name, needed to resolve ChronoField from EnumMap\n *\n * @param {String} fieldName\n * @return {ChronoField | null}\n * @private\n */\n static byName(fieldName) {\n for (const prop in ChronoField) {\n if (ChronoField[prop]) {\n if ((ChronoField[prop] instanceof ChronoField) && ChronoField[prop].name() === fieldName) {\n return ChronoField[prop];\n }\n }\n }\n }\n\n /**\n *\n * @param {!string} name\n * @param {!TemporalUnit} baseUnit\n * @param {!TemporalUnit} rangeUnit\n * @param {!ValueRange} range\n * @private\n */\n constructor(name, baseUnit, rangeUnit, range) {\n super();\n this._name = name;\n this._baseUnit = baseUnit;\n this._rangeUnit = rangeUnit;\n this._range = range;\n }\n\n /**\n * @return {string}\n */\n name(){\n return this._name;\n }\n\n /**\n * @return {TemporalUnit} the period unit defining the base unit of the field.\n */\n baseUnit(){\n return this._baseUnit;\n }\n\n /**\n * @return {TemporalUnit} the period unit defining the range of the field.\n */\n rangeUnit(){\n return this._rangeUnit;\n }\n\n /**\n * @return {ValueRange} the range of valid values for the field.\n */\n range(){\n return this._range;\n }\n\n /**\n * @returns {string}\n */\n displayName(){\n return this.toString();\n }\n\n /**\n * Checks that the specified value is valid for this field.\n *\n * This validates that the value is within the outer range of valid values\n * returned by {@link range}.\n *\n * This method checks against the range of the field in the ISO-8601 calendar system.\n *\n * @param {!number} value the value to check.\n * @returns {number} the value that was passed in.\n */\n checkValidValue(value) {\n return this.range().checkValidValue(value, this);\n }\n\n /**\n * Checks that the specified value is valid and fits in an `int`.\n *\n * This validates that the value is within the outer range of valid values\n * returned by {@link range}.\n * It also checks that all valid values are within the bounds of an `int`.\n *\n * This method checks against the range of the field in the ISO-8601 calendar system.\n *\n * @param {number} value the value to check.\n * @return {number} the value that was passed in.\n */\n checkValidIntValue(value) {\n return this.range().checkValidIntValue(value, this);\n }\n\n /**\n * @return {boolean} `true` if it is a component of a date, `false` otherwise.\n */\n isDateBased() {\n const dateBased =\n this === ChronoField.DAY_OF_WEEK ||\n this === ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH ||\n this === ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR ||\n this === ChronoField.DAY_OF_MONTH ||\n this === ChronoField.DAY_OF_YEAR ||\n this === ChronoField.EPOCH_DAY ||\n this === ChronoField.ALIGNED_WEEK_OF_MONTH ||\n this === ChronoField.ALIGNED_WEEK_OF_YEAR ||\n this === ChronoField.MONTH_OF_YEAR ||\n //this === ChronoField.EPOCH_MONTH ||\n this === ChronoField.YEAR_OF_ERA ||\n this === ChronoField.YEAR ||\n this === ChronoField.ERA;\n return dateBased;\n }\n\n /**\n * @return {boolean} `true` if it is a component of a time, `false` otherwise.\n */\n isTimeBased() {\n const timeBased =\n this === ChronoField.NANO_OF_SECOND ||\n this === ChronoField.NANO_OF_DAY ||\n this === ChronoField.MICRO_OF_SECOND ||\n this === ChronoField.MICRO_OF_DAY ||\n this === ChronoField.MILLI_OF_SECOND ||\n this === ChronoField.MILLI_OF_DAY ||\n this === ChronoField.SECOND_OF_MINUTE ||\n this === ChronoField.SECOND_OF_DAY ||\n this === ChronoField.MINUTE_OF_HOUR ||\n this === ChronoField.MINUTE_OF_DAY ||\n this === ChronoField.HOUR_OF_AMPM ||\n this === ChronoField.CLOCK_HOUR_OF_AMPM ||\n this === ChronoField.HOUR_OF_DAY ||\n this === ChronoField.CLOCK_HOUR_OF_DAY ||\n this === ChronoField.AMPM_OF_DAY;\n return timeBased;\n }\n\n /**\n * @param {!TemporalAccessor} temporal the temporal object used to refine the result.\n * @return {ValueRange} the range of valid values for this field.\n * @throws {DateTimeException} if the range for the field cannot be obtained.\n */\n rangeRefinedBy(temporal) {\n return temporal.range(this);\n }\n\n \n\n /**\n * @param {!TemporalAccesor} temporal the temporal object to query.\n * @return {number} the value of this field.\n * @throws {DateTimeException} if a value for the field cannot be obtained.\n */\n getFrom(temporal) {\n return temporal.getLong(this);\n }\n\n /**\n * @returns {string}\n */\n toString(){\n return this.name();\n }\n\n /**\n * @param {*} other\n * @returns {boolean}\n */\n equals(other){\n return this === other;\n }\n\n /**\n * @param {!Temporal} temporal the temporal object to adjust.\n * @param {!number} newValue the new value of the field.\n * @return {Temporal} the adjusted temporal object.\n * @throws {DateTimeException} if the field cannot be set.\n */\n adjustInto(temporal, newValue) {\n return temporal.with(this, newValue);\n }\n\n /**\n * @param {!TemporalAccesor} temporal the temporal object to query.\n * @return {boolean} `true` if the date-time can be queried for this field, `false` if not.\n */\n isSupportedBy(temporal) {\n return temporal.isSupported(this);\n }\n}\n\nexport function _init() {\n\n ChronoField.NANO_OF_SECOND = new ChronoField('NanoOfSecond', ChronoUnit.NANOS, ChronoUnit.SECONDS, ValueRange.of(0, 999999999));\n\n ChronoField.NANO_OF_DAY = new ChronoField('NanoOfDay', ChronoUnit.NANOS, ChronoUnit.DAYS, ValueRange.of(0, 86400 * 1000000000 - 1));\n\n ChronoField.MICRO_OF_SECOND = new ChronoField('MicroOfSecond', ChronoUnit.MICROS, ChronoUnit.SECONDS, ValueRange.of(0, 999999));\n\n ChronoField.MICRO_OF_DAY = new ChronoField('MicroOfDay', ChronoUnit.MICROS, ChronoUnit.DAYS, ValueRange.of(0, 86400 * 1000000 - 1));\n\n ChronoField.MILLI_OF_SECOND = new ChronoField('MilliOfSecond', ChronoUnit.MILLIS, ChronoUnit.SECONDS, ValueRange.of(0, 999));\n\n ChronoField.MILLI_OF_DAY = new ChronoField('MilliOfDay', ChronoUnit.MILLIS, ChronoUnit.DAYS, ValueRange.of(0, 86400 * 1000 - 1));\n\n ChronoField.SECOND_OF_MINUTE = new ChronoField('SecondOfMinute', ChronoUnit.SECONDS, ChronoUnit.MINUTES, ValueRange.of(0, 59));\n\n ChronoField.SECOND_OF_DAY = new ChronoField('SecondOfDay', ChronoUnit.SECONDS, ChronoUnit.DAYS, ValueRange.of(0, 86400 - 1));\n\n ChronoField.MINUTE_OF_HOUR = new ChronoField('MinuteOfHour', ChronoUnit.MINUTES, ChronoUnit.HOURS, ValueRange.of(0, 59));\n\n ChronoField.MINUTE_OF_DAY = new ChronoField('MinuteOfDay', ChronoUnit.MINUTES, ChronoUnit.DAYS, ValueRange.of(0, (24 * 60) - 1));\n\n ChronoField.HOUR_OF_AMPM = new ChronoField('HourOfAmPm', ChronoUnit.HOURS, ChronoUnit.HALF_DAYS, ValueRange.of(0, 11));\n\n ChronoField.CLOCK_HOUR_OF_AMPM = new ChronoField('ClockHourOfAmPm', ChronoUnit.HOURS, ChronoUnit.HALF_DAYS, ValueRange.of(1, 12));\n\n ChronoField.HOUR_OF_DAY = new ChronoField('HourOfDay', ChronoUnit.HOURS, ChronoUnit.DAYS, ValueRange.of(0, 23));\n\n ChronoField.CLOCK_HOUR_OF_DAY = new ChronoField('ClockHourOfDay', ChronoUnit.HOURS, ChronoUnit.DAYS, ValueRange.of(1, 24));\n\n ChronoField.AMPM_OF_DAY = new ChronoField('AmPmOfDay', ChronoUnit.HALF_DAYS, ChronoUnit.DAYS, ValueRange.of(0, 1));\n\n ChronoField.DAY_OF_WEEK = new ChronoField('DayOfWeek', ChronoUnit.DAYS, ChronoUnit.WEEKS, ValueRange.of(1, 7));\n\n ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH = new ChronoField('AlignedDayOfWeekInMonth', ChronoUnit.DAYS, ChronoUnit.WEEKS, ValueRange.of(1, 7));\n\n ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR = new ChronoField('AlignedDayOfWeekInYear', ChronoUnit.DAYS, ChronoUnit.WEEKS, ValueRange.of(1, 7));\n\n ChronoField.DAY_OF_MONTH = new ChronoField('DayOfMonth', ChronoUnit.DAYS, ChronoUnit.MONTHS, ValueRange.of(1, 28, 31), 'day');\n\n ChronoField.DAY_OF_YEAR = new ChronoField('DayOfYear', ChronoUnit.DAYS, ChronoUnit.YEARS, ValueRange.of(1, 365, 366));\n\n ChronoField.EPOCH_DAY = new ChronoField('EpochDay', ChronoUnit.DAYS, ChronoUnit.FOREVER, ValueRange.of(Math.floor(YearConstants.MIN_VALUE * 365.25), Math.floor(YearConstants.MAX_VALUE * 365.25)));\n\n ChronoField.ALIGNED_WEEK_OF_MONTH = new ChronoField('AlignedWeekOfMonth', ChronoUnit.WEEKS, ChronoUnit.MONTHS, ValueRange.of(1, 4, 5));\n\n ChronoField.ALIGNED_WEEK_OF_YEAR = new ChronoField('AlignedWeekOfYear', ChronoUnit.WEEKS, ChronoUnit.YEARS, ValueRange.of(1, 53));\n\n ChronoField.MONTH_OF_YEAR = new ChronoField('MonthOfYear', ChronoUnit.MONTHS, ChronoUnit.YEARS, ValueRange.of(1, 12), 'month');\n\n ChronoField.PROLEPTIC_MONTH = new ChronoField('ProlepticMonth', ChronoUnit.MONTHS, ChronoUnit.FOREVER, ValueRange.of(YearConstants.MIN_VALUE * 12, YearConstants.MAX_VALUE * 12 + 11));\n\n ChronoField.YEAR_OF_ERA = new ChronoField('YearOfEra', ChronoUnit.YEARS, ChronoUnit.FOREVER, ValueRange.of(1, YearConstants.MAX_VALUE, YearConstants.MAX_VALUE + 1));\n\n ChronoField.YEAR = new ChronoField('Year', ChronoUnit.YEARS, ChronoUnit.FOREVER, ValueRange.of(YearConstants.MIN_VALUE, YearConstants.MAX_VALUE), 'year');\n\n ChronoField.ERA = new ChronoField('Era', ChronoUnit.ERAS, ChronoUnit.FOREVER, ValueRange.of(0, 1));\n\n ChronoField.INSTANT_SECONDS = new ChronoField('InstantSeconds', ChronoUnit.SECONDS, ChronoUnit.FOREVER, ValueRange.of(MIN_SAFE_INTEGER, MAX_SAFE_INTEGER));\n\n ChronoField.OFFSET_SECONDS = new ChronoField('OffsetSeconds', ChronoUnit.SECONDS, ChronoUnit.FOREVER, ValueRange.of(-18 * 3600, 18 * 3600));\n\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\n/**\n * Common implementations of {@link TemporalQuery}.\n *\n * This class provides common implementations of {@link TemporalQuery}.\n * These queries are primarily used as optimizations, allowing the internals\n * of other objects to be extracted effectively. Note that application code\n * can also use the {@link from} method on most temporal\n * objects as a method reference matching the query interface, such as\n * {@link LocalDate::from} and {@link ZoneId::from}.\n *\n * There are two equivalent ways of using a {@link TemporalQuery}.\n * The first is to invoke the method on the interface directly.\n * The second is to use {@link TemporalAccessor#query}:\n *
\n *   // these two lines are equivalent, but the second approach is recommended\n *   dateTime = query.queryFrom(dateTime);\n *   dateTime = dateTime.query(query);\n * 
\n * It is recommended to use the second approach, {@link query},\n * as it is a lot clearer to read in code.\n *\n */\nexport class TemporalQueries {\n\n /**\n * A strict query for the {@link ZoneId}.\n *\n * This queries a {@link TemporalAccessor} for the zone.\n * The zone is only returned if the date-time conceptually contains a {@link ZoneId}.\n * It will not be returned if the date-time only conceptually has an {@link ZoneOffset}.\n * Thus a {@link ZonedDateTime} will return the result of\n * {@link getZone}, but an {@link OffsetDateTime} will\n * return null.\n *\n * In most cases, applications should use {@link ZONE} as this query is too strict.\n *\n * The result from JDK classes implementing {@link TemporalAccessor} is as follows:\n * * * {@link LocalDate} returns null\n * * {@link LocalTime} returns null\n * * {@link LocalDateTime} returns null\n * * {@link ZonedDateTime} returns the associated zone\n * * {@link OffsetTime} returns null\n * * {@link OffsetDateTime} returns null\n * * {@link ChronoLocalDate} returns null\n * * {@link ChronoLocalDateTime} returns null\n * * {@link ChronoZonedDateTime} returns the associated zone\n * * {@link Era} returns null\n * * {@link DayOfWeek} returns null\n * * {@link Month} returns null\n * * {@link Year} returns null\n * * {@link YearMonth} returns null\n * * {@link MonthDay} returns null\n * * {@link ZoneOffset} returns null\n * * {@link Instant} returns null\n *\n * @return a query that can obtain the zone ID of a temporal, not null\n */\n static zoneId() {\n return TemporalQueries.ZONE_ID;\n }\n\n /**\n * A query for the {@link Chronology}.\n *\n * This queries a {@link TemporalAccessor} for the chronology.\n * If the target {@link TemporalAccessor} represents a date, or part of a date,\n * then it should return the chronology that the date is expressed in.\n * As a result of this definition, objects only representing time, such as\n * {@link LocalTime}, will return null.\n *\n * The result from js-joda classes implementing {@link TemporalAccessor} is as follows:\n *\n * * {@link LocalDate} returns * {@link IsoChronology.INSTANCE}\n * * {@link LocalTime} returns null (does not represent a date)\n * * {@link LocalDateTime} returns * {@link IsoChronology.INSTANCE}\n * * {@link ZonedDateTime} returns * {@link IsoChronology.INSTANCE}\n * * {@link OffsetTime} returns null (does not represent a date)\n * * {@link OffsetDateTime} returns * {@link IsoChronology.INSTANCE}\n * * {@link ChronoLocalDate} returns the associated chronology\n * * {@link ChronoLocalDateTime} returns the associated chronology\n * * {@link ChronoZonedDateTime} returns the associated chronology\n * * {@link Era} returns the associated chronology\n * * {@link DayOfWeek} returns null (shared across chronologies)\n * * {@link Month} returns * {@link IsoChronology.INSTANCE}\n * * {@link Year} returns * {@link IsoChronology.INSTANCE}\n * * {@link YearMonth} returns * {@link IsoChronology.INSTANCE}\n * * {@link MonthDay} returns null * {@link IsoChronology.INSTANCE}\n * * {@link ZoneOffset} returns null (does not represent a date)\n * * {@link Instant} returns null (does not represent a date)\n *\n * The method {@link Chronology#from} can be used as a\n * {@link TemporalQuery}\n * That method is equivalent to this query, except that it throws an\n * exception if a chronology cannot be obtained.\n *\n * @return {TemporalQuery} a query that can obtain the chronology of a temporal, not null\n */\n static chronology() {\n return TemporalQueries.CHRONO;\n }\n\n /**\n * A query for the smallest supported unit.\n *\n * This queries a {@link TemporalAccessor} for the time precision.\n * If the target {@link TemporalAccessor} represents a consistent or complete date-time,\n * date or time then this must return the smallest precision actually supported.\n * Note that fields such as {@link NANO_OF_DAY} and {@link NANO_OF_SECOND}\n * are defined to always return ignoring the precision, thus this is the only\n * way to find the actual smallest supported unit.\n * For example, were {@link GregorianCalendar} to implement {@link TemporalAccessor}\n * it would return a precision of {@link MILLIS}.\n *\n * The result from js-joda classes implementing {@link TemporalAccessor} is as follows:\n *\n * {@link LocalDate} returns {@link DAYS}\n * {@link LocalTime} returns {@link NANOS}\n * {@link LocalDateTime} returns {@link NANOS}\n * {@link ZonedDateTime} returns {@link NANOS}\n * {@link OffsetTime} returns {@link NANOS}\n * {@link OffsetDateTime} returns {@link NANOS}\n * {@link ChronoLocalDate} returns {@link DAYS}\n * {@link ChronoLocalDateTime} returns {@link NANOS}\n * {@link ChronoZonedDateTime} returns {@link NANOS}\n * {@link Era} returns {@link ERAS}\n * {@link DayOfWeek} returns {@link DAYS}\n * {@link Month} returns {@link MONTHS}\n * {@link Year} returns {@link YEARS}\n * {@link YearMonth} returns {@link MONTHS}\n * {@link MonthDay} returns null (does not represent a complete date or time)\n * {@link ZoneOffset} returns null (does not represent a date or time)\n * {@link Instant} returns {@link NANOS}\n *\n * @return a query that can obtain the precision of a temporal, not null\n */\n static precision() {\n return TemporalQueries.PRECISION;\n }\n\n /**\n * A lenient query for the {@link ZoneId}, falling back to the {@link ZoneOffset}.\n *\n * This queries a {@link TemporalAccessor} for the zone.\n * It first tries to obtain the zone, using {@link zoneId}.\n * If that is not found it tries to obtain the {@link offset}.\n *\n * In most cases, applications should use this query rather than {@link zoneId}.\n *\n * This query examines the {@link ChronoField#OFFSET_SECONDS}\n * field and uses it to create a {@link ZoneOffset}.\n *\n * The method {@link ZoneId#from} can be used as a\n * {@link TemporalQuery} via a method reference, {@link ZoneId::from}.\n * That method is equivalent to this query, except that it throws an\n * exception if a zone cannot be obtained.\n *\n * @return a query that can obtain the zone ID or offset of a temporal, not null\n */\n static zone() {\n return TemporalQueries.ZONE;\n }\n\n /**\n * A query for {@link ZoneOffset} returning null if not found.\n *\n * This returns a {@link TemporalQuery} that can be used to query a temporal\n * object for the offset. The query will return null if the temporal\n * object cannot supply an offset.\n *\n * The query implementation examines the {@link ChronoField#OFFSET_SECONDS}\n * field and uses it to create a {@link ZoneOffset}.\n *\n * The method {@link java.time.ZoneOffset#from} can be used as a\n * {@link TemporalQuery} via a method reference, {@link ZoneOffset::from}.\n * This query and {@link ZoneOffset::from} will return the same result if the\n * temporal object contains an offset. If the temporal object does not contain\n * an offset, then the method reference will throw an exception, whereas this\n * query will return null.\n *\n * @return a query that can obtain the offset of a temporal, not null\n */\n static offset() {\n return TemporalQueries.OFFSET;\n }\n\n /**\n * A query for {@link LocalDate} returning null if not found.\n *\n * This returns a {@link TemporalQuery} that can be used to query a temporal\n * object for the local date. The query will return null if the temporal\n * object cannot supply a local date.\n *\n * The query implementation examines the {@link ChronoField#EPOCH_DAY}\n * field and uses it to create a {@link LocalDate}.\n *\n * @return a query that can obtain the date of a temporal, not null\n */\n static localDate() {\n return TemporalQueries.LOCAL_DATE;\n }\n\n /**\n * A query for {@link LocalTime} returning null if not found.\n *\n * This returns a {@link TemporalQuery} that can be used to query a temporal\n * object for the local time. The query will return null if the temporal\n * object cannot supply a local time.\n *\n * The query implementation examines the {@link ChronoField#NANO_OF_DAY}\n * field and uses it to create a {@link LocalTime}.\n *\n * @return a query that can obtain the time of a temporal, not null\n */\n static localTime() {\n return TemporalQueries.LOCAL_TIME;\n }\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {UnsupportedTemporalTypeException} from '../errors';\n\nimport {ChronoField} from './ChronoField';\nimport {TemporalQueries} from './TemporalQueries';\n\nexport class TemporalAccessor {\n /**\n * Queries this date-time.\n *\n * This queries this date-time using the specified query strategy object.\n *\n * Queries are a key tool for extracting information from date-times.\n * They exists to externalize the process of querying, permitting different\n * approaches, as per the strategy design pattern.\n * Examples might be a query that checks if the date is the day before February 29th\n * in a leap year, or calculates the number of days to your next birthday.\n *\n * The most common query implementations are method references, such as\n * {@link LocalDate::from} and {@link ZoneId::from}.\n * Further implementations are on {@link TemporalQueries}.\n * Queries may also be defined by applications.\n *\n * @implSpec\n * Implementations of this method must behave as follows:\n *
\n        if (query == TemporalQueries.zoneId()\n            || query == TemporalQueries.chronology()\n            || query == TemporalQueries.precision()) {\n                return null;\n        }\n        return query.queryFrom(this);\n     * 
\n *\n * @param {TemporalQuery} query the query to invoke, not null\n * @return the query result, null may be returned (defined by the query)\n * @throws DateTimeException if unable to query\n * @throws ArithmeticException if numeric overflow occurs\n */\n query(query) {\n if (query === TemporalQueries.zoneId()\n || query === TemporalQueries.chronology()\n || query === TemporalQueries.precision()) {\n return null;\n }\n return query.queryFrom(this);\n }\n\n /**\n * Gets the value of the specified field as an `int`.\n *\n * This queries the date-time for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If the date-time cannot return the value, because the field is unsupported or for\n * some other reason, an exception will be thrown.\n *\n * ### Specification for implementors\n *\n * Implementations must check and handle all fields defined in {@link ChronoField}.\n * If the field is supported and has an `int` range, then the value of\n * the field must be returned.\n * If unsupported, then a {@link DateTimeException} must be thrown.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing `this` as the argument.\n *\n * Implementations must not alter either this object.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field, within the valid range of values\n * @throws DateTimeException if a value for the field cannot be obtained\n * @throws DateTimeException if the range of valid values for the field exceeds an `int`\n * @throws DateTimeException if the value is outside the range of valid values for the field\n * @throws ArithmeticException if numeric overflow occurs\n */\n get(field) {\n return this.range(field).checkValidIntValue(this.getLong(field), field);\n }\n\n /**\n * Gets the range of valid values for the specified field.\n *\n * All fields can be expressed as a `long` integer.\n * This method returns an object that describes the valid range for that value.\n * The value of this temporal object is used to enhance the accuracy of the returned range.\n * If the date-time cannot return the range, because the field is unsupported or for\n * some other reason, an exception will be thrown.\n *\n * Note that the result only describes the minimum and maximum valid values\n * and it is important not to read too much into them. For example, there\n * could be values within the range that are invalid for the field.\n *\n * ### Specification for implementors\n *\n * Implementations must check and handle all fields defined in {@link ChronoField}.\n * If the field is supported, then the range of the field must be returned.\n * If unsupported, then a {@link DateTimeException} must be thrown.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.rangeRefinedBy}\n * passing `this` as the argument.\n *\n * Implementations must not alter either this object.\n *\n * @param {TemporalField} field the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws DateTimeException if the range for the field cannot be obtained\n */\n range(field) {\n if (field instanceof ChronoField) {\n if (this.isSupported(field)) {\n return field.range();\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.rangeRefinedBy(this);\n }\n\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {abstractMethodFail} from '../assert';\nimport {Enum} from '../Enum';\n\n\n/**\n * Strategy for querying a temporal object.\n *\n * Queries are a key tool for extracting information from temporal objects.\n * They exist to externalize the process of querying, permitting different\n * approaches, as per the strategy design pattern.\n * Examples might be a query that checks if the date is the day before February 29th\n * in a leap year, or calculates the number of days to your next birthday.\n *\n * The {@link TemporalField} interface provides another mechanism for querying\n * temporal objects. That interface is limited to returning a `long`.\n * By contrast, queries can return any type.\n *\n * There are two equivalent ways of using a {@link TemporalQuery}.\n * The first is to invoke the method on this interface directly.\n * The second is to use {@link TemporalAccessor#query}:\n *
\n *   // these two lines are equivalent, but the second approach is recommended\n *   temporal = thisQuery.queryFrom(temporal);\n *   temporal = temporal.query(thisQuery);\n * 
\n * It is recommended to use the second approach, {@link query},\n * as it is a lot clearer to read in code.\n *\n * The most common implementations are method references, such as\n * {@link LocalDate::from} and {@link ZoneId::from}.\n * Further implementations are on {@link TemporalQueries}.\n * Queries may also be defined by applications.\n *\n * ### Specification for implementors\n *\n * This interface places no restrictions on the mutability of implementations,\n * however immutability is strongly recommended.\n *\n * @interface\n */\nexport class TemporalQuery extends Enum {\n /**\n * Queries the specified temporal object.\n *\n * This queries the specified temporal object to return an object using the logic\n * encapsulated in the implementing class.\n * Examples might be a query that checks if the date is the day before February 29th\n * in a leap year, or calculates the number of days to your next birthday.\n *\n * There are two equivalent ways of using this method.\n * The first is to invoke this method directly.\n * The second is to use {@link TemporalAccessor#query}:\n *
\n     *   // these two lines are equivalent, but the second approach is recommended\n     *   temporal = thisQuery.queryFrom(temporal);\n     *   temporal = temporal.query(thisQuery);\n     * 
\n * It is recommended to use the second approach, {@link query},\n * as it is a lot clearer to read in code.\n *\n * ### Specification for implementors\n *\n * The implementation must take the input object and query it.\n * The implementation defines the logic of the query and is responsible for\n * documenting that logic.\n * It may use any method on {@link TemporalAccessor} to determine the result.\n * The input object must not be altered.\n *\n * The input temporal object may be in a calendar system other than ISO.\n * Implementations may choose to document compatibility with other calendar systems,\n * or reject non-ISO temporal objects by querying the chronology (see {@link TemporalQueries#chronology}).\n *\n * This method may be called from multiple threads in parallel.\n * It must be thread-safe when invoked.\n *\n * @param {TemporalAccessor} temporal the temporal object to query, not null\n * @return the queried value, may return null to indicate not found\n * @throws DateTimeException if unable to query\n * @throws ArithmeticException if numeric overflow occurs\n */\n // eslint-disable-next-line no-unused-vars\n queryFrom(temporal){\n abstractMethodFail('queryFrom');\n }\n\n}\n\n/**\n * Factory to create something similar to the JSR-310 {TemporalQuery} interface, takes a function and returns a new TemporalQuery object that presents that function\n * as the queryFrom() function.\n * @param name for the underlying Enum\n * @param queryFromFunction\n */\nexport function createTemporalQuery(name, queryFromFunction) {\n class ExtendedTemporalQuery extends TemporalQuery {\n\n }\n\n ExtendedTemporalQuery.prototype.queryFrom = queryFromFunction;\n return new ExtendedTemporalQuery(name);\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {DateTimeException, UnsupportedTemporalTypeException, NullPointerException} from './errors';\nimport {MathUtil} from './MathUtil';\nimport {assert, requireNonNull, requireInstance} from './assert';\n\nimport {ChronoField} from './temporal/ChronoField';\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {IllegalArgumentException} from './errors';\nimport {TemporalAccessor} from './temporal/TemporalAccessor';\nimport {TemporalQueries} from './temporal/TemporalQueries';\nimport {createTemporalQuery} from './temporal/TemporalQuery';\n\n/**\n * ### Static properties of Class {@link DayOfWeek}\n *\n * DayOfWeek.MONDAY,\n * DayOfWeek.TUESDAY,\n * DayOfWeek.WEDNESDAY,\n * DayOfWeek.THURSDAY,\n * DayOfWeek.FRIDAY,\n * DayOfWeek.SATURDAY,\n * DayOfWeek.SUNDAY\n *\n */\nexport class DayOfWeek extends TemporalAccessor {\n\n /**\n *\n * @param {number} ordinal\n * @param {string} name\n * @private\n */\n constructor(ordinal, name){\n super();\n this._ordinal = ordinal;\n this._name = name;\n }\n\n /**\n *\n * @returns {number}\n */\n ordinal(){\n return this._ordinal;\n }\n\n /**\n *\n * @returns {string}\n */\n name(){\n return this._name;\n }\n\n /**\n *\n * @returns {DayOfWeek[]}\n */\n static values() {\n return ENUMS.slice();\n }\n\n /**\n *\n * @param {string} name\n * @returns {DayOfWeek}\n */\n static valueOf(name) {\n let ordinal = 0;\n for(ordinal; ordinal < ENUMS.length; ordinal++){\n if(ENUMS[ordinal].name() === name){\n break;\n }\n }\n return DayOfWeek.of(ordinal+1);\n }\n\n /**\n * Obtains an instance of {@link DayOfWeek} from an `int` value.\n *\n * {@link DayOfWeek} is an enum representing the 7 days of the week.\n * This factory allows the enum to be obtained from the `int` value.\n * The `int` value follows the ISO-8601 standard, from 1 (Monday) to 7 (Sunday).\n *\n * @param {!number} dayOfWeek the day-of-week to represent, from 1 (Monday) to 7 (Sunday)\n * @return {DayOfWeek} the day-of-week singleton, not null\n * @throws DateTimeException if the day-of-week is invalid\n */\n static of(dayOfWeek) {\n if (dayOfWeek < 1 || dayOfWeek > 7) {\n throw new DateTimeException('Invalid value for DayOfWeek: ' + dayOfWeek);\n }\n return ENUMS[dayOfWeek - 1];\n }\n\n /**\n * Obtains an instance of {@link DayOfWeek} from a temporal object.\n *\n * A {@link TemporalAccessor} represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of {@link DayOfWeek}.\n *\n * The conversion extracts the {@link ChronoField#DAY_OF_WEEK} field.\n *\n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used as a query via method reference, {@link DayOfWeek::from}.\n *\n * @param {TemporalAccessor} temporal - the temporal object to convert, not null\n * @return {DayOfWeek} the day-of-week, not null\n * @throws DateTimeException if unable to convert to a {@link DayOfWeek}\n */\n static from(temporal) {\n assert(temporal != null, 'temporal', NullPointerException);\n if (temporal instanceof DayOfWeek) {\n return temporal;\n }\n try {\n return DayOfWeek.of(temporal.get(ChronoField.DAY_OF_WEEK));\n } catch (ex) {\n if(ex instanceof DateTimeException) {\n throw new DateTimeException('Unable to obtain DayOfWeek from TemporalAccessor: ' +\n temporal + ', type ' + (temporal.constructor != null ? temporal.constructor.name : ''), ex);\n } else {\n throw ex;\n }\n }\n }\n\n /**\n * Gets the day-of-week `int` value.\n *\n * The values are numbered following the ISO-8601 standard, from 1 (Monday) to 7 (Sunday).\n * See {@link WeekFields#dayOfWeek} for localized week-numbering.\n *\n * @return {number} the day-of-week, from 1 (Monday) to 7 (Sunday)\n */\n value() {\n return this._ordinal + 1;\n }\n\n /**\n * Gets the textual representation, such as 'Mon' or 'Friday'.\n *\n * This returns the textual name used to identify the day-of-week.\n * The parameters control the length of the returned text and the locale.\n *\n * If no textual mapping is found then the numeric value (see {@link getValue}) is returned.\n *\n * @param {TextStyle} style - the length of the text required, not null\n * @param {Locale} locale - the locale to use, not null\n * @return {string} the text value of the day-of-week, not null\n */\n // eslint-disable-next-line no-unused-vars\n displayName(style, locale) {\n throw new IllegalArgumentException('Pattern using (localized) text not implemented yet!');\n // return new DateTimeFormatterBuilder().appendText(ChronoField.DAY_OF_WEEK, style).toFormatter(locale).format(this);\n }\n\n /**\n * Checks if the specified field is supported.\n *\n * This checks if this day-of-week can be queried for the specified field.\n * If false, then calling the {@link range} and\n * {@link get} methods will throw an exception.\n *\n * If the field is {@link ChronoField#DAY_OF_WEEK} then\n * this method returns true.\n * All other {@link ChronoField} instances will return false.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking `TemporalField.isSupportedBy(TemporalAccessor)`\n * passing `this` as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param {TemporalField} field - the field to check, null returns false\n * @return {boolean} true if the field is supported on this day-of-week, false if not\n */\n isSupported(field) {\n if (field instanceof ChronoField) {\n return field === ChronoField.DAY_OF_WEEK;\n }\n return field != null && field.isSupportedBy(this);\n }\n\n /**\n * Gets the range of valid values for the specified field.\n *\n * The range object expresses the minimum and maximum valid values for a field.\n * This day-of-week is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is {@link ChronoField#DAY_OF_WEEK} then the\n * range of the day-of-week, from 1 to 7, will be returned.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking `TemporalField.rangeRefinedBy(TemporalAccessor)`\n * passing `this` as the argument.\n * Whether the range can be obtained is determined by the field.\n *\n * @param {TemporalField} field - the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws DateTimeException if the range for the field cannot be obtained\n */\n range(field) {\n if (field === ChronoField.DAY_OF_WEEK) {\n return field.range();\n } else if (field instanceof ChronoField) {\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.rangeRefinedBy(this);\n }\n\n /**\n * Gets the value of the specified field from this day-of-week as an `int`.\n *\n * This queries this day-of-week for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is {@link ChronoField#DAY_OF_WEEK} then the\n * value of the day-of-week, from 1 to 7, will be returned.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field, within the valid range of values\n * @throws DateTimeException if a value for the field cannot be obtained\n * @throws DateTimeException if the range of valid values for the field exceeds an `int`\n * @throws DateTimeException if the value is outside the range of valid values for the field\n * @throws ArithmeticException if numeric overflow occurs\n */\n get(field) {\n if (field === ChronoField.DAY_OF_WEEK) {\n return this.value();\n }\n return this.range(field).checkValidIntValue(this.getLong(field), field);\n }\n\n /**\n * Gets the value of the specified field from this day-of-week as a `long`.\n *\n * This queries this day-of-week for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is {@link ChronoField#DAY_OF_WEEK} then the\n * value of the day-of-week, from 1 to 7, will be returned.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws DateTimeException if a value for the field cannot be obtained\n * @throws ArithmeticException if numeric overflow occurs\n */\n getLong(field) {\n if (field === ChronoField.DAY_OF_WEEK) {\n return this.value();\n } else if (field instanceof ChronoField) {\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.getFrom(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns the day-of-week that is the specified number of days after this one.\n *\n * The calculation rolls around the end of the week from Sunday to Monday.\n * The specified period may be negative.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} days - the days to add, positive or negative\n * @return {DayOfWeek} the resulting day-of-week, not null\n */\n plus(days) {\n const amount = MathUtil.floorMod(days, 7);\n return ENUMS[MathUtil.floorMod(this._ordinal + (amount + 7), 7)];\n }\n\n /**\n * Returns the day-of-week that is the specified number of days before this one.\n *\n * The calculation rolls around the start of the year from Monday to Sunday.\n * The specified period may be negative.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} days - the days to subtract, positive or negative\n * @return {DayOfWeek} the resulting day-of-week, not null\n */\n minus(days) {\n return this.plus(-1 * MathUtil.floorMod(days, 7));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this day-of-week using the specified query.\n *\n * This queries this day-of-week using the specified query strategy object.\n * The {@link TemporalQuery} object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n *\n * The result of this method is obtained by invoking the\n * {@link TemporalQuery#queryFrom} method on the\n * specified query passing `this` as the argument.\n *\n * @param {TemporalQuery} query the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws DateTimeException if unable to query (defined by the query)\n * @throws ArithmeticException if numeric overflow occurs (defined by the query)\n */\n query(query) {\n if (query === TemporalQueries.precision()) {\n return ChronoUnit.DAYS;\n } else if (query === TemporalQueries.localDate() || query === TemporalQueries.localTime() || query === TemporalQueries.chronology() ||\n query === TemporalQueries.zone() || query === TemporalQueries.zoneId() || query === TemporalQueries.offset()) {\n return null;\n }\n assert(query != null, 'query', NullPointerException);\n return query.queryFrom(this);\n }\n\n /**\n * Adjusts the specified temporal object to have this day-of-week.\n *\n * This returns a temporal object of the same observable type as the input\n * with the day-of-week changed to be the same as this.\n *\n * The adjustment is equivalent to using {@link Temporal#with}\n * passing {@link ChronoField#DAY_OF_WEEK} as the field.\n * Note that this adjusts forwards or backwards within a Monday to Sunday week.\n * See {@link WeekFields#dayOfWeek} for localized week start days.\n * See {@link TemporalAdjusters} for other adjusters\n * with more control, such as `next(MONDAY)`.\n *\n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal#with}:\n *
\n     *   // these two lines are equivalent, but the second approach is recommended\n     *   temporal = thisDayOfWeek.adjustInto(temporal);\n     *   temporal = temporal.with(thisDayOfWeek);\n     * 
\n *\n * For example, given a date that is a Wednesday, the following are output:\n *
\n     *   dateOnWed.with(MONDAY);     // two days earlier\n     *   dateOnWed.with(TUESDAY);    // one day earlier\n     *   dateOnWed.with(WEDNESDAY);  // same date\n     *   dateOnWed.with(THURSDAY);   // one day later\n     *   dateOnWed.with(FRIDAY);     // two days later\n     *   dateOnWed.with(SATURDAY);   // three days later\n     *   dateOnWed.with(SUNDAY);     // four days later\n     * 
\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAdjusters} temporal the target object to be adjusted, not null\n * @return {Temporal} the adjusted object, not null\n * @throws DateTimeException if unable to make the adjustment\n * @throws ArithmeticException if numeric overflow occurs\n */\n adjustInto(temporal) {\n requireNonNull(temporal, 'temporal');\n return temporal.with(ChronoField.DAY_OF_WEEK, this.value());\n }\n\n /**\n *\n * @returns {boolean}\n */\n equals(other){ \n return this === other;\n }\n\n /**\n *\n * @returns {string}\n */\n toString(){\n return this._name;\n }\n\n /**\n * Compares this DayOfWeek to another DayOfWeek.\n *\n * The comparison is based on the value of the DayOfWeek.\n * It is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * @param {DayOfWeek} other the other year to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */ \n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, DayOfWeek, 'other');\n return this._ordinal - other._ordinal;\n }\n\n /**\n * toJSON() use by JSON.stringify\n * delegates to toString()\n *\n * @return {string}\n */\n toJSON() {\n return this.toString();\n }\n}\n\nlet ENUMS;\n\nexport function _init() {\n DayOfWeek.MONDAY = new DayOfWeek(0, 'MONDAY');\n DayOfWeek.TUESDAY = new DayOfWeek(1, 'TUESDAY');\n DayOfWeek.WEDNESDAY = new DayOfWeek(2, 'WEDNESDAY');\n DayOfWeek.THURSDAY = new DayOfWeek(3, 'THURSDAY');\n DayOfWeek.FRIDAY = new DayOfWeek(4, 'FRIDAY');\n DayOfWeek.SATURDAY = new DayOfWeek(5, 'SATURDAY');\n DayOfWeek.SUNDAY = new DayOfWeek(6, 'SUNDAY');\n\n DayOfWeek.FROM = createTemporalQuery('DayOfWeek.FROM', (temporal) => {\n return DayOfWeek.from(temporal);\n });\n\n ENUMS = [\n DayOfWeek.MONDAY,\n DayOfWeek.TUESDAY,\n DayOfWeek.WEDNESDAY,\n DayOfWeek.THURSDAY,\n DayOfWeek.FRIDAY,\n DayOfWeek.SATURDAY,\n DayOfWeek.SUNDAY\n ];\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {assert, requireNonNull, requireInstance} from './assert';\nimport {MathUtil} from './MathUtil';\n\nimport {ChronoField} from './temporal/ChronoField';\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {DateTimeException, IllegalArgumentException, UnsupportedTemporalTypeException} from './errors';\nimport {IsoChronology} from './chrono/IsoChronology';\nimport {TemporalAccessor} from './temporal/TemporalAccessor';\nimport {TemporalQueries} from './temporal/TemporalQueries';\n\n/**\n * A month-of-year, such as 'July'.\n *\n * {@link Month} is representing the 12 months of the year -\n * January, February, March, April, May, June, July, August, September, October,\n * November and December.\n *\n * In addition to the textual name, each month-of-year has an `int` value.\n * The `int` value follows normal usage and the ISO-8601 standard,\n * from 1 (January) to 12 (December). It is recommended that applications use the static values defined by this class\n * rather than the `int` value to ensure code clarity.\n *\n * This class represents a common concept that is found in many calendar systems.\n * As such, this class may be used by any calendar system that has the month-of-year\n * concept defined exactly equivalent to the ISO-8601 calendar system.\n *\n * ### Static properties of Class {@link Month}\n *\n * Month.JANUARY, Month.FEBRUARY, Month.MARCH, Month.APRIL, Month.MAY, Month.JUNE,\n * Month.JULY, Month.AUGUST, Month.SEPTEMBER, Month.OCTOBER, Month.NOVEMBER, Month.DECEMBER\n *\n */\nexport class Month extends TemporalAccessor {\n\n /**\n *\n * @param {number} ordinal\n * @param {string} name\n * @private\n */\n constructor(value, name){\n super();\n this._value = MathUtil.safeToInt(value);\n this._name = name;\n } \n\n /**\n *\n * @return {number} gets the value\n */\n value() {\n return this._value;\n }\n \n /**\n *\n * @returns {number}\n */\n ordinal(){\n return this._value - 1;\n }\n\n /**\n *\n * @returns {string}\n */\n name(){\n return this._name;\n } \n\n /**\n * Gets the textual representation, such as 'Jan' or 'December'.\n *\n * This returns the textual name used to identify the month-of-year.\n * The parameters control the length of the returned text and the locale.\n *\n * If no textual mapping is found then the numeric value (see {@link getValue}) is returned.\n *\n * @param {TextStyle} style - the length of the text required, not null\n * @param {Locale} locale - the locale to use, not null\n * @return {string} the text value of the day-of-week, not null\n */\n // eslint-disable-next-line no-unused-vars\n displayName(style, locale) {\n // TODO:\n throw new IllegalArgumentException('Pattern using (localized) text not implemented yet!');\n }\n\n /**\n * Checks if the specified field is supported.\n *\n * This checks if this month-of-year can be queried for the specified field.\n * If false, then calling the range (see {@link range}) and\n * get (see {@link get}) methods will throw an exception.\n *\n * If the field is MONTH_OF_YEAR (see {@link ChronoField#MONTH_OF_YEAR}) then\n * this method returns true.\n * All other {@link ChronoField} instances will return false.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.isSupportedBy}\n * passing `this` as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param {TemporalField} field - the field to check, null returns false\n * @return {boolean} true if the field is supported on this month-of-year, false if not\n */\n isSupported(field) {\n if (null === field) {\n return false;\n }\n if (field instanceof ChronoField) {\n return field === ChronoField.MONTH_OF_YEAR;\n }\n return field != null && field.isSupportedBy(this);\n }\n\n /**\n * Gets the value of the specified field from this month-of-year as an `int`.\n *\n * This queries this month for the value of the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is MONTH_OF_YEAR (see {@link ChronoField#MONTH_OF_YEAR}) then the\n * value of the month-of-year, from 1 to 12, will be returned.\n * All other {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {Number} the value for the field, within the valid range of values\n * @throws DateTimeException if a value for the field cannot be obtained or\n * the value is outside the range of valid values for the field\n * @throws UnsupportedTemporalTypeException if the field is not supported or\n * the range of values exceeds an `int`\n * @throws ArithmeticException if numeric overflow occurs\n */\n get(field) {\n if (field === ChronoField.MONTH_OF_YEAR) {\n return this.value();\n }\n return this.range(field).checkValidIntValue(this.getLong(field), field);\n }\n\n /**\n * Gets the value of the specified field from this month-of-year as a `long`.\n *\n * This queries this month for the value of the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is MONTH_OF_YEAR (see {@link ChronoField#MONTH_OF_YEAR}) then the\n * value of the month-of-year, from 1 to 12, will be returned.\n * All other {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {Number} the value for the field\n * @throws DateTimeException if a value for the field cannot be obtained\n * @throws UnsupportedTemporalTypeException if the field is not supported\n * @throws ArithmeticException if numeric overflow occurs\n */\n getLong(field) {\n if (field === ChronoField.MONTH_OF_YEAR) {\n return this.value();\n } else if (field instanceof ChronoField) {\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.getFrom(this);\n }\n\n /**\n * Returns the month-of-year that is the specified number of months after this one.\n *\n * The calculation rolls around the end of the year from December to January.\n * The specified period may be negative.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} months - the months to add, positive or negative\n * @return {Month} the resulting month, not null\n */\n plus(months) {\n const amount = MathUtil.intMod(months, 12) + 12; // + 12 to make sure negative arguments are positive, the total is \"corrected\" by the next % 12\n let newMonthVal = MathUtil.intMod((this.value() + amount), 12);\n /* December is 12, not 0, but 12 % 12 = 0 */\n newMonthVal = newMonthVal === 0 ? 12 : newMonthVal;\n return Month.of(newMonthVal);\n }\n\n /**\n * Returns the month-of-year that is the specified number of months before this one.\n *\n * The calculation rolls around the start of the year from January to December.\n * The specified period may be negative.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} months - the months to subtract, positive or negative\n * @return {Month} the resulting month, not null\n */\n minus(months) {\n return this.plus(-1 * MathUtil.intMod(months, 12));\n }\n\n /**\n * Gets the length of this month in days.\n *\n * This takes a flag to determine whether to return the length for a leap year or not.\n *\n * February has 28 days in a standard year and 29 days in a leap year.\n * April, June, September and November have 30 days.\n * All other months have 31 days.\n *\n * @param {boolean} leapYear - true if the length is required for a leap year\n * @return {number} the length of this month in days, from 28 to 31\n */\n length(leapYear) {\n switch (this) {\n case Month.FEBRUARY:\n return (leapYear ? 29 : 28);\n case Month.APRIL:\n case Month.JUNE:\n case Month.SEPTEMBER:\n case Month.NOVEMBER:\n return 30;\n default:\n return 31;\n }\n }\n\n /**\n * Gets the minimum length of this month in days.\n *\n * February has a minimum length of 28 days.\n * April, June, September and November have 30 days.\n * All other months have 31 days.\n *\n * @return {number} the minimum length of this month in days, from 28 to 31\n */\n minLength() {\n switch (this) {\n case Month.FEBRUARY:\n return 28;\n case Month.APRIL:\n case Month.JUNE:\n case Month.SEPTEMBER:\n case Month.NOVEMBER:\n return 30;\n default:\n return 31;\n }\n }\n\n /**\n * Gets the maximum length of this month in days.\n *\n * February has a maximum length of 29 days.\n * April, June, September and November have 30 days.\n * All other months have 31 days.\n *\n * @return {number} the maximum length of this month in days, from 29 to 31\n */\n maxLength() {\n switch (this) {\n case Month.FEBRUARY:\n return 29;\n case Month.APRIL:\n case Month.JUNE:\n case Month.SEPTEMBER:\n case Month.NOVEMBER:\n return 30;\n default:\n return 31;\n }\n }\n\n /**\n * Gets the day-of-year corresponding to the first day of this month.\n *\n * This returns the day-of-year that this month begins on, using the leap\n * year flag to determine the length of February.\n *\n * @param {boolean} leapYear - true if the length is required for a leap year\n * @return {number} the day of year corresponding to the first day of this month, from 1 to 336\n */\n firstDayOfYear(leapYear) {\n const leap = leapYear ? 1 : 0;\n switch (this) {\n case Month.JANUARY:\n return 1;\n case Month.FEBRUARY:\n return 32;\n case Month.MARCH:\n return 60 + leap;\n case Month.APRIL:\n return 91 + leap;\n case Month.MAY:\n return 121 + leap;\n case Month.JUNE:\n return 152 + leap;\n case Month.JULY:\n return 182 + leap;\n case Month.AUGUST:\n return 213 + leap;\n case Month.SEPTEMBER:\n return 244 + leap;\n case Month.OCTOBER:\n return 274 + leap;\n case Month.NOVEMBER:\n return 305 + leap;\n case Month.DECEMBER:\n default:\n return 335 + leap;\n }\n }\n\n /**\n * Gets the month corresponding to the first month of this quarter.\n *\n * The year can be divided into four quarters.\n * This method returns the first month of the quarter for the base month.\n * January, February and March return January.\n * April, May and June return April.\n * July, August and September return July.\n * October, November and December return October.\n *\n * @return {Month} the first month of the quarter corresponding to this month, not null\n */\n firstMonthOfQuarter() {\n switch (this) {\n case Month.JANUARY:\n case Month.FEBRUARY:\n case Month.MARCH:\n return Month.JANUARY;\n case Month.APRIL:\n case Month.MAY:\n case Month.JUNE:\n return Month.APRIL;\n case Month.JULY:\n case Month.AUGUST:\n case Month.SEPTEMBER:\n return Month.JULY;\n case Month.OCTOBER:\n case Month.NOVEMBER:\n case Month.DECEMBER:\n default:\n return Month.OCTOBER;\n }\n }\n\n /**\n * Queries this month-of-year using the specified query.\n *\n * This queries this month-of-year using the specified query strategy object.\n * The {@link TemporalQuery} object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n *\n * The result of this method is obtained by invoking the\n * {@link TemporalQuery#queryFrom} method on the\n * specified query passing `this` as the argument.\n *\n * @param {TemporalQuery} query - the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws DateTimeException if unable to query (defined by the query)\n * @throws ArithmeticException if numeric overflow occurs (defined by the query)\n */\n query(query) {\n assert(query != null, 'query() parameter must not be null', DateTimeException);\n if (query === TemporalQueries.chronology()) {\n return IsoChronology.INSTANCE;\n } else if (query === TemporalQueries.precision()) {\n return ChronoUnit.MONTHS;\n }\n return super.query(query);\n }\n\n\n\n /**\n * toString implementation... in JDK this is inherited from the Enum class\n *\n * @return {String}\n */\n toString() {\n switch (this) {\n case Month.JANUARY:\n return 'JANUARY';\n case Month.FEBRUARY:\n return 'FEBRUARY';\n case Month.MARCH:\n return 'MARCH';\n case Month.APRIL:\n return 'APRIL';\n case Month.MAY:\n return 'MAY';\n case Month.JUNE:\n return 'JUNE';\n case Month.JULY:\n return 'JULY';\n case Month.AUGUST:\n return 'AUGUST';\n case Month.SEPTEMBER:\n return 'SEPTEMBER';\n case Month.OCTOBER:\n return 'OCTOBER';\n case Month.NOVEMBER:\n return 'NOVEMBER';\n case Month.DECEMBER:\n return 'DECEMBER';\n default:\n return 'unknown Month, value: ' + this.value();\n }\n }\n\n /**\n * toJSON() use by JSON.stringify\n * delegates to toString()\n *\n * @return {string}\n */\n toJSON() {\n return this.toString();\n }\n\n /**\n * Adjusts the specified temporal object to have this month-of-year.\n *\n * This returns a temporal object of the same observable type as the input\n * with the month-of-year changed to be the same as this.\n *\n * The adjustment is equivalent to using {@link Temporal#with}\n * passing {@link ChronoField#MONTH_OF_YEAR} as the field.\n * If the specified temporal object does not use the ISO calendar system then\n * a {@link DateTimeException} is thrown.\n *\n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal#with}:\n *
\n     *   // these two lines are equivalent, but the second approach is recommended\n     *   temporal = thisMonth.adjustInto(temporal);\n     *   temporal = temporal.with(thisMonth);\n     * 
\n *\n * For example, given a date in May, the following are output:\n *
\n     *   dateInMay.with(JANUARY);    // four months earlier\n     *   dateInMay.with(APRIL);      // one months earlier\n     *   dateInMay.with(MAY);        // same date\n     *   dateInMay.with(JUNE);       // one month later\n     *   dateInMay.with(DECEMBER);   // seven months later\n     * 
\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal - the target object to be adjusted, not null\n * @return {Temporal} the adjusted object, not null\n * @throws DateTimeException if unable to make the adjustment\n * @throws ArithmeticException if numeric overflow occurs\n */\n adjustInto(temporal) {\n /* we support only ISO for now\n if (Chronology.from(temporal).equals(IsoChronology.INSTANCE) === false) {\n throw new DateTimeException('Adjustment only supported on ISO date-time');\n }\n */\n return temporal.with(ChronoField.MONTH_OF_YEAR, this.value());\n }\n \n /**\n * Compares this Month to another Month.\n *\n * The comparison is based on the value of the Month.\n * It is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * @param {Month} other the other year to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */ \n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Month, 'other');\n return this._value - other._value;\n } \n \n /**\n *\n * @returns {boolean}\n */\n equals(other){ \n return this === other;\n }\n\n /**\n *\n * @param {string} name\n * @returns {Month}\n */\n static valueOf(name) {\n let ordinal = 0;\n for(ordinal; ordinal < MONTHS.length; ordinal++){\n if(MONTHS[ordinal].name() === name){\n break;\n }\n }\n return Month.of(ordinal+1);\n }\n \n\n /**\n * replacement for enum values\n * @return {Month[]}\n */\n static values(){\n return MONTHS.slice();\n }\n\n /**\n *\n * @param {number} month\n * @return {Month} not null\n **/\n static of(month) {\n if (month < 1 || month > 12) {\n assert(false, 'Invalid value for MonthOfYear: ' + month, DateTimeException);\n }\n return MONTHS[month-1];\n }\n\n /**\n * Obtains an instance of {@link Month} from a temporal object.\n *\n * This obtains a month based on the specified temporal.\n * A {@link TemporalAccessor} represents an arbitrary set of date and time information,\n * which this factory converts to an instance of {@link Month}.\n *\n * The conversion extracts the MONTH_OF_YEAR (see {@link ChronoField#MONTH_OF_YEAR}) field.\n * The extraction is only permitted if the temporal object has an ISO\n * chronology, or can be converted to a {@link LocalDate}.\n *\n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used in queries via method reference, {@link Month::from}.\n *\n * @param {TemporalAccessor} temporal the temporal object to convert, not null\n * @return {Month} the month-of-year, not null\n * @throws DateTimeException if unable to convert to a {@link Month}\n */\n static from(temporal) {\n if (temporal instanceof Month) {\n return temporal;\n }\n try {\n /* only ISO for now\n if (IsoChronology.INSTANCE.equals(Chronology.from(temporal)) == false) {\n temporal = LocalDate.from(temporal);\n }*/\n return Month.of(temporal.get(ChronoField.MONTH_OF_YEAR));\n } catch (ex) {\n throw new DateTimeException('Unable to obtain Month from TemporalAccessor: ' +\n temporal + ' of type ' + (temporal && temporal.constructor != null ? temporal.constructor.name : ''), ex);\n }\n }\n}\n\nlet MONTHS;\n\nexport function _init() {\n Month.JANUARY = new Month(1, 'JANUARY');\n Month.FEBRUARY = new Month(2, 'FEBRUARY');\n Month.MARCH = new Month(3, 'MARCH');\n Month.APRIL = new Month(4, 'APRIL');\n Month.MAY = new Month(5, 'MAY');\n Month.JUNE = new Month(6, 'JUNE');\n Month.JULY = new Month(7, 'JULY');\n Month.AUGUST = new Month(8, 'AUGUST');\n Month.SEPTEMBER = new Month(9, 'SEPTEMBER');\n Month.OCTOBER = new Month(10, 'OCTOBER');\n Month.NOVEMBER = new Month(11, 'NOVEMBER');\n Month.DECEMBER = new Month(12, 'DECEMBER');\n\n MONTHS = [\n Month.JANUARY, Month.FEBRUARY, Month.MARCH, Month.APRIL, Month.MAY, Month.JUNE,\n Month.JULY, Month.AUGUST, Month.SEPTEMBER, Month.OCTOBER, Month.NOVEMBER, Month.DECEMBER\n ];\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {MathUtil} from './MathUtil';\nimport {requireNonNull, requireInstance} from './assert';\nimport {DateTimeException, UnsupportedTemporalTypeException, ArithmeticException, DateTimeParseException} from './errors';\n\nimport {IsoChronology} from './chrono/IsoChronology';\n\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {TemporalAmount} from './temporal/TemporalAmount';\n\nimport {LocalDate} from './LocalDate';\n\n/**\n * The pattern for parsing.\n */\nconst PATTERN = /([-+]?)P(?:([-+]?[0-9]+)Y)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)W)?(?:([-+]?[0-9]+)D)?/;\n\n/**\n * A date-based amount of time, such as '2 years, 3 months and 4 days'.\n *\n * This class models a quantity or amount of time in terms of years, months and days.\n * See {@link Duration} for the time-based equivalent to this class.\n *\n * Durations and period differ in their treatment of daylight savings time\n * when added to {@link ZonedDateTime}. A {@link Duration} will add an exact\n * number of seconds, thus a duration of one day is always exactly 24 hours.\n * By contrast, a {@link Period} will add a conceptual day, trying to maintain\n * the local time.\n *\n * For example, consider adding a period of one day and a duration of one day to\n * 18:00 on the evening before a daylight savings gap. The {@link Period} will add\n * the conceptual day and result in a {@link ZonedDateTime} at 18:00 the following day.\n * By contrast, the {@link Duration} will add exactly 24 hours, resulting in a\n * {@link ZonedDateTime} at 19:00 the following day (assuming a one hour DST gap).\n *\n * The supported units of a period are {@link ChronoUnit#YEARS},\n * {@link ChronoUnit#MONTHS} and {@link ChronoUnit#DAYS}.\n * All three fields are always present, but may be set to zero.\n *\n * The period may be used with any calendar system.\n * The meaning of a 'year' or 'month' is only applied when the object is added to a date.\n *\n * The period is modeled as a directed amount of time, meaning that individual parts of the\n * period may be negative.\n *\n * The months and years fields may be normalized (see {@link normalized}).\n * The normalization assumes a 12 month year, so is not appropriate for all calendar systems.\n *\n * ### Static properties of Class {@link Period}\n *\n * Period.ZERO\n *\n * A constant for a period of zero.\n *\n */\nexport class Period extends TemporalAmount /* extends ChronoPeriod */ {\n\n /**\n * do not call the constructor directly\n * use a factory method instead\n *\n * @param {number} years\n * @param {number} months\n * @param {number} days\n * @private\n */\n constructor(years, months, days){\n super();\n \n const _years = MathUtil.safeToInt(years);\n const _months = MathUtil.safeToInt(months);\n const _days = MathUtil.safeToInt(days);\n\n if( _years === 0 && _months === 0 && _days === 0 ){\n if (!Period.ZERO) {\n this._years = _years;\n this._months = _months;\n this._days = _days;\n Period.ZERO = this;\n }\n return Period.ZERO;\n }\n \n /**\n * The number of years.\n */\n this._years = _years;\n /**\n * The number of months.\n */\n this._months = _months;\n /**\n * The number of days.\n */\n this._days = _days;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains a {@link Period} representing a number of years.\n *\n * The resulting period will have the specified years.\n * The months and days units will be zero.\n *\n * @param {number} years - the number of years, positive or negative\n * @return {Period} the period of years, not null\n */\n static ofYears(years) {\n return Period.create(years, 0, 0);\n }\n\n /**\n * Obtains a {@link Period} representing a number of months.\n *\n * The resulting period will have the specified months.\n * The years and days units will be zero.\n *\n * @param {number} months - the number of months, positive or negative\n * @return {Period} the period of months, not null\n */\n static ofMonths(months) {\n return Period.create(0, months, 0);\n }\n\n /**\n * Obtains a {@link Period} representing a number of weeks.\n *\n * The resulting period will have days equal to the weeks multiplied by seven.\n * The years and months units will be zero.\n *\n * @param {number} weeks - the number of weeks, positive or negative\n * @return {Period} the period of days, not null\n */\n static ofWeeks(weeks) {\n return Period.create(0, 0, MathUtil.safeMultiply(weeks, 7));\n }\n\n /**\n * Obtains a {@link Period} representing a number of days.\n *\n * The resulting period will have the specified days.\n * The years and months units will be zero.\n *\n * @param {number} days - the number of days, positive or negative\n * @return {Period} the period of days, not null\n */\n static ofDays(days) {\n return Period.create(0, 0, days);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains a {@link Period} representing a number of years, months and days.\n *\n * This creates an instance based on years, months and days.\n *\n * @param {!number} years - the amount of years, may be negative\n * @param {!number} months - the amount of months, may be negative\n * @param {!number} days - the amount of days, may be negative\n * @return {Period} the period of years, months and days, not null\n */\n static of(years, months, days) {\n return Period.create(years, months, days);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link Period} from a temporal amount.\n *\n * This obtains a period based on the specified amount.\n * A {@link TemporalAmount} represents an - amount of time, which may be\n * date-based or time-based, which this factory extracts to a {@link Period}.\n *\n * The conversion loops around the set of units from the amount and uses\n * the {@link ChronoUnit#YEARS}, {@link ChronoUnit#MONTHS}\n * and {@link ChronoUnit#DAYS} units to create a period.\n * If any other units are found then an exception is thrown.\n *\n * If the amount is a {@link ChronoPeriod} then it must use the ISO chronology.\n *\n * @param {TemporalAmount} amount - the temporal amount to convert, not null\n * @return {Period} the equivalent period, not null\n * @throws DateTimeException if unable to convert to a {@link Period}\n * @throws ArithmeticException if the amount of years, months or days exceeds an int\n */\n static from(amount) {\n if (amount instanceof Period) {\n return amount;\n }\n /*\n if (amount instanceof ChronoPeriod) {\n if (IsoChronology.INSTANCE !== amount.chronology()) {\n throw new DateTimeException('Period requires ISO chronology: ' + amount);\n }\n }\n*/\n requireNonNull(amount, 'amount');\n let years = 0;\n let months = 0;\n let days = 0;\n const units = amount.units();\n for (let i=0; i\n * 'P2Y' -- Period.ofYears(2)\n * 'P3M' -- Period.ofMonths(3)\n * 'P4W' -- Period.ofWeeks(4)\n * 'P5D' -- Period.ofDays(5)\n * 'P1Y2M3D' -- Period.of(1, 2, 3)\n * 'P1Y2M3W4D' -- Period.of(1, 2, 25)\n * 'P-1Y2M' -- Period.of(-1, 2, 0)\n * '-P1Y2M' -- Period.of(-1, -2, 0)\n * \n *\n * @param {string} text - the text to parse, not null\n * @return {Period} the parsed period, not null\n * @throws DateTimeParseException if the text cannot be parsed to a period\n */\n static parse(text) {\n requireNonNull(text, 'text');\n try {\n return Period._parse(text);\n } catch (ex){\n if(ex instanceof ArithmeticException){\n throw new DateTimeParseException('Text cannot be parsed to a Period', text, 0, ex);\n } else {\n throw ex;\n }\n }\n }\n\n /**\n * because functions that containing a try/ catch block cant be optimized,\n * we put the code in a sub function.\n */\n static _parse(text){\n const matches = PATTERN.exec(text);\n if (matches != null) {\n const negate = '-' === matches[1] ? -1 : 1;\n const yearMatch = matches[2];\n const monthMatch = matches[3];\n const weekMatch = matches[4];\n const dayMatch = matches[5];\n if (yearMatch != null || monthMatch != null || weekMatch != null || dayMatch != null) {\n const years = Period._parseNumber(text, yearMatch, negate);\n const months = Period._parseNumber(text, monthMatch, negate);\n const weeks = Period._parseNumber(text, weekMatch, negate);\n let days = Period._parseNumber(text, dayMatch, negate);\n days = MathUtil.safeAdd(days, MathUtil.safeMultiply(weeks, 7));\n return Period.create(years, months, days);\n }\n }\n throw new DateTimeParseException('Text cannot be parsed to a Period', text, 0);\n }\n\n static _parseNumber(text, str, negate) {\n if (str == null) {\n return 0;\n }\n const val = MathUtil.parseInt(str);\n return MathUtil.safeMultiply(val, negate);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Creates an instance.\n *\n * @param {number} years - the amount\n * @param {number} months - the amount\n * @param {number} days - the amount\n * @return {Duration}\n */\n static create(years, months, days) {\n return new Period(years, months, days);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the list of units, from largest to smallest, that fully define this amount.\n *\n * @returns {ChronoUnit[]} list of units\n */\n units() {\n return [ChronoUnit.YEARS, ChronoUnit.MONTHS, ChronoUnit.DAYS];\n }\n\n /**\n * Gets the chronology that defines the meaning of the supported units.\n *\n * The period is defined by the chronology.\n * It controls the supported units and restricts addition/subtraction\n * to {@link ChronoLocalDate} instances of the same chronology.\n *\n * @return {IsoChronology} the chronology defining the period, not null\n */\n chronology() {\n return IsoChronology.INSTANCE;\n }\n\n /**\n * Gets the value of the requested unit.\n *\n * The supported units are chronology specific.\n * They will typically be {@link ChronoUnit#YEARS},\n * {@link ChronoUnit#MONTHS} and {@link ChronoUnit#DAYS}.\n * Requesting an unsupported unit will throw an exception.\n *\n * @param {TemporalUnit} unit the {@link TemporalUnit} for which to return the value\n * @return {number} the long value of the unit\n * @throws DateTimeException if the unit is not supported\n * @throws UnsupportedTemporalTypeException if the unit is not supported\n */\n get(unit) {\n if (unit === ChronoUnit.YEARS) {\n return this._years;\n }\n if (unit === ChronoUnit.MONTHS) {\n return this._months;\n }\n if (unit === ChronoUnit.DAYS) {\n return this._days;\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if all three units of this period are zero.\n *\n * A zero period has the value zero for the years, months and days units.\n *\n * @return {boolean} true if this period is zero-length\n */\n isZero() {\n return (this === Period.ZERO);\n }\n\n /**\n * Checks if any of the three units of this period are negative.\n *\n * This checks whether the years, months or days units are less than zero.\n *\n * @return {boolean} true if any unit of this period is negative\n */\n isNegative() {\n return this._years < 0 || this._months < 0 || this._days < 0;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the amount of years of this period.\n *\n * This returns the years unit.\n *\n * The months unit is not normalized with the years unit.\n * This means that a period of '15 months' is different to a period\n * of '1 year and 3 months'.\n *\n * @return {number} the amount of years of this period, may be negative\n */\n years() {\n return this._years;\n }\n\n /**\n * Gets the amount of months of this period.\n *\n * This returns the months unit.\n *\n * The months unit is not normalized with the years unit.\n * This means that a period of '15 months' is different to a period\n * of '1 year and 3 months'.\n *\n * @return {number} the amount of months of this period, may be negative\n */\n months() {\n return this._months;\n }\n\n /**\n * Gets the amount of days of this period.\n *\n * This returns the days unit.\n *\n * @return {number} the amount of days of this period, may be negative\n */\n days() {\n return this._days;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this period with the specified amount of years.\n *\n * This sets the amount of the years unit in a copy of this period.\n * The months and days units are unaffected.\n *\n * The months unit is not normalized with the years unit.\n * This means that a period of '15 months' is different to a period\n * of '1 year and 3 months'.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} years - the years to represent, may be negative\n * @return {Period} a {@link Period} based on this period with the requested years, not null\n */\n withYears(years) {\n if (years === this._years) {\n return this;\n }\n return Period.create(years, this._months, this._days);\n }\n\n /**\n * Returns a copy of this period with the specified amount of months.\n *\n * This sets the amount of the months unit in a copy of this period.\n * The years and days units are unaffected.\n *\n * The months unit is not normalized with the years unit.\n * This means that a period of '15 months' is different to a period\n * of '1 year and 3 months'.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} months - the months to represent, may be negative\n * @return {Period} a {@link Period} based on this period with the requested months, not null\n */\n withMonths(months) {\n if (months === this._months) {\n return this;\n }\n return Period.create(this._years, months, this._days);\n }\n\n /**\n * Returns a copy of this period with the specified amount of days.\n *\n * This sets the amount of the days unit in a copy of this period.\n * The years and months units are unaffected.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} days - the days to represent, may be negative\n * @return {Period} a {@link Period} based on this period with the requested days, not null\n */\n withDays(days) {\n if (days === this._days) {\n return this;\n }\n return Period.create(this._years, this._months, days);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this period with the specified amount added.\n *\n * This input amount is converted to a {@link Period} using {@link from}.\n * This operates separately on the years, months and days.\n *\n * For example, '1 year, 6 months and 3 days' plus '2 years, 2 months and 2 days'\n * returns '3 years, 8 months and 5 days'.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAmount} amountToAdd - the period to add, not null\n * @return {Period} a {@link Period} based on this period with the requested period added, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n plus(amountToAdd) {\n const amount = Period.from(amountToAdd);\n return Period.create(\n MathUtil.safeAdd(this._years, amount._years),\n MathUtil.safeAdd(this._months, amount._months),\n MathUtil.safeAdd(this._days, amount._days));\n }\n\n /**\n * Returns a copy of this period with the specified years added.\n *\n * This adds the amount to the years unit in a copy of this period.\n * The months and days units are unaffected.\n * For example, '1 year, 6 months and 3 days' plus 2 years returns '3 years, 6 months and 3 days'.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} yearsToAdd - the years to add, positive or negative\n * @return {Period} a {@link Period} based on this period with the specified years added, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusYears(yearsToAdd) {\n if (yearsToAdd === 0) {\n return this;\n }\n return Period.create(MathUtil.safeToInt(MathUtil.safeAdd(this._years, yearsToAdd)), this._months, this._days);\n }\n\n /**\n * Returns a copy of this period with the specified months added.\n *\n * This adds the amount to the months unit in a copy of this period.\n * The years and days units are unaffected.\n * For example, '1 year, 6 months and 3 days' plus 2 months returns '1 year, 8 months and 3 days'.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} monthsToAdd - the months to add, positive or negative\n * @return {Period} a {@link Period} based on this period with the specified months added, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusMonths(monthsToAdd) {\n if (monthsToAdd === 0) {\n return this;\n }\n return Period.create(this._years, MathUtil.safeToInt(MathUtil.safeAdd(this._months, monthsToAdd)), this._days);\n }\n\n /**\n * Returns a copy of this period with the specified days added.\n *\n * This adds the amount to the days unit in a copy of this period.\n * The years and months units are unaffected.\n * For example, '1 year, 6 months and 3 days' plus 2 days returns '1 year, 6 months and 5 days'.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} daysToAdd - the days to add, positive or negative\n * @return {Period} a {@link Period} based on this period with the specified days added, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusDays(daysToAdd) {\n if (daysToAdd === 0) {\n return this;\n }\n return Period.create(this._years, this._months, MathUtil.safeToInt(MathUtil.safeAdd(this._days, daysToAdd)));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this period with the specified amount subtracted.\n *\n * This input amount is converted to a {@link Period} using {@link from}.\n * This operates separately on the years, months and days.\n *\n * For example, '1 year, 6 months and 3 days' minus '2 years, 2 months and 2 days'\n * returns '-1 years, 4 months and 1 day'.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAmount} amountToSubtract - the period to subtract, not null\n * @return {Period} a {@link Period} based on this period with the requested period subtracted, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n minus(amountToSubtract) {\n const amount = Period.from(amountToSubtract);\n return Period.create(\n MathUtil.safeSubtract(this._years, amount._years),\n MathUtil.safeSubtract(this._months, amount._months),\n MathUtil.safeSubtract(this._days, amount._days));\n }\n\n /**\n * Returns a copy of this period with the specified years subtracted.\n *\n * This subtracts the amount from the years unit in a copy of this period.\n * The months and days units are unaffected.\n * For example, '1 year, 6 months and 3 days' minus 2 years returns '-1 years, 6 months and 3 days'.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} yearsToSubtract - the years to subtract, positive or negative\n * @return {Period} a {@link Period} based on this period with the specified years subtracted, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusYears(yearsToSubtract) {\n return this.plusYears(-1 * yearsToSubtract);\n }\n\n /**\n * Returns a copy of this period with the specified months subtracted.\n *\n * This subtracts the amount from the months unit in a copy of this period.\n * The years and days units are unaffected.\n * For example, '1 year, 6 months and 3 days' minus 2 months returns '1 year, 4 months and 3 days'.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} monthsToSubtract - the years to subtract, positive or negative\n * @return {Period} a {@link Period} based on this period with the specified months subtracted, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusMonths(monthsToSubtract) {\n return this.plusMonths(-1 * monthsToSubtract);\n }\n\n /**\n * Returns a copy of this period with the specified days subtracted.\n *\n * This subtracts the amount from the days unit in a copy of this period.\n * The years and months units are unaffected.\n * For example, '1 year, 6 months and 3 days' minus 2 days returns '1 year, 6 months and 1 day'.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} daysToSubtract - the months to subtract, positive or negative\n * @return {Period} a {@link Period} based on this period with the specified days subtracted, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusDays(daysToSubtract) {\n return this.plusDays(-1 * daysToSubtract);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a new instance with each element in this period multiplied\n * by the specified scalar.\n *\n * This simply multiplies each field, years, months, days and normalized time,\n * by the scalar. No normalization is performed.\n *\n * @param {number} scalar - the scalar to multiply by, not null\n * @return {Period} a {@link Period} based on this period with the amounts multiplied by the scalar, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n multipliedBy(scalar) {\n if (this === Period.ZERO || scalar === 1) {\n return this;\n }\n return Period.create(\n MathUtil.safeMultiply(this._years, scalar),\n MathUtil.safeMultiply(this._months, scalar),\n MathUtil.safeMultiply(this._days, scalar));\n }\n\n /**\n * Returns a new instance with each amount in this period negated.\n *\n * @return {Period} a {@link Period} based on this period with the amounts negated, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n negated() {\n return this.multipliedBy(-1);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this period with the years and months normalized\n * using a 12 month year.\n *\n * This normalizes the years and months units, leaving the days unit unchanged.\n * The months unit is adjusted to have an absolute value less than 11,\n * with the years unit being adjusted to compensate. For example, a period of\n * '1 Year and 15 months' will be normalized to '2 years and 3 months'.\n *\n * The sign of the years and months units will be the same after normalization.\n * For example, a period of '1 year and -25 months' will be normalized to\n * '-1 year and -1 month'.\n *\n * This normalization uses a 12 month year which is not valid for all calendar systems.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @return {Period} a {@link Period} based on this period with excess months normalized to years, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n normalized() {\n const totalMonths = this.toTotalMonths();\n const splitYears = MathUtil.intDiv(totalMonths, 12);\n const splitMonths = MathUtil.intMod(totalMonths, 12); // no overflow\n if (splitYears === this._years && splitMonths === this._months) {\n return this;\n }\n return Period.create(MathUtil.safeToInt(splitYears), splitMonths, this._days);\n }\n\n /**\n * Gets the total number of months in this period using a 12 month year.\n *\n * This returns the total number of months in the period by multiplying the\n * number of years by 12 and adding the number of months.\n *\n * This uses a 12 month year which is not valid for all calendar systems.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @return {number} the total number of months in the period, may be negative\n */\n toTotalMonths() {\n return this._years * 12 + this._months; // no overflow\n }\n\n //-------------------------------------------------------------------------\n /**\n * Adds this period to the specified temporal object.\n *\n * This returns a temporal object of the same observable type as the input\n * with this period added.\n *\n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal#plus}.\n *
\n     *   // these two lines are equivalent, but the second approach is recommended\n     *   dateTime = thisPeriod.addTo(dateTime);\n     *   dateTime = dateTime.plus(thisPeriod);\n     * 
\n *\n * The calculation will add the years, then months, then days.\n * Only non-zero amounts will be added.\n * If the date-time has a calendar system with a fixed number of months in a\n * year, then the years and months will be combined before being added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal - the temporal object to adjust, not null\n * @return {Temporal} an object of the same type with the adjustment made, not null\n * @throws DateTimeException if unable to add\n * @throws ArithmeticException if numeric overflow occurs\n */\n addTo(temporal) {\n requireNonNull(temporal, 'temporal');\n if (this._years !== 0) {\n if (this._months !== 0) {\n temporal = temporal.plus(this.toTotalMonths(), ChronoUnit.MONTHS);\n } else {\n temporal = temporal.plus(this._years, ChronoUnit.YEARS);\n }\n } else if (this._months !== 0) {\n temporal = temporal.plus(this._months, ChronoUnit.MONTHS);\n }\n if (this._days !== 0) {\n temporal = temporal.plus(this._days, ChronoUnit.DAYS);\n }\n return temporal;\n }\n\n /**\n * Subtracts this period from the specified temporal object.\n *\n * This returns a temporal object of the same observable type as the input\n * with this period subtracted.\n *\n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal#minus}.\n *
\n     *   // these two lines are equivalent, but the second approach is recommended\n     *   dateTime = thisPeriod.subtractFrom(dateTime);\n     *   dateTime = dateTime.minus(thisPeriod);\n     * 
\n *\n * The calculation operates as follows.\n * First, the chronology of the temporal is checked to ensure it is ISO chronology or null.\n * Second, if the months are zero, the years are added if non-zero, otherwise\n * the combination of years and months is added if non-zero.\n * Finally, any days are added.\n *\n * The calculation will subtract the years, then months, then days.\n * Only non-zero amounts will be subtracted.\n * If the date-time has a calendar system with a fixed number of months in a\n * year, then the years and months will be combined before being subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal - the temporal object to adjust, not null\n * @return {Temporal} an object of the same type with the adjustment made, not null\n * @throws DateTimeException if unable to subtract\n * @throws ArithmeticException if numeric overflow occurs\n */\n subtractFrom(temporal) {\n requireNonNull(temporal, 'temporal');\n if (this._years !== 0) {\n if (this._months !== 0) {\n temporal = temporal.minus(this.toTotalMonths(), ChronoUnit.MONTHS);\n } else {\n temporal = temporal.minus(this._years, ChronoUnit.YEARS);\n }\n } else if (this._months !== 0) {\n temporal = temporal.minus(this._months, ChronoUnit.MONTHS);\n }\n if (this._days !== 0) {\n temporal = temporal.minus(this._days, ChronoUnit.DAYS);\n }\n return temporal;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this period is equal to another period.\n *\n * The comparison is based on the amounts held in the period.\n * To be equal, the years, months and days units must be individually equal.\n * Note that this means that a period of '15 Months' is not equal to a period\n * of '1 Year and 3 Months'.\n *\n * @param {*} obj - the object to check, null returns false\n * @return {boolean} true if this is equal to the other period\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof Period) {\n const other = obj;\n return this._years === other._years &&\n this._months === other._months &&\n this._days === other._days;\n }\n return false;\n }\n\n /**\n * A hash code for this period.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return MathUtil.hashCode(this._years, this._months, this._days);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this period as a string, such as {@link P6Y3M1D}.\n *\n * The output will be in the ISO-8601 period format.\n * A zero period will be represented as zero days, 'P0D'.\n *\n * @return {string} a string representation of this period, not null\n */\n toString() {\n if (this === Period.ZERO) {\n return 'P0D';\n } else {\n let buf = 'P';\n if (this._years !== 0) {\n buf += '' + this._years + 'Y';\n }\n if (this._months !== 0) {\n buf += '' + this._months + 'M';\n }\n if (this._days !== 0) {\n buf += '' + this._days + 'D';\n }\n return buf;\n }\n }\n\n /**\n *\n * @return {string} same as {@link Period.toString}\n */\n toJSON() {\n return this.toString();\n }\n}\n\nexport function _init() {\n /**\n * A constant for a period of zero.\n */\n Period.ofDays(0);\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\n/**\n * @private\n */\nexport class ParsePosition {\n constructor(index) {\n this._index = index;\n this._errorIndex = -1;\n }\n\n getIndex(){\n return this._index;\n }\n\n setIndex(index){\n this._index = index;\n }\n\n getErrorIndex(){\n return this._errorIndex;\n }\n\n setErrorIndex(errorIndex){\n this._errorIndex = errorIndex;\n }\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\n/**\n * @private\n */\nexport class EnumMap {\n constructor(){\n this._map = {};\n }\n\n putAll(otherMap){\n for(const key in otherMap._map){\n this._map[key] = otherMap._map[key];\n }\n return this;\n }\n\n containsKey(key){\n // eslint-disable-next-line no-prototype-builtins\n return (this._map.hasOwnProperty(key.name())) && (this.get(key) !== undefined);\n }\n\n get(key) {\n return this._map[key.name()];\n }\n\n put(key, val) {\n return this.set(key, val);\n }\n\n set(key, val) {\n this._map[key.name()] = val;\n return this;\n }\n\n retainAll(keyList){\n const map = {};\n for(let i=0; i\n * // these two lines are equivalent, but the second approach is recommended\n * temporal = thisAdjuster.adjustInto(temporal);\n * temporal = temporal.with(thisAdjuster);\n * \n * It is recommended to use the second approach, {@link with},\n * as it is a lot clearer to read in code.\n *\n * See {@link TemporalAdjusters} for a standard set of adjusters, including finding the\n * last day of the month.\n * Adjusters may also be defined by applications.\n *\n * ### Specification for implementors\n *\n * This interface places no restrictions on the mutability of implementations,\n * however immutability is strongly recommended.\n *\n * @interface\n */\nexport class TemporalAdjuster {\n\n /**\n * Adjusts the specified temporal object.\n *\n * This adjusts the specified temporal object using the logic\n * encapsulated in the implementing class.\n * Examples might be an adjuster that sets the date avoiding weekends, or one that\n * sets the date to the last day of the month.\n *\n * There are two equivalent ways of using this method.\n * The first is to invoke this method directly.\n * The second is to use {@link Temporal#with}:\n *
\n     *   // these two lines are equivalent, but the second approach is recommended\n     *   temporal = thisAdjuster.adjustInto(temporal);\n     *   temporal = temporal.with(thisAdjuster);\n     * 
\n * It is recommended to use the second approach, {@link with},\n * as it is a lot clearer to read in code.\n *\n * ### Specification for implementors\n *\n * The implementation must take the input object and adjust it.\n * The implementation defines the logic of the adjustment and is responsible for\n * documenting that logic. It may use any method on {@link Temporal} to\n * query the temporal object and perform the adjustment.\n * The returned object must have the same observable type as the input object\n *\n * The input object must not be altered.\n * Instead, an adjusted copy of the original must be returned.\n * This provides equivalent, safe behavior for immutable and mutable temporal objects.\n *\n * The input temporal object may be in a calendar system other than ISO.\n * Implementations may choose to document compatibility with other calendar systems,\n * or reject non-ISO temporal objects by querying the chronology (see {@link TemporalQueries#chronology}).\n *\n * This method may be called from multiple threads in parallel.\n * It must be thread-safe when invoked.\n *\n * @param {Temporal} temporal the temporal object to adjust, not null\n * @return {Temporal} an object of the same observable type with the adjustment made, not null\n * @throws DateTimeException if unable to make the adjustment\n * @throws ArithmeticException if numeric overflow occurs\n *\n * @abstract\n */\n // eslint-disable-next-line no-unused-vars\n adjustInto(temporal){\n abstractMethodFail('adjustInto');\n }\n\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {TemporalAccessor} from './TemporalAccessor';\nimport { abstractMethodFail } from '../assert';\n\n/**\n * Framework-level interface defining read-write access to a temporal object,\n * such as a date, time, offset or some combination of these.\n *\n * This is the base interface type for date, time and offset objects that\n * are complete enough to be manipulated using plus and minus.\n * It is implemented by those classes that can provide and manipulate information\n * as fields (see {@link TemporalField}) or queries (see {@link TemporalQuery}).\n * See {@link TemporalAccessor} for the read-only version of this interface.\n *\n * Most date and time information can be represented as a number.\n * These are modeled using {@link TemporalField} with the number held using\n * a `long` to handle large values. Year, month and day-of-month are\n * simple examples of fields, but they also include instant and offsets.\n * See {@link ChronoField} for the standard set of fields.\n *\n * Two pieces of date/time information cannot be represented by numbers,\n * the {@link Chronology} and the {@link ZoneId}.\n * These can be accessed using the static methods defined on {@link TemporalQueries}.\n *\n * This interface is a framework-level interface that should not be widely\n * used in application code. Instead, applications should create and pass\n * around instances of concrete types, such as {@link LocalDate}.\n * There are many reasons for this, part of which is that implementations\n * of this interface may be in calendar systems other than ISO.\n * See {@link ChronoLocalDate} for a fuller discussion of the issues.\n *\n * ### When to implement\n *\n * A class should implement this interface if it meets three criteria:\n *\n * * it provides access to date/time/offset information, as per {@link TemporalAccessor}\n * * the set of fields are contiguous from the largest to the smallest\n * * the set of fields are complete, such that no other field is needed to define the\n * valid range of values for the fields that are represented\n *\n * Four examples make this clear:\n *\n * * {@link LocalDate} implements this interface as it represents a set of fields\n * that are contiguous from days to forever and require no external information to determine\n * the validity of each date. It is therefore able to implement plus/minus correctly.\n * * {@link LocalTime} implements this interface as it represents a set of fields\n * that are contiguous from nanos to within days and require no external information to determine\n * validity. It is able to implement plus/minus correctly, by wrapping around the day.\n * * {@link MonthDay}, the combination of month-of-year and day-of-month, does not implement\n * this interface. While the combination is contiguous, from days to months within years,\n * the combination does not have sufficient information to define the valid range of values\n * for day-of-month. As such, it is unable to implement plus/minus correctly.\n * * The combination day-of-week and day-of-month (\"Friday the 13th\") should not implement\n * this interface. It does not represent a contiguous set of fields, as days to weeks overlaps\n * days to months.\n *\n * @interface\n */\nexport class Temporal extends TemporalAccessor {\n /**\n * Checks if the specified unit is supported.\n * This checks if the date-time can be queried for the specified unit. If false, then calling the plus and minus methods will throw an exception.\n\n * ### Specification for implementors\n * Implementations must check and handle all fields defined in {@link ChronoUnit}. If the field is supported, then true is returned, otherwise false\n * If the field is not a {@link ChronoUnit}, then the result of this method is obtained by invoking `TemporalUnit.isSupportedBy(Temporal)` passing this as the argument.\n\n * Implementations must not alter this object.\n\n * @param {TemporalUnit} unit - the unit to check, null returns false\n * @return {boolean} true if this date-time can be queried for the unit, false if not\n */\n // eslint-disable-next-line no-unused-vars\n isSupported(unit) {\n abstractMethodFail('isSupported');\n }\n\n /**\n * function overloading for {@link Temporal.plus}\n *\n * Called with 1 (or less) arguments, p1 is expected to be a {@link TemporalAmount} and {@link Temporal.minusAmount} is called.\n *\n * Otherwise {@link Temporal.minusAmountUnit} is called.\n *\n * @param {!(TemporalAmount|number)} p1\n * @param {TemporalUnit} p2\n * @return {Temporal}\n */\n // eslint-disable-next-line no-unused-vars\n minus(p1, p2) {\n if (arguments.length < 2) {\n return this.minusAmount(p1);\n } else {\n return this.minusAmountUnit(p1, p2);\n }\n }\n\n /**\n * Returns an object of the same type as this object with an amount subtracted.\n * This adjusts this temporal, subtracting according to the rules of the specified amount. The\n * amount is typically a {@link Period} but may be any other type implementing the {@link TemporalAmount} interface, such as Duration.\n *\n * Some example code indicating how and why this method is used:\n *\n *
\n     *   date = date.minus(period);                  // subtract a Period instance\n     *   date = date.minus(duration);                // subtract a Duration instance\n     *   date = date.minus(workingDays(6));          // example user-written workingDays method\n     * 
\n *\n * Note that calling plus followed by minus is not guaranteed to return the same date-time.\n *\n * ### Specification for implementors\n * Implementations must not alter either this object. Instead, an adjusted copy of the original\n * must be returned. This provides equivalent, safe behavior for immutable and mutable\n * implementations.\n *\n * @param {TemporalAmount} amount - the amount to subtract, not null\n * @return {Temporal} an object of the same type with the specified adjustment made, not null\n * @throws DateTimeException - if the subtraction cannot be made\n * @throws ArithmeticException - if numeric overflow occurs\n */\n // eslint-disable-next-line no-unused-vars\n minusAmount(amount) {\n abstractMethodFail('minusAmount');\n }\n\n /**\n * Returns an object of the same type as this object with the specified period subtracted.\n * This method returns a new object based on this one with the specified period subtracted. For example, on a {@link LocalDate}, this could be used to subtract a number of years, months or days. The returned object will have the same observable type as this object.\n *\n * In some cases, changing a field is not fully defined. For example, if the target object is a date representing the 31st March, then subtracting one month would be unclear. In cases like this, the field is responsible for resolving the result. Typically it will choose the previous valid date, which would be the last valid day of February in this example.\n *\n * If the implementation represents a date-time that has boundaries, such {@link as} LocalTime, then the permitted units must include the boundary unit, but no multiples of the boundary unit. For example, {@link LocalTime} must accept `DAYS` but not `WEEKS` or `MONTHS`.\n *\n * ### Specification for implementors\n * Implementations must behave in a manor equivalent to the default method behavior.\n * Implementations must not alter either this object or the specified temporal object. Instead, an adjusted copy of the original must be returned. This provides equivalent, safe behavior for immutable and mutable implementations.\n *\n * @param {number} amountToSubtract - the amount of the specified unit to subtract, may be negative\n * @param {TemporalUnit} unit - the unit of the period to subtract, not null\n * @return {Temporal} an object of the same type with the specified period subtracted, not null\n * @throws DateTimeException - if the unit cannot be subtracted\n * @throws ArithmeticException - if numeric overflow occurs\n */\n // eslint-disable-next-line no-unused-vars\n minusAmountUnit(amountToSubtract, unit) {\n abstractMethodFail('minusAmountUnit');\n }\n\n /**\n * function overloading for {@link Temporal.plus}\n *\n * Called with 1 (or less) arguments, p1 is expected to be a {@link TemporalAmount} and {@link Temporal.plusAmount} is called.\n *\n * Otherwise {@link Temporal.plusAmountUnit} is called.\n *\n * @param {!(TemporalAmount|number)} p1\n * @param {TemporalUnit} p2\n * @return {Temporal}\n */\n // eslint-disable-next-line no-unused-vars\n plus(p1, p2) {\n if (arguments.length < 2) {\n return this.plusAmount(p1);\n } else {\n return this.plusAmountUnit(p1, p2);\n }\n }\n\n /**\n * Returns an object of the same type as this object with an amount added.\n * This adjusts this temporal, adding according to the rules of the specified amount. The amount is typically a {@link Period} but may be any other type implementing the {@link TemporalAmount} interface, such as {@link Duration}.\n *\n * Some example code indicating how and why this method is used:\n *\n *
\n     *   date = date.plus(period);                  // add a Period instance\n     *   date = date.plus(duration);                // add a Duration instance\n     *   date = date.plus(workingDays(6));          // example user-written workingDays method\n     * 
\n *\n * Note that calling plus followed by minus is not guaranteed to return the same date-time.\n *\n * ### Specification for implementors\n * Implementations must not alter either this object. Instead, an adjusted copy of the original must be returned. This provides equivalent, safe behavior for immutable and mutable implementations.\n *\n * @param {TemporalAmount} amount - the amount to add, not null\n * @return {Temporal} an object of the same type with the specified adjustment made, not null\n * @throws DateTimeException - if the addition cannot be made\n * @throws ArithmeticException - if numeric overflow occurs\n */\n // eslint-disable-next-line no-unused-vars\n plusAmount(amount) {\n abstractMethodFail('plusAmount');\n }\n\n /**\n * Returns an object of the same type as this object with the specified period added.\n * This method returns a new object based on this one with the specified period added. For example, on a {@link LocalDate}, this could be used to add a number of years, months or days. The returned object will have the same observable type as this object.\n *\n * In some cases, changing a field is not fully defined. For example, if the target object is a date representing the 31st January, then adding one month would be unclear. In cases like this, the field is responsible for resolving the result. Typically it will choose the previous valid date, which would be the last valid day of February in this example.\n *\n * If the implementation represents a date-time that has boundaries, such as {@link LocalTime}, then the permitted units must include the boundary unit, but no multiples of the boundary unit. For example, {@link LocalTime} must accept `DAYS` but not `WEEKS` or `MONTHS`.\n *\n * ### Specification for implementors\n * Implementations must check and handle all units defined in {@link ChronoUnit}. If the unit is supported, then the addition must be performed. If unsupported, then a {@link DateTimeException} must be thrown.\n * If the unit is not a {@link ChronoUnit}, then the result of this method is obtained by invoking `TemporalUnit.addTo(Temporal, long)` passing this as the first argument.\n *\n * Implementations must not alter either this object or the specified temporal object. Instead, an adjusted copy of the original must be returned. This provides equivalent, safe behavior for immutable and mutable implementations.\n *\n * @param {number} amountToAdd - the amount of the specified unit to add, may be negative\n * @param {TemporalUnit} unit - the unit of the period to add, not null\n * @return {Temporal} an object of the same type with the specified period added, not null\n * @throws DateTimeException - if the unit cannot be added\n * @throws ArithmeticException - if numeric overflow occurs\n */\n // eslint-disable-next-line no-unused-vars\n plusAmountUnit(amountToAdd, unit) {\n abstractMethodFail('plusAmountUnit');\n }\n\n /**\n * Calculates the period between this temporal and another temporal in terms of the specified unit.\n * This calculates the period between two temporals in terms of a single unit. The start and end points are this and the specified temporal. The result will be negative if the end is before the start. For example, the period in hours between two temporal objects can be calculated using `startTime.until(endTime, HOURS)`.\n *\n * The calculation returns a whole number, representing the number of complete units between the two temporals. For example, the period in hours between the times 11:30 and 13:29 will only be one hour as it is one minute short of two hours.\n *\n * There are two equivalent ways of using this method. The first is to invoke this method directly. The second is to use `TemporalUnit.between(Temporal, Temporal)`:\n *\n *
\n     *    // these two lines are equivalent\n     *    between = thisUnit.between(start, end);\n     *    between = start.until(end, thisUnit);\n     * 
\n *\n * The choice should be made based on which makes the code more readable.\n * For example, this method allows the number of days between two dates to be calculated:\n *\n *
\n     *    long daysBetween = DAYS.between(start, end);\n     *    // or alternatively\n     *    long daysBetween = start.until(end, DAYS);\n     * 
\n *\n * ### Specification for implementors\n * Implementations must begin by checking to ensure that the input temporal object is of the same observable type as the implementation. They must then perform the calculation for all instances of {@link ChronoUnit}. A {@link DateTimeException} must be thrown for {@link ChronoUnit} instances that are unsupported.\n * If the unit is not a {@link ChronoUnit}, then the result of this method is obtained by invoking `TemporalUnit.between(Temporal, Temporal)` passing this as the first argument and the input temporal as the second argument.\n *\n * In summary, implementations must behave in a manner equivalent to this code:\n *\n *
\n     *   // check input temporal is the same type as this class\n     *   if (unit instanceof ChronoUnit) {\n     *     // if unit is supported, then calculate and return result\n     *     // else throw DateTimeException for unsupported units\n     *   }\n     *   return unit.between(this, endTemporal);\n     * 
\n *\n * The target object must not be altered by this method.\n *\n * @param {Temporal} endTemporal - the end temporal, of the same type as this object, not null\n * @param {TemporalUnit} unit - the unit to measure the period in, not null\n * @return {number} the amount of the period between this and the end\n * @throws DateTimeException - if the period cannot be calculated\n * @throws ArithmeticException - if numeric overflow occurs\n */\n // eslint-disable-next-line no-unused-vars\n until(endTemporal, unit) {\n abstractMethodFail('until');\n }\n\n /**\n * function overloading for {@link Temporal.with}\n *\n * Called with 1 (or less) arguments, p1 is expected to be a {@link TemporalAdjuster} and {@link Temporal.withAdjuster} is called.\n *\n * Otherwise {@link Temporal.withFieldValue} is called.\n *\n * @param {!(TemporalAdjuster|TemporalField)} p1\n * @param {number} p2\n * @return {Temporal}\n */\n // eslint-disable-next-line no-unused-vars\n with(p1, p2) {\n if (arguments.length < 2) {\n return this.withAdjuster(p1);\n } else {\n return this.withFieldValue(p1, p2);\n }\n }\n\n /**\n * Returns an adjusted object of the same type as this object with the adjustment made.\n * This adjusts this date-time according to the rules of the specified adjuster. A simple adjuster might simply set the one of the fields, such as the year field. A more complex adjuster might set the date to the last day of the month. A selection of common adjustments is provided in {@link TemporalAdjusters}. These include finding the \"last day of the month\" and \"next Wednesday\". The adjuster is responsible for handling special cases, such as the varying lengths of month and leap years.\n *\n * Some example code indicating how and why this method is used:\n *\n *
\n     *   date = date.with(Month.JULY);        // most key classes implement TemporalAdjuster\n     *   date = date.with(lastDayOfMonth());  // static import from TemporalAdjusters\n     *   date = date.with(next(WEDNESDAY));   // static import from TemporalAdjusters and DayOfWeek\n     * 
\n *\n * ### Specification for implementors\n * Implementations must not alter either this object. Instead, an adjusted copy of the original must be returned. This provides equivalent, safe behavior for immutable and mutable implementations.\n *\n * @param {TemporalAdjuster} adjuster - the adjuster to use, not null\n * @return {Temporal} an object of the same type with the specified adjustment made, not null\n * @throws DateTimeException - if unable to make the adjustment\n * @throws ArithmeticException - if numeric overflow occurs\n */\n // eslint-disable-next-line no-unused-vars\n withAdjuster(adjuster) {\n abstractMethodFail('withAdjuster');\n }\n\n /**\n * Returns an object of the same type as this object with the specified field altered.\n * This returns a new object based on this one with the value for the specified field changed. For example, on a {@link LocalDate}, this could be used to set the year, month or day-of-month. The returned object will have the same observable type as this object.\n *\n * In some cases, changing a field is not fully defined. For example, if the target object is a date representing the 31st January, then changing the month to February would be unclear. In cases like this, the field is responsible for resolving the result. Typically it will choose the previous valid date, which would be the last valid day of February in this example.\n *\n * ### Specification for implementors\n * Implementations must check and handle all fields defined in {@link ChronoField}. If the field is supported, then the adjustment must be performed. If unsupported, then a {@link DateTimeException} must be thrown.\n * If the field is not a {@link ChronoField}, then the result of this method is obtained by invoking `TemporalField.adjustInto(Temporal, long)` passing this as the first argument.\n *\n * Implementations must not alter either this object or the specified temporal object. Instead, an adjusted copy of the original must be returned. This provides equivalent, safe behavior for immutable and mutable implementations.\n *\n * @param {TemporalField} field - the field to set in the result, not null\n * @param {number} newValue - the new value of the field in the result\n * @return {Temporal} an object of the same type with the specified field set, not null\n * @throws DateTimeException - if the field cannot be set\n * @throws ArithmeticException - if numeric overflow occurs\n */\n // eslint-disable-next-line no-unused-vars\n withFieldValue(field, newValue) {\n abstractMethodFail('withFieldValue');\n }\n}\n","import {MAX_SAFE_INTEGER, MIN_SAFE_INTEGER} from '../MathUtil';\nimport {requireInstance, requireNonNull} from '../assert';\nimport {TemporalAdjuster} from './TemporalAdjuster';\nimport {TemporalAmount} from './TemporalAmount';\nimport {TemporalUnit} from './TemporalUnit';\nimport {Temporal} from './Temporal';\n\nexport class DefaultInterfaceTemporal extends Temporal {\n /**\n * Returns an adjusted object of the same type as this object with the adjustment made.\n * This adjusts this date-time according to the rules of the specified adjuster. A simple adjuster might simply set the one of the fields, such as the year field. A more complex adjuster might set the date to the last day of the month. A selection of common adjustments is provided in {@link TemporalAdjusters}. These include finding the \"last day of the month\" and \"next Wednesday\". The adjuster is responsible for handling special cases, such as the varying lengths of month and leap years.\n *\n * Some example code indicating how and why this method is used:\n *\n *
\n     *   date = date.with(Month.JULY);        // most key classes implement TemporalAdjuster\n     *   date = date.with(lastDayOfMonth());  // static import from TemporalAdjusters\n     *   date = date.with(next(WEDNESDAY));   // static import from TemporalAdjusters and DayOfWeek\n     * 
\n *\n * ### Specification for implementors\n * Implementations must not alter either this object. Instead, an adjusted copy of the original must be returned. This provides equivalent, safe behavior for immutable and mutable implementations.\n *\n * @param {TemporalAdjuster} adjuster - the adjuster to use, not null\n * @return {Temporal} an object of the same type with the specified adjustment made, not null\n * @throws DateTimeException - if unable to make the adjustment\n * @throws ArithmeticException - if numeric overflow occurs\n */\n withAdjuster(adjuster) {\n requireNonNull(adjuster, 'adjuster');\n requireInstance(adjuster, TemporalAdjuster, 'adjuster');\n return adjuster.adjustInto(this);\n }\n\n /**\n * Returns an object of the same type as this object with an amount added.\n * This adjusts this temporal, adding according to the rules of the specified amount. The amount is typically a {@link Period} but may be any other type implementing the {@link TemporalAmount} interface, such as {@link Duration}.\n *\n * Some example code indicating how and why this method is used:\n *\n *
\n     *   date = date.plus(period);                  // add a Period instance\n     *   date = date.plus(duration);                // add a Duration instance\n     *   date = date.plus(workingDays(6));          // example user-written workingDays method\n     * 
\n *\n * Note that calling plus followed by minus is not guaranteed to return the same date-time.\n *\n * ### Specification for implementors\n * Implementations must not alter either this object. Instead, an adjusted copy of the original must be returned. This provides equivalent, safe behavior for immutable and mutable implementations.\n *\n * @param {TemporalAmount} amount - the amount to add, not null\n * @return {Temporal} an object of the same type with the specified adjustment made, not null\n * @throws DateTimeException - if the addition cannot be made\n * @throws ArithmeticException - if numeric overflow occurs\n */\n plusAmount(amount) {\n requireNonNull(amount, 'amount');\n requireInstance(amount, TemporalAmount, 'amount');\n return amount.addTo(this);\n }\n\n /**\n * Returns an object of the same type as this object with an amount subtracted.\n * This adjusts this temporal, subtracting according to the rules of the specified amount. The\n * amount is typically a {@link Period} but may be any other type implementing the {@link TemporalAmount} interface, such as Duration.\n *\n * Some example code indicating how and why this method is used:\n *\n *
\n     *   date = date.minus(period);                  // subtract a Period instance\n     *   date = date.minus(duration);                // subtract a Duration instance\n     *   date = date.minus(workingDays(6));          // example user-written workingDays method\n     * 
\n *\n * Note that calling plus followed by minus is not guaranteed to return the same date-time.\n *\n * ### Specification for implementors\n * Implementations must not alter either this object. Instead, an adjusted copy of the original\n * must be returned. This provides equivalent, safe behavior for immutable and mutable\n * implementations.\n *\n * @param {TemporalAmount} amount - the amount to subtract, not null\n * @return {Temporal} an object of the same type with the specified adjustment made, not null\n * @throws DateTimeException - if the subtraction cannot be made\n * @throws ArithmeticException - if numeric overflow occurs\n */\n minusAmount(amount) {\n requireNonNull(amount, 'amount');\n requireInstance(amount, TemporalAmount, 'amount');\n return amount.subtractFrom(this);\n }\n\n /**\n * Returns an object of the same type as this object with the specified period subtracted.\n * This method returns a new object based on this one with the specified period subtracted. For example, on a {@link LocalDate}, this could be used to subtract a number of years, months or days. The returned object will have the same observable type as this object.\n *\n * In some cases, changing a field is not fully defined. For example, if the target object is a date representing the 31st March, then subtracting one month would be unclear. In cases like this, the field is responsible for resolving the result. Typically it will choose the previous valid date, which would be the last valid day of February in this example.\n *\n * If the implementation represents a date-time that has boundaries, such {@link as} LocalTime, then the permitted units must include the boundary unit, but no multiples of the boundary unit. For example, {@link LocalTime} must accept `DAYS` but not `WEEKS` or `MONTHS`.\n *\n * ### Specification for implementors\n * Implementations must behave in a manor equivalent to the default method behavior.\n * Implementations must not alter either this object or the specified temporal object. Instead, an adjusted copy of the original must be returned. This provides equivalent, safe behavior for immutable and mutable implementations.\n *\n * @param {number} amountToSubtract - the amount of the specified unit to subtract, may be negative\n * @param {TemporalUnit} unit - the unit of the period to subtract, not null\n * @return {Temporal} an object of the same type with the specified period subtracted, not null\n * @throws DateTimeException - if the unit cannot be subtracted\n * @throws ArithmeticException - if numeric overflow occurs\n */\n minusAmountUnit(amountToSubtract, unit) {\n requireNonNull(amountToSubtract, 'amountToSubtract');\n requireNonNull(unit, 'unit');\n requireInstance(unit, TemporalUnit, 'unit');\n return (amountToSubtract === MIN_SAFE_INTEGER ? this.plusAmountUnit(MAX_SAFE_INTEGER, unit).plusAmountUnit(1, unit) : this.plusAmount(-amountToSubtract, unit));\n }\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {requireNonNull, requireInstance} from '../assert';\n\nimport {ChronoField} from '../temporal/ChronoField';\nimport {ChronoUnit} from '../temporal/ChronoUnit';\nimport {DateTimeFormatter} from '../format/DateTimeFormatter';\nimport {TemporalQueries} from '../temporal/TemporalQueries';\nimport {DefaultInterfaceTemporal} from '../temporal/DefaultInterfaceTemporal';\n\nimport {LocalDate} from '../LocalDate';\n\n/**\n * A date without time-of-day or time-zone in an arbitrary chronology, intended\n * for advanced globalization use cases.\n *\n * **Most applications should declare method signatures, fields and variables\n * as {@link LocalDate}, not this interface.**\n *\n * A {@link ChronoLocalDate} is the abstract representation of a date where the\n * {@link Chronology}, or calendar system, is pluggable.\n * The date is defined in terms of fields expressed by {@link TemporalField},\n * where most common implementations are defined in {@link ChronoField}.\n * The chronology defines how the calendar system operates and the meaning of\n * the standard fields.\n *\n * #### When to use this interface\n *\n * The design of the API encourages the use of {@link LocalDate} rather than this\n * interface, even in the case where the application needs to deal with multiple\n * calendar systems. The rationale for this is explored in the following documentation.\n *\n * The primary use case where this interface should be used is where the generic\n * type parameter `C` is fully defined as a specific chronology.\n * In that case, the assumptions of that chronology are known at development\n * time and specified in the code.\n *\n * When the chronology is defined in the generic type parameter as ? or otherwise\n * unknown at development time, the rest of the discussion below applies.\n *\n * To emphasize the point, declaring a method signature, field or variable as this\n * interface type can initially seem like the sensible way to globalize an application,\n * however it is usually the wrong approach.\n * As such, it should be considered an application-wide architectural decision to choose\n * to use this interface as opposed to {@link LocalDate}.\n *\n * #### Architectural issues to consider\n *\n * These are some of the points that must be considered before using this interface\n * throughout an application.\n *\n * 1) Applications using this interface, as opposed to using just {@link LocalDate},\n * face a significantly higher probability of bugs. This is because the calendar system\n * in use is not known at development time. A key cause of bugs is where the developer\n * applies assumptions from their day-to-day knowledge of the ISO calendar system\n * to code that is intended to deal with any arbitrary calendar system.\n * The section below outlines how those assumptions can cause problems\n * The primary mechanism for reducing this increased risk of bugs is a strong code review process.\n * This should also be considered a extra cost in maintenance for the lifetime of the code.\n *\n * 2) This interface does not enforce immutability of implementations.\n * While the implementation notes indicate that all implementations must be immutable\n * there is nothing in the code or type system to enforce this. Any method declared\n * to accept a {@link ChronoLocalDate} could therefore be passed a poorly or\n * maliciously written mutable implementation.\n *\n * 3) Applications using this interface must consider the impact of eras.\n * {@link LocalDate} shields users from the concept of eras, by ensuring that `getYear()`\n * returns the proleptic year. That decision ensures that developers can think of\n * {@link LocalDate} instances as consisting of three fields - year, month-of-year and day-of-month.\n * By contrast, users of this interface must think of dates as consisting of four fields -\n * era, year-of-era, month-of-year and day-of-month. The extra era field is frequently\n * forgotten, yet it is of vital importance to dates in an arbitrary calendar system.\n * For example, in the Japanese calendar system, the era represents the reign of an Emperor.\n * Whenever one reign ends and another starts, the year-of-era is reset to one.\n *\n * 4) The only agreed international standard for passing a date between two systems\n * is the ISO-8601 standard which requires the ISO calendar system. Using this interface\n * throughout the application will inevitably lead to the requirement to pass the date\n * across a network or component boundary, requiring an application specific protocol or format.\n *\n * 5) Long term persistence, such as a database, will almost always only accept dates in the\n * ISO-8601 calendar system (or the related Julian-Gregorian). Passing around dates in other\n * calendar systems increases the complications of interacting with persistence.\n *\n * 6) Most of the time, passing a {@link ChronoLocalDate} throughout an application\n * is unnecessary, as discussed in the last section below.\n *\n * #### False assumptions causing bugs in multi-calendar system code\n *\n * As indicated above, there are many issues to consider when try to use and manipulate a\n * date in an arbitrary calendar system. These are some of the key issues.\n *\n * Code that queries the day-of-month and assumes that the value will never be more than\n * 31 is invalid. Some calendar systems have more than 31 days in some months.\n *\n * Code that adds 12 months to a date and assumes that a year has been added is invalid.\n * Some calendar systems have a different number of months, such as 13 in the Coptic or Ethiopic.\n *\n * Code that adds one month to a date and assumes that the month-of-year value will increase\n * by one or wrap to the next year is invalid. Some calendar systems have a variable number\n * of months in a year, such as the Hebrew.\n *\n * Code that adds one month, then adds a second one month and assumes that the day-of-month\n * will remain close to its original value is invalid. Some calendar systems have a large difference\n * between the length of the longest month and the length of the shortest month.\n * For example, the Coptic or Ethiopic have 12 months of 30 days and 1 month of 5 days.\n *\n * Code that adds seven days and assumes that a week has been added is invalid.\n * Some calendar systems have weeks of other than seven days, such as the French Revolutionary.\n *\n * Code that assumes that because the year of `date1` is greater than the year of `date2`\n * then `date1` is after `date2` is invalid. This is invalid for all calendar systems\n * when referring to the year-of-era, and especially untrue of the Japanese calendar system\n * where the year-of-era restarts with the reign of every new Emperor.\n *\n * Code that treats month-of-year one and day-of-month one as the start of the year is invalid.\n * Not all calendar systems start the year when the month value is one.\n *\n * In general, manipulating a date, and even querying a date, is wide open to bugs when the\n * calendar system is unknown at development time. This is why it is essential that code using\n * this interface is subjected to additional code reviews. It is also why an architectural\n * decision to avoid this interface type is usually the correct one.\n *\n * #### Using LocalDate instead\n *\n * The primary alternative to using this interface throughout your application is as follows.\n *\n * * Declare all method signatures referring to dates in terms of {@link LocalDate}.\n * * Either store the chronology (calendar system) in the user profile or lookup the chronology\n * from the user locale.\n * * Convert the ISO {@link LocalDate} to and from the user's preferred calendar system during\n * printing and parsing.\n *\n * This approach treats the problem of globalized calendar systems as a localization issue\n * and confines it to the UI layer. This approach is in keeping with other localization\n * issues in the java platform.\n *\n * As discussed above, performing calculations on a date where the rules of the calendar system\n * are pluggable requires skill and is not recommended.\n * Fortunately, the need to perform calculations on a date in an arbitrary calendar system\n * is extremely rare. For example, it is highly unlikely that the business rules of a library\n * book rental scheme will allow rentals to be for one month, where meaning of the month\n * is dependent on the user's preferred calendar system.\n *\n * A key use case for calculations on a date in an arbitrary calendar system is producing\n * a month-by-month calendar for display and user interaction. Again, this is a UI issue,\n * and use of this interface solely within a few methods of the UI layer may be justified.\n *\n * In any other part of the system, where a date must be manipulated in a calendar system\n * other than ISO, the use case will generally specify the calendar system to use.\n * For example, an application may need to calculate the next Islamic or Hebrew holiday\n * which may require manipulating the date.\n * This kind of use case can be handled as follows:\n *\n * * start from the ISO {@link LocalDate} being passed to the method\n * * convert the date to the alternate calendar system, which for this use case is known\n * rather than arbitrary\n * * perform the calculation\n * * convert back to {@link LocalDate}\n *\n * Developers writing low-level frameworks or libraries should also avoid this interface.\n * Instead, one of the two general purpose access interfaces should be used.\n * Use {@link TemporalAccessor} if read-only access is required, or use {@link Temporal}\n * if read-write access is required.\n *\n * ### Specification for implementors\n *\n * This interface must be implemented with care to ensure other classes operate correctly.\n * All implementations that can be instantiated must be final, immutable and thread-safe.\n * Subclasses should be Serializable wherever possible.\n *\n * Additional calendar systems may be added to the system.\n * See {@link Chronology} for more details.\n *\n * In JDK 8, this is an interface with default methods.\n * Since there are no default methods in JDK 7, an abstract class is used.\n */\nexport class ChronoLocalDate extends DefaultInterfaceTemporal {\n\n isSupported(fieldOrUnit) {\n if (fieldOrUnit instanceof ChronoField) {\n return fieldOrUnit.isDateBased();\n } else if (fieldOrUnit instanceof ChronoUnit) {\n return fieldOrUnit.isDateBased();\n }\n return fieldOrUnit != null && fieldOrUnit.isSupportedBy(this);\n }\n\n query(query) {\n if (query === TemporalQueries.chronology()) {\n return this.chronology();\n } else if (query === TemporalQueries.precision()) {\n return ChronoUnit.DAYS;\n } else if (query === TemporalQueries.localDate()) {\n return LocalDate.ofEpochDay(this.toEpochDay());\n } else if (query === TemporalQueries.localTime() || query === TemporalQueries.zone() ||\n query === TemporalQueries.zoneId() || query === TemporalQueries.offset()) {\n return null;\n }\n return super.query(query);\n }\n\n adjustInto(temporal) {\n return temporal.with(ChronoField.EPOCH_DAY, this.toEpochDay());\n }\n /**\n * Formats this date using the specified formatter.\n *\n * This date will be passed to the formatter to produce a string.\n *\n * The default implementation must behave as follows:\n *
\n     *  return formatter.format(this);\n     * 
\n *\n * @param {DateTimeFormatter} formatter the formatter to use, not null\n * @return {String} the formatted date string, not null\n * @throws DateTimeException if an error occurs during printing\n */\n format(formatter) {\n requireNonNull(formatter, 'formatter');\n requireInstance(formatter, DateTimeFormatter, 'formatter');\n return formatter.format(this);\n }\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {MathUtil} from './MathUtil';\n\n/**\n * @private\n */\nexport class StringUtil {\n\n /**\n *\n * @param {string} text\n * @param {string} pattern\n * @return {boolean}\n */\n static startsWith(text, pattern){\n return text.indexOf(pattern) === 0;\n }\n\n /**\n *\n * @param {string} text\n * @returns {number}\n */\n static hashCode(text) {\n const len = text.length;\n if (len === 0) {\n return 0;\n }\n\n let hash = 0;\n for (let i = 0; i < len; i++) {\n const chr = text.charCodeAt(i);\n hash = ((hash << 5) - hash) + chr;\n hash |= 0; // Convert to 32bit integer\n }\n return MathUtil.smi(hash);\n }\n}\n\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {abstractMethodFail} from './assert';\nimport {DateTimeException} from './errors';\n\nimport {StringUtil} from './StringUtil';\n\nimport {Instant} from './Instant';\n\nexport class ZoneId {\n /**\n * Gets the system default time-zone.\n *\n * @return {ZoneId} the zone ID, not null\n */\n static systemDefault() {\n // Find implementation at {@link ZoneIdFactory}\n throw new DateTimeException('not supported operation');\n }\n\n /**\n * Gets the set of available zone IDs.\n *\n * This set includes the string form of all available region-based IDs.\n * Offset-based zone IDs are not included in the returned set.\n * The ID can be passed to {@link of} to create a {@link ZoneId}.\n *\n * The set of zone IDs can increase over time, although in a typical application\n * the set of IDs is fixed. Each call to this method is thread-safe.\n *\n * @return {string[]} a modifiable copy of the set of zone IDs, not null\n */\n static getAvailableZoneIds() {\n // Find implementation at {@link ZoneIdFactory}\n throw new DateTimeException('not supported operation');\n }\n\n /**\n * Obtains an instance of {@link ZoneId} from an ID ensuring that the\n * ID is valid and available for use.\n *\n * This method parses the ID producing a {@link ZoneId} or {@link ZoneOffset}.\n * A {@link ZoneOffset} is returned if the ID is 'Z', or starts with '+' or '-'.\n * The result will always be a valid ID for which {@link ZoneRules} can be obtained.\n *\n * Parsing matches the zone ID step by step as follows.\n *\n * * If the zone ID equals 'Z', the result is {@link ZoneOffset.UTC}.\n * * If the zone ID consists of a single letter, the zone ID is invalid\n * and {@link DateTimeException} is thrown.\n * * If the zone ID starts with '+' or '-', the ID is parsed as a\n * {@link ZoneOffset} using {@link ZoneOffset#of}.\n * * If the zone ID equals 'GMT', 'UTC' or 'UT' then the result is a {@link ZoneId}\n * with the same ID and rules equivalent to {@link ZoneOffset.UTC}.\n * * If the zone ID starts with 'UTC+', 'UTC-', 'GMT+', 'GMT-', 'UT+' or 'UT-'\n * then the ID is a prefixed offset-based ID. The ID is split in two, with\n * a two or three letter prefix and a suffix starting with the sign.\n * The suffix is parsed as a {@link ZoneOffset}.\n * The result will be a {@link ZoneId} with the specified UTC/GMT/UT prefix\n * and the normalized offset ID as per {@link ZoneOffset#getId}.\n * The rules of the returned {@link ZoneId} will be equivalent to the\n * parsed {@link ZoneOffset}.\n * * All other IDs are parsed as region-based zone IDs. Region IDs must\n * match the regular expression `[A-Za-z][A-Za-z0-9~/._+-]+`,\n * otherwise a {@link DateTimeException} is thrown. If the zone ID is not\n * in the configured set of IDs, {@link ZoneRulesException} is thrown.\n * The detailed format of the region ID depends on the group supplying the data.\n * The default set of data is supplied by the IANA Time Zone Database (TZDB).\n * This has region IDs of the form '{area}/{city}', such as 'Europe/Paris' or 'America/New_York'.\n * This is compatible with most IDs from {@link java.util.TimeZone}.\n *\n * @param {string} zoneId the time-zone ID, not null\n * @return {ZoneId} the zone ID, not null\n * @throws DateTimeException if the zone ID has an invalid format\n * @throws ZoneRulesException if the zone ID is a region ID that cannot be found\n */\n static of(zoneId) {\n // Find implementation at {@link ZoneIdFactory}\n throw new DateTimeException('not supported operation' + zoneId);\n }\n\n /**\n * Obtains an instance of {@link ZoneId} wrapping an offset.\n *\n * If the prefix is 'GMT', 'UTC', or 'UT' a {@link ZoneId}\n * with the prefix and the non-zero offset is returned.\n * If the prefix is empty `''` the {@link ZoneOffset} is returned.\n *\n * @param {string} prefix the time-zone ID, not null\n * @param {ZoneOffset} offset the offset, not null\n * @return {ZoneId} the zone ID, not null\n * @throws IllegalArgumentException if the prefix is not one of\n * 'GMT', 'UTC', or 'UT', or ''\n */\n static ofOffset(prefix, offset) {\n // Find implementation at {@link ZoneIdFactory}\n throw new DateTimeException('not supported operation' + prefix + offset);\n }\n\n\n /**\n * Obtains an instance of {@link ZoneId} from a temporal object.\n *\n * A {@link TemporalAccessor} represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of {@link ZoneId}.\n *\n * The conversion will try to obtain the zone in a way that favours region-based\n * zones over offset-based zones using {@link TemporalQueries#zone}.\n *\n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used in queries via method reference, {@link ZoneId::from}.\n *\n * @param {!TemporalAccessor} temporal - the temporal object to convert, not null\n * @return {ZoneId} the zone ID, not null\n * @throws DateTimeException if unable to convert to a {@link ZoneId}\n */\n static from(temporal) {\n // Find implementation at {@link ZoneIdFactory}\n throw new DateTimeException('not supported operation' + temporal);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the unique time-zone ID.\n *\n * This ID uniquely defines this object.\n * The format of an offset based ID is defined by {@link ZoneOffset#getId}.\n *\n * @return {String} the time-zone unique ID, not null\n */\n id(){\n abstractMethodFail('ZoneId.id');\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the time-zone rules for this ID allowing calculations to be performed.\n *\n * The rules provide the functionality associated with a time-zone,\n * such as finding the offset for a given instant or local date-time.\n *\n * A time-zone can be invalid if it is deserialized in a Java Runtime which\n * does not have the same rules loaded as the Java Runtime that stored it.\n * In this case, calling this method will throw a {@link ZoneRulesException}.\n *\n * The rules are supplied by {@link ZoneRulesProvider}. An advanced provider may\n * support dynamic updates to the rules without restarting the Java Runtime.\n * If so, then the result of this method may change over time.\n * Each individual call will be still remain thread-safe.\n *\n * {@link ZoneOffset} will always return a set of rules where the offset never changes.\n *\n * @return {!ZoneRules} the rules, not null\n * @throws ZoneRulesException if no rules are available for this ID\n */\n rules(){\n abstractMethodFail('ZoneId.rules');\n }\n\n /**\n * Normalizes the time-zone ID, returning a {@link ZoneOffset} where possible.\n *\n * The returns a normalized {@link ZoneId} that can be used in place of this ID.\n * The result will have {@link ZoneRules} equivalent to those returned by this object,\n * however the ID returned by {@link getId} may be different.\n *\n * The normalization checks if the rules of this {@link ZoneId} have a fixed offset.\n * If they do, then the {@link ZoneOffset} equal to that offset is returned.\n * Otherwise `this` is returned.\n *\n * @return {ZoneId} the time-zone unique ID, not null\n */\n normalized() {\n const rules = this.rules();\n if (rules.isFixedOffset()) {\n return rules.offset(Instant.EPOCH);\n }\n //try {\n //} catch (ZoneRulesException ex) {\n // // ignore invalid objects\n //}\n return this;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this time-zone ID is equal to another time-zone ID.\n *\n * The comparison is based on the ID.\n *\n * @param {*} other the object to check, null returns false\n * @return {boolean} true if this is equal to the other time-zone ID\n */\n equals(other) {\n if (this === other) {\n return true;\n }\n if (other instanceof ZoneId) {\n return this.id() === other.id();\n }\n return false;\n }\n\n /**\n * A hash code for this time-zone ID.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return StringUtil.hashCode(this.id());\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this zone as a string, using the ID.\n *\n * @return {string} a string representation of this time-zone ID, not null\n */\n toString() {\n return this.id();\n }\n\n /**\n * toJSON() use by JSON.stringify\n * delegates to toString()\n *\n * @return {string}\n */\n toJSON() {\n return this.toString();\n }\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {requireNonNull, abstractMethodFail} from '../assert';\n\nimport {Duration} from '../Duration';\nimport {Instant} from '../Instant';\n\nexport class ZoneRules {\n\n /**\n * Obtains an instance of {@link ZoneRules} that always uses the same offset.\n *\n * The returned rules always have the same offset.\n *\n * @param {ZoneOffset} offset - the offset, not null\n * @return {ZoneRules} the zone rules, not null\n */\n static of(offset) {\n requireNonNull(offset, 'offset');\n return new Fixed(offset);\n }\n\n\n //-----------------------------------------------------------------------\n /**\n * Checks of the zone rules are fixed, such that the offset never varies.\n *\n * @return {boolean} true if the time-zone is fixed and the offset never changes\n */\n isFixedOffset(){\n abstractMethodFail('ZoneRules.isFixedOffset');\n }\n\n //-----------------------------------------------------------------------\n\n /**\n *\n * @param instantOrLocalDateTime\n * @returns {ZoneOffset}\n */\n offset(instantOrLocalDateTime){\n if(instantOrLocalDateTime instanceof Instant){\n return this.offsetOfInstant(instantOrLocalDateTime);\n } else {\n return this.offsetOfLocalDateTime(instantOrLocalDateTime);\n }\n }\n\n /**\n * Gets the offset applicable at the specified instant in these rules.\n *\n * The mapping from an instant to an offset is simple, there is only\n * one valid offset for each instant.\n * This method returns that offset.\n *\n * @param {Instant} instant - the instant to find the offset for, not null, but null\n * may be ignored if the rules have a single offset for all instants\n * @return {ZoneOffset} the offset, not null\n */\n // eslint-disable-next-line no-unused-vars\n offsetOfInstant(instant){\n abstractMethodFail('ZoneRules.offsetInstant');\n }\n\n /**\n * Gets the offset applicable at the specified epochMilli in these rules.\n *\n * The method is for javascript performance optimisation.\n *\n * @param {number} epochMilli - the epoch millisecond to find the offset for, not null, but null\n * may be ignored if the rules have a single offset for all instants\n * @return {ZoneOffset} the offset, not null\n */\n // eslint-disable-next-line no-unused-vars\n offsetOfEpochMilli(epochMilli){\n abstractMethodFail('ZoneRules.offsetOfEpochMilli');\n }\n\n\n /**\n * Gets a suitable offset for the specified local date-time in these rules.\n *\n * The mapping from a local date-time to an offset is not straightforward.\n * There are three cases:\n *\n * * Normal, with one valid offset. For the vast majority of the year, the normal\n * case applies, where there is a single valid offset for the local date-time.\n * * Gap, with zero valid offsets. This is when clocks jump forward typically\n * due to the spring daylight savings change from \"winter\" to \"summer\".\n * In a gap there are local date-time values with no valid offset.\n * * Overlap, with two valid offsets. This is when clocks are set back typically\n * due to the autumn daylight savings change from \"summer\" to \"winter\".\n * In an overlap there are local date-time values with two valid offsets.\n *\n * Thus, for any given local date-time there can be zero, one or two valid offsets.\n * This method returns the single offset in the Normal case, and in the Gap or Overlap\n * case it returns the offset before the transition.\n *\n * Since, in the case of Gap and Overlap, the offset returned is a \"best\" value, rather\n * than the \"correct\" value, it should be treated with care. Applications that care\n * about the correct offset should use a combination of this method,\n * {@link getValidOffsets} and {@link getTransition}.\n *\n * @param {LocalDateTime} localDateTime - the local date-time to query, not null, but null\n * may be ignored if the rules have a single offset for all instants\n * @return {ZoneOffset} the best available offset for the local date-time, not null\n */\n // eslint-disable-next-line no-unused-vars\n offsetOfLocalDateTime(localDateTime){\n abstractMethodFail('ZoneRules.offsetLocalDateTime');\n }\n\n /**\n * Gets the offset applicable at the specified local date-time in these rules.\n *\n * The mapping from a local date-time to an offset is not straightforward.\n * There are three cases:\n *\n * * Normal, with one valid offset. For the vast majority of the year, the normal\n * case applies, where there is a single valid offset for the local date-time.\n * * Gap, with zero valid offsets. This is when clocks jump forward typically\n * due to the spring daylight savings change from \"winter\" to \"summer\".\n * In a gap there are local date-time values with no valid offset.\n * * Overlap, with two valid offsets. This is when clocks are set back typically\n * due to the autumn daylight savings change from \"summer\" to \"winter\".\n * In an overlap there are local date-time values with two valid offsets.\n *\n * Thus, for any given local date-time there can be zero, one or two valid offsets.\n * This method returns that list of valid offsets, which is a list of size 0, 1 or 2.\n * In the case where there are two offsets, the earlier offset is returned at index 0\n * and the later offset at index 1.\n *\n * There are various ways to handle the conversion from a {@link LocalDateTime}.\n * One technique, using this method, would be:\n *
\n     *  List validOffsets = rules.getOffset(localDT);\n     *  if (validOffsets.size() == 1) {\n     *    // Normal case: only one valid offset\n     *    zoneOffset = validOffsets.get(0);\n     *  } else {\n     *    // Gap or Overlap: determine what to do from transition (which will be non-null)\n     *    ZoneOffsetTransition trans = rules.getTransition(localDT);\n     *  }\n     * 
\n *\n * In theory, it is possible for there to be more than two valid offsets.\n * This would happen if clocks to be put back more than once in quick succession.\n * This has never happened in the history of time-zones and thus has no special handling.\n * However, if it were to happen, then the list would return more than 2 entries.\n *\n * @param {LocalDateTime} localDateTime - the local date-time to query for valid offsets, not null\n * may be ignored if the rules have a single offset for all instants\n * @return {ZoneOffset[]} the list of valid offsets, may be immutable, not null\n */\n // eslint-disable-next-line no-unused-vars\n validOffsets(localDateTime){\n abstractMethodFail('ZoneRules.validOffsets');\n }\n\n /**\n * Gets the offset transition applicable at the specified local date-time in these rules.\n *\n * The mapping from a local date-time to an offset is not straightforward.\n * There are three cases:\n *\n * * Normal, with one valid offset. For the vast majority of the year, the normal\n * case applies, where there is a single valid offset for the local date-time.\n * * Gap, with zero valid offsets. This is when clocks jump forward typically\n * due to the spring daylight savings change from \"winter\" to \"summer\".\n * In a gap there are local date-time values with no valid offset.\n * * Overlap, with two valid offsets. This is when clocks are set back typically\n * due to the autumn daylight savings change from \"summer\" to \"winter\".\n * In an overlap there are local date-time values with two valid offsets.\n *\n * A transition is used to model the cases of a Gap or Overlap.\n * The Normal case will return null.\n *\n * There are various ways to handle the conversion from a {@link LocalDateTime}.\n * One technique, using this method, would be:\n *
\n     *  ZoneOffsetTransition trans = rules.getTransition(localDT);\n     *  if (trans != null) {\n     *    // Gap or Overlap: determine what to do from transition\n     *  } else {\n     *    // Normal case: only one valid offset\n     *    zoneOffset = rule.getOffset(localDT);\n     *  }\n     * 
\n *\n * @param {LocalDateTime} localDateTime the local date-time to query for offset transition, not null, but null\n * may be ignored if the rules have a single offset for all instants\n * @return {ZoneOffsetTransition} the offset transition, null if the local date-time is not in transition\n */\n // eslint-disable-next-line no-unused-vars\n transition(localDateTime){\n abstractMethodFail('ZoneRules.transition');\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the standard offset for the specified instant in this zone.\n *\n * This provides access to historic information on how the standard offset\n * has changed over time.\n * The standard offset is the offset before any daylight saving time is applied.\n * This is typically the offset applicable during winter.\n *\n * @param {Instant} instant - the instant to find the offset information for, not null, but null\n * may be ignored if the rules have a single offset for all instants\n * @return {ZoneOffset} the standard offset, not null\n */\n // eslint-disable-next-line no-unused-vars\n standardOffset(instant){\n abstractMethodFail('ZoneRules.standardOffset');\n }\n\n /**\n * Gets the amount of daylight savings in use for the specified instant in this zone.\n *\n * This provides access to historic information on how the amount of daylight\n * savings has changed over time.\n * This is the difference between the standard offset and the actual offset.\n * Typically the amount is zero during winter and one hour during summer.\n * Time-zones are second-based, so the nanosecond part of the duration will be zero.\n *\n * @param {Instant} instant - the instant to find the daylight savings for, not null, but null\n * may be ignored if the rules have a single offset for all instants\n * @return {Duration} the difference between the standard and actual offset, not null\n */\n // eslint-disable-next-line no-unused-vars\n daylightSavings(instant){\n abstractMethodFail('ZoneRules.daylightSavings');\n // default {\n // ZoneOffset standardOffset = getStandardOffset(instant);\n // ZoneOffset actualOffset = getOffset(instant);\n // return actualOffset.toDuration().minus(standardOffset.toDuration()).normalized();\n // }\n }\n\n /**\n * Checks if the specified instant is in daylight savings.\n *\n * This checks if the standard and actual offsets are the same at the specified instant.\n *\n * @param {Instant} instant - the instant to find the offset information for, not null, but null\n * may be ignored if the rules have a single offset for all instants\n * @return {boolean} the standard offset, not null\n */\n // eslint-disable-next-line no-unused-vars\n isDaylightSavings(instant) {\n abstractMethodFail('ZoneRules.isDaylightSavings');\n // default {\n // return (getStandardOffset(instant).equals(getOffset(instant)) == false);\n // }\n }\n\n /**\n * Checks if the offset date-time is valid for these rules.\n *\n * To be valid, the local date-time must not be in a gap and the offset\n * must match the valid offsets.\n *\n * @param {LocalDateTime} localDateTime - the date-time to check, not null, but null\n * may be ignored if the rules have a single offset for all instants\n * @param {ZoneOffset} offset - the offset to check, null returns false\n * @return {boolean} true if the offset date-time is valid for these rules\n */\n // eslint-disable-next-line no-unused-vars\n isValidOffset(localDateTime, offset){\n abstractMethodFail('ZoneRules.isValidOffset');\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the next transition after the specified instant.\n *\n * This returns details of the next transition after the specified instant.\n * For example, if the instant represents a point where \"Summer\" daylight savings time\n * applies, then the method will return the transition to the next \"Winter\" time.\n *\n * @param {Instant} instant - the instant to get the next transition after, not null, but null\n * may be ignored if the rules have a single offset for all instants\n * @return {ZoneOffsetTransition} the next transition after the specified instant, null if this is after the last transition\n */\n // eslint-disable-next-line no-unused-vars\n nextTransition(instant){\n abstractMethodFail('ZoneRules.nextTransition');\n }\n\n /**\n * Gets the previous transition before the specified instant.\n *\n * This returns details of the previous transition after the specified instant.\n * For example, if the instant represents a point where \"summer\" daylight saving time\n * applies, then the method will return the transition from the previous \"winter\" time.\n *\n * @param {Instant} instant - the instant to get the previous transition after, not null, but null\n * may be ignored if the rules have a single offset for all instants\n * @return {ZoneOffsetTransition} the previous transition after the specified instant, null if this is before the first transition\n */\n // eslint-disable-next-line no-unused-vars\n previousTransition(instant){\n abstractMethodFail('ZoneRules.previousTransition');\n }\n\n /**\n * Gets the complete list of fully defined transitions.\n *\n * The complete set of transitions for this rules instance is defined by this method\n * and {@link getTransitionRules}. This method returns those transitions that have\n * been fully defined. These are typically historical, but may be in the future.\n *\n * The list will be empty for fixed offset rules and for any time-zone where there has\n * only ever been a single offset. The list will also be empty if the transition rules are unknown.\n *\n * @return {ZoneOffsetTransition[]} an immutable list of fully defined transitions, not null\n */\n transitions(){\n abstractMethodFail('ZoneRules.transitions');\n }\n\n /**\n * Gets the list of transition rules for years beyond those defined in the transition list.\n *\n * The complete set of transitions for this rules instance is defined by this method\n * and {@link getTransitions}. This method returns instances of {@link ZoneOffsetTransitionRule}\n * that define an algorithm for when transitions will occur.\n *\n * For any given {@link ZoneRules}, this list contains the transition rules for years\n * beyond those years that have been fully defined. These rules typically refer to future\n * daylight saving time rule changes.\n *\n * If the zone defines daylight savings into the future, then the list will normally\n * be of size two and hold information about entering and exiting daylight savings.\n * If the zone does not have daylight savings, or information about future changes\n * is uncertain, then the list will be empty.\n *\n * The list will be empty for fixed offset rules and for any time-zone where there is no\n * daylight saving time. The list will also be empty if the transition rules are unknown.\n *\n * @return {ZoneOffsetTransitionRule[]} an immutable list of transition rules, not null\n */\n transitionRules(){\n abstractMethodFail('ZoneRules.transitionRules');\n }\n\n toString(){\n abstractMethodFail('ZoneRules.toString');\n }\n\n /**\n * toJSON() use by JSON.stringify\n * delegates to toString()\n *\n * @return {string}\n */\n toJSON() {\n return this.toString();\n }\n}\n\n\nclass Fixed extends ZoneRules{\n /**\n *\n * @param {ZoneOffset} offset\n * @private\n */\n constructor(offset){\n super();\n this._offset = offset;\n }\n\n isFixedOffset(){\n return true;\n }\n\n offsetOfInstant(){\n return this._offset;\n }\n\n offsetOfEpochMilli(){\n return this._offset;\n }\n\n offsetOfLocalDateTime(){\n return this._offset;\n }\n\n validOffsets(){\n return [this._offset];\n }\n\n transition(){\n return null;\n }\n\n standardOffset(){\n return this._offset;\n }\n\n daylightSavings(){\n return Duration.ZERO;\n }\n\n isDaylightSavings(){\n return false;\n }\n\n /**\n *\n * @param {LocalDateTime} localDateTime\n * @param {ZoneOffset} offset\n * @return {boolean}\n */\n isValidOffset(localDateTime, offset) {\n return this._offset.equals(offset);\n }\n\n nextTransition(){\n return null;\n }\n\n previousTransition(){\n return null;\n }\n\n transitions(){\n return [];\n }\n\n transitionRules(){\n return [];\n }\n\n //-----------------------------------------------------------------------\n /**\n *\n * @param {*} other\n * @returns {boolean}\n */\n equals(other) {\n if (this === other) {\n return true;\n }\n if (other instanceof Fixed) {\n return this._offset.equals(other._offset);\n }\n return false;\n }\n\n /**\n *\n * @returns {string}\n */\n toString() {\n return 'FixedRules:' + this._offset.toString();\n }\n\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {requireNonNull} from './assert';\nimport {DateTimeException} from './errors';\nimport {MathUtil} from './MathUtil';\n\nimport {LocalTime} from './LocalTime';\nimport {ZoneId} from './ZoneId';\n\nimport {ChronoField} from './temporal/ChronoField';\nimport {TemporalQueries} from './temporal/TemporalQueries';\n\nimport {ZoneRules} from './zone/ZoneRules';\n\nconst SECONDS_CACHE = {};\nconst ID_CACHE = {};\n\n/**\n *\n * ### Static properties of Class {@link LocalDate}\n *\n * ZoneOffset.MAX_SECONDS = 18 * LocalTime.SECONDS_PER_HOUR;\n *\n * ZoneOffset.UTC = ZoneOffset.ofTotalSeconds(0);\n *\n * ZoneOffset.MIN = ZoneOffset.ofTotalSeconds(-ZoneOffset.MAX_SECONDS);\n *\n * ZoneOffset.MAX = ZoneOffset.ofTotalSeconds(ZoneOffset.MAX_SECONDS);\n *\n */\nexport class ZoneOffset extends ZoneId {\n /**\n *\n * @param {number} totalSeconds\n * @private\n */\n constructor(totalSeconds){\n super();\n ZoneOffset._validateTotalSeconds(totalSeconds);\n this._totalSeconds = MathUtil.safeToInt(totalSeconds);\n this._rules = ZoneRules.of(this);\n this._id = ZoneOffset._buildId(totalSeconds);\n }\n\n /**\n *\n * @returns {number}\n */\n totalSeconds() {\n return this._totalSeconds;\n }\n\n /**\n *\n * @returns {string}\n */\n id() {\n return this._id;\n }\n\n /**\n *\n * @param {number} totalSeconds\n * @returns {string}\n */\n static _buildId(totalSeconds) {\n if (totalSeconds === 0) {\n return 'Z';\n } else {\n const absTotalSeconds = Math.abs(totalSeconds);\n const absHours = MathUtil.intDiv(absTotalSeconds, LocalTime.SECONDS_PER_HOUR);\n const absMinutes = MathUtil.intMod(MathUtil.intDiv(absTotalSeconds, LocalTime.SECONDS_PER_MINUTE), LocalTime.MINUTES_PER_HOUR);\n let buf = '' + (totalSeconds < 0 ? '-' : '+')\n + (absHours < 10 ? '0' : '') + (absHours)\n + (absMinutes < 10 ? ':0' : ':') + (absMinutes);\n const absSeconds = MathUtil.intMod(absTotalSeconds, LocalTime.SECONDS_PER_MINUTE);\n if (absSeconds !== 0) {\n buf += (absSeconds < 10 ? ':0' : ':') + (absSeconds);\n }\n return buf;\n }\n }\n\n\n /**\n *\n * @param {number} totalSeconds\n * @private\n */\n static _validateTotalSeconds(totalSeconds){\n if (Math.abs(totalSeconds) > ZoneOffset.MAX_SECONDS) {\n throw new DateTimeException('Zone offset not in valid range: -18:00 to +18:00');\n }\n }\n\n /**\n *\n * @param {number} hours\n * @param {number} minutes\n * @param {number} seconds\n * @private\n */\n static _validate(hours, minutes, seconds) {\n if (hours < -18 || hours > 18) {\n throw new DateTimeException('Zone offset hours not in valid range: value ' + hours +\n ' is not in the range -18 to 18');\n }\n if (hours > 0) {\n if (minutes < 0 || seconds < 0) {\n throw new DateTimeException('Zone offset minutes and seconds must be positive because hours is positive');\n }\n } else if (hours < 0) {\n if (minutes > 0 || seconds > 0) {\n throw new DateTimeException('Zone offset minutes and seconds must be negative because hours is negative');\n }\n } else if ((minutes > 0 && seconds < 0) || (minutes < 0 && seconds > 0)) {\n throw new DateTimeException('Zone offset minutes and seconds must have the same sign');\n }\n if (Math.abs(minutes) > 59) {\n throw new DateTimeException('Zone offset minutes not in valid range: abs(value) ' +\n Math.abs(minutes) + ' is not in the range 0 to 59');\n }\n if (Math.abs(seconds) > 59) {\n throw new DateTimeException('Zone offset seconds not in valid range: abs(value) ' +\n Math.abs(seconds) + ' is not in the range 0 to 59');\n }\n if (Math.abs(hours) === 18 && (Math.abs(minutes) > 0 || Math.abs(seconds) > 0)) {\n throw new DateTimeException('Zone offset not in valid range: -18:00 to +18:00');\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link ZoneOffset} using the ID.\n *\n * This method parses the string ID of a {@link ZoneOffset} to\n * return an instance. The parsing accepts all the formats generated by\n * {@link getId}, plus some additional formats:\n *\n * * {@link Z} - for UTC\n * * `+h`\n * * `+hh`\n * * `+hh:mm`\n * * `-hh:mm`\n * * `+hhmm`\n * * `-hhmm`\n * * `+hh:mm:ss`\n * * `-hh:mm:ss`\n * * `+hhmmss`\n * * `-hhmmss`\n *\n * Note that ± means either the plus or minus symbol.\n *\n * The ID of the returned offset will be normalized to one of the formats\n * described by {@link getId}.\n *\n * The maximum supported range is from +18:00 to -18:00 inclusive.\n *\n * @param {string} offsetId the offset ID, not null\n * @return {ZoneOffset} the zone-offset, not null\n * @throws DateTimeException if the offset ID is invalid\n */\n static of(offsetId) {\n requireNonNull(offsetId, 'offsetId');\n // \"Z\" is always in the cache\n const offset = ID_CACHE[offsetId];\n if (offset != null) {\n return offset;\n }\n\n // parse - +h, +hh, +hhmm, +hh:mm, +hhmmss, +hh:mm:ss\n let hours, minutes, seconds;\n switch (offsetId.length) {\n case 2:\n offsetId = offsetId[0] + '0' + offsetId[1]; // fallthru\n // eslint-disable-next-line no-fallthrough\n case 3:\n hours = ZoneOffset._parseNumber(offsetId, 1, false);\n minutes = 0;\n seconds = 0;\n break;\n case 5:\n hours = ZoneOffset._parseNumber(offsetId, 1, false);\n minutes = ZoneOffset._parseNumber(offsetId, 3, false);\n seconds = 0;\n break;\n case 6:\n hours = ZoneOffset._parseNumber(offsetId, 1, false);\n minutes = ZoneOffset._parseNumber(offsetId, 4, true);\n seconds = 0;\n break;\n case 7:\n hours = ZoneOffset._parseNumber(offsetId, 1, false);\n minutes = ZoneOffset._parseNumber(offsetId, 3, false);\n seconds = ZoneOffset._parseNumber(offsetId, 5, false);\n break;\n case 9:\n hours = ZoneOffset._parseNumber(offsetId, 1, false);\n minutes = ZoneOffset._parseNumber(offsetId, 4, true);\n seconds = ZoneOffset._parseNumber(offsetId, 7, true);\n break;\n default:\n throw new DateTimeException('Invalid ID for ZoneOffset, invalid format: ' + offsetId);\n }\n const first = offsetId[0];\n if (first !== '+' && first !== '-') {\n throw new DateTimeException('Invalid ID for ZoneOffset, plus/minus not found when expected: ' + offsetId);\n }\n if (first === '-') {\n return ZoneOffset.ofHoursMinutesSeconds(-hours, -minutes, -seconds);\n } else {\n return ZoneOffset.ofHoursMinutesSeconds(hours, minutes, seconds);\n }\n }\n\n /**\n * Parse a two digit zero-prefixed number.\n *\n * @param {string} offsetId - the offset ID, not null\n * @param {number} pos - the position to parse, valid\n * @param {boolean} precededByColon - should this number be prefixed by a precededByColon\n * @return {number} the parsed number, from 0 to 99\n */\n static _parseNumber(offsetId, pos, precededByColon) {\n if (precededByColon && offsetId[pos - 1] !== ':') {\n throw new DateTimeException('Invalid ID for ZoneOffset, colon not found when expected: ' + offsetId);\n }\n const ch1 = offsetId[pos];\n const ch2 = offsetId[pos + 1];\n if (ch1 < '0' || ch1 > '9' || ch2 < '0' || ch2 > '9') {\n throw new DateTimeException('Invalid ID for ZoneOffset, non numeric characters found: ' + offsetId);\n }\n return (ch1.charCodeAt(0) - 48) * 10 + (ch2.charCodeAt(0) - 48);\n }\n\n /**\n *\n * @param {number} hours\n * @returns {ZoneOffset}\n */\n static ofHours(hours) {\n return ZoneOffset.ofHoursMinutesSeconds(hours, 0, 0);\n }\n\n /**\n *\n * @param {number} hours\n * @param {number} minutes\n * @returns {ZoneOffset}\n */\n static ofHoursMinutes(hours, minutes) {\n return ZoneOffset.ofHoursMinutesSeconds(hours, minutes, 0);\n }\n\n /**\n *\n * @param {number} hours\n * @param {number} minutes\n * @param {number} seconds\n * @returns {ZoneOffset}\n */\n static ofHoursMinutesSeconds(hours, minutes, seconds) {\n ZoneOffset._validate(hours, minutes, seconds);\n const totalSeconds = hours * LocalTime.SECONDS_PER_HOUR + minutes * LocalTime.SECONDS_PER_MINUTE + seconds;\n return ZoneOffset.ofTotalSeconds(totalSeconds);\n }\n\n /**\n *\n * @param {number} totalMinutes\n * @returns {ZoneOffset}\n */\n static ofTotalMinutes(totalMinutes) {\n const totalSeconds = totalMinutes * LocalTime.SECONDS_PER_MINUTE;\n return ZoneOffset.ofTotalSeconds(totalSeconds);\n }\n\n /**\n *\n * @param {number} totalSeconds\n * @returns {ZoneOffset}\n */\n static ofTotalSeconds(totalSeconds) {\n if (totalSeconds % (15 * LocalTime.SECONDS_PER_MINUTE) === 0) {\n const totalSecs = totalSeconds;\n let result = SECONDS_CACHE[totalSecs];\n if (result == null) {\n result = new ZoneOffset(totalSeconds);\n SECONDS_CACHE[totalSecs] = result;\n ID_CACHE[result.id()] = result;\n }\n return result;\n } else {\n return new ZoneOffset(totalSeconds);\n }\n }\n\n /**\n * Gets the associated time-zone rules.\n *\n * The rules will always return this offset when queried.\n * The implementation class is immutable, thread-safe and serializable.\n *\n * @return {ZoneRules} the rules, not null\n */\n rules() {\n return this._rules;\n }\n\n /**\n * Gets the value of the specified field from this offset as an `int`.\n *\n * This queries this offset for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link OFFSET_SECONDS} field returns the value of the offset.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws DateTimeException if a value for the field cannot be obtained\n * @throws ArithmeticException if numeric overflow occurs\n */\n get(field) {\n return this.getLong(field);\n }\n\n /**\n * Gets the value of the specified field from this offset as a `long`.\n *\n * This queries this offset for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link OFFSET_SECONDS} field returns the value of the offset.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws DateTimeException if a value for the field cannot be obtained\n * @throws ArithmeticException if numeric overflow occurs\n */\n getLong(field) {\n if (field === ChronoField.OFFSET_SECONDS) {\n return this._totalSeconds;\n } else if (field instanceof ChronoField) {\n throw new DateTimeException('Unsupported field: ' + field);\n }\n return field.getFrom(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this offset using the specified query.\n *\n * This queries this offset using the specified query strategy object.\n * The {@link TemporalQuery} object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n *\n * The result of this method is obtained by invoking the\n * {@link TemporalQuery#queryFrom} method on the\n * specified query passing `this` as the argument.\n *\n * @param {TemporalQuery} query - the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws DateTimeException if unable to query (defined by the query)\n * @throws ArithmeticException if numeric overflow occurs (defined by the query)\n */\n query(query) {\n requireNonNull(query, 'query');\n if (query === TemporalQueries.offset() || query === TemporalQueries.zone()) {\n return this;\n } else if (query === TemporalQueries.localDate() || query === TemporalQueries.localTime() ||\n query === TemporalQueries.precision() || query === TemporalQueries.chronology() || query === TemporalQueries.zoneId()) {\n return null;\n }\n return query.queryFrom(this);\n }\n\n /**\n * Adjusts the specified temporal object to have the same offset as this object.\n *\n * This returns a temporal object of the same observable type as the input\n * with the offset changed to be the same as this.\n *\n * The adjustment is equivalent to using {@link Temporal#with}\n * passing {@link ChronoField#OFFSET_SECONDS} as the field.\n *\n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal#with}:\n *
\n      *   // these two lines are equivalent, but the second approach is recommended\n      *   temporal = thisOffset.adjustInto(temporal);\n      *   temporal = temporal.with(thisOffset);\n      * 
\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal - the target object to be adjusted, not null\n * @return {Temporal} the adjusted object, not null\n * @throws DateTimeException if unable to make the adjustment\n * @throws ArithmeticException if numeric overflow occurs\n */\n adjustInto(temporal) {\n return temporal.with(ChronoField.OFFSET_SECONDS, this._totalSeconds);\n }\n\n /**\n * Compares this offset to another offset in descending order.\n *\n * The offsets are compared in the order that they occur for the same time\n * of day around the world. Thus, an offset of `+10:00` comes before an\n * offset of `+09:00` and so on down to `-18:00`.\n *\n * The comparison is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * @param {!ZoneOffset} other - the other date to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n * @throws NullPointerException if {@link other} is null\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n return other._totalSeconds - this._totalSeconds;\n }\n\n\n /**\n * Checks if this offset is equal to another offset.\n *\n * The comparison is based on the amount of the offset in seconds.\n * This is equivalent to a comparison by ID.\n *\n * @param {*} obj - the object to check, null returns false\n * @return {boolean} true if this is equal to the other offset\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof ZoneOffset) {\n return this._totalSeconds === obj._totalSeconds;\n }\n return false;\n }\n\n /**\n * @return {number}\n */\n hashCode(){\n return this._totalSeconds;\n }\n\n /**\n *\n * @returns {string}\n */\n toString(){\n return this._id;\n }\n}\n\nexport function _init() {\n ZoneOffset.MAX_SECONDS = 18 * LocalTime.SECONDS_PER_HOUR;\n ZoneOffset.UTC = ZoneOffset.ofTotalSeconds(0);\n ZoneOffset.MIN = ZoneOffset.ofTotalSeconds(-ZoneOffset.MAX_SECONDS);\n ZoneOffset.MAX = ZoneOffset.ofTotalSeconds(ZoneOffset.MAX_SECONDS);\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {requireNonNull} from '../assert';\nimport {DateTimeException} from '../errors';\nimport {MathUtil} from '../MathUtil';\n\nimport {EnumMap} from './EnumMap';\nimport {ResolverStyle} from './ResolverStyle';\n\nimport {IsoChronology} from '../chrono/IsoChronology';\nimport {ChronoLocalDate} from '../chrono/ChronoLocalDate';\nimport {ChronoField} from '../temporal/ChronoField';\nimport {TemporalAccessor} from '../temporal/TemporalAccessor';\nimport {TemporalQueries} from '../temporal/TemporalQueries';\n\nimport {LocalTime} from '../LocalTime';\nimport {LocalDate} from '../LocalDate';\nimport {Period} from '../Period';\n\nimport {ZoneOffset} from '../ZoneOffset';\n\n/**\n * Builder that can holds date and time fields and related date and time objects.\n *\n * The builder is used to hold onto different elements of date and time.\n * It is designed as two separate maps:\n *\n * * from {@link TemporalField} to `long` value, where the value may be\n * outside the valid range for the field\n * * from {@link Class} to {@link TemporalAccessor}, holding larger scale objects\n * like {@link LocalDateTime}.\n *\n * @private\n */\nexport class DateTimeBuilder extends TemporalAccessor {\n\n /**\n * Creates a new instance of the builder with a single field-value.\n *\n * This is equivalent to using {@link addFieldValue} on an empty builder.\n *\n * @param {TemporalField} field - the field to add, not null\n * @param {number} value - the value to add, not null\n * @return {DateTimeBuilder}\n */\n static create(field, value) {\n const dtb = new DateTimeBuilder();\n dtb._addFieldValue(field, value);\n return dtb;\n }\n\n\n constructor(){\n super();\n\n /**\n * The map of other fields.\n */\n this.fieldValues = new EnumMap();\n /**\n * The chronology.\n */\n this.chrono = null;\n /**\n * The zone.\n */\n this.zone = null;\n /**\n * The date.\n */\n this.date = null;\n /**\n * The time.\n */\n this.time = null;\n /**\n * The leap second flag.\n */\n this.leapSecond = false;\n /**\n * The excess days.\n */\n this.excessDays = null;\n }\n\n /**\n *\n * @param {TemporalField} field\n * @return {Number} field value\n */\n getFieldValue0(field) {\n return this.fieldValues.get(field);\n }\n\n /**\n * Adds a field-value pair to the builder.\n *\n * This adds a field to the builder.\n * If the field is not already present, then the field-value pair is added to the map.\n * If the field is already present and it has the same value as that specified, no action occurs.\n * If the field is already present and it has a different value to that specified, then\n * an exception is thrown.\n *\n * @param {TemporalField} field - the field to add, not null\n * @param {Number} value - the value to add, not null\n * @return {DateTimeBuilder}, this for method chaining\n * @throws DateTimeException if the field is already present with a different value\n */\n _addFieldValue(field, value) {\n requireNonNull(field, 'field');\n const old = this.getFieldValue0(field); // check first for better error message\n if (old != null && old !== value) {\n throw new DateTimeException('Conflict found: ' + field + ' ' + old + ' differs from ' + field + ' ' + value + ': ' + this);\n }\n return this._putFieldValue0(field, value);\n }\n\n /**\n * @param {TemporalField} field\n * @param {Number} value\n * @return {DateTimeBuilder}, this for method chaining\n */\n _putFieldValue0(field, value) {\n this.fieldValues.put(field, value);\n return this;\n }\n\n /**\n * Resolves the builder, evaluating the date and time.\n *\n * This examines the contents of the build.er and resolves it to produce the best\n * available date and time, throwing an exception if a problem occurs.\n * Calling this method changes the state of the builder.\n *\n * @param {ResolverStyle} resolverStyle - how to resolve\n * @param {TemporalField[]} resolverFields\n * @return {DateTimeBuilder} this, for method chaining\n */\n resolve(resolverStyle, resolverFields) {\n if (resolverFields != null) {\n this.fieldValues.retainAll(resolverFields);\n }\n // handle standard fields\n // this._mergeInstantFields();\n this._mergeDate(resolverStyle);\n this._mergeTime(resolverStyle);\n //if (resolveFields(resolverStyle)) {\n // mergeInstantFields();\n // mergeDate(resolverStyle);\n // mergeTime(resolverStyle);\n //}\n this._resolveTimeInferZeroes(resolverStyle);\n //this._crossCheck();\n if (this.excessDays != null && this.excessDays.isZero() === false && this.date != null && this.time != null) {\n this.date = this.date.plus(this.excessDays);\n this.excessDays = Period.ZERO;\n }\n //resolveFractional();\n this._resolveInstant();\n return this;\n }\n\n /**\n *\n * @param {ResolverStyle} resolverStyle\n * @private\n */\n _mergeDate(resolverStyle) {\n //if (this.chrono instanceof IsoChronology) {\n this._checkDate(IsoChronology.INSTANCE.resolveDate(this.fieldValues, resolverStyle));\n //} else {\n // if (this.fieldValues.containsKey(ChronoField.EPOCH_DAY)) {\n // this._checkDate(LocalDate.ofEpochDay(this.fieldValues.remove(ChronoField.EPOCH_DAY)));\n // return;\n // }\n //}\n }\n\n /**\n *\n * @param {LocalDate} date\n * @private\n */\n _checkDate(date) {\n if (date != null) {\n this._addObject(date);\n for (const fieldName in this.fieldValues.keySet()) {\n const field = ChronoField.byName(fieldName);\n if (field) {\n if (this.fieldValues.get(field) !== undefined) { // undefined if \"removed\" in EnumMap\n if (field.isDateBased()) {\n let val1;\n try {\n val1 = date.getLong(field);\n } catch (ex) {\n if (ex instanceof DateTimeException) {\n continue;\n } else {\n throw ex;\n }\n }\n const val2 = this.fieldValues.get(field);\n if (val1 !== val2) {\n throw new DateTimeException('Conflict found: Field ' + field + ' ' + val1 + ' differs from ' + field + ' ' + val2 + ' derived from ' + date);\n }\n }\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {ResolverStyle} resolverStyle\n * @private\n */\n _mergeTime(resolverStyle) {\n if (this.fieldValues.containsKey(ChronoField.CLOCK_HOUR_OF_DAY)) {\n const ch = this.fieldValues.remove(ChronoField.CLOCK_HOUR_OF_DAY);\n if (resolverStyle !== ResolverStyle.LENIENT) {\n if (resolverStyle === ResolverStyle.SMART && ch === 0) {\n // ok\n } else {\n ChronoField.CLOCK_HOUR_OF_DAY.checkValidValue(ch);\n }\n }\n this._addFieldValue(ChronoField.HOUR_OF_DAY, ch === 24 ? 0 : ch);\n }\n if (this.fieldValues.containsKey(ChronoField.CLOCK_HOUR_OF_AMPM)) {\n const ch = this.fieldValues.remove(ChronoField.CLOCK_HOUR_OF_AMPM);\n if (resolverStyle !== ResolverStyle.LENIENT) {\n if (resolverStyle === ResolverStyle.SMART && ch === 0) {\n // ok\n } else {\n ChronoField.CLOCK_HOUR_OF_AMPM.checkValidValue(ch);\n }\n }\n this._addFieldValue(ChronoField.HOUR_OF_AMPM, ch === 12 ? 0 : ch);\n }\n if (resolverStyle !== ResolverStyle.LENIENT) {\n if (this.fieldValues.containsKey(ChronoField.AMPM_OF_DAY)) {\n ChronoField.AMPM_OF_DAY.checkValidValue(this.fieldValues.get(ChronoField.AMPM_OF_DAY));\n }\n if (this.fieldValues.containsKey(ChronoField.HOUR_OF_AMPM)) {\n ChronoField.HOUR_OF_AMPM.checkValidValue(this.fieldValues.get(ChronoField.HOUR_OF_AMPM));\n }\n }\n if (this.fieldValues.containsKey(ChronoField.AMPM_OF_DAY) && this.fieldValues.containsKey(ChronoField.HOUR_OF_AMPM)) {\n const ap = this.fieldValues.remove(ChronoField.AMPM_OF_DAY);\n const hap = this.fieldValues.remove(ChronoField.HOUR_OF_AMPM);\n this._addFieldValue(ChronoField.HOUR_OF_DAY, ap * 12 + hap);\n }\n // if (timeFields.containsKey(HOUR_OF_DAY) && timeFields.containsKey(MINUTE_OF_HOUR)) {\n // const hod = timeFields.remove(HOUR_OF_DAY);\n // const moh = timeFields.remove(MINUTE_OF_HOUR);\n // this._addFieldValue(MINUTE_OF_DAY, hod * 60 + moh);\n // }\n // if (timeFields.containsKey(MINUTE_OF_DAY) && timeFields.containsKey(SECOND_OF_MINUTE)) {\n // const mod = timeFields.remove(MINUTE_OF_DAY);\n // const som = timeFields.remove(SECOND_OF_MINUTE);\n // this._addFieldValue(SECOND_OF_DAY, mod * 60 + som);\n // }\n if (this.fieldValues.containsKey(ChronoField.NANO_OF_DAY)) {\n const nod = this.fieldValues.remove(ChronoField.NANO_OF_DAY);\n if (resolverStyle !== ResolverStyle.LENIENT) {\n ChronoField.NANO_OF_DAY.checkValidValue(nod);\n }\n this._addFieldValue(ChronoField.SECOND_OF_DAY, MathUtil.intDiv(nod, 1000000000));\n this._addFieldValue(ChronoField.NANO_OF_SECOND, MathUtil.intMod(nod, 1000000000));\n }\n if (this.fieldValues.containsKey(ChronoField.MICRO_OF_DAY)) {\n const cod = this.fieldValues.remove(ChronoField.MICRO_OF_DAY);\n if (resolverStyle !== ResolverStyle.LENIENT) {\n ChronoField.MICRO_OF_DAY.checkValidValue(cod);\n }\n this._addFieldValue(ChronoField.SECOND_OF_DAY, MathUtil.intDiv(cod, 1000000));\n this._addFieldValue(ChronoField.MICRO_OF_SECOND, MathUtil.intMod(cod, 1000000));\n }\n if (this.fieldValues.containsKey(ChronoField.MILLI_OF_DAY)) {\n const lod = this.fieldValues.remove(ChronoField.MILLI_OF_DAY);\n if (resolverStyle !== ResolverStyle.LENIENT) {\n ChronoField.MILLI_OF_DAY.checkValidValue(lod);\n }\n this._addFieldValue(ChronoField.SECOND_OF_DAY, MathUtil.intDiv(lod, 1000));\n this._addFieldValue(ChronoField.MILLI_OF_SECOND, MathUtil.intMod(lod, 1000));\n }\n if (this.fieldValues.containsKey(ChronoField.SECOND_OF_DAY)) {\n const sod = this.fieldValues.remove(ChronoField.SECOND_OF_DAY);\n if (resolverStyle !== ResolverStyle.LENIENT) {\n ChronoField.SECOND_OF_DAY.checkValidValue(sod);\n }\n this._addFieldValue(ChronoField.HOUR_OF_DAY, MathUtil.intDiv(sod, 3600));\n this._addFieldValue(ChronoField.MINUTE_OF_HOUR, MathUtil.intMod(MathUtil.intDiv(sod, 60), 60));\n this._addFieldValue(ChronoField.SECOND_OF_MINUTE, MathUtil.intMod(sod, 60));\n }\n if (this.fieldValues.containsKey(ChronoField.MINUTE_OF_DAY)) {\n const mod = this.fieldValues.remove(ChronoField.MINUTE_OF_DAY);\n if (resolverStyle !== ResolverStyle.LENIENT) {\n ChronoField.MINUTE_OF_DAY.checkValidValue(mod);\n }\n this._addFieldValue(ChronoField.HOUR_OF_DAY, MathUtil.intDiv(mod, 60));\n this._addFieldValue(ChronoField.MINUTE_OF_HOUR, MathUtil.intMod(mod, 60));\n }\n\n // const sod = MathUtil.intDiv(nod, 1000000000L);\n // this._addFieldValue(HOUR_OF_DAY, MathUtil.intDiv(sod, 3600));\n // this._addFieldValue(MINUTE_OF_HOUR, MathUtil.intMod(MathUtil.intDiv(sod, 60), 60));\n // this._addFieldValue(SECOND_OF_MINUTE, MathUtil.intMod(sod, 60));\n // this._addFieldValue(NANO_OF_SECOND, MathUtil.intMod(nod, 1000000000L));\n if (resolverStyle !== ResolverStyle.LENIENT) {\n if (this.fieldValues.containsKey(ChronoField.MILLI_OF_SECOND)) {\n ChronoField.MILLI_OF_SECOND.checkValidValue(this.fieldValues.get(ChronoField.MILLI_OF_SECOND));\n }\n if (this.fieldValues.containsKey(ChronoField.MICRO_OF_SECOND)) {\n ChronoField.MICRO_OF_SECOND.checkValidValue(this.fieldValues.get(ChronoField.MICRO_OF_SECOND));\n }\n }\n if (this.fieldValues.containsKey(ChronoField.MILLI_OF_SECOND) && this.fieldValues.containsKey(ChronoField.MICRO_OF_SECOND)) {\n const los = this.fieldValues.remove(ChronoField.MILLI_OF_SECOND);\n const cos = this.fieldValues.get(ChronoField.MICRO_OF_SECOND);\n this._putFieldValue0(ChronoField.MICRO_OF_SECOND, los * 1000 + (MathUtil.intMod(cos, 1000)));\n }\n if (this.fieldValues.containsKey(ChronoField.MICRO_OF_SECOND) && this.fieldValues.containsKey(ChronoField.NANO_OF_SECOND)) {\n const nos = this.fieldValues.get(ChronoField.NANO_OF_SECOND);\n this._putFieldValue0(ChronoField.MICRO_OF_SECOND, MathUtil.intDiv(nos, 1000));\n this.fieldValues.remove(ChronoField.MICRO_OF_SECOND);\n }\n if (this.fieldValues.containsKey(ChronoField.MILLI_OF_SECOND) && this.fieldValues.containsKey(ChronoField.NANO_OF_SECOND)) {\n const nos = this.fieldValues.get(ChronoField.NANO_OF_SECOND);\n this._putFieldValue0(ChronoField.MILLI_OF_SECOND, MathUtil.intDiv(nos, 1000000));\n this.fieldValues.remove(ChronoField.MILLI_OF_SECOND);\n }\n if (this.fieldValues.containsKey(ChronoField.MICRO_OF_SECOND)) {\n const cos = this.fieldValues.remove(ChronoField.MICRO_OF_SECOND);\n this._putFieldValue0(ChronoField.NANO_OF_SECOND, cos * 1000);\n } else if (this.fieldValues.containsKey(ChronoField.MILLI_OF_SECOND)) {\n const los = this.fieldValues.remove(ChronoField.MILLI_OF_SECOND);\n this._putFieldValue0(ChronoField.NANO_OF_SECOND, los * 1000000);\n }\n }\n\n /**\n *\n * @param {ResolverStyle} resolverStyle\n * @private\n */\n _resolveTimeInferZeroes(resolverStyle) {\n let hod = this.fieldValues.get(ChronoField.HOUR_OF_DAY);\n const moh = this.fieldValues.get(ChronoField.MINUTE_OF_HOUR);\n const som = this.fieldValues.get(ChronoField.SECOND_OF_MINUTE);\n let nos = this.fieldValues.get(ChronoField.NANO_OF_SECOND);\n if (hod == null) {\n return;\n }\n if (moh == null && (som != null || nos != null)) {\n return;\n }\n if (moh != null && som == null && nos != null) {\n return;\n }\n if (resolverStyle !== ResolverStyle.LENIENT) {\n if (hod != null) {\n if (resolverStyle === ResolverStyle.SMART &&\n hod === 24 &&\n (moh == null || moh === 0) &&\n (som == null || som === 0) &&\n (nos == null || nos === 0)) {\n hod = 0;\n this.excessDays = Period.ofDays(1);\n }\n const hodVal = ChronoField.HOUR_OF_DAY.checkValidIntValue(hod);\n if (moh != null) {\n const mohVal = ChronoField.MINUTE_OF_HOUR.checkValidIntValue(moh);\n if (som != null) {\n const somVal = ChronoField.SECOND_OF_MINUTE.checkValidIntValue(som);\n if (nos != null) {\n const nosVal = ChronoField.NANO_OF_SECOND.checkValidIntValue(nos);\n this._addObject(LocalTime.of(hodVal, mohVal, somVal, nosVal));\n } else {\n this._addObject(LocalTime.of(hodVal, mohVal, somVal));\n }\n } else {\n if (nos == null) {\n this._addObject(LocalTime.of(hodVal, mohVal));\n }\n }\n } else {\n if (som == null && nos == null) {\n this._addObject(LocalTime.of(hodVal, 0));\n }\n }\n }\n } else {\n if (hod != null) {\n let hodVal = hod;\n if (moh != null) {\n if (som != null) {\n if (nos == null) {\n nos = 0;\n }\n let totalNanos = MathUtil.safeMultiply(hodVal, 3600000000000);\n totalNanos = MathUtil.safeAdd(totalNanos, MathUtil.safeMultiply(moh, 60000000000));\n totalNanos = MathUtil.safeAdd(totalNanos, MathUtil.safeMultiply(som, 1000000000));\n totalNanos = MathUtil.safeAdd(totalNanos, nos);\n const excessDays = MathUtil.floorDiv(totalNanos, 86400000000000); // safe int cast\n const nod = MathUtil.floorMod(totalNanos, 86400000000000);\n this._addObject(LocalTime.ofNanoOfDay(nod));\n this.excessDays = Period.ofDays(excessDays);\n } else {\n let totalSecs = MathUtil.safeMultiply(hodVal, 3600);\n totalSecs = MathUtil.safeAdd(totalSecs, MathUtil.safeMultiply(moh, 60));\n const excessDays = MathUtil.floorDiv(totalSecs, 86400); // safe int cast\n const sod = MathUtil.floorMod(totalSecs, 86400);\n this._addObject(LocalTime.ofSecondOfDay(sod));\n this.excessDays = Period.ofDays(excessDays);\n }\n } else {\n const excessDays = MathUtil.safeToInt(MathUtil.floorDiv(hodVal, 24));\n hodVal = MathUtil.floorMod(hodVal, 24);\n this._addObject(LocalTime.of(hodVal, 0));\n this.excessDays = Period.ofDays(excessDays);\n }\n }\n }\n this.fieldValues.remove(ChronoField.HOUR_OF_DAY);\n this.fieldValues.remove(ChronoField.MINUTE_OF_HOUR);\n this.fieldValues.remove(ChronoField.SECOND_OF_MINUTE);\n this.fieldValues.remove(ChronoField.NANO_OF_SECOND);\n }\n\n /**\n *\n * @param {ChronoLocalDate|LocalTime} dateOrTime\n * @private\n */\n _addObject(dateOrTime) {\n if (dateOrTime instanceof ChronoLocalDate){\n this.date = dateOrTime;\n } else if (dateOrTime instanceof LocalTime){\n this.time = dateOrTime;\n }\n }\n\n _resolveInstant() {\n if (this.date != null && this.time != null) {\n const offsetSecs = this.fieldValues.get(ChronoField.OFFSET_SECONDS);\n if (offsetSecs != null) {\n const offset = ZoneOffset.ofTotalSeconds(offsetSecs);\n const instant = this.date.atTime(this.time).atZone(offset).getLong(ChronoField.INSTANT_SECONDS);\n this.fieldValues.put(ChronoField.INSTANT_SECONDS, instant);\n } else if (this.zone != null) {\n const instant = this.date.atTime(this.time).atZone(this.zone).getLong(ChronoField.INSTANT_SECONDS);\n this.fieldValues.put(ChronoField.INSTANT_SECONDS, instant);\n }\n }\n }\n\n /**\n * Builds the specified type from the values in this builder.\n *\n * This attempts to build the specified type from this builder.\n * If the builder cannot return the type, an exception is thrown.\n *\n * @param {!TemporalQuery} type - the type to invoke `from` on, not null\n * @return {*} the extracted value, not null\n * @throws DateTimeException if an error occurs\n */\n build(type) {\n return type.queryFrom(this);\n }\n\n /**\n *\n * @param {TemporalField} field\n * @returns {number}\n */\n isSupported(field) {\n if (field == null) {\n return false;\n }\n return (this.fieldValues.containsKey(field) && this.fieldValues.get(field) !== undefined) ||\n (this.date != null && this.date.isSupported(field)) ||\n (this.time != null && this.time.isSupported(field));\n }\n\n /**\n *\n * @param {TemporalField} field\n * @returns {number}\n */\n getLong(field) {\n requireNonNull(field, 'field');\n const value = this.getFieldValue0(field);\n if (value == null) {\n if (this.date != null && this.date.isSupported(field)) {\n return this.date.getLong(field);\n }\n if (this.time != null && this.time.isSupported(field)) {\n return this.time.getLong(field);\n }\n throw new DateTimeException('Field not found: ' + field);\n }\n return value;\n }\n\n /**\n *\n * @param {!TemporalQuery} query\n * @returns {*}\n */\n query(query) {\n if (query === TemporalQueries.zoneId()) {\n return this.zone;\n } else if (query === TemporalQueries.chronology()) {\n return this.chrono;\n } else if (query === TemporalQueries.localDate()) {\n return this.date != null ? LocalDate.from(this.date) : null;\n } else if (query === TemporalQueries.localTime()) {\n return this.time;\n } else if (query === TemporalQueries.zone() || query === TemporalQueries.offset()) {\n return query.queryFrom(this);\n } else if (query === TemporalQueries.precision()) {\n return null; // not a complete date/time\n }\n // inline TemporalAccessor.super.query(query) as an optimization\n // non-JDK classes are not permitted to make this optimization\n return query.queryFrom(this);\n }\n\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {assert, requireNonNull} from '../assert';\n\nimport {DateTimeBuilder} from './DateTimeBuilder';\nimport {EnumMap} from './EnumMap';\n\nimport {IsoChronology} from '../chrono/IsoChronology';\nimport {Temporal} from '../temporal/Temporal';\nimport {TemporalQueries} from '../temporal/TemporalQueries';\n\n/**\n * @private\n */\nexport class DateTimeParseContext{\n\n constructor(){\n if(arguments.length === 1){\n if(arguments[0] instanceof DateTimeParseContext){\n this._constructorSelf.apply(this, arguments);\n return;\n } else {\n this._constructorFormatter.apply(this, arguments);\n }\n } else {\n this._constructorParam.apply(this, arguments);\n }\n\n this._caseSensitive = true;\n this._strict = true;\n this._parsed = [new Parsed(this)];\n }\n\n _constructorParam(locale, symbols, chronology){\n this._locale = locale;\n this._symbols = symbols;\n this._overrideChronology = chronology;\n }\n\n _constructorFormatter(formatter){\n this._locale = formatter.locale();\n this._symbols = formatter.decimalStyle();\n this._overrideChronology = formatter.chronology();\n }\n\n\n _constructorSelf(other) {\n this._locale = other._locale;\n this._symbols = other._symbols;\n this._overrideChronology = other._overrideChronology;\n this._overrideZone = other._overrideZone;\n this._caseSensitive = other._caseSensitive;\n this._strict = other._strict;\n this._parsed = [new Parsed(this)];\n }\n\n /**\n * Creates a copy of this context.\n */\n copy() {\n return new DateTimeParseContext(this);\n }\n\n symbols(){\n return this._symbols;\n }\n\n isStrict(){\n return this._strict;\n }\n\n setStrict(strict){\n this._strict = strict;\n }\n\n locale() {\n return this._locale;\n }\n\n setLocale(locale) {\n this._locale = locale;\n }\n //-----------------------------------------------------------------------\n /**\n * Starts the parsing of an optional segment of the input.\n */\n startOptional() {\n this._parsed.push(this.currentParsed().copy());\n }\n\n /**\n * Ends the parsing of an optional segment of the input.\n *\n * @param {boolean} successful whether the optional segment was successfully parsed\n */\n endOptional(successful) {\n if (successful) {\n this._parsed.splice(this._parsed.length - 2, 1);\n } else {\n this._parsed.splice(this._parsed.length - 1, 1);\n }\n }\n\n /**\n * Checks if parsing is case sensitive.\n *\n * @return true if parsing is case sensitive, false if case insensitive\n */\n isCaseSensitive() {\n return this._caseSensitive;\n }\n\n /**\n * Sets whether the parsing is case sensitive or not.\n *\n * @param caseSensitive changes the parsing to be case sensitive or not from now on\n */\n setCaseSensitive(caseSensitive) {\n this._caseSensitive = caseSensitive;\n }\n\n /**\n * Helper to compare two {@link CharSequence} instances.\n * This uses {@link isCaseSensitive}.\n *\n * @param cs1 the first character sequence, not null\n * @param offset1 the offset into the first sequence, valid\n * @param cs2 the second character sequence, not null\n * @param offset2 the offset into the second sequence, valid\n * @param length the length to check, valid\n * @return true if equal\n */\n subSequenceEquals(cs1, offset1, cs2, offset2, length) {\n if (offset1 + length > cs1.length || offset2 + length > cs2.length) {\n return false;\n }\n if (! this.isCaseSensitive()) {\n cs1 = cs1.toLowerCase();\n cs2 = cs2.toLowerCase();\n }\n for (let i = 0; i < length; i++) {\n const ch1 = cs1[offset1 + i];\n const ch2 = cs2[offset2 + i];\n if (ch1 !== ch2) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Helper to compare two `char`.\n * This uses {@link isCaseSensitive}.\n *\n * @param ch1 the first character\n * @param ch2 the second character\n * @return true if equal\n */\n charEquals(ch1, ch2) {\n if (this.isCaseSensitive()) {\n return ch1 === ch2;\n }\n return this.charEqualsIgnoreCase(ch1, ch2);\n }\n\n /**\n * Compares two characters ignoring case.\n *\n * @param c1 the first\n * @param c2 the second\n * @return true if equal\n */\n charEqualsIgnoreCase(c1, c2) {\n return c1 === c2 ||\n c1.toLowerCase() === c2.toLowerCase();\n }\n\n setParsedField(field, value, errorPos, successPos){\n const currentParsedFieldValues = this.currentParsed().fieldValues;\n const old = currentParsedFieldValues.get(field);\n currentParsedFieldValues.set(field, value);\n return (old != null && old !== value) ? ~errorPos : successPos;\n }\n\n /**\n * Stores the parsed zone.\n *\n * This stores the zone that has been parsed.\n * No validation is performed other than ensuring it is not null.\n *\n * @param {ZoneId} zone the parsed zone, not null\n */\n setParsedZone(zone) {\n requireNonNull(zone, 'zone');\n this.currentParsed().zone = zone;\n }\n\n getParsed(field) {\n return this.currentParsed().fieldValues.get(field);\n }\n\n toParsed() {\n return this.currentParsed();\n }\n\n currentParsed() {\n return this._parsed[this._parsed.length - 1];\n }\n\n /**\n * Stores the leap second.\n */\n setParsedLeapSecond() {\n this.currentParsed().leapSecond = true;\n }\n\n /**\n * Gets the effective chronology during parsing.\n *\n * @return the effective parsing chronology, not null\n */\n getEffectiveChronology() {\n let chrono = this.currentParsed().chrono;\n if (chrono == null) {\n chrono = this._overrideChronology;\n if (chrono == null) {\n chrono = IsoChronology.INSTANCE;\n }\n }\n return chrono;\n }\n\n\n}\n\nclass Parsed extends Temporal {\n constructor(dateTimeParseContext){\n super();\n this.chrono = null;\n this.zone = null;\n this.fieldValues = new EnumMap();\n this.leapSecond = false;\n this.dateTimeParseContext = dateTimeParseContext;\n }\n\n copy() {\n const cloned = new Parsed();\n cloned.chrono = this.chrono;\n cloned.zone = this.zone;\n cloned.fieldValues.putAll(this.fieldValues);\n cloned.leapSecond = this.leapSecond;\n cloned.dateTimeParseContext = this.dateTimeParseContext;\n return cloned;\n }\n\n toString() {\n return `${this.fieldValues}, ${this.chrono}, ${this.zone}`;\n }\n\n isSupported(field) {\n return this.fieldValues.containsKey(field);\n }\n\n get(field) {\n const val = this.fieldValues.get(field);\n assert(val != null);\n return val;\n }\n\n query(query) {\n if (query === TemporalQueries.chronology()) {\n return this.chrono;\n }\n if (query === TemporalQueries.zoneId() || query === TemporalQueries.zone()) {\n return this.zone;\n }\n return super.query(query);\n }\n\n toBuilder() {\n const builder = new DateTimeBuilder();\n builder.fieldValues.putAll(this.fieldValues);\n builder.chrono = this.dateTimeParseContext.getEffectiveChronology();\n if (this.zone != null) {\n builder.zone = this.zone;\n } else {\n builder.zone = this.overrideZone;\n }\n builder.leapSecond = this.leapSecond;\n builder.excessDays = this.excessDays;\n return builder;\n }\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {DateTimeException} from '../errors';\n\nimport {DateTimeFormatter} from './DateTimeFormatter';\n\n/**\n * @private\n */\nexport class DateTimePrintContext{\n /**\n *\n * @param {TemporalAccessor} temporal\n * @param {DateTimeFormatter|Locale} localeOrFormatter\n * @param {DecimalStyle} symbols\n */\n constructor(temporal, localeOrFormatter, symbols) {\n if(arguments.length === 2 && arguments[1] instanceof DateTimeFormatter){\n this._temporal = DateTimePrintContext.adjust(temporal, localeOrFormatter);\n this._locale = localeOrFormatter.locale();\n this._symbols = localeOrFormatter.decimalStyle();\n } else {\n this._temporal = temporal;\n this._locale = localeOrFormatter;\n this._symbols = symbols;\n }\n this._optional = 0;\n }\n\n /**\n *\n * @param {TemporalAccessor} temporal\n * @param {DateTimeFormatter} formatter\n * @returns {TemporalAccessor}\n */\n // eslint-disable-next-line no-unused-vars\n static adjust(temporal, formatter) {\n // TODO implement\n return temporal;\n }\n\n\n symbols(){\n return this._symbols;\n }\n\n /**\n * Starts the printing of an optional segment of the input.\n */\n startOptional() {\n this._optional++;\n }\n\n /**\n * Ends the printing of an optional segment of the input.\n */\n endOptional() {\n this._optional--;\n }\n\n /**\n * Gets a value using a query.\n *\n * @param {TemporalQuery} query the query to use, not null\n * @return {*} the result, null if not found and optional is true\n * @throws DateTimeException if the type is not available and the section is not optional\n */\n getValueQuery(query) {\n const result = this._temporal.query(query);\n if (result == null && this._optional === 0) {\n throw new DateTimeException('Unable to extract value: ' + this._temporal);\n }\n return result;\n }\n\n /**\n * Gets the value of the specified field.\n *\n * This will return the value for the specified field.\n *\n * @param field the field to find, not null\n * @return the value, null if not found and optional is true\n * @throws DateTimeException if the field is not available and the section is not optional\n */\n getValue(field) {\n try {\n return this._temporal.getLong(field);\n } catch (ex) {\n if ((ex instanceof DateTimeException) && this._optional > 0) {\n return null;\n }\n throw ex;\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the temporal object being output.\n *\n * @return {TemporalAccessor} the temporal object, not null\n */\n temporal() {\n return this._temporal;\n }\n\n /**\n * Gets the locale.\n *

\n * This locale is used to control localization in the print output except\n * where localization is controlled by the symbols.\n *\n * @return the locale, not null\n */\n locale() {\n return this._locale;\n }\n\n //-------------------------------------------------------------------------\n // for testing\n /**\n * Sets the date-time being output.\n *\n * @param temporal the date-time object, not null\n */\n setDateTime(temporal) {\n this._temporal = temporal;\n }\n\n setLocale(locale) {\n this._locale = locale;\n }\n\n\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {UnsupportedTemporalTypeException, IllegalStateException} from '../errors';\n\nimport {DayOfWeek} from '../DayOfWeek';\nimport {Duration} from '../Duration';\nimport {MathUtil} from '../MathUtil';\nimport {LocalDate} from '../LocalDate';\n\nimport {ChronoField} from './ChronoField';\nimport {ChronoUnit} from './ChronoUnit';\nimport {TemporalField} from './TemporalField';\nimport {TemporalUnit} from './TemporalUnit';\nimport {ValueRange} from './ValueRange';\n\nimport {IsoChronology} from '../chrono/IsoChronology';\n\nimport {ResolverStyle} from '../format/ResolverStyle';\n\n/**\n * Fields and units specific to the ISO-8601 calendar system,\n * including quarter-of-year and week-based-year.\n *\n * This class defines fields and units that are specific to the ISO calendar system.\n *\n * ### Quarter of year\n *\n * The ISO-8601 standard is based on the standard civic 12 month year.\n * This is commonly divided into four quarters, often abbreviated as Q1, Q2, Q3 and Q4.\n *\n * January, February and March are in Q1.\n * April, May and June are in Q2.\n * July, August and September are in Q3.\n * October, November and December are in Q4.\n *\n * The complete date is expressed using three fields:\n *\n * * `IsoFields.DAY_OF_QUARTER` - the day within the quarter, from 1 to 90, 91 or 92\n * * `QUARTER_OF_YEAR` - the week within the week-based-year\n * * `ChronoField.YEAR` - the standard ISO year (see {@link ChronoField})\n *\n * ### Week based years\n *\n * The ISO-8601 standard was originally intended as a data interchange format,\n * defining a string format for dates and times. However, it also defines an\n * alternate way of expressing the date, based on the concept of week-based-year.\n *\n * The date is expressed using three fields:\n *\n * * `ChronoField.DAY_OF_WEEK` - the standard field defining the\n * day-of-week from Monday (1) to Sunday (7) (see {@link ChronoField})\n * * `WEEK_OF_WEEK_BASED_YEAR` - the week within the week-based-year\n * * `WEEK_BASED_YEAR` - the week-based-year \n *\n * The week-based-year itself is defined relative to the standard ISO proleptic year.\n * It differs from the standard year in that it always starts on a Monday.\n *\n * The first week of a week-based-year is the first Monday-based week of the standard\n * ISO year that has at least 4 days in the new year.\n *\n * * If January 1st is Monday then week 1 starts on January 1st\n * * If January 1st is Tuesday then week 1 starts on December 31st of the previous standard year\n * * If January 1st is Wednesday then week 1 starts on December 30th of the previous standard year\n * * If January 1st is Thursday then week 1 starts on December 29th of the previous standard year\n * * If January 1st is Friday then week 1 starts on January 4th\n * * If January 1st is Saturday then week 1 starts on January 3rd\n * * If January 1st is Sunday then week 1 starts on January 2nd\n *\n * There are 52 weeks in most week-based years, however on occasion there are 53 weeks.\n *\n * For example:\n *\n * * Sunday, 2008-12-28: Week 52 of week-based-year 2008\n * * Monday, 2008-12-29: Week 1 of week-based-year 2009\n * * Wednesday, 2008-12-31: Week 1 of week-based-year 2009\n * * Thursday, 2009-01-01: Week 1 of week-based-year 2009\n * * Sunday, 2009-01-04: Week 1 of week-based-year 2009\n * * Monday, 2009-01-05: Week 2 of week-based-year 2009\n *\n * @property {TemporalField} DAY_OF_QUARTER The field that represents the day-of-quarter.\n *\n * This field allows the day-of-quarter value to be queried and set.\n * The day-of-quarter has values from 1 to 90 in Q1 of a standard year, from 1 to 91\n * in Q1 of a leap year, from 1 to 91 in Q2 and from 1 to 92 in Q3 and Q4.\n *\n * The day-of-quarter can only be calculated if the day-of-year, month-of-year and year\n * are available.\n *\n * When setting this field, the value is allowed to be partially lenient, taking any\n * value from 1 to 92. If the quarter has less than 92 days, then day 92, and\n * potentially day 91, is in the following quarter.\n *\n * @property {TemporalField} QUARTER_OF_YEAR The field that represents the quarter-of-year.\n *\n * This field allows the quarter-of-year value to be queried and set.\n * The quarter-of-year has values from 1 to 4.\n *\n * The day-of-quarter can only be calculated if the month-of-year is available.\n *\n * @property {TemporalField} WEEK_OF_WEEK_BASED_YEAR The field that represents the\n * week-of-week-based-year.\n *\n * This field allows the week of the week-based-year value to be queried and set.\n *\n * @property {TemporalField} WEEK_BASED_YEAR The field that represents the week-based-year.\n *\n * This field allows the week-based-year value to be queried and set.\n *\n * @property {TemporalField} WEEK_BASED_YEARS The unit that represents week-based-years for\n * the purpose of addition and subtraction.\n *\n * This allows a number of week-based-years to be added to, or subtracted from, a date.\n * The unit is equal to either 52 or 53 weeks.\n * The estimated duration of a week-based-year is the same as that of a standard ISO\n * year at 365.2425 days.\n *\n * The rules for addition add the number of week-based-years to the existing value\n * for the week-based-year field. If the resulting week-based-year only has 52 weeks,\n * then the date will be in week 1 of the following week-based-year.\n *\n * @property {TemporalField} QUARTER_YEARS Unit that represents the concept of a quarter-year.\n * For the ISO calendar system, it is equal to 3 months.\n * The estimated duration of a quarter-year is one quarter of 365.2425 days.\n * \n * @typedef {Object} IsoFields\n * @type {Object}\n */\nexport const IsoFields = {};\n\n//-----------------------------------------------------------------------\n\nconst QUARTER_DAYS = [0, 90, 181, 273, 0, 91, 182, 274];\n\n/**\n * Implementation of the field.\n * @private\n */\nclass Field extends TemporalField{\n\n /**\n *\n * @returns {boolean}\n */\n isDateBased() {\n return true;\n }\n\n /**\n *\n * @returns {boolean}\n */\n isTimeBased() {\n return false;\n }\n\n /**\n *\n * @returns {boolean}\n */\n _isIso() {\n return true;\n }\n\n /**\n *\n * @param {LocalDate} date\n * @returns {ValueRange}\n */\n static _getWeekRangeByLocalDate(date) {\n const wby = Field._getWeekBasedYear(date);\n return ValueRange.of(1, Field._getWeekRangeByYear(wby));\n }\n\n /**\n *\n * @param {number} wby\n * @returns {number}\n */\n static _getWeekRangeByYear(wby) {\n const date = LocalDate.of(wby, 1, 1);\n // 53 weeks if standard year starts on Thursday, or Wed in a leap year\n if (date.dayOfWeek() === DayOfWeek.THURSDAY || (date.dayOfWeek() === DayOfWeek.WEDNESDAY && date.isLeapYear())) {\n return 53;\n }\n return 52;\n }\n\n /**\n *\n * @param {LocalDate} date\n * @returns {number}\n */\n static _getWeek(date) {\n const dow0 = date.dayOfWeek().ordinal();\n const doy0 = date.dayOfYear() - 1;\n const doyThu0 = doy0 + (3 - dow0); // adjust to mid-week Thursday (which is 3 indexed from zero)\n const alignedWeek = MathUtil.intDiv(doyThu0, 7);\n const firstThuDoy0 = doyThu0 - (alignedWeek * 7);\n let firstMonDoy0 = firstThuDoy0 - 3;\n if (firstMonDoy0 < -3) {\n firstMonDoy0 += 7;\n }\n if (doy0 < firstMonDoy0) {\n return Field._getWeekRangeByLocalDate(date.withDayOfYear(180).minusYears(1)).maximum();\n }\n let week = MathUtil.intDiv((doy0 - firstMonDoy0), 7) + 1;\n if (week === 53) {\n if ((firstMonDoy0 === -3 || (firstMonDoy0 === -2 && date.isLeapYear())) === false) {\n week = 1;\n }\n }\n return week;\n }\n\n /**\n *\n * @param {LocalDate} date\n * @returns {number}\n */\n static _getWeekBasedYear(date) {\n let year = date.year();\n let doy = date.dayOfYear();\n if (doy <= 3) {\n const dow = date.dayOfWeek().ordinal();\n if (doy - dow < -2) {\n year--;\n }\n } else if (doy >= 363) {\n const dow = date.dayOfWeek().ordinal();\n doy = doy - 363 - (date.isLeapYear() ? 1 : 0);\n if (doy - dow >= 0) {\n year++;\n }\n }\n return year;\n }\n\n /**\n *\n * @returns {string}\n */\n displayName(/*locale*/) {\n return this.toString();\n }\n\n /**\n *\n * @returns {null}\n */\n resolve() {\n return null;\n }\n\n name(){\n return this.toString();\n }\n\n}\n\n/**\n * @private\n */\nclass DAY_OF_QUARTER_FIELD extends Field {\n\n /**\n *\n * @returns {string}\n */\n toString() {\n return 'DayOfQuarter';\n }\n\n /**\n *\n * @returns {TemporalUnit}\n */\n baseUnit() {\n return ChronoUnit.DAYS;\n }\n\n /**\n *\n * @returns {TemporalUnit}\n */\n rangeUnit() {\n return QUARTER_YEARS;\n }\n\n /**\n *\n * @returns {ValueRange}\n */\n range() {\n return ValueRange.of(1, 90, 92);\n }\n\n /**\n *\n * @param {TemporalAccessor} temporal\n * @returns {boolean}\n */\n isSupportedBy(temporal) {\n return temporal.isSupported(ChronoField.DAY_OF_YEAR) && temporal.isSupported(ChronoField.MONTH_OF_YEAR) &&\n temporal.isSupported(ChronoField.YEAR) && this._isIso(temporal);\n }\n\n\n /**\n *\n * @param {TemporalAccessor} temporal\n * @returns {ValueRange}\n */\n rangeRefinedBy(temporal) {\n if (temporal.isSupported(this) === false) {\n throw new UnsupportedTemporalTypeException('Unsupported field: DayOfQuarter');\n }\n const qoy = temporal.getLong(QUARTER_OF_YEAR);\n if (qoy === 1) {\n const year = temporal.getLong(ChronoField.YEAR);\n return (IsoChronology.isLeapYear(year) ? ValueRange.of(1, 91) : ValueRange.of(1, 90));\n } else if (qoy === 2) {\n return ValueRange.of(1, 91);\n } else if (qoy === 3 || qoy === 4) {\n return ValueRange.of(1, 92);\n } // else value not from 1 to 4, so drop through\n return this.range();\n }\n\n /**\n *\n * @param {TemporalAccessor} temporal\n * @returns {number}\n */\n getFrom(temporal) {\n if (temporal.isSupported(this) === false) {\n throw new UnsupportedTemporalTypeException('Unsupported field: DayOfQuarter');\n }\n const doy = temporal.get(ChronoField.DAY_OF_YEAR);\n const moy = temporal.get(ChronoField.MONTH_OF_YEAR);\n const year = temporal.getLong(ChronoField.YEAR);\n return doy - QUARTER_DAYS[MathUtil.intDiv((moy - 1), 3) + (IsoChronology.isLeapYear(year) ? 4 : 0)];\n }\n\n /**\n *\n * @param {Temporal} temporal\n * @param {number} newValue\n * @returns {temporal}\n */\n adjustInto(temporal, newValue) {\n const curValue = this.getFrom(temporal);\n this.range().checkValidValue(newValue, this);\n return temporal.with(ChronoField.DAY_OF_YEAR, temporal.getLong(ChronoField.DAY_OF_YEAR) + (newValue - curValue));\n }\n\n /**\n *\n * @param {Map} fieldValues\n * @param {TemporalAccessor} partialTemporal\n * @param {ResolverStyle} resolverStyle\n * @returns {ValueRange}\n */\n resolve(fieldValues, partialTemporal, resolverStyle) {\n const yearLong = fieldValues.get(ChronoField.YEAR);\n const qoyLong = fieldValues.get(QUARTER_OF_YEAR);\n if (yearLong == null || qoyLong == null) {\n return null;\n }\n const y = ChronoField.YEAR.checkValidIntValue(yearLong);\n const doq = fieldValues.get(DAY_OF_QUARTER);\n let date;\n if (resolverStyle === ResolverStyle.LENIENT) {\n const qoy = qoyLong;\n date = LocalDate.of(y, 1, 1);\n date = date.plusMonths(MathUtil.safeMultiply(MathUtil.safeSubtract(qoy, 1), 3));\n date = date.plusDays(MathUtil.safeSubtract(doq, 1));\n } else {\n const qoy = QUARTER_OF_YEAR.range().checkValidIntValue(qoyLong, QUARTER_OF_YEAR);\n if (resolverStyle === ResolverStyle.STRICT) {\n let max = 92;\n if (qoy === 1) {\n max = (IsoChronology.isLeapYear(y) ? 91 : 90);\n } else if (qoy === 2) {\n max = 91;\n }\n ValueRange.of(1, max).checkValidValue(doq, this);\n } else {\n this.range().checkValidValue(doq, this); // leniently check from 1 to 92\n }\n date = LocalDate.of(y, ((qoy - 1) * 3) + 1, 1).plusDays(doq - 1);\n }\n fieldValues.remove(this);\n fieldValues.remove(ChronoField.YEAR);\n fieldValues.remove(QUARTER_OF_YEAR);\n return date;\n }\n}\n\n/**\n * @private\n */\nclass QUARTER_OF_YEAR_FIELD extends Field {\n\n /**\n *\n * @returns {string}\n */\n toString() {\n return 'QuarterOfYear';\n }\n\n /**\n *\n * @returns {TemporalUnit}\n */\n baseUnit() {\n return QUARTER_YEARS;\n }\n\n /**\n *\n * @returns {TemporalUnit}\n */\n rangeUnit() {\n return ChronoUnit.YEARS;\n }\n\n /**\n *\n * @returns {ValueRange}\n */\n range() {\n return ValueRange.of(1, 4);\n }\n\n /**\n *\n * @param {TemporalAccessor} temporal\n * @returns {boolean}\n */\n isSupportedBy(temporal) {\n return temporal.isSupported(ChronoField.MONTH_OF_YEAR) && this._isIso(temporal);\n }\n\n\n /**\n *\n * @param {TemporalAccessor} temporal\n * @returns {ValueRange}\n */\n //eslint-disable-next-line no-unused-vars\n rangeRefinedBy(temporal) {\n return this.range();\n }\n\n /**\n *\n * @param {TemporalAccessor} temporal\n * @returns {number}\n */\n getFrom(temporal) {\n if (temporal.isSupported(this) === false) {\n throw new UnsupportedTemporalTypeException('Unsupported field: QuarterOfYear');\n }\n const moy = temporal.getLong(ChronoField.MONTH_OF_YEAR);\n return MathUtil.intDiv((moy + 2), 3);\n }\n\n /**\n *\n * @param {Temporal} temporal\n * @param {number} newValue\n * @returns {temporal}\n */\n adjustInto(temporal, newValue) {\n const curValue = this.getFrom(temporal);\n this.range().checkValidValue(newValue, this);\n return temporal.with(ChronoField.MONTH_OF_YEAR, temporal.getLong(ChronoField.MONTH_OF_YEAR) + (newValue - curValue) * 3);\n }\n\n}\n\n/**\n * @private\n */\nclass WEEK_OF_WEEK_BASED_YEAR_FIELD extends Field {\n\n /**\n *\n * @returns {string}\n */\n toString() {\n return 'WeekOfWeekBasedYear';\n }\n\n /**\n *\n * @returns {TemporalUnit}\n */\n baseUnit() {\n return ChronoUnit.WEEKS;\n }\n\n /**\n *\n * @returns {TemporalUnit}\n */\n rangeUnit() {\n return WEEK_BASED_YEARS;\n }\n\n /**\n *\n * @returns {ValueRange}\n */\n range() {\n return ValueRange.of(1, 52, 53);\n }\n\n /**\n *\n * @param {TemporalAccessor} temporal\n * @returns {boolean}\n */\n isSupportedBy(temporal) {\n return temporal.isSupported(ChronoField.EPOCH_DAY) && this._isIso(temporal);\n }\n\n\n /**\n *\n * @param {TemporalAccessor} temporal\n * @returns {ValueRange}\n */\n rangeRefinedBy(temporal) {\n if (temporal.isSupported(this) === false) {\n throw new UnsupportedTemporalTypeException('Unsupported field: WeekOfWeekBasedYear');\n }\n return Field._getWeekRangeByLocalDate(LocalDate.from(temporal));\n }\n\n /**\n *\n * @param {TemporalAccessor} temporal\n * @returns {number}\n */\n getFrom(temporal) {\n if (temporal.isSupported(this) === false) {\n throw new UnsupportedTemporalTypeException('Unsupported field: WeekOfWeekBasedYear');\n }\n return Field._getWeek(LocalDate.from(temporal));\n }\n\n /**\n *\n * @param {Temporal} temporal\n * @param {number} newValue\n * @returns {temporal}\n */\n adjustInto(temporal, newValue) {\n this.range().checkValidValue(newValue, this);\n return temporal.plus(MathUtil.safeSubtract(newValue, this.getFrom(temporal)), ChronoUnit.WEEKS);\n }\n\n /**\n *\n * @param {Map} fieldValues\n * @param {TemporalAccessor} partialTemporal\n * @param {ResolverStyle} resolverStyle\n * @returns {ValueRange}\n */\n resolve(fieldValues, partialTemporal, resolverStyle) {\n const wbyLong = fieldValues.get(WEEK_BASED_YEAR);\n const dowLong = fieldValues.get(ChronoField.DAY_OF_WEEK);\n if (wbyLong == null || dowLong == null) {\n return null;\n }\n const wby = WEEK_BASED_YEAR.range().checkValidIntValue(wbyLong, WEEK_BASED_YEAR);\n const wowby = fieldValues.get(WEEK_OF_WEEK_BASED_YEAR);\n let date;\n if (resolverStyle === ResolverStyle.LENIENT) {\n let dow = dowLong;\n let weeks = 0;\n if (dow > 7) {\n weeks = MathUtil.intDiv((dow - 1), 7);\n dow = (MathUtil.intMod((dow - 1), 7) + 1);\n } else if (dow < 1) {\n weeks = MathUtil.intDiv(dow, 7) - 1;\n dow = MathUtil.intMod(dow, 7) + 7;\n }\n date = LocalDate.of(wby, 1, 4).plusWeeks(wowby - 1).plusWeeks(weeks).with(ChronoField.DAY_OF_WEEK, dow);\n } else {\n const dow = ChronoField.DAY_OF_WEEK.checkValidIntValue(dowLong);\n if (resolverStyle === ResolverStyle.STRICT) {\n const temp = LocalDate.of(wby, 1, 4);\n const range = Field._getWeekRangeByLocalDate(temp);\n range.checkValidValue(wowby, this);\n } else {\n this.range().checkValidValue(wowby, this); // leniently check from 1 to 53\n }\n date = LocalDate.of(wby, 1, 4).plusWeeks(wowby - 1).with(ChronoField.DAY_OF_WEEK, dow);\n }\n fieldValues.remove(this);\n fieldValues.remove(WEEK_BASED_YEAR);\n fieldValues.remove(ChronoField.DAY_OF_WEEK);\n return date;\n }\n\n /**\n *\n * @returns {string}\n */\n displayName() {\n return 'Week';\n }\n\n}\n\n/**\n * @private\n */\nclass WEEK_BASED_YEAR_FIELD extends Field {\n\n /**\n *\n * @returns {string}\n */\n toString() {\n return 'WeekBasedYear';\n }\n\n /**\n *\n * @returns {TemporalUnit}\n */\n baseUnit() {\n return WEEK_BASED_YEARS;\n }\n\n /**\n *\n * @returns {TemporalUnit}\n */\n rangeUnit() {\n return ChronoUnit.FOREVER;\n }\n\n /**\n *\n * @returns {ValueRange}\n */\n range() {\n return ChronoField.YEAR.range();\n }\n\n /**\n *\n * @param {TemporalAccessor} temporal\n * @returns {boolean}\n */\n isSupportedBy(temporal) {\n return temporal.isSupported(ChronoField.EPOCH_DAY) && this._isIso(temporal);\n }\n\n\n /**\n *\n * @param {TemporalAccessor} temporal\n * @returns {ValueRange}\n */\n //eslint-disable-next-line no-unused-vars\n rangeRefinedBy(temporal) {\n return ChronoField.YEAR.range();\n }\n\n /**\n *\n * @param {TemporalAccessor} temporal\n * @returns {number}\n */\n getFrom(temporal) {\n if (temporal.isSupported(this) === false) {\n throw new UnsupportedTemporalTypeException('Unsupported field: WeekBasedYear');\n }\n return Field._getWeekBasedYear(LocalDate.from(temporal));\n }\n\n /**\n *\n * @param {Temporal} temporal\n * @param {number} newValue\n * @returns {temporal}\n */\n adjustInto(temporal, newValue) {\n if (this.isSupportedBy(temporal) === false) {\n throw new UnsupportedTemporalTypeException('Unsupported field: WeekBasedYear');\n }\n const newWby = this.range().checkValidIntValue(newValue, WEEK_BASED_YEAR); // strict check\n const date = LocalDate.from(temporal);\n const dow = date.get(ChronoField.DAY_OF_WEEK);\n let week = Field._getWeek(date);\n if (week === 53 && Field._getWeekRangeByYear(newWby) === 52) {\n week = 52;\n }\n let resolved = LocalDate.of(newWby, 1, 4); // 4th is guaranteed to be in week one\n const days = (dow - resolved.get(ChronoField.DAY_OF_WEEK)) + ((week - 1) * 7);\n resolved = resolved.plusDays(days);\n return temporal.with(resolved);\n }\n\n}\n\n//-----------------------------------------------------------------------\n/**\n * Implementation of the period unit.\n * @private\n */\nclass Unit extends TemporalUnit {\n\n /**\n *\n * @param {string} name\n * @param {Duration} estimatedDuration\n * @private\n */\n constructor(name, estimatedDuration) {\n super();\n this._name = name;\n this._duration = estimatedDuration;\n }\n\n /**\n *\n * @returns {Duration}\n */\n duration() {\n return this._duration;\n }\n\n /**\n *\n * @returns {boolean}\n */\n isDurationEstimated() {\n return true;\n }\n\n /**\n *\n * @returns {boolean}\n */\n isDateBased() {\n return true;\n }\n\n /**\n *\n * @returns {boolean}\n */\n isTimeBased() {\n return false;\n }\n\n /**\n *\n * @param {Temporal} temporal\n * @returns {boolean}\n */\n isSupportedBy(temporal) {\n return temporal.isSupported(ChronoField.EPOCH_DAY);\n }\n\n /**\n *\n * @param {Temporal} temporal\n * @param {number} periodToAdd\n * @returns {number}\n */\n addTo(temporal, periodToAdd) {\n switch(this) {\n case WEEK_BASED_YEARS: {\n const added = MathUtil.safeAdd(temporal.get(WEEK_BASED_YEAR), periodToAdd);\n return temporal.with(WEEK_BASED_YEAR, added);\n }\n case QUARTER_YEARS:\n // no overflow (256 is multiple of 4)\n return temporal.plus(MathUtil.intDiv(periodToAdd, 256), ChronoUnit.YEARS).plus(MathUtil.intMod(periodToAdd, 256) * 3, ChronoUnit.MONTHS);\n default:\n throw new IllegalStateException('Unreachable');\n }\n }\n\n /**\n *\n * @param {Temporal} temporal1\n * @param {Temporal} temporal2\n * @returns {number}\n */\n between(temporal1, temporal2) {\n switch(this) {\n case WEEK_BASED_YEARS:\n return MathUtil.safeSubtract(temporal2.getLong(WEEK_BASED_YEAR), temporal1.getLong(WEEK_BASED_YEAR));\n case QUARTER_YEARS:\n return MathUtil.intDiv(temporal1.until(temporal2, ChronoUnit.MONTHS), 3);\n default:\n throw new IllegalStateException('Unreachable');\n }\n }\n\n toString() {\n return name;\n }\n}\n\nlet DAY_OF_QUARTER = null;\nlet QUARTER_OF_YEAR = null;\nlet WEEK_OF_WEEK_BASED_YEAR = null;\nlet WEEK_BASED_YEAR = null;\nlet WEEK_BASED_YEARS = null;\nlet QUARTER_YEARS = null;\n\nexport function _init() {\n DAY_OF_QUARTER = new DAY_OF_QUARTER_FIELD();\n QUARTER_OF_YEAR = new QUARTER_OF_YEAR_FIELD();\n WEEK_OF_WEEK_BASED_YEAR = new WEEK_OF_WEEK_BASED_YEAR_FIELD();\n WEEK_BASED_YEAR = new WEEK_BASED_YEAR_FIELD();\n\n WEEK_BASED_YEARS = new Unit('WeekBasedYears', Duration.ofSeconds(31556952));\n QUARTER_YEARS = new Unit('QuarterYears', Duration.ofSeconds(31556952 / 4));\n\n IsoFields.DAY_OF_QUARTER = DAY_OF_QUARTER;\n IsoFields.QUARTER_OF_YEAR = QUARTER_OF_YEAR;\n IsoFields.WEEK_OF_WEEK_BASED_YEAR = WEEK_OF_WEEK_BASED_YEAR;\n IsoFields.WEEK_BASED_YEAR = WEEK_BASED_YEAR;\n IsoFields.WEEK_BASED_YEARS = WEEK_BASED_YEARS;\n IsoFields.QUARTER_YEARS = QUARTER_YEARS;\n\n // this differs from threeten, but for ease of use we bring back good old joda time functionality\n /**\n * the week of the week based year as defined by the ISO8601 Standard with a Monday-based week\n *\n * @returns {number} the week a the week based year\n */\n LocalDate.prototype.isoWeekOfWeekyear = function () {\n return this.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR);\n };\n /**\n * the year of the week based year as defined by the ISO8601 Standard with a Monday-based week\n *\n * @returns {number} the year a the week based year\n */\n LocalDate.prototype.isoWeekyear = function () {\n return this.get(IsoFields.WEEK_BASED_YEAR);\n };\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nexport class DecimalStyle {\n /**\n *\n * @param zeroChar\n * @param positiveSignChar\n * @param negativeSignChar\n * @param decimalPointChar\n * @private\n */\n constructor(zeroChar, positiveSignChar, negativeSignChar, decimalPointChar) {\n this._zeroDigit = zeroChar;\n this._zeroDigitCharCode = zeroChar.charCodeAt(0);\n this._positiveSign = positiveSignChar;\n this._negativeSign = negativeSignChar;\n this._decimalSeparator = decimalPointChar;\n }\n\n positiveSign(){\n return this._positiveSign;\n }\n\n withPositiveSign(positiveSign) {\n if (positiveSign === this._positiveSign) {\n return this;\n }\n return new DecimalStyle(this._zeroDigit, positiveSign, this._negativeSign, this._decimalSeparator);\n }\n\n negativeSign(){\n return this._negativeSign;\n }\n\n withNegativeSign(negativeSign) {\n if (negativeSign === this._negativeSign) {\n return this;\n }\n return new DecimalStyle(this._zeroDigit, this._positiveSign, negativeSign, this._decimalSeparator);\n }\n\n zeroDigit(){\n return this._zeroDigit;\n }\n\n withZeroDigit(zeroDigit) {\n if (zeroDigit === this._zeroDigit) {\n return this;\n }\n return new DecimalStyle(zeroDigit, this._positiveSign, this._negativeSign, this._decimalSeparator);\n }\n\n decimalSeparator(){\n return this._decimalSeparator;\n }\n\n withDecimalSeparator(decimalSeparator) {\n if (decimalSeparator === this._decimalSeparator) {\n return this;\n }\n return new DecimalStyle(this._zeroDigit, this._positiveSign, this._negativeSign, decimalSeparator);\n }\n\n convertToDigit(char){\n const val = char.charCodeAt(0) - this._zeroDigitCharCode;\n return (val >= 0 && val <= 9) ? val : -1;\n }\n\n convertNumberToI18N(numericText) {\n if (this._zeroDigit === '0') {\n return numericText;\n }\n const diff = this._zeroDigitCharCode - '0'.charCodeAt(0);\n let convertedText = '';\n for (let i = 0; i < numericText.length; i++) {\n convertedText += String.fromCharCode(numericText.charCodeAt(i) + diff);\n }\n return convertedText;\n }\n\n equals(other) {\n if (this === other) {\n return true;\n }\n if (other instanceof DecimalStyle) {\n return (this._zeroDigit === other._zeroDigit && this._positiveSign === other._positiveSign &&\n this._negativeSign === other._negativeSign && this._decimalSeparator === other._decimalSeparator);\n }\n return false;\n }\n\n hashCode() {\n return this._zeroDigit + this._positiveSign + this._negativeSign + this._decimalSeparator;\n }\n\n toString() {\n return 'DecimalStyle[' + this._zeroDigit + this._positiveSign + this._negativeSign + this._decimalSeparator + ']';\n }\n\n static of(){\n throw new Error('not yet supported');\n }\n static availableLocales(){\n throw new Error('not yet supported');\n }\n\n}\n\nDecimalStyle.STANDARD = new DecimalStyle('0', '+', '-', '.');\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {Enum} from '../Enum';\n\nexport class SignStyle extends Enum{\n /**\n * Parse helper.\n *\n * @param positive true if positive sign parsed, false for negative sign\n * @param strict true if strict, false if lenient\n * @param fixedWidth true if fixed width, false if not\n * @return true if valid\n */\n parse(positive, strict, fixedWidth){\n switch (this) {\n case SignStyle.NORMAL: // NORMAL\n // valid if negative or (positive and lenient)\n return !positive || !strict;\n case SignStyle.ALWAYS: // ALWAYS\n case SignStyle.EXCEEDS_PAD: // EXCEEDS_PAD\n return true;\n default:\n // valid if lenient and not fixed width\n return !strict && !fixedWidth;\n }\n\n }\n}\n\nSignStyle.NORMAL = new SignStyle('NORMAL');\nSignStyle.NEVER = new SignStyle('NEVER');\nSignStyle.ALWAYS = new SignStyle('ALWAYS');\nSignStyle.EXCEEDS_PAD = new SignStyle('EXCEEDS_PAD');\nSignStyle.NOT_NEGATIVE = new SignStyle('NOT_NEGATIVE');\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\nimport {Enum} from '../Enum';\n\n/**\n * Enumeration of the style of text formatting and parsing.\n *\n * Text styles define three sizes for the formatted text - 'full', 'short' and 'narrow'.\n * Each of these three sizes is available in both 'standard' and 'stand-alone' variations.\n *\n * The difference between the three sizes is obvious in most languages.\n * For example, in English the 'full' month is 'January', the 'short' month is 'Jan'\n * and the 'narrow' month is 'J'. Note that the narrow size is often not unique.\n * For example, 'January', 'June' and 'July' all have the 'narrow' text 'J'.\n *\n * The difference between the 'standard' and 'stand-alone' forms is trickier to describe\n * as there is no difference in English. However, in other languages there is a difference\n * in the word used when the text is used alone, as opposed to in a complete date.\n * For example, the word used for a month when used alone in a date picker is different\n * to the word used for month in association with a day and year in a date.\n *\n * ### Specification for implementors\n *\n * This is immutable and thread-safe enum.\n */\nexport class TextStyle extends Enum {\n /**\n * Checks if the style is stand-alone.\n *\n * @return {boolean} true if the style is stand-alone\n */\n isStandalone() {\n switch (this) {\n case TextStyle.FULL_STANDALONE:\n case TextStyle.SHORT_STANDALONE:\n case TextStyle.NARROW_STANDALONE:\n return true;\n default:\n return false;\n }\n }\n\n /**\n * Converts the style to the equivalent stand-alone style.\n *\n * @return {TextStyle} the matching stand-alone style\n */\n asStandalone() {\n switch (this) {\n case TextStyle.FULL:\n return TextStyle.FULL_STANDALONE;\n case TextStyle.SHORT:\n return TextStyle.SHORT_STANDALONE;\n case TextStyle.NARROW:\n return TextStyle.NARROW_STANDALONE;\n default:\n // all others are already standalone\n return this;\n }\n }\n\n /**\n * Converts the style to the equivalent normal style.\n *\n * @return {TextStyle} the matching normal style\n */\n asNormal() {\n switch (this) {\n case TextStyle.FULL_STANDALONE:\n return TextStyle.FULL;\n case TextStyle.SHORT_STANDALONE:\n return TextStyle.SHORT;\n case TextStyle.NARROW_STANDALONE:\n return TextStyle.NARROW;\n default:\n // all others are already normal\n return this;\n }\n }\n}\n\n/**\n * Full text, typically the full description.\n * For example, day-of-week Monday might output \"Monday\".\n */\nTextStyle.FULL = new TextStyle('FULL');\n/**\n * Full text for stand-alone use, typically the full description.\n * For example, day-of-week Monday might output \"Monday\".\n */\nTextStyle.FULL_STANDALONE = new TextStyle('FULL_STANDALONE');\n/**\n * Short text, typically an abbreviation.\n * For example, day-of-week Monday might output \"Mon\".\n */\nTextStyle.SHORT = new TextStyle('SHORT');\n/**\n * Short text for stand-alone use, typically an abbreviation.\n * For example, day-of-week Monday might output \"Mon\".\n */\nTextStyle.SHORT_STANDALONE = new TextStyle('SHORT_STANDALONE');\n/**\n * Narrow text, typically a single letter.\n * For example, day-of-week Monday might output \"M\".\n */\nTextStyle.NARROW = new TextStyle('NARROW');\n/**\n * Narrow text for stand-alone use, typically a single letter.\n * For example, day-of-week Monday might output \"M\".\n */\nTextStyle.NARROW_STANDALONE = new TextStyle('NARROW_STANDALONE');\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {IllegalArgumentException} from '../../errors';\n\n/**\n * Prints or parses a char literal.\n * @private\n */\nexport class CharLiteralPrinterParser {\n\n constructor(literal) {\n if (literal.length > 1) {\n throw new IllegalArgumentException('invalid literal, too long: \"' + literal + '\"');\n }\n this._literal = literal;\n }\n\n print(context, buf) {\n buf.append(this._literal);\n return true;\n }\n\n parse(context, text, position) {\n const length = text.length;\n if (position === length) {\n return ~position;\n }\n const ch = text.charAt(position);\n if (context.charEquals(this._literal, ch) === false) {\n return ~position;\n }\n return position + this._literal.length;\n }\n\n toString() {\n if (this._literal === '\\'') {\n return \"''\";\n }\n return \"'\" + this._literal + \"'\";\n }\n}\n\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\n/**\n * @private\n */\nexport class CompositePrinterParser {\n\n constructor(printerParsers, optional) {\n this._printerParsers = printerParsers;\n this._optional = optional;\n }\n\n /**\n * Returns a copy of this printer-parser with the optional flag changed.\n *\n * @param {boolean} optional the optional flag to set in the copy\n * @return {CompositePrinterParser} the new printer-parser, not null\n */\n withOptional(optional) {\n if (optional === this._optional) {\n return this;\n }\n return new CompositePrinterParser(this._printerParsers, optional);\n }\n\n print(context, buf) {\n const length = buf.length();\n if (this._optional) {\n context.startOptional();\n }\n try {\n for (let i=0; i 9) {\n throw new IllegalArgumentException('Minimum width must be from 0 to 9 inclusive but was ' + minWidth);\n }\n if (maxWidth < 1 || maxWidth > 9) {\n throw new IllegalArgumentException('Maximum width must be from 1 to 9 inclusive but was ' + maxWidth);\n }\n if (maxWidth < minWidth) {\n throw new IllegalArgumentException('Maximum width must exceed or equal the minimum width but ' +\n maxWidth + ' < ' + minWidth);\n }\n this.field = field;\n this.minWidth = minWidth;\n this.maxWidth = maxWidth;\n this.decimalPoint = decimalPoint;\n }\n\n print(context, buf) {\n const value = context.getValue(this.field);\n if (value === null) {\n return false;\n }\n const symbols = context.symbols();\n if (value === 0) { // scale is zero if value is zero\n if (this.minWidth > 0) {\n if (this.decimalPoint) {\n buf.append(symbols.decimalSeparator());\n }\n for (let i = 0; i < this.minWidth; i++) {\n buf.append(symbols.zeroDigit());\n }\n }\n } else {\n let fraction = this.convertToFraction(value, symbols.zeroDigit());\n const outputScale = Math.min(Math.max(fraction.length, this.minWidth), this.maxWidth);\n fraction = fraction.substr(0, outputScale);\n if(fraction * 1 > 0 ) {\n while (fraction.length > this.minWidth && fraction[fraction.length - 1] === '0') {\n fraction = fraction.substr(0, fraction.length - 1);\n }\n }\n let str = fraction;\n str = symbols.convertNumberToI18N(str);\n if (this.decimalPoint) {\n buf.append(symbols.decimalSeparator());\n }\n buf.append(str);\n }\n return true;\n }\n\n parse(context, text, position) {\n const effectiveMin = (context.isStrict() ? this.minWidth : 0);\n const effectiveMax = (context.isStrict() ? this.maxWidth : 9);\n const length = text.length;\n if (position === length) {\n // valid if whole field is optional, invalid if minimum width\n return (effectiveMin > 0 ? ~position : position);\n }\n if (this.decimalPoint) {\n if (text[position] !== context.symbols().decimalSeparator()) {\n // valid if whole field is optional, invalid if minimum width\n return (effectiveMin > 0 ? ~position : position);\n }\n position++;\n }\n const minEndPos = position + effectiveMin;\n if (minEndPos > length) {\n return ~position; // need at least min width digits\n }\n const maxEndPos = Math.min(position + effectiveMax, length);\n let total = 0; // can use int because we are only parsing up to 9 digits\n let pos = position;\n while (pos < maxEndPos) {\n const ch = text.charAt(pos++);\n const digit = context.symbols().convertToDigit(ch);\n if (digit < 0) {\n if (pos < minEndPos) {\n return ~position; // need at least min width digits\n }\n pos--;\n break;\n }\n total = total * 10 + digit;\n }\n const moveLeft = pos - position;\n const scale = Math.pow(10, moveLeft);\n const value = this.convertFromFraction(total, scale);\n return context.setParsedField(this.field, value, position, pos);\n }\n\n /**\n *\n * @param {Number} value the value to convert, must be valid for this rule\n * @param {String} zeroDigit the character for zero\n * @return {String} the value as a fraction within the range, from 0 to 1, not null\n */\n convertToFraction(value, zeroDigit) {\n const range = this.field.range();\n range.checkValidValue(value, this.field);\n const _min = range.minimum();\n const _range = range.maximum() - _min + 1;\n const _value = value - _min;\n const _scaled = MathUtil.intDiv((_value * 1000000000), _range);\n let fraction = '' + _scaled;\n while(fraction.length < 9){\n fraction = zeroDigit + fraction;\n }\n return fraction;\n }\n\n /**\n *\n * @param {Number} total the fraction to convert, not null\n * @param {Number} scale the scale, not null\n * @return {Number} the value of the field, valid for this rule\n * @throws DateTimeException if the value cannot be converted\n */\n convertFromFraction(total, scale) {\n const range = this.field.range();\n const _min = range.minimum();\n const _range = range.maximum() - _min + 1;\n const _value = MathUtil.intDiv((total * _range), scale);\n return _value;\n }\n\n toString() {\n const decimal = (this.decimalPoint ? ',DecimalPoint' : '');\n return 'Fraction(' + this.field + ',' + this.minWidth + ',' + this.maxWidth + decimal + ')';\n }\n}\n\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {assert} from '../../assert';\nimport {ArithmeticException, DateTimeException, IllegalArgumentException} from '../../errors';\nimport {MathUtil} from '../../MathUtil';\n\nimport {IsoChronology} from '../../chrono/IsoChronology';\n\nimport {SignStyle} from '../SignStyle';\n\n\nconst MAX_WIDTH = 15; // can't parse all numbers with more then 15 digits in javascript\n\nconst EXCEED_POINTS = [\n 0,\n 10,\n 100,\n 1000,\n 10000,\n 100000,\n 1000000,\n 10000000,\n 100000000,\n 1000000000\n];\n\n/**\n * @private\n */\nexport class NumberPrinterParser {\n\n /**\n * Constructor.\n *\n * @param field the field to print, not null\n * @param minWidth the minimum field width, from 1 to 19\n * @param maxWidth the maximum field width, from minWidth to 19\n * @param signStyle the positive/negative sign style, not null\n * @param subsequentWidth the width of subsequent non-negative numbers, 0 or greater,\n * -1 if fixed width due to active adjacent parsing\n */\n constructor(field, minWidth, maxWidth, signStyle, subsequentWidth=0){\n this._field = field;\n this._minWidth = minWidth;\n this._maxWidth = maxWidth;\n this._signStyle = signStyle;\n this._subsequentWidth = subsequentWidth;\n }\n\n field(){ return this._field;}\n minWidth(){ return this._minWidth;}\n maxWidth(){ return this._maxWidth;}\n signStyle(){ return this._signStyle;}\n\n withFixedWidth() {\n if (this._subsequentWidth === -1) {\n return this;\n }\n return new NumberPrinterParser(this._field, this._minWidth, this._maxWidth, this._signStyle, -1);\n }\n\n withSubsequentWidth(subsequentWidth) {\n return new NumberPrinterParser(this._field, this._minWidth, this._maxWidth, this._signStyle, this._subsequentWidth + subsequentWidth);\n }\n\n _isFixedWidth() {\n return this._subsequentWidth === -1 ||\n (this._subsequentWidth > 0 && this._minWidth === this._maxWidth && this._signStyle === SignStyle.NOT_NEGATIVE);\n }\n\n print(context, buf) {\n const contextValue = context.getValue(this._field);\n if (contextValue == null) {\n return false;\n }\n const value = this._getValue(context, contextValue);\n const symbols = context.symbols();\n let str = '' + Math.abs(value);\n if (str.length > this._maxWidth) {\n throw new DateTimeException('Field ' + this._field +\n ' cannot be printed as the value ' + value +\n ' exceeds the maximum print width of ' + this._maxWidth);\n }\n str = symbols.convertNumberToI18N(str);\n\n if (value >= 0) {\n switch (this._signStyle) {\n case SignStyle.EXCEEDS_PAD:\n if (this._minWidth < MAX_WIDTH && value >= EXCEED_POINTS[this._minWidth]) {\n buf.append(symbols.positiveSign());\n }\n break;\n case SignStyle.ALWAYS:\n buf.append(symbols.positiveSign());\n break;\n }\n } else {\n switch (this._signStyle) {\n case SignStyle.NORMAL:\n case SignStyle.EXCEEDS_PAD:\n case SignStyle.ALWAYS:\n buf.append(symbols.negativeSign());\n break;\n case SignStyle.NOT_NEGATIVE:\n throw new DateTimeException('Field ' + this._field +\n ' cannot be printed as the value ' + value +\n ' cannot be negative according to the SignStyle');\n }\n }\n for (let i = 0; i < this._minWidth - str.length; i++) {\n buf.append(symbols.zeroDigit());\n }\n buf.append(str);\n return true;\n }\n\n parse(context, text, position){\n const length = text.length;\n if (position === length) {\n return ~position;\n }\n assert(position>=0 && position length) {\n return ~position;\n }\n let effMaxWidth = (context.isStrict() || this._isFixedWidth() ? this._maxWidth : 9) + Math.max(this._subsequentWidth, 0);\n let total = 0;\n let pos = position;\n for (let pass = 0; pass < 2; pass++) {\n const maxEndPos = Math.min(pos + effMaxWidth, length);\n while (pos < maxEndPos) {\n const ch = text.charAt(pos++);\n const digit = context.symbols().convertToDigit(ch);\n if (digit < 0) {\n pos--;\n if (pos < minEndPos) {\n return ~position; // need at least min width digits\n }\n break;\n }\n if ((pos - position) > MAX_WIDTH) {\n throw new ArithmeticException('number text exceeds length');\n } else {\n total = total * 10 + digit;\n }\n }\n if (this._subsequentWidth > 0 && pass === 0) {\n // re-parse now we know the correct width\n const parseLen = pos - position;\n effMaxWidth = Math.max(effMinWidth, parseLen - this._subsequentWidth);\n pos = position;\n total = 0;\n } else {\n break;\n }\n }\n if (negative) {\n if (total === 0 && context.isStrict()) {\n return ~(position - 1); // minus zero not allowed\n }\n if(total !== 0) {\n total = -total;\n }\n } else if (this._signStyle === SignStyle.EXCEEDS_PAD && context.isStrict()) {\n const parseLen = pos - position;\n if (positive) {\n if (parseLen <= this._minWidth) {\n return ~(position - 1); // '+' only parsed if minWidth exceeded\n }\n } else {\n if (parseLen > this._minWidth) {\n return ~position; // '+' must be parsed if minWidth exceeded\n }\n }\n }\n return this._setValue(context, total, position, pos);\n }\n\n /**\n * Gets the value to output.\n * (This is needed to allow e.g. ReducedPrinterParser to override this and change the value!\n *\n * @param context the context\n * @param value the value of the field, not null\n * @return the value\n * @private\n */\n _getValue(context, value) {\n return value;\n }\n\n /**\n * Stores the value.\n *\n * @param context the context to store into, not null\n * @param value the value\n * @param errorPos the position of the field being parsed\n * @param successPos the position after the field being parsed\n * @return the new position\n */\n _setValue(context, value, errorPos, successPos) {\n return context.setParsedField(this._field, value, errorPos, successPos);\n }\n\n toString() {\n if (this._minWidth === 1 && this._maxWidth === MAX_WIDTH && this._signStyle === SignStyle.NORMAL) {\n return 'Value(' + this._field + ')';\n }\n if (this._minWidth === this._maxWidth && this._signStyle === SignStyle.NOT_NEGATIVE) {\n return 'Value(' + this._field + ',' + this._minWidth + ')';\n }\n return 'Value(' + this._field + ',' + this._minWidth + ',' + this._maxWidth + ',' + this._signStyle + ')';\n }\n\n}\n//-----------------------------------------------------------------------\n/**\n * Prints and parses a reduced numeric date-time field.\n * @private\n */\nexport class ReducedPrinterParser extends NumberPrinterParser {\n\n /**\n * Constructor.\n *\n * @param {TemporalField} field the field to print, validated not null\n * @param {number} width the field width, from 1 to 10\n * @param {number} maxWidth the field max width, from 1 to 10\n * @param {number} baseValue the base value\n * @param {ChronoLocalDate} baseDate the base date\n */\n constructor(field, width, maxWidth, baseValue, baseDate) {\n super(field, width, maxWidth, SignStyle.NOT_NEGATIVE);\n if (width < 1 || width > 10) {\n throw new IllegalArgumentException('The width must be from 1 to 10 inclusive but was ' + width);\n }\n if (maxWidth < 1 || maxWidth > 10) {\n throw new IllegalArgumentException('The maxWidth must be from 1 to 10 inclusive but was ' + maxWidth);\n }\n if (maxWidth < width) {\n throw new IllegalArgumentException('The maxWidth must be greater than the width');\n }\n if (baseDate === null) {\n if (field.range().isValidValue(baseValue) === false) {\n throw new IllegalArgumentException('The base value must be within the range of the field');\n }\n if ((baseValue + EXCEED_POINTS[width]) > MathUtil.MAX_SAFE_INTEGER) {\n throw new DateTimeException('Unable to add printer-parser as the range exceeds the capacity of an int');\n }\n }\n this._baseValue = baseValue;\n this._baseDate = baseDate;\n }\n\n /**\n *\n * @param {DateTimePrintContext} context\n * @param {number} value\n */\n _getValue(context, value) {\n const absValue = Math.abs(value);\n let baseValue = this._baseValue;\n if (this._baseDate !== null) {\n // TODO: in threetenbp the following line is used, but we dont have Chronology yet,\n // let chrono = Chronology.from(context.getTemporal());\n // so let's use IsoChronology for now\n context.temporal();\n const chrono = IsoChronology.INSTANCE;\n baseValue = chrono.date(this._baseDate).get(this._field);\n }\n if (value >= baseValue && value < baseValue + EXCEED_POINTS[this._minWidth]) {\n return absValue % EXCEED_POINTS[this._minWidth];\n }\n return absValue % EXCEED_POINTS[this._maxWidth];\n }\n\n /**\n *\n * @param {DateTimeParseContext} context\n * @param {number} value\n * @param {number} errorPos\n * @param {number} successPos\n */\n _setValue(context, value, errorPos, successPos) {\n let baseValue = this._baseValue;\n if (this._baseDate != null) {\n const chrono = context.getEffectiveChronology();\n baseValue = chrono.date(this._baseDate).get(this._field);\n // TODO: not implemented??\n // context.addChronologyChangedParser(this, value, errorPos, successPos);\n }\n const parseLen = successPos - errorPos;\n if (parseLen === this._minWidth && value >= 0) {\n const range = EXCEED_POINTS[this._minWidth];\n const lastPart = baseValue % range;\n const basePart = baseValue - lastPart;\n if (baseValue > 0) {\n value = basePart + value;\n } else {\n value = basePart - value;\n }\n if (value < baseValue) {\n value += range;\n }\n }\n return context.setParsedField(this._field, value, errorPos, successPos);\n }\n\n withFixedWidth() {\n if (this._subsequentWidth === -1) {\n return this;\n }\n return new ReducedPrinterParser(this._field, this._minWidth, this._maxWidth, this._baseValue, this._baseDate, -1);\n }\n\n /**\n *\n * @param {number} subsequentWidth\n * @returns {ReducedPrinterParser}\n */\n withSubsequentWidth(subsequentWidth) {\n return new ReducedPrinterParser(this._field, this._minWidth, this._maxWidth, this._baseValue, this._baseDate,\n this._subsequentWidth + subsequentWidth);\n }\n\n /**\n *\n * @param {DateTimeParseContext} context\n */\n isFixedWidth(context) {\n if (context.isStrict() === false) {\n return false;\n }\n return super.isFixedWidth(context);\n }\n\n toString() {\n return 'ReducedValue(' + this._field + ',' + this._minWidth + ',' + this._maxWidth + ',' + (this._baseDate != null ? this._baseDate : this._baseValue) + ')';\n }\n}\n\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {requireNonNull} from '../../assert';\nimport {IllegalArgumentException} from '../../errors';\nimport {MathUtil} from '../../MathUtil';\n\nimport {ChronoField} from '../../temporal/ChronoField';\n\n//-----------------------------------------------------------------------\nconst PATTERNS = [\n '+HH', '+HHmm', '+HH:mm', '+HHMM', '+HH:MM', '+HHMMss', '+HH:MM:ss', '+HHMMSS', '+HH:MM:SS'\n];\n/**\n * Prints or parses an offset ID.\n * @private\n */\nexport class OffsetIdPrinterParser {\n\n /**\n * Constructor.\n *\n * @param {string} noOffsetText the text to use for UTC, not null\n * @param {string} pattern the pattern\n */\n constructor(noOffsetText, pattern) {\n requireNonNull(noOffsetText, 'noOffsetText');\n requireNonNull(pattern, 'pattern');\n this.noOffsetText = noOffsetText;\n this.type = this._checkPattern(pattern);\n }\n\n /**\n * @param {String} pattern\n * @return {number}\n */\n _checkPattern(pattern) {\n for (let i = 0; i < PATTERNS.length; i++) {\n if (PATTERNS[i] === pattern) {\n return i;\n }\n }\n throw new IllegalArgumentException('Invalid zone offset pattern: ' + pattern);\n }\n\n /**\n * @param {DateTimePrintContext} context\n * @param {StringBuilder} buf\n * @return {boolean}\n */\n print(context, buf) {\n const offsetSecs = context.getValue(ChronoField.OFFSET_SECONDS);\n if (offsetSecs == null) {\n return false;\n }\n const totalSecs = MathUtil.safeToInt(offsetSecs);\n if (totalSecs === 0) {\n buf.append(this.noOffsetText);\n } else {\n const absHours = Math.abs(MathUtil.intMod(MathUtil.intDiv(totalSecs, 3600), 100)); // anything larger than 99 silently dropped\n const absMinutes = Math.abs(MathUtil.intMod(MathUtil.intDiv(totalSecs, 60), 60));\n const absSeconds = Math.abs(MathUtil.intMod(totalSecs, 60));\n const bufPos = buf.length();\n let output = absHours;\n buf.append(totalSecs < 0 ? '-' : '+')\n .appendChar((MathUtil.intDiv(absHours, 10) + '0')).appendChar(MathUtil.intMod(absHours, 10) + '0');\n if (this.type >= 3 || (this.type >= 1 && absMinutes > 0)) {\n buf.append((this.type % 2) === 0 ? ':' : '')\n .appendChar((MathUtil.intDiv(absMinutes, 10) + '0')).appendChar((absMinutes % 10 + '0'));\n output += absMinutes;\n if (this.type >= 7 || (this.type >= 5 && absSeconds > 0)) {\n buf.append((this.type % 2) === 0 ? ':' : '')\n .appendChar((MathUtil.intDiv(absSeconds, 10) + '0')).appendChar((absSeconds % 10 + '0'));\n output += absSeconds;\n }\n }\n if (output === 0) {\n buf.setLength(bufPos);\n buf.append(this.noOffsetText);\n }\n }\n return true;\n }\n\n /**\n * @param {DateTimeParseContext} context\n * @param {String} text\n * @param {number} position\n * @return {number}\n */\n parse(context, text, position) {\n const length = text.length;\n const noOffsetLen = this.noOffsetText.length;\n if (noOffsetLen === 0) {\n if (position === length) {\n return context.setParsedField(ChronoField.OFFSET_SECONDS, 0, position, position);\n }\n } else {\n if (position === length) {\n return ~position;\n }\n if (context.subSequenceEquals(text, position, this.noOffsetText, 0, noOffsetLen)) {\n return context.setParsedField(ChronoField.OFFSET_SECONDS, 0, position, position + noOffsetLen);\n }\n }\n\n // parse normal plus/minus offset\n const sign = text[position]; // IOOBE if invalid position\n if (sign === '+' || sign === '-') {\n // starts\n const negative = (sign === '-' ? -1 : 1);\n const array = [0,0,0,0];\n array[0] = position + 1;\n if ((this._parseNumber(array, 1, text, true) ||\n this._parseNumber(array, 2, text, this.type >=3) ||\n this._parseNumber(array, 3, text, false)) === false) {\n // success\n const offsetSecs = MathUtil.safeZero(negative * (array[1] * 3600 + array[2] * 60 + array[3]));\n return context.setParsedField(ChronoField.OFFSET_SECONDS, offsetSecs, position, array[0]);\n }\n }\n // handle special case of empty no offset text\n if (noOffsetLen === 0) {\n return context.setParsedField(ChronoField.OFFSET_SECONDS, 0, position, position + noOffsetLen);\n }\n return ~position;\n }\n\n /**\n * Parse a two digit zero-prefixed number.\n *\n * @param {number[]} array the array of parsed data, 0=pos,1=hours,2=mins,3=secs, not null\n * @param {number} arrayIndex the index to parse the value into\n * @param {string} parseText the offset ID, not null\n * @param {boolean} required whether this number is required\n * @return {boolean} true if an error occurred\n */\n _parseNumber(array, arrayIndex, parseText, required) {\n if ((this.type + 3) / 2 < arrayIndex) {\n return false; // ignore seconds/minutes\n }\n let pos = array[0];\n if ((this.type % 2) === 0 && arrayIndex > 1) {\n if (pos + 1 > parseText.length || parseText[pos] !== ':') {\n return required;\n }\n pos++;\n }\n if (pos + 2 > parseText.length) {\n return required;\n }\n const ch1 = parseText[pos++];\n const ch2 = parseText[pos++];\n if (ch1 < '0' || ch1 > '9' || ch2 < '0' || ch2 > '9') {\n return required;\n }\n const value = (ch1.charCodeAt(0) - 48) * 10 + (ch2.charCodeAt(0) - 48);\n if (value < 0 || value > 59) {\n return required;\n }\n array[arrayIndex] = value;\n array[0] = pos;\n return false;\n }\n\n\n toString() {\n const converted = this.noOffsetText.replace('\\'', '\\'\\'');\n return 'Offset(' + PATTERNS[this.type] + ',\\'' + converted + '\\')';\n }\n}\nOffsetIdPrinterParser.INSTANCE_ID = new OffsetIdPrinterParser('Z', '+HH:MM:ss');\nOffsetIdPrinterParser.PATTERNS = PATTERNS;\n\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {assert} from '../../assert';\n\nimport {DateTimeException} from '../../errors';\n\n/**\n * Pads the output to a fixed width.\n * @private\n */\nexport class PadPrinterParserDecorator {\n\n /**\n * Constructor.\n *\n * @param printerParser the printer, not null\n * @param padWidth the width to pad to, 1 or greater\n * @param padChar the pad character\n */\n constructor(printerParser, padWidth, padChar) {\n // input checked by DateTimeFormatterBuilder\n this._printerParser = printerParser;\n this._padWidth = padWidth;\n this._padChar = padChar;\n }\n\n print(context, buf) {\n const preLen = buf.length();\n if (this._printerParser.print(context, buf) === false) {\n return false;\n }\n const len = buf.length() - preLen;\n if (len > this._padWidth) {\n throw new DateTimeException(\n `Cannot print as output of ${len} characters exceeds pad width of ${this._padWidth}`);\n }\n for (let i = 0; i < this._padWidth - len; i++) {\n buf.insert(preLen, this._padChar);\n }\n return true;\n }\n\n parse(context, text, position) {\n // cache context before changed by decorated parser\n const strict = context.isStrict();\n const caseSensitive = context.isCaseSensitive();\n // parse\n assert(!(position > text.length));\n assert(position >= 0);\n if (position === text.length) {\n return ~position; // no more characters in the string\n }\n let endPos = position + this._padWidth;\n if (endPos > text.length) {\n if (strict) {\n return ~position; // not enough characters in the string to meet the parse width\n }\n endPos = text.length;\n }\n let pos = position;\n while (pos < endPos &&\n (caseSensitive ? text[pos] === this._padChar : context.charEquals(text[pos], this._padChar))) {\n pos++;\n }\n text = text.substring(0, endPos);\n const resultPos = this._printerParser.parse(context, text, pos);\n if (resultPos !== endPos && strict) {\n return ~(position + pos); // parse of decorated field didn't parse to the end\n }\n return resultPos;\n }\n\n toString() {\n return `Pad(${this._printerParser},${this._padWidth}${(this._padChar === ' ' ? ')' : ',\\'' + this._padChar + '\\')')}`;\n }\n}\n\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { Enum } from '../../Enum';\n\n/**\n * @private\n */\nexport class SettingsParser extends Enum {\n\n print(/*context, buf*/) {\n return true; // nothing to do here\n }\n\n parse(context, text, position) {\n // using ordinals to avoid javac synthetic inner class\n switch (this) {\n case SettingsParser.SENSITIVE: context.setCaseSensitive(true); break;\n case SettingsParser.INSENSITIVE: context.setCaseSensitive(false); break;\n case SettingsParser.STRICT: context.setStrict(true); break;\n case SettingsParser.LENIENT: context.setStrict(false); break;\n }\n return position;\n }\n\n toString() {\n // using ordinals to avoid javac synthetic inner class\n switch (this) {\n case SettingsParser.SENSITIVE: return 'ParseCaseSensitive(true)';\n case SettingsParser.INSENSITIVE: return 'ParseCaseSensitive(false)';\n case SettingsParser.STRICT: return 'ParseStrict(true)';\n case SettingsParser.LENIENT: return 'ParseStrict(false)';\n }\n }\n}\n\nSettingsParser.SENSITIVE = new SettingsParser('SENSITIVE');\nSettingsParser.INSENSITIVE = new SettingsParser('INSENSITIVE');\nSettingsParser.STRICT = new SettingsParser('STRICT');\nSettingsParser.LENIENT = new SettingsParser('LENIENT');\n\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {assert} from '../../assert';\n\n/**\n * Prints or parses a string literal.\n * @private\n */\nexport class StringLiteralPrinterParser {\n\n constructor(literal) {\n this._literal = literal;\n }\n\n print(context, buf) {\n buf.append(this._literal);\n return true;\n }\n\n parse(context, text, position) {\n const length = text.length;\n assert(!(position > length || position < 0));\n\n if (context.subSequenceEquals(text, position, this._literal, 0, this._literal.length) === false) {\n return ~position;\n }\n return position + this._literal.length;\n }\n\n toString() {\n const converted = this._literal.replace(\"'\", \"''\");\n return '\\'' + converted + '\\'';\n }\n}\n\n","/*\n * @copyright (c) 2016, Philipp Thürwächter, Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {DateTimeException} from '../errors';\n\nexport class ZoneRulesProvider {\n /**\n * Gets the rules for the zone ID.\n *\n * This returns the latest available rules for the zone ID.\n *\n * This method relies on time-zone data provider files that are configured.\n *\n * @param {string} zoneId\n * @return {ZoneRules}\n */\n static getRules(zoneId){\n throw new DateTimeException('unsupported ZoneId:' + zoneId);\n }\n\n\n /**\n * Gets the set of available zone IDs.\n *\n * These zone IDs are loaded and available for use by {@link ZoneId}.\n *\n * @return {string[]} a modifiable copy of the set of zone IDs, not null\n */\n static getAvailableZoneIds(){\n return [];\n }\n}\n\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\n\nimport {ZoneId} from './ZoneId';\nimport {ZoneRulesProvider} from './zone/ZoneRulesProvider';\n\n/**\n * A geographical region where the same time-zone rules apply.\n *\n * Time-zone information is categorized as a set of rules defining when and\n * how the offset from UTC/Greenwich changes. These rules are accessed using\n * identifiers based on geographical regions, such as countries or states.\n * The most common region classification is the Time Zone Database (TZDB),\n * which defines regions such as 'Europe/Paris' and 'Asia/Tokyo'.\n *\n * The region identifier, modeled by this class, is distinct from the\n * underlying rules, modeled by {@link ZoneRules}.\n * The rules are defined by governments and change frequently.\n * By contrast, the region identifier is well-defined and long-lived.\n * This separation also allows rules to be shared between regions if appropriate.\n *\n * ### Specification for implementors\n *\n * This class is immutable and thread-safe.\n */\nexport class ZoneRegion extends ZoneId {\n /**\n * not yet implemented\n * @param {string} zoneId\n * @return {ZoneId}\n */\n static ofId(zoneId){\n const rules = ZoneRulesProvider.getRules(zoneId);\n return new ZoneRegion(zoneId, rules);\n }\n\n //-------------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param {string} id the time-zone ID, not null\n * @param {ZoneRules} rules the rules, null for lazy lookup\n * @private\n */\n constructor(id, rules) {\n super();\n this._id = id;\n this._rules = rules;\n }\n\n //-----------------------------------------------------------------------\n /**\n *\n * @returns {string}\n */\n id() {\n return this._id;\n }\n\n /**\n *\n * @returns {ZoneRules}\n */\n rules() {\n return this._rules;\n }\n\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {ZoneOffset} from '../../ZoneOffset';\nimport {ZoneId} from '../../ZoneId';\nimport {ZoneRegion} from '../../ZoneRegion';\n\nimport {ChronoField} from '../../temporal/ChronoField';\n\nimport { ZoneRulesProvider } from '../../zone/ZoneRulesProvider';\n\nimport {OffsetIdPrinterParser} from './OffsetIdPrinterParser';\n\n/**\n * Prints or parses a zone ID.\n * @private\n */\nexport class ZoneIdPrinterParser {\n\n /**\n *\n * @param {TemporalQuery} query\n * @param {string} description\n */\n constructor(query, description) {\n this.query = query;\n this.description = description;\n }\n\n //-----------------------------------------------------------------------\n /**\n *\n * @param {DateTimePrintContext } context\n * @param {StringBuilder} buf\n * @returns {boolean}\n */\n print(context, buf) {\n const zone = context.getValueQuery(this.query);\n if (zone == null) {\n return false;\n }\n buf.append(zone.id());\n return true;\n }\n\n //-----------------------------------------------------------------------\n /**\n * This implementation looks for the longest matching string.\n * For example, parsing Etc/GMT-2 will return Etc/GMC-2 rather than just\n * Etc/GMC although both are valid.\n *\n * This implementation uses a tree to search for valid time-zone names in\n * the parseText. The top level node of the tree has a length equal to the\n * length of the shortest time-zone as well as the beginning characters of\n * all other time-zones.\n *\n * @param {DateTimeParseContext} context\n * @param {String} text\n * @param {number} position\n * @return {number}\n */\n parse(context, text, position) {\n const length = text.length;\n if (position > length) {\n return ~position;\n }\n if (position === length) {\n return ~position;\n }\n\n // handle fixed time-zone IDs\n const nextChar = text.charAt(position);\n if (nextChar === '+' || nextChar === '-') {\n const newContext = context.copy();\n const endPos = OffsetIdPrinterParser.INSTANCE_ID.parse(newContext, text, position);\n if (endPos < 0) {\n return endPos;\n }\n const offset = newContext.getParsed(ChronoField.OFFSET_SECONDS);\n const zone = ZoneOffset.ofTotalSeconds(offset);\n context.setParsedZone(zone);\n return endPos;\n } else if (length >= position + 2) {\n const nextNextChar = text.charAt(position + 1);\n if (context.charEquals(nextChar, 'U') &&\n context.charEquals(nextNextChar, 'T')) {\n if (length >= position + 3 &&\n context.charEquals(text.charAt(position + 2), 'C')) {\n return this._parsePrefixedOffset(context, text, position, position + 3);\n }\n return this._parsePrefixedOffset(context, text, position, position + 2);\n } else if (context.charEquals(nextChar, 'G') &&\n length >= position + 3 &&\n context.charEquals(nextNextChar, 'M') &&\n context.charEquals(text.charAt(position + 2), 'T')) {\n return this._parsePrefixedOffset(context, text, position, position + 3);\n }\n }\n // javascript special case\n if(text.substr(position, 6) === 'SYSTEM'){\n context.setParsedZone(ZoneId.systemDefault());\n return position + 6;\n }\n\n // ...\n if (context.charEquals(nextChar, 'Z')) {\n context.setParsedZone(ZoneOffset.UTC);\n return position + 1;\n }\n\n const availableZoneIds = ZoneRulesProvider.getAvailableZoneIds();\n if (zoneIdTree.size !== availableZoneIds.length) {\n zoneIdTree = ZoneIdTree.createTreeMap(availableZoneIds);\n }\n\n const maxParseLength = length - position;\n let treeMap = zoneIdTree.treeMap;\n let parsedZoneId = null;\n let parseLength = 0;\n while(treeMap != null) {\n const parsedSubZoneId = text.substr(position, Math.min(treeMap.length, maxParseLength));\n treeMap = treeMap.get(parsedSubZoneId);\n if (treeMap != null && treeMap.isLeaf) {\n parsedZoneId = parsedSubZoneId;\n parseLength = treeMap.length;\n }\n }\n if (parsedZoneId != null) {\n context.setParsedZone(ZoneRegion.ofId(parsedZoneId));\n return position + parseLength;\n }\n\n return ~position;\n }\n\n /**\n *\n * @param {DateTimeParseContext} context\n * @param {String} text\n * @param {number} prefixPos\n * @param {number} position\n * @return {number}\n */\n _parsePrefixedOffset(context, text, prefixPos, position) {\n const prefix = text.substring(prefixPos, position).toUpperCase();\n const newContext = context.copy();\n if (position < text.length && context.charEquals(text.charAt(position), 'Z')) {\n context.setParsedZone(ZoneId.ofOffset(prefix, ZoneOffset.UTC));\n return position;\n }\n const endPos = OffsetIdPrinterParser.INSTANCE_ID.parse(newContext, text, position);\n if (endPos < 0) {\n context.setParsedZone(ZoneId.ofOffset(prefix, ZoneOffset.UTC));\n return position;\n }\n const offsetSecs = newContext.getParsed(ChronoField.OFFSET_SECONDS);\n const offset = ZoneOffset.ofTotalSeconds(offsetSecs);\n context.setParsedZone(ZoneId.ofOffset(prefix, offset));\n return endPos;\n }\n\n /**\n *\n * @returns {string}\n */\n toString() {\n return this.description;\n }\n}\n\nclass ZoneIdTree {\n\n static createTreeMap(availableZoneIds) {\n const sortedZoneIds = availableZoneIds.sort((a, b) => a.length - b.length);\n const treeMap = new ZoneIdTreeMap(sortedZoneIds[0].length, false);\n for (let i=0; i this.length) {\n const subZoneId = zoneId.substr(0, this.length);\n let subTreeMap = this._treeMap[subZoneId];\n if (subTreeMap == null) {\n subTreeMap = new ZoneIdTreeMap(idLength, false);\n this._treeMap[subZoneId] = subTreeMap;\n }\n subTreeMap.add(zoneId);\n }\n }\n\n get(zoneId){\n return this._treeMap[zoneId];\n }\n}\n\nlet zoneIdTree = new ZoneIdTree([]);","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {assert, requireNonNull, requireInstance} from '../assert';\nimport {IllegalArgumentException, IllegalStateException} from '../errors';\nimport {MathUtil} from '../MathUtil';\n\nimport {LocalDate} from '../LocalDate';\nimport {LocalDateTime} from '../LocalDateTime';\nimport {ZoneOffset} from '../ZoneOffset';\nimport {ChronoLocalDate} from '../chrono/ChronoLocalDate';\nimport {ChronoField} from '../temporal/ChronoField';\nimport {IsoFields} from '../temporal/IsoFields';\nimport {TemporalQueries} from '../temporal/TemporalQueries';\n\nimport {DateTimeFormatter} from './DateTimeFormatter';\nimport {DecimalStyle} from './DecimalStyle';\nimport {SignStyle} from './SignStyle';\nimport {TextStyle} from './TextStyle';\nimport {ResolverStyle} from './ResolverStyle';\n\nimport {CharLiteralPrinterParser} from './parser/CharLiteralPrinterParser';\nimport {CompositePrinterParser} from './parser/CompositePrinterParser';\nimport {FractionPrinterParser} from './parser/FractionPrinterParser';\nimport {NumberPrinterParser, ReducedPrinterParser} from './parser/NumberPrinterParser';\nimport {OffsetIdPrinterParser} from './parser/OffsetIdPrinterParser';\nimport {PadPrinterParserDecorator} from './parser/PadPrinterParserDecorator';\nimport {SettingsParser} from './parser/SettingsParser';\nimport {StringLiteralPrinterParser} from './parser/StringLiteralPrinterParser';\nimport {ZoneIdPrinterParser} from './parser/ZoneIdPrinterParser';\n\nconst MAX_WIDTH = 15; // can't parse all numbers with more then 15 digits in javascript\n\nexport class DateTimeFormatterBuilder {\n\n /**\n * Constructs a new instance of the builder.\n */\n constructor() {\n /**\n * The currently active builder, used by the outermost builder.\n */\n this._active = this;\n /**\n * The parent builder, null for the outermost builder.\n */\n this._parent = null;\n\n /**\n * The list of printers that will be used.\n */\n this._printerParsers = [];\n\n /**\n * Whether this builder produces an optional formatter.\n */\n this._optional = false;\n /**\n * The width to pad the next field to.\n */\n this._padNextWidth = 0;\n\n /**\n * The character to pad the next field with.\n */\n this._padNextChar = null;\n\n /**\n * The index of the last variable width value parser.\n */\n this._valueParserIndex = -1;\n }\n\n /**\n * Private static factory, replaces private threeten constructor\n * Returns a new instance of the builder.\n *\n * @param {DateTimeFormatterBuilder} parent the parent builder, not null\n * @param {boolean} optional whether the formatter is optional, not null\n * @return {DateTimeFormatterBuilder} new instance\n */\n static _of(parent, optional){\n requireNonNull(parent, 'parent');\n requireNonNull(optional, 'optional');\n\n const dtFormatterBuilder = new DateTimeFormatterBuilder();\n dtFormatterBuilder._parent = parent;\n dtFormatterBuilder._optional = optional;\n\n return dtFormatterBuilder;\n }\n\n /**\n * Changes the parse style to be case sensitive for the remainder of the formatter.\n *\n * Parsing can be case sensitive or insensitive - by default it is case sensitive.\n * This method allows the case sensitivity setting of parsing to be changed.\n *\n * Calling this method changes the state of the builder such that all\n * subsequent builder method calls will parse text in case sensitive mode.\n * See {@link parseCaseInsensitive} for the opposite setting.\n * The parse case sensitive/insensitive methods may be called at any point\n * in the builder, thus the parser can swap between case parsing modes\n * multiple times during the parse.\n *\n * Since the default is case sensitive, this method should only be used after\n * a previous call to {@link parseCaseInsensitive}.\n *\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n */\n parseCaseSensitive() {\n this._appendInternalPrinterParser(SettingsParser.SENSITIVE);\n return this;\n }\n\n /**\n * Changes the parse style to be case insensitive for the remainder of the formatter.\n *\n * Parsing can be case sensitive or insensitive - by default it is case sensitive.\n * This method allows the case sensitivity setting of parsing to be changed.\n *\n * Calling this method changes the state of the builder such that all\n * subsequent builder method calls will parse text in case sensitive mode.\n * See {@link parseCaseSensitive} for the opposite setting.\n * The parse case sensitive/insensitive methods may be called at any point\n * in the builder, thus the parser can swap between case parsing modes\n * multiple times during the parse.\n *\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n */\n parseCaseInsensitive() {\n this._appendInternalPrinterParser(SettingsParser.INSENSITIVE);\n return this;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Changes the parse style to be strict for the remainder of the formatter.\n *\n * Parsing can be strict or lenient - by default its strict.\n * This controls the degree of flexibility in matching the text and sign styles.\n *\n * When used, this method changes the parsing to be strict from this point onwards.\n * As strict is the default, this is normally only needed after calling {@link parseLenient}.\n * The change will remain in force until the end of the formatter that is eventually\n * constructed or until {@link parseLenient} is called.\n *\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n */\n parseStrict() {\n this._appendInternalPrinterParser(SettingsParser.STRICT);\n return this;\n }\n\n /**\n * Changes the parse style to be lenient for the remainder of the formatter.\n * Note that case sensitivity is set separately to this method.\n *\n * Parsing can be strict or lenient - by default its strict.\n * This controls the degree of flexibility in matching the text and sign styles.\n * Applications calling this method should typically also call {@link parseCaseInsensitive}.\n *\n * When used, this method changes the parsing to be strict from this point onwards.\n * The change will remain in force until the end of the formatter that is eventually\n * constructed or until {@link parseStrict} is called.\n *\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n */\n parseLenient() {\n this._appendInternalPrinterParser(SettingsParser.LENIENT);\n return this;\n }\n\n /**\n * appendValue function overloading\n */\n appendValue(){\n if(arguments.length === 1){\n return this._appendValue1.apply(this, arguments);\n } else if(arguments.length === 2){\n return this._appendValue2.apply(this, arguments);\n } else {\n return this._appendValue4.apply(this, arguments);\n }\n }\n\n /**\n * Appends the value of a date-time field to the formatter using a normal\n * output style.\n *\n * The value of the field will be output during a print.\n * If the value cannot be obtained then an exception will be thrown.\n *\n * The value will be printed as per the normal print of an integer value.\n * Only negative numbers will be signed. No padding will be added.\n *\n * The parser for a variable width value such as this normally behaves greedily,\n * requiring one digit, but accepting as many digits as possible.\n * This behavior can be affected by 'adjacent value parsing'.\n * See {@link appendValue} for full details.\n *\n * @param field the field to append, not null\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n */\n _appendValue1(field) {\n requireNonNull(field);\n this._appendValuePrinterParser(new NumberPrinterParser(field, 1, MAX_WIDTH, SignStyle.NORMAL));\n return this;\n }\n\n /**\n * Appends the value of a date-time field to the formatter using a fixed\n * width, zero-padded approach.\n *\n * The value of the field will be output during a print.\n * If the value cannot be obtained then an exception will be thrown.\n *\n * The value will be zero-padded on the left. If the size of the value\n * means that it cannot be printed within the width then an exception is thrown.\n * If the value of the field is negative then an exception is thrown during printing.\n *\n * This method supports a special technique of parsing known as 'adjacent value parsing'.\n * This technique solves the problem where a variable length value is followed by one or more\n * fixed length values. The standard parser is greedy, and thus it would normally\n * steal the digits that are needed by the fixed width value parsers that follow the\n * variable width one.\n *\n * No action is required to initiate 'adjacent value parsing'.\n * When a call to {@link appendValue} with a variable width is made, the builder\n * enters adjacent value parsing setup mode. If the immediately subsequent method\n * call or calls on the same builder are to this method, then the parser will reserve\n * space so that the fixed width values can be parsed.\n *\n * For example, consider `builder.appendValue(YEAR).appendValue(MONTH_OF_YEAR, 2)`.\n * The year is a variable width parse of between 1 and 19 digits.\n * The month is a fixed width parse of 2 digits.\n * Because these were appended to the same builder immediately after one another,\n * the year parser will reserve two digits for the month to parse.\n * Thus, the text '201106' will correctly parse to a year of 2011 and a month of 6.\n * Without adjacent value parsing, the year would greedily parse all six digits and leave\n * nothing for the month.\n *\n * Adjacent value parsing applies to each set of fixed width not-negative values in the parser\n * that immediately follow any kind of variable width value.\n * Calling any other append method will end the setup of adjacent value parsing.\n * Thus, in the unlikely event that you need to avoid adjacent value parsing behavior,\n * simply add the `appendValue` to another {@link DateTimeFormatterBuilder}\n * and add that to this builder.\n *\n * If adjacent parsing is active, then parsing must match exactly the specified\n * number of digits in both strict and lenient modes.\n * In addition, no positive or negative sign is permitted.\n *\n * @param field the field to append, not null\n * @param width the width of the printed field, from 1 to 19\n * @return this, for chaining, not null\n * @throws IllegalArgumentException if the width is invalid\n */\n _appendValue2(field, width) {\n requireNonNull(field);\n if (width < 1 || width > MAX_WIDTH) {\n throw new IllegalArgumentException(`The width must be from 1 to ${MAX_WIDTH} inclusive but was ${width}`);\n }\n const pp = new NumberPrinterParser(field, width, width, SignStyle.NOT_NEGATIVE);\n this._appendValuePrinterParser(pp);\n return this;\n }\n\n /**\n * Appends the value of a date-time field to the formatter providing full\n * control over printing.\n *\n * The value of the field will be output during a print.\n * If the value cannot be obtained then an exception will be thrown.\n *\n * This method provides full control of the numeric formatting, including\n * zero-padding and the positive/negative sign.\n *\n * The parser for a variable width value such as this normally behaves greedily,\n * accepting as many digits as possible.\n * This behavior can be affected by 'adjacent value parsing'.\n * See {@link appendValue} for full details.\n *\n * In strict parsing mode, the minimum number of parsed digits is `minWidth`.\n * In lenient parsing mode, the minimum number of parsed digits is one.\n *\n * If this method is invoked with equal minimum and maximum widths and a sign style of\n * `NOT_NEGATIVE` then it delegates to `appendValue(TemporalField, int)`.\n * In this scenario, the printing and parsing behavior described there occur.\n *\n * @param field the field to append, not null\n * @param minWidth the minimum field width of the printed field, from 1 to 19\n * @param maxWidth the maximum field width of the printed field, from 1 to 19\n * @param signStyle the positive/negative output style, not null\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n * @throws IllegalArgumentException if the widths are invalid\n */\n _appendValue4(field, minWidth, maxWidth, signStyle) {\n requireNonNull(field);\n requireNonNull(signStyle);\n if (minWidth === maxWidth && signStyle === SignStyle.NOT_NEGATIVE) {\n return this._appendValue2(field, maxWidth);\n }\n if (minWidth < 1 || minWidth > MAX_WIDTH) {\n throw new IllegalArgumentException(`The minimum width must be from 1 to ${MAX_WIDTH} inclusive but was ${minWidth}`);\n }\n if (maxWidth < 1 || maxWidth > MAX_WIDTH) {\n throw new IllegalArgumentException(`The minimum width must be from 1 to ${MAX_WIDTH} inclusive but was ${maxWidth}`);\n }\n if (maxWidth < minWidth) {\n throw new IllegalArgumentException(`The maximum width must exceed or equal the minimum width but ${maxWidth} < ${minWidth}`);\n }\n const pp = new NumberPrinterParser(field, minWidth, maxWidth, signStyle);\n this._appendValuePrinterParser(pp);\n return this;\n }\n\n /**\n * appendValueReduced function overloading\n */\n appendValueReduced() {\n if (arguments.length === 4 && arguments[3] instanceof ChronoLocalDate) {\n return this._appendValueReducedFieldWidthMaxWidthBaseDate.apply(this, arguments);\n } else {\n return this._appendValueReducedFieldWidthMaxWidthBaseValue.apply(this, arguments);\n }\n }\n\n /**\n * Appends the reduced value of a date-time field to the formatter.\n *\n * Since fields such as year vary by chronology, it is recommended to use the\n * {@link appendValueReduced} date}\n * variant of this method in most cases. This variant is suitable for\n * simple fields or working with only the ISO chronology.\n *\n * For formatting, the `width` and `maxWidth` are used to\n * determine the number of characters to format.\n * If they are equal then the format is fixed width.\n * If the value of the field is within the range of the `baseValue` using\n * `width` characters then the reduced value is formatted otherwise the value is\n * truncated to fit `maxWidth`.\n * The rightmost characters are output to match the width, left padding with zero.\n *\n * For strict parsing, the number of characters allowed by `width` to `maxWidth` are parsed.\n * For lenient parsing, the number of characters must be at least 1 and less than 10.\n * If the number of digits parsed is equal to `width` and the value is positive,\n * the value of the field is computed to be the first number greater than\n * or equal to the `baseValue` with the same least significant characters,\n * otherwise the value parsed is the field value.\n * This allows a reduced value to be entered for values in range of the baseValue\n * and width and absolute values can be entered for values outside the range.\n *\n * For example, a base value of `1980` and a width of `2` will have\n * valid values from `1980` to `2079`.\n * During parsing, the text `\"12\"` will result in the value `2012` as that\n * is the value within the range where the last two characters are \"12\".\n * By contrast, parsing the text `\"1915\"` will result in the value `1915`.\n *\n * @param {TemporalField} field the field to append, not null\n * @param {number} width the field width of the printed and parsed field, from 1 to 10\n * @param {number} maxWidth the maximum field width of the printed field, from 1 to 10\n * @param {number} baseValue the base value of the range of valid values\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n * @throws IllegalArgumentException if the width or base value is invalid\n */\n _appendValueReducedFieldWidthMaxWidthBaseValue(field, width, maxWidth, baseValue) {\n requireNonNull(field, 'field');\n const pp = new ReducedPrinterParser(field, width, maxWidth, baseValue, null);\n this._appendValuePrinterParser(pp);\n return this;\n }\n\n /**\n * Appends the reduced value of a date-time field to the formatter.\n *\n * This is typically used for formatting and parsing a two digit year.\n *\n * The base date is used to calculate the full value during parsing.\n * For example, if the base date is 1950-01-01 then parsed values for\n * a two digit year parse will be in the range 1950-01-01 to 2049-12-31.\n * Only the year would be extracted from the date, thus a base date of\n * 1950-08-25 would also parse to the range 1950-01-01 to 2049-12-31.\n * This behavior is necessary to support fields such as week-based-year\n * or other calendar systems where the parsed value does not align with\n * standard ISO years.\n *\n * The exact behavior is as follows. Parse the full set of fields and\n * determine the effective chronology using the last chronology if\n * it appears more than once. Then convert the base date to the\n * effective chronology. Then extract the specified field from the\n * chronology-specific base date and use it to determine the\n * `baseValue` used below.\n *\n * For formatting, the `width` and `maxWidth` are used to\n * determine the number of characters to format.\n * If they are equal then the format is fixed width.\n * If the value of the field is within the range of the `baseValue` using\n * `width` characters then the reduced value is formatted otherwise the value is\n * truncated to fit `maxWidth`.\n * The rightmost characters are output to match the width, left padding with zero.\n *\n * For strict parsing, the number of characters allowed by `width` to `maxWidth` are parsed.\n * For lenient parsing, the number of characters must be at least 1 and less than 10.\n * If the number of digits parsed is equal to `width` and the value is positive,\n * the value of the field is computed to be the first number greater than\n * or equal to the `baseValue` with the same least significant characters,\n * otherwise the value parsed is the field value.\n * This allows a reduced value to be entered for values in range of the baseValue\n * and width and absolute values can be entered for values outside the range.\n *\n * For example, a base value of `1980` and a width of `2` will have\n * valid values from `1980` to `2079`.\n * During parsing, the text `\"12\"` will result in the value `2012` as that\n * is the value within the range where the last two characters are \"12\".\n * By contrast, parsing the text `\"1915\"` will result in the value `1915`.\n *\n * @param {TemporalField} field the field to append, not null\n * @param {number} width the field width of the printed and parsed field, from 1 to 10\n * @param {number} maxWidth the maximum field width of the printed field, from 1 to 10\n * @param {ChronoLocalDate} baseDate the base date used to calculate the base value for the range\n * of valid values in the parsed chronology, not null\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n * @throws IllegalArgumentException if the width or base value is invalid\n */\n _appendValueReducedFieldWidthMaxWidthBaseDate(field, width, maxWidth, baseDate) {\n requireNonNull(field, 'field');\n requireNonNull(baseDate, 'baseDate');\n requireInstance(baseDate, ChronoLocalDate, 'baseDate');\n const pp = new ReducedPrinterParser(field, width, maxWidth, 0, baseDate);\n this._appendValuePrinterParser(pp);\n return this;\n }\n\n /**\n * Appends a fixed width printer-parser.\n *\n * @param pp the printer-parser, not null\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n */\n _appendValuePrinterParser(pp) {\n assert(pp != null);\n if (this._active._valueParserIndex >= 0 &&\n this._active._printerParsers[this._active._valueParserIndex] instanceof NumberPrinterParser) {\n const activeValueParser = this._active._valueParserIndex;\n\n // adjacent parsing mode, update setting in previous parsers\n let basePP = this._active._printerParsers[activeValueParser];\n if (pp.minWidth() === pp.maxWidth() && pp.signStyle() === SignStyle.NOT_NEGATIVE) {\n // Append the width to the subsequentWidth of the active parser\n basePP = basePP.withSubsequentWidth(pp.maxWidth());\n // Append the new parser as a fixed width\n this._appendInternal(pp.withFixedWidth());\n // Retain the previous active parser\n this._active._valueParserIndex = activeValueParser;\n } else {\n // Modify the active parser to be fixed width\n basePP = basePP.withFixedWidth();\n // The new parser becomes the mew active parser\n this._active._valueParserIndex = this._appendInternal(pp);\n }\n // Replace the modified parser with the updated one\n this._active._printerParsers[activeValueParser] = basePP;\n } else {\n // The new Parser becomes the active parser\n this._active._valueParserIndex = this._appendInternal(pp);\n }\n return this;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Appends the fractional value of a date-time field to the formatter.\n *\n * The fractional value of the field will be output including the\n * preceding decimal point. The preceding value is not output.\n * For example, the second-of-minute value of 15 would be output as `.25`.\n *\n * The width of the printed fraction can be controlled. Setting the\n * minimum width to zero will cause no output to be generated.\n * The printed fraction will have the minimum width necessary between\n * the minimum and maximum widths - trailing zeroes are omitted.\n * No rounding occurs due to the maximum width - digits are simply dropped.\n *\n * When parsing in strict mode, the number of parsed digits must be between\n * the minimum and maximum width. When parsing in lenient mode, the minimum\n * width is considered to be zero and the maximum is nine.\n *\n * If the value cannot be obtained then an exception will be thrown.\n * If the value is negative an exception will be thrown.\n * If the field does not have a fixed set of valid values then an\n * exception will be thrown.\n * If the field value in the date-time to be printed is invalid it\n * cannot be printed and an exception will be thrown.\n *\n * @param {TemporalField} field the field to append, not null\n * @param {Number} minWidth the minimum width of the field excluding the decimal point, from 0 to 9\n * @param {Number} maxWidth the maximum width of the field excluding the decimal point, from 1 to 9\n * @param {boolean} decimalPoint whether to output the localized decimal point symbol\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n * @throws IllegalArgumentException if the field has a variable set of valid values or\n * either width is invalid\n */\n appendFraction(field, minWidth, maxWidth, decimalPoint) {\n this._appendInternal(new FractionPrinterParser(field, minWidth, maxWidth, decimalPoint));\n return this;\n }\n\n /**\n * Appends an instant using ISO-8601 to the formatter with control over\n * the number of fractional digits.\n *\n * Instants have a fixed output format, although this method provides some\n * control over the fractional digits. They are converted to a date-time\n * with a zone-offset of UTC and printed using the standard ISO-8601 format.\n * The localized decimal style is not used.\n *\n * The {@link this.fractionalDigits} parameter allows the output of the fractional\n * second to be controlled. Specifying zero will cause no fractional digits\n * to be output. From 1 to 9 will output an increasing number of digits, using\n * zero right-padding if necessary. The special value -1 is used to output as\n * many digits as necessary to avoid any trailing zeroes.\n *\n * When parsing in strict mode, the number of parsed digits must match the\n * fractional digits. When parsing in lenient mode, any number of fractional\n * digits from zero to nine are accepted.\n *\n * The instant is obtained using {@link ChronoField#INSTANT_SECONDS}\n * and optionally (@code NANO_OF_SECOND). The value of {@link INSTANT_SECONDS}\n * may be outside the maximum range of {@link LocalDateTime}.\n *\n * The {@link ResolverStyle} has no effect on instant parsing.\n * The end-of-day time of '24:00' is handled as midnight at the start of the following day.\n * The leap-second time of '23:59:59' is handled to some degree, see\n * {@link DateTimeFormatter#parsedLeapSecond} for full details.\n *\n * An alternative to this method is to format/parse the instant as a single\n * epoch-seconds value. That is achieved using `appendValue(INSTANT_SECONDS)`.\n *\n * @param {number} [fractionalDigits=-2] - the number of fractional second digits to format with,\n * from 0 to 9, or -1 to use as many digits as necessary\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n */\n appendInstant(fractionalDigits=-2) {\n if (fractionalDigits < -2 || fractionalDigits > 9) {\n throw new IllegalArgumentException('Invalid fractional digits: ' + fractionalDigits);\n }\n this._appendInternal(new InstantPrinterParser(fractionalDigits));\n return this;\n }\n\n\n /**\n * Appends the zone offset, such as '+01:00', to the formatter.\n *\n * This appends an instruction to print/parse the offset ID to the builder.\n * This is equivalent to calling `appendOffset(\"HH:MM:ss\", \"Z\")`.\n *\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n */\n appendOffsetId() {\n this._appendInternal(OffsetIdPrinterParser.INSTANCE_ID);\n return this;\n }\n\n /**\n * Appends the zone offset, such as '+01:00', to the formatter.\n *\n * This appends an instruction to print/parse the offset ID to the builder.\n *\n * During printing, the offset is obtained using a mechanism equivalent\n * to querying the temporal with {@link TemporalQueries#offset}.\n * It will be printed using the format defined below.\n * If the offset cannot be obtained then an exception is thrown unless the\n * section of the formatter is optional.\n *\n * During parsing, the offset is parsed using the format defined below.\n * If the offset cannot be parsed then an exception is thrown unless the\n * section of the formatter is optional.\n *\n * The format of the offset is controlled by a pattern which must be one\n * of the following:\n *\n * * `+HH` - hour only, ignoring minute and second\n * * `+HHmm` - hour, with minute if non-zero, ignoring second, no colon\n * * `+HH:mm` - hour, with minute if non-zero, ignoring second, with colon\n * * `+HHMM` - hour and minute, ignoring second, no colon\n * * `+HH:MM` - hour and minute, ignoring second, with colon\n * * `+HHMMss` - hour and minute, with second if non-zero, no colon\n * * `+HH:MM:ss` - hour and minute, with second if non-zero, with colon\n * * `+HHMMSS` - hour, minute and second, no colon\n * * `+HH:MM:SS` - hour, minute and second, with colon\n *\n * The \"no offset\" text controls what text is printed when the total amount of\n * the offset fields to be output is zero.\n * Example values would be 'Z', '+00:00', 'UTC' or 'GMT'.\n * Three formats are accepted for parsing UTC - the \"no offset\" text, and the\n * plus and minus versions of zero defined by the pattern.\n *\n * @param {String} pattern the pattern to use, not null\n * @param {String} noOffsetText the text to use when the offset is zero, not null\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n */\n appendOffset(pattern, noOffsetText) {\n this._appendInternalPrinterParser(new OffsetIdPrinterParser(noOffsetText, pattern));\n return this;\n }\n\n /**\n * Appends the time-zone ID, such as 'Europe/Paris' or '+02:00', to the formatter.\n *\n * This appends an instruction to print/parse the zone ID to the builder.\n * The zone ID is obtained in a strict manner suitable for {@link ZonedDateTime}.\n * By contrast, {@link OffsetDateTime} does not have a zone ID suitable\n * for use with this method, see {@link appendZoneOrOffsetId}.\n *\n * During printing, the zone is obtained using a mechanism equivalent\n * to querying the temporal with {@link TemporalQueries#zoneId}.\n * It will be printed using the result of {@link ZoneId#getId}.\n * If the zone cannot be obtained then an exception is thrown unless the\n * section of the formatter is optional.\n *\n * During parsing, the zone is parsed and must match a known zone or offset.\n * If the zone cannot be parsed then an exception is thrown unless the\n * section of the formatter is optional.\n *\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n * @see #appendZoneRegionId()\n */\n appendZoneId() {\n this._appendInternal(new ZoneIdPrinterParser(TemporalQueries.zoneId(), 'ZoneId()'));\n return this;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Appends the elements defined by the specified pattern to the builder.\n *\n * All letters 'A' to 'Z' and 'a' to 'z' are reserved as pattern letters.\n * The characters '{' and '}' are reserved for future use.\n * The characters '[' and ']' indicate optional patterns.\n * The following pattern letters are defined:\n *

\n     *  |Symbol  |Meaning                     |Presentation      |Examples\n     *  |--------|----------------------------|------------------|----------------------------------------------------\n     *  | G      | era                        | number/text      | 1; 01; AD; Anno Domini\n     *  | u      | year                       | year             | 2004; 04\n     *  | y      | year-of-era                | year             | 2004; 04\n     *  | D      | day-of-year                | number           | 189\n     *  | M      | month-of-year              | number/text      | 7; 07; Jul; July; J\n     *  | d      | day-of-month               | number           | 10\n     *  |        |                            |                  |\n     *  | Q      | quarter-of-year            | number/text      | 3; 03; Q3\n     *  | Y      | week-based-year            | year             | 1996; 96\n     *  | w      | week-of-year               | number           | 27\n     *  | W      | week-of-month              | number           | 27\n     *  | e      | localized day-of-week      | number           | 2; Tue; Tuesday; T\n     *  | E      | day-of-week                | number/text      | 2; Tue; Tuesday; T\n     *  | F      | week-of-month              | number           | 3\n     *  |        |                            |                  |\n     *  | a      | am-pm-of-day               | text             | PM\n     *  | h      | clock-hour-of-am-pm (1-12) | number           | 12\n     *  | K      | hour-of-am-pm (0-11)       | number           | 0\n     *  | k      | clock-hour-of-am-pm (1-24) | number           | 0\n     *  |        |                            |                  |\n     *  | H      | hour-of-day (0-23)         | number           | 0\n     *  | m      | minute-of-hour             | number           | 30\n     *  | s      | second-of-minute           | number           | 55\n     *  | S      | fraction-of-second         | fraction         | 978\n     *  | A      | milli-of-day               | number           | 1234\n     *  | n      | nano-of-second             | number           | 987654321\n     *  | N      | nano-of-day                | number           | 1234000000\n     *  |        |                            |                  |\n     *  | V      | time-zone ID               | zone-id          | America/Los_Angeles; Z; -08:30\n     *  | z      | time-zone name             | zone-name        | Pacific Standard Time; PST\n     *  | X      | zone-offset 'Z' for zero   | offset-X         | Z; -08; -0830; -08:30; -083015; -08:30:15;\n     *  | x      | zone-offset                | offset-x         | +0000; -08; -0830; -08:30; -083015; -08:30:15;\n     *  | Z      | zone-offset                | offset-Z         | +0000; -0800; -08:00;\n     *  |        |                            |                  |\n     *  | p      | pad next                   | pad modifier     | 1\n     *  |        |                            |                  |\n     *  | '      | escape for text            | delimiter        |\n     *  | ''     | single quote               | literal          | '\n     *  | [      | optional section start     |                  |\n     *  | ]      | optional section end       |                  |\n     *  | {}     | reserved for future use    |                  |\n     * 
\n *\n * The count of pattern letters determine the format.\n *\n * **Text**: The text style is determined based on the number of pattern letters used.\n * Less than 4 pattern letters will use the short form (see {@link TextStyle#SHORT}).\n * Exactly 4 pattern letters will use the full form (see {@link TextStyle#FULL}).\n * Exactly 5 pattern letters will use the narrow form (see {@link TextStyle#NARROW}).\n *\n * **Number**: If the count of letters is one, then the value is printed using the minimum number\n * of digits and without padding as per {@link appendValue}. Otherwise, the\n * count of digits is used as the width of the output field as per {@link appendValue}.\n *\n * **Number/Text**: If the count of pattern letters is 3 or greater, use the Text rules above.\n * Otherwise use the Number rules above.\n *\n * **Fraction**: Outputs the nano-of-second field as a fraction-of-second.\n * The nano-of-second value has nine digits, thus the count of pattern letters is from 1 to 9.\n * If it is less than 9, then the nano-of-second value is truncated, with only the most\n * significant digits being output.\n * When parsing in strict mode, the number of parsed digits must match the count of pattern letters.\n * When parsing in lenient mode, the number of parsed digits must be at least the count of pattern\n * letters, up to 9 digits.\n *\n * **Year**: The count of letters determines the minimum field width below which padding is used.\n * If the count of letters is two, then a reduced (see {@link appendValueReduced}) two digit form is used.\n * For printing, this outputs the rightmost two digits. For parsing, this will parse using the\n * base value of 2000, resulting in a year within the range 2000 to 2099 inclusive.\n * If the count of letters is less than four (but not two), then the sign is only output for negative\n * years as per {@link SignStyle#NORMAL}.\n * Otherwise, the sign is output if the pad width is exceeded, as per {@link SignStyle#EXCEEDS_PAD}\n *\n * **ZoneId**: This outputs the time-zone ID, such as 'Europe/Paris'.\n * If the count of letters is two, then the time-zone ID is output.\n * Any other count of letters throws {@link IllegalArgumentException}.\n *
\n     *  Pattern     Equivalent builder methods\n     *   VV          appendZoneId()\n     * 
\n *\n * **Zone names**: This outputs the display name of the time-zone ID.\n * If the count of letters is one, two or three, then the short name is output.\n * If the count of letters is four, then the full name is output.\n * Five or more letters throws {@link IllegalArgumentException}.\n *
\n     *  Pattern     Equivalent builder methods\n     *   z           appendZoneText(TextStyle.SHORT)\n     *   zz          appendZoneText(TextStyle.SHORT)\n     *   zzz         appendZoneText(TextStyle.SHORT)\n     *   zzzz        appendZoneText(TextStyle.FULL)\n     * 
\n *\n * **Offset X and x**: This formats the offset based on the number of pattern letters.\n * One letter outputs just the hour', such as '+01', unless the minute is non-zero\n * in which case the minute is also output, such as '+0130'.\n * Two letters outputs the hour and minute, without a colon, such as '+0130'.\n * Three letters outputs the hour and minute, with a colon, such as '+01:30'.\n * Four letters outputs the hour and minute and optional second, without a colon, such as '+013015'.\n * Five letters outputs the hour and minute and optional second, with a colon, such as '+01:30:15'.\n * Six or more letters throws {@link IllegalArgumentException}.\n * Pattern letter 'X' (upper case) will output 'Z' when the offset to be output would be zero,\n * whereas pattern letter 'x' (lower case) will output '+00', '+0000', or '+00:00'.\n *
\n     *  Pattern     Equivalent builder methods\n     *   X           appendOffset(\"+HHmm\",\"Z\")\n     *   XX          appendOffset(\"+HHMM\",\"Z\")\n     *   XXX         appendOffset(\"+HH:MM\",\"Z\")\n     *   XXXX        appendOffset(\"+HHMMss\",\"Z\")\n     *   XXXXX       appendOffset(\"+HH:MM:ss\",\"Z\")\n     *   x           appendOffset(\"+HHmm\",\"+00\")\n     *   xx          appendOffset(\"+HHMM\",\"+0000\")\n     *   xxx         appendOffset(\"+HH:MM\",\"+00:00\")\n     *   xxxx        appendOffset(\"+HHMMss\",\"+0000\")\n     *   xxxxx       appendOffset(\"+HH:MM:ss\",\"+00:00\")\n     * 
\n *\n * **Offset Z**: This formats the offset based on the number of pattern letters.\n * One, two or three letters outputs the hour and minute, without a colon, such as '+0130'.\n * Four or more letters throws {@link IllegalArgumentException}.\n * The output will be '+0000' when the offset is zero.\n *
\n     *  Pattern     Equivalent builder methods\n     *   Z           appendOffset(\"+HHMM\",\"+0000\")\n     *   ZZ          appendOffset(\"+HHMM\",\"+0000\")\n     *   ZZZ         appendOffset(\"+HHMM\",\"+0000\")\n     * 
\n *\n * **Optional section**: The optional section markers work exactly like calling {@link optionalStart}\n * and {@link optionalEnd}.\n *\n * **Pad modifier**: Modifies the pattern that immediately follows to be padded with spaces.\n * The pad width is determined by the number of pattern letters.\n * This is the same as calling {@link padNext}.\n *\n * For example, 'ppH' outputs the hour-of-day padded on the left with spaces to a width of 2.\n *\n * Any unrecognized letter is an error.\n * Any non-letter character, other than '[', ']', '{', '}' and the single quote will be output directly.\n * Despite this, it is recommended to use single quotes around all characters that you want to\n * output directly to ensure that future changes do not break your application.\n *\n * Note that the pattern string is similar, but not identical, to\n * {@link java.text.SimpleDateFormat}.\n * The pattern string is also similar, but not identical, to that defined by the\n * Unicode Common Locale Data Repository (CLDR/LDML).\n * Pattern letters 'E' and 'u' are merged, which changes the meaning of \"E\" and \"EE\" to be numeric.\n * Pattern letters 'X' is aligned with Unicode CLDR/LDML, which affects pattern 'X'.\n * Pattern letter 'y' and 'Y' parse years of two digits and more than 4 digits differently.\n * Pattern letters 'n', 'A', 'N', 'I' and 'p' are added.\n * Number types will reject large numbers.\n *\n * @param {String} pattern the pattern to add, not null\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n * @throws IllegalArgumentException if the pattern is invalid\n */\n appendPattern(pattern) {\n requireNonNull(pattern, 'pattern');\n this._parsePattern(pattern);\n return this;\n }\n\n\n //-----------------------------------------------------------------------\n // empty implementations of locale functionality, be implemented/overridden by js-joda-locale\n\n appendZoneText() {\n throw new IllegalArgumentException('Pattern using (localized) text not implemented, use js-joda-locale plugin!');\n }\n\n appendText() {\n throw new IllegalArgumentException('Pattern using (localized) text not implemented, use js-joda-locale plugin!');\n }\n\n appendLocalizedOffset() {\n throw new IllegalArgumentException('Pattern using (localized) text not implemented, use js-joda-locale plugin!');\n }\n\n appendWeekField() {\n throw new IllegalArgumentException('Pattern using (localized) text not implemented, use js-joda-locale plugin!');\n }\n\n //-----------------------------------------------------------------------\n\n _parsePattern(pattern) {\n /** Map of letters to fields. */\n const FIELD_MAP = {\n 'G': ChronoField.ERA,\n 'y': ChronoField.YEAR_OF_ERA,\n 'u': ChronoField.YEAR,\n 'Q': IsoFields.QUARTER_OF_YEAR,\n 'q': IsoFields.QUARTER_OF_YEAR,\n 'M': ChronoField.MONTH_OF_YEAR,\n 'L': ChronoField.MONTH_OF_YEAR,\n 'D': ChronoField.DAY_OF_YEAR,\n 'd': ChronoField.DAY_OF_MONTH,\n 'F': ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH,\n 'E': ChronoField.DAY_OF_WEEK,\n 'c': ChronoField.DAY_OF_WEEK,\n 'e': ChronoField.DAY_OF_WEEK,\n 'a': ChronoField.AMPM_OF_DAY,\n 'H': ChronoField.HOUR_OF_DAY,\n 'k': ChronoField.CLOCK_HOUR_OF_DAY,\n 'K': ChronoField.HOUR_OF_AMPM,\n 'h': ChronoField.CLOCK_HOUR_OF_AMPM,\n 'm': ChronoField.MINUTE_OF_HOUR,\n 's': ChronoField.SECOND_OF_MINUTE,\n 'S': ChronoField.NANO_OF_SECOND,\n 'A': ChronoField.MILLI_OF_DAY,\n 'n': ChronoField.NANO_OF_SECOND,\n 'N': ChronoField.NANO_OF_DAY\n };\n\n for (let pos = 0; pos < pattern.length; pos++) {\n let cur = pattern.charAt(pos);\n if ((cur >= 'A' && cur <= 'Z') || (cur >= 'a' && cur <= 'z')) {\n let start = pos++;\n for (; pos < pattern.length && pattern.charAt(pos) === cur; pos++); // short loop\n let count = pos - start;\n // padding\n if (cur === 'p') {\n let pad = 0;\n if (pos < pattern.length) {\n cur = pattern.charAt(pos);\n if ((cur >= 'A' && cur <= 'Z') || (cur >= 'a' && cur <= 'z')) {\n pad = count;\n start = pos++;\n for (; pos < pattern.length && pattern.charAt(pos) === cur; pos++); // short loop\n count = pos - start;\n }\n }\n if (pad === 0) {\n throw new IllegalArgumentException(\n 'Pad letter \\'p\\' must be followed by valid pad pattern: ' + pattern);\n }\n this.padNext(pad); // pad and continue parsing\n }\n // main rules\n const field = FIELD_MAP[cur];\n if (field != null) {\n this._parseField(cur, count, field);\n } else if (cur === 'z') {\n if (count > 4) {\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n } else if (count === 4) {\n this.appendZoneText(TextStyle.FULL);\n } else {\n this.appendZoneText(TextStyle.SHORT);\n }\n } else if (cur === 'V') {\n if (count !== 2) {\n throw new IllegalArgumentException('Pattern letter count must be 2: ' + cur);\n }\n this.appendZoneId();\n } else if (cur === 'Z') {\n if (count < 4) {\n this.appendOffset('+HHMM', '+0000');\n } else if (count === 4) {\n this.appendLocalizedOffset(TextStyle.FULL);\n } else if (count === 5) {\n this.appendOffset('+HH:MM:ss', 'Z');\n } else {\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n } else if (cur === 'O') {\n if (count === 1) {\n this.appendLocalizedOffset(TextStyle.SHORT);\n } else if (count === 4) {\n this.appendLocalizedOffset(TextStyle.FULL);\n } else {\n throw new IllegalArgumentException('Pattern letter count must be 1 or 4: ' + cur);\n }\n } else if (cur === 'X') {\n if (count > 5) {\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n this.appendOffset(OffsetIdPrinterParser.PATTERNS[count + (count === 1 ? 0 : 1)], 'Z');\n } else if (cur === 'x') {\n if (count > 5) {\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n const zero = (count === 1 ? '+00' : (count % 2 === 0 ? '+0000' : '+00:00'));\n this.appendOffset(OffsetIdPrinterParser.PATTERNS[count + (count === 1 ? 0 : 1)], zero);\n } else if (cur === 'W') {\n if (count > 1) {\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n this.appendWeekField('W', count);\n } else if (cur === 'w') {\n if (count > 2) {\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n this.appendWeekField('w', count);\n } else if (cur === 'Y') {\n this.appendWeekField('Y', count);\n } else {\n throw new IllegalArgumentException('Unknown pattern letter: ' + cur);\n }\n pos--;\n\n } else if (cur === '\\'') {\n // parse literals\n const start = pos++;\n for (; pos < pattern.length; pos++) {\n if (pattern.charAt(pos) === '\\'') {\n if (pos + 1 < pattern.length && pattern.charAt(pos + 1) === '\\'') {\n pos++;\n } else {\n break; // end of literal\n }\n }\n }\n if (pos >= pattern.length) {\n throw new IllegalArgumentException('Pattern ends with an incomplete string literal: ' + pattern);\n }\n const str = pattern.substring(start + 1, pos);\n if (str.length === 0) {\n this.appendLiteral('\\'');\n } else {\n this.appendLiteral(str.replace('\\'\\'', '\\''));\n }\n\n } else if (cur === '[') {\n this.optionalStart();\n\n } else if (cur === ']') {\n if (this._active._parent === null) {\n throw new IllegalArgumentException('Pattern invalid as it contains ] without previous [');\n }\n this.optionalEnd();\n\n } else if (cur === '{' || cur === '}' || cur === '#') {\n throw new IllegalArgumentException('Pattern includes reserved character: \\'' + cur + '\\'');\n } else {\n this.appendLiteral(cur);\n }\n }\n }\n\n _parseField(cur, count, field) {\n switch (cur) {\n case 'u':\n case 'y':\n if (count === 2) {\n this.appendValueReduced(field, 2, 2, ReducedPrinterParser.BASE_DATE);\n } else if (count < 4) {\n this.appendValue(field, count, MAX_WIDTH, SignStyle.NORMAL);\n } else {\n this.appendValue(field, count, MAX_WIDTH, SignStyle.EXCEEDS_PAD);\n }\n break;\n case 'M':\n case 'Q':\n switch (count) {\n case 1:\n this.appendValue(field);\n break;\n case 2:\n this.appendValue(field, 2);\n break;\n case 3:\n this.appendText(field, TextStyle.SHORT);\n break;\n case 4:\n this.appendText(field, TextStyle.FULL);\n break;\n case 5:\n this.appendText(field, TextStyle.NARROW);\n break;\n default:\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n break;\n case 'L':\n case 'q':\n switch (count) {\n case 1:\n this.appendValue(field);\n break;\n case 2:\n this.appendValue(field, 2);\n break;\n case 3:\n this.appendText(field, TextStyle.SHORT_STANDALONE);\n break;\n case 4:\n this.appendText(field, TextStyle.FULL_STANDALONE);\n break;\n case 5:\n this.appendText(field, TextStyle.NARROW_STANDALONE);\n break;\n default:\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n break;\n case 'e':\n switch (count) {\n case 1:\n case 2:\n this.appendWeekField('e', count);\n break;\n case 3:\n this.appendText(field, TextStyle.SHORT);\n break;\n case 4:\n this.appendText(field, TextStyle.FULL);\n break;\n case 5:\n this.appendText(field, TextStyle.NARROW);\n break;\n default:\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n // eslint-disable-next-line no-unreachable\n break;\n case 'c':\n switch (count) {\n case 1:\n this.appendWeekField('c', count);\n break;\n case 2:\n throw new IllegalArgumentException('Invalid number of pattern letters: ' + cur);\n case 3:\n this.appendText(field, TextStyle.SHORT_STANDALONE);\n break;\n case 4:\n this.appendText(field, TextStyle.FULL_STANDALONE);\n break;\n case 5:\n this.appendText(field, TextStyle.NARROW_STANDALONE);\n break;\n default:\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n // eslint-disable-next-line no-unreachable\n break;\n case 'a':\n if (count === 1) {\n this.appendText(field, TextStyle.SHORT);\n } else {\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n // eslint-disable-next-line no-unreachable\n break;\n case 'E':\n case 'G':\n switch (count) {\n case 1:\n case 2:\n case 3:\n this.appendText(field, TextStyle.SHORT);\n break;\n case 4:\n this.appendText(field, TextStyle.FULL);\n break;\n case 5:\n this.appendText(field, TextStyle.NARROW);\n break;\n default:\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n // eslint-disable-next-line no-unreachable\n break;\n case 'S':\n this.appendFraction(ChronoField.NANO_OF_SECOND, count, count, false);\n break;\n case 'F':\n if (count === 1) {\n this.appendValue(field);\n } else {\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n break;\n case 'd':\n case 'h':\n case 'H':\n case 'k':\n case 'K':\n case 'm':\n case 's':\n if (count === 1) {\n this.appendValue(field);\n } else if (count === 2) {\n this.appendValue(field, count);\n } else {\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n break;\n case 'D':\n if (count === 1) {\n this.appendValue(field);\n } else if (count <= 3) {\n this.appendValue(field, count);\n } else {\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n break;\n default:\n if (count === 1) {\n this.appendValue(field);\n } else {\n this.appendValue(field, count);\n }\n break;\n }\n }\n\n /**\n * padNext function overloading\n */\n padNext() {\n if (arguments.length === 1) {\n return this._padNext1.apply(this, arguments);\n } else {\n return this._padNext2.apply(this, arguments);\n }\n }\n\n /**\n * Causes the next added printer/parser to pad to a fixed width using a space.\n *\n * This padding will pad to a fixed width using spaces.\n *\n * During formatting, the decorated element will be output and then padded\n * to the specified width. An exception will be thrown during printing if\n * the pad width is exceeded.\n *\n * During parsing, the padding and decorated element are parsed.\n * If parsing is lenient, then the pad width is treated as a maximum.\n * If parsing is case insensitive, then the pad character is matched ignoring case.\n * The padding is parsed greedily. Thus, if the decorated element starts with\n * the pad character, it will not be parsed.\n *\n * @param {number} padWidth the pad width, 1 or greater\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n * @throws IllegalArgumentException if pad width is too small\n */\n _padNext1(padWidth) {\n return this._padNext2(padWidth, ' ');\n }\n\n /**\n * Causes the next added printer/parser to pad to a fixed width.\n *\n * This padding is intended for padding other than zero-padding.\n * Zero-padding should be achieved using the appendValue methods.\n *\n * During formatting, the decorated element will be output and then padded\n * to the specified width. An exception will be thrown during printing if\n * the pad width is exceeded.\n *\n * During parsing, the padding and decorated element are parsed.\n * If parsing is lenient, then the pad width is treated as a maximum.\n * If parsing is case insensitive, then the pad character is matched ignoring case.\n * The padding is parsed greedily. Thus, if the decorated element starts with\n * the pad character, it will not be parsed.\n *\n * @param {number} padWidth the pad width, 1 or greater\n * @param {String} padChar the pad character\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n * @throws IllegalArgumentException if pad width is too small\n */\n _padNext2(padWidth, padChar) {\n if (padWidth < 1) {\n throw new IllegalArgumentException('The pad width must be at least one but was ' + padWidth);\n }\n this._active._padNextWidth = padWidth;\n this._active._padNextChar = padChar;\n this._active._valueParserIndex = -1;\n return this;\n }\n\n\n //-----------------------------------------------------------------------\n /**\n * Mark the start of an optional section.\n *\n * The output of printing can include optional sections, which may be nested.\n * An optional section is started by calling this method and ended by calling\n * {@link optionalEnd} or by ending the build process.\n *\n * All elements in the optional section are treated as optional.\n * During printing, the section is only output if data is available in the\n * {@link TemporalAccessor} for all the elements in the section.\n * During parsing, the whole section may be missing from the parsed string.\n *\n * For example, consider a builder setup as\n * `builder.appendValue(HOUR_OF_DAY,2).optionalStart().appendValue(MINUTE_OF_HOUR,2)`.\n * The optional section ends automatically at the end of the builder.\n * During printing, the minute will only be output if its value can be obtained from the date-time.\n * During parsing, the input will be successfully parsed whether the minute is present or not.\n *\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n */\n optionalStart() {\n this._active._valueParserIndex = -1;\n this._active = DateTimeFormatterBuilder._of(this._active, true);\n return this;\n }\n\n /**\n * Ends an optional section.\n *\n * The output of printing can include optional sections, which may be nested.\n * An optional section is started by calling {@link optionalStart} and ended\n * using this method (or at the end of the builder).\n *\n * Calling this method without having previously called `optionalStart`\n * will throw an exception.\n * Calling this method immediately after calling `optionalStart` has no effect\n * on the formatter other than ending the (empty) optional section.\n *\n * All elements in the optional section are treated as optional.\n * During printing, the section is only output if data is available in the\n * {@link TemporalAccessor} for all the elements in the section.\n * During parsing, the whole section may be missing from the parsed string.\n *\n * For example, consider a builder setup as\n * `builder.appendValue(HOUR_OF_DAY,2).optionalStart().appendValue(MINUTE_OF_HOUR,2).optionalEnd()`.\n * During printing, the minute will only be output if its value can be obtained from the date-time.\n * During parsing, the input will be successfully parsed whether the minute is present or not.\n *\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n * @throws IllegalStateException if there was no previous call to `optionalStart`\n */\n optionalEnd() {\n if (this._active._parent == null) {\n throw new IllegalStateException('Cannot call optionalEnd() as there was no previous call to optionalStart()');\n }\n if (this._active._printerParsers.length > 0) {\n const cpp = new CompositePrinterParser(this._active._printerParsers, this._active._optional);\n this._active = this._active._parent;\n this._appendInternal(cpp);\n } else {\n this._active = this._active._parent;\n }\n return this;\n }\n\n /**\n * Appends a printer and/or parser to the internal list handling padding.\n *\n * @param pp the printer-parser to add, not null\n * @return the index into the active parsers list\n */\n _appendInternal(pp) {\n assert(pp != null);\n if (this._active._padNextWidth > 0) {\n if (pp != null) {\n pp = new PadPrinterParserDecorator(pp, this._active._padNextWidth, this._active._padNextChar);\n }\n this._active._padNextWidth = 0;\n this._active._padNextChar = 0;\n }\n this._active._printerParsers.push(pp);\n this._active._valueParserIndex = -1;\n return this._active._printerParsers.length - 1;\n }\n\n /**\n * Appends a string literal to the formatter.\n *\n * This string will be output during a print.\n *\n * If the literal is empty, nothing is added to the formatter.\n *\n * @param literal the literal to append, not null\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n */\n appendLiteral(literal) {\n assert(literal != null);\n if (literal.length > 0) {\n if (literal.length === 1) {\n this._appendInternalPrinterParser(new CharLiteralPrinterParser(literal.charAt(0)));\n } else {\n this._appendInternalPrinterParser(new StringLiteralPrinterParser(literal));\n }\n }\n return this;\n }\n\n /**\n * Appends a printer and/or parser to the internal list handling padding.\n *\n * @param pp the printer-parser to add, not null\n * @return the index into the active parsers list\n */\n _appendInternalPrinterParser(pp) {\n assert(pp != null);\n if (this._active._padNextWidth > 0) {\n if (pp != null) {\n pp = new PadPrinterParserDecorator(pp, this._active._padNextWidth, this._active._padNextChar);\n }\n this._active._padNextWidth = 0;\n this._active._padNextChar = 0;\n }\n this._active._printerParsers.push(pp);\n this._active._valueParserIndex = -1;\n return this._active._printerParsers.length - 1;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Appends all the elements of a formatter to the builder.\n *\n * This method has the same effect as appending each of the constituent\n * parts of the formatter directly to this builder.\n *\n * @param {DateTimeFormatter} formatter the formatter to add, not null\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n */\n append(formatter) {\n requireNonNull(formatter, 'formatter');\n this._appendInternal(formatter._toPrinterParser(false));\n return this;\n }\n\n /**\n * Completes this builder by creating the DateTimeFormatter.\n *\n * This will create a formatter with the specified locale.\n * Numbers will be printed and parsed using the standard non-localized set of symbols.\n *\n * Calling this method will end any open optional sections by repeatedly\n * calling {@link optionalEnd} before creating the formatter.\n *\n * This builder can still be used after creating the formatter if desired,\n * although the state may have been changed by calls to `optionalEnd`.\n *\n * @param resolverStyle the new resolver style\n * @return the created formatter, not null\n */\n toFormatter(resolverStyle=ResolverStyle.SMART) {\n while (this._active._parent != null) {\n this.optionalEnd();\n }\n const pp = new CompositePrinterParser(this._printerParsers, false);\n return new DateTimeFormatter(pp, null, DecimalStyle.STANDARD, resolverStyle, null, null, null);\n }\n\n}\n\n// days in a 400 year cycle = 146097\n// days in a 10,000 year cycle = 146097 * 25\n// seconds per day = 86400\nconst SECONDS_PER_10000_YEARS = 146097 * 25 * 86400;\nconst SECONDS_0000_TO_1970 = ((146097 * 5) - (30 * 365 + 7)) * 86400;\n\n/**\n * Prints or parses an ISO-8601 instant.\n */\nclass InstantPrinterParser {\n\n constructor(fractionalDigits) {\n this.fractionalDigits = fractionalDigits;\n }\n\n print(context, buf) {\n // use INSTANT_SECONDS, thus this code is not bound by Instant.MAX\n const inSecs = context.getValue(ChronoField.INSTANT_SECONDS);\n let inNanos = 0;\n if (context.temporal().isSupported(ChronoField.NANO_OF_SECOND)) {\n inNanos = context.temporal().getLong(ChronoField.NANO_OF_SECOND);\n }\n if (inSecs == null) {\n return false;\n }\n const inSec = inSecs;\n let inNano = ChronoField.NANO_OF_SECOND.checkValidIntValue(inNanos);\n if (inSec >= -SECONDS_0000_TO_1970) {\n // current era\n const zeroSecs = inSec - SECONDS_PER_10000_YEARS + SECONDS_0000_TO_1970;\n const hi = MathUtil.floorDiv(zeroSecs, SECONDS_PER_10000_YEARS) + 1;\n const lo = MathUtil.floorMod(zeroSecs, SECONDS_PER_10000_YEARS);\n const ldt = LocalDateTime.ofEpochSecond(lo - SECONDS_0000_TO_1970, 0, ZoneOffset.UTC);\n if (hi > 0) {\n buf.append('+').append(hi);\n }\n buf.append(ldt);\n if (ldt.second() === 0) {\n buf.append(':00');\n }\n } else {\n // before current era\n const zeroSecs = inSec + SECONDS_0000_TO_1970;\n const hi = MathUtil.intDiv(zeroSecs, SECONDS_PER_10000_YEARS);\n const lo = MathUtil.intMod(zeroSecs, SECONDS_PER_10000_YEARS);\n const ldt = LocalDateTime.ofEpochSecond(lo - SECONDS_0000_TO_1970, 0, ZoneOffset.UTC);\n const pos = buf.length();\n buf.append(ldt);\n if (ldt.second() === 0) {\n buf.append(':00');\n }\n if (hi < 0) {\n if (ldt.year() === -10000) {\n buf.replace(pos, pos + 2, '' + (hi - 1));\n } else if (lo === 0) {\n buf.insert(pos, hi);\n } else {\n buf.insert(pos + 1, Math.abs(hi));\n }\n }\n }\n //fraction\n if (this.fractionalDigits === -2) {\n if (inNano !== 0) {\n buf.append('.');\n if (MathUtil.intMod(inNano, 1000000) === 0) {\n buf.append(('' + (MathUtil.intDiv(inNano, 1000000) + 1000)).substring(1));\n } else if (MathUtil.intMod(inNano, 1000) === 0) {\n buf.append(('' + (MathUtil.intDiv(inNano, 1000) + 1000000)).substring(1));\n } else {\n buf.append(('' + ((inNano) + 1000000000)).substring(1));\n }\n }\n } else if (this.fractionalDigits > 0 || (this.fractionalDigits === -1 && inNano > 0)) {\n buf.append('.');\n let div = 100000000;\n for (let i = 0; ((this.fractionalDigits === -1 && inNano > 0) || i < this.fractionalDigits); i++) {\n const digit = MathUtil.intDiv(inNano, div);\n buf.append(digit);\n inNano = inNano - (digit * div);\n div = MathUtil.intDiv(div, 10);\n }\n }\n buf.append('Z');\n return true;\n }\n\n parse(context, text, position) {\n // new context to avoid overwriting fields like year/month/day\n const newContext = context.copy();\n const minDigits = (this.fractionalDigits < 0 ? 0 : this.fractionalDigits);\n const maxDigits = (this.fractionalDigits < 0 ? 9 : this.fractionalDigits);\n const parser = new DateTimeFormatterBuilder()\n .append(DateTimeFormatter.ISO_LOCAL_DATE).appendLiteral('T')\n .appendValue(ChronoField.HOUR_OF_DAY, 2).appendLiteral(':').appendValue(ChronoField.MINUTE_OF_HOUR, 2).appendLiteral(':')\n .appendValue(ChronoField.SECOND_OF_MINUTE, 2).appendFraction(ChronoField.NANO_OF_SECOND, minDigits, maxDigits, true).appendLiteral('Z')\n .toFormatter()._toPrinterParser(false);\n const pos = parser.parse(newContext, text, position);\n if (pos < 0) {\n return pos;\n }\n // parser restricts most fields to 2 digits, so definitely int\n // correctly parsed nano is also guaranteed to be valid\n const yearParsed = newContext.getParsed(ChronoField.YEAR);\n const month = newContext.getParsed(ChronoField.MONTH_OF_YEAR);\n const day = newContext.getParsed(ChronoField.DAY_OF_MONTH);\n let hour = newContext.getParsed(ChronoField.HOUR_OF_DAY);\n const min = newContext.getParsed(ChronoField.MINUTE_OF_HOUR);\n const secVal = newContext.getParsed(ChronoField.SECOND_OF_MINUTE);\n const nanoVal = newContext.getParsed(ChronoField.NANO_OF_SECOND);\n let sec = (secVal != null ? secVal : 0);\n const nano = (nanoVal != null ? nanoVal : 0);\n const year = MathUtil.intMod(yearParsed, 10000);\n let days = 0;\n if (hour === 24 && min === 0 && sec === 0 && nano === 0) {\n hour = 0;\n days = 1;\n } else if (hour === 23 && min === 59 && sec === 60) {\n context.setParsedLeapSecond();\n sec = 59;\n }\n let instantSecs;\n try {\n const ldt = LocalDateTime.of(year, month, day, hour, min, sec, 0).plusDays(days);\n instantSecs = ldt.toEpochSecond(ZoneOffset.UTC);\n instantSecs += MathUtil.safeMultiply(MathUtil.intDiv(yearParsed, 10000), SECONDS_PER_10000_YEARS);\n } catch (ex) {\n return ~position;\n }\n let successPos = pos;\n successPos = context.setParsedField(ChronoField.INSTANT_SECONDS, instantSecs, position, successPos);\n return context.setParsedField(ChronoField.NANO_OF_SECOND, nano, position, successPos);\n }\n\n toString() {\n return 'Instant()';\n }\n}\n\n\nexport function _init() {\n ReducedPrinterParser.BASE_DATE = LocalDate.of(2000, 1, 1);\n\n DateTimeFormatterBuilder.CompositePrinterParser = CompositePrinterParser;\n DateTimeFormatterBuilder.PadPrinterParserDecorator = PadPrinterParserDecorator;\n DateTimeFormatterBuilder.SettingsParser = SettingsParser;\n DateTimeFormatterBuilder.CharLiteralPrinterParser = StringLiteralPrinterParser;\n DateTimeFormatterBuilder.StringLiteralPrinterParser = StringLiteralPrinterParser;\n DateTimeFormatterBuilder.CharLiteralPrinterParser = CharLiteralPrinterParser;\n DateTimeFormatterBuilder.NumberPrinterParser = NumberPrinterParser;\n DateTimeFormatterBuilder.ReducedPrinterParser = ReducedPrinterParser;\n DateTimeFormatterBuilder.FractionPrinterParser = FractionPrinterParser;\n DateTimeFormatterBuilder.OffsetIdPrinterParser = OffsetIdPrinterParser;\n DateTimeFormatterBuilder.ZoneIdPrinterParser = ZoneIdPrinterParser;\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\n/**\n * @private\n */\nexport class StringBuilder {\n constructor(){\n this._str = '';\n }\n\n append(str){\n this._str += str;\n return this;\n }\n\n appendChar(str){\n this._str += str[0];\n return this;\n }\n\n insert(offset, str){\n this._str = this._str.slice(0, offset) + str + this._str.slice(offset);\n return this;\n }\n\n replace(start, end, str){\n this._str = this._str.slice(0, start) + str + this._str.slice(end);\n return this;\n }\n\n length(){\n return this._str.length;\n }\n\n setLength(length){\n this._str = this._str.slice(0, length);\n return this;\n }\n\n\n toString() {\n return this._str;\n }\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {assert, requireNonNull} from '../assert';\n\nimport {DateTimeParseException, NullPointerException} from '../errors';\n\nimport {Period} from '../Period';\n\nimport {ParsePosition} from './ParsePosition';\nimport {DateTimeBuilder} from './DateTimeBuilder';\nimport {DateTimeParseContext} from './DateTimeParseContext';\nimport {DateTimePrintContext} from './DateTimePrintContext';\nimport {DateTimeFormatterBuilder} from './DateTimeFormatterBuilder';\nimport {SignStyle} from './SignStyle';\nimport {StringBuilder} from './StringBuilder';\nimport {ResolverStyle} from './ResolverStyle';\n\nimport {IsoChronology} from '../chrono/IsoChronology';\nimport {ChronoField} from '../temporal/ChronoField';\nimport {createTemporalQuery} from '../temporal/TemporalQuery';\n\n/**\n *\n * ### Static properties of Class {@link DateTimeFormatter}\n *\n * DateTimeFormatter.ISO_LOCAL_DATE\n *\n * DateTimeFormatter.ISO_LOCAL_TIME\n *\n * DateTimeFormatter.ISO_LOCAL_DATE_TIME\n *\n */\nexport class DateTimeFormatter {\n\n //-----------------------------------------------------------------------\n /**\n * A query that provides access to the excess days that were parsed.\n *\n * This returns a singleton {@link TemporalQuery} that provides\n * access to additional information from the parse. The query always returns\n * a non-null period, with a zero period returned instead of null.\n *\n * There are two situations where this query may return a non-zero period.\n *\n * * If the {@link ResolverStyle} is {@link LENIENT} and a time is parsed\n * without a date, then the complete result of the parse consists of a\n * {@link LocalTime} and an excess {@link Period} in days.\n * * If the {@link ResolverStyle} is {@link SMART} and a time is parsed\n * without a date where the time is 24:00:00, then the complete result of\n * the parse consists of a {@link LocalTime} of 00:00:00 and an excess\n * {@link Period} of one day.\n *\n * In both cases, if a complete {@link ChronoLocalDateTime} or {@link Instant}\n * is parsed, then the excess days are added to the date part.\n * As a result, this query will return a zero period.\n *\n * The {@link SMART} behaviour handles the common \"end of day\" 24:00 value.\n * Processing in {@link LENIENT} mode also produces the same result:\n *
\n     *  Text to parse        Parsed object                         Excess days\n     *  \"2012-12-03T00:00\"   LocalDateTime.of(2012, 12, 3, 0, 0)   ZERO\n     *  \"2012-12-03T24:00\"   LocalDateTime.of(2012, 12, 4, 0, 0)   ZERO\n     *  \"00:00\"              LocalTime.of(0, 0)                    ZERO\n     *  \"24:00\"              LocalTime.of(0, 0)                    Period.ofDays(1)\n     * 
\n * The query can be used as follows:\n *
\n     *  TemporalAccessor parsed = formatter.parse(str);\n     *  LocalTime time = parsed.query(LocalTime.FROM);\n     *  Period extraDays = parsed.query(DateTimeFormatter.parsedExcessDays());\n     * 
\n * @return {TemporalQuery} a query that provides access to the excess days that were parsed\n */\n static parsedExcessDays() {\n return DateTimeFormatter.PARSED_EXCESS_DAYS;\n }\n\n /**\n * A query that provides access to whether a leap-second was parsed.\n *\n * This returns a singleton {@link TemporalQuery} that provides\n * access to additional information from the parse. The query always returns\n * a non-null boolean, true if parsing saw a leap-second, false if not.\n *\n * Instant parsing handles the special \"leap second\" time of '23:59:60'.\n * Leap seconds occur at '23:59:60' in the UTC time-zone, but at other\n * local times in different time-zones. To avoid this potential ambiguity,\n * the handling of leap-seconds is limited to\n * {@link DateTimeFormatterBuilder#appendInstant}, as that method\n * always parses the instant with the UTC zone offset.\n *\n * If the time '23:59:60' is received, then a simple conversion is applied,\n * replacing the second-of-minute of 60 with 59. This query can be used\n * on the parse result to determine if the leap-second adjustment was made.\n * The query will return one second of excess if it did adjust to remove\n * the leap-second, and zero if not. Note that applying a leap-second\n * smoothing mechanism, such as UTC-SLS, is the responsibility of the\n * application, as follows:\n *
\n     *  TemporalAccessor parsed = formatter.parse(str);\n     *  Instant instant = parsed.query(Instant::from);\n     *  if (parsed.query(DateTimeFormatter.parsedLeapSecond())) {\n     *    // validate leap-second is correct and apply correct smoothing\n     *  }\n     * 
\n * @return a query that provides access to whether a leap-second was parsed\n */\n static parsedLeapSecond() {\n return DateTimeFormatter.PARSED_LEAP_SECOND;\n }\n\n /**\n * Creates a formatter using the specified pattern.\n *\n * This method will create a formatter based on a simple pattern of letters and symbols.\n *\n * The returned formatter will use the default locale, but this can be changed\n * using {@link DateTimeFormatter.withLocale}.\n *\n * All letters 'A' to 'Z' and 'a' to 'z' are reserved as pattern letters.\n * The following pattern letters are defined:\n *
\n     *  |Symbol  |Meaning                     |Presentation      |Examples\n     *  |--------|----------------------------|------------------|----------------------------------------------------\n     *  | G      | era                        | number/text      | 1; 01; AD; Anno Domini\n     *  | u      | year                       | year             | 2004; 04\n     *  | y      | year-of-era                | year             | 2004; 04\n     *  | D      | day-of-year                | number           | 189\n     *  | M      | month-of-year              | number/text      | 7; 07; Jul; July; J\n     *  | d      | day-of-month               | number           | 10\n     *  |        |                            |                  |\n     *  | Q      | quarter-of-year            | number/text      | 3; 03; Q3\n     *  | Y      | week-based-year            | year             | 1996; 96\n     *  | w      | week-of-year               | number           | 27\n     *  | W      | week-of-month              | number           | 27\n     *  | e      | localized day-of-week      | number           | 2; Tue; Tuesday; T\n     *  | E      | day-of-week                | number/text      | 2; Tue; Tuesday; T\n     *  | F      | week-of-month              | number           | 3\n     *  |        |                            |                  |\n     *  | a      | am-pm-of-day               | text             | PM\n     *  | h      | clock-hour-of-am-pm (1-12) | number           | 12\n     *  | K      | hour-of-am-pm (0-11)       | number           | 0\n     *  | k      | clock-hour-of-am-pm (1-24) | number           | 0\n     *  |        |                            |                  |\n     *  | H      | hour-of-day (0-23)         | number           | 0\n     *  | m      | minute-of-hour             | number           | 30\n     *  | s      | second-of-minute           | number           | 55\n     *  | S      | fraction-of-second         | fraction         | 978\n     *  | A      | milli-of-day               | number           | 1234\n     *  | n      | nano-of-second             | number           | 987654321\n     *  | N      | nano-of-day                | number           | 1234000000\n     *  |        |                            |                  |\n     *  | V      | time-zone ID               | zone-id          | America/Los_Angeles; Z; -08:30\n     *  | z      | time-zone name             | zone-name        | Pacific Standard Time; PST\n     *  | X      | zone-offset 'Z' for zero   | offset-X         | Z; -08; -0830; -08:30; -083015; -08:30:15;\n     *  | x      | zone-offset                | offset-x         | +0000; -08; -0830; -08:30; -083015; -08:30:15;\n     *  | Z      | zone-offset                | offset-Z         | +0000; -0800; -08:00;\n     *  |        |                            |                  |\n     *  | p      | pad next                   | pad modifier     | 1\n     *  |        |                            |                  |\n     *  | '      | escape for text            | delimiter        |\n     *  | ''     | single quote               | literal          | '\n     *  | [      | optional section start     |                  |\n     *  | ]      | optional section end       |                  |\n     *  | {}     | reserved for future use    |                  |\n     * 
\n *\n * The count of pattern letters determine the format.\n *\n * **Text**: The text style is determined based on the number of pattern letters used.\n * Less than 4 pattern letters will use the short form `TextStyle.SHORT`.\n * Exactly 4 pattern letters will use the full form `TextStyle.FULL`.\n * Exactly 5 pattern letters will use the narrow form `TextStyle.NARROW`.\n *\n * **NOTE**: since text styles require locale support, they are currently not supported in js-joda!\n *\n * **Number**: If the count of letters is one, then the value is printed using the minimum number\n * of digits and without padding as per {@link DateTimeFormatterBuilder.appendValue}.\n * Otherwise, the count of digits is used as the width of the output field as per\n * {@link DateTimeFormatterBuilder.appendValue}.\n *\n * **Number/Text**: If the count of pattern letters is 3 or greater, use the Text rules above.\n * Otherwise use the Number rules above.\n *\n * **Fraction**: Outputs the nano-of-second field as a fraction-of-second.\n * The nano-of-second value has nine digits, thus the count of pattern letters is from 1 to 9.\n * If it is less than 9, then the nano-of-second value is truncated, with only the most\n * significant digits being output.\n * When parsing in strict mode, the number of parsed digits must match the count of pattern letters.\n * When parsing in lenient mode, the number of parsed digits must be at least the count of pattern\n * letters, up to 9 digits.\n *\n * **Year**: The count of letters determines the minimum field width below which padding is used.\n * If the count of letters is two, then a {@link DateTimeFormatterBuilder.appendValueReduced}\n * two digit form is used.\n * For printing, this outputs the rightmost two digits. For parsing, this will parse using the\n * base value of 2000, resulting in a year within the range 2000 to 2099 inclusive.\n * If the count of letters is less than four (but not two), then the sign is only output for negative\n * years as per `SignStyle.NORMAL`.\n * Otherwise, the sign is output if the pad width is exceeded, as per `SignStyle.EXCEEDS_PAD`\n *\n * **ZoneId**: This outputs the time-zone ID, such as 'Europe/Paris'.\n * If the count of letters is two, then the time-zone ID is output.\n * Any other count of letters throws `IllegalArgumentException`.\n *\n * **Zone names**: This outputs the display name of the time-zone ID.\n * If the count of letters is one, two or three, then the short name is output.\n * If the count of letters is four, then the full name is output.\n * Five or more letters throws `IllegalArgumentException`.\n *\n * **NOTE**: since zone ids and name require the iana tzdb, they are currently not supported in js-joda!\n *\n * **Offset X and x**: This formats the offset based on the number of pattern letters.\n * One letter outputs just the hour', such as '+01', unless the minute is non-zero\n * in which case the minute is also output, such as '+0130'.\n * Two letters outputs the hour and minute, without a colon, such as '+0130'.\n * Three letters outputs the hour and minute, with a colon, such as '+01:30'.\n * Four letters outputs the hour and minute and optional second, without a colon, such as '+013015'.\n * Five letters outputs the hour and minute and optional second, with a colon, such as '+01:30:15'.\n * Six or more letters throws `IllegalArgumentException`.\n * Pattern letter 'X' (upper case) will output 'Z' when the offset to be output would be zero,\n * whereas pattern letter 'x' (lower case) will output '+00', '+0000', or '+00:00'.\n *\n * **Offset Z**: This formats the offset based on the number of pattern letters.\n * One, two or three letters outputs the hour and minute, without a colon, such as '+0130'.\n * Four or more letters throws `IllegalArgumentException`.\n * The output will be '+0000' when the offset is zero.\n *\n * **Optional section**: The optional section markers work exactly like calling\n * {@link DateTimeFormatterBuilder.optionalStart} and {@link DateTimeFormatterBuilder.optionalEnd}.\n *\n * **Pad modifier**: Modifies the pattern that immediately follows to be padded with spaces.\n * The pad width is determined by the number of pattern letters.\n * This is the same as calling {@link DateTimeFormatterBuilder.padNext}.\n *\n * For example, 'ppH' outputs the hour-of-day padded on the left with spaces to a width of 2.\n *\n * Any unrecognized letter is an error.\n * Any non-letter character, other than '[', ']', '{', '}' and the single quote will be output directly.\n * Despite this, it is recommended to use single quotes around all characters that you want to\n * output directly to ensure that future changes do not break your application.\n *\n * @param {String} pattern the pattern to use, not null\n * @return {DateTimeFormatter} the formatter based on the pattern, not null\n * @throws IllegalArgumentException if the pattern is invalid\n * @see DateTimeFormatterBuilder#appendPattern(String)\n * @example\n * var s = LocalDate.parse('2016-04-01').format(DateTimeFormatter.ofPattern('d MM yyyy'));\n * console.log(s); // '1 04 2016'\n *\n */\n static ofPattern(pattern) {\n return new DateTimeFormatterBuilder().appendPattern(pattern).toFormatter();\n }\n\n\n //-----------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param printerParser the printer/parser to use, not null\n * @param locale the locale to use, not null\n * @param decimalStyle the decimal style to use, not null\n * @param resolverStyle the resolver style to use, not null\n * @param resolverFields the fields to use during resolving, null for all fields\n * @param chrono the chronology to use, null for no override\n * @param zone the zone to use, null for no override\n * @private\n */\n constructor(printerParser, locale, decimalStyle, resolverStyle, resolverFields, chrono=IsoChronology.INSTANCE, zone) {\n assert(printerParser != null);\n assert(decimalStyle != null);\n assert(resolverStyle != null);\n /**\n * The printer and/or parser to use, not null.\n */\n this._printerParser = printerParser;\n /**\n * The locale to use for formatting. // nyi\n */\n this._locale = locale;\n /**\n * The symbols to use for formatting, not null.\n */\n this._decimalStyle = decimalStyle;\n /**\n * The resolver style to use, not null.\n */\n this._resolverStyle = resolverStyle;\n /**\n * The fields to use in resolving, null for all fields.\n */\n this._resolverFields = resolverFields;\n /**\n * The chronology to use for formatting, null for no override.\n */\n this._chrono = chrono;\n /**\n * The zone to use for formatting, null for no override. // nyi\n */\n this._zone = zone;\n }\n\n locale() {\n return this._locale;\n }\n\n decimalStyle() {\n return this._decimalStyle;\n }\n\n chronology() {\n return this._chrono;\n }\n\n /**\n * Returns a copy of this formatter with a new override chronology.\n *\n * This returns a formatter with similar state to this formatter but\n * with the override chronology set.\n * By default, a formatter has no override chronology, returning null.\n *\n * If an override is added, then any date that is printed or parsed will be affected.\n *\n * When printing, if the {@link Temporal} object contains a date then it will\n * be converted to a date in the override chronology.\n * Any time or zone will be retained unless overridden.\n * The converted result will behave in a manner equivalent to an implementation\n * of {@link ChronoLocalDate},{@link ChronoLocalDateTime} or {@link ChronoZonedDateTime}.\n *\n * When parsing, the override chronology will be used to interpret the\n * {@link ChronoField} into a date unless the\n * formatter directly parses a valid chronology.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param chrono the new chronology, not null\n * @return a formatter based on this formatter with the requested override chronology, not null\n */\n withChronology(chrono) {\n if (this._chrono != null && this._chrono.equals(chrono)) {\n return this;\n }\n return new DateTimeFormatter(this._printerParser, this._locale, this._decimalStyle,\n this._resolverStyle, this._resolverFields, chrono, this._zone);\n }\n\n /**\n * not yet supported\n * @returns {DateTimeFormatter}\n */\n withLocale(){\n return this;\n }\n\n /**\n * Returns a copy of this formatter with a new resolver style.\n *

\n * This returns a formatter with similar state to this formatter but\n * with the resolver style set. By default, a formatter has the\n * {@link ResolverStyle#SMART SMART} resolver style.\n *

\n * Changing the resolver style only has an effect during parsing.\n * Parsing a text string occurs in two phases.\n * Phase 1 is a basic text parse according to the fields added to the builder.\n * Phase 2 resolves the parsed field-value pairs into date and/or time objects.\n * The resolver style is used to control how phase 2, resolving, happens.\n * See {@link ResolverStyle} for more information on the options available.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param {ResolverStyle} resolverStyle the new resolver style, not null\n * @return {DateTimeFormatter} a formatter based on this formatter with the requested resolver style, not null\n */\n withResolverStyle(resolverStyle) {\n requireNonNull(resolverStyle, 'resolverStyle');\n if (resolverStyle.equals(this._resolverStyle)) {\n return this;\n }\n return new DateTimeFormatter(this._printerParser, this._locale, this._decimalStyle, resolverStyle, this._resolverFields, this._chrono, this._zone);\n }\n //-----------------------------------------------------------------------\n /**\n * Formats a date-time object using this formatter.\n *\n * This formats the date-time to a String using the rules of the formatter.\n *\n * @param {TemporalAccessor} temporal the temporal object to print, not null\n * @return {String} the printed string, not null\n * @throws DateTimeException if an error occurs during formatting\n */\n format(temporal) {\n const buf = new StringBuilder(32);\n this._formatTo(temporal, buf);\n return buf.toString();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Formats a date-time object to an {@link Appendable} using this formatter.\n *\n * This formats the date-time to the specified destination.\n * {@link Appendable} is a general purpose interface that is implemented by all\n * key character output classes including {@link StringBuffer}, {@link StringBuilder},\n * {@link PrintStream} and {@link Writer}.\n *\n * Although {@link Appendable} methods throw an {@link IOException}, this method does not.\n * Instead, any {@link IOException} is wrapped in a runtime exception.\n *\n * @param {TemporalAccessor} temporal - the temporal object to print, not null\n * @param {StringBuilder} appendable - the appendable to print to, not null\n * @throws DateTimeException if an error occurs during formatting\n */\n _formatTo(temporal, appendable) {\n requireNonNull(temporal, 'temporal');\n requireNonNull(appendable, 'appendable');\n const context = new DateTimePrintContext(temporal, this);\n this._printerParser.print(context, appendable);\n }\n\n /**\n * function overloading for {@link DateTimeFormatter.parse}\n *\n * if called with one arg {@link DateTimeFormatter.parse1} is called\n * otherwise {@link DateTimeFormatter.parse2}\n *\n * @param {string} text\n * @param {TemporalQuery} type\n * @return {TemporalAccessor}\n */\n parse(text, type){\n if(arguments.length === 1){\n return this.parse1(text);\n } else {\n return this.parse2(text, type);\n }\n }\n\n /**\n * Fully parses the text producing a temporal object.\n *\n * This parses the entire text producing a temporal object.\n * It is typically more useful to use {@link parse}.\n * The result of this method is {@link TemporalAccessor} which has been resolved,\n * applying basic validation checks to help ensure a valid date-time.\n *\n * If the parse completes without reading the entire length of the text,\n * or a problem occurs during parsing or merging, then an exception is thrown.\n *\n * @param {String} text the text to parse, not null\n * @return {TemporalAccessor} the parsed temporal object, not null\n * @throws DateTimeParseException if unable to parse the requested result\n */\n parse1(text) {\n requireNonNull(text, 'text');\n try {\n return this._parseToBuilder(text, null).resolve(this._resolverStyle, this._resolverFields);\n } catch (ex) {\n if(ex instanceof DateTimeParseException){\n throw ex;\n } else {\n throw this._createError(text, ex);\n }\n }\n }\n\n /**\n * Fully parses the text producing a temporal object.\n *\n * This parses the entire text producing a temporal object.\n * It is typically more useful to use {@link parse}.\n * The result of this method is {@link TemporalAccessor} which has been resolved,\n * applying basic validation checks to help ensure a valid date-time.\n *\n * If the parse completes without reading the entire length of the text,\n * or a problem occurs during parsing or merging, then an exception is thrown.\n *\n * @param text the text to parse, not null\n * @param type the type to extract, not null\n * @return the parsed temporal object, not null\n * @throws DateTimeParseException if unable to parse the requested result\n */\n parse2(text, type) {\n requireNonNull(text, 'text');\n requireNonNull(type, 'type');\n try {\n const builder = this._parseToBuilder(text, null).resolve(this._resolverStyle, this._resolverFields);\n return builder.build(type);\n } catch (ex) {\n if(ex instanceof DateTimeParseException){\n throw ex;\n } else {\n throw this._createError(text, ex);\n }\n }\n }\n\n _createError(text, ex) {\n let abbr = '';\n if (text.length > 64) {\n abbr = text.substring(0, 64) + '...';\n } else {\n abbr = text;\n }\n return new DateTimeParseException('Text \\'' + abbr + '\\' could not be parsed: ' + ex.message, text, 0, ex);\n }\n\n\n /**\n * Parses the text to a builder.\n *\n * This parses to a {@link DateTimeBuilder} ensuring that the text is fully parsed.\n * This method throws {@link DateTimeParseException} if unable to parse, or\n * some other {@link DateTimeException} if another date/time problem occurs.\n *\n * @param text the text to parse, not null\n * @param position the position to parse from, updated with length parsed\n * and the index of any error, null if parsing whole string\n * @return the engine representing the result of the parse, not null\n * @throws DateTimeParseException if the parse fails\n */\n _parseToBuilder(text, position) {\n const pos = (position != null ? position : new ParsePosition(0));\n const result = this._parseUnresolved0(text, pos);\n if (result == null || pos.getErrorIndex() >= 0 || (position == null && pos.getIndex() < text.length)) {\n let abbr = '';\n if (text.length > 64) {\n abbr = text.substr(0, 64).toString() + '...';\n } else {\n abbr = text;\n }\n if (pos.getErrorIndex() >= 0) {\n throw new DateTimeParseException('Text \\'' + abbr + '\\' could not be parsed at index ' +\n pos.getErrorIndex(), text, pos.getErrorIndex());\n } else {\n throw new DateTimeParseException('Text \\'' + abbr + '\\' could not be parsed, unparsed text found at index ' +\n pos.getIndex(), text, pos.getIndex());\n }\n }\n return result.toBuilder();\n }\n\n /**\n * Parses the text using this formatter, without resolving the result, intended\n * for advanced use cases.\n *\n * Parsing is implemented as a two-phase operation.\n * First, the text is parsed using the layout defined by the formatter, producing\n * a {@link Map} of field to value, a {@link ZoneId} and a {@link Chronology}.\n * Second, the parsed data is *resolved*, by validating, combining and\n * simplifying the various fields into more useful ones.\n * This method performs the parsing stage but not the resolving stage.\n *\n * The result of this method is {@link TemporalAccessor} which represents the\n * data as seen in the input. Values are not validated, thus parsing a date string\n * of '2012-00-65' would result in a temporal with three fields - year of '2012',\n * month of '0' and day-of-month of '65'.\n *\n * The text will be parsed from the specified start {@link ParsePosition}.\n * The entire length of the text does not have to be parsed, the {@link ParsePosition}\n * will be updated with the index at the end of parsing.\n *\n * Errors are returned using the error index field of the {@link ParsePosition}\n * instead of {@link DateTimeParseException}.\n * The returned error index will be set to an index indicative of the error.\n * Callers must check for errors before using the context.\n *\n * If the formatter parses the same field more than once with different values,\n * the result will be an error.\n *\n * This method is intended for advanced use cases that need access to the\n * internal state during parsing. Typical application code should use\n * {@link parse} or the parse method on the target type.\n *\n * @param text the text to parse, not null\n * @param position the position to parse from, updated with length parsed\n * and the index of any error, not null\n * @return the parsed text, null if the parse results in an error\n * @throws DateTimeException if some problem occurs during parsing\n * @throws IndexOutOfBoundsException if the position is invalid\n */\n parseUnresolved(text, position) {\n return this._parseUnresolved0(text, position);\n }\n\n _parseUnresolved0(text, position) {\n assert(text != null, 'text', NullPointerException);\n assert(position != null, 'position', NullPointerException);\n const context = new DateTimeParseContext(this);\n let pos = position.getIndex();\n pos = this._printerParser.parse(context, text, pos);\n if (pos < 0) {\n position.setErrorIndex(~pos); // index not updated from input\n return null;\n }\n position.setIndex(pos); // errorIndex not updated from input\n return context.toParsed();\n }\n\n /**\n * Returns the formatter as a composite printer parser.\n *\n * @param {boolean} optional whether the printer/parser should be optional\n * @return {CompositePrinterParser} the printer/parser, not null\n */\n _toPrinterParser(optional) {\n return this._printerParser.withOptional(optional);\n }\n\n /**\n *\n * @returns {string}\n */\n toString() {\n const pattern = this._printerParser.toString();\n return pattern.indexOf('[') === 0 ? pattern : pattern.substring(1, pattern.length - 1);\n }\n\n}\n\nexport function _init() {\n\n DateTimeFormatter.ISO_LOCAL_DATE = new DateTimeFormatterBuilder()\n .appendValue(ChronoField.YEAR, 4, 10, SignStyle.EXCEEDS_PAD)\n .appendLiteral('-')\n .appendValue(ChronoField.MONTH_OF_YEAR, 2)\n .appendLiteral('-')\n .appendValue(ChronoField.DAY_OF_MONTH, 2)\n .toFormatter(ResolverStyle.STRICT).withChronology(IsoChronology.INSTANCE);\n\n DateTimeFormatter.ISO_LOCAL_TIME = new DateTimeFormatterBuilder()\n .appendValue(ChronoField.HOUR_OF_DAY, 2)\n .appendLiteral(':')\n .appendValue(ChronoField.MINUTE_OF_HOUR, 2)\n .optionalStart()\n .appendLiteral(':')\n .appendValue(ChronoField.SECOND_OF_MINUTE, 2)\n .optionalStart()\n .appendFraction(ChronoField.NANO_OF_SECOND, 0, 9, true)\n .toFormatter(ResolverStyle.STRICT);\n\n DateTimeFormatter.ISO_LOCAL_DATE_TIME = new DateTimeFormatterBuilder()\n .parseCaseInsensitive()\n .append(DateTimeFormatter.ISO_LOCAL_DATE)\n .appendLiteral('T')\n .append(DateTimeFormatter.ISO_LOCAL_TIME)\n .toFormatter(ResolverStyle.STRICT).withChronology(IsoChronology.INSTANCE);\n\n DateTimeFormatter.ISO_INSTANT = new DateTimeFormatterBuilder()\n .parseCaseInsensitive()\n .appendInstant()\n .toFormatter(ResolverStyle.STRICT);\n\n DateTimeFormatter.ISO_OFFSET_DATE_TIME = new DateTimeFormatterBuilder()\n .parseCaseInsensitive()\n .append(DateTimeFormatter.ISO_LOCAL_DATE_TIME)\n .appendOffsetId()\n .toFormatter(ResolverStyle.STRICT).withChronology(IsoChronology.INSTANCE);\n\n DateTimeFormatter.ISO_ZONED_DATE_TIME = new DateTimeFormatterBuilder()\n .append(DateTimeFormatter.ISO_OFFSET_DATE_TIME)\n .optionalStart()\n .appendLiteral('[')\n .parseCaseSensitive()\n .appendZoneId()\n // .appendZoneRegionId()\n .appendLiteral(']')\n .toFormatter(ResolverStyle.STRICT).withChronology(IsoChronology.INSTANCE);\n\n DateTimeFormatter.BASIC_ISO_DATE = new DateTimeFormatterBuilder()\n .appendValue(ChronoField.YEAR, 4, 10, SignStyle.EXCEEDS_PAD)\n .appendValue(ChronoField.MONTH_OF_YEAR, 2)\n .appendValue(ChronoField.DAY_OF_MONTH, 2)\n .toFormatter(ResolverStyle.STRICT).withChronology(IsoChronology.INSTANCE);\n\n DateTimeFormatter.ISO_OFFSET_DATE = new DateTimeFormatterBuilder()\n .parseCaseInsensitive()\n .append(DateTimeFormatter.ISO_LOCAL_DATE)\n .appendOffsetId()\n .toFormatter(ResolverStyle.STRICT).withChronology(IsoChronology.INSTANCE);\n\n DateTimeFormatter.ISO_OFFSET_TIME = new DateTimeFormatterBuilder()\n .parseCaseInsensitive()\n .append(DateTimeFormatter.ISO_LOCAL_TIME)\n .appendOffsetId()\n .toFormatter(ResolverStyle.STRICT).withChronology(IsoChronology.INSTANCE);\n\n DateTimeFormatter.ISO_ORDINAL_DATE = new DateTimeFormatterBuilder()\n .appendValue(ChronoField.YEAR, 4, 10, SignStyle.EXCEEDS_PAD)\n .appendLiteral('-')\n .appendValue(ChronoField.DAY_OF_YEAR)\n .toFormatter(ResolverStyle.STRICT);\n\n DateTimeFormatter.ISO_WEEK_DATE = new DateTimeFormatterBuilder()\n .appendValue(ChronoField.YEAR, 4, 10, SignStyle.EXCEEDS_PAD)\n .appendLiteral('-W')\n .appendValue(ChronoField.ALIGNED_WEEK_OF_YEAR)\n .appendLiteral('-')\n .appendValue(ChronoField.DAY_OF_WEEK)\n .toFormatter(ResolverStyle.STRICT);\n\n // TODO:\n // ISO_DATE - https://www.threeten.org/threetenbp/apidocs/org/threeten/bp/format/DateTimeFormatter.html#ISO_DATE\n // ISO_TIME - https://www.threeten.org/threetenbp/apidocs/org/threeten/bp/format/DateTimeFormatter.html#ISO_TIME\n // ISO_DATE_TIME - https://www.threeten.org/threetenbp/apidocs/org/threeten/bp/format/DateTimeFormatter.html#ISO_DATE_TIME\n\n DateTimeFormatter.PARSED_EXCESS_DAYS = createTemporalQuery('PARSED_EXCESS_DAYS', (temporal) => {\n if (temporal instanceof DateTimeBuilder) {\n return temporal.excessDays;\n } else {\n return Period.ZERO;\n }\n });\n\n DateTimeFormatter.PARSED_LEAP_SECOND = createTemporalQuery('PARSED_LEAP_SECOND', (temporal) => {\n if (temporal instanceof DateTimeBuilder) {\n return temporal.leapSecond;\n } else {\n return false;\n }\n });\n\n\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\nimport {requireNonNull, requireInstance} from './assert';\nimport {DateTimeException, UnsupportedTemporalTypeException} from './errors';\nimport {MathUtil} from './MathUtil';\n\nimport {ChronoField} from './temporal/ChronoField';\nimport {Clock} from './Clock';\nimport {DateTimeFormatter} from './format/DateTimeFormatter';\nimport {DateTimeFormatterBuilder} from './format/DateTimeFormatterBuilder';\nimport {IsoChronology} from './chrono/IsoChronology';\nimport {LocalDate} from './LocalDate';\nimport {Month} from './Month';\nimport {TemporalAccessor} from './temporal/TemporalAccessor';\nimport {TemporalQuery, createTemporalQuery} from './temporal/TemporalQuery';\nimport {TemporalQueries} from './temporal/TemporalQueries';\nimport {ValueRange} from './temporal/ValueRange';\nimport {Year} from './Year';\nimport {ZoneId} from './ZoneId';\n\n/**\n * A month-day in the ISO-8601 calendar system, such as `--12-03`.\n *\n * {@link MonthDay} is an immutable date-time object that represents the combination\n * of a year and month. Any field that can be derived from a month and day, such as\n * quarter-of-year, can be obtained.\n *\n * This class does not store or represent a year, time or time-zone.\n * For example, the value \"December 3rd\" can be stored in a {@link MonthDay}.\n *\n * Since a {@link MonthDay} does not possess a year, the leap day of\n * February 29th is considered valid.\n *\n * This class implements {@link TemporalAccessor} rather than {@link Temporal}.\n * This is because it is not possible to define whether February 29th is valid or not\n * without external information, preventing the implementation of plus/minus.\n * Related to this, {@link MonthDay} only provides access to query and set the fields\n * {@link MONTH_OF_YEAR} and {@link DAY_OF_MONTH}.\n *\n * The ISO-8601 calendar system is the modern civil calendar system used today\n * in most of the world. It is equivalent to the proleptic Gregorian calendar\n * system, in which today's rules for leap years are applied for all time.\n * For most applications written today, the ISO-8601 rules are entirely suitable.\n * However, any application that makes use of historical dates, and requires them\n * to be accurate will find the ISO-8601 approach unsuitable.\n *\n * ### Specification for implementors\n *\n * This class is immutable and thread-safe.\n */\nexport class MonthDay extends TemporalAccessor {\n /**\n * function overloading for {@link MonthDay.now}\n *\n * if called with 0 argument {@link MonthDay.now0} is executed,\n *\n * if called with 1 argument and first argument is an instance of ZoneId, then {@link MonthDay.nowZoneId} is executed,\n *\n * otherwise {@link MonthDay.nowClock} is executed\n *\n * @param {?(ZoneId|Clock)} zoneIdOrClock\n * @returns {MonthDay}\n */\n static now(zoneIdOrClock) {\n if (arguments.length === 0) {\n return MonthDay.now0();\n } else if (arguments.length === 1 && zoneIdOrClock instanceof ZoneId) {\n return MonthDay.nowZoneId(zoneIdOrClock);\n } else {\n return MonthDay.nowClock(zoneIdOrClock);\n }\n }\n /**\n * Obtains the current month-day from the system clock in the default time-zone.\n *\n * This will query the system clock (see {@link Clock#systemDefaultZone}) in the default\n * time-zone to obtain the current month-day.\n *\n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @return {MonthDay} the current month-day using the system clock and default time-zone, not null\n */\n static now0() {\n return this.nowClock(Clock.systemDefaultZone());\n }\n\n /**\n * Obtains the current month-day from the system clock in the specified time-zone.\n *\n * This will query the system clock (see {@link Clock#system}) to obtain the current month-day.\n * Specifying the time-zone avoids dependence on the default time-zone.\n *\n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @param {ZoneId} zone the zone ID to use, not null\n * @return {MonthDay} the current month-day using the system clock, not null\n */\n static nowZoneId(zone) {\n requireNonNull(zone, 'zone');\n return this.nowClock(Clock.system(zone));\n }\n\n /**\n * Obtains the current month-day from the specified clock.\n *\n * This will query the specified clock to obtain the current month-day.\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using dependency injection (see {@link Clock}).\n *\n * @param {Clock} clock the clock to use, not null\n * @return {MonthDay} the current month-day, not null\n */\n static nowClock(clock) {\n requireNonNull(clock, 'clock');\n const now = LocalDate.now(clock); // called once\n return MonthDay.of(now.month(), now.dayOfMonth());\n }\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link MonthDay.of}\n *\n * if called with 2 argument and first argument is an instance of Month, then {@link MonthDay.ofMonthNumber} is executed,\n *\n * otherwise {@link MonthDay.ofNumberNumber} is executed\n *\n * @param {!(Month|number)} monthOrNumber\n * @param {?number} number\n * @returns {MonthDay}\n */\n static of(monthOrNumber, number) {\n if (arguments.length === 2 && monthOrNumber instanceof Month) {\n return MonthDay.ofMonthNumber(monthOrNumber, number);\n } else {\n return MonthDay.ofNumberNumber(monthOrNumber, number);\n }\n }\n /**\n * Obtains an instance of {@link MonthDay}.\n *\n * The day-of-month must be valid for the month within a leap year.\n * Hence, for February, day 29 is valid.\n *\n * For example, passing in April and day 31 will throw an exception, as\n * there can never be April 31st in any year. By contrast, passing in\n * February 29th is permitted, as that month-day can sometimes be valid.\n *\n * @param {Month} month the month-of-year to represent, not null\n * @param {number} dayOfMonth the day-of-month to represent, from 1 to 31\n * @return {MonthDay} the month-day, not null\n * @throws DateTimeException if the value of any field is out of range\n * @throws DateTimeException if the day-of-month is invalid for the month\n */\n static ofMonthNumber(month, dayOfMonth) {\n requireNonNull(month, 'month');\n ChronoField.DAY_OF_MONTH.checkValidValue(dayOfMonth);\n if (dayOfMonth > month.maxLength()) {\n throw new DateTimeException('Illegal value for DayOfMonth field, value ' + dayOfMonth +\n ' is not valid for month ' + month.toString());\n }\n return new MonthDay(month.value(), dayOfMonth);\n }\n\n /**\n * Obtains an instance of {@link MonthDay}.\n *\n * The day-of-month must be valid for the month within a leap year.\n * Hence, for month 2 (February), day 29 is valid.\n *\n * For example, passing in month 4 (April) and day 31 will throw an exception, as\n * there can never be April 31st in any year. By contrast, passing in\n * February 29th is permitted, as that month-day can sometimes be valid.\n *\n * @param {number} month the month-of-year to represent, from 1 (January) to 12 (December)\n * @param {number} dayOfMonth the day-of-month to represent, from 1 to 31\n * @return {MonthDay} the month-day, not null\n * @throws DateTimeException if the value of any field is out of range\n * @throws DateTimeException if the day-of-month is invalid for the month\n */\n static ofNumberNumber(month, dayOfMonth) {\n requireNonNull(month, 'month');\n requireNonNull(dayOfMonth, 'dayOfMonth');\n return MonthDay.of(Month.of(month), dayOfMonth);\n }\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link MonthDay} from a temporal object.\n *\n * A {@link TemporalAccessor} represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of {@link MonthDay}.\n *\n * The conversion extracts the MONTH_OF_YEAR (see {@link ChronoField#MONTH_OF_YEAR}) and\n * DAY_OF_MONTH (see {@link ChronoField#DAY_OF_MONTH}) fields.\n * The extraction is only permitted if the date-time has an ISO chronology.\n *\n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used in queries via method reference, {@link MonthDay::from}.\n *\n * @param {TemporalAccessor} temporal the temporal object to convert, not null\n * @return {MonthDay} the month-day, not null\n * @throws DateTimeException if unable to convert to a {@link MonthDay}\n */\n static from(temporal) {\n requireNonNull(temporal, 'temporal');\n requireInstance(temporal, TemporalAccessor, 'temporal');\n if (temporal instanceof MonthDay) {\n return temporal;\n }\n try {\n /* TODO: only IsoChronology for now\n if (IsoChronology.INSTANCE.equals(Chronology.from(temporal)) == false) {\n temporal = LocalDate.from(temporal);\n }*/\n return MonthDay.of(temporal.get(ChronoField.MONTH_OF_YEAR), temporal.get(ChronoField.DAY_OF_MONTH));\n } catch (ex) {\n throw new DateTimeException('Unable to obtain MonthDay from TemporalAccessor: ' +\n temporal + ', type ' + (temporal && temporal.constructor != null ? temporal.constructor.name : ''));\n }\n }\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link MonthDay.parse}\n *\n * if called with 1 argument, then {@link MonthDay.parseString} is executed,\n *\n * otherwise {@link MonthDay.parseStringFormatter} is executed\n *\n * @param {!(String)} text\n * @param {?DateTimeFormatter} formatter\n * @returns {MonthDay}\n */\n static parse(text, formatter) {\n if (arguments.length === 1) {\n return MonthDay.parseString(text);\n } else {\n return MonthDay.parseStringFormatter(text, formatter);\n }\n }\n\n /**\n * Obtains an instance of {@link MonthDay} from a text string such as `--12-03`.\n *\n * The string must represent a valid month-day.\n * The format is `--MM-dd`.\n *\n * @param {String} text the text to parse such as \"--12-03\", not null\n * @return {MonthDay} the parsed month-day, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n static parseString(text) {\n return MonthDay.parseStringFormatter(text, PARSER);\n }\n\n /**\n * Obtains an instance of {@link MonthDay} from a text string using a specific formatter.\n *\n * The text is parsed using the formatter, returning a month-day.\n *\n * @param {String} text the text to parse, not null\n * @param {DateTimeFormatter} formatter the formatter to use, not null\n * @return {MonthDay} the parsed month-day, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n static parseStringFormatter(text, formatter) {\n requireNonNull(text, 'text');\n requireNonNull(formatter, 'formatter');\n requireInstance(formatter, DateTimeFormatter, 'formatter');\n return formatter.parse(text, MonthDay.FROM);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Constructor, previously validated.\n *\n * @param {number} month the month-of-year to represent, validated from 1 to 12\n * @param {number} dayOfMonth the day-of-month to represent, validated from 1 to 29-31\n * @private\n */\n constructor(month, dayOfMonth) {\n super();\n this._month = MathUtil.safeToInt(month);\n this._day = MathUtil.safeToInt(dayOfMonth);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the month-of-year field from 1 to 12.\n *\n * This method returns the month as an `int` from 1 to 12.\n * Application code is frequently clearer if the enum {@link Month}\n * is used by calling {@link getMonth}.\n *\n * @return {number} the month-of-year, from 1 to 12\n * @see #month()\n */\n monthValue() {\n return this._month;\n }\n\n /**\n * Gets the month-of-year field using the {@link Month} enum.\n *\n * This method returns the enum {@link Month} for the month.\n * This avoids confusion as to what `int` values mean.\n * If you need access to the primitive `int` value then the enum\n * provides the int value (see {@link Month#getValue}).\n *\n * @return {Month} the month-of-year, not null\n * @see #getMonthValue()\n */\n month() {\n return Month.of(this._month);\n }\n\n /**\n * Gets the day-of-month field.\n *\n * This method returns the primitive `int` value for the day-of-month.\n *\n * @return {number} the day-of-month, from 1 to 31\n */\n dayOfMonth() {\n return this._day;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the specified field is supported.\n *\n * This checks if this month-day can be queried for the specified field.\n * If false, then calling the range (see {@link range}) and\n * get (see {@link get}) methods will throw an exception.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return valid\n * values based on this date-time.\n * The supported fields are:\n *\n * * {@link MONTH_OF_YEAR}\n * * {@link YEAR}\n *\n * All other {@link ChronoField} instances will return false.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.isSupportedBy}\n * passing `this` as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param {TemporalField} field the field to check, null returns false\n * @return {boolean} true if the field is supported on this month-day, false if not\n */\n isSupported(field) {\n if (field instanceof ChronoField) {\n return field === ChronoField.MONTH_OF_YEAR || field === ChronoField.DAY_OF_MONTH;\n }\n return field != null && field.isSupportedBy(this);\n }\n\n /**\n * Gets the range of valid values for the specified field.\n *\n * The range object expresses the minimum and maximum valid values for a field.\n * This month-day is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return\n * appropriate range instances.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.rangeRefinedBy}\n * passing `this` as the argument.\n * Whether the range can be obtained is determined by the field.\n *\n * @param {TemporalField} field the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws DateTimeException if the range for the field cannot be obtained\n */\n range(field) {\n if (field === ChronoField.MONTH_OF_YEAR) {\n return field.range();\n } else if (field === ChronoField.DAY_OF_MONTH) {\n return ValueRange.of(1, this.month().minLength(), this.month().maxLength());\n }\n return super.range(field);\n }\n\n /**\n * Gets the value of the specified field from this month-day as an `int`.\n *\n * This queries this month-day for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return valid\n * values based on this month-day.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field the field to get, not null\n * @return {number} the value for the field\n * @throws DateTimeException if a value for the field cannot be obtained\n * @throws ArithmeticException if numeric overflow occurs\n */\n get(field) {\n return this.range(field).checkValidIntValue(this.getLong(field), field);\n }\n\n /**\n * Gets the value of the specified field from this month-day as a `long`.\n *\n * This queries this month-day for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return valid\n * values based on this month-day.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field the field to get, not null\n * @return {number} the value for the field\n * @throws DateTimeException if a value for the field cannot be obtained\n * @throws ArithmeticException if numeric overflow occurs\n */\n getLong(field) {\n requireNonNull(field, 'field');\n if (field instanceof ChronoField) {\n switch (field) {\n // alignedDOW and alignedWOM not supported because they cannot be set in with()\n case ChronoField.DAY_OF_MONTH: return this._day;\n case ChronoField.MONTH_OF_YEAR: return this._month;\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.getFrom(this);\n }\n //-----------------------------------------------------------------------\n /**\n * Checks if the year is valid for this month-day.\n *\n * This method checks whether this month and day and the input year form\n * a valid date. This can only return false for February 29th.\n *\n * @param {number} year the year to validate, an out of range value returns false\n * @return {boolean} true if the year is valid for this month-day\n * @see Year#isValidMonthDay(MonthDay)\n */\n isValidYear(year) {\n return (this._day === 29 && this._month === 2 && Year.isLeap(year) === false) === false;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link MonthDay} with the month-of-year altered.\n *\n * This returns a month-day with the specified month.\n * If the day-of-month is invalid for the specified month, the day will\n * be adjusted to the last valid day-of-month.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} month the month-of-year to set in the returned month-day, from 1 (January) to 12 (December)\n * @return {MonthDay} based on this month-day with the requested month, not null\n * @throws DateTimeException if the month-of-year value is invalid\n */\n withMonth(month) {\n return this.with(Month.of(month));\n }\n\n /**\n * Returns a copy of this {@link MonthDay} with the month-of-year altered.\n *\n * This returns a month-day with the specified month.\n * If the day-of-month is invalid for the specified month, the day will\n * be adjusted to the last valid day-of-month.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Month} month the month-of-year to set in the returned month-day, not null\n * @return {MonthDay} based on this month-day with the requested month, not null\n */\n with(month) {\n requireNonNull(month, 'month');\n if (month.value() === this._month) {\n return this;\n }\n const day = Math.min(this._day, month.maxLength());\n return new MonthDay(month.value(), day);\n }\n\n /**\n * Returns a copy of this {@link MonthDay} with the day-of-month altered.\n *\n * This returns a month-day with the specified day-of-month.\n * If the day-of-month is invalid for the month, an exception is thrown.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} dayOfMonth the day-of-month to set in the return month-day, from 1 to 31\n * @return {MonthDay} based on this month-day with the requested day, not null\n * @throws DateTimeException if the day-of-month value is invalid\n * @throws DateTimeException if the day-of-month is invalid for the month\n */\n withDayOfMonth(dayOfMonth) {\n if (dayOfMonth === this._day) {\n return this;\n }\n return MonthDay.of(this._month, dayOfMonth);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this month-day using the specified query.\n *\n * This queries this month-day using the specified query strategy object.\n * The {@link TemporalQuery} object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n *\n * The result of this method is obtained by invoking the\n * {@link TemporalQuery#queryFrom} method on the\n * specified query passing `this` as the argument.\n *\n * @param {TemporalQuery} query the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws DateTimeException if unable to query (defined by the query)\n * @throws ArithmeticException if numeric overflow occurs (defined by the query)\n */\n query(query) {\n requireNonNull(query, 'query');\n requireInstance(query, TemporalQuery, 'query');\n if (query === TemporalQueries.chronology()) {\n return IsoChronology.INSTANCE;\n }\n return super.query(query);\n }\n\n /**\n * Adjusts the specified temporal object to have this month-day.\n *\n * This returns a temporal object of the same observable type as the input\n * with the month and day-of-month changed to be the same as this.\n *\n * The adjustment is equivalent to using {@link Temporal#with}\n * twice, passing {@link ChronoField#MONTH_OF_YEAR} and\n * {@link ChronoField#DAY_OF_MONTH} as the fields.\n * If the specified temporal object does not use the ISO calendar system then\n * a {@link DateTimeException} is thrown.\n *\n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal#with}:\n *

\n     *   // these two lines are equivalent, but the second approach is recommended\n     *   temporal = thisMonthDay.adjustInto(temporal);\n     *   temporal = temporal.with(thisMonthDay);\n     * 
\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal the target object to be adjusted, not null\n * @return {Temporal} the adjusted object, not null\n * @throws DateTimeException if unable to make the adjustment\n * @throws ArithmeticException if numeric overflow occurs\n */\n adjustInto(temporal) {\n requireNonNull(temporal, 'temporal');\n /* TODO: only IsoChronology for now\n if (Chronology.from(temporal).equals(IsoChronology.INSTANCE) == false) {\n throw new DateTimeException(\"Adjustment only supported on ISO date-time\");\n }*/\n temporal = temporal.with(ChronoField.MONTH_OF_YEAR, this._month);\n return temporal.with(ChronoField.DAY_OF_MONTH, Math.min(temporal.range(ChronoField.DAY_OF_MONTH).maximum(), this._day));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this month-day with a year to create a {@link LocalDate}.\n *\n * This returns a {@link LocalDate} formed from this month-day and the specified year.\n *\n * A month-day of February 29th will be adjusted to February 28th in the resulting\n * date if the year is not a leap year.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} year the year to use, from MIN_YEAR to MAX_YEAR\n * @return {LocalDate} the local date formed from this month-day and the specified year, not null\n * @throws DateTimeException if the year is outside the valid range of years\n */\n atYear(year) {\n return LocalDate.of(year, this._month, this.isValidYear(year) ? this._day : 28);\n }\n //-----------------------------------------------------------------------\n /**\n * Compares this month-day to another month-day.\n *\n * The comparison is based first on value of the month, then on the value of the day.\n * It is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * @param {MonthDay} other the other month-day to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, MonthDay, 'other');\n let cmp = (this._month - other.monthValue());\n if (cmp === 0) {\n cmp = (this._day - other.dayOfMonth());\n }\n return cmp;\n }\n\n /**\n * Is this month-day after the specified month-day.\n *\n * @param {MonthDay} other the other month-day to compare to, not null\n * @return {boolean} true if this is after the specified month-day\n */\n isAfter(other) {\n requireNonNull(other, 'other');\n requireInstance(other, MonthDay, 'other');\n return this.compareTo(other) > 0;\n }\n\n /**\n * Is this month-day before the specified month-day.\n *\n * @param {MonthDay} other the other month-day to compare to, not null\n * @return {boolean} true if this point is before the specified month-day\n */\n isBefore(other) {\n requireNonNull(other, 'other');\n requireInstance(other, MonthDay, 'other');\n return this.compareTo(other) < 0;\n }\n\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this month-day is equal to another month-day.\n *\n * The comparison is based on the time-line position of the month-day within a year.\n *\n * @param {*} obj the object to check, null returns false\n * @return {boolean} true if this is equal to the other month-day\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof MonthDay) {\n const other = obj;\n return this.monthValue() === other.monthValue() && this.dayOfMonth() === other.dayOfMonth();\n }\n return false;\n }\n //-----------------------------------------------------------------------\n /**\n * Outputs this month-day as a string, such as `--12-03`.\n *\n * The output will be in the format `--MM-dd`:\n *\n * @return {String} a string representation of this month-day, not null\n */\n toString() {\n return '--'\n + (this._month < 10 ? '0' : '') + this._month\n + (this._day < 10 ? '-0' : '-') + this._day;\n }\n\n /**\n * toJSON() use by JSON.stringify\n * delegates to toString()\n *\n * @return {string}\n */\n toJSON() {\n return this.toString();\n }\n\n /**\n * Outputs this month-day as a string using the formatter.\n *\n * This month-day will be passed to the formatter\n * print method (see {@link DateTimeFormatter#format}).\n *\n * @param {DateTimeFormatter} formatter the formatter to use, not null\n * @return {String} the formatted month-day string, not null\n * @throws DateTimeException if an error occurs during printing\n */\n format(formatter) {\n requireNonNull(formatter, 'formatter');\n requireInstance(formatter, DateTimeFormatter, 'formatter');\n return formatter.format(this);\n }\n\n}\n\nlet PARSER;\n\nexport function _init() {\n PARSER = new DateTimeFormatterBuilder()\n .appendLiteral('--')\n .appendValue(ChronoField.MONTH_OF_YEAR, 2)\n .appendLiteral('-')\n .appendValue(ChronoField.DAY_OF_MONTH, 2)\n .toFormatter();\n\n MonthDay.FROM = createTemporalQuery('MonthDay.FROM', (temporal) => {\n return MonthDay.from(temporal);\n });\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\nimport {requireNonNull, requireInstance} from './assert';\nimport {DateTimeException, UnsupportedTemporalTypeException} from './errors';\nimport {MathUtil} from './MathUtil';\n\nimport {ChronoField} from './temporal/ChronoField';\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {Clock} from './Clock';\nimport {DateTimeFormatterBuilder} from './format/DateTimeFormatterBuilder';\nimport {IsoChronology} from './chrono/IsoChronology';\nimport {LocalDate} from './LocalDate';\nimport {Month} from './Month';\nimport {SignStyle} from './format/SignStyle';\nimport {Temporal} from './temporal/Temporal';\nimport {TemporalAmount} from './temporal/TemporalAmount';\nimport {TemporalField} from './temporal/TemporalField';\nimport {TemporalQueries} from './temporal/TemporalQueries';\nimport {TemporalQuery} from './temporal/TemporalQuery';\nimport {TemporalUnit} from './temporal/TemporalUnit';\nimport {createTemporalQuery} from './temporal/TemporalQuery';\nimport {ValueRange} from './temporal/ValueRange';\nimport {Year} from './Year';\nimport {ZoneId} from './ZoneId';\n\n/**\n * A year-month in the ISO-8601 calendar system, such as `2007-12`.\n *\n * {@link YearMonth} is an immutable date-time object that represents the combination\n * of a year and month. Any field that can be derived from a year and month, such as\n * quarter-of-year, can be obtained.\n *\n * This class does not store or represent a day, time or time-zone.\n * For example, the value \"October 2007\" can be stored in a {@link YearMonth}.\n *\n * The ISO-8601 calendar system is the modern civil calendar system used today\n * in most of the world. It is equivalent to the proleptic Gregorian calendar\n * system, in which today's rules for leap years are applied for all time.\n * For most applications written today, the ISO-8601 rules are entirely suitable.\n * However, any application that makes use of historical dates, and requires them\n * to be accurate will find the ISO-8601 approach unsuitable.\n *\n * ### Specification for implementors\n *\n * This class is immutable and thread-safe.\n */\nexport class YearMonth extends Temporal {\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link YearMonth.now}\n *\n * if called with 0 argument {@link YearMonth.now0} is executed,\n *\n * if called with 1 argument and first argument is an instance of ZoneId, then {@link YearMonth.nowZoneId} is executed,\n *\n * otherwise {@link YearMonth.nowClock} is executed\n *\n * @param {?(ZoneId|Clock)} zoneIdOrClock\n * @returns {YearMonth}\n */\n static now(zoneIdOrClock) {\n if (arguments.length === 0) {\n return YearMonth.now0();\n } else if (arguments.length === 1 && zoneIdOrClock instanceof ZoneId) {\n return YearMonth.nowZoneId(zoneIdOrClock);\n } else {\n return YearMonth.nowClock(zoneIdOrClock);\n }\n }\n\n /**\n * Obtains the current year-month from the system clock in the default time-zone.\n *\n * This will query the system clock (see {@link Clock#systemDefaultZone}) in the default\n * time-zone to obtain the current year-month.\n * The zone and offset will be set based on the time-zone in the clock.\n *\n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @return {YearMonth} the current year-month using the system clock and default time-zone, not null\n */\n static now0() {\n return YearMonth.nowClock(Clock.systemDefaultZone());\n }\n\n /**\n * Obtains the current year-month from the system clock in the specified time-zone.\n *\n * This will query the system clock (see {@link Clock#system}) to obtain the current year-month.\n * Specifying the time-zone avoids dependence on the default time-zone.\n *\n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @param {ZoneId} zone the zone ID to use, not null\n * @return {YearMonth} the current year-month using the system clock, not null\n */\n static nowZoneId(zone) {\n return YearMonth.nowClock(Clock.system(zone));\n }\n\n /**\n * Obtains the current year-month from the specified clock.\n *\n * This will query the specified clock to obtain the current year-month.\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using dependency injection.\n *\n * @param {Clock} clock the clock to use, not null\n * @return {YearMonth} the current year-month, not null\n */\n static nowClock(clock) {\n const now = LocalDate.now(clock);\n return YearMonth.of(now.year(), now.month());\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link YearMonth.of}\n *\n * if called with 2 argument and first argument is an instance of Month, then {@link YearMonth.ofNumberMonth} is executed,\n *\n * otherwise {@link YearMonth.ofNumberNumber} is executed\n *\n * @param {!number} year\n * @param {!(Month|number)} monthOrNumber\n * @returns {YearMonth}\n */\n static of(year, monthOrNumber) {\n if (arguments.length === 2 && monthOrNumber instanceof Month) {\n return YearMonth.ofNumberMonth(year, monthOrNumber);\n } else {\n return YearMonth.ofNumberNumber(year, monthOrNumber);\n }\n }\n\n /**\n * Obtains an instance of {@link YearMonth} from a year and month.\n *\n * @param {number} year the year to represent, from MIN_YEAR to MAX_YEAR\n * @param {Month} month the month-of-year to represent, not null\n * @return {YearMonth} the year-month, not null\n * @throws DateTimeException if the year value is invalid\n */\n static ofNumberMonth(year, month) {\n requireNonNull(month, 'month');\n requireInstance(month, Month, 'month');\n return YearMonth.ofNumberNumber(year, month.value());\n }\n\n /**\n * Obtains an instance of {@link YearMonth} from a year and month.\n *\n * @param {number} year the year to represent, from MIN_YEAR to MAX_YEAR\n * @param {number} month the month-of-year to represent, from 1 (January) to 12 (December)\n * @return {YearMonth} the year-month, not null\n * @throws DateTimeException if either field value is invalid\n */\n static ofNumberNumber(year, month) {\n requireNonNull(year, 'year');\n requireNonNull(month, 'month');\n ChronoField.YEAR.checkValidValue(year);\n ChronoField.MONTH_OF_YEAR.checkValidValue(month);\n return new YearMonth(year, month);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link YearMonth} from a temporal object.\n *\n * A {@link TemporalAccessor} represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of {@link YearMonth}.\n *\n * The conversion extracts the {@link ChronoField#YEAR} and\n * {@link ChronoField#MONTH_OF_YEAR} fields.\n * The extraction is only permitted if the temporal object has an ISO\n * chronology, or can be converted to a {@link LocalDate}.\n *\n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used in queries via method reference, {@link YearMonth::from}.\n *\n * @param {TemporalAccessor} temporal the temporal object to convert, not null\n * @return {YearMonth} the year-month, not null\n * @throws DateTimeException if unable to convert to a {@link YearMonth}\n */\n static from(temporal) {\n requireNonNull(temporal, 'temporal');\n if (temporal instanceof YearMonth) {\n return temporal;\n }\n try {\n /* TODO: only IsoChronology for now\n if (IsoChronology.INSTANCE.equals(Chronology.from(temporal)) == false) {\n temporal = LocalDate.from(temporal);\n }*/\n return YearMonth.of(temporal.get(ChronoField.YEAR), temporal.get(ChronoField.MONTH_OF_YEAR));\n } catch (ex) {\n throw new DateTimeException('Unable to obtain YearMonth from TemporalAccessor: ' +\n temporal + ', type ' + (temporal && temporal.constructor != null ? temporal.constructor.name : ''));\n }\n }\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link YearMonth.parse}\n *\n * if called with 2 argument and first argument is an instance of Month, then {@link YearMonth.parseString} is executed,\n *\n * otherwise {@link YearMonth.parseStringFormatter} is executed\n *\n * @param {!(String)} text\n * @param {?DateTimeFormatter} formatter\n * @returns {YearMonth}\n */\n static parse(text, formatter) {\n if (arguments.length === 1) {\n return YearMonth.parseString(text);\n } else {\n return YearMonth.parseStringFormatter(text, formatter);\n }\n }\n\n /**\n * Obtains an instance of {@link YearMonth} from a text string such as `2007-12`.\n *\n * The string must represent a valid year-month.\n * The format must be {@link yyyy-MM}.\n * Years outside the range 0000 to 9999 must be prefixed by the plus or minus symbol.\n *\n * @param {String} text the text to parse such as \"2007-12\", not null\n * @return {YearMonth} the parsed year-month, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n static parseString(text) {\n return YearMonth.parseStringFormatter(text, PARSER);\n }\n\n /**\n * Obtains an instance of {@link YearMonth} from a text string using a specific formatter.\n *\n * The text is parsed using the formatter, returning a year-month.\n *\n * @param {String} text the text to parse, not null\n * @param {DateTimeFormatter} formatter the formatter to use, not null\n * @return the parsed year-month, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n static parseStringFormatter(text, formatter) {\n requireNonNull(formatter, 'formatter');\n return formatter.parse(text, YearMonth.FROM);\n }\n\n\n /**\n * Constructor.\n *\n * @param {number} year the year to represent, validated from MIN_YEAR to MAX_YEAR\n * @param {number} month the month-of-year to represent, validated from 1 (January) to 12 (December)\n * @private\n */\n constructor(year, month) {\n super();\n this._year = MathUtil.safeToInt(year);\n this._month = MathUtil.safeToInt(month);\n }\n\n /**\n * function overloading for {@link YearMonth.isSupported}\n *\n * if called with 1 argument and first argument is an instance of TemporalField, then {@link YearMonth.isSupportedField} is executed,\n *\n * otherwise {@link YearMonth.isSupportedUnit} is executed\n *\n * @param {!(TemporalField|ChronoUnit)} fieldOrUnit\n * @returns {boolean}\n */\n isSupported(fieldOrUnit) {\n if (arguments.length === 1 && fieldOrUnit instanceof TemporalField) {\n return this.isSupportedField(fieldOrUnit);\n } else {\n return this.isSupportedUnit(fieldOrUnit);\n }\n }\n\n /**\n * Checks if the specified field is supported.\n *\n * This checks if this year-month can be queried for the specified field.\n * If false, then calling {@link range} and {@link get} will throw an exception.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return valid\n * values based on this date-time.\n * The supported fields are:\n *\n * * {@link MONTH_OF_YEAR}\n * * {@link EPOCH_MONTH}\n * * {@link YEAR_OF_ERA}\n * * {@link YEAR}\n * * {@link ERA}\n *\n * All other {@link ChronoField} instances will return false.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.isSupportedBy}\n * passing `this` as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param {TemporalField} field the field to check, null returns false\n * @return {boolean} true if the field is supported on this year-month, false if not\n */\n isSupportedField(field) {\n if (field instanceof ChronoField) {\n return field === ChronoField.YEAR || field === ChronoField.MONTH_OF_YEAR ||\n field === ChronoField.PROLEPTIC_MONTH || field === ChronoField.YEAR_OF_ERA || field === ChronoField.ERA;\n }\n return field != null && field.isSupportedBy(this);\n }\n\n isSupportedUnit(unit) {\n if (unit instanceof ChronoUnit) {\n return unit === ChronoUnit.MONTHS || unit === ChronoUnit.YEARS || unit === ChronoUnit.DECADES || unit === ChronoUnit.CENTURIES || unit === ChronoUnit.MILLENNIA || unit === ChronoUnit.ERAS;\n }\n return unit != null && unit.isSupportedBy(this);\n }\n\n /**\n * Gets the range of valid values for the specified field.\n *\n * The range object expresses the minimum and maximum valid values for a field.\n * This year-month is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return\n * appropriate range instances.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.rangeRefinedBy}\n * passing `this` as the argument.\n * Whether the range can be obtained is determined by the field.\n *\n * @param {TemporalField} field the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws DateTimeException if the range for the field cannot be obtained\n */\n range(field) {\n if (field === ChronoField.YEAR_OF_ERA) {\n return (this.year() <= 0 ? ValueRange.of(1, Year.MAX_VALUE + 1) : ValueRange.of(1, Year.MAX_VALUE));\n }\n return super.range(field);\n }\n\n /**\n * Gets the value of the specified field from this year-month as an `int`.\n *\n * This queries this year-month for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return valid\n * values based on this year-month, except {@link EPOCH_MONTH} which is too\n * large to fit in an `int` and throw a {@link DateTimeException}.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field the field to get, not null\n * @return {number} the value for the field\n * @throws DateTimeException if a value for the field cannot be obtained\n * @throws ArithmeticException if numeric overflow occurs\n */\n get(field) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n return this.range(field).checkValidIntValue(this.getLong(field), field);\n }\n\n /**\n * Gets the value of the specified field from this year-month as a `long`.\n *\n * This queries this year-month for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return valid\n * values based on this year-month.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field the field to get, not null\n * @return {number} the value for the field\n * @throws DateTimeException if a value for the field cannot be obtained\n * @throws ArithmeticException if numeric overflow occurs\n */\n getLong(field) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n if (field instanceof ChronoField) {\n switch (field) {\n case ChronoField.MONTH_OF_YEAR: return this._month;\n case ChronoField.PROLEPTIC_MONTH: return this._getProlepticMonth();\n case ChronoField.YEAR_OF_ERA: return (this._year < 1 ? 1 - this._year : this._year);\n case ChronoField.YEAR: return this._year;\n case ChronoField.ERA: return (this._year < 1 ? 0 : 1);\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.getFrom(this);\n }\n\n _getProlepticMonth() {\n return MathUtil.safeAdd(MathUtil.safeMultiply(this._year, 12), (this._month - 1));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the year field.\n *\n * This method returns the primitive `int` value for the year.\n *\n * The year returned by this method is proleptic as per {@link get}.\n *\n * @return {number} the year, from MIN_YEAR to MAX_YEAR\n */\n year() {\n return this._year;\n }\n\n /**\n * Gets the month-of-year field from 1 to 12.\n *\n * This method returns the month as an `int` from 1 to 12.\n * Application code is frequently clearer if the enum {@link Month}\n * is used by calling {@link getMonth}.\n *\n * @return {number} the month-of-year, from 1 to 12\n * @see #getMonth()\n */\n monthValue() {\n return this._month;\n }\n\n /**\n * Gets the month-of-year field using the {@link Month} enum.\n *\n * This method returns the enum {@link Month} for the month.\n * This avoids confusion as to what `int` values mean.\n * If you need access to the primitive `int` value, use {@link Month#getValue}.\n *\n * @return {Month} the month-of-year, not null\n */\n month() {\n return Month.of(this._month);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the year is a leap year, according to the ISO proleptic\n * calendar system rules.\n *\n * This method applies the current rules for leap years across the whole time-line.\n * In general, a year is a leap year if it is divisible by four without\n * remainder. However, years divisible by 100, are not leap years, with\n * the exception of years divisible by 400 which are.\n *\n * For example, 1904 is a leap year it is divisible by 4.\n * 1900 was not a leap year as it is divisible by 100, however 2000 was a\n * leap year as it is divisible by 400.\n *\n * The calculation is proleptic - applying the same rules into the far future and far past.\n * This is historically inaccurate, but is correct for the ISO-8601 standard.\n *\n * @return {boolean} true if the year is leap, false otherwise\n */\n isLeapYear() {\n return IsoChronology.isLeapYear(this._year);\n }\n\n /**\n * Checks if the day-of-month is valid for this year-month.\n *\n * This method checks whether this year and month and the input day form\n * a valid date.\n *\n * @param {number} dayOfMonth the day-of-month to validate, from 1 to 31, invalid value returns false\n * @return {boolean} true if the day is valid for this year-month\n */\n isValidDay(dayOfMonth) {\n return dayOfMonth >= 1 && dayOfMonth <= this.lengthOfMonth();\n }\n\n /**\n * Returns the length of the month, taking account of the year.\n *\n * This returns the length of the month in days.\n * For example, a date in January would return 31.\n *\n * @return {number} the length of the month in days, from 28 to 31\n */\n lengthOfMonth() {\n return this.month().length(this.isLeapYear());\n }\n\n /**\n * Returns the length of the year.\n *\n * This returns the length of the year in days, either 365 or 366.\n *\n * @return {number} 366 if the year is leap, 365 otherwise\n */\n lengthOfYear() {\n return (this.isLeapYear() ? 366 : 365);\n }\n\n /**\n * function overloading for {@link YearMonth.with}\n *\n * if called with 1 argument, then {@link YearMonth.withAdjuster} is executed,\n * otherwise {@link YearMonth.withFieldValue} is executed.\n *\n * @param {!(TemporalAdjuster|TemporalField)} adjusterOrField\n * @param {?number} value nullable only of first argument is an instance of TemporalAdjuster\n * @returns {YearMonth}\n */\n with(adjusterOrField, value) {\n if (arguments.length === 1) {\n return this.withAdjuster(adjusterOrField);\n } else {\n return this.withFieldValue(adjusterOrField, value);\n }\n }\n\n /**\n * Returns an adjusted copy of this year-month.\n *\n * This returns a new {@link YearMonth}, based on this one, with the year-month adjusted.\n * The adjustment takes place using the specified adjuster strategy object.\n * Read the documentation of the adjuster to understand what adjustment will be made.\n *\n * A simple adjuster might simply set the one of the fields, such as the year field.\n * A more complex adjuster might set the year-month to the next month that\n * Halley's comet will pass the Earth.\n *\n * The result of this method is obtained by invoking the\n * {@link TemporalAdjuster#adjustInto} method on the\n * specified adjuster passing `this` as the argument.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAdjuster} adjuster the adjuster to use, not null\n * @return {YearMonth} based on `this` with the adjustment made, not null\n * @throws DateTimeException if the adjustment cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n withAdjuster(adjuster) {\n requireNonNull(adjuster, 'adjuster');\n return adjuster.adjustInto(this);\n }\n\n /**\n * Returns a copy of this year-month with the specified field set to a new value.\n *\n * This returns a new {@link YearMonth}, based on this one, with the value\n * for the specified field changed.\n * This can be used to change any supported field, such as the year or month.\n * If it is not possible to set the value, because the field is not supported or for\n * some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the adjustment is implemented here.\n * The supported fields behave as follows:\n *\n * * {@link MONTH_OF_YEAR} -\n * Returns a {@link YearMonth} with the specified month-of-year.\n * The year will be unchanged.\n * * {@link PROLEPTIC_MONTH} -\n * Returns a {@link YearMonth} with the specified proleptic-month.\n * This completely replaces the year and month of this object.\n * * {@link YEAR_OF_ERA} -\n * Returns a {@link YearMonth} with the specified year-of-era\n * The month and era will be unchanged.\n * * {@link YEAR} -\n * Returns a {@link YearMonth} with the specified year.\n * The month will be unchanged.\n * * {@link ERA} -\n * Returns a {@link YearMonth} with the specified era.\n * The month and year-of-era will be unchanged.\n *\n * In all cases, if the new value is outside the valid range of values for the field\n * then a {@link DateTimeException} will be thrown.\n *\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.adjustInto}\n * passing `this` as the argument. In this case, the field determines\n * whether and how to adjust the instant.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalField} field the field to set in the result, not null\n * @param {number} newValue the new value of the field in the result\n * @return a {@link YearMonth} based on `this` with the specified field set, not null\n * @throws DateTimeException if the field cannot be set\n * @throws ArithmeticException if numeric overflow occurs\n */\n withFieldValue(field, newValue) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n if (field instanceof ChronoField) {\n const f = field;\n f.checkValidValue(newValue);\n switch (f) {\n case ChronoField.MONTH_OF_YEAR: return this.withMonth(newValue);\n case ChronoField.PROLEPTIC_MONTH: return this.plusMonths(newValue - this.getLong(ChronoField.PROLEPTIC_MONTH));\n case ChronoField.YEAR_OF_ERA: return this.withYear((this._year < 1 ? 1 - newValue : newValue));\n case ChronoField.YEAR: return this.withYear(newValue);\n case ChronoField.ERA: return (this.getLong(ChronoField.ERA) === newValue ? this : this.withYear(1 - this._year));\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.adjustInto(this, newValue);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link YearMonth} with the year altered.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} year the year to set in the returned year-month, from MIN_YEAR to MAX_YEAR\n * @return {YearMonth} based on this year-month with the requested year, not null\n * @throws DateTimeException if the year value is invalid\n */\n withYear(year) {\n ChronoField.YEAR.checkValidValue(year);\n return new YearMonth(year, this._month);\n }\n\n /**\n * Returns a copy of this {@link YearMonth} with the month-of-year altered.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} month the month-of-year to set in the returned year-month, from 1 (January) to 12 (December)\n * @return {YearMonth} based on this year-month with the requested month, not null\n * @throws DateTimeException if the month-of-year value is invalid\n */\n withMonth(month) {\n ChronoField.MONTH_OF_YEAR.checkValidValue(month);\n return new YearMonth(this._year, month);\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * Returns a copy of this year-month with the specified period added.\n *\n * This method returns a new year-month based on this year-month with the specified period added.\n * The adder is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link plus}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAmount} amount the amount to add, not null\n * @return {YearMonth} based on this year-month with the addition made, not null\n * @throws DateTimeException if the addition cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusAmount(amount) {\n requireNonNull(amount, 'amount');\n requireInstance(amount, TemporalAmount, 'amount');\n return amount.addTo(this);\n }\n\n /**\n * @param {number} amountToAdd\n * @param {TemporalUnit} unit\n * @return {YearMonth} based on this year-month with the addition made, not null\n * @throws DateTimeException if the addition cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusAmountUnit(amountToAdd, unit) {\n requireNonNull(unit, 'unit');\n requireInstance(unit, TemporalUnit, 'unit');\n if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.MONTHS: return this.plusMonths(amountToAdd);\n case ChronoUnit.YEARS: return this.plusYears(amountToAdd);\n case ChronoUnit.DECADES: return this.plusYears(MathUtil.safeMultiply(amountToAdd, 10));\n case ChronoUnit.CENTURIES: return this.plusYears(MathUtil.safeMultiply(amountToAdd, 100));\n case ChronoUnit.MILLENNIA: return this.plusYears(MathUtil.safeMultiply(amountToAdd, 1000));\n case ChronoUnit.ERAS: return this.with(ChronoField.ERA, MathUtil.safeAdd(this.getLong(ChronoField.ERA), amountToAdd));\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n return unit.addTo(this, amountToAdd);\n }\n\n /**\n * Returns a copy of this year-month with the specified period in years added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} yearsToAdd the years to add, may be negative\n * @return {YearMonth} based on this year-month with the years added, not null\n * @throws DateTimeException if the result exceeds the supported range\n */\n plusYears(yearsToAdd) {\n if (yearsToAdd === 0) {\n return this;\n }\n const newYear = ChronoField.YEAR.checkValidIntValue(this._year + yearsToAdd); // safe overflow\n return this.withYear(newYear);\n }\n\n /**\n * Returns a copy of this year-month with the specified period in months added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} monthsToAdd the months to add, may be negative\n * @return {YearMonth} based on this year-month with the months added, not null\n * @throws DateTimeException if the result exceeds the supported range\n */\n plusMonths(monthsToAdd) {\n if (monthsToAdd === 0) {\n return this;\n }\n const monthCount = (this._year * 12) + (this._month - 1);\n const calcMonths = monthCount + monthsToAdd;\n const newYear = ChronoField.YEAR.checkValidIntValue(MathUtil.floorDiv(calcMonths, 12));\n const newMonth = MathUtil.floorMod(calcMonths, 12) + 1;\n return new YearMonth(newYear, newMonth);\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * Returns a copy of this year-month with the specified period subtracted.\n *\n * This method returns a new year-month based on this year-month with the specified period subtracted.\n * The subtractor is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link minus}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAmount} amount the amount to subtract, not null\n * @return {YearMonth} based on this year-month with the subtraction made, not null\n * @throws DateTimeException if the subtraction cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusAmount(amount) {\n requireNonNull(amount, 'amount');\n return amount.subtractFrom(this);\n }\n\n /**\n * @param {number} amountToSubtract the amount to subtract, not null\n * @param {TemporalUnit} unit\n * @return {YearMonth} based on this year-month with the subtraction made, not null\n * @throws DateTimeException if the subtraction cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusAmountUnit(amountToSubtract, unit) {\n return (amountToSubtract === MathUtil.MIN_SAFE_INTEGER ? this.plusAmountUnit(MathUtil.MAX_SAFE_INTEGER, unit).plusAmountUnit(1, unit) : this.plusAmountUnit(-amountToSubtract, unit));\n }\n\n /**\n * Returns a copy of this year-month with the specified period in years subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} yearsToSubtract the years to subtract, may be negative\n * @return {YearMonth} based on this year-month with the years subtracted, not null\n * @throws DateTimeException if the result exceeds the supported range\n */\n minusYears(yearsToSubtract) {\n return (yearsToSubtract === MathUtil.MIN_SAFE_INTEGER ? this.plusYears(MathUtil.MIN_SAFE_INTEGER).plusYears(1) : this.plusYears(-yearsToSubtract));\n }\n\n /**\n * Returns a copy of this year-month with the specified period in months subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} monthsToSubtract the months to subtract, may be negative\n * @return {YearMonth} based on this year-month with the months subtracted, not null\n * @throws DateTimeException if the result exceeds the supported range\n */\n minusMonths(monthsToSubtract) {\n return (monthsToSubtract === MathUtil.MIN_SAFE_INTEGER ? this.plusMonths(Math.MAX_SAFE_INTEGER).plusMonths(1) : this.plusMonths(-monthsToSubtract));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this year-month using the specified query.\n *\n * This queries this year-month using the specified query strategy object.\n * The {@link TemporalQuery} object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n *\n * The result of this method is obtained by invoking the\n * {@link TemporalQuery#queryFrom} method on the\n * specified query passing `this` as the argument.\n *\n * @param {TemporalQuery} query the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws DateTimeException if unable to query (defined by the query)\n * @throws ArithmeticException if numeric overflow occurs (defined by the query)\n */\n query(query) {\n requireNonNull(query, 'query');\n requireInstance(query, TemporalQuery, 'query');\n if (query === TemporalQueries.chronology()) {\n return IsoChronology.INSTANCE;\n } else if (query === TemporalQueries.precision()) {\n return ChronoUnit.MONTHS;\n } else if (query === TemporalQueries.localDate() || query === TemporalQueries.localTime() ||\n query === TemporalQueries.zone() || query === TemporalQueries.zoneId() || query === TemporalQueries.offset()) {\n return null;\n }\n return super.query(query);\n }\n\n /**\n * Adjusts the specified temporal object to have this year-month.\n *\n * This returns a temporal object of the same observable type as the input\n * with the year and month changed to be the same as this.\n *\n * The adjustment is equivalent to using {@link Temporal#with}\n * passing {@link ChronoField#PROLEPTIC_MONTH} as the field.\n * If the specified temporal object does not use the ISO calendar system then\n * a {@link DateTimeException} is thrown.\n *\n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal#with}:\n *
\n     *   // these two lines are equivalent, but the second approach is recommended\n     *   temporal = thisYearMonth.adjustInto(temporal);\n     *   temporal = temporal.with(thisYearMonth);\n     * 
\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal the target object to be adjusted, not null\n * @return {Temporal} the adjusted object, not null\n * @throws DateTimeException if unable to make the adjustment\n * @throws ArithmeticException if numeric overflow occurs\n */\n adjustInto(temporal) {\n requireNonNull(temporal, 'temporal');\n requireInstance(temporal, Temporal, 'temporal');\n /* TODO: only IsoChronology for now\n if (Chronology.from(temporal).equals(IsoChronology.INSTANCE) == false) {\n throw new DateTimeException(\"Adjustment only supported on ISO date-time\");\n }*/\n return temporal.with(ChronoField.PROLEPTIC_MONTH, this._getProlepticMonth());\n }\n\n /**\n * Calculates the period between this year-month and another year-month in\n * terms of the specified unit.\n *\n * This calculates the period between two year-months in terms of a single unit.\n * The start and end points are `this` and the specified year-month.\n * The result will be negative if the end is before the start.\n * The {@link Temporal} passed to this method must be a {@link YearMonth}.\n * For example, the period in years between two year-months can be calculated\n * using {@link startYearMonth.until}.\n *\n * The calculation returns a whole number, representing the number of\n * complete units between the two year-months.\n * For example, the period in decades between 2012-06 and 2032-05\n * will only be one decade as it is one month short of two decades.\n *\n * This method operates in association with {@link TemporalUnit#between}.\n * The result of this method is a `long` representing the amount of\n * the specified unit. By contrast, the result of {@link between} is an\n * object that can be used directly in addition/subtraction:\n *
\n     *   long period = start.until(end, YEARS);   // this method\n     *   dateTime.plus(YEARS.between(start, end));      // use in plus/minus\n     * 
\n *\n * The calculation is implemented in this method for {@link ChronoUnit}.\n * The units {@link MONTHS}, {@link YEARS}, {@link DECADES},\n * {@link CENTURIES}, {@link MILLENNIA} and {@link ERAS} are supported.\n * Other {@link ChronoUnit} values will throw an exception.\n *\n * If the unit is not a {@link ChronoUnit}, then the result of this method\n * is obtained by invoking {@link TemporalUnit.between}\n * passing `this` as the first argument and the input temporal as\n * the second argument.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} endExclusive the end year-month, which is converted to a {@link YearMonth}, not null\n * @param {TemporalUnit} unit the unit to measure the period in, not null\n * @return {number} the amount of the period between this year-month and the end year-month\n * @throws DateTimeException if the period cannot be calculated\n * @throws ArithmeticException if numeric overflow occurs\n */\n until(endExclusive, unit) {\n requireNonNull(endExclusive, 'endExclusive');\n requireNonNull(unit, 'unit');\n requireInstance(endExclusive, Temporal, 'endExclusive');\n requireInstance(unit, TemporalUnit, 'unit');\n\n const end = YearMonth.from(endExclusive);\n if (unit instanceof ChronoUnit) {\n const monthsUntil = end._getProlepticMonth() - this._getProlepticMonth(); // no overflow\n switch (unit) {\n case ChronoUnit.MONTHS: return monthsUntil;\n case ChronoUnit.YEARS: return monthsUntil / 12;\n case ChronoUnit.DECADES: return monthsUntil / 120;\n case ChronoUnit.CENTURIES: return monthsUntil / 1200;\n case ChronoUnit.MILLENNIA: return monthsUntil / 12000;\n case ChronoUnit.ERAS: return end.getLong(ChronoField.ERA) - this.getLong(ChronoField.ERA);\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n return unit.between(this, end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this year-month with a day-of-month to create a {@link LocalDate}.\n *\n * This returns a {@link LocalDate} formed from this year-month and the specified day-of-month.\n *\n * The day-of-month value must be valid for the year-month.\n *\n * This method can be used as part of a chain to produce a date:\n *
\n     *  LocalDate date = year.atMonth(month).atDay(day);\n     * 
\n *\n * @param {number} dayOfMonth the day-of-month to use, from 1 to 31\n * @return {LocalDate} the date formed from this year-month and the specified day, not null\n * @throws DateTimeException if the day is invalid for the year-month\n * @see #isValidDay(int)\n */\n atDay(dayOfMonth) {\n return LocalDate.of(this._year, this._month, dayOfMonth);\n }\n\n /**\n * Returns a {@link LocalDate} at the end of the month.\n *\n * This returns a {@link LocalDate} based on this year-month.\n * The day-of-month is set to the last valid day of the month, taking\n * into account leap years.\n *\n * This method can be used as part of a chain to produce a date:\n *
\n     *  LocalDate date = year.atMonth(month).atEndOfMonth();\n     * 
\n *\n * @return {LocalDate} the last valid date of this year-month, not null\n */\n atEndOfMonth() {\n return LocalDate.of(this._year, this._month, this.lengthOfMonth());\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this year-month to another year-month.\n *\n * The comparison is based first on the value of the year, then on the value of the month.\n * It is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * @param {YearMonth} other the other year-month to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, YearMonth, 'other');\n let cmp = (this._year - other.year());\n if (cmp === 0) {\n cmp = (this._month - other.monthValue());\n }\n return cmp;\n }\n\n /**\n * Is this year-month after the specified year-month.\n *\n * @param {YearMonth} other the other year-month to compare to, not null\n * @return {boolean} true if this is after the specified year-month\n */\n isAfter(other) {\n return this.compareTo(other) > 0;\n }\n\n /**\n * Is this year-month before the specified year-month.\n *\n * @param {YearMonth} other the other year-month to compare to, not null\n * @return {boolean} true if this point is before the specified year-month\n */\n isBefore(other) {\n return this.compareTo(other) < 0;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this year-month is equal to another year-month.\n *\n * The comparison is based on the time-line position of the year-months.\n *\n * @param {*} obj the object to check, null returns false\n * @return {boolean} true if this is equal to the other year-month\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof YearMonth) {\n const other = obj;\n return this.year() === other.year() && this.monthValue() === other.monthValue();\n }\n return false;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this year-month as a string, such as `2007-12`.\n *\n * The output will be in the format {@link yyyy-MM}:\n *\n * @return {String} a string representation of this year-month, not null\n */\n toString() {\n return PARSER.format(this);\n }\n\n /**\n * toJSON() use by JSON.stringify\n * delegates to toString()\n *\n * @return {string}\n */\n toJSON() {\n return this.toString();\n }\n\n /**\n * Outputs this year-month as a string using the formatter.\n *\n * @param {DateTimeFormatter} formatter the formatter to use, not null\n * @return {String} the formatted year-month string, not null\n * @throws DateTimeException if an error occurs during printing\n */\n format(formatter) {\n requireNonNull(formatter, 'formatter');\n return formatter.format(this);\n }\n\n}\n\nlet PARSER;\n\nexport function _init() {\n\n PARSER = new DateTimeFormatterBuilder()\n .appendValue(ChronoField.YEAR, 4, 10, SignStyle.EXCEEDS_PAD)\n .appendLiteral('-')\n .appendValue(ChronoField.MONTH_OF_YEAR, 2)\n .toFormatter();\n\n YearMonth.FROM = createTemporalQuery('YearMonth.FROM', (temporal) => {\n return YearMonth.from(temporal);\n });\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {DateTimeException, UnsupportedTemporalTypeException} from './errors';\nimport {requireNonNull, requireInstance} from './assert';\nimport {MathUtil} from './MathUtil';\n\nimport {ChronoField} from './temporal/ChronoField';\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {Clock} from './Clock';\nimport {DateTimeFormatter} from './format/DateTimeFormatter';\nimport {DateTimeFormatterBuilder} from './format/DateTimeFormatterBuilder';\nimport {IsoChronology} from './chrono/IsoChronology';\nimport {LocalDate} from './LocalDate';\nimport {Month} from './Month';\nimport {MonthDay} from './MonthDay';\nimport {SignStyle} from './format/SignStyle';\nimport {Temporal} from './temporal/Temporal';\nimport {TemporalAccessor} from './temporal/TemporalAccessor';\nimport {TemporalAmount} from './temporal/TemporalAmount';\nimport {TemporalField} from './temporal/TemporalField';\nimport {TemporalQueries} from './temporal/TemporalQueries';\nimport {TemporalQuery, createTemporalQuery} from './temporal/TemporalQuery';\nimport {TemporalUnit} from './temporal/TemporalUnit';\nimport {YearConstants} from './YearConstants';\nimport {YearMonth} from './YearMonth';\nimport {ZoneId} from './ZoneId';\n\n\n/**\n * A year in the ISO-8601 calendar system, such as `2007`.\n *\n * {@link Year} is an immutable date-time object that represents a year.\n * Any field that can be derived from a year can be obtained.\n *\n * **Note that years in the ISO chronology only align with years in the\n * Gregorian-Julian system for modern years. Parts of Russia did not switch to the\n * modern Gregorian/ISO rules until 1920.\n * As such, historical years must be treated with caution.**\n *\n * This class does not store or represent a month, day, time or time-zone.\n * For example, the value \"2007\" can be stored in a {@link Year}.\n *\n * Years represented by this class follow the ISO-8601 standard and use\n * the proleptic numbering system. Year 1 is preceded by year 0, then by year -1.\n *\n * The ISO-8601 calendar system is the modern civil calendar system used today\n * in most of the world. It is equivalent to the proleptic Gregorian calendar\n * system, in which today's rules for leap years are applied for all time.\n * For most applications written today, the ISO-8601 rules are entirely suitable.\n * However, any application that makes use of historical dates, and requires them\n * to be accurate will find the ISO-8601 approach unsuitable.\n *\n * ### Static properties of Class {@link LocalDate}\n *\n * Year.MIN_VALUE = -999.999;\n *\n * The minimum supported year. Theoretically the minimum could be -28.542.4812 years in javascript.\n * approx LocalDateTime.ofEpochSecond(Number.MIN_SAFE_INTEGER, 0, ZoneOffset.UTC).year()\n *\n * Year.MAX_VALUE = 999.999;\n *\n * The maximum supported year. Theoretically the maximum could be 285.428.751 years in javascript.\n * approx LocalDateTime.ofEpochSecond(Number.MAX_SAFE_INTEGER, 0, ZoneOffset.UTC).year()\n *\n */\nexport class Year extends Temporal {\n\n /**\n *\n * @param {number} value\n * @private\n */\n constructor(value) {\n super();\n this._year = MathUtil.safeToInt(value);\n }\n\n /**\n *\n * @return {number} gets the value\n */\n value() {\n return this._year;\n }\n\n /**\n * function overloading for {@link Year.now}\n *\n * if called without arguments, then {@link Year.now0} is executed.\n\n * if called with 1 arguments and first argument is an instance of ZoneId, then {@link Year.nowZoneId} is executed.\n *\n * Otherwise {@link Year.nowClock} is executed.\n *\n * @param {!(ZoneId|Clock)} zoneIdOrClock\n * @returns {Year}\n */\n static now(zoneIdOrClock = undefined) {\n if (zoneIdOrClock === undefined) {\n return Year.now0();\n } else if (zoneIdOrClock instanceof ZoneId) {\n return Year.nowZoneId(zoneIdOrClock);\n } else {\n return Year.nowClock(zoneIdOrClock);\n }\n }\n\n /**\n * Obtains the current year from the system clock in the default time-zone.\n *\n * This will query the system clock (see {@link Clock#systemDefaultZone}) in the default\n * time-zone to obtain the current year.\n *\n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @return {Year} the current year using the system clock and default time-zone, not null\n */\n static now0() {\n return Year.nowClock(Clock.systemDefaultZone());\n }\n\n /**\n * Obtains the current year from the system clock in the specified time-zone.\n *\n * This will query the system clock (see {@link Clock#system}) to obtain the current year.\n * Specifying the time-zone avoids dependence on the default time-zone.\n *\n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @param {ZoneId} zone the zone ID to use, not null\n * @return {Year} the current year using the system clock, not null\n */\n static nowZoneId(zone) {\n requireNonNull(zone, 'zone');\n requireInstance(zone, ZoneId, 'zone');\n return Year.nowClock(Clock.system(zone));\n }\n\n /**\n * Obtains the current year from the specified clock.\n *\n * This will query the specified clock to obtain the current year.\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using dependency injection.\n *\n * @param {Clock} clock the clock to use, not null\n * @return {Year} the current year, not null\n */\n static nowClock(clock) {\n requireNonNull(clock, 'clock');\n requireInstance(clock, Clock, 'clock');\n const now = LocalDate.now(clock); // called once\n return Year.of(now.year());\n }\n /**\n * Obtains an instance of {@link Year}.\n *\n * This method accepts a year value from the proleptic ISO calendar system.\n *\n * * The year 2AD/CE is represented by 2.\n * * The year 1AD/CE is represented by 1.\n * * The year 1BC/BCE is represented by 0.\n * * The year 2BC/BCE is represented by -1.\n *\n * @param {Number} isoYear the ISO proleptic year to represent, from {@link MIN_VALUE} to {@link MAX_VALUE}\n * @return {Year} the year, not null\n * @throws DateTimeException if the field is invalid\n */\n static of(isoYear) {\n requireNonNull(isoYear, 'isoYear');\n ChronoField.YEAR.checkValidValue(isoYear);\n return new Year(isoYear);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link Year} from a temporal object.\n *\n * A {@link TemporalAccessor} represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of {@link Year}.\n *\n * The conversion extracts the {@link ChronoField#YEAR} field.\n * The extraction is only permitted if the temporal object has an ISO\n * chronology, or can be converted to a {@link LocalDate}.\n *\n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used in queries via method reference, {@link Year::from}.\n *\n * @param {TemporalAccessor} temporal the temporal object to convert, not null\n * @return {Year} the year, not null\n * @throws DateTimeException if unable to convert to a {@link Year}\n */\n static from(temporal) {\n requireNonNull(temporal, 'temporal');\n requireInstance(temporal, TemporalAccessor, 'temporal');\n if (temporal instanceof Year) {\n return temporal;\n }\n try {\n /* TODO: we support only ISO for now\n if (IsoChronology.INSTANCE.equals(Chronology.from(temporal)) == false) {\n temporal = LocalDate.from(temporal);\n }*/\n return Year.of(temporal.get(ChronoField.YEAR));\n } catch (ex) {\n throw new DateTimeException('Unable to obtain Year from TemporalAccessor: ' +\n temporal + ', type ' + (temporal && temporal.constructor != null ? temporal.constructor.name : ''));\n }\n }\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link Year.parse}\n *\n * if called with 1 argument, then {@link Year.parseText} is executed.\n *\n * Otherwise {@link Year.parseTextFormatter} is executed.\n *\n * @param {!(String)} text\n * @param {?DateTimeFormatter} formatter\n * @returns {Year}\n */\n static parse(text, formatter) {\n if (arguments.length <= 1) {\n return Year.parseText(text);\n } else {\n return Year.parseTextFormatter(text, formatter);\n }\n }\n\n /**\n * Obtains an instance of {@link Year} from a text string such as `2007`.\n *\n * The string must represent a valid year.\n * Years outside the range 0000 to 9999 must be prefixed by the plus or minus symbol.\n *\n * @param {String} text the text to parse such as \"2007\", not null\n * @return {Year} the parsed year, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n static parseText(text) {\n requireNonNull(text, 'text');\n return Year.parse(text, PARSER);\n }\n\n /**\n * Obtains an instance of {@link Year} from a text string using a specific formatter.\n *\n * The text is parsed using the formatter, returning a year.\n *\n * @param {String} text the text to parse, not null\n * @param {DateTimeFormatter} formatter the formatter to use, not null\n * @return {Year} the parsed year, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n static parseTextFormatter(text, formatter = PARSER) {\n requireNonNull(text, 'text');\n requireNonNull(formatter, 'formatter');\n requireInstance(formatter, DateTimeFormatter, 'formatter');\n return formatter.parse(text, Year.FROM);\n }\n\n //-------------------------------------------------------------------------\n /**\n * Checks if the year is a leap year, according to the ISO proleptic\n * calendar system rules.\n *\n * This method applies the current rules for leap years across the whole time-line.\n * In general, a year is a leap year if it is divisible by four without\n * remainder. However, years divisible by 100, are not leap years, with\n * the exception of years divisible by 400 which are.\n *\n * For example, 1904 is a leap year it is divisible by 4.\n * 1900 was not a leap year as it is divisible by 100, however 2000 was a\n * leap year as it is divisible by 400.\n *\n * The calculation is proleptic - applying the same rules into the far future and far past.\n * This is historically inaccurate, but is correct for the ISO-8601 standard.\n *\n * @param {number} year the year to check\n * @return {boolean} true if the year is leap, false otherwise\n */\n static isLeap(year) {\n return ((MathUtil.intMod(year, 4) === 0) && ((MathUtil.intMod(year, 100) !== 0) || (MathUtil.intMod(year, 400) === 0)));\n }\n\n /**\n * function overloading for {@link YearMonth.isSupported}\n *\n * if called with 1 argument and first argument is an instance of TemporalField, then {@link YearMonth.isSupportedField} is executed,\n *\n * otherwise {@link YearMonth.isSupportedUnit} is executed\n *\n * @param {!(TemporalField|ChronoUnit)} fieldOrUnit\n * @returns {boolean}\n */\n isSupported(fieldOrUnit) {\n if (arguments.length === 1 && fieldOrUnit instanceof TemporalField) {\n return this.isSupportedField(fieldOrUnit);\n } else {\n return this.isSupportedUnit(fieldOrUnit);\n }\n }\n\n /**\n * Checks if the specified field is supported.\n *\n * This checks if this year can be queried for the specified field.\n * If false, then calling {@link range} and {@link get} will throw an exception.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return valid\n * values based on this date-time.\n * The supported fields are:\n *\n * * {@link YEAR_OF_ERA}\n * * {@link YEAR}\n * * {@link ERA}\n *\n * All other {@link ChronoField} instances will return false.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.isSupportedBy}\n * passing `this` as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param {TemporalField} field the field to check, null returns false\n * @return {boolean} true if the field is supported on this year, false if not\n */\n isSupportedField(field) {\n if (field instanceof ChronoField) {\n return field === ChronoField.YEAR || field === ChronoField.YEAR_OF_ERA || field === ChronoField.ERA;\n }\n return field != null && field.isSupportedBy(this);\n }\n\n isSupportedUnit(unit) {\n if (unit instanceof ChronoUnit) {\n return unit === ChronoUnit.YEARS || unit === ChronoUnit.DECADES || unit === ChronoUnit.CENTURIES || unit === ChronoUnit.MILLENNIA || unit === ChronoUnit.ERAS;\n }\n return unit != null && unit.isSupportedBy(this);\n }\n\n /**\n * Gets the range of valid values for the specified field.\n *\n * The range object expresses the minimum and maximum valid values for a field.\n * This year is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return\n * appropriate range instances.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.rangeRefinedBy}\n * passing `this` as the argument.\n * Whether the range can be obtained is determined by the field.\n *\n * @param {TemporalField} field the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws DateTimeException if the range for the field cannot be obtained\n */\n range(field) {\n if (this.isSupported(field)) {\n return field.range();\n } else if (field instanceof ChronoField) {\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return super.range(field);\n }\n\n /**\n * Gets the value of the specified field from this year as an `int`.\n *\n * This queries this year for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return valid\n * values based on this year.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field the field to get, not null\n * @return {number} the value for the field\n * @throws DateTimeException if a value for the field cannot be obtained\n * @throws ArithmeticException if numeric overflow occurs\n */\n get(field) {\n return this.range(field).checkValidIntValue(this.getLong(field), field);\n }\n\n /**\n * Gets the value of the specified field from this year as a `long`.\n *\n * This queries this year for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return valid\n * values based on this year.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field the field to get, not null\n * @return {number} the value for the field\n * @throws DateTimeException if a value for the field cannot be obtained\n * @throws ArithmeticException if numeric overflow occurs\n */\n getLong(field) {\n requireNonNull(field, 'field');\n if (field instanceof ChronoField) {\n switch (field) {\n case ChronoField.YEAR_OF_ERA: return (this._year < 1 ? 1 - this._year : this._year);\n case ChronoField.YEAR: return this._year;\n case ChronoField.ERA: return (this._year < 1 ? 0 : 1);\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.getFrom(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the year is a leap year, according to the ISO proleptic\n * calendar system rules.\n *\n * This method applies the current rules for leap years across the whole time-line.\n * In general, a year is a leap year if it is divisible by four without\n * remainder. However, years divisible by 100, are not leap years, with\n * the exception of years divisible by 400 which are.\n *\n * For example, 1904 is a leap year it is divisible by 4.\n * 1900 was not a leap year as it is divisible by 100, however 2000 was a\n * leap year as it is divisible by 400.\n *\n * The calculation is proleptic - applying the same rules into the far future and far past.\n * This is historically inaccurate, but is correct for the ISO-8601 standard.\n *\n * @return {boolean} true if the year is leap, false otherwise\n */\n isLeap() {\n return Year.isLeap(this._year);\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * Returns an adjusted copy of this year.\n *\n * This returns a new {@link Year}, based on this one, with the year adjusted.\n * The adjustment takes place using the specified adjuster strategy object.\n * Read the documentation of the adjuster to understand what adjustment will be made.\n *\n * The result of this method is obtained by invoking the\n * {@link TemporalAdjuster#adjustInto} method on the\n * specified adjuster passing `this` as the argument.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAdjuster} adjuster the adjuster to use, not null\n * @returns {Year} based on `this` with the adjustment made, not null\n * @throws DateTimeException if the adjustment cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n withAdjuster(adjuster) {\n requireNonNull(adjuster, 'adjuster');\n return adjuster.adjustInto(this);\n }\n\n /**\n * Returns a copy of this year with the specified field set to a new value.\n *\n * This returns a new {@link Year}, based on this one, with the value\n * for the specified field changed.\n * If it is not possible to set the value, because the field is not supported or for\n * some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the adjustment is implemented here.\n * The supported fields behave as follows:\n *\n * * {@link YEAR_OF_ERA} -\n * Returns a {@link Year} with the specified year-of-era\n * The era will be unchanged.\n * * {@link YEAR} -\n * Returns a {@link Year} with the specified year.\n * This completely replaces the date and is equivalent to {@link of}.\n * * {@link ERA} -\n * Returns a {@link Year} with the specified era.\n * The year-of-era will be unchanged.\n *\n * In all cases, if the new value is outside the valid range of values for the field\n * then a {@link DateTimeException} will be thrown.\n *\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.adjustInto}\n * passing `this` as the argument. In this case, the field determines\n * whether and how to adjust the instant.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalField} field the field to set in the result, not null\n * @param {number} newValue the new value of the field in the result\n * @returns {Year} based on `this` with the specified field set, not null\n * @throws DateTimeException if the field cannot be set\n * @throws ArithmeticException if numeric overflow occurs\n */\n withFieldValue(field, newValue) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n if (field instanceof ChronoField) {\n field.checkValidValue(newValue);\n switch (field) {\n case ChronoField.YEAR_OF_ERA:\n return Year.of((this._year < 1 ? 1 - newValue : newValue));\n case ChronoField.YEAR:\n return Year.of(newValue);\n case ChronoField.ERA:\n return (this.getLong(ChronoField.ERA) === newValue ? this : Year.of(1 - this._year));\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.adjustInto(this, newValue);\n }\n\n /**\n * Returns a copy of this year with the specified period added.\n *\n * This method returns a new year based on this year with the specified period added.\n * The adder is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link plus}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAmount} amount the amount to add, not null\n * @return {Year} based on this year with the addition made, not null\n * @throws DateTimeException if the addition cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusAmount(amount) {\n requireNonNull(amount, 'amount');\n requireInstance(amount, TemporalAmount, 'amount');\n return amount.addTo(this);\n }\n\n /**\n * @param {number} amountToAdd\n * @param {TemporalUnit} unit\n * @return {Year} based on this year with the addition made, not null\n * @throws DateTimeException if the addition cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusAmountUnit(amountToAdd, unit) {\n requireNonNull(amountToAdd, 'amountToAdd');\n requireNonNull(unit, 'unit');\n requireInstance(unit, TemporalUnit, 'unit');\n if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.YEARS: return this.plusYears(amountToAdd);\n case ChronoUnit.DECADES: return this.plusYears(MathUtil.safeMultiply(amountToAdd, 10));\n case ChronoUnit.CENTURIES: return this.plusYears(MathUtil.safeMultiply(amountToAdd, 100));\n case ChronoUnit.MILLENNIA: return this.plusYears(MathUtil.safeMultiply(amountToAdd, 1000));\n case ChronoUnit.ERAS: return this.with(ChronoField.ERA, MathUtil.safeAdd(this.getLong(ChronoField.ERA), amountToAdd));\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n return unit.addTo(this, amountToAdd);\n }\n\n /**\n * Returns a copy of this year with the specified number of years added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} yearsToAdd the years to add, may be negative\n * @return {Year} based on this year with the period added, not null\n * @throws DateTimeException if the result exceeds the supported year range\n */\n plusYears(yearsToAdd) {\n if (yearsToAdd === 0) {\n return this;\n }\n return Year.of(ChronoField.YEAR.checkValidIntValue(MathUtil.safeAdd(this._year, yearsToAdd)));\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * Returns a copy of this year with the specified period subtracted.\n *\n * This method returns a new year based on this year with the specified period subtracted.\n * The subtractor is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link minus}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAmount} amount the amount to subtract, not null\n * @return {Year} based on this year with the subtraction made, not null\n * @throws DateTimeException if the subtraction cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusAmount(amount) {\n requireNonNull(amount, 'amount');\n requireInstance(amount, TemporalAmount, 'amount');\n return amount.subtractFrom(this);\n }\n\n /**\n * @param {number} amountToSubtract the amount to subtract, not null\n * @param {TemporalUnit} unit\n * @return {Year} based on this year with the subtraction made, not null\n * @throws DateTimeException if the subtraction cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusAmountUnit(amountToSubtract, unit) {\n requireNonNull(amountToSubtract, 'amountToSubtract');\n requireNonNull(unit, 'unit');\n requireInstance(unit, TemporalUnit, 'unit');\n return (amountToSubtract === MathUtil.MIN_SAFE_INTEGER ? this.plus(MathUtil.MAX_SAFE_INTEGER, unit).plus(1, unit) : this.plus(-amountToSubtract, unit));\n }\n\n /**\n * Returns a copy of this year with the specified number of years subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} yearsToSubtract the years to subtract, may be negative\n * @return {Year} based on this year with the period subtracted, not null\n * @throws DateTimeException if the result exceeds the supported year range\n */\n minusYears(yearsToSubtract) {\n return (yearsToSubtract === MathUtil.MIN_SAFE_INTEGER ? this.plusYears(MathUtil.MAX_SAFE_INTEGER).plusYears(1) : this.plusYears(-yearsToSubtract));\n }\n\n /**\n * Adjusts the specified temporal object to have this year.\n *\n * This returns a temporal object of the same observable type as the input\n * with the year changed to be the same as this.\n *\n * The adjustment is equivalent to using {@link Temporal#with}\n * passing {@link ChronoField#YEAR} as the field.\n * If the specified temporal object does not use the ISO calendar system then\n * a {@link DateTimeException} is thrown.\n *\n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal#with}:\n *
\n     *   // these two lines are equivalent, but the second approach is recommended\n     *   temporal = thisYear.adjustInto(temporal);\n     *   temporal = temporal.with(thisYear);\n     * 
\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal the target object to be adjusted, not null\n * @return {Temporal} the adjusted object, not null\n * @throws DateTimeException if unable to make the adjustment\n * @throws ArithmeticException if numeric overflow occurs\n */\n adjustInto(temporal) {\n requireNonNull(temporal, 'temporal');\n /* TODO: only IsoChronology for now\n if (Chronology.from(temporal).equals(IsoChronology.INSTANCE) == false) {\n throw new DateTimeException(\"Adjustment only supported on ISO date-time\");\n }*/\n return temporal.with(ChronoField.YEAR, this._year);\n }\n\n /**\n * Checks if the month-day is valid for this year.\n *\n * This method checks whether this year and the input month and day form\n * a valid date.\n *\n * @param {MonthDay} monthDay the month-day to validate, null returns false\n * @return {boolean} true if the month and day are valid for this year\n */\n isValidMonthDay(monthDay) {\n return monthDay != null && monthDay.isValidYear(this._year);\n }\n\n /**\n * Gets the length of this year in days.\n *\n * @return {number} the length of this year in days, 365 or 366\n */\n length() {\n return this.isLeap() ? 366 : 365;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this year with a day-of-year to create a {@link LocalDate}.\n *\n * This returns a {@link LocalDate} formed from this year and the specified day-of-year.\n *\n * The day-of-year value 366 is only valid in a leap year.\n *\n * @param {number} dayOfYear the day-of-year to use, not null\n * @return {LocalDate} the local date formed from this year and the specified date of year, not null\n * @throws DateTimeException if the day of year is zero or less, 366 or greater or equal\n * to 366 and this is not a leap year\n */\n atDay(dayOfYear) {\n return LocalDate.ofYearDay(this._year, dayOfYear);\n }\n\n /**\n * function overloading for {@link Year.atMonth}\n *\n * if called with 1 arguments and first argument is instance of Month, then {@link Year.atMonthMonth} is executed.\n *\n * Otherwise {@link Year.atMonthNumber} is executed.\n *\n * @param {Month|number} monthOrNumber\n * @returns {YearMonth}\n */\n atMonth(monthOrNumber) {\n if (arguments.length === 1 && monthOrNumber instanceof Month) {\n return this.atMonthMonth(monthOrNumber);\n } else {\n return this.atMonthNumber(monthOrNumber);\n }\n }\n\n /**\n * Combines this year with a month to create a {@link YearMonth}.\n *\n * This returns a {@link YearMonth} formed from this year and the specified month.\n * All possible combinations of year and month are valid.\n *\n * This method can be used as part of a chain to produce a date:\n *
\n     *  LocalDate date = year.atMonth(month).atDay(day);\n     * 
\n *\n * @param {Month} month the month-of-year to use, not null\n * @return {YearMonth} the year-month formed from this year and the specified month, not null\n */\n atMonthMonth(month) {\n requireNonNull(month, 'month');\n requireInstance(month, Month, 'month');\n return YearMonth.of(this._year, month);\n }\n\n /**\n * Combines this year with a month to create a {@link YearMonth}.\n *\n * This returns a {@link YearMonth} formed from this year and the specified month.\n * All possible combinations of year and month are valid.\n *\n * This method can be used as part of a chain to produce a date:\n *
\n     *  LocalDate date = year.atMonth(month).atDay(day);\n     * 
\n *\n * @param {number} month the month-of-year to use, from 1 (January) to 12 (December)\n * @return {YearMonth} the year-month formed from this year and the specified month, not null\n * @throws DateTimeException if the month is invalid\n */\n atMonthNumber(month) {\n requireNonNull(month, 'month');\n return YearMonth.of(this._year, month);\n }\n\n /**\n * Combines this year with a month-day to create a {@link LocalDate}.\n *\n * This returns a {@link LocalDate} formed from this year and the specified month-day.\n *\n * A month-day of February 29th will be adjusted to February 28th in the resulting\n * date if the year is not a leap year.\n *\n * @param {MonthDay} monthDay the month-day to use, not null\n * @return {LocalDate} the local date formed from this year and the specified month-day, not null\n */\n atMonthDay(monthDay) {\n requireNonNull(monthDay, 'monthDay');\n requireInstance(monthDay, MonthDay, 'monthDay');\n return monthDay.atYear(this._year);\n }\n\n\n //-----------------------------------------------------------------------\n /**\n * Queries this year using the specified query.\n *\n * This queries this year using the specified query strategy object.\n * The {@link TemporalQuery} object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n *\n * The result of this method is obtained by invoking the\n * {@link TemporalQuery#queryFrom} method on the\n * specified query passing `this` as the argument.\n *\n * @param {TemporalQuery} query the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws DateTimeException if unable to query (defined by the query)\n * @throws ArithmeticException if numeric overflow occurs (defined by the query)\n */\n query(query) {\n requireNonNull(query, 'query()');\n requireInstance(query, TemporalQuery, 'query()');\n if (query === TemporalQueries.chronology()) {\n return IsoChronology.INSTANCE;\n } else if (query === TemporalQueries.precision()) {\n return ChronoUnit.YEARS;\n } else if (query === TemporalQueries.localDate() || query === TemporalQueries.localTime() ||\n query === TemporalQueries.zone() || query === TemporalQueries.zoneId() || query === TemporalQueries.offset()) {\n return null;\n }\n return super.query(query);\n }\n //-----------------------------------------------------------------------\n /**\n * Compares this year to another year.\n *\n * The comparison is based on the value of the year.\n * It is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * @param {Year} other the other year to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Year, 'other');\n return this._year - other._year;\n }\n\n /**\n * Is this year after the specified year.\n *\n * @param {Year} other the other year to compare to, not null\n * @return {boolean} true if this is after the specified year\n */\n isAfter(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Year, 'other');\n return this._year > other._year;\n }\n\n /**\n * Is this year before the specified year.\n *\n * @param {Year} other the other year to compare to, not null\n * @return {boolean} true if this point is before the specified year\n */\n isBefore(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Year, 'other');\n return this._year < other._year;\n }\n /**\n * Outputs this year as a string using the formatter.\n *\n * @param {DateTimeFormatter} formatter the formatter to use, not null\n * @return {String} the formatted year string, not null\n * @throws DateTimeException if an error occurs during printing\n */\n format(formatter) {\n requireNonNull(formatter, 'formatter');\n requireInstance(formatter, DateTimeFormatter, 'formatter');\n return formatter.format(this);\n }\n\n /**\n * Checks if this year is equal to the specified {@link Year}.\n *\n * The comparison is based on the value\n *\n * @param {*} other - the other year, null returns false\n * @return {boolean} true if the other duration is equal to this one\n */\n equals(other) {\n if (this === other) {\n return true;\n }\n if (other instanceof Year) {\n return this.value() === other.value();\n }\n return false;\n }\n /**\n * Outputs this year as a string.\n *\n * @return {String} a string representation of this year, not null\n */\n toString() {\n return '' + this._year;\n }\n\n /**\n * toJSON() use by JSON.stringify\n * delegates to toString()\n *\n * @return {string}\n */\n toJSON() {\n return this.toString();\n }\n\n /**\n * Calculates the amount of time until another temporal in terms of the specified unit.\n * This calculates the amount of time between two temporal objects in terms of a single {@link TemporalUnit}. The start and end points are this and the specified temporal. The end point is converted to be of the same type as the start point if different. The result will be negative if the end is before the start. For example, the amount in hours between two temporal objects can be calculated using `startTime.until(endTime, HOURS)`.\n *\n * The calculation returns a whole number, representing the number of complete units between the two temporals. For example, the amount in hours between the times 11:30 and 13:29 will only be one hour as it is one minute short of two hours.\n *\n * There are two equivalent ways of using this method. The first is to invoke this method directly. The second is to use `TemporalUnit.between(Temporal, Temporal)`:\n *\n *
\n     *    // these two lines are equivalent\n     *    temporal = start.until(end, unit);\n     *    temporal = unit.between(start, end);\n     * 
\n *\n * The choice should be made based on which makes the code more readable.\n * For example, this method allows the number of days between two dates to be calculated:\n *\n *
\n     *   daysBetween = start.until(end, DAYS);\n     *   // or alternatively\n     *   daysBetween = DAYS.between(start, end);\n     * 
\n *\n * ### Implementation Requirements:\n * Implementations must begin by checking to ensure that the input temporal object is of the same observable type as the implementation. They must then perform the calculation for all instances of {@link ChronoUnit}. An {@link UnsupportedTemporalTypeException} must be thrown for {@link ChronoUnit} instances that are unsupported.\n * If the unit is not a {@link ChronoUnit}, then the result of this method is obtained by invoking `TemporalUnit.between(Temporal, Temporal)` passing this as the first argument and the converted input temporal as the second argument.\n *\n * In summary, implementations must behave in a manner equivalent to this pseudo-code:\n *\n *
\n     *   // convert the end temporal to the same type as this class\n     *   if (unit instanceof ChronoUnit) {\n     *     // if unit is supported, then calculate and return result\n     *     // else throw UnsupportedTemporalTypeException for unsupported units\n     *   }\n     *   return unit.between(this, convertedEndTemporal);\n     * 
\n *\n * Note that the unit's between method must only be invoked if the two temporal objects have exactly the same type evaluated by `getClass()`.\n *\n * Implementations must ensure that no observable state is altered when this read-only method is invoked.\n *\n * @param {Temporal} endExclusive - the end temporal, exclusive, converted to be of the same type as this object, not null\n * @param {TemporalUnit} unit - the unit to measure the amount in, not null\n * @return {number} the amount of time between this temporal object and the specified one in terms of the unit; positive if the specified object is later than this one, negative if it is earlier than this one\n * @throws DateTimeException - if the amount cannot be calculated, or the end temporal cannot be converted to the same type as this temporal\n * @throws UnsupportedTemporalTypeException - if the unit is not supported\n * @throws ArithmeticException - if numeric overflow occurs\n */\n until(endExclusive, unit) {\n const end = Year.from(endExclusive);\n\n if (unit instanceof ChronoUnit) {\n const yearsUntil = end.value() - this.value();\n switch (unit) {\n case ChronoUnit.YEARS:\n return yearsUntil;\n case ChronoUnit.DECADES:\n return MathUtil.intDiv(yearsUntil, 10);\n case ChronoUnit.CENTURIES:\n return MathUtil.intDiv(yearsUntil, 100);\n case ChronoUnit.MILLENNIA:\n return MathUtil.intDiv(yearsUntil, 1000);\n case ChronoUnit.ERAS:\n return end.getLong(ChronoField.ERA) - this.getLong(ChronoField.ERA);\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n return unit.between(this, end);\n }\n}\n\nlet PARSER;\n\nexport function _init() {\n\n Year.MIN_VALUE = YearConstants.MIN_VALUE;\n Year.MAX_VALUE = YearConstants.MAX_VALUE;\n\n PARSER = new DateTimeFormatterBuilder()\n .appendValue(ChronoField.YEAR, 4, 10, SignStyle.EXCEEDS_PAD)\n .toFormatter();\n\n Year.FROM = createTemporalQuery('Year.FROM', (temporal) => {\n return Year.from(temporal);\n });\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {requireNonNull} from '../assert';\nimport {IllegalStateException} from '../errors';\n\nimport {TemporalAdjuster} from './TemporalAdjuster';\nimport {ChronoField} from '../temporal/ChronoField';\nimport {ChronoUnit} from '../temporal/ChronoUnit';\nimport {MathUtil} from '../MathUtil';\n\n/**\n * Common implementations of {@link TemporalAdjuster}.\n *\n * This class provides common implementations of {@link TemporalAdjuster}.\n * They are especially useful to document the intent of business logic and\n * often link well to requirements.\n * For example, these two pieces of code do the same thing, but the second\n * one is clearer (assuming that there is a static import of this class):\n *
\n *  // direct manipulation\n *  date.withDayOfMonth(1).plusMonths(1).minusDays(1);\n *  // use of an adjuster from this class\n *  date.with(lastDayOfMonth());\n * 
\n * There are two equivalent ways of using a {@link TemporalAdjuster}.\n * The first is to invoke the method on the interface directly.\n * The second is to use {@link Temporal#with}:\n *
\n *   // these two lines are equivalent, but the second approach is recommended\n *   dateTime = adjuster.adjustInto(dateTime);\n *   dateTime = dateTime.with(adjuster);\n * 
\n * It is recommended to use the second approach, {@link with},\n * as it is a lot clearer to read in code.\n *\n * ### Specification for implementors\n *\n * This is a thread-safe utility class.\n * All returned adjusters are immutable and thread-safe.\n *\n * The JDK 8 ofDateAdjuster(UnaryOperator) method is not backported.\n */\nexport class TemporalAdjusters {\n\n //-----------------------------------------------------------------------\n /**\n * Returns the 'first day of month' adjuster, which returns a new date set to\n * the first day of the current month.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-01-15 will return 2011-01-01.\n * * The input 2011-02-15 will return 2011-02-01.\n *\n * The behavior is suitable for use with most calendar systems.\n * It is equivalent to:\n *
\n     *  temporal.with(DAY_OF_MONTH, 1);\n     * 
\n *\n * @return {TemporalAdjuster} the first day-of-month adjuster, not null\n */\n static firstDayOfMonth() {\n return Impl.FIRST_DAY_OF_MONTH;\n }\n\n /**\n * Returns the 'last day of month' adjuster, which returns a new date set to\n * the last day of the current month.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-01-15 will return 2011-01-31.\n * * The input 2011-02-15 will return 2011-02-28.\n * * The input 2012-02-15 will return 2012-02-29 (leap year).\n * * The input 2011-04-15 will return 2011-04-30.\n *\n * The behavior is suitable for use with most calendar systems.\n * It is equivalent to:\n *
\n     *  long lastDay = temporal.range(DAY_OF_MONTH).getMaximum();\n     *  temporal.with(DAY_OF_MONTH, lastDay);\n     * 
\n *\n * @return {TemporalAdjuster} the last day-of-month adjuster, not null\n */\n static lastDayOfMonth() {\n return Impl.LAST_DAY_OF_MONTH;\n }\n\n /**\n * Returns the 'first day of next month' adjuster, which returns a new date set to\n * the first day of the next month.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-01-15 will return 2011-02-01.\n * * The input 2011-02-15 will return 2011-03-01.\n *\n * The behavior is suitable for use with most calendar systems.\n * It is equivalent to:\n *
\n     *  temporal.with(DAY_OF_MONTH, 1).plus(1, MONTHS);\n     * 
\n *\n * @return {TemporalAdjuster} the first day of next month adjuster, not null\n */\n static firstDayOfNextMonth() {\n return Impl.FIRST_DAY_OF_NEXT_MONTH;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns the 'first day of year' adjuster, which returns a new date set to\n * the first day of the current year.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-01-15 will return 2011-01-01.\n * * The input 2011-02-15 will return 2011-01-01.\n *\n * The behavior is suitable for use with most calendar systems.\n * It is equivalent to:\n *
\n     *  temporal.with(DAY_OF_YEAR, 1);\n     * 
\n *\n * @return {TemporalAdjuster} the first day-of-year adjuster, not null\n */\n static firstDayOfYear() {\n return Impl.FIRST_DAY_OF_YEAR;\n }\n\n /**\n * Returns the 'last day of year' adjuster, which returns a new date set to\n * the last day of the current year.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-01-15 will return 2011-12-31.\n * * The input 2011-02-15 will return 2011-12-31.\n *\n * The behavior is suitable for use with most calendar systems.\n * It is equivalent to:\n *
\n     *  long lastDay = temporal.range(DAY_OF_YEAR).getMaximum();\n     *  temporal.with(DAY_OF_YEAR, lastDay);\n     * 
\n *\n * @return {TemporalAdjuster} the last day-of-year adjuster, not null\n */\n static lastDayOfYear() {\n return Impl.LAST_DAY_OF_YEAR;\n }\n\n /**\n * Returns the 'first day of next year' adjuster, which returns a new date set to\n * the first day of the next year.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-01-15 will return 2012-01-01.\n *\n * The behavior is suitable for use with most calendar systems.\n * It is equivalent to:\n *
\n     *  temporal.with(DAY_OF_YEAR, 1).plus(1, YEARS);\n     * 
\n *\n * @return {TemporalAdjuster} the first day of next month adjuster, not null\n */\n static firstDayOfNextYear() {\n return Impl.FIRST_DAY_OF_NEXT_YEAR;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns the first in month adjuster, which returns a new date\n * in the same month with the first matching day-of-week.\n * This is used for expressions like 'first Tuesday in March'.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-12-15 for (MONDAY) will return 2011-12-05.\n * * The input 2011-12-15 for (FRIDAY) will return 2011-12-02.\n *\n * The behavior is suitable for use with most calendar systems.\n * It uses the {@link DAY_OF_WEEK} and {@link DAY_OF_MONTH} fields\n * and the {@link DAYS} unit, and assumes a seven day week.\n *\n * @param {DayOfWeek} dayOfWeek the day-of-week, not null\n * @return {TemporalAdjuster} the first in month adjuster, not null\n */\n static firstInMonth(dayOfWeek) {\n requireNonNull(dayOfWeek, 'dayOfWeek');\n return new DayOfWeekInMonth(1, dayOfWeek);\n }\n\n /**\n * Returns the last in month adjuster, which returns a new date\n * in the same month with the last matching day-of-week.\n * This is used for expressions like 'last Tuesday in March'.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-12-15 for (MONDAY) will return 2011-12-26.\n * * The input 2011-12-15 for (FRIDAY) will return 2011-12-30.\n *\n * The behavior is suitable for use with most calendar systems.\n * It uses the {@link DAY_OF_WEEK} and {@link DAY_OF_MONTH} fields\n * and the {@link DAYS} unit, and assumes a seven day week.\n *\n * @param {DayOfWeek} dayOfWeek the day-of-week, not null\n * @return {TemporalAdjuster} the first in month adjuster, not null\n */\n static lastInMonth(dayOfWeek) {\n requireNonNull(dayOfWeek, 'dayOfWeek');\n return new DayOfWeekInMonth(-1, dayOfWeek);\n }\n\n /**\n * Returns the day-of-week in month adjuster, which returns a new date\n * in the same month with the ordinal day-of-week.\n * This is used for expressions like the 'second Tuesday in March'.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-12-15 for (1,TUESDAY) will return 2011-12-06.\n * * The input 2011-12-15 for (2,TUESDAY) will return 2011-12-13.\n * * The input 2011-12-15 for (3,TUESDAY) will return 2011-12-20.\n * * The input 2011-12-15 for (4,TUESDAY) will return 2011-12-27.\n * * The input 2011-12-15 for (5,TUESDAY) will return 2012-01-03.\n * * The input 2011-12-15 for (-1,TUESDAY) will return 2011-12-27 (last in month).\n * * The input 2011-12-15 for (-4,TUESDAY) will return 2011-12-06 (3 weeks before last in month).\n * * The input 2011-12-15 for (-5,TUESDAY) will return 2011-11-29 (4 weeks before last in month).\n * * The input 2011-12-15 for (0,TUESDAY) will return 2011-11-29 (last in previous month).\n *\n * For a positive or zero ordinal, the algorithm is equivalent to finding the first\n * day-of-week that matches within the month and then adding a number of weeks to it.\n * For a negative ordinal, the algorithm is equivalent to finding the last\n * day-of-week that matches within the month and then subtracting a number of weeks to it.\n * The ordinal number of weeks is not validated and is interpreted leniently\n * according to this algorithm. This definition means that an ordinal of zero finds\n * the last matching day-of-week in the previous month.\n *\n * The behavior is suitable for use with most calendar systems.\n * It uses the {@link DAY_OF_WEEK} and {@link DAY_OF_MONTH} fields\n * and the {@link DAYS} unit, and assumes a seven day week.\n *\n * @param {Number} ordinal the week within the month, unbounded but typically from -5 to 5\n * @param {DayOfWeek} dayOfWeek the day-of-week, not null\n * @return {TemporalAdjuster} the day-of-week in month adjuster, not null\n */\n static dayOfWeekInMonth(ordinal, dayOfWeek) {\n requireNonNull(dayOfWeek, 'dayOfWeek');\n return new DayOfWeekInMonth(ordinal, dayOfWeek);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns the next day-of-week adjuster, which adjusts the date to the\n * first occurrence of the specified day-of-week after the date being adjusted.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-01-15 (a Saturday) for parameter (MONDAY) will return 2011-01-17 (two days later).\n * * The input 2011-01-15 (a Saturday) for parameter (WEDNESDAY) will return 2011-01-19 (four days later).\n * * The input 2011-01-15 (a Saturday) for parameter (SATURDAY) will return 2011-01-22 (seven days later).\n *\n * The behavior is suitable for use with most calendar systems.\n * It uses the {@link DAY_OF_WEEK} field and the {@link DAYS} unit,\n * and assumes a seven day week.\n *\n * @param {DayOfWeek} dayOfWeek the day-of-week to move the date to, not null\n * @return {TemporalAdjuster} the next day-of-week adjuster, not null\n */\n static next(dayOfWeek) {\n return new RelativeDayOfWeek(2, dayOfWeek);\n }\n\n /**\n * Returns the next-or-same day-of-week adjuster, which adjusts the date to the\n * first occurrence of the specified day-of-week after the date being adjusted\n * unless it is already on that day in which case the same object is returned.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-01-15 (a Saturday) for parameter (MONDAY) will return 2011-01-17 (two days later).\n * * The input 2011-01-15 (a Saturday) for parameter (WEDNESDAY) will return 2011-01-19 (four days later).\n * * The input 2011-01-15 (a Saturday) for parameter (SATURDAY) will return 2011-01-15 (same as input).\n *\n * The behavior is suitable for use with most calendar systems.\n * It uses the {@link DAY_OF_WEEK} field and the {@link DAYS} unit,\n * and assumes a seven day week.\n *\n * @param {DayOfWeek} dayOfWeek the day-of-week to check for or move the date to, not null\n * @return {TemporalAdjuster} the next-or-same day-of-week adjuster, not null\n */\n static nextOrSame(dayOfWeek) {\n return new RelativeDayOfWeek(0, dayOfWeek);\n }\n\n /**\n * Returns the previous day-of-week adjuster, which adjusts the date to the\n * first occurrence of the specified day-of-week before the date being adjusted.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-01-15 (a Saturday) for parameter (MONDAY) will return 2011-01-10 (five days earlier).\n * * The input 2011-01-15 (a Saturday) for parameter (WEDNESDAY) will return 2011-01-12 (three days earlier).\n * * The input 2011-01-15 (a Saturday) for parameter (SATURDAY) will return 2011-01-08 (seven days earlier).\n *\n * The behavior is suitable for use with most calendar systems.\n * It uses the {@link DAY_OF_WEEK} field and the {@link DAYS} unit,\n * and assumes a seven day week.\n *\n * @param {DayOfWeek} dayOfWeek the day-of-week to move the date to, not null\n * @return {TemporalAdjuster} the previous day-of-week adjuster, not null\n */\n static previous(dayOfWeek) {\n return new RelativeDayOfWeek(3, dayOfWeek);\n }\n\n /**\n * Returns the previous-or-same day-of-week adjuster, which adjusts the date to the\n * first occurrence of the specified day-of-week before the date being adjusted\n * unless it is already on that day in which case the same object is returned.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-01-15 (a Saturday) for parameter (MONDAY) will return 2011-01-10 (five days earlier).\n * * The input 2011-01-15 (a Saturday) for parameter (WEDNESDAY) will return 2011-01-12 (three days earlier).\n * * The input 2011-01-15 (a Saturday) for parameter (SATURDAY) will return 2011-01-15 (same as input).\n *\n * The behavior is suitable for use with most calendar systems.\n * It uses the {@link DAY_OF_WEEK} field and the {@link DAYS} unit,\n * and assumes a seven day week.\n *\n * @param {DayOfWeek} dayOfWeek the day-of-week to check for or move the date to, not null\n * @return {TemporalAdjuster} the previous-or-same day-of-week adjuster, not null\n */\n static previousOrSame(dayOfWeek) {\n return new RelativeDayOfWeek(1, dayOfWeek);\n }\n\n}\n\n//-----------------------------------------------------------------------\n/**\n * Enum implementing the adjusters.\n */\nclass Impl extends TemporalAdjuster {\n\n /**\n *\n * @param ordinal\n * @private\n */\n constructor(ordinal) {\n super();\n this._ordinal = ordinal;\n }\n\n adjustInto(temporal) {\n switch (this._ordinal) {\n case 0: return temporal.with(ChronoField.DAY_OF_MONTH, 1);\n case 1: return temporal.with(ChronoField.DAY_OF_MONTH, temporal.range(ChronoField.DAY_OF_MONTH).maximum());\n case 2: return temporal.with(ChronoField.DAY_OF_MONTH, 1).plus(1, ChronoUnit.MONTHS);\n case 3: return temporal.with(ChronoField.DAY_OF_YEAR, 1);\n case 4: return temporal.with(ChronoField.DAY_OF_YEAR, temporal.range(ChronoField.DAY_OF_YEAR).maximum());\n case 5: return temporal.with(ChronoField.DAY_OF_YEAR, 1).plus(1, ChronoUnit.YEARS);\n }\n throw new IllegalStateException('Unreachable');\n }\n\n}\n\n/** First day of month adjuster. */\nImpl.FIRST_DAY_OF_MONTH = new Impl(0);\n/** Last day of month adjuster. */\nImpl.LAST_DAY_OF_MONTH = new Impl(1);\n/** First day of next month adjuster. */\nImpl.FIRST_DAY_OF_NEXT_MONTH = new Impl(2);\n/** First day of year adjuster. */\nImpl.FIRST_DAY_OF_YEAR = new Impl(3);\n/** Last day of year adjuster. */\nImpl.LAST_DAY_OF_YEAR = new Impl(4);\n/** First day of next month adjuster. */\nImpl.FIRST_DAY_OF_NEXT_YEAR = new Impl(5);\n\n\n/**\n * Class implementing day-of-week in month adjuster.\n */\nclass DayOfWeekInMonth extends TemporalAdjuster {\n\n /**\n *\n * @param ordinal\n * @param dow\n * @private\n */\n constructor(ordinal, dow) {\n super();\n this._ordinal = ordinal;\n this._dowValue = dow.value();\n }\n\n adjustInto(temporal) {\n if (this._ordinal >= 0) {\n const temp = temporal.with(ChronoField.DAY_OF_MONTH, 1);\n const curDow = temp.get(ChronoField.DAY_OF_WEEK);\n let dowDiff = MathUtil.intMod((this._dowValue - curDow + 7), 7);\n dowDiff += (this._ordinal - 1) * 7; // safe from overflow\n return temp.plus(dowDiff, ChronoUnit.DAYS);\n } else {\n const temp = temporal.with(ChronoField.DAY_OF_MONTH, temporal.range(ChronoField.DAY_OF_MONTH).maximum());\n const curDow = temp.get(ChronoField.DAY_OF_WEEK);\n let daysDiff = this._dowValue - curDow;\n daysDiff = (daysDiff === 0 ? 0 : (daysDiff > 0 ? daysDiff - 7 : daysDiff));\n daysDiff -= (-this._ordinal - 1) * 7; // safe from overflow\n return temp.plus(daysDiff, ChronoUnit.DAYS);\n }\n }\n}\n\n/**\n * Implementation of next, previous or current day-of-week.\n */\nclass RelativeDayOfWeek extends TemporalAdjuster {\n\n /**\n *\n * @param relative\n * @param dayOfWeek\n * @private\n */\n constructor(relative, dayOfWeek) {\n super();\n requireNonNull(dayOfWeek, 'dayOfWeek');\n /** Whether the current date is a valid answer. */\n this._relative = relative;\n /** The day-of-week value, from 1 to 7. */\n this._dowValue = dayOfWeek.value();\n }\n\n adjustInto(temporal) {\n const calDow = temporal.get(ChronoField.DAY_OF_WEEK);\n if (this._relative < 2 && calDow === this._dowValue) {\n return temporal;\n }\n if ((this._relative & 1) === 0) {\n const daysDiff = calDow - this._dowValue;\n return temporal.plus(daysDiff >= 0 ? 7 - daysDiff : -daysDiff, ChronoUnit.DAYS);\n } else {\n const daysDiff = this._dowValue - calDow;\n return temporal.minus(daysDiff >= 0 ? 7 - daysDiff : -daysDiff, ChronoUnit.DAYS);\n }\n }\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {Enum} from '../Enum';\nimport {requireNonNull} from '../assert';\nimport {DateTimeException} from '../errors';\nimport {MathUtil} from '../MathUtil';\n\nimport {DayOfWeek} from '../DayOfWeek';\nimport {LocalDate} from '../LocalDate';\nimport {Month} from '../Month';\nimport {Year} from '../Year';\n\nimport {ChronoField} from '../temporal/ChronoField';\nimport {ResolverStyle} from '../format/ResolverStyle';\nimport {TemporalAdjusters} from '../temporal/TemporalAdjusters';\n\nexport class IsoChronology extends Enum{\n /**\n * Checks if the year is a leap year, according to the ISO proleptic\n * calendar system rules.\n *\n * This method applies the current rules for leap years across the whole time-line.\n * In general, a year is a leap year if it is divisible by four without\n * remainder. However, years divisible by 100, are not leap years, with\n * the exception of years divisible by 400 which are.\n *\n * For example, 1904 is a leap year it is divisible by 4.\n * 1900 was not a leap year as it is divisible by 100, however 2000 was a\n * leap year as it is divisible by 400.\n *\n * The calculation is proleptic - applying the same rules into the far future and far past.\n * This is historically inaccurate, but is correct for the ISO-8601 standard.\n *\n * @param {number} prolepticYear - the ISO proleptic year to check\n * @return {boolean} true if the year is leap, false otherwise\n */\n static isLeapYear(prolepticYear) {\n return ((prolepticYear & 3) === 0) && ((prolepticYear % 100) !== 0 || (prolepticYear % 400) === 0);\n }\n\n /**\n * Updates the map of field-values during resolution.\n *\n * @param {EnumMap} fieldValues the fieldValues map to update, not null\n * @param {ChronoField} field the field to update, not null\n * @param {number} value the value to update, not null\n * @throws DateTimeException if a conflict occurs\n */\n _updateResolveMap(fieldValues, field, value) {\n // TODO: this function is in Chronology in threetenbp, maybe needs to be moved?\n requireNonNull(fieldValues, 'fieldValues');\n requireNonNull(field, 'field');\n const current = fieldValues.get(field);\n if (current != null && current !== value) {\n throw new DateTimeException('Invalid state, field: ' + field + ' ' + current + ' conflicts with ' + field + ' ' + value);\n }\n fieldValues.put(field, value);\n }\n\n resolveDate(fieldValues, resolverStyle) {\n if (fieldValues.containsKey(ChronoField.EPOCH_DAY)) {\n return LocalDate.ofEpochDay(fieldValues.remove(ChronoField.EPOCH_DAY));\n }\n\n // normalize fields\n const prolepticMonth = fieldValues.remove(ChronoField.PROLEPTIC_MONTH);\n if (prolepticMonth != null) {\n if (resolverStyle !== ResolverStyle.LENIENT) {\n ChronoField.PROLEPTIC_MONTH.checkValidValue(prolepticMonth);\n }\n this._updateResolveMap(fieldValues, ChronoField.MONTH_OF_YEAR, MathUtil.floorMod(prolepticMonth, 12) + 1);\n this._updateResolveMap(fieldValues, ChronoField.YEAR, MathUtil.floorDiv(prolepticMonth, 12));\n }\n\n // eras\n const yoeLong = fieldValues.remove(ChronoField.YEAR_OF_ERA);\n if (yoeLong != null) {\n if (resolverStyle !== ResolverStyle.LENIENT) {\n ChronoField.YEAR_OF_ERA.checkValidValue(yoeLong);\n }\n const era = fieldValues.remove(ChronoField.ERA);\n if (era == null) {\n const year = fieldValues.get(ChronoField.YEAR);\n if (resolverStyle === ResolverStyle.STRICT) {\n // do not invent era if strict, but do cross-check with year\n if (year != null) {\n this._updateResolveMap(fieldValues, ChronoField.YEAR, (year > 0 ? yoeLong: MathUtil.safeSubtract(1, yoeLong)));\n } else {\n // reinstate the field removed earlier, no cross-check issues\n fieldValues.put(ChronoField.YEAR_OF_ERA, yoeLong);\n }\n } else {\n // invent era\n this._updateResolveMap(fieldValues, ChronoField.YEAR, (year == null || year > 0 ? yoeLong: MathUtil.safeSubtract(1, yoeLong)));\n }\n } else if (era === 1) {\n this._updateResolveMap(fieldValues, ChronoField.YEAR, yoeLong);\n } else if (era === 0) {\n this._updateResolveMap(fieldValues, ChronoField.YEAR, MathUtil.safeSubtract(1, yoeLong));\n } else {\n throw new DateTimeException('Invalid value for era: ' + era);\n }\n } else if (fieldValues.containsKey(ChronoField.ERA)) {\n ChronoField.ERA.checkValidValue(fieldValues.get(ChronoField.ERA)); // always validated\n }\n\n // build date\n if (fieldValues.containsKey(ChronoField.YEAR)) {\n if (fieldValues.containsKey(ChronoField.MONTH_OF_YEAR)) {\n if (fieldValues.containsKey(ChronoField.DAY_OF_MONTH)) {\n const y = ChronoField.YEAR.checkValidIntValue(fieldValues.remove(ChronoField.YEAR));\n const moy = fieldValues.remove(ChronoField.MONTH_OF_YEAR);\n let dom = fieldValues.remove(ChronoField.DAY_OF_MONTH);\n if (resolverStyle === ResolverStyle.LENIENT) {\n const months = moy - 1;\n const days = dom - 1;\n return LocalDate.of(y, 1, 1).plusMonths(months).plusDays(days);\n } else if (resolverStyle === ResolverStyle.SMART){\n ChronoField.DAY_OF_MONTH.checkValidValue(dom);\n if (moy === 4 || moy === 6 || moy === 9 || moy === 11) {\n dom = Math.min(dom, 30);\n } else if (moy === 2) {\n dom = Math.min(dom, Month.FEBRUARY.length(Year.isLeap(y)));\n }\n return LocalDate.of(y, moy, dom);\n } else {\n return LocalDate.of(y, moy, dom);\n }\n }\n /*\n if (fieldValues.containsKey(ALIGNED_WEEK_OF_MONTH)) {\n if (fieldValues.containsKey(ALIGNED_DAY_OF_WEEK_IN_MONTH)) {\n int y = ChronoField.YEAR.checkValidIntValue(fieldValues.remove(ChronoField.YEAR));\n if (resolverStyle == ResolverStyle.LENIENT) {\n long months = Jdk8Methods.safeSubtract(fieldValues.remove(ChronoField.MONTH_OF_YEAR), 1);\n long weeks = Jdk8Methods.safeSubtract(fieldValues.remove(ALIGNED_WEEK_OF_MONTH), 1);\n long days = Jdk8Methods.safeSubtract(fieldValues.remove(ALIGNED_DAY_OF_WEEK_IN_MONTH), 1);\n return LocalDate.of(y, 1, 1).plusMonths(months).plusWeeks(weeks).plusDays(days);\n }\n int moy = ChronoField.MONTH_OF_YEAR.checkValidIntValue(fieldValues.remove(ChronoField.MONTH_OF_YEAR));\n int aw = ALIGNED_WEEK_OF_MONTH.checkValidIntValue(fieldValues.remove(ALIGNED_WEEK_OF_MONTH));\n int ad = ALIGNED_DAY_OF_WEEK_IN_MONTH.checkValidIntValue(fieldValues.remove(ALIGNED_DAY_OF_WEEK_IN_MONTH));\n LocalDate date = LocalDate.of(y, moy, 1).plusDays((aw - 1) * 7 + (ad - 1));\n if (resolverStyle == ResolverStyle.STRICT && date.get(ChronoField.MONTH_OF_YEAR) != moy) {\n throw new DateTimeException(\"Strict mode rejected date parsed to a different month\");\n }\n return date;\n }\n if (fieldValues.containsKey(DAY_OF_WEEK)) {\n int y = ChronoField.YEAR.checkValidIntValue(fieldValues.remove(ChronoField.YEAR));\n if (resolverStyle == ResolverStyle.LENIENT) {\n long months = Jdk8Methods.safeSubtract(fieldValues.remove(ChronoField.MONTH_OF_YEAR), 1);\n long weeks = Jdk8Methods.safeSubtract(fieldValues.remove(ALIGNED_WEEK_OF_MONTH), 1);\n long days = Jdk8Methods.safeSubtract(fieldValues.remove(DAY_OF_WEEK), 1);\n return LocalDate.of(y, 1, 1).plusMonths(months).plusWeeks(weeks).plusDays(days);\n }\n int moy = ChronoField.MONTH_OF_YEAR.checkValidIntValue(fieldValues.remove(ChronoField.MONTH_OF_YEAR));\n int aw = ALIGNED_WEEK_OF_MONTH.checkValidIntValue(fieldValues.remove(ALIGNED_WEEK_OF_MONTH));\n int dow = DAY_OF_WEEK.checkValidIntValue(fieldValues.remove(DAY_OF_WEEK));\n LocalDate date = LocalDate.of(y, moy, 1).plusWeeks(aw - 1).with(nextOrSame(DayOfWeek.of(dow)));\n if (resolverStyle == ResolverStyle.STRICT && date.get(ChronoField.MONTH_OF_YEAR) != moy) {\n throw new DateTimeException(\"Strict mode rejected date parsed to a different month\");\n }\n return date;\n }\n }\n*/\n }\n if (fieldValues.containsKey(ChronoField.DAY_OF_YEAR)) {\n const y = ChronoField.YEAR.checkValidIntValue(fieldValues.remove(ChronoField.YEAR));\n if (resolverStyle === ResolverStyle.LENIENT) {\n const days = MathUtil.safeSubtract(fieldValues.remove(ChronoField.DAY_OF_YEAR), 1);\n return LocalDate.ofYearDay(y, 1).plusDays(days);\n }\n const doy = ChronoField.DAY_OF_YEAR.checkValidIntValue(fieldValues.remove(ChronoField.DAY_OF_YEAR));\n return LocalDate.ofYearDay(y, doy);\n }\n if (fieldValues.containsKey(ChronoField.ALIGNED_WEEK_OF_YEAR)) {\n if (fieldValues.containsKey(ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR)) {\n const y = ChronoField.YEAR.checkValidIntValue(fieldValues.remove(ChronoField.YEAR));\n if (resolverStyle === ResolverStyle.LENIENT) {\n const weeks = MathUtil.safeSubtract(fieldValues.remove(ChronoField.ALIGNED_WEEK_OF_YEAR), 1);\n const days = MathUtil.safeSubtract(fieldValues.remove(ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR), 1);\n return LocalDate.of(y, 1, 1).plusWeeks(weeks).plusDays(days);\n }\n const aw = ChronoField.ALIGNED_WEEK_OF_YEAR.checkValidIntValue(fieldValues.remove(ChronoField.ALIGNED_WEEK_OF_YEAR));\n const ad = ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR.checkValidIntValue(fieldValues.remove(ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR));\n const date = LocalDate.of(y, 1, 1).plusDays((aw - 1) * 7 + (ad - 1));\n if (resolverStyle === ResolverStyle.STRICT && date.get(ChronoField.YEAR) !== y) {\n throw new DateTimeException('Strict mode rejected date parsed to a different year');\n }\n return date;\n }\n if (fieldValues.containsKey(ChronoField.DAY_OF_WEEK)) {\n const y = ChronoField.YEAR.checkValidIntValue(fieldValues.remove(ChronoField.YEAR));\n if (resolverStyle === ResolverStyle.LENIENT) {\n const weeks = MathUtil.safeSubtract(fieldValues.remove(ChronoField.ALIGNED_WEEK_OF_YEAR), 1);\n const days = MathUtil.safeSubtract(fieldValues.remove(ChronoField.DAY_OF_WEEK), 1);\n return LocalDate.of(y, 1, 1).plusWeeks(weeks).plusDays(days);\n }\n const aw = ChronoField.ALIGNED_WEEK_OF_YEAR.checkValidIntValue(fieldValues.remove(ChronoField.ALIGNED_WEEK_OF_YEAR));\n const dow = ChronoField.DAY_OF_WEEK.checkValidIntValue(fieldValues.remove(ChronoField.DAY_OF_WEEK));\n const date = LocalDate.of(y, 1, 1).plusWeeks(aw - 1).with(TemporalAdjusters.nextOrSame(DayOfWeek.of(dow)));\n if (resolverStyle === ResolverStyle.STRICT && date.get(ChronoField.YEAR) !== y) {\n throw new DateTimeException('Strict mode rejected date parsed to a different month');\n }\n return date;\n }\n }\n }\n return null;\n }\n\n /**\n * Obtains an ISO local date from another date-time object.\n *

\n * This is equivalent to {@link LocalDate#from(TemporalAccessor)}.\n *\n * @param temporal the date-time object to convert, not null\n * @return the ISO local date, not null\n * @throws DateTimeException if unable to create the date\n */\n date(temporal) {\n return LocalDate.from(temporal);\n }\n\n}\n\nexport function _init() {\n IsoChronology.INSTANCE = new IsoChronology('IsoChronology');\n}\n","/**\n * @copyright (c) 2016-present, Philipp Thürwächter & Pattrick Hüper & js-joda contributors\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {ChronoField} from './temporal/ChronoField';\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {Clock} from './Clock';\nimport {DateTimeException, UnsupportedTemporalTypeException} from './errors';\nimport {DateTimeFormatter} from './format/DateTimeFormatter';\nimport {DefaultInterfaceTemporal} from './temporal/DefaultInterfaceTemporal';\nimport {Instant, LocalTime} from './js-joda';\nimport {MathUtil} from './MathUtil';\nimport {OffsetDateTime} from './OffsetDateTime';\nimport {TemporalQueries} from './temporal/TemporalQueries';\nimport {ZoneId} from './ZoneId';\nimport {ZoneOffset} from './ZoneOffset';\n\nimport {createTemporalQuery} from './temporal/TemporalQuery';\nimport {requireInstance, requireNonNull} from './assert';\n\n/**\n * A time with an offset from UTC/Greenwich in the ISO-8601 calendar system, such as 10:15:30+01:00.\n */\nexport class OffsetTime extends DefaultInterfaceTemporal {\n /**\n * @param {!TemporalAccessor} temporal\n * @return {OffsetTime}\n */\n static from(temporal) {\n requireNonNull(temporal, 'temporal');\n if (temporal instanceof OffsetTime) {\n return temporal;\n } else if (temporal instanceof OffsetDateTime) {\n return temporal.toOffsetTime();\n }\n try {\n const time = LocalTime.from(temporal);\n const offset = ZoneOffset.from(temporal);\n return new OffsetTime(time, offset);\n } catch(ex) {\n throw new DateTimeException(`Unable to obtain OffsetTime TemporalAccessor: ${temporal}, type ${temporal.constructor != null ? temporal.constructor.name : ''}`);\n }\n }\n\n /**\n * @param {Clock|ZoneId} clockOrZone\n * @return {OffsetTime}\n */\n static now(clockOrZone) {\n if (arguments.length === 0){\n return OffsetTime._now(Clock.systemDefaultZone());\n } else if (clockOrZone instanceof Clock){\n return OffsetTime._now(clockOrZone);\n } else {\n return OffsetTime._now(Clock.system(clockOrZone));\n }\n }\n\n /**\n * @param {Clock} clock - the clock to use, defaults to Clock.systemDefaultZone()\n * @return {OffsetTime} the current offset date-time, not null\n */\n static _now(clock) {\n requireNonNull(clock, 'clock');\n const now = clock.instant();\n return OffsetTime.ofInstant(now, clock.zone().rules().offset(now));\n }\n\n /**\n * @return {OffsetTime}\n */\n static of(){\n if (arguments.length <= 2) {\n return OffsetTime.ofTimeAndOffset.apply(this, arguments);\n } else {\n return OffsetTime.ofNumbers.apply(this, arguments);\n }\n }\n\n /**\n * @param {int}hour\n * @param {int}minute\n * @param {int}second\n * @param {int}nanoOfSecond\n * @param {ZoneOffset}offset\n * @return {OffsetTime}\n */\n static ofNumbers(hour, minute, second, nanoOfSecond, offset) {\n const time = LocalTime.of(hour, minute, second, nanoOfSecond);\n return new OffsetTime(time, offset);\n }\n\n /**\n * @param {LocalTime}time\n * @param {ZoneOffset}offset\n * @return {OffsetTime}\n */\n static ofTimeAndOffset(time, offset) {\n return new OffsetTime(time, offset);\n }\n\n /**\n * @param {!Instant} instant\n * @param {!ZoneId} zone\n * @return {!OffsetTime}\n */\n static ofInstant( instant, zone){\n requireNonNull(instant, 'instant');\n requireInstance(instant, Instant, 'instant');\n requireNonNull(zone, 'zone');\n requireInstance(zone, ZoneId, 'zone');\n\n const rules = zone.rules();\n const offset = rules.offset(instant);\n let secsOfDay = instant.epochSecond() % LocalTime.SECONDS_PER_DAY;\n secsOfDay = (secsOfDay + offset.totalSeconds()) % LocalTime.SECONDS_PER_DAY;\n if (secsOfDay < 0) {\n secsOfDay += LocalTime.SECONDS_PER_DAY;\n }\n const time = LocalTime.ofSecondOfDay(secsOfDay, instant.nano());\n return new OffsetTime(time, offset);\n }\n\n /**\n * @param {string} text\n * @param {DateTimeFormatter} formatter\n * @return {OffsetTime}\n */\n static parse(text, formatter= DateTimeFormatter.ISO_OFFSET_TIME) {\n requireNonNull(formatter, 'formatter');\n return formatter.parse(text, OffsetTime.FROM);\n }\n //-----------------------------------------------------------------------\n\n /**\n * @param {LocalTime} time\n * @param {ZoneOffset} offset\n * @private\n */\n constructor(time, offset) {\n super();\n requireNonNull(time, 'time');\n requireInstance(time, LocalTime, 'time');\n requireNonNull(offset, 'offset');\n requireInstance(offset, ZoneOffset, 'offset');\n this._time = time;\n this._offset = offset;\n }\n\n\n /**\n * @param {TemporalAdjuster} temporal - the target object to be adjusted, not null\n * @return {Temporal} the adjusted object, not null\n * @throws {DateTimeException} if unable to make the adjustment\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n adjustInto(temporal) {\n return temporal\n .with(ChronoField.NANO_OF_DAY, this._time.toNanoOfDay())\n .with(ChronoField.OFFSET_SECONDS, this.offset().totalSeconds());\n }\n\n /**\n * @param {LocalDate} date - the date to combine with, not null\n * @return {OffsetDateTime} the offset date-time formed from this time and the specified date, not null\n */\n atDate(date) {\n return OffsetDateTime.of(date, this._time, this._offset);\n }\n\n /**\n * @param {DateTimeFormatter} formatter - the formatter to use, not null\n * @return {string} the formatted time string, not null\n * @throws {DateTimeException} if an error occurs during printing\n */\n format(formatter) {\n requireNonNull(formatter, 'formatter');\n return formatter.format(this, OffsetTime.FROM);\n }\n\n\n /**\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n get(field) {\n return super.get(field);\n }\n\n /**\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained\n * @trhows {UnsupportedTemporalTypeException}\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n getLong(field) {\n if (field instanceof ChronoField) {\n if (field === ChronoField.OFFSET_SECONDS) {\n return this._offset.totalSeconds();\n }\n return this._time.getLong(field);\n }\n return field.getFrom(this);\n }\n\n /**\n * @return {int}\n */\n hour() {\n return this._time.hour();\n }\n\n /**\n * @return {int}\n */\n minute() {\n return this._time.minute();\n }\n\n /**\n * @return {int}\n */\n second() {\n return this._time.second();\n }\n\n /**\n * @return {int}\n */\n nano() {\n return this._time.nano();\n }\n\n /**\n * @return {ZoneOffset}\n */\n offset() {\n return this._offset;\n }\n\n /**\n * @param {OffsetTime} other - the other time to compare to, not null\n * @return {boolean} true if this is after the specified time\n * @throws {NullPointerException} if `other` is null\n */\n isAfter(other) {\n requireNonNull(other, 'other');\n return this._toEpochNano() > other._toEpochNano();\n }\n\n /**\n * @param {OffsetTime} other - the other time to compare to, not null\n * @return {boolean} true if this point is before the specified time\n * @throws {NullPointerException} if `other` is null\n */\n isBefore(other) {\n requireNonNull(other, 'other');\n return this._toEpochNano() < other._toEpochNano();\n }\n\n /**\n * @param {OffsetTime} other - the other time to compare to, not null\n * @return {boolean}\n * @throws {NullPointerException} if `other` is null\n */\n isEqual(other) {\n requireNonNull(other, 'other');\n return this._toEpochNano() === other._toEpochNano();\n }\n\n /**\n * @param {TemporalField|TemporalUnit} fieldOrUnit - the field to check, null returns false\n * @return {boolean} true if the field is supported on this time, false if not\n */\n isSupported(fieldOrUnit) {\n if (fieldOrUnit instanceof ChronoField) {\n return fieldOrUnit.isTimeBased() || fieldOrUnit === ChronoField.OFFSET_SECONDS;\n } else if (fieldOrUnit instanceof ChronoUnit) {\n return fieldOrUnit.isTimeBased();\n }\n return fieldOrUnit != null && fieldOrUnit.isSupportedBy(this);\n }\n\n /**\n * @param {number} hours\n * @return {OffsetTime}\n */\n minusHours(hours) {\n return this._withLocalTimeOffset(this._time.minusHours(hours), this._offset);\n }\n\n /**\n * @param {number} minutes\n * @return {OffsetTime}\n */\n minusMinutes(minutes) {\n return this._withLocalTimeOffset(this._time.minusMinutes(minutes), this._offset);\n }\n\n /**\n * @param {number} seconds\n * @return {OffsetTime}\n */\n minusSeconds(seconds) {\n return this._withLocalTimeOffset(this._time.minusSeconds(seconds), this._offset);\n }\n\n /**\n * @param {number} nanos\n * @return {OffsetTime}\n */\n minusNanos(nanos) {\n return this._withLocalTimeOffset(this._time.minusNanos(nanos), this._offset);\n }\n\n minusAmount(amount) {\n requireNonNull(amount);\n return amount.subtractFrom(this);\n }\n\n minusAmountUnit(amountToSubtract, unit) {\n return this.plus(-1 * amountToSubtract, unit);\n }\n\n plusAmount(amount) {\n requireNonNull(amount);\n return amount.addTo(this);\n }\n\n /**\n *\n * @param amountToAdd\n * @param unit\n * @return {Temporal}\n */\n plusAmountUnit(amountToAdd, unit) {\n if (unit instanceof ChronoUnit) {\n return this._withLocalTimeOffset(this._time.plus(amountToAdd, unit), this._offset);\n }\n return unit.addTo(this, amountToAdd);\n }\n\n /**\n * @param {int} hours\n * @return {OffsetTime}\n */\n plusHours(hours) {\n return this._withLocalTimeOffset(this._time.plusHours(hours), this._offset);\n }\n\n /**\n * @param {int} minutes\n * @return {OffsetTime}\n */\n plusMinutes(minutes) {\n return this._withLocalTimeOffset(this._time.plusMinutes(minutes), this._offset);\n }\n\n /**\n * @param {int} seconds\n * @return {OffsetTime}\n */\n plusSeconds(seconds) {\n return this._withLocalTimeOffset(this._time.plusSeconds(seconds), this._offset);\n }\n\n /**\n * @param {int} nanos\n * @return {OffsetTime}\n */\n plusNanos(nanos) {\n return this._withLocalTimeOffset(this._time.plusNanos(nanos), this._offset);\n }\n\n /**\n * @param {TemporalQuery} query - the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws {DateTimeException} if unable to query (defined by the query)\n * @throws {ArithmeticException} if numeric overflow occurs (defined by the query)\n */\n query(query) {\n requireNonNull(query, 'query');\n if (query === TemporalQueries.precision()) {\n return ChronoUnit.NANOS;\n } else if (query === TemporalQueries.offset() || query === TemporalQueries.zone()) {\n return this.offset();\n } else if (query === TemporalQueries.localTime()) {\n return this._time;\n } else if (query === TemporalQueries.chronology() || query === TemporalQueries.localDate() || query === TemporalQueries.zoneId()) {\n return null;\n }\n return super.query(query);\n }\n\n /**\n * @param {TemporalField} field - the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws {DateTimeException} if the range for the field cannot be obtained\n */\n range(field) {\n if (field instanceof ChronoField) {\n if (field === ChronoField.OFFSET_SECONDS) {\n return field.range();\n }\n return this._time.range(field);\n }\n return field.rangeRefinedBy(this);\n }\n\n /**\n * @return {LocalTime}\n */\n toLocalTime() {\n return this._time;\n }\n\n /**\n * @param {TemporalUnit} unit - the unit to truncate to, not null\n * @return {OffsetTime} a {@link LocalTime} based on this time with the time truncated, not null\n * @throws {DateTimeException} if unable to truncate\n */\n truncatedTo(unit) {\n return this._withLocalTimeOffset(this._time.truncatedTo(unit), this._offset);\n }\n\n /**\n * @param {Temporal} endExclusive - the end time, which is converted to a {@link LocalTime}, not null\n * @param {TemporalUnit} unit - the unit to measure the period in, not null\n * @return {number} the amount of the period between this time and the end time\n * @throws {DateTimeException} if the period cannot be calculated\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n until(endExclusive, unit) {\n requireNonNull(endExclusive, 'endExclusive');\n requireNonNull(unit, 'unit');\n const end = OffsetTime.from(endExclusive);\n if (unit instanceof ChronoUnit) {\n const nanosUntil = end._toEpochNano() - this._toEpochNano(); // no overflow\n switch (unit) {\n case ChronoUnit.NANOS: return nanosUntil;\n case ChronoUnit.MICROS: return Math.floor(nanosUntil / 1000);\n case ChronoUnit.MILLIS: return Math.floor(nanosUntil / 1000000);\n case ChronoUnit.SECONDS: return Math.floor(nanosUntil / LocalTime.NANOS_PER_SECOND);\n case ChronoUnit.MINUTES: return Math.floor(nanosUntil / LocalTime.NANOS_PER_MINUTE);\n case ChronoUnit.HOURS: return Math.floor(nanosUntil / LocalTime.NANOS_PER_HOUR);\n case ChronoUnit.HALF_DAYS: return Math.floor(nanosUntil / (12 * LocalTime.NANOS_PER_HOUR));\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n return unit.between(this, end);\n }\n\n /**\n * @param {int} hour\n * @return {OffsetTime}\n */\n withHour(hour) {\n return this._withLocalTimeOffset(this._time.withHour(hour), this._offset);\n }\n\n /**\n * @param {int} minute\n * @return {OffsetTime}\n */\n withMinute(minute) {\n return this._withLocalTimeOffset(this._time.withMinute(minute), this._offset);\n }\n\n /**\n * @param {int} second\n * @return {OffsetTime}\n */\n withSecond(second) {\n return this._withLocalTimeOffset(this._time.withSecond(second), this._offset);\n }\n\n /**\n * @param {int} nano\n * @return {OffsetTime}\n */\n withNano(nano) {\n return this._withLocalTimeOffset(this._time.withNano(nano), this._offset);\n }\n\n /**\n * @param {ZoneOffset} offset\n * @return {OffsetTime}\n */\n withOffsetSameInstant(offset) {\n requireNonNull(offset, 'offset');\n if (offset.equals(this._offset)) {\n return this;\n }\n const difference = offset.totalSeconds() - this._offset.totalSeconds();\n const adjusted = this._time.plusSeconds(difference);\n return new OffsetTime(adjusted, offset);\n }\n\n /**\n * @param {ZoneOffset} offset\n * @return {OffsetTime}\n */\n withOffsetSameLocal(offset) {\n return offset != null && offset.equals(this._offset) ? this : new OffsetTime(this._time, offset);\n }\n\n _toEpochNano() {\n const nod = this._time.toNanoOfDay();\n const offsetNanos = this._offset.totalSeconds() * LocalTime.NANOS_PER_SECOND;\n return nod - offsetNanos;\n }\n\n withAdjuster(adjuster) {\n requireNonNull(adjuster, 'adjuster');\n // optimizations\n if (adjuster instanceof LocalTime) {\n return this._withLocalTimeOffset(adjuster, this._offset);\n } else if (adjuster instanceof ZoneOffset) {\n return this._withLocalTimeOffset(this._time, adjuster);\n } else if (adjuster instanceof OffsetTime) {\n return adjuster;\n }\n return adjuster.adjustInto(this);\n }\n\n withFieldValue(field, newValue) {\n requireNonNull(field, 'field');\n if (field instanceof ChronoField) {\n if (field === ChronoField.OFFSET_SECONDS) {\n return this._withLocalTimeOffset(this._time, ZoneOffset.ofTotalSeconds(field.checkValidIntValue(newValue)));\n }\n return this._withLocalTimeOffset(this._time.with(field, newValue), this._offset);\n }\n return field.adjustInto(this, newValue);\n }\n\n /**\n * @private\n * @param {LocalTime}time\n * @param {ZoneOffset}offset\n * @return {OffsetTime}\n */\n _withLocalTimeOffset(time, offset) {\n if (this._time === time && this._offset.equals(offset)) {\n return this;\n }\n return new OffsetTime(time, offset);\n }\n\n //---------------------------------\n\n /**\n * @param {OffsetTime} other - the other time to compare to, not null\n * @return {int} the comparator value, negative if less, positive if greater\n * @throws {NullPointerException} if `other` is null\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, OffsetTime, 'other');\n if (this._offset.equals(other._offset)) {\n return this._time.compareTo(other._time);\n }\n const compare = MathUtil.compareNumbers(this._toEpochNano(), other._toEpochNano());\n if (compare === 0) {\n return this._time.compareTo(other._time);\n }\n return compare;\n }\n\n /**\n * @param {*} other - the object to check, null returns false\n * @return {boolean} true if this is equal to the other time\n */\n equals(other) {\n if (this === other) {\n return true;\n }\n if (other instanceof OffsetTime) {\n return this._time.equals(other._time) && this._offset.equals(other._offset);\n }\n return false;\n }\n\n /**\n * @return {number}\n */\n hashCode() {\n return this._time.hashCode() ^ this._offset.hashCode();\n }\n\n /**\n * @return {string}\n */\n toString() {\n return this._time.toString() + this._offset.toString();\n }\n\n /**\n *\n * @return {string} same as {@link LocalDateTime.toString}\n */\n toJSON() {\n return this.toString();\n }\n}\n\n\nexport function _init() {\n OffsetTime.MIN = OffsetTime.ofNumbers(0, 0, 0,0, ZoneOffset.MAX);\n\n OffsetTime.MAX = OffsetTime.ofNumbers(23, 59, 59,999999999, ZoneOffset.MIN);\n\n OffsetTime.FROM = createTemporalQuery('OffsetTime.FROM', (temporal) => {\n return OffsetTime.from(temporal);\n });\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {requireNonNull} from '../assert';\nimport {Instant} from '../Instant';\nimport {LocalDate} from '../LocalDate';\nimport {MathUtil} from '../MathUtil';\n\nimport {ChronoUnit} from '../temporal/ChronoUnit';\nimport {DefaultInterfaceTemporal} from '../temporal/DefaultInterfaceTemporal';\nimport {TemporalQueries} from '../temporal/TemporalQueries';\n\nexport class ChronoZonedDateTime extends DefaultInterfaceTemporal {\n query(query) {\n if (query === TemporalQueries.zoneId() || query === TemporalQueries.zone()) {\n return this.zone();\n } else if (query === TemporalQueries.chronology()) {\n return this.toLocalDate().chronology();\n } else if (query === TemporalQueries.precision()) {\n return ChronoUnit.NANOS;\n } else if (query === TemporalQueries.offset()) {\n return this.offset();\n } else if (query === TemporalQueries.localDate()) {\n return LocalDate.ofEpochDay(this.toLocalDate().toEpochDay());\n } else if (query === TemporalQueries.localTime()) {\n return this.toLocalTime();\n }\n return super.query(query);\n }\n\n /**\n * Outputs this date-time as a string using the formatter.\n *\n * @param {DateTimeFormatter} formatter - the formatter to use, not null\n * @return {string} the formatted date-time string, not null\n * @throws DateTimeException if an error occurs during printing\n */\n format(formatter) {\n requireNonNull(formatter, 'formatter');\n return formatter.format(this);\n }\n\n /**\n * Converts this date-time to an {@link Instant}.\n *\n * This returns an {@link Instant} representing the same point on the\n * time-line as this date-time. The calculation combines the\n * local date-time (see {@link toLocalDateTime}) and\n * offset (see {@link getOffset}).\n *\n * @return {Instant} an {@link Instant} representing the same instant, not null\n */\n toInstant() {\n return Instant.ofEpochSecond(this.toEpochSecond(), this.toLocalTime().nano());\n }\n\n /**\n * Converts this date-time to the number of seconds from the epoch\n * of 1970-01-01T00:00:00Z.\n *\n * This uses the local date-time (see {@link toLocalDateTime}) and\n * offset (see {@link getOffset}) to calculate the epoch-second value,\n * which is the number of elapsed seconds from 1970-01-01T00:00:00Z.\n * Instants on the time-line after the epoch are positive, earlier are negative.\n *\n * @return {number} the number of seconds from the epoch of 1970-01-01T00:00:00Z\n */\n toEpochSecond() {\n const epochDay = this.toLocalDate().toEpochDay();\n let secs = epochDay * 86400 + this.toLocalTime().toSecondOfDay();\n secs -= this.offset().totalSeconds();\n return secs;\n }\n\n /**\n * Compares this date-time to another date-time, including the chronology.\n *\n * The comparison is based first on the instant, then on the local date-time,\n * then on the zone ID, then on the chronology.\n * It is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * If all the date-time objects being compared are in the same chronology, then the\n * additional chronology stage is not required.\n *\n * @param {ChronoZonedDateTime} other - the other date-time to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n let cmp = MathUtil.compareNumbers(this.toEpochSecond(), other.toEpochSecond());\n if (cmp === 0) {\n cmp = this.toLocalTime().nano() - other.toLocalTime().nano();\n if (cmp === 0) {\n cmp = this.toLocalDateTime().compareTo(other.toLocalDateTime());\n if (cmp === 0) {\n cmp = strcmp(this.zone().id(), other.zone().id());\n // we only support iso for now\n //if (cmp === 0) {\n // cmp = toLocalDate().getChronology().compareTo(other.toLocalDate().getChronology());\n //}\n }\n }\n }\n return cmp;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the instant of this date-time is after that of the specified date-time.\n *\n * This method differs from the comparison in {@link compareTo} in that it\n * only compares the instant of the date-time. This is equivalent to using\n * `dateTime1.toInstant().isAfter(dateTime2.toInstant())`.\n *\n * @param {!ChronoZonedDateTime} other - the other date-time to compare to, not null\n * @return {boolean} true if this is after the specified date-time\n */\n isAfter(other) {\n requireNonNull(other, 'other');\n const thisEpochSec = this.toEpochSecond();\n const otherEpochSec = other.toEpochSecond();\n return thisEpochSec > otherEpochSec ||\n (thisEpochSec === otherEpochSec && this.toLocalTime().nano() > other.toLocalTime().nano());\n }\n\n /**\n * Checks if the instant of this date-time is before that of the specified date-time.\n *\n * This method differs from the comparison in {@link compareTo} in that it\n * only compares the instant of the date-time. This is equivalent to using\n * `dateTime1.toInstant().isBefore(dateTime2.toInstant())`.\n *\n * @param {!ChronoZonedDateTime} other - the other date-time to compare to, not null\n * @return {boolean} true if this point is before the specified date-time\n */\n isBefore(other) {\n requireNonNull(other, 'other');\n const thisEpochSec = this.toEpochSecond();\n const otherEpochSec = other.toEpochSecond();\n return thisEpochSec < otherEpochSec ||\n (thisEpochSec === otherEpochSec && this.toLocalTime().nano() < other.toLocalTime().nano());\n }\n\n /**\n * Checks if the instant of this date-time is equal to that of the specified date-time.\n *\n * This method differs from the comparison in {@link compareTo} and {@link equals}\n * in that it only compares the instant of the date-time. This is equivalent to using\n * `dateTime1.toInstant().equals(dateTime2.toInstant())`.\n *\n * @param {!ChronoZonedDateTime} other - the other date-time to compare to, not null\n * @return {boolean} true if the instant equals the instant of the specified date-time\n */\n isEqual(other) {\n requireNonNull(other, 'other');\n return this.toEpochSecond() === other.toEpochSecond() &&\n this.toLocalTime().nano() === other.toLocalTime().nano();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this date-time is equal to another date-time.\n *\n * The comparison is based on the offset date-time and the zone.\n * To compare for the same instant on the time-line, use {@link compareTo}.\n * Only objects of type {@link ChronoZoneDateTime} are compared, other types return false.\n *\n * @param {*} other the object to check, null returns false\n * @return {boolean} true if this is equal to the other date-time\n */\n equals(other) {\n if (this === other) {\n return true;\n }\n if (other instanceof ChronoZonedDateTime) {\n return this.compareTo(other) === 0;\n }\n return false;\n }\n\n}\n\nfunction strcmp(a, b){\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {requireNonNull} from './assert';\nimport {DateTimeException, IllegalArgumentException} from './errors';\nimport {MathUtil} from './MathUtil';\n\nimport {Clock} from './Clock';\nimport {Instant} from './Instant';\nimport {LocalDate} from './LocalDate';\nimport {LocalDateTime} from './LocalDateTime';\nimport {LocalTime} from './LocalTime';\nimport {OffsetDateTime} from './OffsetDateTime';\nimport {ZoneId} from './ZoneId';\nimport {ZoneOffset} from './ZoneOffset';\n\nimport {ChronoZonedDateTime} from './chrono/ChronoZonedDateTime';\nimport {DateTimeFormatter} from './format/DateTimeFormatter';\nimport {ChronoField} from './temporal/ChronoField';\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {createTemporalQuery} from './temporal/TemporalQuery';\nimport {TemporalQueries} from './temporal/TemporalQueries';\n\n/**\n * A date-time with a time-zone in the ISO-8601 calendar system,\n * such as `2007-12-03T10:15:30+01:00 Europe/Paris`.\n *\n * `ZonedDateTime` is an immutable representation of a date-time with a time-zone.\n * This class stores all date and time fields, to a precision of nanoseconds,\n * and a time-zone, with a zone offset used to handle ambiguous local date-times.\n * For example, the value\n * '2nd October 2007 at 13:45.30.123456789 +02:00 in the Europe/Paris time-zone'\n * can be stored in a {@link ZonedDateTime}.\n *\n * This class handles conversion from the local time-line of {@link LocalDateTime}\n * to the instant time-line of {@link Instant}.\n * The difference between the two time-lines is the offset from UTC/Greenwich,\n * represented by a {@link ZoneOffset}.\n *\n * Converting between the two time-lines involves calculating the offset using the\n * {@link ZoneRules} rules accessed from the {@link ZoneId}.\n * Obtaining the offset for an instant is simple, as there is exactly one valid\n * offset for each instant. By contrast, obtaining the offset for a local date-time\n * is not straightforward. There are three cases:\n *\n * * Normal, with one valid offset. For the vast majority of the year, the normal\n * case applies, where there is a single valid offset for the local date-time.\n * * Gap, with zero valid offsets. This is when clocks jump forward typically\n * due to the spring daylight savings change from 'winter' to 'summer'.\n * In a gap there are local date-time values with no valid offset.\n * * Overlap, with two valid offsets. This is when clocks are set back typically\n * due to the autumn daylight savings change from 'summer' to 'winter'.\n * In an overlap there are local date-time values with two valid offsets.\n *\n * Any method that converts directly or implicitly from a local date-time to an\n * instant by obtaining the offset has the potential to be complicated.\n *\n * For Gaps, the general strategy is that if the local date-time falls in the\n * middle of a Gap, then the resulting zoned date-time will have a local date-time\n * shifted forwards by the length of the Gap, resulting in a date-time in the later\n * offset, typically 'summer' time.\n *\n * For Overlaps, the general strategy is that if the local date-time falls in the\n * middle of an Overlap, then the previous offset will be retained. If there is no\n * previous offset, or the previous offset is invalid, then the earlier offset is\n * used, typically 'summer' time. Two additional methods,\n * {@link withEarlierOffsetAtOverlap} and {@link withLaterOffsetAtOverlap},\n * help manage the case of an overlap.\n *\n * ### Specification for implementors\n *\n * A {@link ZonedDateTime} holds state equivalent to three separate objects,\n * a {@link LocalDateTime}, a {@link ZoneId} and the resolved {@link ZoneOffset}.\n * The offset and local date-time are used to define an instant when necessary.\n * The zone ID is used to obtain the rules for how and when the offset changes.\n * The offset cannot be freely set, as the zone controls which offsets are valid.\n */\nexport class ZonedDateTime extends ChronoZonedDateTime {\n\n //-----------------------------------------------------------------------\n /**\n * Obtains the current date-time from the system clock in the specified time-zone or clock\n * or default time zone.\n *\n * This will query the system clock (see {@link Clock#systemDefaultZone}) in the default\n * time-zone to obtain the current date-time.\n * The zone and offset will be set based on the time-zone in the clock.\n *\n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @param {Clock|ZoneId} [clockOrZone=Clock.systemDefaultZone()]\n * @return {ZonedDateTime} the current date-time using the system clock, not null\n */\n static now(clockOrZone) {\n let clock;\n if(clockOrZone instanceof ZoneId){\n clock = Clock.system(clockOrZone);\n } else {\n clock = clockOrZone == null ? Clock.systemDefaultZone() : clockOrZone;\n }\n return ZonedDateTime.ofInstant(clock.instant(), clock.zone());\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for static {@link ZonedDateTime.of}\n *\n * if called with 2 (or less) args {@link ZonedDateTime.of2} is called,\n * if called with 3 args and the first arg is an instance of LocalDate {@link ZonedDateTime.of3} is called,\n * otherwise {@link ZonedDateTime.of8} is called.\n */\n static of(){\n if(arguments.length <= 2){\n return ZonedDateTime.of2.apply(this, arguments);\n } else if (arguments.length === 3 && arguments[0] instanceof LocalDate){\n return ZonedDateTime.of3.apply(this, arguments);\n } else {\n return ZonedDateTime.of8.apply(this, arguments);\n }\n }\n /**\n * Obtains an instance of {@link ZonedDateTime} from a local date and time.\n *\n * This creates a zoned date-time matching the input local date and time as closely as possible.\n * Time-zone rules, such as daylight savings, mean that not every local date-time\n * is valid for the specified zone, thus the local date-time may be adjusted.\n *\n * The local date time and first combined to form a local date-time.\n * The local date-time is then resolved to a single instant on the time-line.\n * This is achieved by finding a valid offset from UTC/Greenwich for the local\n * date-time as defined by the {@link ZoneRules} of the zone ID.\n *\n * In most cases, there is only one valid offset for a local date-time.\n * In the case of an overlap, when clocks are set back, there are two valid offsets.\n * This method uses the earlier offset typically corresponding to 'summer'.\n *\n * In the case of a gap, when clocks jump forward, there is no valid offset.\n * Instead, the local date-time is adjusted to be later by the length of the gap.\n * For a typical one hour daylight savings change, the local date-time will be\n * moved one hour later into the offset typically corresponding to 'summer'.\n *\n * @param {LocalDate} date - the local date, not null\n * @param {LocalTime} time - the local time, not null\n * @param {ZoneId} zone - the time-zone, not null\n * @return {ZonedDateTime} the offset date-time, not null\n */\n static of3(date, time, zone) {\n return ZonedDateTime.of2(LocalDateTime.of(date, time), zone);\n }\n\n /**\n * Obtains an instance of {@link ZonedDateTime} from a local date-time.\n *\n * This creates a zoned date-time matching the input local date-time as closely as possible.\n * Time-zone rules, such as daylight savings, mean that not every local date-time\n * is valid for the specified zone, thus the local date-time may be adjusted.\n *\n * The local date-time is resolved to a single instant on the time-line.\n * This is achieved by finding a valid offset from UTC/Greenwich for the local\n * date-time as defined by the {@link ZoneRules} of the zone ID.\n *\n * In most cases, there is only one valid offset for a local date-time.\n * In the case of an overlap, when clocks are set back, there are two valid offsets.\n * This method uses the earlier offset typically corresponding to 'summer'.\n *\n * In the case of a gap, when clocks jump forward, there is no valid offset.\n * Instead, the local date-time is adjusted to be later by the length of the gap.\n * For a typical one hour daylight savings change, the local date-time will be\n * moved one hour later into the offset typically corresponding to 'summer'.\n *\n * @param {!LocalDateTime} localDateTime - the local date-time, not null\n * @param {!ZoneId} zone - the time-zone, not null\n * @return {ZonedDateTime} the zoned date-time, not null\n */\n static of2(localDateTime, zone) {\n return ZonedDateTime.ofLocal(localDateTime, zone, null);\n }\n\n /**\n * Obtains an instance of {@link ZonedDateTime} from a year, month, day,\n * hour, minute, second, nanosecond and time-zone.\n *\n * This creates a zoned date-time matching the local date-time of the seven\n * specified fields as closely as possible.\n * Time-zone rules, such as daylight savings, mean that not every local date-time\n * is valid for the specified zone, thus the local date-time may be adjusted.\n *\n * The local date-time is resolved to a single instant on the time-line.\n * This is achieved by finding a valid offset from UTC/Greenwich for the local\n * date-time as defined by the {@link ZoneRules} of the zone ID.\n *\n * In most cases, there is only one valid offset for a local date-time.\n * In the case of an overlap, when clocks are set back, there are two valid offsets.\n * This method uses the earlier offset typically corresponding to 'summer'.\n *\n * In the case of a gap, when clocks jump forward, there is no valid offset.\n * Instead, the local date-time is adjusted to be later by the length of the gap.\n * For a typical one hour daylight savings change, the local date-time will be\n * moved one hour later into the offset typically corresponding to 'summer'.\n *\n * This method exists primarily for writing test cases.\n * Non test-code will typically use other methods to create an offset time.\n * {@link LocalDateTime} has five additional convenience variants of the\n * equivalent factory method taking fewer arguments.\n * They are not provided here to reduce the footprint of the API.\n *\n * @param {number} year - the year to represent, from MIN_YEAR to MAX_YEAR\n * @param {number} month - the month-of-year to represent, from 1 (January) to 12 (December)\n * @param {number} dayOfMonth - the day-of-month to represent, from 1 to 31\n * @param {number} hour - the hour-of-day to represent, from 0 to 23\n * @param {number} minute - the minute-of-hour to represent, from 0 to 59\n * @param {number} second - the second-of-minute to represent, from 0 to 59\n * @param {number} nanoOfSecond - the nano-of-second to represent, from 0 to 999,999,999\n * @param {ZoneId} zone - the time-zone, not null\n * @return {ZonedDateTime } the offset date-time, not null\n * @throws DateTimeException if the value of any field is out of range, or\n * if the day-of-month is invalid for the month-year\n */\n static of8(\n year, month, dayOfMonth,\n hour, minute, second, nanoOfSecond, zone) {\n const dt = LocalDateTime.of(year, month, dayOfMonth, hour, minute, second, nanoOfSecond);\n return ZonedDateTime.ofLocal(dt, zone, null);\n }\n\n /**\n * Obtains an instance of {@link ZonedDateTime} from a local date-time\n * using the preferred offset if possible.\n *\n * The local date-time is resolved to a single instant on the time-line.\n * This is achieved by finding a valid offset from UTC/Greenwich for the local\n * date-time as defined by the {@link ZoneRules} of the zone ID.\n *\n * In most cases, there is only one valid offset for a local date-time.\n * In the case of an overlap, where clocks are set back, there are two valid offsets.\n * If the preferred offset is one of the valid offsets then it is used.\n * Otherwise the earlier valid offset is used, typically corresponding to 'summer'.\n *\n * In the case of a gap, where clocks jump forward, there is no valid offset.\n * Instead, the local date-time is adjusted to be later by the length of the gap.\n * For a typical one hour daylight savings change, the local date-time will be\n * moved one hour later into the offset typically corresponding to 'summer'.\n *\n * @param {!LocalDateTime} localDateTime - the local date-time, not null\n * @param {!ZoneId} zone - the time-zone, not null\n * @param {ZoneOffset} preferredOffset - the zone offset, null if no preference\n * @return {ZonedDateTime} the zoned date-time, not null\n */\n static ofLocal(localDateTime, zone, preferredOffset) {\n requireNonNull(localDateTime, 'localDateTime');\n requireNonNull(zone, 'zone');\n if (zone instanceof ZoneOffset) {\n return new ZonedDateTime(localDateTime, zone, zone);\n }\n let offset = null;\n const rules = zone.rules();\n const validOffsets = rules.validOffsets(localDateTime);\n if (validOffsets.length === 1) {\n offset = validOffsets[0];\n } else if (validOffsets.length === 0) {\n const trans = rules.transition(localDateTime);\n localDateTime = localDateTime.plusSeconds(trans.duration().seconds());\n offset = trans.offsetAfter();\n } else {\n if (preferredOffset != null &&\n validOffsets.some((validOffset) => {return validOffset.equals(preferredOffset);})) {\n offset = preferredOffset;\n } else {\n offset = requireNonNull(validOffsets[0], 'offset'); // protect against bad ZoneRules\n }\n }\n\n return new ZonedDateTime(localDateTime, offset, zone);\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link ZonedDateTime.ofInstant}.\n * if called with 2 args {@link ZonedDateTime.ofInstant2} is called\n * otherwise {@link ZonedDateTime.ofInstant3}.\n */\n static ofInstant(){\n if (arguments.length === 2){\n return ZonedDateTime.ofInstant2.apply(this, arguments);\n } else {\n return ZonedDateTime.ofInstant3.apply(this, arguments);\n }\n }\n /**\n * Obtains an instance of {@link ZonedDateTime} from an {@link Instant}.\n *\n * This creates a zoned date-time with the same instant as that specified.\n * Calling {@link toInstant} will return an instant equal to the one used here.\n *\n * Converting an instant to a zoned date-time is simple as there is only one valid\n * offset for each instant.\n *\n * @param {!Instant} instant - the instant to create the date-time from, not null\n * @param {!ZoneId} zone - the time-zone, not null\n * @return {ZonedDateTime} the zoned date-time, not null\n * @throws DateTimeException if the result exceeds the supported range\n */\n static ofInstant2(instant, zone) {\n requireNonNull(instant, 'instant');\n requireNonNull(zone, 'zone');\n return ZonedDateTime._create(instant.epochSecond(), instant.nano(), zone);\n }\n\n /**\n * Obtains an instance of {@link ZonedDateTime} from the instant formed by combining\n * the local date-time and offset.\n *\n * This creates a zoned date-time by combining the {@link LocalDateTime} and {@link ZoneOffset}.\n * This combination uniquely specifies an instant without ambiguity.\n *\n * Converting an instant to a zoned date-time is simple as there is only one valid\n * offset for each instant. If the valid offset is different to the offset specified,\n * the the date-time and offset of the zoned date-time will differ from those specified.\n *\n * If the {@link ZoneId} to be used is a {@link ZoneOffset}, this method is equivalent\n * to {@link of}.\n *\n * @param {LocalDateTime} localDateTime - the local date-time, not null\n * @param {ZoneOffset} offset - the zone offset, not null\n * @param {ZoneId} zone - the time-zone, not null\n * @return {ZonedDateTime} the zoned date-time, not null\n */\n static ofInstant3(localDateTime, offset, zone) {\n requireNonNull(localDateTime, 'localDateTime');\n requireNonNull(offset, 'offset');\n requireNonNull(zone, 'zone');\n return ZonedDateTime._create(localDateTime.toEpochSecond(offset), localDateTime.nano(), zone);\n }\n\n /**\n * Obtains an instance of {@link ZonedDateTime} using seconds from the\n * epoch of 1970-01-01T00:00:00Z.\n *\n * @param {number} epochSecond - the number of seconds from the epoch of 1970-01-01T00:00:00Z\n * @param {number} nanoOfSecond - the nanosecond within the second, from 0 to 999,999,999\n * @param {ZoneId} zone - the time-zone, not null\n * @return {ZonedDateTime} the zoned date-time, not null\n * @throws DateTimeException if the result exceeds the supported range\n */\n static _create(epochSecond, nanoOfSecond, zone) {\n const rules = zone.rules();\n const instant = Instant.ofEpochSecond(epochSecond, nanoOfSecond); // TODO: rules should be queryable by epochSeconds\n const offset = rules.offset(instant);\n const ldt = LocalDateTime.ofEpochSecond(epochSecond, nanoOfSecond, offset);\n return new ZonedDateTime(ldt, offset, zone);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link ZonedDateTime} strictly validating the\n * combination of local date-time, offset and zone ID.\n *\n * This creates a zoned date-time ensuring that the offset is valid for the\n * local date-time according to the rules of the specified zone.\n * If the offset is invalid, an exception is thrown.\n *\n * @param {LocalDateTime} localDateTime - the local date-time, not null\n * @param {ZoneOffset} offset - the zone offset, not null\n * @param {ZoneId} zone - the time-zone, not null\n * @return {ZonedDateTime} the zoned date-time, not null\n */\n static ofStrict(localDateTime, offset, zone) {\n requireNonNull(localDateTime, 'localDateTime');\n requireNonNull(offset, 'offset');\n requireNonNull(zone, 'zone');\n const rules = zone.rules();\n if (rules.isValidOffset(localDateTime, offset) === false) {\n const trans = rules.transition(localDateTime);\n if (trans != null && trans.isGap()) {\n // error message says daylight savings for simplicity\n // even though there are other kinds of gaps\n throw new DateTimeException('LocalDateTime ' + localDateTime +\n ' does not exist in zone ' + zone +\n ' due to a gap in the local time-line, typically caused by daylight savings');\n }\n throw new DateTimeException('ZoneOffset \"' + offset + '\" is not valid for LocalDateTime \"' +\n localDateTime + '\" in zone \"' + zone + '\"');\n }\n return new ZonedDateTime(localDateTime, offset, zone);\n }\n\n /**\n * Obtains an instance of {@link ZonedDateTime} leniently, for advanced use cases,\n * allowing any combination of local date-time, offset and zone ID.\n *\n * This creates a zoned date-time with no checks other than no nulls.\n * This means that the resulting zoned date-time may have an offset that is in conflict\n * with the zone ID.\n *\n * This method is intended for advanced use cases.\n * For example, consider the case where a zoned date-time with valid fields is created\n * and then stored in a database or serialization-based store. At some later point,\n * the object is then re-loaded. However, between those points in time, the government\n * that defined the time-zone has changed the rules, such that the originally stored\n * local date-time now does not occur. This method can be used to create the object\n * in an 'invalid' state, despite the change in rules.\n *\n * @param {LocalDateTime} localDateTime - the local date-time, not null\n * @param {ZoneOffset} offset - the zone offset, not null\n * @param {ZoneId} zone - the time-zone, not null\n * @return {ZonedDateTime} the zoned date-time, not null\n */\n static ofLenient(localDateTime, offset, zone) {\n requireNonNull(localDateTime, 'localDateTime');\n requireNonNull(offset, 'offset');\n requireNonNull(zone, 'zone');\n if (zone instanceof ZoneOffset && offset.equals(zone) === false) {\n throw new IllegalArgumentException('ZoneId must match ZoneOffset');\n }\n return new ZonedDateTime(localDateTime, offset, zone);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link ZonedDateTime} from a temporal object.\n *\n * A {@link TemporalAccessor} represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of {@link ZonedDateTime}.\n *\n * The conversion will first obtain a {@link ZoneId}. It will then try to obtain an instant.\n * If that fails it will try to obtain a local date-time.\n * The zoned date time will either be a combination of {@link ZoneId} and instant,\n * or {@link ZoneId} and local date-time.\n *\n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used in queries via method reference, {@link ZonedDateTime::from}.\n *\n * @param {!TemporalAccessor} temporal - the temporal object to convert, not null\n * @return {ZonedDateTime} the zoned date-time, not null\n * @throws DateTimeException if unable to convert to an {@link ZonedDateTime}\n */\n static from(temporal) {\n requireNonNull(temporal, 'temporal');\n if (temporal instanceof ZonedDateTime) {\n return temporal;\n }\n const zone = ZoneId.from(temporal);\n if (temporal.isSupported(ChronoField.INSTANT_SECONDS)) {\n const zdt = ZonedDateTime._from(temporal, zone);\n if(zdt != null) return zdt;\n }\n const ldt = LocalDateTime.from(temporal);\n return ZonedDateTime.of2(ldt, zone);\n }\n\n static _from(temporal, zone){\n try {\n return ZonedDateTime.__from(temporal, zone);\n } catch (ex) {\n if(!(ex instanceof DateTimeException)) throw ex;\n // ignore\n }\n }\n\n static __from(temporal, zone){\n const epochSecond = temporal.getLong(ChronoField.INSTANT_SECONDS);\n const nanoOfSecond = temporal.get(ChronoField.NANO_OF_SECOND);\n return ZonedDateTime._create(epochSecond, nanoOfSecond, zone);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link ZonedDateTime} from a text string such as\n * `2007-12-03T10:15:30+01:00[Europe/Paris]`.\n *\n * The string must represent a valid date-time and is parsed using\n * {@link org.threeten.bp.format.DateTimeFormatter#ISO_ZONED_DATE_TIME}.\n *\n * @param {!string} text - the text to parse such as '2007-12-03T10:15:30+01:00[Europe/Paris]', not null\n * @param {!DateTimeFormatter} [formatter=DateTimeFormatter.ISO_ZONED_DATE_TIME] - the formatter to use\n * @return {ZonedDateTime} the parsed zoned date-time, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n static parse(text, formatter = DateTimeFormatter.ISO_ZONED_DATE_TIME) {\n requireNonNull(formatter, 'formatter');\n return formatter.parse(text, ZonedDateTime.FROM);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param {LocalDateTime} dateTime - the date-time, validated as not null\n * @param {ZoneOffset} offset - the zone offset, validated as not null\n * @param {ZoneUd} zone - the time-zone, validated as not null\n * @private\n */\n constructor(dateTime, offset, zone) {\n requireNonNull(dateTime, 'dateTime');\n requireNonNull(offset, 'offset');\n requireNonNull(zone, 'zone');\n\n super();\n\n /**\n * The local date-time.\n */\n this._dateTime = dateTime;\n /**\n * The offset from UTC/Greenwich.\n */\n this._offset = offset;\n /**\n * The time-zone.\n */\n this._zone = zone;\n }\n\n /**\n * Resolves the new local date-time using this zone ID, retaining the offset if possible.\n *\n * @param {LocalDateTime} newDateTime - the new local date-time, not null\n * @return {ZonedDateTime} the zoned date-time, not null\n */\n _resolveLocal(newDateTime) {\n requireNonNull(newDateTime, 'newDateTime');\n return ZonedDateTime.ofLocal(newDateTime, this._zone, this._offset);\n }\n\n /**\n * Resolves the new local date-time using the offset to identify the instant.\n *\n * @param {LocalDateTime} newDateTime - the new local date-time, not null\n * @return {ZonedDateTime} the zoned date-time, not null\n */\n _resolveInstant(newDateTime) {\n return ZonedDateTime.ofInstant3(newDateTime, this._offset, this._zone);\n }\n\n /**\n * Resolves the offset into this zoned date-time.\n *\n * This ignores the offset, unless it can be used in an overlap.\n *\n * @param {ZoneOffset} offset - the offset, not null\n * @return {ZonedDateTime} the zoned date-time, not null\n */\n _resolveOffset(offset) {\n if (offset.equals(this._offset) === false && this._zone.rules().isValidOffset(this._dateTime, offset)) {\n return new ZonedDateTime(this._dateTime, offset, this._zone);\n }\n return this;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the specified field is supported.\n *\n * This checks if this date-time can be queried for the specified field.\n * If false, then calling {@link range} and {@link get} will throw an exception.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields are:\n *\n * * {@link NANO_OF_SECOND}\n * * {@link NANO_OF_DAY}\n * * {@link MICRO_OF_SECOND}\n * * {@link MICRO_OF_DAY}\n * * {@link MILLI_OF_SECOND}\n * * {@link MILLI_OF_DAY}\n * * {@link SECOND_OF_MINUTE}\n * * {@link SECOND_OF_DAY}\n * * {@link MINUTE_OF_HOUR}\n * * {@link MINUTE_OF_DAY}\n * * {@link HOUR_OF_AMPM}\n * * {@link CLOCK_HOUR_OF_AMPM}\n * * {@link HOUR_OF_DAY}\n * * {@link CLOCK_HOUR_OF_DAY}\n * * {@link AMPM_OF_DAY}\n * * {@link DAY_OF_WEEK}\n * * {@link ALIGNED_DAY_OF_WEEK_IN_MONTH}\n * * {@link ALIGNED_DAY_OF_WEEK_IN_YEAR}\n * * {@link DAY_OF_MONTH}\n * * {@link DAY_OF_YEAR}\n * * {@link EPOCH_DAY}\n * * {@link ALIGNED_WEEK_OF_MONTH}\n * * {@link ALIGNED_WEEK_OF_YEAR}\n * * {@link MONTH_OF_YEAR}\n * * {@link EPOCH_MONTH}\n * * {@link YEAR_OF_ERA}\n * * {@link YEAR}\n * * {@link ERA}\n * * {@link INSTANT_SECONDS}\n * * {@link OFFSET_SECONDS}\n *\n * All other {@link ChronoField} instances will return false.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.isSupportedBy}\n * passing `this` as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param {TemporalField|TemporalUnit} fieldOrUnit - the field to check, null returns false\n * @return {boolean} true if the field is supported on this date-time, false if not\n */\n isSupported(fieldOrUnit) {\n if(fieldOrUnit instanceof ChronoField){\n return true;\n } else if (fieldOrUnit instanceof ChronoUnit) {\n return fieldOrUnit.isDateBased() || fieldOrUnit.isTimeBased();\n }\n return (fieldOrUnit != null && fieldOrUnit.isSupportedBy(this));\n }\n\n\n /**\n * Gets the range of valid values for the specified field.\n *\n * The range object expresses the minimum and maximum valid values for a field.\n * This date-time is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return\n * appropriate range instances.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.rangeRefinedBy}\n * passing `this` as the argument.\n * Whether the range can be obtained is determined by the field.\n *\n * @param {TemporalField} field - the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws DateTimeException if the range for the field cannot be obtained\n */\n range(field) {\n if (field instanceof ChronoField) {\n if (field === ChronoField.INSTANT_SECONDS || field === ChronoField.OFFSET_SECONDS) {\n return field.range();\n }\n return this._dateTime.range(field);\n }\n return field.rangeRefinedBy(this);\n }\n\n /**\n * Gets the value of the specified field from this date-time as an `int`.\n *\n * This queries this date-time for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return valid\n * values based on this date-time, except {@link NANO_OF_DAY}, {@link MICRO_OF_DAY},\n * {@link EPOCH_DAY}, {@link EPOCH_MONTH} and {@link INSTANT_SECONDS} which are too\n * large to fit in an `int` and throw a {@link DateTimeException}.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {!TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws DateTimeException if a value for the field cannot be obtained\n * @throws ArithmeticException if numeric overflow occurs\n */\n get(field) {\n return this.getLong(field);\n }\n\n /**\n * Gets the value of the specified field from this date-time as a `long`.\n *\n * This queries this date-time for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return valid\n * values based on this date-time.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {!TemporalField} field the field to get, not null\n * @return {number} the value for the field\n * @throws DateTimeException if a value for the field cannot be obtained\n * @throws ArithmeticException if numeric overflow occurs\n */\n getLong(field) {\n if (field instanceof ChronoField) {\n switch (field) {\n case ChronoField.INSTANT_SECONDS: return this.toEpochSecond();\n case ChronoField.OFFSET_SECONDS: return this._offset.totalSeconds();\n }\n return this._dateTime.getLong(field);\n }\n requireNonNull(field, 'field');\n return field.getFrom(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the zone offset, such as '+01:00'.\n *\n * This is the offset of the local date-time from UTC/Greenwich.\n *\n * @return {ZoneOffset}the zone offset, not null\n */\n offset() {\n return this._offset;\n }\n\n /**\n * Returns a copy of this date-time changing the zone offset to the\n * earlier of the two valid offsets at a local time-line overlap.\n *\n * This method only has any effect when the local time-line overlaps, such as\n * at an autumn daylight savings cutover. In this scenario, there are two\n * valid offsets for the local date-time. Calling this method will return\n * a zoned date-time with the earlier of the two selected.\n *\n * If this method is called when it is not an overlap, `this`\n * is returned.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the earlier offset, not null\n */\n withEarlierOffsetAtOverlap() {\n const trans = this._zone.rules().transition(this._dateTime);\n if (trans != null && trans.isOverlap()) {\n const earlierOffset = trans.offsetBefore();\n if (earlierOffset.equals(this._offset) === false) {\n return new ZonedDateTime(this._dateTime, earlierOffset, this._zone);\n }\n }\n return this;\n }\n\n /**\n * Returns a copy of this date-time changing the zone offset to the\n * later of the two valid offsets at a local time-line overlap.\n *\n * This method only has any effect when the local time-line overlaps, such as\n * at an autumn daylight savings cutover. In this scenario, there are two\n * valid offsets for the local date-time. Calling this method will return\n * a zoned date-time with the later of the two selected.\n *\n * If this method is called when it is not an overlap, `this`\n * is returned.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the later offset, not null\n */\n withLaterOffsetAtOverlap() {\n const trans = this._zone.rules().transition(this.toLocalDateTime());\n if (trans != null) {\n const laterOffset = trans.offsetAfter();\n if (laterOffset.equals(this._offset) === false) {\n return new ZonedDateTime(this._dateTime, laterOffset, this._zone);\n }\n }\n return this;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the time-zone, such as 'Europe/Paris'.\n *\n * This returns the zone ID. This identifies the time-zone {@link ZoneRules}\n * that determine when and how the offset from UTC/Greenwich changes.\n *\n * The zone ID may be same as the offset (see {@link getOffset}).\n * If this is true, then any future calculations, such as addition or subtraction,\n * have no complex edge cases due to time-zone rules.\n * See also {@link withFixedOffsetZone}.\n *\n * @return {ZoneId} the time-zone, not null\n */\n zone() {\n return this._zone;\n }\n\n /**\n * Returns a copy of this date-time with a different time-zone,\n * retaining the local date-time if possible.\n *\n * This method changes the time-zone and retains the local date-time.\n * The local date-time is only changed if it is invalid for the new zone,\n * determined using the same approach as\n * {@link ofLocal}.\n *\n * To change the zone and adjust the local date-time,\n * use {@link withZoneSameInstant}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {ZoneId} zone - the time-zone to change to, not null\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the requested zone, not null\n */\n withZoneSameLocal(zone) {\n requireNonNull(zone, 'zone');\n return this._zone.equals(zone) ? this : ZonedDateTime.ofLocal(this._dateTime, zone, this._offset);\n }\n\n /**\n * Returns a copy of this date-time with a different time-zone,\n * retaining the instant.\n *\n * This method changes the time-zone and retains the instant.\n * This normally results in a change to the local date-time.\n *\n * This method is based on retaining the same instant, thus gaps and overlaps\n * in the local time-line have no effect on the result.\n *\n * To change the offset while keeping the local time,\n * use {@link withZoneSameLocal}.\n *\n * @param {ZoneId} zone - the time-zone to change to, not null\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the requested zone, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n withZoneSameInstant(zone) {\n requireNonNull(zone, 'zone');\n return this._zone.equals(zone) ? this :\n ZonedDateTime._create(this._dateTime.toEpochSecond(this._offset), this._dateTime.nano(), zone);\n }\n\n /**\n * Returns a copy of this date-time with the zone ID set to the offset.\n *\n * This returns a zoned date-time where the zone ID is the same as {@link getOffset}.\n * The local date-time, offset and instant of the result will be the same as in this date-time.\n *\n * Setting the date-time to a fixed single offset means that any future\n * calculations, such as addition or subtraction, have no complex edge cases\n * due to time-zone rules.\n * This might also be useful when sending a zoned date-time across a network,\n * as most protocols, such as ISO-8601, only handle offsets,\n * and not region-based zone IDs.\n *\n * This is equivalent to {@link ZonedDateTime.of}.\n *\n * @return {ZonedDateTime} a {@link ZonedDateTime} with the zone ID set to the offset, not null\n */\n withFixedOffsetZone() {\n return this._zone.equals(this._offset) ? this : new ZonedDateTime(this._dateTime, this._offset, this._offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the year field.\n *\n * This method returns the primitive `int` value for the year.\n *\n * The year returned by this method is proleptic as per {@link get}.\n * To obtain the year-of-era, use `get(YEAR_OF_ERA)`.\n *\n * @return {number} the year, from MIN_YEAR to MAX_YEAR\n */\n year() {\n return this._dateTime.year();\n }\n\n /**\n * Gets the month-of-year field from 1 to 12.\n *\n * This method returns the month as an `int` from 1 to 12.\n * Application code is frequently clearer if the enum {@link Month}\n * is used by calling {@link getMonth}.\n *\n * @return {number} the month-of-year, from 1 to 12\n * @see #month()\n */\n monthValue() {\n return this._dateTime.monthValue();\n }\n\n /**\n * Gets the month-of-year field using the {@link Month} enum.\n *\n * This method returns the enum {@link Month} for the month.\n * This avoids confusion as to what `int` values mean.\n * If you need access to the primitive `int` value, use {@link Month#getValue}.\n *\n * @return {Month} the month-of-year, not null\n * @see #getMonthValue()\n */\n month() {\n return this._dateTime.month();\n }\n\n /**\n * Gets the day-of-month field.\n *\n * This method returns the primitive `int` value for the day-of-month.\n *\n * @return {number} the day-of-month, from 1 to 31\n */\n dayOfMonth() {\n return this._dateTime.dayOfMonth();\n }\n\n /**\n * Gets the day-of-year field.\n *\n * This method returns the primitive `int` value for the day-of-year.\n *\n * @return {number} the day-of-year, from 1 to 365, or 366 in a leap year\n */\n dayOfYear() {\n return this._dateTime.dayOfYear();\n }\n\n /**\n * Gets the day-of-week field, which is an enum {@link DayOfWeek}.\n *\n * This method returns the enum {@link DayOfWeek} for the day-of-week.\n * This avoids confusion as to what `int` values mean.\n * If you need access to the primitive `int` value, use {@link DayOfWeek#getValue}.\n *\n * Additional information can be obtained from the {@link DayOfWeek}.\n * This includes textual names of the values.\n *\n * @return {DayOfWeek} the day-of-week, not null\n */\n dayOfWeek() {\n return this._dateTime.dayOfWeek();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the hour-of-day field.\n *\n * @return {number} the hour-of-day, from 0 to 23\n */\n hour() {\n return this._dateTime.hour();\n }\n\n /**\n * Gets the minute-of-hour field.\n *\n * @return {number} the minute-of-hour, from 0 to 59\n */\n minute() {\n return this._dateTime.minute();\n }\n\n /**\n * Gets the second-of-minute field.\n *\n * @return {number} the second-of-minute, from 0 to 59\n */\n second() {\n return this._dateTime.second();\n }\n\n /**\n * Gets the nano-of-second field.\n *\n * @return {number} the nano-of-second, from 0 to 999,999,999\n */\n nano() {\n return this._dateTime.nano();\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * Returns an adjusted copy of this date-time.\n *\n * This returns a new {@link ZonedDateTime}, based on this one, with the date-time adjusted.\n * The adjustment takes place using the specified adjuster strategy object.\n * Read the documentation of the adjuster to understand what adjustment will be made.\n *\n * A simple adjuster might simply set the one of the fields, such as the year field.\n * A more complex adjuster might set the date to the last day of the month.\n * A selection of common adjustments is provided in {@link TemporalAdjusters}.\n * These include finding the 'last day of the month' and 'next Wednesday'.\n * Key date-time classes also implement the {@link TemporalAdjuster} interface,\n * such as {@link Month} and {@link MonthDay}.\n * The adjuster is responsible for handling special cases, such as the varying\n * lengths of month and leap years.\n *\n * For example this code returns a date on the last day of July:\n *

\n     *  import static org.threeten.bp.Month.*;\n     *  import static org.threeten.bp.temporal.Adjusters.*;\n     *\n     *  result = zonedDateTime.with(JULY).with(lastDayOfMonth());\n     * 
\n *\n * The classes {@link LocalDate} and {@link LocalTime} implement {@link TemporalAdjuster},\n * thus this method can be used to change the date, time or offset:\n *
\n     *  result = zonedDateTime.with(date);\n     *  result = zonedDateTime.with(time);\n     * 
\n *\n * {@link ZoneOffset} also implements {@link TemporalAdjuster} however it is less likely\n * that setting the offset will have the effect you expect. When an offset is passed in,\n * the local date-time is combined with the new offset to form an {@link Instant}.\n * The instant and original zone are then used to create the result.\n * This algorithm means that it is quite likely that the output has a different offset\n * to the specified offset. It will however work correctly when passing in the offset\n * applicable for the instant of the zoned date-time, and will work correctly if passing\n * one of the two valid offsets during a daylight savings overlap when the same local time\n * occurs twice.\n *\n * The result of this method is obtained by invoking the\n * {@link TemporalAdjuster#adjustInto} method on the\n * specified adjuster passing `this` as the argument.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAdjuster} adjuster - the adjuster to use, not null\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on `this` with the adjustment made, not null\n * @throws DateTimeException if the adjustment cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n withAdjuster(adjuster) {\n // optimizations\n if (adjuster instanceof LocalDate) {\n return this._resolveLocal(LocalDateTime.of(adjuster, this._dateTime.toLocalTime()));\n } else if (adjuster instanceof LocalTime) {\n return this._resolveLocal(LocalDateTime.of(this._dateTime.toLocalDate(), adjuster));\n } else if (adjuster instanceof LocalDateTime) {\n return this._resolveLocal(adjuster);\n } else if (adjuster instanceof Instant) {\n const instant = adjuster;\n return ZonedDateTime._create(instant.epochSecond(), instant.nano(), this._zone);\n } else if (adjuster instanceof ZoneOffset) {\n return this._resolveOffset(adjuster);\n }\n requireNonNull(adjuster, 'adjuster');\n return adjuster.adjustInto(this);\n }\n\n /**\n * Returns a copy of this date-time with the specified field set to a new value.\n *\n * This returns a {@link ZonedDateTime}, based on this one, with the value\n * for the specified field changed.\n * This can be used to change any supported field, such as the year, month or day-of-month.\n * If it is not possible to set the value, because the field is not supported or for\n * some other reason, an exception is thrown.\n *\n * In some cases, changing the specified field can cause the resulting date-time to become invalid,\n * such as changing the month from 31st January to February would make the day-of-month invalid.\n * In cases like this, the field is responsible for resolving the date. Typically it will choose\n * the previous valid date, which would be the last valid day of February in this example.\n *\n * If the field is a {@link ChronoField} then the adjustment is implemented here.\n *\n * The {@link INSTANT_SECONDS} field will return a date-time with the specified instant.\n * The zone and nano-of-second are unchanged.\n * The result will have an offset derived from the new instant and original zone.\n * If the new instant value is outside the valid range then a {@link DateTimeException} will be thrown.\n *\n * The {@link OFFSET_SECONDS} field will typically be ignored.\n * The offset of a {@link ZonedDateTime} is controlled primarily by the time-zone.\n * As such, changing the offset does not generally make sense, because there is only\n * one valid offset for the local date-time and zone.\n * If the zoned date-time is in a daylight savings overlap, then the offset is used\n * to switch between the two valid offsets. In all other cases, the offset is ignored.\n * If the new offset value is outside the valid range then a {@link DateTimeException} will be thrown.\n *\n * The other supported fields (see {@link isSupported}) will behave as in {@link LocalDateTime#with}.\n * The zone is not part of the calculation and will be unchanged.\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * All other {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.adjustInto}\n * passing `this` as the argument. In this case, the field determines\n * whether and how to adjust the instant.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalField} field - the field to set in the result, not null\n * @param {number} newValue - the new value of the field in the result\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on `this` with the specified field set, not null\n * @throws DateTimeException if the field cannot be set\n * @throws UnsupportedTemporalTypeException if the field is not supported\n * @throws ArithmeticException if numeric overflow occurs\n */\n withFieldValue(field, newValue) {\n if (field instanceof ChronoField) {\n switch (field) {\n case ChronoField.INSTANT_SECONDS: return ZonedDateTime._create(newValue, this.nano(), this._zone);\n case ChronoField.OFFSET_SECONDS: {\n const offset = ZoneOffset.ofTotalSeconds(field.checkValidIntValue(newValue));\n return this._resolveOffset(offset);\n }\n }\n return this._resolveLocal(this._dateTime.with(field, newValue));\n }\n return field.adjustInto(this, newValue);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link ZonedDateTime} with the year value altered.\n *\n * This operates on the local time-line,\n * changing the year (see {@link LocalDateTime#withYear}) of the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} year - the year to set in the result, from MIN_YEAR to MAX_YEAR\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the requested year, not null\n * @throws DateTimeException if the year value is invalid\n */\n withYear(year) {\n return this._resolveLocal(this._dateTime.withYear(year));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the month-of-year value altered.\n *\n * This operates on the local time-line,\n * changing the month (see {@link LocalDateTime#withMonth}) of the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} month - the month-of-year to set in the result, from 1 (January) to 12 (December)\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the requested month, not null\n * @throws DateTimeException if the month-of-year value is invalid\n */\n withMonth(month) {\n return this._resolveLocal(this._dateTime.withMonth(month));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the day-of-month value altered.\n *\n * This operates on the local time-line,\n * changing the day-of-month (see {@link LocalDateTime#withDayOfMonth}) of the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} dayOfMonth - the day-of-month to set in the result, from 1 to 28-31\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the requested day, not null\n * @throws DateTimeException if the day-of-month value is invalid\n * @throws DateTimeException if the day-of-month is invalid for the month-year\n */\n withDayOfMonth(dayOfMonth) {\n return this._resolveLocal(this._dateTime.withDayOfMonth(dayOfMonth));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the day-of-year altered.\n *\n * This operates on the local time-line,\n * changing the day-of-year (see {@link LocalDateTime#withDayOfYear}) of the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} dayOfYear - the day-of-year to set in the result, from 1 to 365-366\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date with the requested day, not null\n * @throws DateTimeException if the day-of-year value is invalid\n * @throws DateTimeException if the day-of-year is invalid for the year\n */\n withDayOfYear(dayOfYear) {\n return this._resolveLocal(this._dateTime.withDayOfYear(dayOfYear));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link ZonedDateTime} with the hour-of-day value altered.\n *\n * This operates on the local time-line,\n * changing the time (see {@link LocalDateTime#withHour}) of the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} hour - the hour-of-day to set in the result, from 0 to 23\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the requested hour, not null\n * @throws DateTimeException if the hour value is invalid\n */\n withHour(hour) {\n return this._resolveLocal(this._dateTime.withHour(hour));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the minute-of-hour value altered.\n *\n * This operates on the local time-line,\n * changing the time (see {@link LocalDateTime#withMinute}) of the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} minute - the minute-of-hour to set in the result, from 0 to 59\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the requested minute, not null\n * @throws DateTimeException if the minute value is invalid\n */\n withMinute(minute) {\n return this._resolveLocal(this._dateTime.withMinute(minute));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the second-of-minute value altered.\n *\n * This operates on the local time-line,\n * changing the time (see {@link LocalDateTime#withSecond}) of the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} second - the second-of-minute to set in the result, from 0 to 59\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the requested second, not null\n * @throws DateTimeException if the second value is invalid\n */\n withSecond(second) {\n return this._resolveLocal(this._dateTime.withSecond(second));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the nano-of-second value altered.\n *\n * This operates on the local time-line,\n * changing the time (see {@link LocalDateTime#withNano}) of the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} nanoOfSecond - the nano-of-second to set in the result, from 0 to 999,999,999\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the requested nanosecond, not null\n * @throws DateTimeException if the nano value is invalid\n */\n withNano(nanoOfSecond) {\n return this._resolveLocal(this._dateTime.withNano(nanoOfSecond));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link ZonedDateTime} with the time truncated.\n *\n * Truncation returns a copy of the original date-time with fields\n * smaller than the specified unit set to zero.\n * For example, truncating with {@link ChronoUnit#MINUTES}\n * will set the second-of-minute and nano-of-second field to zero.\n *\n * The unit must have a duration (see {@link TemporalUnit#getDuration})\n * that divides into the length of a standard day without remainder.\n * This includes all supplied time units on {@link ChronoUnit} and\n * {@link ChronoUnit#DAYS}. Other units throw an exception.\n *\n * This operates on the local time-line, truncating the underlying local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalUnit} unit - the unit to truncate to, not null\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the time truncated, not null\n * @throws DateTimeException if unable to truncate\n */\n truncatedTo(unit) {\n return this._resolveLocal(this._dateTime.truncatedTo(unit));\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * Returns a copy of this date-time with the specified period added.\n *\n * This method returns a new date-time based on this time with the specified period added.\n * The amount is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link plus}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {!TemporalAmount} amount - the amount to add, not null\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the addition made, not null\n * @throws DateTimeException if the addition cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusAmount(amount) {\n requireNonNull(amount);\n return amount.addTo(this);\n }\n\n /**\n * Returns a copy of this date-time with the specified period added.\n *\n * This method returns a new date-time based on this date-time with the specified period added.\n * This can be used to add any period that is defined by a unit, for example to add years, months or days.\n * The unit is responsible for the details of the calculation, including the resolution\n * of any edge cases in the calculation.\n *\n * The calculation for date and time units differ.\n *\n * Date units operate on the local time-line.\n * The period is first added to the local date-time, then converted back\n * to a zoned date-time using the zone ID.\n * The conversion uses {@link ofLocal}\n * with the offset before the addition.\n *\n * Time units operate on the instant time-line.\n * The period is first added to the local date-time, then converted back to\n * a zoned date-time using the zone ID.\n * The conversion uses {@link ofInstant}\n * with the offset before the addition.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} amountToAdd - the amount of the unit to add to the result, may be negative\n * @param {TemporalUnit} unit - the unit of the period to add, not null\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the specified period added, not null\n * @throws DateTimeException if the unit cannot be added to this type\n */\n plusAmountUnit(amountToAdd, unit) {\n if (unit instanceof ChronoUnit) {\n if (unit.isDateBased()) {\n return this._resolveLocal(this._dateTime.plus(amountToAdd, unit));\n } else {\n return this._resolveInstant(this._dateTime.plus(amountToAdd, unit));\n }\n }\n requireNonNull(unit, 'unit');\n return unit.addTo(this, amountToAdd);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in years added.\n *\n * This operates on the local time-line, adding years to the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} years - the years to add, may be negative\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the years added, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n plusYears(years) {\n return this._resolveLocal(this._dateTime.plusYears(years));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in months added.\n *\n * This operates on the local time-line, adding months to the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} months - the months to add, may be negative\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the months added, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n plusMonths(months) {\n return this._resolveLocal(this._dateTime.plusMonths(months));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in weeks added.\n *\n * This operates on the local time-line, adding weeks to the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} weeks - the weeks to add, may be negative\n * @return {ZonedDateTime}a {@link ZonedDateTime} based on this date-time with the weeks added, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n plusWeeks(weeks) {\n return this._resolveLocal(this._dateTime.plusWeeks(weeks));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in days added.\n *\n * This operates on the local time-line, adding days to the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} days - the days to add, may be negative\n * @return {ZonedDateTime}a {@link ZonedDateTime} based on this date-time with the days added, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n plusDays(days) {\n return this._resolveLocal(this._dateTime.plusDays(days));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in hours added.\n *\n * This operates on the instant time-line, such that adding one hour will\n * always be a duration of one hour later.\n * This may cause the local date-time to change by an amount other than one hour.\n * Note that this is a different approach to that used by days, months and years,\n * thus adding one day is not the same as adding 24 hours.\n *\n * For example, consider a time-zone where the spring DST cutover means that the\n * local times 01:00 to 01:59 occur twice changing from offset +02:00 to +01:00.\n *\n * * Adding one hour to 00:30+02:00 will result in 01:30+02:00\n * * Adding one hour to 01:30+02:00 will result in 01:30+01:00\n * * Adding one hour to 01:30+01:00 will result in 02:30+01:00\n * * Adding three hours to 00:30+02:00 will result in 02:30+01:00\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} hours - the hours to add, may be negative\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the hours added, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n plusHours(hours) {\n return this._resolveInstant(this._dateTime.plusHours(hours));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in minutes added.\n *\n * This operates on the instant time-line, such that adding one minute will\n * always be a duration of one minute later.\n * This may cause the local date-time to change by an amount other than one minute.\n * Note that this is a different approach to that used by days, months and years.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} minutes - the minutes to add, may be negative\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the minutes added, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n plusMinutes(minutes) {\n return this._resolveInstant(this._dateTime.plusMinutes(minutes));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in seconds added.\n *\n * This operates on the instant time-line, such that adding one second will\n * always be a duration of one second later.\n * This may cause the local date-time to change by an amount other than one second.\n * Note that this is a different approach to that used by days, months and years.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} seconds - the seconds to add, may be negative\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the seconds added, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n plusSeconds(seconds) {\n return this._resolveInstant(this._dateTime.plusSeconds(seconds));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in nanoseconds added.\n *\n * This operates on the instant time-line, such that adding one nano will\n * always be a duration of one nano later.\n * This may cause the local date-time to change by an amount other than one nano.\n * Note that this is a different approach to that used by days, months and years.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} nanos - the nanos to add, may be negative\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the nanoseconds added, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n plusNanos(nanos) {\n return this._resolveInstant(this._dateTime.plusNanos(nanos));\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * Returns a copy of this date-time with the specified period subtracted.\n *\n * This method returns a new date-time based on this time with the specified period subtracted.\n * The amount is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link minus}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAmount} amount - the amount to subtract, not null\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the subtraction made, not null\n * @throws DateTimeException if the subtraction cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusAmount(amount) {\n requireNonNull(amount, 'amount');\n return amount.subtractFrom(this);\n }\n\n /**\n * Returns a copy of this date-time with the specified period subtracted.\n *\n * This method returns a new date-time based on this date-time with the specified period subtracted.\n * This can be used to subtract any period that is defined by a unit, for example to subtract years, months or days.\n * The unit is responsible for the details of the calculation, including the resolution\n * of any edge cases in the calculation.\n *\n * The calculation for date and time units differ.\n *\n * Date units operate on the local time-line.\n * The period is first subtracted from the local date-time, then converted back\n * to a zoned date-time using the zone ID.\n * The conversion uses {@link ofLocal}\n * with the offset before the subtraction.\n *\n * Time units operate on the instant time-line.\n * The period is first subtracted from the local date-time, then converted back to\n * a zoned date-time using the zone ID.\n * The conversion uses {@link ofInstant}\n * with the offset before the subtraction.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} amountToSubtract - the amount of the unit to subtract from the result, may be negative\n * @param {TemporalUnit} unit - the unit of the period to subtract, not null\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the specified period subtracted, not null\n * @throws DateTimeException if the unit cannot be added to this type\n */\n minusAmountUnit(amountToSubtract, unit) {\n return this.plusAmountUnit(-1 * amountToSubtract, unit);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in years subtracted.\n *\n * This operates on the local time-line, subtracting years from the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} years - the years to subtract, may be negative\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the years subtracted, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n minusYears(years) {\n return this.plusYears(-1 * years);\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in months subtracted.\n *\n * This operates on the local time-line, subtracting months from the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} months - the months to subtract, may be negative\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the months subtracted, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n minusMonths(months) {\n return this.plusMonths(-1 * months);\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in weeks subtracted.\n *\n * This operates on the local time-line, subtracting weeks from the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} weeks - the weeks to subtract, may be negative\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the weeks subtracted, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n minusWeeks(weeks) {\n return this.plusWeeks(-1 * weeks);\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in days subtracted.\n *\n * This operates on the local time-line, subtracting days from the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} days - the days to subtract, may be negative\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the days subtracted, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n minusDays(days) {\n return this.plusDays(-1 * days);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in hours subtracted.\n *\n * This operates on the instant time-line, such that subtracting one hour will\n * always be a duration of one hour earlier.\n * This may cause the local date-time to change by an amount other than one hour.\n * Note that this is a different approach to that used by days, months and years,\n * thus subtracting one day is not the same as adding 24 hours.\n *\n * For example, consider a time-zone where the spring DST cutover means that the\n * local times 01:00 to 01:59 occur twice changing from offset +02:00 to +01:00.\n *\n * * Subtracting one hour from 02:30+01:00 will result in 01:30+02:00\n * * Subtracting one hour from 01:30+01:00 will result in 01:30+02:00\n * * Subtracting one hour from 01:30+02:00 will result in 00:30+01:00\n * * Subtracting three hours from 02:30+01:00 will result in 00:30+02:00\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} hours - the hours to subtract, may be negative\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the hours subtracted, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n minusHours(hours) {\n return this.plusHours(-1 * hours);\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in minutes subtracted.\n *\n * This operates on the instant time-line, such that subtracting one minute will\n * always be a duration of one minute earlier.\n * This may cause the local date-time to change by an amount other than one minute.\n * Note that this is a different approach to that used by days, months and years.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} minutes - the minutes to subtract, may be negative\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the minutes subtracted, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n minusMinutes(minutes) {\n return this.plusMinutes(-1 * minutes);\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in seconds subtracted.\n *\n * This operates on the instant time-line, such that subtracting one second will\n * always be a duration of one second earlier.\n * This may cause the local date-time to change by an amount other than one second.\n * Note that this is a different approach to that used by days, months and years.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} seconds - the seconds to subtract, may be negative\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the seconds subtracted, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n minusSeconds(seconds) {\n return this.plusSeconds(-1 * seconds);\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in nanoseconds subtracted.\n *\n * This operates on the instant time-line, such that subtracting one nano will\n * always be a duration of one nano earlier.\n * This may cause the local date-time to change by an amount other than one nano.\n * Note that this is a different approach to that used by days, months and years.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} nanos - the nanos to subtract, may be negative\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the nanoseconds subtracted, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n minusNanos(nanos) {\n return this.plusNanos(-1 * nanos);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this date-time using the specified query.\n *\n * This queries this date-time using the specified query strategy object.\n * The {@link TemporalQuery} object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n *\n * The result of this method is obtained by invoking the\n * {@link TemporalQuery#queryFrom} method on the\n * specified query passing `this` as the argument.\n *\n * @param {TemporalQuery} query - the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws DateTimeException if unable to query (defined by the query)\n * @throws ArithmeticException if numeric overflow occurs (defined by the query)\n */\n query(query) {\n if (query === TemporalQueries.localDate()) {\n return this.toLocalDate();\n }\n requireNonNull(query, 'query');\n return super.query(query);\n }\n\n /**\n * Calculates the period between this date-time and another date-time in\n * terms of the specified unit.\n *\n * This calculates the period between two date-times in terms of a single unit.\n * The start and end points are `this` and the specified date-time.\n * The result will be negative if the end is before the start.\n * For example, the period in days between two date-times can be calculated\n * using {@link startDateTime.until}.\n *\n * The {@link Temporal} passed to this method must be a {@link ZonedDateTime}.\n * If the time-zone differs between the two zoned date-times, the specified\n * end date-time is normalized to have the same zone as this date-time.\n *\n * The calculation returns a whole number, representing the number of\n * complete units between the two date-times.\n * For example, the period in months between 2012-06-15T00:00Z and 2012-08-14T23:59Z\n * will only be one month as it is one minute short of two months.\n *\n * This method operates in association with {@link TemporalUnit#between}.\n * The result of this method is a `long` representing the amount of\n * the specified unit. By contrast, the result of {@link between} is an\n * object that can be used directly in addition/subtraction:\n *
\n     *   long period = start.until(end, MONTHS);   // this method\n     *   dateTime.plus(MONTHS.between(start, end));      // use in plus/minus\n     * 
\n *\n * The calculation is implemented in this method for {@link ChronoUnit}.\n * The units {@link NANOS}, {@link MICROS}, {@link MILLIS}, {@link SECONDS},\n * {@link MINUTES}, {@link HOURS} and {@link HALF_DAYS}, {@link DAYS},\n * {@link WEEKS}, {@link MONTHS}, {@link YEARS}, {@link DECADES},\n * {@link CENTURIES}, {@link MILLENNIA} and {@link ERAS} are supported.\n * Other {@link ChronoUnit} values will throw an exception.\n *\n * The calculation for date and time units differ.\n *\n * Date units operate on the local time-line, using the local date-time.\n * For example, the period from noon on day 1 to noon the following day\n * in days will always be counted as exactly one day, irrespective of whether\n * there was a daylight savings change or not.\n *\n * Time units operate on the instant time-line.\n * The calculation effectively converts both zoned date-times to instants\n * and then calculates the period between the instants.\n * For example, the period from noon on day 1 to noon the following day\n * in hours may be 23, 24 or 25 hours (or some other amount) depending on\n * whether there was a daylight savings change or not.\n *\n * If the unit is not a {@link ChronoUnit}, then the result of this method\n * is obtained by invoking {@link TemporalUnit.between}\n * passing `this` as the first argument and the input temporal as\n * the second argument.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} endExclusive the end date-time, which is converted to a {@link ZonedDateTime}, not null\n * @param {TemporalUnit} unit the unit to measure the period in, not null\n * @return {number} the amount of the period between this date-time and the end date-time\n * @throws DateTimeException if the period cannot be calculated\n * @throws ArithmeticException if numeric overflow occurs\n */\n until(endExclusive, unit) {\n let end = ZonedDateTime.from(endExclusive);\n if (unit instanceof ChronoUnit) {\n end = end.withZoneSameInstant(this._zone);\n if (unit.isDateBased()) {\n return this._dateTime.until(end._dateTime, unit);\n } else {\n const difference = this._offset.totalSeconds() - end._offset.totalSeconds();\n const adjustedEnd = end._dateTime.plusSeconds(difference);\n return this._dateTime.until(adjustedEnd, unit);\n }\n }\n return unit.between(this, end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the {@link LocalDateTime} part of this date-time.\n *\n * This returns a {@link LocalDateTime} with the same year, month, day and time\n * as this date-time.\n *\n * @return {LocalDateTime} the local date-time part of this date-time, not null\n */\n toLocalDateTime() {\n return this._dateTime;\n }\n\n /**\n * Gets the {@link LocalDate} part of this date-time.\n *\n * This returns a {@link LocalDate} with the same year, month and day\n * as this date-time.\n *\n * @return {LocalDate} the date part of this date-time, not null\n */\n toLocalDate() {\n return this._dateTime.toLocalDate();\n }\n\n /**\n * Gets the {@link LocalTime} part of this date-time.\n *\n * This returns a {@link LocalTime} with the same hour, minute, second and\n * nanosecond as this date-time.\n *\n * @return {LocalTime} the time part of this date-time, not null\n */\n toLocalTime() {\n return this._dateTime.toLocalTime();\n }\n\n /**\n * Converts this date-time to an {@link OffsetDateTime}.\n *\n * This creates an offset date-time using the local date-time and offset.\n * The zone ID is ignored.\n *\n * @return {OffsetDateTime} an offset date-time representing the same local date-time and offset, not null\n */\n toOffsetDateTime() {\n return OffsetDateTime.of(this._dateTime, this._offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this date-time is equal to another date-time.\n *\n * The comparison is based on the offset date-time and the zone.\n * Only objects of type {@link ZonedDateTime} are compared, other types return false.\n *\n * @param {*} other the object to check, null returns false\n * @return {boolean} true if this is equal to the other date-time\n */\n equals(other) {\n if (this === other) {\n return true;\n }\n if (other instanceof ZonedDateTime) {\n return this._dateTime.equals(other._dateTime) &&\n this._offset.equals(other._offset) &&\n this._zone.equals(other._zone);\n }\n return false;\n }\n\n /**\n * A hash code for this date-time.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return MathUtil.hashCode(this._dateTime.hashCode(), this._offset.hashCode(), this._zone.hashCode());\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this date-time as a string, such as\n * `2007-12-03T10:15:30+01:00[Europe/Paris]`.\n *\n * The format consists of the {@link LocalDateTime} followed by the {@link ZoneOffset}.\n * If the {@link ZoneId} is not the same as the offset, then the ID is output.\n * The output is compatible with ISO-8601 if the offset and ID are the same.\n *\n * @return {string} a string representation of this date-time, not null\n */\n toString() {\n let str = this._dateTime.toString() + this._offset.toString();\n if (this._offset !== this._zone) {\n str += '[' + this._zone.toString() + ']';\n }\n return str;\n }\n\n /**\n *\n * @return {string} same as {@link ZonedDateTime.toString}\n */\n toJSON() {\n return this.toString();\n }\n\n /**\n * Outputs this date-time as a string using the formatter.\n *\n * @param {DateTimeFormatter} formatter the formatter to use, not null\n * @return {string} the formatted date-time string, not null\n * @throws DateTimeException if an error occurs during printing\n */\n format(formatter) {\n return super.format(formatter);\n }\n\n}\n\nexport function _init(){\n ZonedDateTime.FROM = createTemporalQuery('ZonedDateTime.FROM', (temporal) => {\n return ZonedDateTime.from(temporal);\n });\n}\n","/**\n * @copyright (c) 2016-present, Philipp Thürwächter & Pattrick Hüper & js-joda contributors\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {ChronoField} from './temporal/ChronoField';\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {Clock} from './Clock';\nimport {DateTimeFormatter} from './format/DateTimeFormatter';\nimport {DefaultInterfaceTemporal} from './temporal/DefaultInterfaceTemporal';\nimport {Instant} from './Instant';\nimport {IsoChronology} from './chrono/IsoChronology';\nimport {LocalDateTime} from './LocalDateTime';\nimport {LocalDate} from './LocalDate';\nimport {LocalTime} from './LocalTime';\nimport {MathUtil} from './MathUtil';\nimport {OffsetTime} from './OffsetTime';\nimport {TemporalQueries} from './temporal/TemporalQueries';\nimport {ZonedDateTime} from './ZonedDateTime';\nimport {ZoneId} from './ZoneId';\nimport {ZoneOffset} from './ZoneOffset';\nimport {DateTimeException, IllegalArgumentException} from './errors';\n\nimport {createTemporalQuery} from './temporal/TemporalQuery';\nimport {requireInstance, requireNonNull} from './assert';\n\n/**\n * A date-time with an offset from UTC/Greenwich in the ISO-8601 calendar system,\n * such as 2007-12-23T10:15:30+01:00.\n */\nexport class OffsetDateTime extends DefaultInterfaceTemporal {\n /**\n * @param {TemporaroAccessor} temporal\n * @return {OffsetDateTime}\n */\n static from(temporal) {\n requireNonNull(temporal, 'temporal');\n if (temporal instanceof OffsetDateTime) {\n return temporal;\n }\n try {\n const offset = ZoneOffset.from(temporal);\n try {\n const ldt = LocalDateTime.from(temporal);\n return OffsetDateTime.of(ldt, offset);\n } catch (_) {\n const instant = Instant.from(temporal);\n return OffsetDateTime.ofInstant(instant, offset);\n }\n } catch (ex) {\n throw new DateTimeException(`Unable to obtain OffsetDateTime TemporalAccessor: ${temporal}, type ${temporal.constructor != null ? temporal.constructor.name : ''}`);\n }\n }\n\n /**\n * @param {Clock|ZoneId|null} clockOrZone\n * @return {OffsetDateTime}\n */\n static now(clockOrZone) {\n if (arguments.length === 0) {\n return OffsetDateTime.now(Clock.systemDefaultZone());\n } else {\n requireNonNull(clockOrZone, 'clockOrZone');\n if (clockOrZone instanceof ZoneId) {\n return OffsetDateTime.now(Clock.system(clockOrZone));\n } else if (clockOrZone instanceof Clock) {\n const now = clockOrZone.instant(); // called once\n return OffsetDateTime.ofInstant(now, clockOrZone.zone().rules().offset(now));\n } else {\n throw new IllegalArgumentException('clockOrZone must be an instance of ZoneId or Clock');\n }\n }\n }\n\n /**\n * @return {OffsetDateTime}\n */\n static of() {\n if (arguments.length <= 2) {\n return OffsetDateTime.ofDateTime.apply(this, arguments);\n } else if (arguments.length === 3) {\n return OffsetDateTime.ofDateAndTime.apply(this, arguments);\n } else {\n return OffsetDateTime.ofNumbers.apply(this, arguments);\n }\n }\n\n static ofDateTime(dateTime, offset) {\n return new OffsetDateTime(dateTime, offset);\n }\n\n static ofDateAndTime(date, time, offset) {\n const dt = LocalDateTime.of(date, time);\n return new OffsetDateTime(dt, offset);\n }\n\n static ofNumbers(year, month, dayOfMonth, hour=0, minute=0, second=0, nanoOfSecond=0, offset) {\n const dt = LocalDateTime.of(year, month, dayOfMonth, hour, minute, second, nanoOfSecond);\n return new OffsetDateTime(dt, offset);\n }\n\n /**\n * @param {Instant} instant\n * @param {ZoneId} zone\n * @return {OffsetDateTime}\n */\n static ofInstant(instant, zone){\n requireNonNull(instant, 'instant');\n requireNonNull(zone, 'zone');\n const rules = zone.rules();\n const offset = rules.offset(instant);\n const ldt = LocalDateTime.ofEpochSecond(instant.epochSecond(), instant.nano(), offset);\n return new OffsetDateTime(ldt, offset);\n }\n\n /**\n * @param {string} text\n * @param {DateTimeFormatter|undefined} formatter\n * @return {OffsetTime}\n */\n static parse(text, formatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME){\n requireNonNull(formatter, 'formatter');\n return formatter.parse(text, OffsetDateTime.FROM);\n }\n\n // TODO: Need java.util.Comparater interface.\n // static timeLineOrder() {\n //\n // }\n\n //-----------------------------------------------------------------------\n\n\n /**\n * @param {LocalDateTime} dateTime\n * @param {ZoneOffset} offset\n * @private\n */\n constructor(dateTime, offset) {\n super();\n requireNonNull(dateTime, 'dateTime');\n requireInstance(dateTime, LocalDateTime, 'dateTime');\n requireNonNull(offset, 'offset');\n requireInstance(offset, ZoneOffset, 'offset');\n this._dateTime = dateTime;\n this._offset = offset;\n }\n\n /**\n *\n * @param {Temporal} temporal\n * @return {Temporal}\n */\n adjustInto(temporal) {\n return temporal\n .with(ChronoField.EPOCH_DAY, this.toLocalDate().toEpochDay())\n .with(ChronoField.NANO_OF_DAY, this.toLocalTime().toNanoOfDay())\n .with(ChronoField.OFFSET_SECONDS, this.offset().totalSeconds());\n }\n\n until(endExclusive, unit) {\n let end = OffsetDateTime.from(endExclusive);\n if (unit instanceof ChronoUnit) {\n end = end.withOffsetSameInstant(this._offset);\n return this._dateTime.until(end._dateTime, unit);\n }\n return unit.between(this, end);\n }\n\n /**\n * @param {ZoneId}zone\n * @return {ZonedDateTime}\n */\n atZoneSameInstant(zone) {\n return ZonedDateTime.ofInstant(this._dateTime, this._offset, zone);\n }\n\n /**\n * @param {ZoneId} zone\n * @return {ZonedDateTime}\n */\n atZoneSimilarLocal(zone) {\n return ZonedDateTime.ofLocal(this._dateTime, zone, this._offset);\n }\n\n query(query) {\n requireNonNull(query, 'query');\n if (query === TemporalQueries.chronology()) {\n return IsoChronology.INSTANCE;\n } else if (query === TemporalQueries.precision()) {\n return ChronoUnit.NANOS;\n } else if (query === TemporalQueries.offset() || query === TemporalQueries.zone()) {\n return this.offset();\n } else if (query === TemporalQueries.localDate()) {\n return this.toLocalDate();\n } else if (query === TemporalQueries.localTime()) {\n return this.toLocalTime();\n } else if (query === TemporalQueries.zoneId()) {\n return null;\n }\n return super.query(query);\n }\n\n get(field) {\n if (field instanceof ChronoField) {\n switch (field) {\n case ChronoField.INSTANT_SECONDS: throw new DateTimeException('Field too large for an int: ' + field);\n case ChronoField.OFFSET_SECONDS: return this.offset().totalSeconds();\n }\n return this._dateTime.get(field);\n }\n return super.get(field);\n }\n\n getLong(field) {\n if (field instanceof ChronoField) {\n switch (field) {\n case ChronoField.INSTANT_SECONDS: return this.toEpochSecond();\n case ChronoField.OFFSET_SECONDS: return this.offset().totalSeconds();\n }\n return this._dateTime.getLong(field);\n }\n return field.getFrom(this);\n }\n\n /**\n * @return {ZoneOffset}\n */\n offset() {\n return this._offset;\n }\n\n /**\n * @return {number} the year, from MIN_YEAR to MAX_YEAR\n */\n year() {\n return this._dateTime.year();\n }\n\n /**\n * @return {number} the month-of-year, from 1 to 12\n * @see #month()\n */\n monthValue() {\n return this._dateTime.monthValue();\n }\n\n /**\n * @return {{number} }the month-of-year, not null\n * @see #monthValue()\n */\n month() {\n return this._dateTime.month();\n }\n\n /**\n * @return {number} the day-of-month, from 1 to 31\n */\n dayOfMonth() {\n return this._dateTime.dayOfMonth();\n }\n\n /**\n * @return {number} the day-of-year, from 1 to 365, or 366 in a leap year\n */\n dayOfYear() {\n return this._dateTime.dayOfYear();\n }\n\n /**\n * @return {number} the day-of-week, not null\n */\n dayOfWeek() {\n return this._dateTime.dayOfWeek();\n }\n\n /**\n * @return {number} the hour-of-day, from 0 to 23\n */\n hour() {\n return this._dateTime.hour();\n }\n\n /**\n * @return {number} the minute-of-hour, from 0 to 59\n */\n minute() {\n return this._dateTime.minute();\n }\n\n /**\n * @return {number} the second-of-minute, from 0 to 59\n */\n second() {\n return this._dateTime.second();\n }\n\n /**\n * @return {number} the nano-of-second, from 0 to 999,999,999\n */\n nano() {\n return this._dateTime.nano();\n }\n\n //-----------------------------------------------------------------------\n /**\n * @return {LocalDateTime}the local date-time part of this date-time, not null\n */\n toLocalDateTime() {\n return this._dateTime;\n }\n\n /**\n * @return {LocalDate} the date part of this date-time, not null\n */\n toLocalDate() {\n return this._dateTime.toLocalDate();\n }\n\n /**\n * @return {LocalTime} the time part of this date-time, not null\n */\n toLocalTime() {\n return this._dateTime.toLocalTime();\n }\n\n /**\n * @return {OffsetTime} an OffsetTime representing the time and offset, not null\n */\n toOffsetTime() {\n return OffsetTime.of(this._dateTime.toLocalTime(), this._offset);\n }\n\n /**\n * @return {ZonedDateTime}a zoned date-time representing the same local date-time and offset, not null\n */\n toZonedDateTime() {\n return ZonedDateTime.of(this._dateTime, this._offset);\n }\n\n /**\n * @return {Instant} an {@code Instant} representing the same instant, not null\n */\n toInstant() {\n return this._dateTime.toInstant(this._offset);\n }\n\n /**\n * @return {number} the number of seconds from the epoch of 1970-01-01T00:00:00Z\n */\n toEpochSecond() {\n return this._dateTime.toEpochSecond(this._offset);\n }\n\n isSupported(fieldOrUnit) {\n if (fieldOrUnit instanceof ChronoField) {\n return fieldOrUnit.isDateBased() || fieldOrUnit.isTimeBased();\n }\n if (fieldOrUnit instanceof ChronoUnit) {\n return fieldOrUnit.isDateBased() || fieldOrUnit.isTimeBased();\n }\n return fieldOrUnit != null && fieldOrUnit.isSupportedBy(this);\n }\n\n range(field) {\n if (field instanceof ChronoField) {\n if (field === ChronoField.INSTANT_SECONDS || field === ChronoField.OFFSET_SECONDS) {\n return field.range();\n }\n return this._dateTime.range(field);\n }\n return field.rangeRefinedBy(this);\n }\n\n withAdjuster(adjuster) {\n requireNonNull(adjuster);\n // optimizations\n if (adjuster instanceof LocalDate || adjuster instanceof LocalTime || adjuster instanceof LocalDateTime) {\n return this._withDateTimeOffset(this._dateTime.with(adjuster), this._offset);\n } else if (adjuster instanceof Instant) {\n return OffsetDateTime.ofInstant(adjuster, this._offset);\n } else if (adjuster instanceof ZoneOffset) {\n return this._withDateTimeOffset(this._dateTime, adjuster);\n } else if (adjuster instanceof OffsetDateTime) {\n return adjuster;\n }\n return adjuster.adjustInto(this);\n }\n\n withFieldValue(field, newValue) {\n requireNonNull(field);\n if (field instanceof ChronoField) {\n const f = field;\n switch (f) {\n case ChronoField.INSTANT_SECONDS: return OffsetDateTime.ofInstant(Instant.ofEpochSecond(newValue, this.nano()), this._offset);\n case ChronoField.OFFSET_SECONDS: {\n return this._withDateTimeOffset(this._dateTime, ZoneOffset.ofTotalSeconds(f.checkValidIntValue(newValue)));\n }\n }\n return this._withDateTimeOffset(this._dateTime.with(field, newValue), this._offset);\n }\n return field.adjustInto(this, newValue);\n }\n\n _withDateTimeOffset(dateTime, offset) {\n if (this._dateTime === dateTime && this._offset.equals(offset)) {\n return this;\n }\n return new OffsetDateTime(dateTime, offset);\n }\n\n /**\n * @param {int} year\n * @return {OffsetDateTime}\n */\n withYear(year) {\n return this._withDateTimeOffset(this._dateTime.withYear(year), this._offset);\n }\n\n /**\n * @param {int} month\n * @return {OffsetDateTime}\n */\n withMonth(month) {\n return this._withDateTimeOffset(this._dateTime.withMonth(month), this._offset);\n }\n\n /**\n * @param {int} dayOfMonth\n * @return {OffsetDateTime}\n */\n withDayOfMonth(dayOfMonth) {\n return this._withDateTimeOffset(this._dateTime.withDayOfMonth(dayOfMonth), this._offset);\n }\n\n /**\n * @param {int} dayOfYear\n * @return {OffsetDateTime}\n */\n withDayOfYear(dayOfYear) {\n return this._withDateTimeOffset(this._dateTime.withDayOfYear(dayOfYear), this._offset);\n }\n\n /**\n * @param {int} hour\n * @return {OffsetDateTime}\n */\n withHour(hour) {\n return this._withDateTimeOffset(this._dateTime.withHour(hour), this._offset);\n }\n\n /**\n * @param {int} minute\n * @return {OffsetDateTime}\n */\n withMinute(minute) {\n return this._withDateTimeOffset(this._dateTime.withMinute(minute), this._offset);\n }\n\n /**\n * @param {int} second\n * @return {OffsetDateTime}\n */\n withSecond(second) {\n return this._withDateTimeOffset(this._dateTime.withSecond(second), this._offset);\n }\n\n /**\n * @param {int} nanoOfSecond\n * @return {OffsetDateTime}\n */\n withNano(nanoOfSecond) {\n return this._withDateTimeOffset(this._dateTime.withNano(nanoOfSecond), this._offset);\n }\n\n /**\n * @param {ZoneOffset} offset\n * @return {OffsetDateTime}\n */\n withOffsetSameLocal(offset) {\n requireNonNull(offset, 'offset');\n return this._withDateTimeOffset(this._dateTime, offset);\n }\n\n /**\n * @param {ZoneOffset} offset\n * @return {OffsetDateTime}\n */\n withOffsetSameInstant(offset) {\n requireNonNull(offset, 'offset');\n if (offset.equals(this._offset)) {\n return this;\n }\n const difference = offset.totalSeconds() - this._offset.totalSeconds();\n const adjusted = this._dateTime.plusSeconds(difference);\n return new OffsetDateTime(adjusted, offset);\n }\n\n /**\n * @param {TemporalUnit} unit\n * @return {OffsetDateTime}\n */\n truncatedTo(unit) {\n return this._withDateTimeOffset(this._dateTime.truncatedTo(unit), this._offset);\n }\n\n plusAmount(amount) {\n requireNonNull(amount, 'amount');\n return amount.addTo(this);\n }\n\n plusAmountUnit(amountToAdd, unit) {\n if (unit instanceof ChronoUnit) {\n return this._withDateTimeOffset(this._dateTime.plus(amountToAdd, unit), this._offset);\n }\n return unit.addTo(this, amountToAdd);\n }\n\n /**\n * @param {int} years\n * @return {OffsetTime}\n */\n plusYears(years) {\n return this._withDateTimeOffset(this._dateTime.plusYears(years), this._offset);\n }\n\n /**\n * @param {int} months\n * @return {OffsetTime}\n */\n plusMonths(months) {\n return this._withDateTimeOffset(this._dateTime.plusMonths(months), this._offset);\n }\n\n /**\n * @param {int} weeks\n * @return {OffsetTime}\n */\n plusWeeks(weeks) {\n return this._withDateTimeOffset(this._dateTime.plusWeeks(weeks), this._offset);\n }\n\n /**\n * @param {int} days\n * @return {OffsetTime}\n */\n plusDays(days) {\n return this._withDateTimeOffset(this._dateTime.plusDays(days), this._offset);\n }\n\n /**\n * @param {int} hours\n * @return {OffsetTime}\n */\n plusHours(hours) {\n return this._withDateTimeOffset(this._dateTime.plusHours(hours), this._offset);\n }\n\n /**\n * @param {int} minutes\n * @return {OffsetTime}\n */\n plusMinutes(minutes) {\n return this._withDateTimeOffset(this._dateTime.plusMinutes(minutes), this._offset);\n }\n\n /**\n * @param {int} seconds\n * @return {OffsetTime}\n */\n plusSeconds(seconds) {\n return this._withDateTimeOffset(this._dateTime.plusSeconds(seconds), this._offset);\n }\n\n /**\n * @param {int} nanos\n * @return {OffsetTime}\n */\n plusNanos(nanos) {\n return this._withDateTimeOffset(this._dateTime.plusNanos(nanos), this._offset);\n }\n\n minusAmount(amount) {\n requireNonNull(amount);\n return amount.subtractFrom(this);\n }\n\n minusAmountUnit(amountToSubtract, unit) {\n return this.plus(-1 * amountToSubtract, unit);\n }\n\n /**\n * @param {int} years\n * @return {OffsetTime}\n */\n minusYears(years) {\n return this._withDateTimeOffset(this._dateTime.minusYears(years), this._offset);\n }\n\n /**\n * @param {int} months\n * @return {OffsetTime}\n */\n minusMonths(months) {\n return this._withDateTimeOffset(this._dateTime.minusMonths(months), this._offset);\n }\n\n /**\n * @param {int} weeks\n * @return {OffsetTime}\n */\n minusWeeks(weeks) {\n return this._withDateTimeOffset(this._dateTime.minusWeeks(weeks), this._offset);\n }\n\n /**\n * @param {int} days\n * @return {OffsetTime}\n */\n minusDays(days) {\n return this._withDateTimeOffset(this._dateTime.minusDays(days), this._offset);\n }\n\n /**\n * @param {int} hours\n * @return {OffsetTime}\n */\n minusHours(hours) {\n return this._withDateTimeOffset(this._dateTime.minusHours(hours), this._offset);\n }\n\n /**\n * @param {int} minutes\n * @return {OffsetTime}\n */\n minusMinutes(minutes) {\n return this._withDateTimeOffset(this._dateTime.minusMinutes(minutes), this._offset);\n }\n\n /**\n * @param {int} seconds\n * @return {OffsetTime}\n */\n minusSeconds(seconds) {\n return this._withDateTimeOffset(this._dateTime.minusSeconds(seconds), this._offset);\n }\n\n /**\n * @param {int} nanos\n * @return {OffsetTime}\n */\n minusNanos(nanos) {\n return this._withDateTimeOffset(this._dateTime.minusNanos(nanos), this._offset);\n }\n\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, OffsetDateTime, 'other');\n if (this.offset().equals(other.offset())) {\n return this.toLocalDateTime().compareTo(other.toLocalDateTime());\n }\n let cmp = MathUtil.compareNumbers(this.toEpochSecond(), other.toEpochSecond());\n if (cmp === 0) {\n cmp = this.toLocalTime().nano() - other.toLocalTime().nano();\n if (cmp === 0) {\n cmp = this.toLocalDateTime().compareTo(other.toLocalDateTime());\n }\n }\n return cmp;\n }\n\n /**\n * @param {OffsetDateTime} other\n * @return {boolean}\n */\n isAfter(other) {\n requireNonNull(other, 'other');\n const thisEpochSec = this.toEpochSecond();\n const otherEpochSec = other.toEpochSecond();\n return thisEpochSec > otherEpochSec || (thisEpochSec === otherEpochSec && this.toLocalTime().nano() > other.toLocalTime().nano());\n }\n\n /**\n * @param {OffsetDateTime} other\n * @return {boolean}\n */\n isBefore(other) {\n requireNonNull(other, 'other');\n const thisEpochSec = this.toEpochSecond();\n const otherEpochSec = other.toEpochSecond();\n return thisEpochSec < otherEpochSec || (thisEpochSec === otherEpochSec && this.toLocalTime().nano() < other.toLocalTime().nano());\n }\n\n /**\n * @param {OffsetDateTime} other\n * @return {boolean}\n */\n isEqual(other) {\n requireNonNull(other, 'other');\n return this.toEpochSecond() === other.toEpochSecond() && this.toLocalTime().nano() === other.toLocalTime().nano();\n }\n\n //-----------------------------------------------------------------------\n /**\n * @param other\n * @return {boolean}\n */\n equals(other) {\n if (this === other) {\n return true;\n }\n if (other instanceof OffsetDateTime) {\n return this._dateTime.equals(other._dateTime) && this._offset.equals(other._offset);\n }\n return false;\n }\n\n /**\n * @return {number}\n */\n hashCode() {\n return this._dateTime.hashCode() ^ this._offset.hashCode();\n }\n\n toString() {\n return this._dateTime.toString() + this._offset.toString();\n }\n\n /**\n *\n * @return {string} same as {@link LocalDateTime.toString}\n */\n toJSON() {\n return this.toString();\n }\n\n /**\n * @param {DateTimeFormatter} formatter\n * @return {string}\n */\n format(formatter) {\n requireNonNull(formatter, 'formatter');\n return formatter.format(this);\n }\n}\n\n\nexport function _init() {\n OffsetDateTime.MIN = LocalDateTime.MIN.atOffset(ZoneOffset.MAX);\n\n OffsetDateTime.MAX = LocalDateTime.MAX.atOffset(ZoneOffset.MIN);\n\n OffsetDateTime.FROM = createTemporalQuery('OffsetDateTime.FROM', (temporal) => {\n return OffsetDateTime.from(temporal);\n });\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {assert, requireNonNull, requireInstance} from './assert';\n\nimport {MathUtil} from './MathUtil';\nimport {DateTimeException, UnsupportedTemporalTypeException, NullPointerException, IllegalArgumentException} from './errors';\n\nimport {IsoChronology} from './chrono/IsoChronology';\nimport {ChronoField} from './temporal/ChronoField';\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {ChronoLocalDate} from './chrono/ChronoLocalDate';\nimport {TemporalQueries} from './temporal/TemporalQueries';\nimport {createTemporalQuery} from './temporal/TemporalQuery';\nimport {ValueRange} from './temporal/ValueRange';\nimport {DateTimeFormatter} from './format/DateTimeFormatter';\n\nimport {Clock} from './Clock';\nimport {DayOfWeek} from './DayOfWeek';\nimport {OffsetDateTime} from './OffsetDateTime';\nimport {OffsetTime} from './OffsetTime';\nimport {Month} from './Month';\nimport {Period} from './Period';\nimport {YearConstants} from './YearConstants';\nimport {LocalTime} from './LocalTime';\nimport {LocalDateTime} from './LocalDateTime';\nimport {Year} from './Year';\nimport {ZoneId} from './ZoneId';\nimport {ZoneOffset} from './ZoneOffset';\nimport {ZonedDateTime} from './ZonedDateTime';\n\n/**\n * The number of days in a 400 year cycle.\n */\nconst DAYS_PER_CYCLE = 146097;\n\n/**\n* The number of days from year zero to year 1970.\n* There are five 400 year cycles from year zero to 2000.\n* There are 7 leap years from 1970 to 2000.\n*/\nconst DAYS_0000_TO_1970 = (DAYS_PER_CYCLE * 5) - (30 * 365 + 7);\n\n/**\n * A date without a time-zone in the ISO-8601 calendar system,\n * such as 2007-12-03.\n *\n * LocalDate is an immutable date-time object that represents a date,\n * often viewed as year-month-day. Other date fields, such as day-of-year,\n * day-of-week and week-of-year, can also be accessed.\n * For example, the value \"2nd October 2007\" can be stored in a LocalDate.\n *\n * This class does not store or represent a time or time-zone.\n * Instead, it is a description of the date, as used for birthdays.\n * It cannot represent an instant on the time-line without additional information\n * such as an offset or time-zone.\n *\n * The ISO-8601 calendar system is the modern civil calendar system used today\n * in most of the world. It is equivalent to the proleptic Gregorian calendar\n * system, in which today's rules for leap years are applied for all time.\n * For most applications written today, the ISO-8601 rules are entirely suitable.\n * However, any application that makes use of historical dates, and requires them\n * to be accurate will find the ISO-8601 approach unsuitable.\n *\n * ### Static properties of Class {@link LocalDate}\n *\n * LocalDate.MIN = LocalDate.of(Year.MIN_VALUE, 1, 1);\n *\n * The minimum supported {@link LocalDate}\n * This could be used by an application as a \"far past\" date.\n *\n * LocalDate.MAX = LocalDate.of(Year.MAX_VALUE, 12, 31);\n *\n * The maximum supported {@link LocalDate}\n * This could be used by an application as a \"far future\" date.\n *\n * LocalDate.EPOCH_0\n *\n * The date at epoch day 0, that is 1970-01-01.\n */\n\nexport class LocalDate extends ChronoLocalDate{\n\n /**\n * Obtains the current date from the system clock in the default time-zone or\n * if specified, the current date from the specified clock or\n * if argument is a ZoneId this will query a clock with the specified ZoneId.\n *\n * This will query the specified clock to obtain the current date - today.\n * Using this method allows the use of an alternate clock for testing.\n *\n * @param {Clock|ZoneId} [clockOrZone=Clock.systemDefaultZone()] - the clock or zone to use,\n * if null, the system clock and default time-zone is used.\n * @return {LocalDate} the current date, not null\n */\n static now(clockOrZone) {\n let clock;\n if(clockOrZone == null){\n clock = Clock.systemDefaultZone();\n } else if(clockOrZone instanceof ZoneId){\n clock = Clock.system(clockOrZone);\n } else {\n clock = clockOrZone;\n }\n return LocalDate.ofInstant(clock.instant(), clock.zone());\n }\n\n /**\n * obtain a LocalDate from an Instant in the specified time-zone or, if null\n * in the system default time-zone\n *\n * @param {!Instant} instant\n * @param {ZoneId} [zone=ZoneId.systemDefault()], defaults to ZoneId.systemDefault()\n * @returns {LocalDate} the current date, not null\n */\n static ofInstant(instant, zone=ZoneId.systemDefault()){\n requireNonNull(instant, 'instant');\n const offset = zone.rules().offset(instant);\n const epochSec = instant.epochSecond() + offset.totalSeconds();\n const epochDay = MathUtil.floorDiv(epochSec, LocalTime.SECONDS_PER_DAY);\n return LocalDate.ofEpochDay(epochDay);\n }\n\n /**\n * Obtains an instance of {@link LocalDate} from a year, month and day.\n *\n * This returns a {@link LocalDate} with the specified year, month and day-of-month.\n * The day must be valid for the year and month, otherwise an exception will be thrown.\n *\n * @param {!number} year - the year to represent, from {@link Year.MIN_VALUE} to {@link Year.MAX_VALUE}\n * @param {!(Month|Number)} month - the month-of-year to represent, from 1 (January) to 12 (December)\n * @param {!number} dayOfMonth - the day-of-month to represent, from 1 to 31\n * @return {LocalDate} the local date, not null\n * @throws {DateTimeException} if the value of any field is out of range,\n * or if the day-of-month is invalid for the month-year\n */\n static of(year, month, dayOfMonth) {\n return new LocalDate(year, month, dayOfMonth);\n }\n\n /**\n * Obtains an instance of {@link LocalDate} from a year and day-of-year.\n *\n * This returns a {@link LocalDate} with the specified year and day-of-year.\n * The day-of-year must be valid for the year, otherwise an exception will be thrown.\n *\n * @param {!number} year - the year to represent, from {@link Year.MIN_VALUE} to {@link Year.MAX_VALUE}\n * @param {!number} dayOfYear - the day-of-year to represent, from 1 to 366\n * @return {LocalDate} the local date, not null\n * @throws {DateTimeException} if the value of any field is out of range,\n * or if the day-of-year is invalid for the year\n */\n static ofYearDay(year, dayOfYear) {\n ChronoField.YEAR.checkValidValue(year);\n //TODO: ChronoField.DAY_OF_YEAR.checkValidValue(dayOfYear);\n const leap = IsoChronology.isLeapYear(year);\n if (dayOfYear === 366 && leap === false) {\n assert(false, 'Invalid date \\'DayOfYear 366\\' as \\'' + year + '\\' is not a leap year', DateTimeException);\n }\n let moy = Month.of(Math.floor((dayOfYear - 1) / 31 + 1));\n const monthEnd = moy.firstDayOfYear(leap) + moy.length(leap) - 1;\n if (dayOfYear > monthEnd) {\n moy = moy.plus(1);\n }\n const dom = dayOfYear - moy.firstDayOfYear(leap) + 1;\n return new LocalDate(year, moy.value(), dom);\n }\n\n /**\n * Obtains an instance of LocalDate from the epoch day count.\n *\n * This returns a LocalDate with the specified epoch-day.\n * The {@link ChronoField.EPOCH_DAY} is a simple incrementing count\n * of days where day 0 is 1970-01-01. Negative numbers represent earlier days.\n *\n * @param {number} [epochDay=0] - the Epoch Day to convert, based on the epoch 1970-01-01\n * @return {LocalDate} the local date, not null\n * @throws {AssertionError} if the epoch days exceeds the supported date range\n */\n static ofEpochDay(epochDay=0) {\n let adjust, adjustCycles, doyEst, yearEst, zeroDay;\n zeroDay = epochDay + DAYS_0000_TO_1970;\n zeroDay -= 60;\n adjust = 0;\n if (zeroDay < 0) {\n adjustCycles = MathUtil.intDiv(zeroDay + 1, DAYS_PER_CYCLE) - 1;\n adjust = adjustCycles * 400;\n zeroDay += -adjustCycles * DAYS_PER_CYCLE;\n }\n yearEst = MathUtil.intDiv(400 * zeroDay + 591, DAYS_PER_CYCLE);\n doyEst = zeroDay - (365 * yearEst + MathUtil.intDiv(yearEst, 4) - MathUtil.intDiv(yearEst, 100) + MathUtil.intDiv(yearEst, 400));\n if (doyEst < 0) {\n yearEst--;\n doyEst = zeroDay - (365 * yearEst + MathUtil.intDiv(yearEst, 4) - MathUtil.intDiv(yearEst, 100) + MathUtil.intDiv(yearEst, 400));\n }\n yearEst += adjust;\n const marchDoy0 = doyEst;\n const marchMonth0 = MathUtil.intDiv(marchDoy0 * 5 + 2, 153);\n const month = (marchMonth0 + 2) % 12 + 1;\n const dom = marchDoy0 - MathUtil.intDiv(marchMonth0 * 306 + 5, 10) + 1;\n yearEst += MathUtil.intDiv(marchMonth0, 10);\n const year = yearEst;\n return new LocalDate(year, month, dom);\n }\n\n /**\n * Obtains an instance of {@link LocalDate} from a temporal object.\n *\n * A {@link TemporalAccessor} represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of {@link LocalDate}.\n *\n * The conversion uses the {@link TemporalQueries.localDate} query, which relies\n * on extracting the {@link ChronoField.EPOCH_DAY} field.\n *\n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used as a query via method reference, {@link LocalDate::from}.\n *\n * @param {!TemporalAccessor} temporal - the temporal object to convert, not null\n * @return {LocalDate} the local date, not null\n * @throws {DateTimeException} if unable to convert to a {@link LocalDate}\n */\n static from(temporal) {\n requireNonNull(temporal, 'temporal');\n const date = temporal.query(TemporalQueries.localDate());\n if (date == null) {\n throw new DateTimeException(\n `Unable to obtain LocalDate from TemporalAccessor: ${temporal}, type ${temporal.constructor != null ? temporal.constructor.name : ''}`);\n }\n return date;\n }\n\n /**\n * Obtains an instance of {@link LocalDate} from a text string using a specific formatter.\n *\n * The text is parsed using the formatter, returning a date.\n *\n * @param {!string} text - the text to parse, not null\n * @param {DateTimeFormatter} [formatter=DateTimeFormatter.ISO_LOCAL_DATE] - the formatter to use, default is\n * {@link DateTimeFormatter.ISO_LOCAL_DATE}\n * @return {LocalDate} the parsed local date, not null\n * @throws {DateTimeParseException} if the text cannot be parsed\n */\n static parse(text, formatter = DateTimeFormatter.ISO_LOCAL_DATE){\n assert(formatter != null, 'formatter', NullPointerException);\n return formatter.parse(text, LocalDate.FROM);\n }\n\n /**\n * Resolves the date, resolving days past the end of month.\n *\n * @param {!number} year - the year to represent, validated from {@link Year.MIN_VALUE} to {@link Year.MAX_VALUE}\n * @param {!number} month - the month-of-year to represent, validated from 1 to 12\n * @param {!number} day - the day-of-month to represent, validated from 1 to 31\n * @return {LocalDate} resolved date, not null\n */\n static _resolvePreviousValid(year, month, day) {\n switch (month) {\n case 2:\n day = Math.min(day, IsoChronology.isLeapYear(year) ? 29 : 28);\n break;\n case 4:\n case 6:\n case 9:\n case 11:\n day = Math.min(day, 30);\n break;\n }\n return LocalDate.of(year, month, day);\n }\n\n /**\n * Do not call the constructor directly, use the of*() factories instead like {@link LocalDate.of}\n *\n * @param {!number} year\n * @param {!(Month|number)} month\n * @param {!number} dayOfMonth\n * @private\n */\n constructor(year, month, dayOfMonth){\n super();\n requireNonNull(year, 'year');\n requireNonNull(month, 'month');\n requireNonNull(dayOfMonth, 'dayOfMonth');\n\n if (month instanceof Month) {\n month = month.value();\n }\n this._year = MathUtil.safeToInt(year);\n this._month = MathUtil.safeToInt(month);\n this._day = MathUtil.safeToInt(dayOfMonth);\n LocalDate._validate(this._year, this._month, this._day);\n }\n\n\n /**\n *\n * @param {!number} year\n * @param {!number} month\n * @param {!number} dayOfMonth\n * @throws {DateTimeException} if date values are invalid\n * @private\n */\n static _validate(year, month, dayOfMonth) {\n let dom;\n ChronoField.YEAR.checkValidValue(year);\n ChronoField.MONTH_OF_YEAR.checkValidValue(month);\n ChronoField.DAY_OF_MONTH.checkValidValue(dayOfMonth);\n\n if (dayOfMonth > 28) {\n dom = 31;\n switch (month) {\n case 2:\n dom = IsoChronology.isLeapYear(year) ? 29 : 28;\n break;\n case 4:\n case 6:\n case 9:\n case 11:\n dom = 30;\n }\n if (dayOfMonth > dom) {\n if (dayOfMonth === 29) {\n assert(false, 'Invalid date \\'February 29\\' as \\'' + year + '\\' is not a leap year', DateTimeException);\n } else {\n assert(false, 'Invalid date \\'' + year + '\\' \\'' + month + '\\' \\'' + dayOfMonth + '\\'', DateTimeException);\n }\n }\n }\n }\n\n /**\n * Checks if the specified field is supported.\n *\n * This checks if this date can be queried for the specified field.\n * If false, then calling the {@link LocalDate.range} range and\n * {@link LocalDate.get} get methods will throw an exception.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link LocalDate.isSupported} supported fields will return valid\n * values based on this date-time.\n * The supported fields are:\n *\n * * {@link ChronoField.DAY_OF_WEEK}\n * * {@link ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH}\n * * {@link ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR}\n * * {@link ChronoField.DAY_OF_MONTH}\n * * {@link ChronoField.DAY_OF_YEAR}\n * * {@link ChronoField.EPOCH_DAY}\n * * {@link ChronoField.ALIGNED_WEEK_OF_MONTH}\n * * {@link ChronoField.ALIGNED_WEEK_OF_YEAR}\n * * {@link ChronoField.MONTH_OF_YEAR}\n * * {@link ChronoField.EPOCH_MONTH}\n * * {@link ChronoField.YEAR_OF_ERA}\n * * {@link ChronoField.YEAR}\n * * {@link ChronoField.ERA}\n *\n * All other {@link ChronoField} instances will return false.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.isSupportedBy}\n * passing this as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param {TemporalField} field the field to check, null returns false\n * @return {boolean} true if the field is supported on this date, false if not\n */\n isSupported(field) {\n return super.isSupported(field);\n }\n\n /**\n * Gets the range of valid values for the specified field.\n *\n * The range object expresses the minimum and maximum valid values for a field.\n * This date is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link LocalDate.isSupported} supported fields will return\n * appropriate range instances.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.rangeRefinedBy}\n * passing this as the argument.\n * Whether the range can be obtained is determined by the field.\n *\n * @param {TemporalField} field the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws {DateTimeException} if the range for the field cannot be obtained\n */\n range(field) {\n if (field instanceof ChronoField) {\n if (field.isDateBased()) {\n switch (field) {\n case ChronoField.DAY_OF_MONTH: return ValueRange.of(1, this.lengthOfMonth());\n case ChronoField.DAY_OF_YEAR: return ValueRange.of(1, this.lengthOfYear());\n case ChronoField.ALIGNED_WEEK_OF_MONTH: return ValueRange.of(1, this.month() === Month.FEBRUARY && this.isLeapYear() === false ? 4 : 5);\n case ChronoField.YEAR_OF_ERA:\n return (this._year <= 0 ? ValueRange.of(1, Year.MAX_VALUE + 1) : ValueRange.of(1, Year.MAX_VALUE));\n }\n return field.range();\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.rangeRefinedBy(this);\n }\n\n /**\n * Gets the value of the specified field from this date as an `int`.\n *\n * This queries this date for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link LocalDate.isSupported} supported fields will return valid\n * values based on this date, except {@link ChronoField.EPOCH_DAY} and {@link ChronoField.EPOCH_MONTH}\n * which are too large to fit in an `int` and throw a {@link DateTimeException}.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing this as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {!TemporalField} field the field to get, not null\n * @return the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n get(field) {\n return this.getLong(field);\n }\n\n /**\n * see {LocalDate.get}, get and getLong are identical in javascript, because we are only limited by\n * {@link MathUtil.MIN_SAFE_INTEGER}/ {@link MathUtil.MAX_SAFE_INTEGER}\n *\n * @param {!TemporalField} field\n * @returns {*}\n */\n getLong(field) {\n assert(field != null, '', NullPointerException);\n if (field instanceof ChronoField) {\n return this._get0(field);\n }\n return field.getFrom(this);\n }\n\n /**\n * TODO tests are missing for the ALIGNED_* ChronoFields\n *\n * @param {!TemporalField} field\n * @returns {*}\n * @private\n */\n _get0(field) {\n switch (field) {\n case ChronoField.DAY_OF_WEEK: return this.dayOfWeek().value();\n case ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH: return MathUtil.intMod((this._day - 1), 7) + 1;\n case ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR: return MathUtil.intMod((this.dayOfYear() - 1), 7) + 1;\n case ChronoField.DAY_OF_MONTH: return this._day;\n case ChronoField.DAY_OF_YEAR: return this.dayOfYear();\n case ChronoField.EPOCH_DAY: return this.toEpochDay();\n case ChronoField.ALIGNED_WEEK_OF_MONTH: return MathUtil.intDiv((this._day - 1), 7) + 1;\n case ChronoField.ALIGNED_WEEK_OF_YEAR: return MathUtil.intDiv((this.dayOfYear() - 1), 7) + 1;\n case ChronoField.MONTH_OF_YEAR: return this._month;\n case ChronoField.PROLEPTIC_MONTH: return this._prolepticMonth();\n case ChronoField.YEAR_OF_ERA: return (this._year >= 1 ? this._year : 1 - this._year);\n case ChronoField.YEAR: return this._year;\n case ChronoField.ERA: return (this._year >= 1 ? 1 : 0);\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n\n /**\n *\n * @return {number}\n * @private\n */\n _prolepticMonth() {\n return (this._year * 12) + (this._month - 1);\n }\n\n /**\n * Gets the chronology of this date, which is the ISO calendar system.\n *\n * The {@link Chronology} represents the calendar system in use.\n * The ISO-8601 calendar system is the modern civil calendar system used today\n * in most of the world. It is equivalent to the proleptic Gregorian calendar\n * system, in which today's rules for leap years are applied for all time.\n *\n * @return {Chronology} the ISO chronology, not null\n */\n chronology() {\n return IsoChronology.INSTANCE;\n }\n\n /**\n *\n * @return {number} gets the year\n */\n year() {\n return this._year;\n }\n\n /**\n *\n * @return {number} gets the month value\n */\n monthValue() {\n return this._month;\n }\n\n /**\n *\n * @returns {Month} month\n */\n month() {\n return Month.of(this._month);\n }\n\n /**\n *\n * @return {number} gets the day of month\n */\n dayOfMonth() {\n return this._day;\n }\n\n /**\n * Gets the day-of-year field.\n *\n * This method returns the primitive int value for the day-of-year.\n *\n * @return {number} the day-of-year, from 1 to 365, or 366 in a leap year\n */\n dayOfYear() {\n return this.month().firstDayOfYear(this.isLeapYear()) + this._day - 1;\n }\n\n /**\n * Gets the day-of-week field, which is an enum {@link DayOfWeek}.\n *\n * This method returns the enum {@link DayOfWeek} for the day-of-week.\n * This avoids confusion as to what `int` values mean.\n * If you need access to the primitive `int` value then the enum\n * provides the {@link DayOfWeek.value} int value.\n *\n * Additional information can be obtained from the {@link DayOfWeek}.\n * This includes textual names of the values.\n *\n * @return {DayOfWeek} the day-of-week, not null\n */\n dayOfWeek() {\n const dow0 = MathUtil.floorMod(this.toEpochDay() + 3, 7);\n return DayOfWeek.of(dow0 + 1);\n }\n\n /**\n * Checks if the year is a leap year, according to the ISO proleptic\n * calendar system rules.\n *\n * This method applies the current rules for leap years across the whole time-line.\n * In general, a year is a leap year if it is divisible by four without\n * remainder. However, years divisible by 100, are not leap years, with\n * the exception of years divisible by 400 which are.\n *\n * For example, 1904 is a leap year it is divisible by 4.\n * 1900 was not a leap year as it is divisible by 100, however 2000 was a\n * leap year as it is divisible by 400.\n *\n * The calculation is proleptic - applying the same rules into the far future and far past.\n * This is historically inaccurate, but is correct for the ISO-8601 standard.\n *\n * @return {boolean} true if the year is leap, false otherwise\n */\n isLeapYear() {\n return IsoChronology.isLeapYear(this._year);\n }\n\n /**\n * Returns the length of the month represented by this date.\n *\n * This returns the length of the month in days.\n * For example, a date in January would return 31.\n *\n * @return {number} the length of the month in days\n */\n lengthOfMonth() {\n switch (this._month) {\n case 2:\n return (this.isLeapYear() ? 29 : 28);\n case 4:\n case 6:\n case 9:\n case 11:\n return 30;\n default:\n return 31;\n }\n }\n\n /**\n * Returns the length of the year represented by this date.\n *\n * This returns the length of the year in days, either 365 or 366.\n *\n * @return {number} 366 if the year is leap, 365 otherwise\n */\n lengthOfYear() {\n return (this.isLeapYear() ? 366 : 365);\n }\n\n /**\n * Returns an adjusted copy of this date.\n *\n * This returns a new {@link LocalDate}, based on this one, with the date adjusted.\n * The adjustment takes place using the specified adjuster strategy object.\n * Read the documentation of the adjuster to understand what adjustment will be made.\n *\n * A simple adjuster might simply set the one of the fields, such as the year field.\n * A more complex adjuster might set the date to the last day of the month.\n * A selection of common adjustments is provided in {@link TemporalAdjusters}.\n * These include finding the \"last day of the month\" and \"next Wednesday\".\n * Key date-time classes also implement the {@link TemporalAdjuster} interface,\n * such as {@link Month} and {@link MonthDay}.\n * The adjuster is responsible for handling special cases, such as the varying\n * lengths of month and leap years.\n *\n * For example this code returns a date on the last day of July:\n *
\n     *  import static org.threeten.bp.Month.*;\n     *  import static org.threeten.bp.temporal.Adjusters.*;\n     *\n     *  result = localDate.with(JULY).with(lastDayOfMonth());\n     * 
\n *\n * The result of this method is obtained by invoking the\n * {@link TemporalAdjuster.adjustInto} method on the\n * specified adjuster passing `this` as the argument.\n *\n * @param {!TemporalAdjuster} adjuster - the adjuster to use, not null\n * @return {LocalDate} a {@link LocalDate} based on `this` with the adjustment made, not null\n * @throws {DateTimeException} if the adjustment cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n withAdjuster(adjuster) {\n requireNonNull(adjuster, 'adjuster');\n // optimizations\n if (adjuster instanceof LocalDate) {\n return adjuster;\n }\n assert(typeof adjuster.adjustInto === 'function', 'adjuster', IllegalArgumentException);\n return adjuster.adjustInto(this);\n }\n\n /**\n * Returns a copy of this date with the specified field set to a new value.\n *\n * This returns a new {@link LocalDate}, based on this one, with the value\n * for the specified field changed.\n * This can be used to change any supported field, such as the year, month or day-of-month.\n * If it is not possible to set the value, because the field is not supported or for\n * some other reason, an exception is thrown.\n *\n * In some cases, changing the specified field can cause the resulting date to become invalid,\n * such as changing the month from 31st January to February would make the day-of-month invalid.\n * In cases like this, the field is responsible for resolving the date. Typically it will choose\n * the previous valid date, which would be the last valid day of February in this example.\n *\n * If the field is a {@link ChronoField} then the adjustment is implemented here.\n * The supported fields behave as follows:\n *\n * * {@link DAY_OF_WEEK} -\n * Returns a {@link LocalDate} with the specified day-of-week.\n * The date is adjusted up to 6 days forward or backward within the boundary\n * of a Monday to Sunday week.\n * * {@link ALIGNED_DAY_OF_WEEK_IN_MONTH} -\n * Returns a {@link LocalDate} with the specified aligned-day-of-week.\n * The date is adjusted to the specified month-based aligned-day-of-week.\n * Aligned weeks are counted such that the first week of a given month starts\n * on the first day of that month.\n * This may cause the date to be moved up to 6 days into the following month.\n * * {@link ALIGNED_DAY_OF_WEEK_IN_YEAR} -\n * Returns a {@link LocalDate} with the specified aligned-day-of-week.\n * The date is adjusted to the specified year-based aligned-day-of-week.\n * Aligned weeks are counted such that the first week of a given year starts\n * on the first day of that year.\n * This may cause the date to be moved up to 6 days into the following year.\n * * {@link DAY_OF_MONTH} -\n * Returns a {@link LocalDate} with the specified day-of-month.\n * The month and year will be unchanged. If the day-of-month is invalid for the\n * year and month, then a {@link DateTimeException} is thrown.\n * * {@link DAY_OF_YEAR} -\n * Returns a {@link LocalDate} with the specified day-of-year.\n * The year will be unchanged. If the day-of-year is invalid for the\n * year, then a {@link DateTimeException} is thrown.\n * * {@link EPOCH_DAY} -\n * Returns a {@link LocalDate} with the specified epoch-day.\n * This completely replaces the date and is equivalent to {@link ofEpochDay}.\n * * {@link ALIGNED_WEEK_OF_MONTH} -\n * Returns a {@link LocalDate} with the specified aligned-week-of-month.\n * Aligned weeks are counted such that the first week of a given month starts\n * on the first day of that month.\n * This adjustment moves the date in whole week chunks to match the specified week.\n * The result will have the same day-of-week as this date.\n * This may cause the date to be moved into the following month.\n * * {@link ALIGNED_WEEK_OF_YEAR} -\n * Returns a {@link LocalDate} with the specified aligned-week-of-year.\n * Aligned weeks are counted such that the first week of a given year starts\n * on the first day of that year.\n * This adjustment moves the date in whole week chunks to match the specified week.\n * The result will have the same day-of-week as this date.\n * This may cause the date to be moved into the following year.\n * * {@link MONTH_OF_YEAR} -\n * Returns a {@link LocalDate} with the specified month-of-year.\n * The year will be unchanged. The day-of-month will also be unchanged,\n * unless it would be invalid for the new month and year. In that case, the\n * day-of-month is adjusted to the maximum valid value for the new month and year.\n * * {@link PROLEPTIC_MONTH} -\n * Returns a {@link LocalDate} with the specified proleptic-month.\n * The day-of-month will be unchanged, unless it would be invalid for the new month\n * and year. In that case, the day-of-month is adjusted to the maximum valid value\n * for the new month and year.\n * * {@link YEAR_OF_ERA} -\n * Returns a {@link LocalDate} with the specified year-of-era.\n * The era and month will be unchanged. The day-of-month will also be unchanged,\n * unless it would be invalid for the new month and year. In that case, the\n * day-of-month is adjusted to the maximum valid value for the new month and year.\n * * {@link YEAR} -\n * Returns a {@link LocalDate} with the specified year.\n * The month will be unchanged. The day-of-month will also be unchanged,\n * unless it would be invalid for the new month and year. In that case, the\n * day-of-month is adjusted to the maximum valid value for the new month and year.\n * * {@link ERA} -\n * Returns a {@link LocalDate} with the specified era.\n * The year-of-era and month will be unchanged. The day-of-month will also be unchanged,\n * unless it would be invalid for the new month and year. In that case, the\n * day-of-month is adjusted to the maximum valid value for the new month and year.\n *\n * In all cases, if the new value is outside the valid range of values for the field\n * then a {@link DateTimeException} will be thrown.\n *\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.adjustInto}\n * passing `this` as the argument. In this case, the field determines\n * whether and how to adjust the instant.\n *\n * @param {TemporalField} field - the field to set in the result, not null\n * @param {number} newValue - the new value of the field in the result\n * @return {LocalDate} a {@link LocalDate} based on `this` with the specified field set, not null\n * @throws {DateTimeException} if the field cannot be set\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n withFieldValue(field, newValue) {\n assert(field != null, 'field', NullPointerException);\n if (field instanceof ChronoField) {\n const f = field;\n f.checkValidValue(newValue);\n switch (f) {\n case ChronoField.DAY_OF_WEEK: return this.plusDays(newValue - this.dayOfWeek().value());\n case ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH: return this.plusDays(newValue - this.getLong(ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH));\n case ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR: return this.plusDays(newValue - this.getLong(ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR));\n case ChronoField.DAY_OF_MONTH: return this.withDayOfMonth(newValue);\n case ChronoField.DAY_OF_YEAR: return this.withDayOfYear(newValue);\n case ChronoField.EPOCH_DAY: return LocalDate.ofEpochDay(newValue);\n case ChronoField.ALIGNED_WEEK_OF_MONTH: return this.plusWeeks(newValue - this.getLong(ChronoField.ALIGNED_WEEK_OF_MONTH));\n case ChronoField.ALIGNED_WEEK_OF_YEAR: return this.plusWeeks(newValue - this.getLong(ChronoField.ALIGNED_WEEK_OF_YEAR));\n case ChronoField.MONTH_OF_YEAR: return this.withMonth(newValue);\n case ChronoField.PROLEPTIC_MONTH: return this.plusMonths(newValue - this.getLong(ChronoField.PROLEPTIC_MONTH));\n case ChronoField.YEAR_OF_ERA: return this.withYear((this._year >= 1 ? newValue : 1 - newValue));\n case ChronoField.YEAR: return this.withYear(newValue);\n case ChronoField.ERA: return (this.getLong(ChronoField.ERA) === newValue ? this : this.withYear(1 - this._year));\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.adjustInto(this, newValue);\n }\n\n /**\n * Returns a copy of this date with the year altered.\n * If the day-of-month is invalid for the year, it will be changed to the last valid day of the month.\n *\n * @param {!number} year the year to set in the result, from {@link Year.MIN_VALUE} to {@link Year.MAX_VALUE}\n * @return {LocalDate} a {@link LocalDate} based on this date with the requested year, not null\n * @throws {DateTimeException} if the year value is invalid\n */\n withYear(year) {\n if (this._year === year) {\n return this;\n }\n ChronoField.YEAR.checkValidValue(year);\n return LocalDate._resolvePreviousValid(year, this._month, this._day);\n }\n\n /**\n * Returns a copy of this date with the month-of-year altered.\n * If the day-of-month is invalid for the year, it will be changed to the last valid day of the month.\n *\n * @param {!(Month|number)} month - the month-of-year to set in the result, from 1 (January) to 12 (December)\n * @return {LocalDate} a {@link LocalDate} based on this date with the requested month, not null\n * @throws {DateTimeException} if the month-of-year value is invalid\n */\n withMonth(month) {\n const m = (month instanceof Month) ? month.value() : month;\n if (this._month === m) {\n return this;\n }\n ChronoField.MONTH_OF_YEAR.checkValidValue(m);\n return LocalDate._resolvePreviousValid(this._year, m, this._day);\n }\n\n /**\n * Returns a copy of this {@link LocalDate} with the day-of-month altered.\n *\n * If the resulting date is invalid, an exception is thrown.\n *\n * @param {!number} dayOfMonth - the day-of-month to set in the result, from 1 to 28-31\n * @return {LocalDate} based on this date with the requested day, not null\n * @throws {DateTimeException} if the day-of-month value is invalid,\n * or if the day-of-month is invalid for the month-year\n */\n withDayOfMonth(dayOfMonth) {\n if (this._day === dayOfMonth) {\n return this;\n }\n return LocalDate.of(this._year, this._month, dayOfMonth);\n }\n\n /**\n * Returns a copy of this date with the day-of-year altered.\n * If the resulting date is invalid, an exception is thrown.\n *\n * @param dayOfYear the day-of-year to set in the result, from 1 to 365-366\n * @return {LocalDate} a {@link LocalDate} based on this date with the requested day, not null\n * @throws {DateTimeException} if the day-of-year value is invalid\n * @throws {DateTimeException} if the day-of-year is invalid for the year\n */\n withDayOfYear(dayOfYear) {\n if (this.dayOfYear() === dayOfYear) {\n return this;\n }\n return LocalDate.ofYearDay(this._year, dayOfYear);\n }\n\n /**\n * Returns a copy of this date with the specified period added.\n *\n * This method returns a new date based on this date with the specified period added.\n * The amount is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link LocalDate.plusAmountUnit}.\n *\n * @param {!TemporalAmount} amount - the amount to add, not null\n * @return {LocalDate} a {@link LocalDate} based on this date with the addition made, not null\n * @throws {DateTimeException} if the addition cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n plusAmount(amount) {\n requireNonNull(amount, 'amount');\n return amount.addTo(this);\n }\n\n /**\n * Returns a copy of this date with the specified period added.\n *\n * This method returns a new date based on this date with the specified period added.\n * This can be used to add any period that is defined by a unit, for example to add years, months or days.\n * The unit is responsible for the details of the calculation, including the resolution\n * of any edge cases in the calculation.\n *\n * @param {!number} amountToAdd - the amount of the unit to add to the result, may be negative\n * @param {!TemporalUnit} unit - the unit of the period to add, not null\n * @return {LocalDate} a {@link LocalDate} based on this date with the specified period added, not null\n * @throws {DateTimeException} if the unit cannot be added to this type\n */\n plusAmountUnit(amountToAdd, unit) {\n requireNonNull(amountToAdd, 'amountToAdd');\n requireNonNull(unit, 'unit');\n if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.DAYS: return this.plusDays(amountToAdd);\n case ChronoUnit.WEEKS: return this.plusWeeks(amountToAdd);\n case ChronoUnit.MONTHS: return this.plusMonths(amountToAdd);\n case ChronoUnit.YEARS: return this.plusYears(amountToAdd);\n case ChronoUnit.DECADES: return this.plusYears(MathUtil.safeMultiply(amountToAdd, 10));\n case ChronoUnit.CENTURIES: return this.plusYears(MathUtil.safeMultiply(amountToAdd, 100));\n case ChronoUnit.MILLENNIA: return this.plusYears(MathUtil.safeMultiply(amountToAdd, 1000));\n case ChronoUnit.ERAS: return this.with(ChronoField.ERA, MathUtil.safeAdd(this.getLong(ChronoField.ERA), amountToAdd));\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n return unit.addTo(this, amountToAdd);\n }\n\n /**\n * Returns a copy of this {@link LocalDate} with the specified period in years added.\n *\n * This method adds the specified amount to the years field in three steps:\n *\n * 1. Add the input years to the year field\n * 2. Check if the resulting date would be invalid\n * 3. Adjust the day-of-month to the last valid day if necessary\n *\n * For example, 2008-02-29 (leap year) plus one year would result in the\n * invalid date 2009-02-29 (standard year). Instead of returning an invalid\n * result, the last valid day of the month, 2009-02-28, is selected instead.\n *\n * @param {!number} yearsToAdd - the years to add, may be negative\n * @return {LocalDate} a {@link LocalDate} based on this date with the years added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusYears(yearsToAdd) {\n if (yearsToAdd === 0) {\n return this;\n }\n const newYear = ChronoField.YEAR.checkValidIntValue(this._year + yearsToAdd); // safe overflow\n return LocalDate._resolvePreviousValid(newYear, this._month, this._day);\n }\n\n /**\n * Returns a copy of this {@link LocalDate} with the specified period in months added.\n *\n * This method adds the specified amount to the months field in three steps:\n *\n * 1. Add the input months to the month-of-year field\n * 2. Check if the resulting date would be invalid\n * 3. Adjust the day-of-month to the last valid day if necessary\n *\n * For example, 2007-03-31 plus one month would result in the invalid date\n * 2007-04-31. Instead of returning an invalid result, the last valid day\n * of the month, 2007-04-30, is selected instead.\n *\n * @param {number} monthsToAdd - the months to add, may be negative\n * @return {LocalDate} a {@link LocalDate} based on this date with the months added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusMonths(monthsToAdd) {\n if (monthsToAdd === 0) {\n return this;\n }\n const monthCount = this._year * 12 + (this._month - 1);\n const calcMonths = monthCount + monthsToAdd; // safe overflow\n const newYear = ChronoField.YEAR.checkValidIntValue(MathUtil.floorDiv(calcMonths, 12));\n const newMonth = MathUtil.floorMod(calcMonths, 12) + 1;\n return LocalDate._resolvePreviousValid(newYear, newMonth, this._day);\n }\n\n /**\n * Returns a copy of this {@link LocalDate} with the specified period in weeks added.\n *\n * This method adds the specified amount in weeks to the days field incrementing\n * the month and year fields as necessary to ensure the result remains valid.\n * The result is only invalid if the maximum/minimum year is exceeded.\n *\n * For example, 2008-12-31 plus one week would result in 2009-01-07.\n *\n * @param {!number} weeksToAdd - the weeks to add, may be negative\n * @return {LocalDate} a {@link LocalDate} based on this date with the weeks added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusWeeks(weeksToAdd) {\n return this.plusDays(MathUtil.safeMultiply(weeksToAdd, 7));\n }\n\n\n /**\n * Returns a copy of this LocalDate with the specified number of days added.\n *\n * This method adds the specified amount to the days field incrementing the\n * month and year fields as necessary to ensure the result remains valid.\n * The result is only invalid if the maximum/minimum year is exceeded.\n *\n * For example, 2008-12-31 plus one day would result in 2009-01-01.\n *\n * @param {number} daysToAdd - the days to add, may be negative\n * @return {LocalDate} a LocalDate based on this date with the days added, not null\n * @throws AssertionError if the result exceeds the supported date range\n */\n plusDays(daysToAdd) {\n if (daysToAdd === 0) {\n return this;\n }\n const mjDay = MathUtil.safeAdd(this.toEpochDay(), daysToAdd);\n return LocalDate.ofEpochDay(mjDay);\n }\n\n /**\n * Returns a copy of this date with the specified period subtracted.\n *\n * This method returns a new date based on this date with the specified period subtracted.\n * The amount is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link minus}.\n *\n * @param {!TemporalAmount} amount - the amount to subtract, not null\n * @return {LocalDate} a {@link LocalDate} based on this date with the subtraction made, not null\n * @throws {DateTimeException} if the subtraction cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n minusAmount(amount) {\n requireNonNull(amount, 'amount');\n return amount.subtractFrom(this);\n }\n\n /**\n * Returns a copy of this date with the specified period subtracted.\n *\n * This method returns a new date based on this date with the specified period subtracted.\n * This can be used to subtract any period that is defined by a unit, for example to subtract years, months or days.\n * The unit is responsible for the details of the calculation, including the resolution\n * of any edge cases in the calculation.\n *\n * @param {!number} amountToSubtract - the amount of the unit to subtract from the result, may be negative\n * @param {!TemporalUnit} unit the unit of the period to subtract, not null\n * @return {LocalDate} a {@link LocalDate} based on this date with the specified period subtracted, not null\n * @throws {DateTimeException} if the unit cannot be added to this type\n */\n minusAmountUnit(amountToSubtract, unit) {\n requireNonNull(amountToSubtract, 'amountToSubtract');\n requireNonNull(unit, 'unit');\n return this.plusAmountUnit(-1 * amountToSubtract, unit);\n }\n\n /**\n * Returns a copy of this {@link LocalDate} with the specified period in years subtracted.\n *\n * This method subtracts the specified amount from the years field in three steps:\n *\n * 1. Subtract the input years to the year field\n * 2. Check if the resulting date would be invalid\n * 3. Adjust the day-of-month to the last valid day if necessary\n *\n * For example, 2008-02-29 (leap year) minus one year would result in the\n * invalid date 2007-02-29 (standard year). Instead of returning an invalid\n * result, the last valid day of the month, 2007-02-28, is selected instead.\n *\n * @param {!number} yearsToSubtract - the years to subtract, may be negative\n * @return {LocalDate} a {@link LocalDate} based on this date with the years subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusYears(yearsToSubtract) {\n return this.plusYears(yearsToSubtract * -1);\n }\n\n /**\n * Returns a copy of this {@link LocalDate} with the specified period in months subtracted.\n *\n * This method subtracts the specified amount from the months field in three steps:\n *\n * 1. Subtract the input months to the month-of-year field\n * 2. Check if the resulting date would be invalid\n * 3. Adjust the day-of-month to the last valid day if necessary\n *\n * For example, 2007-03-31 minus one month would result in the invalid date\n * 2007-02-31. Instead of returning an invalid result, the last valid day\n * of the month, 2007-02-28, is selected instead.\n *\n * @param {!number} monthsToSubtract - the months to subtract, may be negative\n * @return {LocalDate} a {@link LocalDate} based on this date with the months subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusMonths(monthsToSubtract) {\n return this.plusMonths(monthsToSubtract * -1);\n }\n\n /**\n * Returns a copy of this {@link LocalDate} with the specified period in weeks subtracted.\n *\n * This method subtracts the specified amount in weeks from the days field decrementing\n * the month and year fields as necessary to ensure the result remains valid.\n * The result is only invalid if the maximum/minimum year is exceeded.\n *\n * For example, 2009-01-07 minus one week would result in 2008-12-31.\n *\n * @param {!number} weeksToSubtract - the weeks to subtract, may be negative\n * @return {LocalDate} a {@link LocalDate} based on this date with the weeks subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusWeeks(weeksToSubtract) {\n return this.plusWeeks(weeksToSubtract * -1);\n }\n\n /*\n * Returns a copy of this LocalDate with the specified number of days subtracted.\n *\n * This method subtracts the specified amount from the days field decrementing the\n * month and year fields as necessary to ensure the result remains valid.\n * The result is only invalid if the maximum/minimum year is exceeded.\n *\n * For example, 2009-01-01 minus one day would result in 2008-12-31.\n *\n * @param {number} daysToSubtract - the days to subtract, may be negative\n * @return {LocalDate} a LocalDate based on this date with the days subtracted, not null\n * @throws AssertionError if the result exceeds the supported date range\n */\n minusDays(daysToSubtract) {\n return this.plusDays(daysToSubtract * -1);\n }\n\n /**\n * Queries this date using the specified query.\n *\n * This queries this date using the specified query strategy object.\n * The {@link TemporalQuery} object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n *\n * The result of this method is obtained by invoking the\n * {@link TemporalQuery#queryFrom} method on the\n * specified query passing `this` as the argument.\n *\n * @param {TemporalQuery} query - the query to invoke, not null\n * @return the query result, null may be returned (defined by the query)\n * @throws {DateTimeException} if unable to query (defined by the query)\n * @throws {ArithmeticException} if numeric overflow occurs (defined by the query)\n */\n query(query) {\n requireNonNull(query, 'query');\n if (query === TemporalQueries.localDate()) {\n return this;\n }\n return super.query(query);\n }\n\n /**\n * Adjusts the specified temporal object to have the same date as this object.\n *\n * This returns a temporal object of the same observable type as the input\n * with the date changed to be the same as this.\n *\n * The adjustment is equivalent to using {@link Temporal#with}\n * passing {@link ChronoField.EPOCH_DAY} as the field.\n *\n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal#with}:\n *
\n     *   // these two lines are equivalent, but the second approach is recommended\n     *   temporal = thisLocalDate.adjustInto(temporal);\n     *   temporal = temporal.with(thisLocalDate);\n     * 
\n *\n * @param {!TemporalAdjuster} temporal - the target object to be adjusted, not null\n * @return the adjusted object, not null\n * @throws {DateTimeException} if unable to make the adjustment\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n adjustInto(temporal) {\n return super.adjustInto(temporal);\n }\n\n /**\n * function overloading for {@link LocalDate.until}\n *\n * called with 1 (or less) arguments {{@link LocalDate.until1}} is called\n * otherwise {@link LocalDate.until2}\n *\n * @param {!TemporalAccessor} p1\n * @param {TemporalUnit} p2 - not null if called with 2 arguments\n * @return {number|Period}\n */\n until(p1, p2){\n if(arguments.length < 2){\n return this.until1(p1);\n } else {\n return this.until2(p1, p2);\n }\n }\n\n /**\n * Calculates the period between this date and another date in\n * terms of the specified unit.\n *\n * This calculates the period between two dates in terms of a single unit.\n * The start and end points are `this` and the specified date.\n * The result will be negative if the end is before the start.\n * The {@link Temporal} passed to this method must be a {@link LocalDate}.\n * For example, the period in days between two dates can be calculated\n * using {@link startDate.until}.\n *\n * The calculation returns a whole number, representing the number of\n * complete units between the two dates.\n * For example, the period in months between 2012-06-15 and 2012-08-14\n * will only be one month as it is one day short of two months.\n *\n * This method operates in association with {@link TemporalUnit#between}.\n * The result of this method is a `long` representing the amount of\n * the specified unit. By contrast, the result of {@link between} is an\n * object that can be used directly in addition/subtraction:\n *
\n     *   long period = start.until(end, MONTHS);   // this method\n     *   dateTime.plus(MONTHS.between(start, end));      // use in plus/minus\n     * 
\n *\n * The calculation is implemented in this method for {@link ChronoUnit}.\n * The units {@link DAYS}, {@link WEEKS}, {@link MONTHS}, {@link YEARS},\n * {@link DECADES}, {@link CENTURIES}, {@link MILLENNIA} and {@link ERAS}\n * are supported. Other {@link ChronoUnit} values will throw an exception.\n *\n * If the unit is not a {@link ChronoUnit}, then the result of this method\n * is obtained by invoking {@link TemporalUnit.between}\n * passing `this` as the first argument and the input temporal as\n * the second argument.\n *\n * @param {!TemporalAccessor} endExclusive - the end date, which is converted to a {@link LocalDate}, not null\n * @param {!TemporalUnit} unit - the unit to measure the period in, not null\n * @return {number} the amount of the period between this date and the end date\n * @throws {DateTimeException} if the period cannot be calculated\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n until2(endExclusive, unit) {\n const end = LocalDate.from(endExclusive);\n if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.DAYS: return this.daysUntil(end);\n case ChronoUnit.WEEKS: return MathUtil.intDiv(this.daysUntil(end), 7);\n case ChronoUnit.MONTHS: return this._monthsUntil(end);\n case ChronoUnit.YEARS: return MathUtil.intDiv(this._monthsUntil(end), 12);\n case ChronoUnit.DECADES: return MathUtil.intDiv(this._monthsUntil(end), 120);\n case ChronoUnit.CENTURIES: return MathUtil.intDiv(this._monthsUntil(end), 1200);\n case ChronoUnit.MILLENNIA: return MathUtil.intDiv(this._monthsUntil(end), 12000);\n case ChronoUnit.ERAS: return end.getLong(ChronoField.ERA) - this.getLong(ChronoField.ERA);\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n return unit.between(this, end);\n }\n\n /**\n *\n * @param {!LocalDate} end\n * @returns {number}\n * @protected\n */\n daysUntil(end) {\n return end.toEpochDay() - this.toEpochDay(); // no overflow\n }\n\n /**\n *\n * @param {!LocalDate} end\n * @returns {number}\n * @private\n */\n _monthsUntil(end) {\n const packed1 = this._prolepticMonth() * 32 + this.dayOfMonth(); // no overflow\n const packed2 = end._prolepticMonth() * 32 + end.dayOfMonth(); // no overflow\n return MathUtil.intDiv((packed2 - packed1), 32);\n }\n\n /**\n * Calculates the period between this date and another date as a {@link Period}.\n *\n * This calculates the period between two dates in terms of years, months and days.\n * The start and end points are `this` and the specified date.\n * The result will be negative if the end is before the start.\n *\n * The calculation is performed using the ISO calendar system.\n * If necessary, the input date will be converted to ISO.\n *\n * The start date is included, but the end date is not.\n * The period is calculated by removing complete months, then calculating\n * the remaining number of days, adjusting to ensure that both have the same sign.\n * The number of months is then normalized into years and months based on a 12 month year.\n * A month is considered to be complete if the end day-of-month is greater\n * than or equal to the start day-of-month.\n * For example, from `2010-01-15` to `2011-03-18` is \"1 year, 2 months and 3 days\".\n *\n * The result of this method can be a negative period if the end is before the start.\n * The negative sign will be the same in each of year, month and day.\n *\n * There are two equivalent ways of using this method.\n * The first is to invoke this method.\n * The second is to use {@link Period#between}:\n *
\n     *   // these two lines are equivalent\n     *   period = start.until(end);\n     *   period = Period.between(start, end);\n     * 
\n * The choice should be made based on which makes the code more readable.\n *\n * @param {!TemporalAccessor} endDate - the end date, exclusive, which may be in any chronology, not null\n * @return {Period} the period between this date and the end date, not null\n */\n until1(endDate) {\n const end = LocalDate.from(endDate);\n let totalMonths = end._prolepticMonth() - this._prolepticMonth(); // safe\n let days = end._day - this._day;\n if (totalMonths > 0 && days < 0) {\n totalMonths--;\n const calcDate = this.plusMonths(totalMonths);\n days = (end.toEpochDay() - calcDate.toEpochDay()); // safe\n } else if (totalMonths < 0 && days > 0) {\n totalMonths++;\n days -= end.lengthOfMonth();\n }\n const years = MathUtil.intDiv(totalMonths, 12); // safe\n const months = MathUtil.intMod(totalMonths, 12); // safe\n return Period.of(years, months, days);\n }\n\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link LocalDate.atTime}\n *\n * if called with 1 argument {@link LocalDate.atTime1} is called\n * otherwise {@link LocalDate.atTime4}\n *\n * @return {LocalDateTime|OffsetDateTime} the local date-time formed from this date and the specified params\n */\n atTime(){\n if(arguments.length===1){\n return this.atTime1.apply(this, arguments);\n } else {\n return this.atTime4.apply(this, arguments);\n }\n }\n\n /**\n * Combines this date with a time to create a {@link LocalDateTime}.\n *\n * This returns a {@link LocalDateTime} formed from this date at the specified time.\n * All possible combinations of date and time are valid.\n *\n * @param {LocalTime} time - the time to combine with, not null\n * @return {LocalDateTime|OffsetDateTime} the date-time formed from this date and the specified time, not null\n */\n atTime1(time) {\n requireNonNull(time, 'time');\n if (time instanceof LocalTime) {\n return LocalDateTime.of(this, time);\n } else if (time instanceof OffsetTime) {\n return this._atTimeOffsetTime(time);\n } else {\n throw new IllegalArgumentException('time must be an instance of LocalTime or OffsetTime' +\n (time && time.constructor && time.constructor.name ? ', but is ' + time.constructor.name : ''));\n }\n }\n\n /**\n * Combines this date with a time to create a {@link LocalDateTime}.\n *\n * This returns a {@link LocalDateTime} formed from this date at the\n * specified hour, minute, second and nanosecond.\n * The individual time fields must be within their valid range.\n * All possible combinations of date and time are valid.\n *\n * @param {!number} hour - the hour-of-day to use, from 0 to 23\n * @param {!number} minute - the minute-of-hour to use, from 0 to 59\n * @param {number} [second=0] - the second-of-minute to represent, from 0 to 59\n * @param {number} [nanoOfSecond=0] - the nano-of-second to represent, from 0 to 999,999,999\n * @return {LocalDateTime} the local date-time formed from this date and the specified time, not null\n * @throws {DateTimeException} if the value of any field is out of range\n */\n atTime4(hour, minute, second=0, nanoOfSecond=0) {\n return this.atTime1(LocalTime.of(hour, minute, second, nanoOfSecond));\n }\n\n /**\n * Combines this date with an offset time to create an {@link OffsetDateTime}.\n *\n * This returns an {@link OffsetDateTime} formed from this date at the specified time.\n * All possible combinations of date and time are valid.\n *\n * @param {OffsetTime} time - the time to combine with, not null\n * @return {OffsetDateTime} the offset date-time formed from this date and the specified time, not null\n */\n _atTimeOffsetTime(time) { // atTime(offsetTime)\n return OffsetDateTime.of(LocalDateTime.of(this, time.toLocalTime()), time.offset());\n }\n\n /**\n * Combines this date with the time of midnight to create a {@link LocalDateTime}\n * at the start of this date.\n *\n * This returns a {@link LocalDateTime} formed from this date at the time of\n * midnight, 00:00, at the start of this date.\n *\n * @param {ZoneId} zone - if zone is not null @see {@link LocalDate.atStartOfDayWithZone}\n * @return {LocalDateTime|ZonedDateTime} the local date-time of midnight at the start of this date, not null\n */\n atStartOfDay(zone) {\n if(zone != null){\n return this.atStartOfDayWithZone(zone);\n } else {\n return LocalDateTime.of(this, LocalTime.MIDNIGHT);\n }\n }\n\n /**\n * Combines this date with a time-zone to create a {@link ZonedDateTime}\n * at the start of the day\n *\n * This returns a {@link ZonedDateTime} formed from this date at the\n * specified zone, with the time set to be the earliest valid time according\n * to the rules in the time-zone.\n *\n * Time-zone rules, such as daylight savings, mean that not every local date-time\n * is valid for the specified zone, thus the local date-time may not be midnight.\n *\n * In most cases, there is only one valid offset for a local date-time.\n * In the case of an overlap, there are two valid offsets, and the earlier one is used,\n * corresponding to the first occurrence of midnight on the date.\n * In the case of a gap, the zoned date-time will represent the instant just after the gap.\n *\n * If the zone ID is a {@link ZoneOffset}, then the result always has a time of midnight.\n *\n * To convert to a specific time in a given time-zone call {@link atTime}\n * followed by {@link LocalDateTime#atZone}.\n *\n * @param {!ZoneId} zone - the zone ID to use, not null\n * @return {ZonedDateTime} the zoned date-time formed from this date and the earliest valid time for the zone, not null\n */\n atStartOfDayWithZone(zone) {\n requireNonNull(zone, 'zone');\n let ldt = this.atTime(LocalTime.MIDNIGHT);\n // need to handle case where there is a gap from 11:30 to 00:30\n // standard ZDT factory would result in 01:00 rather than 00:30\n if (zone instanceof ZoneOffset === false) {\n const trans = zone.rules().transition(ldt);\n if (trans != null && trans.isGap()) {\n ldt = trans.dateTimeAfter();\n }\n }\n return ZonedDateTime.of(ldt, zone);\n }\n\n\n /**\n * Converts this date to the Epoch Day.\n *\n * The Epoch Day count is a simple incrementing count of days where day 0 is 1970-01-01 (ISO).\n * This definition is the same for all chronologies, enabling conversion.\n *\n * @return {number} the Epoch Day equivalent to this date\n */\n toEpochDay() {\n const y = this._year;\n const m = this._month;\n let total = 0;\n total += 365 * y;\n if (y >= 0) {\n total += MathUtil.intDiv(y + 3, 4) - MathUtil.intDiv(y + 99, 100) + MathUtil.intDiv(y + 399, 400);\n } else {\n total -= MathUtil.intDiv(y, -4) - MathUtil.intDiv(y, -100) + MathUtil.intDiv(y, -400);\n }\n total += MathUtil.intDiv(367 * m - 362, 12);\n total += this.dayOfMonth() - 1;\n if (m > 2) {\n total--;\n if (!IsoChronology.isLeapYear(y)) {\n total--;\n }\n }\n return total - DAYS_0000_TO_1970;\n }\n\n /**\n * Compares this date to another date.\n *\n * The comparison is primarily based on the date, from earliest to latest.\n * It is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * If all the dates being compared are instances of {@link LocalDate},\n * then the comparison will be entirely based on the date.\n * If some dates being compared are in different chronologies, then the\n * chronology is also considered, see {@link ChronoLocalDate.compareTo}.\n *\n * @param {!LocalDate} other - the other date to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, LocalDate, 'other');\n return this._compareTo0(other);\n // return super.compareTo(other); if not instanceof LocalDate\n }\n\n /**\n *\n * @param {!LocalDate} otherDate\n * @returns {number}\n * @private\n */\n _compareTo0(otherDate) {\n let cmp = (this._year - otherDate._year);\n if (cmp === 0) {\n cmp = (this._month - otherDate._month);\n if (cmp === 0) {\n cmp = (this._day - otherDate._day);\n }\n }\n return cmp;\n }\n\n /**\n * Checks if this date is after the specified date.\n *\n * This checks to see if this date represents a point on the\n * local time-line after the other date.\n *
\n     *   LocalDate a = LocalDate.of(2012, 6, 30);\n     *   LocalDate b = LocalDate.of(2012, 7, 1);\n     *   a.isAfter(b) == false\n     *   a.isAfter(a) == false\n     *   b.isAfter(a) == true\n     * 
\n *\n * This method only considers the position of the two dates on the local time-line.\n * It does not take into account the chronology, or calendar system.\n * This is different from the comparison in {@link compareTo},\n * but is the same approach as {@link DATE_COMPARATOR}.\n *\n * @param {!LocalDate} other - the other date to compare to, not null\n * @return {boolean} true if this date is after the specified date\n */\n isAfter(other) {\n return this.compareTo(other) > 0;\n // return super.isAfter(other) if not instanceof LocalDate\n }\n\n /**\n * Checks if this date is before the specified date.\n *\n * This checks to see if this date represents a point on the\n * local time-line before the other date.\n *
\n     *   LocalDate a = LocalDate.of(2012, 6, 30);\n     *   LocalDate b = LocalDate.of(2012, 7, 1);\n     *   a.isBefore(b) == true\n     *   a.isBefore(a) == false\n     *   b.isBefore(a) == false\n     * 
\n *\n * This method only considers the position of the two dates on the local time-line.\n * It does not take into account the chronology, or calendar system.\n * This is different from the comparison in {@link compareTo},\n * but is the same approach as {@link DATE_COMPARATOR}.\n *\n * @param {!LocalDate} other - the other date to compare to, not null\n * @return {boolean} true if this date is before the specified date\n */\n isBefore(other) {\n return this.compareTo(other) < 0;\n // return super.isBefore(other) if not instanceof LocalDate\n }\n\n /**\n * Checks if this date is equal to the specified date.\n *\n * This checks to see if this date represents the same point on the\n * local time-line as the other date.\n *
\n     *   LocalDate a = LocalDate.of(2012, 6, 30);\n     *   LocalDate b = LocalDate.of(2012, 7, 1);\n     *   a.isEqual(b) == false\n     *   a.isEqual(a) == true\n     *   b.isEqual(a) == false\n     * 
\n *\n * This method only considers the position of the two dates on the local time-line.\n * It does not take into account the chronology, or calendar system.\n * This is different from the comparison in {@link compareTo}\n * but is the same approach as {@link DATE_COMPARATOR}.\n *\n * @param {!LocalDate} other - the other date to compare to, not null\n * @return {boolean} true if this date is equal to the specified date\n */\n isEqual(other) {\n return this.compareTo(other) === 0;\n // return super.isEqual(other) if not instanceof LocalDate\n }\n\n /**\n * Checks if this date is equal to another date.\n *\n * Compares this LocalDate with another ensuring that the date is the same.\n *\n * Only objects of type LocalDate are compared, other types return false.\n *\n * @param {*} other - the object to check, null returns false\n * @return {boolean} true if this is equal to the other date\n */\n equals(other) {\n if (this === other) {\n return true;\n }\n if (other instanceof LocalDate) {\n return this._compareTo0(other) === 0;\n }\n return false;\n }\n\n /**\n * A hash code for this date.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n const yearValue = this._year;\n const monthValue = this._month;\n const dayValue = this._day;\n return MathUtil.hash((yearValue & 0xFFFFF800) ^ ((yearValue << 11) + (monthValue << 6) + (dayValue)));\n }\n\n /**\n * Outputs this date as a String, such as 2007-12-03.\n * The output will be in the ISO-8601 format uuuu-MM-dd.\n *\n * @return {string} a string representation of this date, not null\n */\n toString() {\n let dayString, monthString, yearString;\n\n const yearValue = this._year;\n const monthValue = this._month;\n const dayValue = this._day;\n\n const absYear = Math.abs(yearValue);\n\n if (absYear < 1000) {\n if (yearValue < 0) {\n yearString = '-' + ('' + (yearValue - 10000)).slice(-4);\n } else {\n yearString = ('' + (yearValue + 10000)).slice(-4);\n }\n } else {\n if (yearValue > 9999) {\n yearString = '+' + yearValue;\n } else {\n yearString = '' + yearValue;\n }\n }\n\n if (monthValue < 10) {\n monthString = '-0' + monthValue;\n } else {\n monthString = '-' + monthValue;\n }\n\n if (dayValue < 10) {\n dayString = '-0' + dayValue;\n } else {\n dayString = '-' + dayValue;\n }\n\n return yearString + monthString + dayString;\n }\n\n /**\n *\n * @return {string} same as {@link LocalDate.toString}\n */\n toJSON() {\n return this.toString();\n }\n\n /**\n * Outputs this date as a string using the formatter.\n *\n * @param {DateTimeFormatter} formatter the formatter to use, not null\n * @return {String} the formatted date string, not null\n * @throws DateTimeException if an error occurs during printing\n */\n format(formatter) {\n requireNonNull(formatter, 'formatter');\n requireInstance(formatter, DateTimeFormatter, 'formatter');\n return super.format(formatter);\n }\n}\n\nexport function _init() {\n /**\n * The minimum supported {@link LocalDate}\n * This could be used by an application as a \"far past\" date.\n */\n LocalDate.MIN = LocalDate.of(YearConstants.MIN_VALUE, 1, 1);\n /**\n * The maximum supported {@link LocalDate}\n * This could be used by an application as a \"far future\" date.\n */\n LocalDate.MAX = LocalDate.of(YearConstants.MAX_VALUE, 12, 31);\n /**\n * The date at epoch day 0, that is 1970-01-01.\n */\n LocalDate.EPOCH_0 = LocalDate.ofEpochDay(0);\n\n LocalDate.FROM = createTemporalQuery('LocalDate.FROM', (temporal) => {\n return LocalDate.from(temporal);\n });\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {requireNonNull, requireInstance} from '../assert';\nimport {MathUtil} from '../MathUtil';\n\nimport {LocalDate} from '../LocalDate';\nimport {Instant} from '../Instant';\nimport {ZoneOffset} from '../ZoneOffset';\nimport {ChronoUnit} from '../temporal/ChronoUnit';\nimport {ChronoField} from '../temporal/ChronoField';\nimport {DefaultInterfaceTemporal} from '../temporal/DefaultInterfaceTemporal';\nimport {TemporalQueries} from '../temporal/TemporalQueries';\n\n/**\n * A date-time without a time-zone in an arbitrary chronology, intended\n * for advanced globalization use cases.\n *\n * **Most applications should declare method signatures, fields and variables\n * as {@link LocalDateTime}, not this interface.**\n *\n * A {@link ChronoLocalDateTime} is the abstract representation of a local date-time\n * where the {@link Chronology}, or calendar system, is pluggable.\n * The date-time is defined in terms of fields expressed by {@link TemporalField},\n * where most common implementations are defined in {@link ChronoField}.\n * The chronology defines how the calendar system operates and the meaning of\n * the standard fields.\n *\n * #### When to use this interface\n *\n * The design of the API encourages the use of {@link LocalDateTime} rather than this\n * interface, even in the case where the application needs to deal with multiple\n * calendar systems. The rationale for this is explored in detail in {@link ChronoLocalDate}.\n *\n * Ensure that the discussion in {@link ChronoLocalDate} has been read and understood\n * before using this interface.\n *\n * ### Specification for implementors\n *\n * This interface must be implemented with care to ensure other classes operate correctly.\n * All implementations that can be instantiated must be final, immutable and thread-safe.\n * Subclasses should be Serializable wherever possible.\n *\n * In JDK 8, this is an interface with default methods.\n * Since there are no default methods in JDK 7, an abstract class is used.\n *\n * @param D the date type\n */\nexport class ChronoLocalDateTime extends DefaultInterfaceTemporal {\n /* \n extends DefaultInterfaceTemporal\n implements Temporal, TemporalAdjuster, Comparable> */\n\n //-----------------------------------------------------------------------\n /**\n * Gets the chronology of this date-time.\n *\n * The {@link Chronology} represents the calendar system in use.\n * The era and other fields in {@link ChronoField} are defined by the chronology.\n *\n * @return the chronology, not null\n */\n chronology() {\n return this.toLocalDate().chronology();\n }\n\n /**\n *\n * @param {TemporalQuery} query\n * @returns {*}\n */\n query(query) {\n if (query === TemporalQueries.chronology()) {\n return this.chronology();\n } else if (query === TemporalQueries.precision()) {\n return ChronoUnit.NANOS;\n } else if (query === TemporalQueries.localDate()) {\n return LocalDate.ofEpochDay(this.toLocalDate().toEpochDay());\n } else if (query === TemporalQueries.localTime()) {\n return this.toLocalTime();\n } else if (query === TemporalQueries.zone() || query === TemporalQueries.zoneId() || query === TemporalQueries.offset()) {\n return null;\n }\n return super.query(query);\n }\n\n adjustInto(temporal) {\n return temporal\n .with(ChronoField.EPOCH_DAY, this.toLocalDate().toEpochDay())\n .with(ChronoField.NANO_OF_DAY, this.toLocalTime().toNanoOfDay());\n }\n\n //-----------------------------------------------------------------------\n /**\n * Converts this date-time to an {@link Instant}.\n *\n * This combines this local date-time and the specified offset to form\n * an {@link Instant}.\n *\n * @param {ZoneOffset} offset the offset to use for the conversion, not null\n * @return {Instant} an {@link Instant} representing the same instant, not null\n */\n toInstant(offset) {\n requireInstance(offset, ZoneOffset, 'zoneId');\n return Instant.ofEpochSecond(this.toEpochSecond(offset), this.toLocalTime().nano());\n }\n\n /**\n * Converts this date-time to the number of seconds from the epoch\n * of 1970-01-01T00:00:00Z.\n *\n * This combines this local date-time and the specified offset to calculate the\n * epoch-second value, which is the number of elapsed seconds from 1970-01-01T00:00:00Z.\n * Instants on the time-line after the epoch are positive, earlier are negative.\n *\n * @param {ZoneOffset} offset the offset to use for the conversion, not null\n * @return {number} the number of seconds from the epoch of 1970-01-01T00:00:00Z\n */\n toEpochSecond(offset) {\n requireNonNull(offset, 'offset');\n const epochDay = this.toLocalDate().toEpochDay();\n let secs = epochDay * 86400 + this.toLocalTime().toSecondOfDay();\n secs -= offset.totalSeconds();\n return MathUtil.safeToInt(secs);\n }\n\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {MathUtil} from './MathUtil';\nimport {assert, requireNonNull, requireInstance} from './assert';\nimport {DateTimeException, UnsupportedTemporalTypeException, IllegalArgumentException} from './errors';\n\nimport {Clock} from './Clock';\nimport {Instant} from './Instant';\nimport {LocalDate} from './LocalDate';\nimport {LocalTime} from './LocalTime';\nimport {OffsetDateTime} from './OffsetDateTime';\nimport {ZonedDateTime} from './ZonedDateTime';\nimport {ZoneId} from './ZoneId';\nimport {ZoneOffset} from './ZoneOffset';\n\n\nimport {DateTimeFormatter} from './format/DateTimeFormatter';\nimport {ChronoField} from './temporal/ChronoField';\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {TemporalQueries} from './temporal/TemporalQueries';\nimport {createTemporalQuery} from './temporal/TemporalQuery';\n\nimport {ChronoLocalDateTime} from './chrono/ChronoLocalDateTime';\n\n/**\n * A date-time without a time-zone in the ISO-8601 calendar system,\n * such as `2007-12-03T10:15:30`.\n *\n * {@link LocalDateTime} is an immutable date-time object that represents a date-time,\n * often viewed as year-month-day-hour-minute-second. Other date and time fields,\n * such as day-of-year, day-of-week and week-of-year, can also be accessed.\n * Time is represented to nanosecond precision.\n * For example, the value '2nd October 2007 at 13:45.30.123456789' can be\n * stored in a {@link LocalDateTime}.\n *\n * This class does not store or represent a time-zone.\n * Instead, it is a description of the date, as used for birthdays, combined with\n * the local time as seen on a wall clock.\n * It cannot represent an instant on the time-line without additional information\n * such as an offset or time-zone.\n *\n * The ISO-8601 calendar system is the modern civil calendar system used today\n * in most of the world. It is equivalent to the proleptic Gregorian calendar\n * system, in which today's rules for leap years are applied for all time.\n * For most applications written today, the ISO-8601 rules are entirely suitable.\n * However, any application that makes use of historical dates, and requires them\n * to be accurate will find the ISO-8601 approach unsuitable.\n *\n * ### Static properties of Class {@link LocalTime}\n *\n * LocalDateTime.MIN\n *\n * The minimum supported {@link LocalDateTime}, '-999999999-01-01T00:00:00'.\n * This is the local date-time of midnight at the start of the minimum date.\n * This combines {@link LocalDate#MIN} and {@link LocalTime#MIN}.\n * This could be used by an application as a 'far past' date-time.\n *\n * LocalDateTime.MAX\n *\n * The maximum supported {@link LocalDateTime}, '+999999999-12-31T23:59:59.999999999'.\n * This is the local date-time just before midnight at the end of the maximum date.\n * This combines {@link LocalDate#MAX} and {@link LocalTime#MAX}.\n * This could be used by an application as a 'far future' date-time.\n *\n */\nexport class LocalDateTime extends ChronoLocalDateTime\n/** extends ChronoLocalDateTime\nimplements Temporal, TemporalAdjuster, Serializable */ {\n\n\n /**\n * Obtains the current date-time from from the specified clock or the system clock in the specified time-zone.\n *\n * If the argument is an instance of Clock this will query the specified clock to obtain the current date-time.\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using dependency injection.\n *\n * If the argument is an instance of ZoneId this will query the system clock (see {@link Clock#system}) to obtain the current date-time.\n * Specifying the time-zone avoids dependence on the default time-zone.\n *\n * If nor argument is applied, the system default time zone is used to obtain the current date-time.\n *\n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @param {Clock|ZoneId} clockOrZone - the zone ID or clock to use, if null Clock.systemDefaultZone() is used.\n * @return {LocalDateTime} the current date-time using the system clock, not null\n */\n static now(clockOrZone) {\n if (clockOrZone == null){\n return LocalDateTime._now(Clock.systemDefaultZone());\n } else if (clockOrZone instanceof Clock){\n return LocalDateTime._now(clockOrZone);\n } else {\n return LocalDateTime._now(Clock.system(clockOrZone));\n }\n }\n\n /**\n * Obtains the current date-time from the specified clock.\n *\n * This will query the specified clock to obtain the current date-time.\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using dependency injection.\n *\n * @param {Clock} clock - the clock to use, defaults to Clock.systemDefaultZone()\n * @return {LocalDateTime} the current date-time, not null\n */\n static _now(clock) {\n requireNonNull(clock, 'clock');\n return LocalDateTime.ofInstant(clock.instant(), clock.zone());\n\n // this is an alternative implementation with better performance.\n // const epochMilli = clock.millis();\n // const offset = clock.zone().rules().offsetOfEpochMilli(epochMilli);\n // return LocalDateTime._ofEpochMillis(epochMilli, offset);\n\n }\n\n /**\n * @see comment at {LocalDateTime._now}\n * @param {number} epochMilli\n * @param {ZoneOffset} offset\n * @return {LocalDateTime} the date-time, not null\n *\n */\n static _ofEpochMillis(epochMilli, offset){\n const localSecond = MathUtil.floorDiv(epochMilli, 1000) + offset.totalSeconds();\n const localEpochDay = MathUtil.floorDiv(localSecond, LocalTime.SECONDS_PER_DAY);\n const secsOfDay = MathUtil.floorMod(localSecond, LocalTime.SECONDS_PER_DAY);\n const nanoOfSecond = MathUtil.floorMod(epochMilli, 1000) * 1000000;\n const date = LocalDate.ofEpochDay(localEpochDay);\n const time = LocalTime.ofSecondOfDay(secsOfDay, nanoOfSecond);\n return new LocalDateTime(date, time);\n\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link LocalDateTime.of}\n *\n * if called with 2 arguments and first argument is an instance of LocalDate and second is an\n * instance of LocalTime, then {@link LocalDateTime.ofDateAndTime} is executed.\n *\n * Otherwise {@link LocalDateTime.ofNumbers} is executed.\n *\n * @returns {LocalDateTime}\n */\n static of(){\n if (arguments.length <= 2){\n return LocalDateTime.ofDateAndTime.apply(this, arguments);\n } else {\n return LocalDateTime.ofNumbers.apply(this, arguments);\n }\n }\n /**\n * Obtains an instance of {@link LocalDateTime} from year, month,\n * day, hour, minute, second and nanosecond.\n *\n * The day must be valid for the year and month, otherwise an exception will be thrown.\n *\n * @param {number} [year] - the year to represent, from MIN_YEAR to MAX_YEAR\n * @param {number} [month] - the month-of-year to represent, from 1 to 12 or from a Month\n * @param {number} [dayOfMonth] - the day-of-month to represent, from 1 to 31\n * @param {number} [hour=0] - the hour-of-day to represent, from 0 to 23\n * @param {number} [minute=0] - the minute-of-hour to represent, from 0 to 59\n * @param {number} [second=0] - the second-of-minute to represent, from 0 to 59\n * @param {number} [nanoOfSecond=0] - the nano-of-second to represent, from 0 to 999,999,999\n * @return {LocalDateTime} the local date-time, not null\n * @throws {DateTimeException} if the value of any field is out of range\n * @throws {DateTimeException} if the day-of-month is invalid for the month-year\n */\n static ofNumbers(year, month, dayOfMonth, hour=0, minute=0, second=0, nanoOfSecond=0) {\n const date = LocalDate.of(year, month, dayOfMonth);\n const time = LocalTime.of(hour, minute, second, nanoOfSecond);\n return new LocalDateTime(date, time);\n }\n\n /**\n * Obtains an instance of {@link LocalDateTime} from a date and time.\n *\n * @param {!LocalDate} date - the local date, not null\n * @param {!LocalTime} time - the local time, not null\n * @return {LocalDateTime} the local date-time, not null\n */\n static ofDateAndTime(date, time) {\n requireNonNull(date, 'date');\n requireNonNull(time, 'time');\n return new LocalDateTime(date, time);\n }\n\n //-------------------------------------------------------------------------\n /**\n * Obtains an instance of {@link LocalDateTime} from an {@link Instant} and zone ID.\n *\n * This creates a local date-time based on the specified instant.\n * First, the offset from UTC/Greenwich is obtained using the zone ID and instant,\n * which is simple as there is only one valid offset for each instant.\n * Then, the instant and offset are used to calculate the local date-time.\n *\n * @param {!Instant} instant the instant to create the date-time from, not null\n * @param {!ZoneId} [zone=ZoneId.systemDefault()] the time-zone, which may be an offset, defaults to ZoneId.systemDefault()\n * @return {LocalDateTime} the local date-time, not null\n * @throws {DateTimeException} if the result exceeds the supported range\n */\n static ofInstant(instant, zone=ZoneId.systemDefault()) {\n requireNonNull(instant, 'instant');\n requireInstance(instant, Instant, 'instant');\n requireNonNull(zone, 'zone');\n const offset = zone.rules().offset(instant);\n return LocalDateTime.ofEpochSecond(instant.epochSecond(), instant.nano(), offset);\n }\n\n /**\n * Obtains an instance of {@link LocalDateTime} using seconds from the\n * epoch of 1970-01-01T00:00:00Z.\n *\n * This allows the {@link ChronoField.INSTANT_SECONDS} epoch-second field\n * to be converted to a local date-time. This is primarily intended for\n * low-level conversions rather than general application usage.\n *\n * @param {number} epochSecond - the number of seconds from the epoch of 1970-01-01T00:00:00Z\n * @param {number|!ZoneOffset} nanoOfSecond - the nanosecond within the second, from 0 to 999,999,999\n * @param {ZoneOffset} offset - the zone offset, not null if called with 3 arguments\n * @return {LocalDateTime} the local date-time, not null\n * @throws {DateTimeException} if the result exceeds the supported range\n */\n static ofEpochSecond(epochSecond=0, nanoOfSecond=0, offset) {\n if(arguments.length === 2 && nanoOfSecond instanceof ZoneOffset){\n offset = nanoOfSecond;\n nanoOfSecond = 0;\n }\n requireNonNull(offset, 'offset');\n const localSecond = epochSecond + offset.totalSeconds(); // overflow caught later\n const localEpochDay = MathUtil.floorDiv(localSecond, LocalTime.SECONDS_PER_DAY);\n const secsOfDay = MathUtil.floorMod(localSecond, LocalTime.SECONDS_PER_DAY);\n const date = LocalDate.ofEpochDay(localEpochDay);\n const time = LocalTime.ofSecondOfDay(secsOfDay, nanoOfSecond);\n return new LocalDateTime(date, time);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link LocalDateTime} from a temporal object.\n *\n * A {@link TemporalAccessor} represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of {@link LocalDateTime}.\n *\n * The conversion extracts and combines {@link LocalDate} and {@link LocalTime}.\n *\n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used as a query via method reference, {@link LocalDateTime::from}.\n *\n * @param {!TemporalAccessor} temporal - the temporal object to convert, not null\n * @return {LocalDateTime} {LocalDateTime} the local date-time, not null\n * @throws {DateTimeException} if unable to convert to a {@link LocalDateTime}\n */\n static from(temporal) {\n requireNonNull(temporal, 'temporal');\n if (temporal instanceof LocalDateTime) {\n return temporal;\n } else if (temporal instanceof ZonedDateTime) {\n return temporal.toLocalDateTime();\n }\n try {\n const date = LocalDate.from(temporal);\n const time = LocalTime.from(temporal);\n return new LocalDateTime(date, time);\n } catch (ex) {\n throw new DateTimeException(`Unable to obtain LocalDateTime TemporalAccessor: ${temporal}, type ${temporal.constructor != null ? temporal.constructor.name : ''}`);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link LocalDateTime} from a text string using a specific formatter.\n *\n * The text is parsed using the formatter, returning a date-time.\n *\n * @param {!string} text - the text to parse, not null\n * @param {DateTimeFormatter} [formatter=DateTimeFormatter.ISO_LOCAL_DATE_TIME] - the formatter to use,\n * defaults to DateTimeFormatter.ISO_LOCAL_DATE_TIME\n * @return {LocalDateTime} the parsed local date-time, not null\n * @throws {DateTimeParseException} if the text cannot be parsed\n */\n static parse(text, formatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME) {\n requireNonNull(formatter, 'formatter');\n return formatter.parse(text, LocalDateTime.FROM);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param {LocalDate} date - the date part of the date-time, validated not null\n * @param {LocalTime} time - the time part of the date-time, validated not null\n * @private\n */\n constructor(date, time) {\n super();\n requireInstance(date, LocalDate, 'date');\n requireInstance(time, LocalTime, 'time');\n this._date = date;\n this._time = time;\n }\n\n /**\n * Returns a copy of this date-time with the new date and time, checking\n * to see if a new object is in fact required.\n *\n * @param {LocalDate} newDate - the date of the new date-time, not null\n * @param {LocalTime} newTime - the time of the new date-time, not null\n * @return {LocalDateTime} the date-time, not null\n */\n _withDateTime(newDate, newTime) {\n if (this._date.equals(newDate) && this._time.equals(newTime)) {\n return this;\n }\n return new LocalDateTime(newDate, newTime);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the specified field is supported.\n *\n * This checks if this date-time can be queried for the specified field.\n * If false, then calling the {@link LocalDateTime.range} range and\n * {@link LocalDateTime.get} get methods will throw an exception.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields are:\n *\n * * {@link ChronoField.NANO_OF_SECOND}\n * * {@link ChronoField.NANO_OF_DAY}\n * * {@link ChronoField.MICRO_OF_SECOND}\n * * {@link ChronoField.MICRO_OF_DAY}\n * * {@link ChronoField.MILLI_OF_SECOND}\n * * {@link ChronoField.MILLI_OF_DAY}\n * * {@link ChronoField.SECOND_OF_MINUTE}\n * * {@link ChronoField.SECOND_OF_DAY}\n * * {@link ChronoField.MINUTE_OF_HOUR}\n * * {@link ChronoField.MINUTE_OF_DAY}\n * * {@link ChronoField.HOUR_OF_AMPM}\n * * {@link ChronoField.CLOCK_HOUR_OF_AMPM}\n * * {@link ChronoField.HOUR_OF_DAY}\n * * {@link ChronoField.CLOCK_HOUR_OF_DAY}\n * * {@link ChronoField.AMPM_OF_DAY}\n * * {@link ChronoField.DAY_OF_WEEK}\n * * {@link ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH}\n * * {@link ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR}\n * * {@link ChronoField.DAY_OF_MONTH}\n * * {@link ChronoField.DAY_OF_YEAR}\n * * {@link ChronoField.EPOCH_DAY}\n * * {@link ChronoField.ALIGNED_WEEK_OF_MONTH}\n * * {@link ChronoField.ALIGNED_WEEK_OF_YEAR}\n * * {@link ChronoField.MONTH_OF_YEAR}\n * * {@link ChronoField.EPOCH_MONTH}\n * * {@link ChronoField.YEAR_OF_ERA}\n * * {@link ChronoField.YEAR}\n * * {@link ChronoField.ERA}\n *\n * All other {@link ChronoField} instances will return false.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.isSupportedBy}\n * passing `this` as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param {TemporalField|TemporalUnit} fieldOrUnit - the field to check, null returns false\n * @return {boolean} true if the field is supported on this date-time, false if not\n */\n isSupported(fieldOrUnit) {\n if (fieldOrUnit instanceof ChronoField) {\n return fieldOrUnit.isDateBased() || fieldOrUnit.isTimeBased();\n } else if (fieldOrUnit instanceof ChronoUnit) {\n return fieldOrUnit.isDateBased() || fieldOrUnit.isTimeBased();\n }\n return fieldOrUnit != null && fieldOrUnit.isSupportedBy(this);\n }\n\n /**\n * Gets the range of valid values for the specified field.\n *\n * The range object expresses the minimum and maximum valid values for a field.\n * This date-time is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return\n * appropriate range instances.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.rangeRefinedBy}\n * passing `this` as the argument.\n * Whether the range can be obtained is determined by the field.\n *\n * @param {!TemporalField} field - the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws {DateTimeException} if the range for the field cannot be obtained\n */\n range(field) {\n if (field instanceof ChronoField) {\n return (field.isTimeBased() ? this._time.range(field) : this._date.range(field));\n }\n return field.rangeRefinedBy(this);\n }\n\n /**\n * Gets the value of the specified field from this date-time as an `int`.\n *\n * This queries this date-time for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return valid\n * values based on this date-time, except {@link NANO_OF_DAY}, {@link MICRO_OF_DAY},\n * {@link EPOCH_DAY} and {@link EPOCH_MONTH} which are too large to fit in\n * an `int` and throw a {@link DateTimeException}.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {!TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n get(field) {\n if (field instanceof ChronoField) {\n return (field.isTimeBased() ? this._time.get(field) : this._date.get(field));\n }\n return super.get(field);\n }\n\n /**\n * Gets the value of the specified field from this date-time as a `long`.\n *\n * This queries this date-time for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return valid\n * values based on this date-time.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {!TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n getLong(field) {\n requireNonNull(field, 'field');\n if (field instanceof ChronoField) {\n return (field.isTimeBased() ? this._time.getLong(field) : this._date.getLong(field));\n }\n return field.getFrom(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the year field.\n *\n * This method returns the primitive `int` value for the year.\n *\n * The year returned by this method is proleptic as per `get(YEAR)`.\n * To obtain the year-of-era, use `get(YEAR_OF_ERA)`.\n *\n * @return {number} the year, from MIN_YEAR to MAX_YEAR\n */\n year() {\n return this._date.year();\n }\n\n /**\n * Gets the month-of-year field from 1 to 12.\n *\n * This method returns the month as an `int` from 1 to 12.\n * Application code is frequently clearer if the enum {@link Month}\n * is used by calling {@link getMonth}.\n *\n * @return {number} the month-of-year, from 1 to 12\n * @see #getMonth()\n */\n monthValue() {\n return this._date.monthValue();\n }\n\n /**\n * Gets the month-of-year field using the {@link Month} enum.\n *\n * This method returns the enum {@link Month} for the month.\n * This avoids confusion as to what `int` values mean.\n * If you need access to the primitive `int` value, use\n * {@link Month#getValue}.\n *\n * @return {Month} the month-of-year, not null\n * @see #getMonthValue()\n */\n month() {\n return this._date.month();\n }\n\n /**\n * Gets the day-of-month field.\n *\n * This method returns the primitive `int` value for the day-of-month.\n *\n * @return {number} the day-of-month, from 1 to 31\n */\n dayOfMonth() {\n return this._date.dayOfMonth();\n }\n\n /**\n * Gets the day-of-year field.\n *\n * This method returns the primitive `int` value for the day-of-year.\n *\n * @return {number} the day-of-year, from 1 to 365, or 366 in a leap year\n */\n dayOfYear() {\n return this._date.dayOfYear();\n }\n\n /**\n * Gets the day-of-week field, which is an enum {@link DayOfWeek}.\n *\n * This method returns the enum {@link DayOfWeek} for the day-of-week.\n * This avoids confusion as to what `int` values mean.\n * If you need access to the primitive `int` value, use\n * {@link DayOfWeek#getValue}.\n *\n * Additional information can be obtained from the {@link DayOfWeek}.\n * This includes textual names of the values.\n *\n * @return {DayOfWeek} the day-of-week, not null\n */\n dayOfWeek() {\n return this._date.dayOfWeek();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the hour-of-day field.\n *\n * @return {number} the hour-of-day, from 0 to 23\n */\n hour() {\n return this._time.hour();\n }\n\n /**\n * Gets the minute-of-hour field.\n *\n * @return {number} the minute-of-hour, from 0 to 59\n */\n minute() {\n return this._time.minute();\n }\n\n /**\n * Gets the second-of-minute field.\n *\n * @return {number} the second-of-minute, from 0 to 59\n */\n second() {\n return this._time.second();\n }\n\n /**\n * Gets the nano-of-second field.\n *\n * @return {number} the nano-of-second, from 0 to 999,999,999\n */\n nano() {\n return this._time.nano();\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * Returns an adjusted copy of this date-time.\n *\n * This returns a new {@link LocalDateTime}, based on this one, with the date-time adjusted.\n * The adjustment takes place using the specified adjuster strategy object.\n * Read the documentation of the adjuster to understand what adjustment will be made.\n *\n * A simple adjuster might simply set the one of the fields, such as the year field.\n * A more complex adjuster might set the date to the last day of the month.\n * A selection of common adjustments is provided in {@link TemporalAdjusters}.\n * These include finding the 'last day of the month' and 'next Wednesday'.\n * Key date-time classes also implement the {@link TemporalAdjuster} interface,\n * such as {@link Month} and {@link MonthDay}.\n * The adjuster is responsible for handling special cases, such as the varying\n * lengths of month and leap years.\n *\n * For example this code returns a date on the last day of July:\n *
\n     *  import static org.threeten.bp.Month.*;\n     *  import static org.threeten.bp.temporal.Adjusters.*;\n     *\n     *  result = localDateTime.with(JULY).with(lastDayOfMonth());\n     * 
\n *\n * The classes {@link LocalDate} and {@link LocalTime} implement {@link TemporalAdjuster},\n * thus this method can be used to change the date, time or offset:\n *
\n     *  result = localDateTime.with(date);\n     *  result = localDateTime.with(time);\n     * 
\n *\n * The result of this method is obtained by invoking the\n * {@link TemporalAdjuster#adjustInto} method on the\n * specified adjuster passing `this` as the argument.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAdjuster} adjuster the adjuster to use, not null\n * @return {LocalDateTime} a {@link LocalDateTime} based on `this` with the adjustment made, not null\n * @throws {DateTimeException} if the adjustment cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n withAdjuster(adjuster) {\n requireNonNull(adjuster, 'adjuster');\n // optimizations\n if (adjuster instanceof LocalDate) {\n return this._withDateTime(adjuster, this._time);\n } else if (adjuster instanceof LocalTime) {\n return this._withDateTime(this._date, adjuster);\n } else if (adjuster instanceof LocalDateTime) {\n return adjuster;\n }\n assert(typeof adjuster.adjustInto === 'function', 'adjuster', IllegalArgumentException);\n return adjuster.adjustInto(this);\n }\n\n /**\n * Returns a copy of this date-time with the specified field set to a new value.\n *\n * This returns a new {@link LocalDateTime}, based on this one, with the value\n * for the specified field changed.\n * This can be used to change any supported field, such as the year, month or day-of-month.\n * If it is not possible to set the value, because the field is not supported or for\n * some other reason, an exception is thrown.\n *\n * In some cases, changing the specified field can cause the resulting date-time to become invalid,\n * such as changing the month from 31st January to February would make the day-of-month invalid.\n * In cases like this, the field is responsible for resolving the date. Typically it will choose\n * the previous valid date, which would be the last valid day of February in this example.\n *\n * If the field is a {@link ChronoField} then the adjustment is implemented here.\n * The supported fields (see {@link isSupported}) will behave as in\n * {@link LocalDate#with} or {@link LocalTime#with}.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.adjustInto}\n * passing `this` as the argument. In this case, the field determines\n * whether and how to adjust the instant.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalField} field - the field to set in the result, not null\n * @param {number} newValue - the new value of the field in the result\n * @return {LocalDateTime} a {@link LocalDateTime} based on `this` with the specified field set, not null\n * @throws {DateTimeException} if the field cannot be set\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n withFieldValue(field, newValue) {\n requireNonNull(field, 'field');\n if (field instanceof ChronoField) {\n if (field.isTimeBased()) {\n return this._withDateTime(this._date, this._time.with(field, newValue));\n } else {\n return this._withDateTime(this._date.with(field, newValue), this._time);\n }\n }\n return field.adjustInto(this, newValue);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalDateTime} with the year altered.\n * The time does not affect the calculation and will be the same in the result.\n * If the day-of-month is invalid for the year, it will be changed to the last valid day of the month.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} year - the year to set in the result, from MIN_YEAR to MAX_YEAR\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the requested year, not null\n * @throws {DateTimeException} if the year value is invalid\n */\n withYear(year) {\n return this._withDateTime(this._date.withYear(year), this._time);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the month-of-year altered.\n * The time does not affect the calculation and will be the same in the result.\n * If the day-of-month is invalid for the year, it will be changed to the last valid day of the month.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {!(number|Month)} month - the month-of-year to set in the result, from 1 (January) to 12 (December)\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the requested month, not null\n * @throws {DateTimeException} if the month-of-year value is invalid\n */\n withMonth(month) {\n return this._withDateTime(this._date.withMonth(month), this._time);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the day-of-month altered.\n * If the resulting {@link LocalDateTime} is invalid, an exception is thrown.\n * The time does not affect the calculation and will be the same in the result.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} dayOfMonth - the day-of-month to set in the result, from 1 to 28-31\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the requested day, not null\n * @throws {DateTimeException} if the day-of-month value is invalid\n * @throws {DateTimeException} if the day-of-month is invalid for the month-year\n */\n withDayOfMonth(dayOfMonth) {\n return this._withDateTime(this._date.withDayOfMonth(dayOfMonth), this._time);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the day-of-year altered.\n * If the resulting {@link LocalDateTime} is invalid, an exception is thrown.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} dayOfYear - the day-of-year to set in the result, from 1 to 365-366\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date with the requested day, not null\n * @throws {DateTimeException} if the day-of-year value is invalid\n * @throws {DateTimeException} if the day-of-year is invalid for the year\n */\n withDayOfYear(dayOfYear) {\n return this._withDateTime(this._date.withDayOfYear(dayOfYear), this._time);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalDateTime} with the hour-of-day value altered.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} hour - the hour-of-day to set in the result, from 0 to 23\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the requested hour, not null\n * @throws {DateTimeException} if the hour value is invalid\n */\n withHour(hour) {\n const newTime = this._time.withHour(hour);\n return this._withDateTime(this._date, newTime);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the minute-of-hour value altered.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} minute - the minute-of-hour to set in the result, from 0 to 59\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the requested minute, not null\n * @throws {DateTimeException} if the minute value is invalid\n */\n withMinute(minute) {\n const newTime = this._time.withMinute(minute);\n return this._withDateTime(this._date, newTime);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the second-of-minute value altered.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} second - the second-of-minute to set in the result, from 0 to 59\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the requested second, not null\n * @throws {DateTimeException} if the second value is invalid\n */\n withSecond(second) {\n const newTime = this._time.withSecond(second);\n return this._withDateTime(this._date, newTime);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the nano-of-second value altered.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} nanoOfSecond - the nano-of-second to set in the result, from 0 to 999,999,999\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the requested nanosecond, not null\n * @throws {DateTimeException} if the nano value is invalid\n */\n withNano(nanoOfSecond) {\n const newTime = this._time.withNano(nanoOfSecond);\n return this._withDateTime(this._date, newTime);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalDateTime} with the time truncated.\n *\n * Truncation returns a copy of the original date-time with fields\n * smaller than the specified unit set to zero.\n * For example, truncating with {@link ChronoUnit#MINUTES}\n * will set the second-of-minute and nano-of-second field to zero.\n *\n * The unit must have a duration (see {@link TemporalUnit#getDuration})\n * that divides into the length of a standard day without remainder.\n * This includes all supplied time units on {@link ChronoUnit} and\n * {@link ChronoUnit#DAYS}. Other units throw an exception.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalUnit} unit - the unit to truncate to, not null\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the time truncated, not null\n * @throws {DateTimeException} if unable to truncate\n */\n truncatedTo(unit) {\n return this._withDateTime(this._date, this._time.truncatedTo(unit));\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * Returns a copy of this date-time with the specified period added.\n *\n * This method returns a new date-time based on this time with the specified period added.\n * The amount is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link plus}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAmount} amount - the amount to add, not null\n * @return {LocalDateTime} based on this date-time with the addition made, not null\n * @throws {DateTimeException} if the addition cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n plusAmount(amount) {\n requireNonNull(amount, 'amount');\n return amount.addTo(this);\n }\n\n /**\n * Returns a copy of this date-time with the specified period added.\n *\n * This method returns a new date-time based on this date-time with the specified period added.\n * This can be used to add any period that is defined by a unit, for example to add years, months or days.\n * The unit is responsible for the details of the calculation, including the resolution\n * of any edge cases in the calculation.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} amountToAdd - the amount of the unit to add to the result, may be negative\n * @param {!TemporalUnit} unit - the unit of the period to add, not null\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the specified period added, not null\n * @throws {DateTimeException} if the unit cannot be added to this type\n */\n plusAmountUnit(amountToAdd, unit) {\n requireNonNull(unit, 'unit');\n if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.NANOS: return this.plusNanos(amountToAdd);\n case ChronoUnit.MICROS: return this.plusDays(MathUtil.intDiv(amountToAdd, LocalTime.MICROS_PER_DAY)).plusNanos(MathUtil.intMod(amountToAdd, LocalTime.MICROS_PER_DAY) * 1000);\n case ChronoUnit.MILLIS: return this.plusDays(MathUtil.intDiv(amountToAdd, LocalTime.MILLIS_PER_DAY)).plusNanos(MathUtil.intMod(amountToAdd, LocalTime.MILLIS_PER_DAY) * 1000000);\n case ChronoUnit.SECONDS: return this.plusSeconds(amountToAdd);\n case ChronoUnit.MINUTES: return this.plusMinutes(amountToAdd);\n case ChronoUnit.HOURS: return this.plusHours(amountToAdd);\n case ChronoUnit.HALF_DAYS: return this.plusDays(MathUtil.intDiv(amountToAdd, 256)).plusHours(MathUtil.intMod(amountToAdd, 256) * 12); // no overflow (256 is multiple of 2)\n }\n return this._withDateTime(this._date.plus(amountToAdd, unit), this._time);\n }\n return unit.addTo(this, amountToAdd);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in years added.\n *\n * This method adds the specified amount to the years field in three steps:\n *\n * 1. Add the input years to the year field\n * 2. Check if the resulting date would be invalid\n * 3. Adjust the day-of-month to the last valid day if necessary\n *\n * For example, 2008-02-29 (leap year) plus one year would result in the\n * invalid date 2009-02-29 (standard year). Instead of returning an invalid\n * result, the last valid day of the month, 2009-02-28, is selected instead.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} years - the years to add, may be negative\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the years added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusYears(years) {\n const newDate = this._date.plusYears(years);\n return this._withDateTime(newDate, this._time);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in months added.\n *\n * This method adds the specified amount to the months field in three steps:\n *\n * 1. Add the input months to the month-of-year field\n * 2. Check if the resulting date would be invalid\n * 3. Adjust the day-of-month to the last valid day if necessary\n *\n * For example, 2007-03-31 plus one month would result in the invalid date\n * 2007-04-31. Instead of returning an invalid result, the last valid day\n * of the month, 2007-04-30, is selected instead.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} months - the months to add, may be negative\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the months added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusMonths(months) {\n const newDate = this._date.plusMonths(months);\n return this._withDateTime(newDate, this._time);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in weeks added.\n *\n * This method adds the specified amount in weeks to the days field incrementing\n * the month and year fields as necessary to ensure the result remains valid.\n * The result is only invalid if the maximum/minimum year is exceeded.\n *\n * For example, 2008-12-31 plus one week would result in 2009-01-07.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} weeks - the weeks to add, may be negative\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the weeks added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusWeeks(weeks) {\n const newDate = this._date.plusWeeks(weeks);\n return this._withDateTime(newDate, this._time);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in days added.\n *\n * This method adds the specified amount to the days field incrementing the\n * month and year fields as necessary to ensure the result remains valid.\n * The result is only invalid if the maximum/minimum year is exceeded.\n *\n * For example, 2008-12-31 plus one day would result in 2009-01-01.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} days - the days to add, may be negative\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the days added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusDays(days) {\n const newDate = this._date.plusDays(days);\n return this._withDateTime(newDate, this._time);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in hours added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} hours - the hours to add, may be negative\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the hours added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusHours(hours) {\n return this._plusWithOverflow(this._date, hours, 0, 0, 0, 1);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in minutes added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} minutes - the minutes to add, may be negative\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the minutes added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusMinutes(minutes) {\n return this._plusWithOverflow(this._date, 0, minutes, 0, 0, 1);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in seconds added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} seconds - the seconds to add, may be negative\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the seconds added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusSeconds(seconds) {\n return this._plusWithOverflow(this._date, 0, 0, seconds, 0, 1);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in nanoseconds added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} nanos - the nanos to add, may be negative\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the nanoseconds added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusNanos(nanos) {\n return this._plusWithOverflow(this._date, 0, 0, 0, nanos, 1);\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * Returns a copy of this date-time with the specified period subtracted.\n *\n * This method returns a new date-time based on this time with the specified period subtracted.\n * The amount is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link minus}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAmount} amount - the amount to subtract, not null\n * @return {LocalDateTime} based on this date-time with the subtraction made, not null\n * @throws {DateTimeException} if the subtraction cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n minusAmount(amount) {\n requireNonNull(amount, 'amount');\n return amount.subtractFrom(this);\n }\n\n /**\n * Returns a copy of this date-time with the specified period subtracted.\n *\n * This method returns a new date-time based on this date-time with the specified period subtracted.\n * This can be used to subtract any period that is defined by a unit, for example to subtract years, months or days.\n * The unit is responsible for the details of the calculation, including the resolution\n * of any edge cases in the calculation.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} amountToSubtract - the amount of the unit to subtract from the result, may be negative\n * @param {TemporalUnit} unit - the unit of the period to subtract, not null\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the specified period subtracted, not null\n * @throws {DateTimeException} if the unit cannot be added to this type\n */\n minusAmountUnit(amountToSubtract, unit) {\n requireNonNull(unit, 'unit');\n return this.plusAmountUnit(-1 * amountToSubtract, unit);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in years subtracted.\n *\n * This method subtracts the specified amount from the years field in three steps:\n *\n * 1. Subtract the input years from the year field\n * 2. Check if the resulting date would be invalid\n * 3. Adjust the day-of-month to the last valid day if necessary\n *\n * For example, 2008-02-29 (leap year) minus one year would result in the\n * invalid date 2009-02-29 (standard year). Instead of returning an invalid\n * result, the last valid day of the month, 2009-02-28, is selected instead.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} years - the years to subtract, may be negative\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the years subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusYears(years) {\n return this.plusYears(-1 * years);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in months subtracted.\n *\n * This method subtracts the specified amount from the months field in three steps:\n *\n * 1. Subtract the input months from the month-of-year field\n * 2. Check if the resulting date would be invalid\n * 3. Adjust the day-of-month to the last valid day if necessary\n *\n * For example, 2007-03-31 minus one month would result in the invalid date\n * 2007-04-31. Instead of returning an invalid result, the last valid day\n * of the month, 2007-04-30, is selected instead.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} months - the months to subtract, may be negative\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the months subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusMonths(months) {\n return this.plusMonths(-1 * months);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in weeks subtracted.\n *\n * This method subtracts the specified amount in weeks from the days field decrementing\n * the month and year fields as necessary to ensure the result remains valid.\n * The result is only invalid if the maximum/minimum year is exceeded.\n *\n * For example, 2009-01-07 minus one week would result in 2008-12-31.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} weeks - the weeks to subtract, may be negative\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the weeks subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusWeeks(weeks) {\n return this.plusWeeks(-1 * weeks);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in days subtracted.\n *\n * This method subtracts the specified amount from the days field incrementing the\n * month and year fields as necessary to ensure the result remains valid.\n * The result is only invalid if the maximum/minimum year is exceeded.\n *\n * For example, 2009-01-01 minus one day would result in 2008-12-31.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} days - the days to subtract, may be negative\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the days subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusDays(days) {\n return this.plusDays(-1 * days);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in hours subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} hours - the hours to subtract, may be negative\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the hours subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusHours(hours) {\n return this._plusWithOverflow(this._date, hours, 0, 0, 0, -1);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in minutes subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} minutes - the minutes to subtract, may be negative\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the minutes subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusMinutes(minutes) {\n return this._plusWithOverflow(this._date, 0, minutes, 0, 0, -1);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in seconds subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} seconds - the seconds to subtract, may be negative\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the seconds subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusSeconds(seconds) {\n return this._plusWithOverflow(this._date, 0, 0, seconds, 0, -1);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in nanoseconds subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} nanos - the nanos to subtract, may be negative\n * @return {LocalDateTime} based on this date-time with the nanoseconds subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusNanos(nanos) {\n return this._plusWithOverflow(this._date, 0, 0, 0, nanos, -1);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {LocalDate} newDate the new date to base the calculation on, not null\n * @param {Number} hours - the hours to add, may be negative\n * @param {Number} minutes - the minutes to add, may be negative\n * @param {Number} seconds - the seconds to add, may be negative\n * @param {Number} nanos - the nanos to add, may be negative\n * @param {Number} sign - the sign to determine add or subtract\n * @return {LocalDateTime} the combined result, not null\n */\n _plusWithOverflow(newDate, hours, minutes, seconds, nanos, sign) {\n // 9223372036854775808 long, 2147483648 int\n if (hours === 0 && minutes === 0 && seconds === 0 && nanos === 0) {\n return this._withDateTime(newDate, this._time);\n }\n let totDays = MathUtil.intDiv(nanos, LocalTime.NANOS_PER_DAY) + // max/24*60*60*1B\n MathUtil.intDiv(seconds, LocalTime.SECONDS_PER_DAY) + // max/24*60*60\n MathUtil.intDiv(minutes, LocalTime.MINUTES_PER_DAY) + // max/24*60\n MathUtil.intDiv(hours, LocalTime.HOURS_PER_DAY); // max/24\n totDays *= sign; // total max*0.4237...\n let totNanos = MathUtil.intMod(nanos, LocalTime.NANOS_PER_DAY) + // max 86400000000000\n (MathUtil.intMod(seconds, LocalTime.SECONDS_PER_DAY)) * LocalTime.NANOS_PER_SECOND + // max 86400000000000\n (MathUtil.intMod(minutes, LocalTime.MINUTES_PER_DAY)) * LocalTime.NANOS_PER_MINUTE + // max 86400000000000\n (MathUtil.intMod(hours, LocalTime.HOURS_PER_DAY)) * LocalTime.NANOS_PER_HOUR; // max 86400000000000\n const curNoD = this._time.toNanoOfDay(); // max 86400000000000\n totNanos = totNanos * sign + curNoD; // total 432000000000000\n totDays += MathUtil.floorDiv(totNanos, LocalTime.NANOS_PER_DAY);\n const newNoD = MathUtil.floorMod(totNanos, LocalTime.NANOS_PER_DAY);\n const newTime = (newNoD === curNoD ? this._time : LocalTime.ofNanoOfDay(newNoD));\n return this._withDateTime(newDate.plusDays(totDays), newTime);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this date-time using the specified query.\n *\n * This queries this date-time using the specified query strategy object.\n * The {@link TemporalQuery} object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n *\n * The result of this method is obtained by invoking the\n * {@link TemporalQuery#queryFrom} method on the\n * specified query passing `this` as the argument.\n *\n * @param {TemporalQuery} query the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws {DateTimeException} if unable to query (defined by the query)\n * @throws {ArithmeticException} if numeric overflow occurs (defined by the query)\n */\n query(query) {\n requireNonNull(query, 'query');\n if (query === TemporalQueries.localDate()) {\n return this.toLocalDate();\n }\n return super.query(query);\n }\n\n /**\n * Adjusts the specified temporal object to have the same date and time as this object.\n *\n * This returns a temporal object of the same observable type as the input\n * with the date and time changed to be the same as this.\n *\n * The adjustment is equivalent to using {@link Temporal#with}\n * twice, passing {@link ChronoField#EPOCH_DAY} and\n * {@link ChronoField#NANO_OF_DAY} as the fields.\n *\n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal#with}:\n *
\n     *   // these two lines are equivalent, but the second approach is recommended\n     *   temporal = thisLocalDateTime.adjustInto(temporal);\n     *   temporal = temporal.with(thisLocalDateTime);\n     * 
\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAdjuster} temporal - the target object to be adjusted, not null\n * @return {LocalDateTime} the adjusted object, not null\n * @throws {DateTimeException} if unable to make the adjustment\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n adjustInto(temporal) {\n return super.adjustInto(temporal);\n }\n\n /**\n * Calculates the period between this date-time and another date-time in\n * terms of the specified unit.\n *\n * This calculates the period between two date-times in terms of a single unit.\n * The start and end points are `this` and the specified date-time.\n * The result will be negative if the end is before the start.\n * The {@link Temporal} passed to this method must be a {@link LocalDateTime}.\n * For example, the period in days between two date-times can be calculated\n * using `startDateTime.until(endDateTime, DAYS)`.\n *\n * The calculation returns a whole number, representing the number of\n * complete units between the two date-times.\n * For example, the period in months between 2012-06-15T00:00 and 2012-08-14T23:59\n * will only be one month as it is one minute short of two months.\n *\n * This method operates in association with {@link TemporalUnit#between}.\n * The result of this method is a `long` representing the amount of\n * the specified unit. By contrast, the result of {@link between} is an\n * object that can be used directly in addition/subtraction:\n *
\n     *   long period = start.until(end, MONTHS);   // this method\n     *   dateTime.plus(MONTHS.between(start, end));      // use in plus/minus\n     * 
\n *\n * The calculation is implemented in this method for {@link ChronoUnit}.\n * The units {@link NANOS}, {@link MICROS}, {@link MILLIS}, {@link SECONDS},\n * {@link MINUTES}, {@link HOURS} and {@link HALF_DAYS}, {@link DAYS},\n * {@link WEEKS}, {@link MONTHS}, {@link YEARS}, {@link DECADES},\n * {@link CENTURIES}, {@link MILLENNIA} and {@link ERAS} are supported.\n * Other {@link ChronoUnit} values will throw an exception.\n *\n * If the unit is not a {@link ChronoUnit}, then the result of this method\n * is obtained by invoking {@link TemporalUnit.between}\n * passing `this` as the first argument and the input temporal as\n * the second argument.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} endExclusive - the end date-time, which is converted to a {@link LocalDateTime}, not null\n * @param {TemporalUnit} unit - the unit to measure the period in, not null\n * @return {number} the amount of the period between this date-time and the end date-time\n * @throws {DateTimeException} if the period cannot be calculated\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n until(endExclusive, unit) {\n requireNonNull(endExclusive, 'endExclusive');\n requireNonNull(unit, 'unit');\n const end = LocalDateTime.from(endExclusive);\n if (unit instanceof ChronoUnit) {\n if (unit.isTimeBased()) {\n let daysUntil = this._date.daysUntil(end._date);\n let timeUntil = end._time.toNanoOfDay() - this._time.toNanoOfDay();\n if (daysUntil > 0 && timeUntil < 0) {\n daysUntil--;\n timeUntil += LocalTime.NANOS_PER_DAY;\n } else if (daysUntil < 0 && timeUntil > 0) {\n daysUntil++;\n timeUntil -= LocalTime.NANOS_PER_DAY;\n }\n let amount = daysUntil;\n switch (unit) {\n case ChronoUnit.NANOS:\n amount = MathUtil.safeMultiply(amount, LocalTime.NANOS_PER_DAY);\n return MathUtil.safeAdd(amount, timeUntil);\n case ChronoUnit.MICROS:\n amount = MathUtil.safeMultiply(amount, LocalTime.MICROS_PER_DAY);\n return MathUtil.safeAdd(amount, MathUtil.intDiv(timeUntil, 1000));\n case ChronoUnit.MILLIS:\n amount = MathUtil.safeMultiply(amount, LocalTime.MILLIS_PER_DAY);\n return MathUtil.safeAdd(amount, MathUtil.intDiv(timeUntil, 1000000));\n case ChronoUnit.SECONDS:\n amount = MathUtil.safeMultiply(amount, LocalTime.SECONDS_PER_DAY);\n return MathUtil.safeAdd(amount, MathUtil.intDiv(timeUntil, LocalTime.NANOS_PER_SECOND));\n case ChronoUnit.MINUTES:\n amount = MathUtil.safeMultiply(amount, LocalTime.MINUTES_PER_DAY);\n return MathUtil.safeAdd(amount, MathUtil.intDiv(timeUntil, LocalTime.NANOS_PER_MINUTE));\n case ChronoUnit.HOURS:\n amount = MathUtil.safeMultiply(amount, LocalTime.HOURS_PER_DAY);\n return MathUtil.safeAdd(amount, MathUtil.intDiv(timeUntil, LocalTime.NANOS_PER_HOUR));\n case ChronoUnit.HALF_DAYS:\n amount = MathUtil.safeMultiply(amount, 2);\n return MathUtil.safeAdd(amount, MathUtil.intDiv(timeUntil, (LocalTime.NANOS_PER_HOUR * 12)));\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n let endDate = end._date;\n const endTime = end._time;\n if (endDate.isAfter(this._date) && endTime.isBefore(this._time)) {\n endDate = endDate.minusDays(1);\n } else if (endDate.isBefore(this._date) && endTime.isAfter(this._time)) {\n endDate = endDate.plusDays(1);\n }\n return this._date.until(endDate, unit);\n }\n return unit.between(this, end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this date-time with an offset to create an {@link OffsetDateTime}.\n *\n * This returns an {@link OffsetDateTime} formed from this date-time at the specified offset.\n * All possible combinations of date-time and offset are valid.\n *\n * @param {ZoneOffset} offset the offset to combine with, not null\n * @return {OffsetDateTime} the offset date-time formed from this date-time and the specified offset, not null\n */\n atOffset(offset) {\n return OffsetDateTime.of(this, offset);\n }\n\n /**\n * Combines this date-time with a time-zone to create a {@link ZonedDateTime}.\n *\n * This returns a {@link ZonedDateTime} formed from this date-time at the\n * specified time-zone. The result will match this date-time as closely as possible.\n * Time-zone rules, such as daylight savings, mean that not every local date-time\n * is valid for the specified zone, thus the local date-time may be adjusted.\n *\n * The local date-time is resolved to a single instant on the time-line.\n * This is achieved by finding a valid offset from UTC/Greenwich for the local\n * date-time as defined by the {@link ZoneRules} of the zone ID.\n *\n * In most cases, there is only one valid offset for a local date-time.\n * In the case of an overlap, where clocks are set back, there are two valid offsets.\n * This method uses the earlier offset typically corresponding to 'summer'.\n *\n * In the case of a gap, where clocks jump forward, there is no valid offset.\n * Instead, the local date-time is adjusted to be later by the length of the gap.\n * For a typical one hour daylight savings change, the local date-time will be\n * moved one hour later into the offset typically corresponding to 'summer'.\n *\n * To obtain the later offset during an overlap, call\n * {@link ZonedDateTime#withLaterOffsetAtOverlap} on the result of this method.\n * To throw an exception when there is a gap or overlap, use\n * {@link ZonedDateTime#ofStrict}.\n *\n * @param {ZoneId} zone the time-zone to use, not null\n * @return {ZonedDateTime} the zoned date-time formed from this date-time, not null\n */\n atZone(zone) {\n return ZonedDateTime.of(this, zone);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the {@link LocalDate} part of this date-time.\n *\n * This returns a {@link LocalDate} with the same year, month and day\n * as this date-time.\n *\n * @return {LocalDate} the date part of this date-time, not null\n */\n toLocalDate() {\n return this._date;\n }\n\n /**\n * Gets the {@link LocalTime} part of this date-time.\n *\n * This returns a {@link LocalTime} with the same hour, minute, second and\n * nanosecond as this date-time.\n *\n * @return {LocalTime} the time part of this date-time, not null\n */\n toLocalTime() {\n return this._time;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this date-time to another date-time.\n *\n * The comparison is primarily based on the date-time, from earliest to latest.\n * It is 'consistent with equals', as defined by {@link Comparable}.\n *\n * If all the date-times being compared are instances of {@link LocalDateTime},\n * then the comparison will be entirely based on the date-time.\n * If some dates being compared are in different chronologies, then the\n * chronology is also considered, see {@link ChronoLocalDateTime#compareTo}.\n *\n * @param {!LocalDateTime} other - the other date-time to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, LocalDateTime, 'other');\n return this._compareTo0(other);\n // return super.compareTo(other); if not instance of LocalDateTime\n }\n\n /**\n *\n * @param {!LocalDateTime} other\n * @returns {number}\n * @private\n */\n _compareTo0(other) {\n let cmp = this._date.compareTo(other.toLocalDate());\n if (cmp === 0) {\n cmp = this._time.compareTo(other.toLocalTime());\n }\n return cmp;\n }\n\n /**\n * Checks if this date-time is after the specified date-time.\n *\n * This checks to see if this date-time represents a point on the\n * local time-line after the other date-time.\n *
\n     *   LocalDate a = LocalDateTime.of(2012, 6, 30, 12, 00);\n     *   LocalDate b = LocalDateTime.of(2012, 7, 1, 12, 00);\n     *   a.isAfter(b) == false\n     *   a.isAfter(a) == false\n     *   b.isAfter(a) == true\n     * 
\n *\n * This method only considers the position of the two date-times on the local time-line.\n * It does not take into account the chronology, or calendar system.\n * This is different from the comparison in {@link compareTo},\n * but is the same approach as {@link DATE_TIME_COMPARATOR}.\n *\n * @param {LocalDateTime} other - the other date-time to compare to, not null\n * @return {boolean} true if this date-time is after the specified date-time\n */\n isAfter(other) {\n return this.compareTo(other) > 0;\n // return super.isAfter(other); if not instance of LocalDateTime\n }\n\n /**\n * Checks if this date-time is before the specified date-time.\n *\n * This checks to see if this date-time represents a point on the\n * local time-line before the other date-time.\n *
\n     *   LocalDate a = LocalDateTime.of(2012, 6, 30, 12, 00);\n     *   LocalDate b = LocalDateTime.of(2012, 7, 1, 12, 00);\n     *   a.isBefore(b) == true\n     *   a.isBefore(a) == false\n     *   b.isBefore(a) == false\n     * 
\n *\n * This method only considers the position of the two date-times on the local time-line.\n * It does not take into account the chronology, or calendar system.\n * This is different from the comparison in {@link compareTo},\n * but is the same approach as {@link DATE_TIME_COMPARATOR}.\n *\n * @param {LocalDateTime} other - the other date-time to compare to, not null\n * @return {boolean} true if this date-time is before the specified date-time\n */\n isBefore(other) {\n return this.compareTo(other) < 0;\n // return super.isBefore(other); if not instance of LocalDateTime\n }\n\n /**\n * Checks if this date-time is equal to the specified date-time.\n *\n * This checks to see if this date-time represents the same point on the\n * local time-line as the other date-time.\n *
\n     *   LocalDate a = LocalDateTime.of(2012, 6, 30, 12, 00);\n     *   LocalDate b = LocalDateTime.of(2012, 7, 1, 12, 00);\n     *   a.isEqual(b) == false\n     *   a.isEqual(a) == true\n     *   b.isEqual(a) == false\n     * 
\n *\n * This method only considers the position of the two date-times on the local time-line.\n * It does not take into account the chronology, or calendar system.\n * This is different from the comparison in {@link compareTo},\n * but is the same approach as {@link DATE_TIME_COMPARATOR}.\n *\n * @param {LocalDateTime} other - the other date-time to compare to, not null\n * @return {boolean} true if this date-time is equal to the specified date-time\n */\n isEqual(other) {\n return this.compareTo(other) === 0;\n // return super.isEqual(other); if not instance of LocalDateTime\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this date-time is equal to another date-time.\n *\n * Compares this {@link LocalDateTime} with another ensuring that the date-time is the same.\n * Only objects of type {@link LocalDateTime} are compared, other types return false.\n *\n * @param {*} other - the object to check, null returns false\n * @return {boolean} true if this is equal to the other date-time\n */\n equals(other) {\n if (this === other) {\n return true;\n }\n if (other instanceof LocalDateTime) {\n return this._date.equals(other._date) && this._time.equals(other._time);\n }\n return false;\n }\n\n /**\n * A hash code for this date-time.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return this._date.hashCode() ^ this._time.hashCode();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this date-time as a string, such as `2007-12-03T10:15:30`.\n *\n * The output will be one of the following ISO-8601 formats:\n *\n * * `yyyy-MM-dd'T'HH:mm`\n * * `yyyy-MM-dd'T'HH:mm:ss`\n * * `yyyy-MM-dd'T'HH:mm:ss.SSS`\n * * `yyyy-MM-dd'T'HH:mm:ss.SSSSSS`\n * * `yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS`\n *\n * The format used will be the shortest that outputs the full value of\n * the time where the omitted parts are implied to be zero.\n *\n * @return {string} a string representation of this date-time, not null\n */\n toString() {\n return this._date.toString() + 'T' + this._time.toString();\n }\n\n /**\n *\n * @return {string} same as {@link LocalDateTime.toString}\n */\n toJSON() {\n return this.toString();\n }\n\n /**\n * Outputs this date-time as a string using the formatter.\n *\n * @param {!DateTimeFormatter} formatter the formatter to use, not null\n * @return {String} the formatted date-time string, not null\n * @throws {DateTimeException} if an error occurs during printing\n */\n format(formatter) {\n requireNonNull(formatter, 'formatter');\n return formatter.format(this);\n }\n\n}\n\nexport function _init(){\n /**\n * The minimum supported {@link LocalDateTime}, '-999999999-01-01T00:00:00'.\n * This is the local date-time of midnight at the start of the minimum date.\n * This combines {@link LocalDate#MIN} and {@link LocalTime#MIN}.\n * This could be used by an application as a 'far past' date-time.\n */\n LocalDateTime.MIN = LocalDateTime.of(LocalDate.MIN, LocalTime.MIN);\n\n /**\n * The maximum supported {@link LocalDateTime}, '+999999999-12-31T23:59:59.999999999'.\n * This is the local date-time just before midnight at the end of the maximum date.\n * This combines {@link LocalDate#MAX} and {@link LocalTime#MAX}.\n * This could be used by an application as a 'far future' date-time.\n */\n LocalDateTime.MAX = LocalDateTime.of(LocalDate.MAX, LocalTime.MAX);\n\n LocalDateTime.FROM = createTemporalQuery('LocalDateTime.FROM', (temporal) => {\n return LocalDateTime.from(temporal);\n });\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\n\nimport {MathUtil} from './MathUtil';\nimport {assert, requireNonNull, requireInstance} from './assert';\nimport {DateTimeException, UnsupportedTemporalTypeException, IllegalArgumentException} from './errors';\n\nimport {Clock} from './Clock';\nimport {LocalDateTime} from './LocalDateTime';\nimport {ZoneId} from './ZoneId';\n\nimport {DateTimeFormatter} from './format/DateTimeFormatter';\n\nimport {ChronoField} from './temporal/ChronoField';\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {Temporal} from './temporal/Temporal';\nimport {TemporalField} from './temporal/TemporalField';\nimport {TemporalQueries} from './temporal/TemporalQueries';\nimport {createTemporalQuery} from './temporal/TemporalQuery';\n\n/**\n * A time without time-zone in the ISO-8601 calendar system,\n * such as `10:15:30`.\n *\n * {@link LocalTime} is an immutable date-time object that represents a time,\n * often viewed as hour-minute-second.\n * Time is represented to nanosecond precision.\n * For example, the value '13:45.30.123456789' can be stored in a {@link LocalTime}.\n *\n * It does not store or represent a date or time-zone.\n * Instead, it is a description of the local time as seen on a wall clock.\n * It cannot represent an instant on the time-line without additional information\n * such as an offset or time-zone.\n *\n * The ISO-8601 calendar system is the modern civil calendar system used today\n * in most of the world. This API assumes that all calendar systems use the same\n * representation, this class, for time-of-day.\n *\n * ### Static properties of Class {@link LocalTime}\n *\n * LocalTime.MIN\n *\n * The minimum supported {@link LocalTime}, '00:00'.\n * This is the time of midnight at the start of the day.\n *\n * LocalTime.MAX\n *\n * The maximum supported {@link LocalTime}, '23:59:59.999999999'.\n * This is the time just before midnight at the end of the day.\n *\n * LocalTime.MIDNIGHT\n *\n * The time of midnight at the start of the day, '00:00'.\n *\n * LocalTime.NOON\n *\n * The time of noon in the middle of the day, '12:00'.\n *\n * LocalTime.HOURS_PER_DAY\n *\n * Hours per day.\n *\n * LocalTime.MINUTES_PER_HOUR\n *\n * Minutes per hour.\n *\n * LocalTime.MINUTES_PER_DAY\n *\n * Minutes per day.\n *\n * LocalTime.SECONDS_PER_MINUTE\n *\n * Seconds per minute.\n *\n * LocalTime.SECONDS_PER_HOUR\n *\n * Seconds per hour.\n *\n * LocalTime.SECONDS_PER_DAY\n *\n * Seconds per day.\n *\n * LocalTime.MILLIS_PER_DAY\n *\n * Milliseconds per day.\n *\n * LocalTime.MICROS_PER_DAY\n *\n * Microseconds per day.\n *\n * LocalTime.NANOS_PER_SECOND\n *\n * Nanos per second.\n *\n * LocalTime.NANOS_PER_MINUTE\n *\n * Nanos per minute.\n *\n * LocalTime.NANOS_PER_HOUR\n *\n * Nanos per hour.\n *\n * LocalTime.NANOS_PER_DAY\n *\n * Nanos per day.\n *\n */\nexport class LocalTime extends Temporal /** implements Temporal, TemporalAdjuster */ {\n /**\n * Obtains the current time from the specified clock.\n * If no argument is specified the system default clock is queried,\n * if a zone-id is passed a system clock with the specified zone is queried.\n *\n * This will query the specified clock to obtain the current time.\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using dependency injection.\n *\n * @param {Clock|ZoneId} clockOrZone - the zone ID or clock to use, if null Clock.systemDefaultZone() is used.\n * @return {LocalTime} the current time using the system clock, not null\n */\n static now(clockOrZone) {\n if (clockOrZone == null){\n return LocalTime._now(Clock.systemDefaultZone());\n } else if (clockOrZone instanceof Clock){\n return LocalTime._now(clockOrZone);\n } else {\n return LocalTime._now(Clock.system(clockOrZone));\n }\n }\n\n /**\n * Obtains the current time from the specified clock.\n *\n * This will query the specified clock to obtain the current time.\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using dependency injection (see {@link Clock}).\n *\n * @param {Clock} [clock=Clock.systemDefaultZone()] - the clock to use, not null\n * @return {LocalTime} the current time, not null\n */\n static _now(clock = Clock.systemDefaultZone()) {\n requireNonNull(clock, 'clock');// inline OffsetTime factory to avoid creating object and InstantProvider checks\n return LocalTime.ofInstant(clock.instant(), clock.zone());\n }\n\n /**\n * obtain a LocalTime from an Instant in the specified time-zone or, if null\n * in the system default time-zone\n *\n * @param {!Instant} instant\n * @param {ZoneId} [zone=ZoneId.systemDefault()], defaults to ZoneId.systemDefault()\n * @returns {LocalTime} the current date, not null\n */\n static ofInstant(instant, zone=ZoneId.systemDefault()){\n const offset = zone.rules().offset(instant);\n let secsOfDay = MathUtil.intMod(instant.epochSecond(), LocalTime.SECONDS_PER_DAY);\n secsOfDay = MathUtil.intMod((secsOfDay + offset.totalSeconds()), LocalTime.SECONDS_PER_DAY);\n if (secsOfDay < 0) {\n secsOfDay += LocalTime.SECONDS_PER_DAY;\n }\n return LocalTime.ofSecondOfDay(secsOfDay, instant.nano());\n }\n\n /**\n * Obtains an instance of {@link LocalTime} from an hour, minute, second and nanosecond.\n *\n * This factory may return a cached value, but applications must not rely on this.\n *\n * @param {number} [hour=0] - the hour-of-day to represent, from 0 to 23\n * @param {number} [minute=0] - the minute-of-hour to represent, from 0 to 59\n * @param {number} [second=0] - the second-of-minute to represent, from 0 to 59\n * @param {number} [nanoOfSecond=0] - the nano-of-second to represent, from 0 to 999,999,999\n * @return {LocalTime} the local time, not null\n * @throws {DateTimeException} if the value of any field is out of range\n */\n static of(hour, minute, second, nanoOfSecond) {\n return new LocalTime(hour, minute, second, nanoOfSecond);\n }\n\n /**\n * Obtains an instance of {@link LocalTime} from a second-of-day value, with\n * associated nanos of second.\n *\n * This factory may return a cached value, but applications must not rely on this.\n *\n * @param {number} [secondOfDay=0] - the second-of-day, from `0` to `24 * 60 * 60 - 1`\n * @param {number} [nanoOfSecond=0] - the nano-of-second, from `0` to `999,999,999`\n * @return {LocalTime} the local time, not null\n * @throws {DateTimeException} if the either input value is invalid\n */\n static ofSecondOfDay(secondOfDay=0, nanoOfSecond=0) {\n ChronoField.SECOND_OF_DAY.checkValidValue(secondOfDay);\n ChronoField.NANO_OF_SECOND.checkValidValue(nanoOfSecond);\n const hours = MathUtil.intDiv(secondOfDay, LocalTime.SECONDS_PER_HOUR);\n secondOfDay -= hours * LocalTime.SECONDS_PER_HOUR;\n const minutes = MathUtil.intDiv(secondOfDay, LocalTime.SECONDS_PER_MINUTE);\n secondOfDay -= minutes * LocalTime.SECONDS_PER_MINUTE;\n return new LocalTime(hours, minutes, secondOfDay, nanoOfSecond);\n }\n\n /**\n * Obtains an instance of {@link LocalTime} from a nanos-of-day value.\n *\n * This factory may return a cached value, but applications must not rely on this.\n *\n * @param {number} [nanoOfDay=0] - the nano of day, from `0` to `24 * 60 * 60 * 1,000,000,000 - 1`\n * @return {LocalTime} the local time, not null\n * @throws {DateTimeException} if the nanos of day value is invalid\n */\n static ofNanoOfDay(nanoOfDay=0) {\n ChronoField.NANO_OF_DAY.checkValidValue(nanoOfDay);\n const hours = MathUtil.intDiv(nanoOfDay, LocalTime.NANOS_PER_HOUR);\n nanoOfDay -= hours * LocalTime.NANOS_PER_HOUR;\n const minutes = MathUtil.intDiv(nanoOfDay, LocalTime.NANOS_PER_MINUTE);\n nanoOfDay -= minutes * LocalTime.NANOS_PER_MINUTE;\n const seconds = MathUtil.intDiv(nanoOfDay, LocalTime.NANOS_PER_SECOND);\n nanoOfDay -= seconds * LocalTime.NANOS_PER_SECOND;\n return new LocalTime(hours, minutes, seconds, nanoOfDay);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link LocalTime} from a temporal object.\n *\n * A {@link TemporalAccessor} represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of {@link LocalTime}.\n *\n * The conversion uses the {@link TemporalQueries#localTime} query, which relies\n * on extracting {@link ChronoField#NANO_OF_DAY}.\n *\n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used in queries via method reference, {@link LocalTime::from}.\n *\n * @param {!TemporalAccessor} temporal - the temporal object to convert, not null\n * @return {LocalTime} the local time, not null\n * @throws {DateTimeException} if unable to convert to a {@link LocalTime}\n */\n static from(temporal) {\n requireNonNull(temporal, 'temporal');\n const time = temporal.query(TemporalQueries.localTime());\n if (time == null) {\n throw new DateTimeException(`Unable to obtain LocalTime TemporalAccessor: ${temporal}, type ${temporal.constructor != null ? temporal.constructor.name : ''}`);\n }\n return time;\n }\n\n /**\n * Obtains an instance of {@link LocalTime} from a text string using a specific formatter.\n *\n * The text is parsed using the formatter, returning a time.\n *\n * @param {!String} text - the text to parse, not null\n * @param {DateTimeFormatter} [formatter=DateTimeFormatter.ISO_LOCAL_TIME] - the formatter to use, default is\n * {@link DateTimeFormatter.ISO_LOCAL_TIME}\n * @return {LocalTime} the parsed local time, not null\n * @throws {DateTimeParseException} if the text cannot be parsed\n */\n static parse(text, formatter=DateTimeFormatter.ISO_LOCAL_TIME) {\n requireNonNull(formatter, 'formatter');\n return formatter.parse(text, LocalTime.FROM);\n }\n\n /**\n * Constructor, previously validated.\n *\n * @param {number} [hour=0] - the hour-of-day to represent, validated from 0 to 23\n * @param {number} [minute=0] - the minute-of-hour to represent, validated from 0 to 59\n * @param {number} [second=0] - the second-of-minute to represent, validated from 0 to 59\n * @param {number} [nanoOfSecond=0] - the nano-of-second to represent, validated from 0 to 999,999,999\n * @private\n */\n constructor(hour=0, minute=0, second=0, nanoOfSecond=0) {\n super();\n const _hour = MathUtil.safeToInt(hour);\n const _minute = MathUtil.safeToInt(minute);\n const _second = MathUtil.safeToInt(second);\n const _nanoOfSecond = MathUtil.safeToInt(nanoOfSecond);\n LocalTime._validate(_hour, _minute, _second, _nanoOfSecond);\n if (_minute === 0 && _second === 0 && _nanoOfSecond === 0) {\n if (!LocalTime.HOURS[_hour]) {\n this._hour = _hour;\n this._minute = _minute;\n this._second = _second;\n this._nano = _nanoOfSecond;\n LocalTime.HOURS[_hour] = this;\n }\n return LocalTime.HOURS[_hour];\n }\n this._hour = _hour;\n this._minute = _minute;\n this._second = _second;\n this._nano = _nanoOfSecond;\n }\n\n static _validate(hour, minute, second, nanoOfSecond){\n ChronoField.HOUR_OF_DAY.checkValidValue(hour);\n ChronoField.MINUTE_OF_HOUR.checkValidValue(minute);\n ChronoField.SECOND_OF_MINUTE.checkValidValue(second);\n ChronoField.NANO_OF_SECOND.checkValidValue(nanoOfSecond);\n\n }\n //-----------------------------------------------------------------------\n /**\n * Checks if the specified field is supported.\n *\n * This checks if this time can be queried for the specified field.\n * If false, then calling {@link range} and {@link get} will throw an exception.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields are:\n *\n * * {@link ChronoField.NANO_OF_SECOND}\n * * {@link ChronoField.NANO_OF_DAY}\n * * {@link ChronoField.MICRO_OF_SECOND}\n * * {@link ChronoField.MICRO_OF_DAY}\n * * {@link ChronoField.MILLI_OF_SECOND}\n * * {@link ChronoField.MILLI_OF_DAY}\n * * {@link ChronoField.SECOND_OF_MINUTE}\n * * {@link ChronoField.SECOND_OF_DAY}\n * * {@link ChronoField.MINUTE_OF_HOUR}\n * * {@link ChronoField.MINUTE_OF_DAY}\n * * {@link ChronoField.HOUR_OF_AMPM}\n * * {@link ChronoField.CLOCK_HOUR_OF_AMPM}\n * * {@link ChronoField.HOUR_OF_DAY}\n * * {@link ChronoField.CLOCK_HOUR_OF_DAY}\n * * {@link ChronoField.AMPM_OF_DAY}\n *\n * All other {@link ChronoField} instances will return false.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.isSupportedBy}\n * passing this as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param {ChronoField|ChronoUnit} fieldOrUnit - the field to check, null returns false\n * @return {boolean} true if the field is supported on this time, false if not\n */\n isSupported(fieldOrUnit) {\n if (fieldOrUnit instanceof ChronoField) {\n return fieldOrUnit.isTimeBased();\n } else if (fieldOrUnit instanceof ChronoUnit) {\n return fieldOrUnit.isTimeBased();\n }\n return fieldOrUnit != null && fieldOrUnit.isSupportedBy(this);\n }\n\n /**\n * Gets the range of valid values for the specified field.\n *\n * The range object expresses the minimum and maximum valid values for a field.\n * This time is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return\n * appropriate range instances.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.rangeRefinedBy}\n * passing this as the argument.\n * Whether the range can be obtained is determined by the field.\n *\n * @param {ChronoField} field - the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws {DateTimeException} if the range for the field cannot be obtained\n */\n range(field) {\n requireNonNull(field);\n return super.range(field);\n }\n\n /**\n * Gets the value of the specified field from this time as an `int`.\n *\n * This queries this time for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return valid\n * values based on this time, except {@link ChronoField.NANO_OF_DAY} and {@link ChronoField.MICRO_OF_DAY}\n * which are too large to fit in an `int` and throw a {@link DateTimeException}.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing this as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {ChronoField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n get(field) {\n return this.getLong(field);\n }\n\n /**\n * Gets the value of the specified field from this time as a `long`.\n *\n * This queries this time for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return valid\n * values based on this time.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.from}\n * passing this as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {ChronoField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n getLong(field) {\n requireNonNull(field, 'field');\n if (field instanceof ChronoField) {\n return this._get0(field);\n }\n return field.getFrom(this);\n }\n\n /**\n *\n * @param {ChronoField} field\n * @returns {number}\n * @private\n */\n _get0(field) {\n switch (field) {\n case ChronoField.NANO_OF_SECOND: return this._nano;\n case ChronoField.NANO_OF_DAY: return this.toNanoOfDay();\n case ChronoField.MICRO_OF_SECOND: return MathUtil.intDiv(this._nano, 1000);\n case ChronoField.MICRO_OF_DAY: return MathUtil.intDiv(this.toNanoOfDay(), 1000);\n case ChronoField.MILLI_OF_SECOND: return MathUtil.intDiv(this._nano, 1000000);\n case ChronoField.MILLI_OF_DAY: return MathUtil.intDiv(this.toNanoOfDay(), 1000000);\n case ChronoField.SECOND_OF_MINUTE: return this._second;\n case ChronoField.SECOND_OF_DAY: return this.toSecondOfDay();\n case ChronoField.MINUTE_OF_HOUR: return this._minute;\n case ChronoField.MINUTE_OF_DAY: return this._hour * 60 + this._minute;\n case ChronoField.HOUR_OF_AMPM: return MathUtil.intMod(this._hour, 12);\n case ChronoField.CLOCK_HOUR_OF_AMPM: {\n const ham = MathUtil.intMod(this._hour, 12);\n return (ham % 12 === 0 ? 12 : ham);\n }\n case ChronoField.HOUR_OF_DAY: return this._hour;\n case ChronoField.CLOCK_HOUR_OF_DAY: return (this._hour === 0 ? 24 : this._hour);\n case ChronoField.AMPM_OF_DAY: return MathUtil.intDiv(this._hour, 12);\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the hour-of-day field.\n *\n * @return {number} the hour-of-day, from 0 to 23\n */\n hour() {\n return this._hour;\n }\n\n /**\n * Gets the minute-of-hour field.\n *\n * @return {number} the minute-of-hour, from 0 to 59\n */\n minute() {\n return this._minute;\n }\n\n /**\n * Gets the second-of-minute field.\n *\n * @return {number} the second-of-minute, from 0 to 59\n */\n second() {\n return this._second;\n }\n\n /**\n * Gets the nano-of-second field.\n *\n * @return {number} the nano-of-second, from 0 to 999,999,999\n */\n nano() {\n return this._nano;\n }\n\n /**\n * Returns an adjusted copy of this time.\n *\n * This returns a new {@link LocalTime}, based on this one, with the time adjusted.\n * The adjustment takes place using the specified adjuster strategy object.\n * Read the documentation of the adjuster to understand what adjustment will be made.\n *\n * A simple adjuster might simply set the one of the fields, such as the hour field.\n * A more complex adjuster might set the time to the last hour of the day.\n *\n * The result of this method is obtained by invoking the\n * {@link TemporalAdjuster.adjustInto} method on the\n * specified adjuster passing this as the argument.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAdjuster} adjuster - the adjuster to use, not null\n * @return {LocalTime} a {@link LocalTime} based on this with the adjustment made, not null\n * @throws {DateTimeException} if the adjustment cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n withAdjuster(adjuster) {\n requireNonNull(adjuster, 'adjuster');\n // optimizations\n if (adjuster instanceof LocalTime) {\n return adjuster;\n }\n assert(typeof adjuster.adjustInto === 'function', 'adjuster', IllegalArgumentException);\n return adjuster.adjustInto(this);\n }\n\n /**\n * Returns a copy of this time with the specified field set to a new value.\n *\n * This returns a new {@link LocalTime}, based on this one, with the value\n * for the specified field changed.\n * This can be used to change any supported field, such as the hour, minute or second.\n * If it is not possible to set the value, because the field is not supported or for\n * some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the adjustment is implemented here.\n * The supported fields behave as follows:\n *\n * * {@link ChronoField.NANO_OF_SECOND} -\n * Returns a {@link LocalTime} with the specified nano-of-second.\n * The hour, minute and second will be unchanged.\n * * {@link ChronoField.NANO_OF_DAY} -\n * Returns a {@link LocalTime} with the specified nano-of-day.\n * This completely replaces the time and is equivalent to {@link ofNanoOfDay}.\n * * {@link ChronoField.MICRO_OF_SECOND} -\n * Returns a {@link LocalTime} with the nano-of-second replaced by the specified\n * micro-of-second multiplied by 1,000.\n * The hour, minute and second will be unchanged.\n * * {@link ChronoField.MICRO_OF_DAY} -\n * Returns a {@link LocalTime} with the specified micro-of-day.\n * This completely replaces the time and is equivalent to using {@link ofNanoOfDay}\n * with the micro-of-day multiplied by 1,000.\n * * {@link ChronoField.MILLI_OF_SECOND} -\n * Returns a {@link LocalTime} with the nano-of-second replaced by the specified\n * milli-of-second multiplied by 1,000,000.\n * The hour, minute and second will be unchanged.\n * * {@link ChronoField.MILLI_OF_DAY} -\n * Returns a {@link LocalTime} with the specified milli-of-day.\n * This completely replaces the time and is equivalent to using {@link ofNanoOfDay}\n * with the milli-of-day multiplied by 1,000,000.\n * * {@link ChronoField.SECOND_OF_MINUTE} -\n * Returns a {@link LocalTime} with the specified second-of-minute.\n * The hour, minute and nano-of-second will be unchanged.\n * * {@link ChronoField.SECOND_OF_DAY} -\n * Returns a {@link LocalTime} with the specified second-of-day.\n * The nano-of-second will be unchanged.\n * * {@link ChronoField.MINUTE_OF_HOUR} -\n * Returns a {@link LocalTime} with the specified minute-of-hour.\n * The hour, second-of-minute and nano-of-second will be unchanged.\n * * {@link ChronoField.MINUTE_OF_DAY} -\n * Returns a {@link LocalTime} with the specified minute-of-day.\n * The second-of-minute and nano-of-second will be unchanged.\n * * {@link ChronoField.HOUR_OF_AMPM} -\n * Returns a {@link LocalTime} with the specified hour-of-am-pm.\n * The AM/PM, minute-of-hour, second-of-minute and nano-of-second will be unchanged.\n * * {@link ChronoField.CLOCK_HOUR_OF_AMPM} -\n * Returns a {@link LocalTime} with the specified clock-hour-of-am-pm.\n * The AM/PM, minute-of-hour, second-of-minute and nano-of-second will be unchanged.\n * * {@link ChronoField.HOUR_OF_DAY} -\n * Returns a {@link LocalTime} with the specified hour-of-day.\n * The minute-of-hour, second-of-minute and nano-of-second will be unchanged.\n * * {@link ChronoField.CLOCK_HOUR_OF_DAY} -\n * Returns a {@link LocalTime} with the specified clock-hour-of-day.\n * The minute-of-hour, second-of-minute and nano-of-second will be unchanged.\n * * {@link ChronoField.AMPM_OF_DAY} -\n * Returns a {@link LocalTime} with the specified AM/PM.\n * The hour-of-am-pm, minute-of-hour, second-of-minute and nano-of-second will be unchanged.\n *\n * In all cases, if the new value is outside the valid range of values for the field\n * then a {@link DateTimeException} will be thrown.\n *\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.adjustInto}\n * passing this as the argument. In this case, the field determines\n * whether and how to adjust the instant.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {!TemporalField} field - the field to set in the result, not null\n * @param {number} newValue - the new value of the field in the result\n * @return {LocalTime} a {@link LocalTime} based on this with the specified field set, not null\n * @throws {DateTimeException} if the field cannot be set\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n withFieldValue(field, newValue) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n if (field instanceof ChronoField) {\n field.checkValidValue(newValue);\n switch (field) {\n case ChronoField.NANO_OF_SECOND: return this.withNano(newValue);\n case ChronoField.NANO_OF_DAY: return LocalTime.ofNanoOfDay(newValue);\n case ChronoField.MICRO_OF_SECOND: return this.withNano(newValue * 1000);\n case ChronoField.MICRO_OF_DAY: return LocalTime.ofNanoOfDay(newValue * 1000);\n case ChronoField.MILLI_OF_SECOND: return this.withNano( newValue * 1000000);\n case ChronoField.MILLI_OF_DAY: return LocalTime.ofNanoOfDay(newValue * 1000000);\n case ChronoField.SECOND_OF_MINUTE: return this.withSecond(newValue);\n case ChronoField.SECOND_OF_DAY: return this.plusSeconds(newValue - this.toSecondOfDay());\n case ChronoField.MINUTE_OF_HOUR: return this.withMinute(newValue);\n case ChronoField.MINUTE_OF_DAY: return this.plusMinutes(newValue - (this._hour * 60 + this._minute));\n case ChronoField.HOUR_OF_AMPM: return this.plusHours(newValue - MathUtil.intMod(this._hour, 12));\n case ChronoField.CLOCK_HOUR_OF_AMPM: return this.plusHours((newValue === 12 ? 0 : newValue) - MathUtil.intMod(this._hour, 12));\n case ChronoField.HOUR_OF_DAY: return this.withHour(newValue);\n case ChronoField.CLOCK_HOUR_OF_DAY: return this.withHour((newValue === 24 ? 0 : newValue));\n case ChronoField.AMPM_OF_DAY: return this.plusHours((newValue - MathUtil.intDiv(this._hour, 12)) * 12);\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.adjustInto(this, newValue);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalTime} with the hour-of-day value altered.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} [hour=0] - the hour-of-day to set in the result, from 0 to 23\n * @return {LocalTime} a {@link LocalTime} based on this time with the requested hour, not null\n * @throws {DateTimeException} if the hour value is invalid\n */\n withHour(hour=0) {\n if (this._hour === hour) {\n return this;\n }\n return new LocalTime(hour, this._minute, this._second, this._nano);\n }\n\n /**\n * Returns a copy of this {@link LocalTime} with the minute-of-hour value altered.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} [minute=0] - the minute-of-hour to set in the result, from 0 to 59\n * @return {LocalTime} a {@link LocalTime} based on this time with the requested minute, not null\n * @throws {DateTimeException} if the minute value is invalid\n */\n withMinute(minute=0) {\n if (this._minute === minute) {\n return this;\n }\n return new LocalTime(this._hour, minute, this._second, this._nano);\n }\n\n /**\n * Returns a copy of this {@link LocalTime} with the second-of-minute value altered.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} [second=0] - the second-of-minute to set in the result, from 0 to 59\n * @return {LocalTime} a {@link LocalTime} based on this time with the requested second, not null\n * @throws {DateTimeException} if the second value is invalid\n */\n withSecond(second=0) {\n if (this._second === second) {\n return this;\n }\n return new LocalTime(this._hour, this._minute, second, this._nano);\n }\n\n /**\n * Returns a copy of this {@link LocalTime} with the nano-of-second value altered.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} [nanoOfSecond=0] - the nano-of-second to set in the result, from 0 to 999,999,999\n * @return {LocalTime} a {@link LocalTime} based on this time with the requested nanosecond, not null\n * @throws {DateTimeException} if the nanos value is invalid\n */\n withNano(nanoOfSecond=0) {\n if (this._nano === nanoOfSecond) {\n return this;\n }\n return new LocalTime(this._hour, this._minute, this._second, nanoOfSecond);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalTime} with the time truncated.\n *\n * Truncating the time returns a copy of the original time with fields\n * smaller than the specified unit set to zero.\n * For example, truncating with the {@link ChronoUnit.MINUTES} minutes unit\n * will set the second-of-minute and nano-of-second field to zero.\n *\n * The unit must have a duration (see {@link TemporalUnit#getDuration})\n * that divides into the length of a standard day without remainder.\n * This includes all supplied time units on {@link ChronoUnit} and\n * {@link ChronoUnit.DAYS}. Other units throw an exception.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {!ChronoUnit} unit - the unit to truncate to, not null\n * @return {LocalTime} a {@link LocalTime} based on this time with the time truncated, not null\n * @throws {DateTimeException} if unable to truncate\n */\n truncatedTo(unit) {\n requireNonNull(unit, 'unit');\n if (unit === ChronoUnit.NANOS) {\n return this;\n }\n const unitDur = unit.duration();\n if (unitDur.seconds() > LocalTime.SECONDS_PER_DAY) {\n throw new DateTimeException('Unit is too large to be used for truncation');\n }\n const dur = unitDur.toNanos();\n if (MathUtil.intMod(LocalTime.NANOS_PER_DAY, dur) !== 0) {\n throw new DateTimeException('Unit must divide into a standard day without remainder');\n }\n const nod = this.toNanoOfDay();\n return LocalTime.ofNanoOfDay(MathUtil.intDiv(nod, dur) * dur);\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * Returns a copy of this date with the specified period added.\n *\n * This method returns a new time based on this time with the specified period added.\n * The amount is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link plus}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAmount} amount - the amount to add, not null\n * @return {LocalTime} a {@link LocalTime} based on this time with the addition made, not null\n * @throws {DateTimeException} if the addition cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n plusAmount(amount) {\n requireNonNull(amount, 'amount');\n return amount.addTo(this);\n }\n\n /**\n * Returns a copy of this time with the specified period added.\n *\n * This method returns a new time based on this time with the specified period added.\n * This can be used to add any period that is defined by a unit, for example to add hours, minutes or seconds.\n * The unit is responsible for the details of the calculation, including the resolution\n * of any edge cases in the calculation.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} amountToAdd - the amount of the unit to add to the result, may be negative\n * @param {TemporalUnit} unit - the unit of the period to add, not null\n * @return {LocalTime} a {@link LocalTime} based on this time with the specified period added, not null\n * @throws {DateTimeException} if the unit cannot be added to this type\n */\n plusAmountUnit(amountToAdd, unit) {\n requireNonNull(unit, 'unit');\n if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.NANOS: return this.plusNanos(amountToAdd);\n case ChronoUnit.MICROS: return this.plusNanos(MathUtil.intMod(amountToAdd, LocalTime.MICROS_PER_DAY) * 1000);\n case ChronoUnit.MILLIS: return this.plusNanos(MathUtil.intMod(amountToAdd, LocalTime.MILLIS_PER_DAY) * 1000000);\n case ChronoUnit.SECONDS: return this.plusSeconds(amountToAdd);\n case ChronoUnit.MINUTES: return this.plusMinutes(amountToAdd);\n case ChronoUnit.HOURS: return this.plusHours(amountToAdd);\n case ChronoUnit.HALF_DAYS: return this.plusHours(MathUtil.intMod(amountToAdd, 2) * 12);\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n return unit.addTo(this, amountToAdd);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalTime} with the specified period in hours added.\n *\n * This adds the specified number of hours to this time, returning a new time.\n * The calculation wraps around midnight.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} hoursToAdd - the hours to add, may be negative\n * @return {LocalTime} a {@link LocalTime} based on this time with the hours added, not null\n */\n plusHours(hoursToAdd) {\n if (hoursToAdd === 0) {\n return this;\n }\n\n const newHour = MathUtil.intMod(MathUtil.intMod(hoursToAdd, LocalTime.HOURS_PER_DAY) + this._hour + LocalTime.HOURS_PER_DAY, LocalTime.HOURS_PER_DAY);\n return new LocalTime(newHour, this._minute, this._second, this._nano);\n }\n\n /**\n * Returns a copy of this {@link LocalTime} with the specified period in minutes added.\n *\n * This adds the specified number of minutes to this time, returning a new time.\n * The calculation wraps around midnight.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} minutesToAdd - the minutes to add, may be negative\n * @return {LocalTime} a {@link LocalTime} based on this time with the minutes added, not null\n */\n plusMinutes(minutesToAdd) {\n if (minutesToAdd === 0) {\n return this;\n }\n const mofd = this._hour * LocalTime.MINUTES_PER_HOUR + this._minute;\n const newMofd = MathUtil.intMod(MathUtil.intMod(minutesToAdd, LocalTime.MINUTES_PER_DAY) + mofd + LocalTime.MINUTES_PER_DAY, LocalTime.MINUTES_PER_DAY);\n if (mofd === newMofd) {\n return this;\n }\n const newHour = MathUtil.intDiv(newMofd, LocalTime.MINUTES_PER_HOUR);\n const newMinute = MathUtil.intMod(newMofd, LocalTime.MINUTES_PER_HOUR);\n return new LocalTime(newHour, newMinute, this._second, this._nano);\n }\n\n /**\n * Returns a copy of this {@link LocalTime} with the specified period in seconds added.\n *\n * This adds the specified number of seconds to this time, returning a new time.\n * The calculation wraps around midnight.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} secondsToAdd - the seconds to add, may be negative\n * @return {LocalTime} a {@link LocalTime} based on this time with the seconds added, not null\n */\n plusSeconds(secondsToAdd) {\n if (secondsToAdd === 0) {\n return this;\n }\n const sofd = this._hour * LocalTime.SECONDS_PER_HOUR +\n this._minute * LocalTime.SECONDS_PER_MINUTE + this._second;\n const newSofd = MathUtil.intMod((MathUtil.intMod(secondsToAdd, LocalTime.SECONDS_PER_DAY) + sofd + LocalTime.SECONDS_PER_DAY), LocalTime.SECONDS_PER_DAY);\n if (sofd === newSofd) {\n return this;\n }\n const newHour = MathUtil.intDiv(newSofd, LocalTime.SECONDS_PER_HOUR);\n const newMinute = MathUtil.intMod(MathUtil.intDiv(newSofd, LocalTime.SECONDS_PER_MINUTE), LocalTime.MINUTES_PER_HOUR);\n const newSecond = MathUtil.intMod(newSofd, LocalTime.SECONDS_PER_MINUTE);\n return new LocalTime(newHour, newMinute, newSecond, this._nano);\n }\n\n /**\n * Returns a copy of this {@link LocalTime} with the specified period in nanoseconds added.\n *\n * This adds the specified number of nanoseconds to this time, returning a new time.\n * The calculation wraps around midnight.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} nanosToAdd - the nanos to add, may be negative\n * @return {LocalTime} a {@link LocalTime} based on this time with the nanoseconds added, not null\n */\n plusNanos(nanosToAdd) {\n if (nanosToAdd === 0) {\n return this;\n }\n const nofd = this.toNanoOfDay();\n const newNofd = MathUtil.intMod((MathUtil.intMod(nanosToAdd, LocalTime.NANOS_PER_DAY) + nofd + LocalTime.NANOS_PER_DAY), LocalTime.NANOS_PER_DAY);\n if (nofd === newNofd) {\n return this;\n }\n const newHour = MathUtil.intDiv(newNofd, LocalTime.NANOS_PER_HOUR);\n const newMinute = MathUtil.intMod(MathUtil.intDiv(newNofd, LocalTime.NANOS_PER_MINUTE), LocalTime.MINUTES_PER_HOUR);\n const newSecond = MathUtil.intMod(MathUtil.intDiv(newNofd, LocalTime.NANOS_PER_SECOND), LocalTime.SECONDS_PER_MINUTE);\n const newNano = MathUtil.intMod(newNofd, LocalTime.NANOS_PER_SECOND);\n return new LocalTime(newHour, newMinute, newSecond, newNano);\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * Returns a copy of this time with the specified period subtracted.\n *\n * This method returns a new time based on this time with the specified period subtracted.\n * The amount is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link minus}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAmount} amount - the amount to subtract, not null\n * @return {LocalTime} a {@link LocalTime} based on this time with the subtraction made, not null\n * @throws {DateTimeException} if the subtraction cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n\n minusAmount(amount) {\n requireNonNull(amount, 'amount');\n return amount.subtractFrom(this);\n }\n\n /**\n * Returns a copy of this time with the specified period subtracted.\n *\n * This method returns a new time based on this time with the specified period subtracted.\n * This can be used to subtract any period that is defined by a unit, for example to subtract hours, minutes or seconds.\n * The unit is responsible for the details of the calculation, including the resolution\n * of any edge cases in the calculation.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} amountToSubtract - the amount of the unit to subtract from the result, may be negative\n * @param {ChronoUnit} unit - the unit of the period to subtract, not null\n * @return {LocalTime} a {@link LocalTime} based on this time with the specified period subtracted, not null\n * @throws {DateTimeException} if the unit cannot be added to this type\n */\n minusAmountUnit(amountToSubtract, unit) {\n requireNonNull(unit, 'unit');\n return this.plusAmountUnit(-1 * amountToSubtract, unit);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalTime} with the specified period in hours subtracted.\n *\n * This subtracts the specified number of hours from this time, returning a new time.\n * The calculation wraps around midnight.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} hoursToSubtract - the hours to subtract, may be negative\n * @return {LocalTime} a {@link LocalTime} based on this time with the hours subtracted, not null\n */\n minusHours(hoursToSubtract) {\n return this.plusHours(-1 * MathUtil.intMod(hoursToSubtract, LocalTime.HOURS_PER_DAY));\n }\n\n /**\n * Returns a copy of this {@link LocalTime} with the specified period in minutes subtracted.\n *\n * This subtracts the specified number of minutes from this time, returning a new time.\n * The calculation wraps around midnight.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} minutesToSubtract - the minutes to subtract, may be negative\n * @return {LocalTime} a {@link LocalTime} based on this time with the minutes subtracted, not null\n */\n minusMinutes(minutesToSubtract) {\n return this.plusMinutes(-1 * MathUtil.intMod(minutesToSubtract, LocalTime.MINUTES_PER_DAY));\n }\n\n /**\n * Returns a copy of this {@link LocalTime} with the specified period in seconds subtracted.\n *\n * This subtracts the specified number of seconds from this time, returning a new time.\n * The calculation wraps around midnight.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} secondsToSubtract - the seconds to subtract, may be negative\n * @return {LocalTime} a {@link LocalTime} based on this time with the seconds subtracted, not null\n */\n minusSeconds(secondsToSubtract) {\n return this.plusSeconds(-1 * MathUtil.intMod(secondsToSubtract, LocalTime.SECONDS_PER_DAY));\n }\n\n /**\n * Returns a copy of this {@link LocalTime} with the specified period in nanoseconds subtracted.\n *\n * This subtracts the specified number of nanoseconds from this time, returning a new time.\n * The calculation wraps around midnight.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} nanosToSubtract - the nanos to subtract, may be negative\n * @return {LocalTime} a {@link LocalTime} based on this time with the nanoseconds subtracted, not null\n */\n minusNanos(nanosToSubtract) {\n return this.plusNanos(-1 * MathUtil.intMod(nanosToSubtract, LocalTime.NANOS_PER_DAY));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this time using the specified query.\n *\n * This queries this time using the specified query strategy object.\n * The {@link TemporalQuery} object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n *\n * The result of this method is obtained by invoking the\n * {@link TemporalQuery#queryFrom} method on the\n * specified query passing this as the argument.\n *\n * @param {TemporalQuery} query - the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws {DateTimeException} if unable to query (defined by the query)\n * @throws {ArithmeticException} if numeric overflow occurs (defined by the query)\n */\n query(query) {\n requireNonNull(query, 'query');\n if (query === TemporalQueries.precision()) {\n return ChronoUnit.NANOS;\n } else if (query === TemporalQueries.localTime()) {\n return this;\n }\n // inline TemporalAccessor.super.query(query) as an optimization\n if (query === TemporalQueries.chronology() || query === TemporalQueries.zoneId() ||\n query === TemporalQueries.zone() || query === TemporalQueries.offset() ||\n query === TemporalQueries.localDate()) {\n return null;\n }\n return query.queryFrom(this);\n }\n\n /**\n * Adjusts the specified temporal object to have the same time as this object.\n *\n * This returns a temporal object of the same observable type as the input\n * with the time changed to be the same as this.\n *\n * The adjustment is equivalent to using {@link Temporal.with}\n * passing {@link ChronoField.NANO_OF_DAY} as the field.\n *\n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal.with}:\n *
\n     *   // these two lines are equivalent, but the second approach is recommended\n     *   temporal = thisLocalTime.adjustInto(temporal);\n     *   temporal = temporal.with(thisLocalTime);\n     * 
\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAdjuster} temporal - the target object to be adjusted, not null\n * @return {Temporal} the adjusted object, not null\n * @throws {DateTimeException} if unable to make the adjustment\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n adjustInto(temporal) {\n return temporal.with(LocalTime.NANO_OF_DAY, this.toNanoOfDay());\n }\n\n /**\n * Calculates the period between this time and another time in\n * terms of the specified unit.\n *\n * This calculates the period between two times in terms of a single unit.\n * The start and end points are this and the specified time.\n * The result will be negative if the end is before the start.\n * The {@link Temporal} passed to this method must be a {@link LocalTime}.\n * For example, the period in hours between two times can be calculated\n * using {@link startTime.until}.\n *\n * The calculation returns a whole number, representing the number of\n * complete units between the two times.\n * For example, the period in hours between 11:30 and 13:29 will only\n * be one hour as it is one minute short of two hours.\n *\n * This method operates in association with {@link TemporalUnit.between}.\n * The result of this method is a `long` representing the amount of\n * the specified unit. By contrast, the result of {@link between} is an\n * object that can be used directly in addition/subtraction:\n *
\n     *   long period = start.until(end, HOURS);   // this method\n     *   dateTime.plus(HOURS.between(start, end));      // use in plus/minus\n     * 
\n *\n * The calculation is implemented in this method for {@link ChronoUnit}.\n * The units {@link ChronoUnit.NANOS}, {@link ChronoUnit.MICROS}, {@link ChronoUnit.MILLIS}, {@link ChronoUnit.SECONDS},\n * {@link ChronoUnit.MINUTES}, {@link ChronoUnit.HOURS} and {@link ChronoUnit.HALF_DAYS} are supported.\n * Other {@link ChronoUnit} values will throw an exception.\n *\n * If the unit is not a {@link ChronoUnit}, then the result of this method\n * is obtained by invoking {@link TemporalUnit.between}\n * passing this as the first argument and the input temporal as\n * the second argument.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAccessor} endExclusive - the end time, which is converted to a {@link LocalTime}, not null\n * @param {TemporalUnit} unit - the unit to measure the period in, not null\n * @return {number} the amount of the period between this time and the end time\n * @throws {DateTimeException} if the period cannot be calculated\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n until(endExclusive, unit) {\n requireNonNull(endExclusive, 'endExclusive');\n requireNonNull(unit, 'unit');\n const end = LocalTime.from(endExclusive);\n if (unit instanceof ChronoUnit) {\n const nanosUntil = end.toNanoOfDay() - this.toNanoOfDay(); // no overflow\n switch (unit) {\n case ChronoUnit.NANOS: return nanosUntil;\n case ChronoUnit.MICROS: return MathUtil.intDiv(nanosUntil, 1000);\n case ChronoUnit.MILLIS: return MathUtil.intDiv(nanosUntil, 1000000);\n case ChronoUnit.SECONDS: return MathUtil.intDiv(nanosUntil, LocalTime.NANOS_PER_SECOND);\n case ChronoUnit.MINUTES: return MathUtil.intDiv(nanosUntil, LocalTime.NANOS_PER_MINUTE);\n case ChronoUnit.HOURS: return MathUtil.intDiv(nanosUntil, LocalTime.NANOS_PER_HOUR);\n case ChronoUnit.HALF_DAYS: return MathUtil.intDiv(nanosUntil, (12 * LocalTime.NANOS_PER_HOUR));\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n return unit.between(this, end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this time with a date to create a {@link LocalDateTime}.\n *\n * This returns a {@link LocalDateTime} formed from this time at the specified date.\n * All possible combinations of date and time are valid.\n *\n * @param {LocalDate} date - the date to combine with, not null\n * @return {LocalDateTime} the local date-time formed from this time and the specified date, not null\n */\n atDate(date) {\n return LocalDateTime.of(date, this);\n }\n\n /**\n * Combines this time with an offset to create an {@link OffsetTime}.\n *\n * This returns an {@link OffsetTime} formed from this time at the specified offset.\n * All possible combinations of time and offset are valid.\n *\n * @param {OffsetTime} offset - the offset to combine with, not null\n * @return {OffsetTime} the offset time formed from this time and the specified offset, not null\n */\n /*\n atOffset(offset) {\n return OffsetTime.of(this, offset);\n }\n*/\n\n //-----------------------------------------------------------------------\n /**\n * Extracts the time as seconds of day, from `0` to `24 * 60 * 60 - 1`.\n *\n * @return {number} the second-of-day equivalent to this time\n */\n toSecondOfDay() {\n let total = this._hour * LocalTime.SECONDS_PER_HOUR;\n total += this._minute * LocalTime.SECONDS_PER_MINUTE;\n total += this._second;\n return total;\n }\n\n /**\n * Extracts the time as nanos of day, from `0` to `24 * 60 * 60 * 1,000,000,000 - 1`.\n *\n * @return {number} the nano of day equivalent to this time\n */\n toNanoOfDay() {\n let total = this._hour * LocalTime.NANOS_PER_HOUR;\n total += this._minute * LocalTime.NANOS_PER_MINUTE;\n total += this._second * LocalTime.NANOS_PER_SECOND;\n total += this._nano;\n return total;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this {@link LocalTime} to another time.\n *\n * The comparison is based on the time-line position of the local times within a day.\n * It is 'consistent with equals', as defined by {@link Comparable}.\n *\n * @param {LocalTime} other - the other time to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n * @throws {NullPointerException} if `other` is null\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, LocalTime, 'other');\n let cmp = MathUtil.compareNumbers(this._hour, other._hour);\n if (cmp === 0) {\n cmp = MathUtil.compareNumbers(this._minute, other._minute);\n if (cmp === 0) {\n cmp = MathUtil.compareNumbers(this._second, other._second);\n if (cmp === 0) {\n cmp = MathUtil.compareNumbers(this._nano, other._nano);\n }\n }\n }\n return cmp;\n }\n\n /**\n * Checks if this {@link LocalTime} is after the specified time.\n *\n * The comparison is based on the time-line position of the time within a day.\n *\n * @param {LocalTime} other - the other time to compare to, not null\n * @return {boolean} true if this is after the specified time\n * @throws {NullPointerException} if `other` is null\n */\n isAfter(other) {\n return this.compareTo(other) > 0;\n }\n\n /**\n * Checks if this {@link LocalTime} is before the specified time.\n *\n * The comparison is based on the time-line position of the time within a day.\n *\n * @param {LocalTime} other - the other time to compare to, not null\n * @return {boolean} true if this point is before the specified time\n * @throws {NullPointerException} if `other` is null\n */\n isBefore(other) {\n return this.compareTo(other) < 0;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this time is equal to another time.\n *\n * The comparison is based on the time-line position of the time within a day.\n *\n * Only objects of type {@link LocalTime} are compared, other types return false.\n * To compare the date of two {@link TemporalAccessor} instances, use\n * {@link ChronoField#NANO_OF_DAY} as a comparator.\n *\n * @param {*} other - the object to check, null returns false\n * @return {boolean} true if this is equal to the other time\n */\n equals(other) {\n if (this === other) {\n return true;\n }\n if (other instanceof LocalTime) {\n return this._hour === other._hour && this._minute === other._minute &&\n this._second === other._second && this._nano === other._nano;\n }\n return false;\n }\n\n /**\n * A hash code for this time.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n const nod = this.toNanoOfDay();\n return MathUtil.hash(nod);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this time as a string, such as `10:15`.\n *\n * The output will be one of the following ISO-8601 formats:\n *\n * * {@link HH:mm}\n * * {@link HH:mm:ss}\n * * {@link HH:mm:ss.SSS}\n * * {@link HH:mm:ss.SSSSSS}\n * * {@link HH:mm:ss.SSSSSSSSS}\n *\n * The format used will be the shortest that outputs the full value of\n * the time where the omitted parts are implied to be zero.\n *\n * @return {string} a string representation of this time, not null\n */\n toString() {\n let buf = '';\n const hourValue = this._hour;\n const minuteValue = this._minute;\n const secondValue = this._second;\n const nanoValue = this._nano;\n buf += hourValue < 10 ? '0' : '';\n buf += hourValue;\n buf += minuteValue < 10 ? ':0' : ':';\n buf += minuteValue;\n if (secondValue > 0 || nanoValue > 0) {\n buf += secondValue < 10 ? ':0' : ':';\n buf += secondValue;\n if (nanoValue > 0) {\n buf += '.';\n if(MathUtil.intMod(nanoValue, 1000000) === 0) {\n buf += ('' + (MathUtil.intDiv(nanoValue, 1000000) + 1000)).substring(1);\n } else if (MathUtil.intMod(nanoValue, 1000) === 0) {\n buf += ('' + (MathUtil.intDiv(nanoValue, 1000) + 1000000)).substring(1);\n } else {\n buf += ('' + (nanoValue + 1000000000)).substring(1);\n }\n }\n }\n return buf;\n }\n\n /**\n *\n * @return {string} same as {@link LocalTime.toString}\n */\n toJSON() {\n return this.toString();\n }\n\n /**\n * Outputs this time as a string using the formatter.\n *\n * @param {DateTimeFormatter} formatter - the formatter to use, not null\n * @return {string} the formatted time string, not null\n * @throws {DateTimeException} if an error occurs during printing\n */\n format(formatter) {\n requireNonNull(formatter, 'formatter');\n return formatter.format(this);\n }\n}\n\nexport function _init() {\n /**\n * Constants for the local time of each hour.\n */\n LocalTime.HOURS = [];\n for (let hour = 0; hour < 24; hour++) {\n LocalTime.of(hour, 0, 0, 0);\n }\n\n /**\n * The minimum supported {@link LocalTime}, '00:00'.\n * This is the time of midnight at the start of the day.\n */\n LocalTime.MIN = LocalTime.HOURS[0];\n /**\n * The maximum supported {@link LocalTime}, '23:59:59.999999999'.\n * This is the time just before midnight at the end of the day.\n */\n LocalTime.MAX = new LocalTime(23, 59, 59, 999999999);\n /**\n * The time of midnight at the start of the day, '00:00'.\n */\n LocalTime.MIDNIGHT = LocalTime.HOURS[0];\n /**\n * The time of noon in the middle of the day, '12:00'.\n */\n LocalTime.NOON = LocalTime.HOURS[12];\n\n LocalTime.FROM = createTemporalQuery('LocalTime.FROM', (temporal) => {\n return LocalTime.from(temporal);\n });\n}\n\n/**\n * Hours per day.\n */\nLocalTime.HOURS_PER_DAY = 24;\n/**\n * Minutes per hour.\n */\nLocalTime.MINUTES_PER_HOUR = 60;\n/**\n * Minutes per day.\n */\nLocalTime.MINUTES_PER_DAY = LocalTime.MINUTES_PER_HOUR * LocalTime.HOURS_PER_DAY;\n/**\n * Seconds per minute.\n */\nLocalTime.SECONDS_PER_MINUTE = 60;\n/**\n * Seconds per hour.\n */\nLocalTime.SECONDS_PER_HOUR = LocalTime.SECONDS_PER_MINUTE * LocalTime.MINUTES_PER_HOUR;\n/**\n * Seconds per day.\n */\nLocalTime.SECONDS_PER_DAY = LocalTime.SECONDS_PER_HOUR * LocalTime.HOURS_PER_DAY;\n/**\n * Milliseconds per day.\n */\nLocalTime.MILLIS_PER_DAY = LocalTime.SECONDS_PER_DAY * 1000;\n/**\n * Microseconds per day.\n */\nLocalTime.MICROS_PER_DAY = LocalTime.SECONDS_PER_DAY * 1000000;\n/**\n * Nanos per second.\n */\nLocalTime.NANOS_PER_SECOND = 1000000000;\n/**\n * Nanos per minute.\n */\nLocalTime.NANOS_PER_MINUTE = LocalTime.NANOS_PER_SECOND * LocalTime.SECONDS_PER_MINUTE;\n/**\n * Nanos per hour.\n */\nLocalTime.NANOS_PER_HOUR = LocalTime.NANOS_PER_MINUTE * LocalTime.MINUTES_PER_HOUR;\n/**\n * Nanos per day.\n */\nLocalTime.NANOS_PER_DAY = LocalTime.NANOS_PER_HOUR * LocalTime.HOURS_PER_DAY;\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {requireNonNull, requireInstance} from './assert';\nimport {DateTimeException, UnsupportedTemporalTypeException} from './errors';\n\nimport {Clock} from './Clock';\nimport {LocalTime} from './LocalTime';\nimport {ZonedDateTime} from './ZonedDateTime';\nimport {MathUtil} from './MathUtil';\nimport {OffsetDateTime} from './OffsetDateTime';\n\nimport {Temporal} from './temporal/Temporal';\nimport {ChronoField} from './temporal/ChronoField';\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {TemporalQueries} from './temporal/TemporalQueries';\nimport {TemporalUnit} from './temporal/TemporalUnit';\nimport {createTemporalQuery} from './temporal/TemporalQuery';\nimport {DateTimeFormatter} from './format/DateTimeFormatter';\n\nconst NANOS_PER_MILLI = 1000000;\n\n/**\n * An instantaneous point on the time-line.\n *\n * This class models a single instantaneous point on the time-line.\n * This might be used to record event time-stamps in the application.\n *\n * Time-scale\n *\n * The length of the solar day is the standard way that humans measure time.\n * This has traditionally been subdivided into 24 hours of 60 minutes of 60 seconds,\n * forming a 86400 second day.\n *\n * Modern timekeeping is based on atomic clocks which precisely define an SI second\n * relative to the transitions of a Caesium atom. The length of an SI second was defined\n * to be very close to the 86400th fraction of a day.\n *\n * Unfortunately, as the Earth rotates the length of the day varies.\n * In addition, over time the average length of the day is getting longer as the Earth slows.\n * As a result, the length of a solar day in 2012 is slightly longer than 86400 SI seconds.\n * The actual length of any given day and the amount by which the Earth is slowing\n * are not predictable and can only be determined by measurement.\n * The UT1 time-scale captures the accurate length of day, but is only available some\n * time after the day has completed.\n *\n * The UTC time-scale is a standard approach to bundle up all the additional fractions\n * of a second from UT1 into whole seconds, known as *leap-seconds*.\n * A leap-second may be added or removed depending on the Earth's rotational changes.\n * As such, UTC permits a day to have 86399 SI seconds or 86401 SI seconds where\n * necessary in order to keep the day aligned with the Sun.\n *\n * The modern UTC time-scale was introduced in 1972, introducing the concept of whole leap-seconds.\n * Between 1958 and 1972, the definition of UTC was complex, with minor sub-second leaps and\n * alterations to the length of the notional second. As of 2012, discussions are underway\n * to change the definition of UTC again, with the potential to remove leap seconds or\n * introduce other changes.\n *\n * Given the complexity of accurate timekeeping described above, this Java API defines\n * its own time-scale, the *Java Time-Scale*.\n *\n * The Java Time-Scale divides each calendar day into exactly 86400\n * subdivisions, known as seconds. These seconds may differ from the\n * SI second. It closely matches the de facto international civil time\n * scale, the definition of which changes from time to time.\n *\n * The Java Time-Scale has slightly different definitions for different\n * segments of the time-line, each based on the consensus international\n * time scale that is used as the basis for civil time. Whenever the\n * internationally-agreed time scale is modified or replaced, a new\n * segment of the Java Time-Scale must be defined for it. Each segment\n * must meet these requirements:\n *\n * * the Java Time-Scale shall closely match the underlying international\n * civil time scale;\n * * the Java Time-Scale shall exactly match the international civil\n * time scale at noon each day;\n * * the Java Time-Scale shall have a precisely-defined relationship to\n * the international civil time scale.\n *\n * There are currently, as of 2013, two segments in the Java time-scale.\n *\n * For the segment from 1972-11-03 (exact boundary discussed below) until\n * further notice, the consensus international time scale is UTC (with\n * leap seconds). In this segment, the Java Time-Scale is identical to\n * [UTC-SLS](http://www.cl.cam.ac.uk/~mgk25/time/utc-sls/).\n * This is identical to UTC on days that do not have a leap second.\n * On days that do have a leap second, the leap second is spread equally\n * over the last 1000 seconds of the day, maintaining the appearance of\n * exactly 86400 seconds per day.\n *\n * For the segment prior to 1972-11-03, extending back arbitrarily far,\n * the consensus international time scale is defined to be UT1, applied\n * proleptically, which is equivalent to the (mean) solar time on the\n * prime meridian (Greenwich). In this segment, the Java Time-Scale is\n * identical to the consensus international time scale. The exact\n * boundary between the two segments is the instant where UT1 = UTC\n * between 1972-11-03T00:00 and 1972-11-04T12:00.\n *\n * Implementations of the Java time-scale using the JSR-310 API are not\n * required to provide any clock that is sub-second accurate, or that\n * progresses monotonically or smoothly. Implementations are therefore\n * not required to actually perform the UTC-SLS slew or to otherwise be\n * aware of leap seconds. JSR-310 does, however, require that\n * implementations must document the approach they use when defining a\n * clock representing the current instant.\n * See {@link Clock} for details on the available clocks.\n *\n * The Java time-scale is used for all date-time classes.\n * This includes {@link Instant}, {@link LocalDate}, {@link LocalTime}, {@link OffsetDateTime},\n * {@link ZonedDateTime} and {@link Duration}.\n *\n * ### Static properties of Class {@link Instant}\n *\n * Instant.EPOCH\n *\n * Instant.MIN\n *\n * Instant.MAX\n *\n * Instant.MIN_SECONDS\n *\n * Instant.MAX_SECONDS\n *\n */\nexport class Instant extends Temporal {\n\n /**\n * Obtains the current instant from the system clock, or if specified\n * the current instant from the specified clock.\n *\n * This will query the specified clock to obtain the current time.\n *\n * @param {Clock} [clock=Clock.systemUTC()] - the clock to use, defaults to the system clock\n * @return {Instant} the current instant, not null\n */\n static now(clock = Clock.systemUTC()){\n return clock.instant();\n }\n\n /**\n * Obtains an instance of {@link Instant} using seconds from the\n * epoch of 1970-01-01T00:00:00Z.\n *\n * @param {number} epochSecond - the number of seconds from 1970-01-01T00:00:00Z\n * @param {number} nanoAdjustment nanoseconds start from the start of epochSecond, if null the nanosecond field is set to zero.\n * @return {Instant} an instant, not null\n * @throws DateTimeException if the instant exceeds the maximum or minimum instant\n */\n static ofEpochSecond(epochSecond, nanoAdjustment=0){\n const secs = epochSecond + MathUtil.floorDiv(nanoAdjustment, LocalTime.NANOS_PER_SECOND);\n const nos = MathUtil.floorMod(nanoAdjustment, LocalTime.NANOS_PER_SECOND);\n return Instant._create(secs, nos);\n }\n\n /**\n * Obtains an instance of {@link Instant} using milliseconds from the\n * epoch of 1970-01-01T00:00:00Z.\n *\n * The seconds and nanoseconds are extracted from the specified milliseconds.\n *\n * @param {number} epochMilli - the number of milliseconds from 1970-01-01T00:00:00Z\n * @return {Instant} an instant, not null\n * @throws DateTimeException if the instant exceeds the maximum or minimum instant\n */\n static ofEpochMilli(epochMilli) {\n const secs = MathUtil.floorDiv(epochMilli, 1000);\n const mos = MathUtil.floorMod(epochMilli, 1000);\n return Instant._create(secs, mos * 1000000);\n }\n\n /**\n * Obtains an instance of {@link Instant} from a temporal object.\n *\n * A {@link TemporalAccessor} represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of {@link Instant}.\n *\n * The conversion extracts the {@link ChronoField#INSTANT_SECONDS}\n * and {@link ChronoField#NANO_OF_SECOND} fields.\n *\n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used as a query via method reference, {@link Instant::from}.\n *\n * @param {TemporalAccessor} temporal - the temporal object to convert, not null\n * @return {Instant} the instant, not null\n * @throws DateTimeException if unable to convert to an {@link Instant}\n */\n static from(temporal) {\n try {\n const instantSecs = temporal.getLong(ChronoField.INSTANT_SECONDS);\n const nanoOfSecond = temporal.get(ChronoField.NANO_OF_SECOND);\n return Instant.ofEpochSecond(instantSecs, nanoOfSecond);\n } catch (ex) {\n throw new DateTimeException('Unable to obtain Instant from TemporalAccessor: ' +\n temporal + ', type ' + typeof temporal, ex);\n }\n }\n\n /**\n * Obtains an instance of {@link Instant} from a text string such as\n * `2007-12-03T10:15:30.000Z`.\n *\n * The string must represent a valid instant in UTC and is parsed using\n * {@link DateTimeFormatter#ISO_INSTANT}.\n *\n * @param {string} text - the text to parse, not null\n * @return {Instant} the parsed instant, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n static parse(text) {\n return DateTimeFormatter.ISO_INSTANT.parse(text, Instant.FROM);\n }\n\n /**\n *\n * @param {number} seconds\n * @param {number} nanoOfSecond\n * @returns {Instant}\n * @private\n */\n static _create(seconds, nanoOfSecond){\n if(seconds === 0 && nanoOfSecond === 0){\n return Instant.EPOCH;\n }\n return new Instant(seconds, nanoOfSecond);\n }\n\n /**\n *\n * @param {number} seconds\n * @param {number} nanoOfSecond\n * @private\n */\n static _validate(seconds, nanoOfSecond){\n if (seconds < Instant.MIN_SECONDS || seconds > Instant.MAX_SECONDS) {\n throw new DateTimeException('Instant exceeds minimum or maximum instant');\n }\n if (nanoOfSecond < 0 || nanoOfSecond > LocalTime.NANOS_PER_SECOND) {\n throw new DateTimeException('Instant exceeds minimum or maximum instant');\n }\n }\n\n /**\n *\n * @param {number} seconds\n * @param {number} nanoOfSecond\n * @private\n */\n constructor(seconds, nanoOfSecond){\n super();\n Instant._validate(seconds, nanoOfSecond);\n this._seconds = MathUtil.safeToInt(seconds);\n this._nanos = MathUtil.safeToInt(nanoOfSecond);\n }\n\n /**\n * Checks if the specified field is supported.\n *\n * This checks if this instant can be queried for the specified field.\n * If false, then calling {@link range} and {@link get} will throw an exception.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields are:\n *\n * * {@link NANO_OF_SECOND}\n * * {@link MICRO_OF_SECOND}\n * * {@link MILLI_OF_SECOND}\n * * {@link INSTANT_SECONDS}\n *\n * All other {@link ChronoField} instances will return false.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.isSupportedBy}\n * passing `this` as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param {TemporalField|TemporalUnit} fieldOrUnit - the field to check, null returns false\n * @return {boolean} true if the field is supported on this instant, false if not\n */\n isSupported(fieldOrUnit) {\n if (fieldOrUnit instanceof ChronoField) {\n return fieldOrUnit === ChronoField.INSTANT_SECONDS || fieldOrUnit === ChronoField.NANO_OF_SECOND || fieldOrUnit === ChronoField.MICRO_OF_SECOND || fieldOrUnit === ChronoField.MILLI_OF_SECOND;\n }\n if (fieldOrUnit instanceof ChronoUnit) {\n return fieldOrUnit.isTimeBased() || fieldOrUnit === ChronoUnit.DAYS;\n }\n return fieldOrUnit != null && fieldOrUnit.isSupportedBy(this);\n }\n\n /**\n * Gets the range of valid values for the specified field.\n *\n * The range object expresses the minimum and maximum valid values for a field.\n * This instant is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return\n * appropriate range instances.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.rangeRefinedBy}\n * passing `this` as the argument.\n * Whether the range can be obtained is determined by the field.\n *\n * @param {TemporalField} field - the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws DateTimeException if the range for the field cannot be obtained\n */\n range(field) {\n return super.range(field);\n }\n\n /**\n * Gets the value of the specified field from this instant as an `int`.\n *\n * This queries this instant for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return valid\n * values based on this date-time, except {@link INSTANT_SECONDS} which is too\n * large to fit in an `int` and throws a {@link DateTimeException}.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws DateTimeException if a value for the field cannot be obtained\n * @throws ArithmeticException if numeric overflow occurs\n */\n get(field) {\n return this.getLong(field);\n }\n\n /**\n * Gets the value of the specified field from this instant as a `long`.\n *\n * This queries this instant for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return valid\n * values based on this date-time.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws DateTimeException if a value for the field cannot be obtained\n * @throws ArithmeticException if numeric overflow occurs\n */\n getLong(field) {\n if (field instanceof ChronoField) {\n switch (field) {\n case ChronoField.NANO_OF_SECOND: return this._nanos;\n case ChronoField.MICRO_OF_SECOND: return MathUtil.intDiv(this._nanos, 1000);\n case ChronoField.MILLI_OF_SECOND: return MathUtil.intDiv(this._nanos, NANOS_PER_MILLI);\n case ChronoField.INSTANT_SECONDS: return this._seconds;\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.getFrom(this);\n }\n\n /**\n * Gets the number of seconds from the Java epoch of 1970-01-01T00:00:00Z.\n *\n * The epoch second count is a simple incrementing count of seconds where\n * second 0 is 1970-01-01T00:00:00Z.\n * The nanosecond part of the day is returned by {@link getNanosOfSecond}.\n *\n * @return {number} the seconds from the epoch of 1970-01-01T00:00:00Z\n */\n epochSecond(){\n return this._seconds;\n }\n\n /**\n * Gets the number of nanoseconds, later along the time-line, from the start\n * of the second.\n *\n * The nanosecond-of-second value measures the total number of nanoseconds from\n * the second returned by {@link getEpochSecond}.\n *\n * @return {number} the nanoseconds within the second, always positive, never exceeds 999,999,999\n */\n nano(){\n return this._nanos;\n }\n\n //-------------------------------------------------------------------------\n /**\n * Returns an adjusted copy of this instant.\n *\n * This returns a new {@link Instant}, based on this one, with the date adjusted.\n * The adjustment takes place using the specified adjuster strategy object.\n * Read the documentation of the adjuster to understand what adjustment will be made.\n *\n * The result of this method is obtained by invoking the\n * {@link TemporalAdjuster#adjustInto} method on the\n * specified adjuster passing `this` as the argument.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {!TemporalAdjuster} adjuster - the adjuster to use, not null\n * @return {Instant} an {@link Instant} based on `this` with the adjustment made, not null\n * @throws DateTimeException if the adjustment cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n withAdjuster(adjuster) {\n requireNonNull(adjuster, 'adjuster');\n return adjuster.adjustInto(this);\n }\n\n /**\n * Returns a copy of this instant with the specified field set to a new value.\n *\n * This returns a new {@link Instant}, based on this one, with the value\n * for the specified field changed.\n * If it is not possible to set the value, because the field is not supported or for\n * some other reason, an exception is thrown.\n *\n * If the field is a {@link ChronoField} then the adjustment is implemented here.\n * The supported fields behave as follows:\n *\n * * {@link NANO_OF_SECOND} -\n * Returns an {@link Instant} with the specified nano-of-second.\n * The epoch-second will be unchanged.\n * * {@link MICRO_OF_SECOND} -\n * Returns an {@link Instant} with the nano-of-second replaced by the specified\n * micro-of-second multiplied by 1,000. The epoch-second will be unchanged.\n * * {@link MILLI_OF_SECOND} -\n * Returns an {@link Instant} with the nano-of-second replaced by the specified\n * milli-of-second multiplied by 1,000,000. The epoch-second will be unchanged.\n * * {@link INSTANT_SECONDS} -\n * Returns an {@link Instant} with the specified epoch-second.\n * The nano-of-second will be unchanged.\n *\n *\n * In all cases, if the new value is outside the valid range of values for the field\n * then a {@link DateTimeException} will be thrown.\n *\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.adjustInto}\n * passing `this` as the argument. In this case, the field determines\n * whether and how to adjust the instant.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalField} field - the field to set in the result, not null\n * @param {number} newValue - the new value of the field in the result\n * @return {Instant} an {@link Instant} based on `this` with the specified field set, not null\n * @throws DateTimeException if the field cannot be set\n * @throws ArithmeticException if numeric overflow occurs\n */\n withFieldValue(field, newValue) {\n requireNonNull(field, 'field');\n if (field instanceof ChronoField) {\n field.checkValidValue(newValue);\n switch (field) {\n case ChronoField.MILLI_OF_SECOND: {\n const nval = newValue * NANOS_PER_MILLI;\n return (nval !== this._nanos? Instant._create(this._seconds, nval) : this);\n }\n case ChronoField.MICRO_OF_SECOND: {\n const nval = newValue * 1000;\n return (nval !== this._nanos? Instant._create(this._seconds, nval) : this);\n }\n case ChronoField.NANO_OF_SECOND: return (newValue !== this._nanos? Instant._create(this._seconds, newValue) : this);\n case ChronoField.INSTANT_SECONDS: return (newValue !== this._seconds ? Instant._create(newValue, this._nanos) : this);\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.adjustInto(this, newValue);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link Instant} truncated to the specified unit.\n *\n * Truncating the instant returns a copy of the original with fields\n * smaller than the specified unit set to zero.\n * The fields are calculated on the basis of using a UTC offset as seen\n * in {@link toString}.\n * For example, truncating with {@link ChronoUnit#MINUTES} will\n * round down to the nearest minute, setting the seconds and nanoseconds to zero.\n *\n * The unit must have a duration (see {@link TemporalUnit#getDuration})\n * that divides into the length of a standard day without remainder.\n * This includes all supplied time units on {@link ChronoUnit} and\n * {@link ChronoUnit#DAYS}. Other units throw an exception.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {!TemporalUnit} unit - the unit to truncate to, not null\n * @return {Instant} an {@link Instant} based on this instant with the time truncated, not null\n * @throws DateTimeException if the unit is invalid for truncation\n */\n truncatedTo(unit) {\n requireNonNull(unit, 'unit');\n if (unit === ChronoUnit.NANOS) {\n return this;\n }\n const unitDur = unit.duration();\n if (unitDur.seconds() > LocalTime.SECONDS_PER_DAY) {\n throw new DateTimeException('Unit is too large to be used for truncation');\n }\n const dur = unitDur.toNanos();\n if (MathUtil.intMod(LocalTime.NANOS_PER_DAY, dur) !== 0) {\n throw new DateTimeException('Unit must divide into a standard day without remainder');\n }\n const nod = MathUtil.intMod(this._seconds, LocalTime.SECONDS_PER_DAY) * LocalTime.NANOS_PER_SECOND + this._nanos;\n const result = MathUtil.intDiv(nod, dur) * dur;\n return this.plusNanos(result - nod);\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * @param {!TemporalAmount} amount\n * @return {Instant}\n * @throws DateTimeException\n * @throws ArithmeticException\n */\n plusAmount(amount) {\n requireNonNull(amount, 'amount');\n return amount.addTo(this);\n }\n\n /**\n * @param {!number} amountToAdd\n * @param {!TemporalUnit} unit\n * @return {Instant}\n * @throws DateTimeException\n * @throws ArithmeticException\n */\n plusAmountUnit(amountToAdd, unit) {\n requireNonNull(amountToAdd, 'amountToAdd');\n requireNonNull(unit, 'unit');\n requireInstance(unit, TemporalUnit);\n if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.NANOS: return this.plusNanos(amountToAdd);\n case ChronoUnit.MICROS: return this._plus(MathUtil.intDiv(amountToAdd, 1000000), MathUtil.intMod(amountToAdd, 1000000) * 1000);\n case ChronoUnit.MILLIS: return this.plusMillis(amountToAdd);\n case ChronoUnit.SECONDS: return this.plusSeconds(amountToAdd);\n case ChronoUnit.MINUTES: return this.plusSeconds(MathUtil.safeMultiply(amountToAdd, LocalTime.SECONDS_PER_MINUTE));\n case ChronoUnit.HOURS: return this.plusSeconds(MathUtil.safeMultiply(amountToAdd, LocalTime.SECONDS_PER_HOUR));\n case ChronoUnit.HALF_DAYS: return this.plusSeconds(MathUtil.safeMultiply(amountToAdd, LocalTime.SECONDS_PER_DAY / 2));\n case ChronoUnit.DAYS: return this.plusSeconds(MathUtil.safeMultiply(amountToAdd, LocalTime.SECONDS_PER_DAY));\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n return unit.addTo(this, amountToAdd);\n }\n\n /**\n * Returns a copy of this instant with the specified duration in seconds added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} secondsToAdd the seconds to add, positive or negative\n * @return {Instant} an {@link Instant} based on this instant with the specified seconds added, not null\n * @throws DateTimeException if the result exceeds the maximum or minimum instant\n */\n plusSeconds(secondsToAdd) {\n return this._plus(secondsToAdd, 0);\n }\n\n /**\n * Returns a copy of this instant with the specified duration in milliseconds added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} millisToAdd - the milliseconds to add, positive or negative\n * @return {Instant} an {@link Instant} based on this instant with the specified milliseconds added, not null\n * @throws DateTimeException if the result exceeds the maximum or minimum instant\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusMillis(millisToAdd) {\n return this._plus(MathUtil.intDiv(millisToAdd, 1000), MathUtil.intMod(millisToAdd, 1000) * NANOS_PER_MILLI);\n }\n\n /**\n * Returns a copy of this instant with the specified duration in nanoseconds added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} nanosToAdd - the nanoseconds to add, positive or negative\n * @return {Instant} an {@link Instant} based on this instant with the specified nanoseconds added, not null\n * @throws DateTimeException if the result exceeds the maximum or minimum instant\n */\n plusNanos(nanosToAdd) {\n return this._plus(0, nanosToAdd);\n }\n\n /**\n * Returns a copy of this instant with the specified duration added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} secondsToAdd - the seconds to add, positive or negative\n * @param {number} nanosToAdd - the nanos to add, positive or negative\n * @return {Instant} an {@link Instant} based on this instant with the specified seconds added, not null\n * @throws DateTimeException if the result exceeds the maximum or minimum instant\n */\n _plus(secondsToAdd, nanosToAdd) {\n if (secondsToAdd === 0 && nanosToAdd === 0) {\n return this;\n }\n let epochSec = this._seconds + secondsToAdd;\n epochSec = epochSec + MathUtil.intDiv(nanosToAdd, LocalTime.NANOS_PER_SECOND);\n const nanoAdjustment = this._nanos + nanosToAdd % LocalTime.NANOS_PER_SECOND;\n return Instant.ofEpochSecond(epochSec, nanoAdjustment);\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * @param {!TemporalAmount} amount\n * @return {Instant}\n * @throws DateTimeException\n * @throws ArithmeticException\n */\n minusAmount(amount) {\n requireNonNull(amount, 'amount');\n return amount.subtractFrom(this);\n }\n\n /**\n * @param {!number} amountToSubtract\n * @param {!TemporalUnit} unit\n * @return {Instant}\n * @throws DateTimeException\n * @throws ArithmeticException\n */\n minusAmountUnit(amountToSubtract, unit) {\n return this.plusAmountUnit(-1 * amountToSubtract, unit);\n }\n\n /**\n * Returns a copy of this instant with the specified duration in seconds subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} secondsToSubtract - the seconds to subtract, positive or negative\n * @return {Instant} an {@link Instant} based on this instant with the specified seconds subtracted, not null\n * @throws DateTimeException if the result exceeds the maximum or minimum instant\n */\n minusSeconds(secondsToSubtract) {\n return this.plusSeconds(secondsToSubtract * -1);\n }\n\n /**\n * Returns a copy of this instant with the specified duration in milliseconds subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} millisToSubtract - the milliseconds to subtract, positive or negative\n * @return {Instant} an {@link Instant} based on this instant with the specified milliseconds subtracted, not null\n * @throws DateTimeException if the result exceeds the maximum or minimum instant\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusMillis(millisToSubtract) {\n return this.plusMillis(-1 * millisToSubtract);\n }\n\n /**\n * Returns a copy of this instant with the specified duration in nanoseconds subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} nanosToSubtract the nanoseconds to subtract, positive or negative\n * @return {Instant} an {@link Instant} based on this instant with the specified nanoseconds subtracted, not null\n * @throws DateTimeException if the result exceeds the maximum or minimum instant\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusNanos(nanosToSubtract) {\n return this.plusNanos(-1 * nanosToSubtract);\n }\n\n //-------------------------------------------------------------------------\n /**\n * Queries this instant using the specified query.\n *\n * This queries this instant using the specified query strategy object.\n * The {@link TemporalQuery} object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n *\n * The result of this method is obtained by invoking the\n * {@link TemporalQuery#queryFrom} method on the\n * specified query passing `this` as the argument.\n *\n * @param {!TemporalQuery} query - the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws DateTimeException if unable to query (defined by the query)\n * @throws ArithmeticException if numeric overflow occurs (defined by the query)\n */\n query(query) {\n requireNonNull(query, 'query');\n if (query === TemporalQueries.precision()) {\n return ChronoUnit.NANOS;\n }\n // inline TemporalAccessor.super.query(query) as an optimization\n if (query === TemporalQueries.localDate() || query === TemporalQueries.localTime() ||\n query === TemporalQueries.chronology() || query === TemporalQueries.zoneId() ||\n query === TemporalQueries.zone() || query === TemporalQueries.offset()) {\n return null;\n }\n return query.queryFrom(this);\n }\n\n /**\n * Adjusts the specified temporal object to have this instant.\n *\n * This returns a temporal object of the same observable type as the input\n * with the instant changed to be the same as this.\n *\n * The adjustment is equivalent to using {@link Temporal#with}\n * twice, passing {@link ChronoField#INSTANT_SECONDS} and\n * {@link ChronoField#NANO_OF_SECOND} as the fields.\n *\n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal#with}:\n *
\n     *   // these two lines are equivalent, but the second approach is recommended\n     *   temporal = thisInstant.adjustInto(temporal);\n     *   temporal = temporal.with(thisInstant);\n     * 
\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {!Temporal} temporal - the target object to be adjusted, not null\n * @return {Temporal} the adjusted object, not null\n * @throws DateTimeException if unable to make the adjustment\n * @throws ArithmeticException if numeric overflow occurs\n */\n adjustInto(temporal) {\n requireNonNull(temporal, 'temporal');\n return temporal.with(ChronoField.INSTANT_SECONDS, this._seconds).with(ChronoField.NANO_OF_SECOND, this._nanos);\n }\n\n /**\n * Calculates the period between this instant and another instant in\n * terms of the specified unit.\n *\n * This calculates the period between two instants in terms of a single unit.\n * The start and end points are `this` and the specified instant.\n * The result will be negative if the end is before the start.\n * The calculation returns a whole number, representing the number of\n * complete units between the two instants.\n * The {@link Temporal} passed to this method is converted to a\n * {@link Instant} using {@link from}.\n * For example, the period in days between two dates can be calculated\n * using `startInstant.until(endInstant, SECONDS)`.\n *\n * This method operates in association with {@link TemporalUnit#between}.\n * The result of this method is a `long` representing the amount of\n * the specified unit. By contrast, the result of {@link between} is an\n * object that can be used directly in addition/subtraction:\n *
\n     *   long period = start.until(end, SECONDS);   // this method\n     *   dateTime.plus(SECONDS.between(start, end));      // use in plus/minus\n     * 
\n *\n * The calculation is implemented in this method for {@link ChronoUnit}.\n * The units {@link NANOS}, {@link MICROS}, {@link MILLIS}, {@link SECONDS},\n * {@link MINUTES}, {@link HOURS}, {@link HALF_DAYS} and {@link DAYS}\n * are supported. Other {@link ChronoUnit} values will throw an exception.\n *\n * If the unit is not a {@link ChronoUnit}, then the result of this method\n * is obtained by invoking {@link TemporalUnit.between}\n * passing `this` as the first argument and the input temporal as\n * the second argument.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} endExclusive - the end date, which is converted to an {@link Instant}, not null\n * @param {TemporalUnit} unit - the unit to measure the period in, not null\n * @return {number} the amount of the period between this date and the end date\n * @throws DateTimeException if the period cannot be calculated\n * @throws ArithmeticException if numeric overflow occurs\n */\n until(endExclusive, unit) {\n requireNonNull(endExclusive, 'endExclusive');\n requireNonNull(unit, 'unit');\n const end = Instant.from(endExclusive);\n if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.NANOS: return this._nanosUntil(end);\n case ChronoUnit.MICROS: return MathUtil.intDiv(this._nanosUntil(end), 1000);\n case ChronoUnit.MILLIS: return MathUtil.safeSubtract(end.toEpochMilli(), this.toEpochMilli());\n case ChronoUnit.SECONDS: return this._secondsUntil(end);\n case ChronoUnit.MINUTES: return MathUtil.intDiv(this._secondsUntil(end), LocalTime.SECONDS_PER_MINUTE);\n case ChronoUnit.HOURS: return MathUtil.intDiv(this._secondsUntil(end), LocalTime.SECONDS_PER_HOUR);\n case ChronoUnit.HALF_DAYS: return MathUtil.intDiv(this._secondsUntil(end), (12 * LocalTime.SECONDS_PER_HOUR));\n case ChronoUnit.DAYS: return MathUtil.intDiv(this._secondsUntil(end), LocalTime.SECONDS_PER_DAY);\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n return unit.between(this, end);\n }\n\n /**\n *\n * @param {Temporal} end\n * @returns {number}\n * @private\n */\n _nanosUntil(end) {\n const secsDiff = MathUtil.safeSubtract(end.epochSecond(), this.epochSecond());\n const totalNanos = MathUtil.safeMultiply(secsDiff, LocalTime.NANOS_PER_SECOND);\n return MathUtil.safeAdd(totalNanos, end.nano() - this.nano());\n }\n\n /**\n *\n * @param {Temporal} end\n * @returns {number}\n * @private\n */\n _secondsUntil(end) {\n let secsDiff = MathUtil.safeSubtract(end.epochSecond(), this.epochSecond());\n const nanosDiff = end.nano() - this.nano();\n if (secsDiff > 0 && nanosDiff < 0) {\n secsDiff--;\n } else if (secsDiff < 0 && nanosDiff > 0) {\n secsDiff++;\n }\n return secsDiff;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this instant with an offset to create an {@link OffsetDateTime}.\n *\n * This returns an {@link OffsetDateTime} formed from this instant at the\n * specified offset from UTC/Greenwich. An exception will be thrown if the\n * instant is too large to fit into an offset date-time.\n *\n * This method is equivalent to {@link OffsetDateTime#ofInstant}.\n *\n * @param {ZoneOffset} offset - the offset to combine with, not null\n * @return {OffsetDateTime} the offset date-time formed from this instant and the specified offset, not null\n * @throws DateTimeException if the result exceeds the supported range\n */\n atOffset(offset) {\n return OffsetDateTime.ofInstant(this, offset);\n }\n\n /**\n * Combines this instant with a time-zone to create a {@link ZonedDateTime}.\n *\n * This returns an {@link ZonedDateTime} formed from this instant at the\n * specified time-zone. An exception will be thrown if the instant is too\n * large to fit into a zoned date-time.\n *\n * This method is equivalent to {@link ZonedDateTime#ofInstant}.\n *\n * @param {ZoneId} zone - the zone to combine with, not null\n * @return {ZonedDateTime} the zoned date-time formed from this instant and the specified zone, not null\n * @throws DateTimeException if the result exceeds the supported range\n */\n atZone(zone) {\n return ZonedDateTime.ofInstant(this, zone);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Converts this instant to the number of milliseconds from the epoch\n * of 1970-01-01T00:00:00Z.\n *\n * If this instant represents a point on the time-line too far in the future\n * or past to fit in a `long` milliseconds, then an exception is thrown.\n *\n * If this instant has greater than millisecond precision, then the conversion\n * will drop any excess precision information as though the amount in nanoseconds\n * was subject to integer division by one million.\n *\n * @return {number} the number of milliseconds since the epoch of 1970-01-01T00:00:00Z\n * @throws ArithmeticException if numeric overflow occurs\n */\n toEpochMilli() {\n const millis = MathUtil.safeMultiply(this._seconds, 1000);\n return millis + MathUtil.intDiv(this._nanos, NANOS_PER_MILLI);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this instant to the specified instant.\n *\n * The comparison is based on the time-line position of the instants.\n * It is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * @param {Instant} otherInstant the other instant to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n * @throws NullPointerException if otherInstant is null\n */\n compareTo(otherInstant) {\n requireNonNull(otherInstant, 'otherInstant');\n requireInstance(otherInstant, Instant, 'otherInstant');\n const cmp = MathUtil.compareNumbers(this._seconds, otherInstant._seconds);\n if (cmp !== 0) {\n return cmp;\n }\n return this._nanos - otherInstant._nanos;\n }\n\n /**\n * Checks if this instant is after the specified instant.\n *\n * The comparison is based on the time-line position of the instants.\n *\n * @param {Instant} otherInstant the other instant to compare to, not null\n * @return {boolean} true if this instant is after the specified instant\n * @throws NullPointerException if otherInstant is null\n */\n isAfter(otherInstant) {\n return this.compareTo(otherInstant) > 0;\n }\n\n /**\n * Checks if this instant is before the specified instant.\n *\n * The comparison is based on the time-line position of the instants.\n *\n * @param {Instant} otherInstant the other instant to compare to, not null\n * @return {boolean} true if this instant is before the specified instant\n * @throws NullPointerException if otherInstant is null\n */\n isBefore(otherInstant) {\n return this.compareTo(otherInstant) < 0;\n }\n\n /**\n * Checks if this instant is equal to the specified instant.\n *\n * The comparison is based on the time-line position of the instants.\n *\n * @param {*} other - the other instant, null/ undefined returns false\n * @return {boolean} true if the other instant is equal to this one\n */\n equals(other) {\n if(this === other){\n return true;\n }\n if(other instanceof Instant){\n return this.epochSecond() === other.epochSecond() &&\n this.nano() === other.nano();\n }\n return false;\n }\n\n /**\n * Returns a hash code for this instant.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return MathUtil.hashCode(this._seconds, this._nanos);\n }\n\n /**\n * A string representation of this instant using ISO-8601 representation.\n *\n * The format used is the same as {@link DateTimeFormatter#ISO_INSTANT}.\n *\n * @return {string} an ISO-8601 representation of this instant, not null\n */\n toString(){\n return DateTimeFormatter.ISO_INSTANT.format(this);\n }\n\n /**\n *\n * @return {string} same as {@link LocalDate.toString}\n */\n toJSON() {\n return this.toString();\n }\n}\n\nexport function _init() {\n Instant.MIN_SECONDS = -31619119219200; // -1000000-01-01T00:00:00Z\n Instant.MAX_SECONDS = 31494816403199; // +1000000-12-31T23:59:59.999999999Z\n Instant.EPOCH = new Instant(0, 0);\n Instant.MIN = Instant.ofEpochSecond(Instant.MIN_SECONDS, 0);\n Instant.MAX = Instant.ofEpochSecond(Instant.MAX_SECONDS, 999999999);\n Instant.FROM = createTemporalQuery('Instant.FROM', (temporal) => {\n return Instant.from(temporal);\n });\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {abstractMethodFail, requireNonNull} from './assert';\nimport {Instant} from './Instant';\nimport {ZoneId} from './ZoneId';\nimport {ZoneOffset} from './ZoneOffset';\n\n/**\n * A clock providing access to the current instant, date and time using a time-zone.\n *\n * Instances of this class are used to find the current instant, which can be\n * interpreted using the stored time-zone to find the current date and time.\n * As such, a clock can be used instead of {@link System#currentTimeMillis}\n * and {@link TimeZone#getDefault}.\n *\n * Use of a {@link Clock} is optional. All key date-time classes also have a\n * `now()` factory method that uses the system clock in the default time zone.\n * The primary purpose of this abstraction is to allow alternate clocks to be\n * plugged in as and when required. Applications use an object to obtain the\n * current time rather than a static method. This can simplify testing.\n *\n * Best practice for applications is to pass a {@link Clock} into any method\n * that requires the current instant.\n *\n * This approach allows an alternate clock, such as {@link fixed}\n * or {@link offset} to be used during testing.\n *\n * The {@link system} factory methods provide clocks based on the best available\n * system clock This may use {@link System#currentTimeMillis}, or a higher\n * resolution clock if one is available.\n *\n * The javascript Clock implementation differs from the openjdk.\n *\n * Javascript only provides the UTC millis of epoch and the ZoneOffset in minutes of the system default time.\n * Javascript do not provide the system default ZoneId.\n *\n * the system default ZoneId is only guessable by the ZoneOffset, like moment-timezone does by returning one ZoneId\n * with the same ZoneOffset.\n *\n * Therefore we are doing a shortcut here, by defining a SystemUTCClock and a SystemDefaultClock, the Clock itself\n * is returning the ZoneOffset and not the ZoneRules as in the jdk. We should change it, when introducing the iana\n * timezone database and implementing the timezone domains.\n *\n */\n\nexport class Clock {\n /**\n * Obtains a clock that returns the current instant using the\n * system clock, converting to date and time using the Date.getTime() UTC millis.\n *\n * This clock, rather than {@link systemDefaultZone}, should be used when\n * you need the current instant without the date or time.\n *\n * @return {Clock} a clock that uses the system clock in the UTC zone, not null\n */\n static systemUTC() {\n return new SystemClock(ZoneOffset.UTC);\n }\n\n /**\n * Obtains a clock that returns the current instant using the best available\n * system clock, converting to date and time using the default time-zone.\n *\n * This clock is based on the available system clock using the Date.getTime() UTC millis\n *\n * Using this method hard codes a dependency to the default time-zone into your application.\n *\n * The UTC clock (see {@link systemUTC}) should be used when you need the current instant\n * without the date or time.\n *\n *\n * @return {Clock} a clock that uses the system clock in the default zone, not null\n * @see ZoneId#systemDefault()\n */\n static systemDefaultZone() {\n return new SystemClock(ZoneId.systemDefault());\n }\n\n /**\n *\n * @param {ZoneId} zone\n * @return {Clock} a clock that uses the specified time zone\n */\n static system(zone){\n return new SystemClock(zone);\n }\n\n /**\n * Obtains a clock that always returns the same instant.\n *\n * This clock simply returns the specified instant.\n * As such, it is not a clock in the conventional sense.\n * The main use case for this is in testing, where the fixed clock ensures\n * tests are not dependent on the current clock.\n *\n * @param {Instant} fixedInstant the instant to use as the clock, not null\n * @param {ZoneId} zoneId the zoneOffset to use as zone Offset, not null\n * @return {Clock} a clock that always returns the same instant, not null\n */\n static fixed(fixedInstant, zoneId) {\n return new FixedClock(fixedInstant, zoneId);\n }\n \n /**\n * Obtains a clock that returns instants from the specified clock with the\n * specified duration added\n *

\n * This clock wraps another clock, returning instants that are later by the\n * specified duration. If the duration is negative, the instants will be\n * earlier than the current date and time.\n * The main use case for this is to simulate running in the future or in the past.\n *

\n * A duration of zero would have no offsetting effect.\n * Passing zero will return the underlying clock.\n *

\n * The returned implementation is immutable, thread-safe and {@code Serializable}\n * providing that the base clock is.\n *\n * @param baseClock the base clock to add the duration to, not null\n * @param offsetDuration the duration to add, not null\n * @return a clock based on the base clock with the duration added, not null\n */\n static offset(baseClock, duration) {\n return new OffsetClock(baseClock, duration); \n }\n\n /**\n * Gets the current millisecond instant of the clock.\n *\n * This returns the millisecond-based instant, measured from 1970-01-01T00:00Z (UTC).\n * This is equivalent to the definition of {@link Date#getTime}.\n *\n * Most applications should avoid this method and use {@link Instant} to represent\n * an instant on the time-line rather than a raw millisecond value.\n * This method is provided to allow the use of the clock in high performance use cases\n * where the creation of an object would be unacceptable.\n *\n * The default implementation currently calls {@link instant}.\n *\n * @return the current millisecond instant from this clock, measured from\n * the Java epoch of 1970-01-01T00:00Z (UTC), not null\n */\n millis(){\n abstractMethodFail('Clock.millis');\n }\n\n /**\n * Gets the current instant of the clock.\n *\n * This returns an instant representing the current instant as defined by the clock.\n *\n * @return {Instant} the current instant from this clock, not null\n */\n instant(){\n abstractMethodFail('Clock.instant');\n }\n\n zone(){\n abstractMethodFail('Clock.zone');\n }\n \n /**\n * Returns a copy of this clock with a different time-zone.\n *

\n * A clock will typically obtain the current instant and then convert that\n * to a date or time using a time-zone. This method returns a clock with\n * similar properties but using a different time-zone.\n *\n * @param zone the time-zone to change to, not null\n * @return a clock based on this clock with the specified time-zone, not null\n */\n withZone(){\n abstractMethodFail('Clock.withZone');\n }\n}\n\n/**\n * Implementation of a clock that always returns the latest time from\n * {@link Date#getTime}.\n *\n * @private\n */\nclass SystemClock extends Clock {\n /**\n *\n * @param {!ZoneId} zone\n */\n constructor(zone){\n requireNonNull(zone, 'zone');\n super();\n this._zone = zone;\n }\n\n /**\n *\n * @returns {!ZoneId}\n */\n zone() {\n return this._zone;\n }\n\n /**\n *\n * @returns {number}\n */\n millis() {\n return new Date().getTime();\n }\n\n /**\n *\n * @returns {Instant}\n */\n instant() {\n return Instant.ofEpochMilli(this.millis());\n }\n \n equals(obj) { \n if (obj instanceof SystemClock) { \n return this._zone.equals(obj._zone);\n }\n return false; \n } \n \n withZone(zone) {\n if (zone.equals(this._zone)) { // intentional NPE\n return this;\n }\n return new SystemClock(zone);\n } \n\n /**\n *\n * @returns {string}\n */\n toString(){\n return 'SystemClock[' + this._zone.toString() + ']';\n }\n\n}\n\n/**\n * Implementation of a clock that always returns the same instant.\n * This is typically used for testing.\n * @private\n */\nclass FixedClock extends Clock{\n constructor(fixedInstant, zoneId) {\n super();\n this._instant = fixedInstant;\n this._zoneId = zoneId;\n }\n\n instant() {\n return this._instant;\n }\n\n millis(){\n return this._instant.toEpochMilli();\n }\n\n zone() {\n return this._zoneId;\n }\n\n toString(){\n return 'FixedClock[]';\n }\n \n equals(obj) { \n if (obj instanceof FixedClock) { \n return this._instant.equals(obj._instant) && this._zoneId.equals(obj._zoneId);\n }\n return false; \n }\n\n withZone(zone) {\n if (zone.equals(this._zoneId)) { // intentional NPE\n return this;\n }\n return new FixedClock(this._instant, zone);\n } \n \n}\n\n\n/**\n * Implementation of a clock that adds an offset to an underlying clock.\n */\nclass OffsetClock extends Clock {\n constructor(baseClock, offset) {\n super();\n this._baseClock = baseClock;\n this._offset = offset;\n }\n \n zone() {\n return this._baseClock.zone();\n }\n \n withZone(zone) {\n if (zone.equals(this._baseClock.zone())) { // intentional NPE\n return this;\n }\n return new OffsetClock(this._baseClock.withZone(zone), this._offset);\n }\n \n millis() {\n return this._baseClock.millis() + this._offset.toMillis();\n }\n \n instant() {\n return this._baseClock.instant().plus(this._offset);\n }\n \n equals(obj) {\n if (obj instanceof OffsetClock) { \n return this._baseClock.equals(obj._baseClock) && this._offset.equals(obj._offset);\n }\n return false;\n }\n \n toString() {\n return 'OffsetClock[' + this._baseClock + ',' + this._offset + ']';\n }\n}","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {requireNonNull} from '../assert';\nimport {IllegalArgumentException} from '../errors';\n\nimport {Duration} from '../Duration';\nimport {LocalDateTime} from '../LocalDateTime';\n\n/**\n * A transition between two offsets caused by a discontinuity in the local time-line.\n *\n * A transition between two offsets is normally the result of a daylight savings cutover.\n * The discontinuity is normally a gap in spring and an overlap in autumn.\n * {@link ZoneOffsetTransition} models the transition between the two offsets.\n *\n * Gaps occur where there are local date-times that simply do not not exist.\n * An example would be when the offset changes from `+03:00` to `+04:00`.\n * This might be described as 'the clocks will move forward one hour tonight at 1am'.\n *\n * Overlaps occur where there are local date-times that exist twice.\n * An example would be when the offset changes from `+04:00` to `+03:00`.\n * This might be described as 'the clocks will move back one hour tonight at 2am'.\n *\n */\nexport class ZoneOffsetTransition {\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance defining a transition between two offsets.\n *\n * Applications should normally obtain an instance from {@link ZoneRules}.\n * This factory is only intended for use when creating {@link ZoneRules}.\n *\n * @param {LocalDateTime} transition - the transition date-time at the transition, which never\n * actually occurs, expressed local to the before offset, not null\n * @param {ZoneOffset} offsetBefore - the offset before the transition, not null\n * @param {ZoneOffset} offsetAfter - the offset at and after the transition, not null\n * @return {ZoneOffsetTransition} the transition, not null\n * @throws IllegalArgumentException if {@link offsetBefore} and {@link offsetAfter}\n * are equal, or {@link transition.getNano} returns non-zero value\n */\n static of(transition, offsetBefore, offsetAfter) {\n return new ZoneOffsetTransition(transition, offsetBefore, offsetAfter);\n }\n\n /**\n * Creates an instance defining a transition between two offsets.\n * Creates an instance from epoch-second if transition is not a LocalDateTimeInstance\n *\n * @param {(LocalDateTime \\ number)} transition - the transition date-time with the offset before the transition, not null\n * @param {ZoneOffset} offsetBefore - the offset before the transition, not null\n * @param {ZoneOffset} offsetAfter - the offset at and after the transition, not null\n * @private\n */\n constructor(transition, offsetBefore, offsetAfter) {\n requireNonNull(transition, 'transition');\n requireNonNull(offsetBefore, 'offsetBefore');\n requireNonNull(offsetAfter, 'offsetAfter');\n if (offsetBefore.equals(offsetAfter)) {\n throw new IllegalArgumentException('Offsets must not be equal');\n }\n if (transition.nano() !== 0) {\n throw new IllegalArgumentException('Nano-of-second must be zero');\n }\n if(transition instanceof LocalDateTime) {\n this._transition = transition;\n } else {\n this._transition = LocalDateTime.ofEpochSecond(transition, 0, offsetBefore);\n }\n this._offsetBefore = offsetBefore;\n this._offsetAfter = offsetAfter;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the transition instant.\n *\n * This is the instant of the discontinuity, which is defined as the first\n * instant that the 'after' offset applies.\n *\n * The methods {@link getInstant}, {@link getDateTimeBefore} and {@link getDateTimeAfter}\n * all represent the same instant.\n *\n * @return {Instant} the transition instant, not null\n */\n instant() {\n return this._transition.toInstant(this._offsetBefore);\n }\n\n /**\n * Gets the transition instant as an epoch second.\n *\n * @return {number} the transition epoch second\n */\n toEpochSecond() {\n return this._transition.toEpochSecond(this._offsetBefore);\n }\n\n //-------------------------------------------------------------------------\n /**\n * Gets the local transition date-time, as would be expressed with the 'before' offset.\n *\n * This is the date-time where the discontinuity begins expressed with the 'before' offset.\n * At this instant, the 'after' offset is actually used, therefore the combination of this\n * date-time and the 'before' offset will never occur.\n *\n * The combination of the 'before' date-time and offset represents the same instant\n * as the 'after' date-time and offset.\n *\n * @return {LocalDateTime} the transition date-time expressed with the before offset, not null\n */\n dateTimeBefore(){\n return this._transition;\n }\n\n /**\n * Gets the local transition date-time, as would be expressed with the 'after' offset.\n *\n * This is the first date-time after the discontinuity, when the new offset applies.\n *\n * The combination of the 'before' date-time and offset represents the same instant\n * as the 'after' date-time and offset.\n *\n * @return {LocalDateTime} the transition date-time expressed with the after offset, not null\n */\n dateTimeAfter() {\n return this._transition.plusSeconds(this.durationSeconds());\n }\n\n /**\n * Gets the offset before the transition.\n *\n * This is the offset in use before the instant of the transition.\n *\n * @return {ZoneOffset} the offset before the transition, not null\n */\n offsetBefore() {\n return this._offsetBefore;\n }\n\n /**\n * Gets the offset after the transition.\n *\n * This is the offset in use on and after the instant of the transition.\n *\n * @return {ZoneOffset} the offset after the transition, not null\n */\n offsetAfter() {\n return this._offsetAfter;\n }\n\n /**\n * Gets the duration of the transition.\n *\n * In most cases, the transition duration is one hour, however this is not always the case.\n * The duration will be positive for a gap and negative for an overlap.\n * Time-zones are second-based, so the nanosecond part of the duration will be zero.\n *\n * @return {Duration} the duration of the transition, positive for gaps, negative for overlaps\n */\n duration() {\n return Duration.ofSeconds(this.durationSeconds());\n }\n\n /**\n * Gets the duration of the transition in seconds.\n *\n * @return {number} the duration in seconds\n */\n durationSeconds() {\n return this._offsetAfter.totalSeconds() - this._offsetBefore.totalSeconds();\n }\n\n /**\n * Does this transition represent a gap in the local time-line.\n *\n * Gaps occur where there are local date-times that simply do not not exist.\n * An example would be when the offset changes from `+01:00` to `+02:00`.\n * This might be described as 'the clocks will move forward one hour tonight at 1am'.\n *\n * @return {boolean} true if this transition is a gap, false if it is an overlap\n */\n isGap() {\n return this._offsetAfter.totalSeconds() > this._offsetBefore.totalSeconds();\n }\n\n /**\n * Does this transition represent a gap in the local time-line.\n *\n * Overlaps occur where there are local date-times that exist twice.\n * An example would be when the offset changes from `+02:00` to `+01:00`.\n * This might be described as 'the clocks will move back one hour tonight at 2am'.\n *\n * @return {boolean} true if this transition is an overlap, false if it is a gap\n */\n isOverlap() {\n return this._offsetAfter.totalSeconds() < this._offsetBefore.totalSeconds();\n }\n\n /**\n * Checks if the specified offset is valid during this transition.\n *\n * This checks to see if the given offset will be valid at some point in the transition.\n * A gap will always return false.\n * An overlap will return true if the offset is either the before or after offset.\n *\n * @param {ZoneOffset} offset - the offset to check, null returns false\n * @return {boolean} true if the offset is valid during the transition\n */\n isValidOffset(offset) {\n return this.isGap() ? false : (this._offsetBefore.equals(offset) || this._offsetAfter.equals(offset));\n }\n\n /**\n * Gets the valid offsets during this transition.\n *\n * A gap will return an empty list, while an overlap will return both offsets.\n *\n * @return {ZoneOffset[]} the list of valid offsets\n */\n validOffsets() {\n if (this.isGap()){\n return [];\n } else {\n return [this._offsetBefore, this._offsetAfter];\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this transition to another based on the transition instant.\n *\n * This compares the instants of each transition.\n * The offsets are ignored, making this order inconsistent with equals.\n *\n * @param {ZoneOffsetTransition} transition - the transition to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */\n compareTo(transition) {\n return this.instant().compareTo(transition.instant());\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this object equals another.\n *\n * The entire state of the object is compared.\n *\n * @param {*} other - the other object to compare to, null returns false\n * @return true if equal\n */\n equals(other) {\n if (other === this) {\n return true;\n }\n if (other instanceof ZoneOffsetTransition) {\n const d = other;\n return this._transition.equals(d._transition) &&\n this._offsetBefore.equals(d.offsetBefore()) && this._offsetAfter.equals(d.offsetAfter());\n }\n return false;\n }\n\n /**\n * Returns a suitable hash code.\n *\n * @return {number} the hash code\n */\n hashCode() {\n return this._transition.hashCode() ^ this._offsetBefore.hashCode() ^ (this._offsetAfter.hashCode()>>>16);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a string describing this object.\n *\n * @return {string} a string for debugging, not null\n */\n toString() {\n return 'Transition[' + (this.isGap() ? 'Gap' : 'Overlap') +\n ' at ' + this._transition.toString() + this._offsetBefore.toString() +\n ' to ' + this._offsetAfter + ']';\n }\n\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {ChronoField} from './ChronoField';\nimport {createTemporalQuery} from './TemporalQuery';\nimport {TemporalQueries} from './TemporalQueries';\n\nimport {LocalDate} from '../LocalDate';\nimport {LocalTime} from '../LocalTime';\nimport {ZoneOffset} from '../ZoneOffset';\n\n\nexport function _init() {\n //-----------------------------------------------------------------------\n /**\n * A strict query for the {@link ZoneId}.\n */\n TemporalQueries.ZONE_ID = createTemporalQuery('ZONE_ID', (temporal) => {\n return temporal.query(TemporalQueries.ZONE_ID);\n });\n\n /**\n * A query for the {@link Chronology}.\n */\n TemporalQueries.CHRONO = createTemporalQuery('CHRONO', (temporal) => {\n return temporal.query(TemporalQueries.CHRONO);\n });\n\n /**\n * A query for the smallest supported unit.\n */\n TemporalQueries.PRECISION = createTemporalQuery('PRECISION', (temporal) => {\n return temporal.query(TemporalQueries.PRECISION);\n });\n\n //-----------------------------------------------------------------------\n /**\n * A query for {@link ZoneOffset} returning null if not found.\n */\n TemporalQueries.OFFSET = createTemporalQuery('OFFSET', (temporal) => {\n if (temporal.isSupported(ChronoField.OFFSET_SECONDS)) {\n return ZoneOffset.ofTotalSeconds(temporal.get(ChronoField.OFFSET_SECONDS));\n }\n return null;\n });\n\n /**\n * A lenient query for the {@link ZoneId}, falling back to the {@link ZoneOffset}.\n */\n TemporalQueries.ZONE = createTemporalQuery('ZONE', (temporal) => {\n const zone = temporal.query(TemporalQueries.ZONE_ID);\n return (zone != null ? zone : temporal.query(TemporalQueries.OFFSET));\n });\n\n /**\n * A query for {@link LocalDate} returning null if not found.\n */\n TemporalQueries.LOCAL_DATE = createTemporalQuery('LOCAL_DATE', (temporal) => {\n if (temporal.isSupported(ChronoField.EPOCH_DAY)) {\n return LocalDate.ofEpochDay(temporal.getLong(ChronoField.EPOCH_DAY));\n }\n return null;\n });\n\n /**\n * A query for {@link LocalTime} returning null if not found.\n */\n TemporalQueries.LOCAL_TIME = createTemporalQuery('LOCAL_TIME', (temporal) => {\n if (temporal.isSupported(ChronoField.NANO_OF_DAY)) {\n return LocalTime.ofNanoOfDay(temporal.getLong(ChronoField.NANO_OF_DAY));\n }\n return null;\n });\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {ZoneRules} from './ZoneRules';\nimport {ZoneOffset} from '../ZoneOffset';\nimport {DateTimeException} from '../errors';\n\nexport class SystemDefaultZoneRules extends ZoneRules {\n\n isFixedOffset(){\n return false;\n }\n\n /**\n *\n * @param {Instant} instant\n * @returns {ZoneOffset}\n */\n offsetOfInstant(instant){\n const offsetInMinutes = new Date(instant.toEpochMilli()).getTimezoneOffset();\n return ZoneOffset.ofTotalMinutes(offsetInMinutes * -1);\n }\n\n /**\n *\n * @param {number} epochMilli\n * @returns {ZoneOffset}\n */\n offsetOfEpochMilli(epochMilli){\n const offsetInMinutes = new Date(epochMilli).getTimezoneOffset();\n return ZoneOffset.ofTotalMinutes(offsetInMinutes * -1);\n }\n\n /**\n * This implementation is NOT returning the best value in a gap or overlap situation\n * as specified at {@link ZoneRules.offsetOfLocalDateTime}.\n *\n * The calculated offset depends Date.prototype.getTimezoneOffset and its not specified\n * at the ECMA-262 specification how to handle daylight savings gaps/ overlaps.\n *\n * The Chrome Browser version 49 is returning the next transition offset in a gap/overlap situation,\n * other browsers/ engines might do it in the same way.\n *\n * @param {LocalDateTime} localDateTime\n * @returns {ZoneOffset}\n */\n offsetOfLocalDateTime(localDateTime){\n const epochMilli = localDateTime.toEpochSecond(ZoneOffset.UTC) * 1000;\n const offsetInMinutesBeforePossibleTransition = new Date(epochMilli).getTimezoneOffset();\n const epochMilliSystemZone = epochMilli + offsetInMinutesBeforePossibleTransition * 60000;\n const offsetInMinutesAfterPossibleTransition = new Date(epochMilliSystemZone).getTimezoneOffset();\n return ZoneOffset.ofTotalMinutes(offsetInMinutesAfterPossibleTransition * -1);\n }\n\n /**\n *\n * @param localDateTime\n * @return {ZoneOffset[]}\n */\n validOffsets(localDateTime){\n return [this.offsetOfLocalDateTime(localDateTime)];\n }\n\n /**\n * @return null, not supported\n */\n transition(){\n return null;\n }\n\n /**\n *\n * @param instant\n * @return {ZoneOffset}\n */\n standardOffset(instant){\n return this.offsetOfInstant(instant);\n }\n\n /**\n * @throws DateTimeException not supported\n */\n daylightSavings(){\n this._throwNotSupported();\n }\n\n /**\n * @throws DateTimeException not supported\n */\n isDaylightSavings(){\n this._throwNotSupported();\n }\n\n /**\n *\n * @param {LocalDateTime} dateTime\n * @param {ZoneOffset} offset\n * @return {boolean}\n */\n isValidOffset(dateTime, offset) {\n return this.offsetOfLocalDateTime(dateTime).equals(offset);\n }\n\n /**\n * @throws DateTimeException not supported\n */\n nextTransition(){\n this._throwNotSupported();\n }\n\n /**\n * @throws DateTimeException not supported\n */\n previousTransition(){\n this._throwNotSupported();\n }\n\n /**\n * @throws DateTimeException not supported\n */\n transitions(){\n this._throwNotSupported();\n }\n\n /**\n * @throws DateTimeException not supported\n */\n transitionRules(){\n this._throwNotSupported();\n }\n\n /**\n * @throws DateTimeException not supported\n */\n _throwNotSupported(){\n throw new DateTimeException('not supported operation');\n }\n //-----------------------------------------------------------------------\n /**\n *\n * @param {*} other\n * @returns {boolean}\n */\n equals(other) {\n if (this === other || other instanceof SystemDefaultZoneRules) {\n return true;\n } else {\n return false;\n }\n }\n\n /**\n *\n * @returns {string}\n */\n toString() {\n return 'SYSTEM';\n }\n\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {SystemDefaultZoneRules} from './SystemDefaultZoneRules';\nimport {ZoneId} from '../ZoneId';\n\nexport class SystemDefaultZoneId extends ZoneId {\n\n constructor(){\n super();\n this._rules = new SystemDefaultZoneRules();\n }\n\n rules(){\n return this._rules;\n }\n\n equals(other){\n if(this === other){\n return true;\n }\n return false;\n }\n\n id(){\n return 'SYSTEM';\n }\n\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {requireNonNull} from './assert';\nimport {DateTimeException, IllegalArgumentException} from './errors';\nimport {StringUtil} from './StringUtil';\n\nimport {ZoneOffset} from './ZoneOffset';\nimport {ZoneRegion} from './ZoneRegion';\nimport {ZoneId} from './ZoneId';\n\nimport {TemporalQueries} from './temporal/TemporalQueries';\nimport {SystemDefaultZoneId} from './zone/SystemDefaultZoneId';\nimport {ZoneRulesProvider} from './zone/ZoneRulesProvider';\n\n/**\n * @see {@link ZoneId}\n *\n * Helper class to avoid dependency cycles.\n * Static methods of the class ZoneIdFactory are added automatically to class ZoneId.\n * @private\n */\nexport class ZoneIdFactory {\n\n /**\n * Gets the system default time-zone.\n *\n *\n * @return {ZoneId} the zone ID, not null\n */\n static systemDefault() {\n return SYSTEM_DEFAULT_ZONE_ID_INSTANCE;\n }\n\n /**\n * Gets the set of available zone IDs.\n *\n * This set includes the string form of all available region-based IDs.\n * Offset-based zone IDs are not included in the returned set.\n * The ID can be passed to {@link of} to create a {@link ZoneId}.\n *\n * The set of zone IDs can increase over time, although in a typical application\n * the set of IDs is fixed. Each call to this method is thread-safe.\n *\n * @return {string[]} a modifiable copy of the set of zone IDs, not null\n */\n static getAvailableZoneIds() {\n return ZoneRulesProvider.getAvailableZoneIds();\n }\n\n /**\n * Obtains an instance of {@link ZoneId} from an ID ensuring that the\n * ID is valid and available for use.\n *\n * This method parses the ID producing a {@link ZoneId} or {@link ZoneOffset}.\n * A {@link ZoneOffset} is returned if the ID is 'Z', or starts with '+' or '-'.\n * The result will always be a valid ID for which {@link ZoneRules} can be obtained.\n *\n * Parsing matches the zone ID step by step as follows.\n *\n * * If the zone ID equals 'Z', the result is {@link ZoneOffset.UTC}.\n * * If the zone ID consists of a single letter, the zone ID is invalid\n * and {@link DateTimeException} is thrown.\n * * If the zone ID starts with '+' or '-', the ID is parsed as a\n * {@link ZoneOffset} using {@link ZoneOffset#of}.\n * * If the zone ID equals 'GMT', 'UTC' or 'UT' then the result is a {@link ZoneId}\n * with the same ID and rules equivalent to {@link ZoneOffset.UTC}.\n * * If the zone ID starts with 'UTC+', 'UTC-', 'GMT+', 'GMT-', 'UT+' or 'UT-'\n * then the ID is a prefixed offset-based ID. The ID is split in two, with\n * a two or three letter prefix and a suffix starting with the sign.\n * The suffix is parsed as a {@link ZoneOffset}.\n * The result will be a {@link ZoneId} with the specified UTC/GMT/UT prefix\n * and the normalized offset ID as per {@link ZoneOffset#getId}.\n * The rules of the returned {@link ZoneId} will be equivalent to the\n * parsed {@link ZoneOffset}.\n * * All other IDs are parsed as region-based zone IDs. Region IDs must\n * match the regular expression `[A-Za-z][A-Za-z0-9~/._+-]+`,\n * otherwise a {@link DateTimeException} is thrown. If the zone ID is not\n * in the configured set of IDs, {@link ZoneRulesException} is thrown.\n * The detailed format of the region ID depends on the group supplying the data.\n * The default set of data is supplied by the IANA Time Zone Database (TZDB).\n * This has region IDs of the form '{area}/{city}', such as 'Europe/Paris' or 'America/New_York'.\n * This is compatible with most IDs from {@link java.util.TimeZone}.\n *\n * @param {string} zoneId the time-zone ID, not null\n * @return {ZoneId} the zone ID, not null\n * @throws DateTimeException if the zone ID has an invalid format\n * @throws ZoneRulesException if the zone ID is a region ID that cannot be found\n */\n static of(zoneId) {\n requireNonNull(zoneId, 'zoneId');\n if (zoneId === 'Z') {\n return ZoneOffset.UTC;\n }\n if (zoneId.length === 1) {\n throw new DateTimeException('Invalid zone: ' + zoneId);\n }\n if (StringUtil.startsWith(zoneId, '+') || StringUtil.startsWith(zoneId, '-')) {\n return ZoneOffset.of(zoneId);\n }\n if (zoneId === 'UTC' || zoneId === 'GMT' || zoneId === 'GMT0' || zoneId === 'UT') {\n return new ZoneRegion(zoneId, ZoneOffset.UTC.rules());\n }\n if (StringUtil.startsWith(zoneId, 'UTC+') || StringUtil.startsWith(zoneId, 'GMT+') ||\n StringUtil.startsWith(zoneId, 'UTC-') || StringUtil.startsWith(zoneId, 'GMT-')) {\n const offset = ZoneOffset.of(zoneId.substring(3));\n if (offset.totalSeconds() === 0) {\n return new ZoneRegion(zoneId.substring(0, 3), offset.rules());\n }\n return new ZoneRegion(zoneId.substring(0, 3) + offset.id(), offset.rules());\n }\n if (StringUtil.startsWith(zoneId, 'UT+') || StringUtil.startsWith(zoneId, 'UT-')) {\n const offset = ZoneOffset.of(zoneId.substring(2));\n if (offset.totalSeconds() === 0) {\n return new ZoneRegion('UT', offset.rules());\n }\n return new ZoneRegion('UT' + offset.id(), offset.rules());\n }\n // javascript special case\n if(zoneId === 'SYSTEM'){\n return ZoneId.systemDefault();\n }\n return ZoneRegion.ofId(zoneId);\n }\n\n /**\n * Obtains an instance of {@link ZoneId} wrapping an offset.\n *\n * If the prefix is 'GMT', 'UTC', or 'UT' a {@link ZoneId}\n * with the prefix and the non-zero offset is returned.\n * If the prefix is empty `''` the {@link ZoneOffset} is returned.\n *\n * @param {string} prefix the time-zone ID, not null\n * @param {ZoneOffset} offset the offset, not null\n * @return {ZoneId} the zone ID, not null\n * @throws IllegalArgumentException if the prefix is not one of\n * 'GMT', 'UTC', or 'UT', or ''\n */\n static ofOffset(prefix, offset) {\n requireNonNull(prefix, 'prefix');\n requireNonNull(offset, 'offset');\n if (prefix.length === 0) {\n return offset;\n }\n if (prefix === 'GMT' || prefix === 'UTC' || prefix === 'UT') {\n if (offset.totalSeconds() === 0) {\n return new ZoneRegion(prefix, offset.rules());\n }\n return new ZoneRegion(prefix + offset.id(), offset.rules());\n }\n throw new IllegalArgumentException('Invalid prefix, must be GMT, UTC or UT: ' + prefix);\n }\n\n\n /**\n * Obtains an instance of {@link ZoneId} from a temporal object.\n *\n * A {@link TemporalAccessor} represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of {@link ZoneId}.\n *\n * The conversion will try to obtain the zone in a way that favours region-based\n * zones over offset-based zones using {@link TemporalQueries#zone}.\n *\n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used in queries via method reference, {@link ZoneId::from}.\n *\n * @param {!TemporalAccessor} temporal - the temporal object to convert, not null\n * @return {ZoneId} the zone ID, not null\n * @throws DateTimeException if unable to convert to a {@link ZoneId}\n */\n static from(temporal) {\n requireNonNull(temporal, 'temporal');\n const obj = temporal.query(TemporalQueries.zone());\n if (obj == null) {\n throw new DateTimeException('Unable to obtain ZoneId from TemporalAccessor: ' +\n temporal + ', type ' + (temporal.constructor != null ? temporal.constructor.name : ''));\n }\n return obj;\n }\n}\n\nlet SYSTEM_DEFAULT_ZONE_ID_INSTANCE = null;\n\nexport function _init(){\n SYSTEM_DEFAULT_ZONE_ID_INSTANCE = new SystemDefaultZoneId();\n\n // a bit magic to stay a bit more to the threeten bp impl.\n ZoneId.systemDefault = ZoneIdFactory.systemDefault;\n ZoneId.getAvailableZoneIds = ZoneIdFactory.getAvailableZoneIds;\n ZoneId.of = ZoneIdFactory.of;\n ZoneId.ofOffset = ZoneIdFactory.ofOffset;\n ZoneId.from = ZoneIdFactory.from;\n ZoneOffset.from = ZoneIdFactory.from;\n\n // short cut\n ZoneId.SYSTEM = SYSTEM_DEFAULT_ZONE_ID_INSTANCE;\n ZoneId.UTC = ZoneOffset.ofTotalSeconds(0);\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {_init as ZoneOffsetInit} from './ZoneOffset';\nimport {_init as DayOfWeekInit} from './DayOfWeek';\nimport {_init as DurationInit} from './Duration';\nimport {_init as InstantInit} from './Instant';\nimport {_init as LocalDateInit} from './LocalDate';\nimport {_init as LocalTimeInit} from './LocalTime';\nimport {_init as LocalDateTimeInit} from './LocalDateTime';\nimport {_init as MonthInit} from './Month';\nimport {_init as MonthDayInit} from './MonthDay';\nimport {_init as OffsetDateTimeInit} from './OffsetDateTime';\nimport {_init as OffsetTimeInit} from './OffsetTime';\nimport {_init as PeriodInit} from './Period';\nimport {_init as YearInit} from './Year';\nimport {_init as YearConstantsInit} from './YearConstants';\nimport {_init as YearMonthInit} from './YearMonth';\nimport {_init as ZonedDateTimeInit} from './ZonedDateTime';\nimport {_init as IsoChronologyInit} from './chrono/IsoChronology';\nimport {_init as DateTimeFormatterInit} from './format/DateTimeFormatter';\nimport {_init as ChronoFieldInit} from './temporal/ChronoField';\nimport {_init as ChronoUnitInit} from './temporal/ChronoUnit';\nimport {_init as IsoFieldsInit} from './temporal/IsoFields';\nimport {_init as DateTimeFormatterBuilderInit} from './format/DateTimeFormatterBuilder';\n\nimport {_init as TemporalQueriesInit} from './temporal/TemporalQueriesFactory';\nimport {_init as ZoneIdInit} from './ZoneIdFactory';\n\nlet isInit = false;\n\nfunction init() {\n\n if (isInit) {\n return;\n }\n\n isInit = true;\n\n YearConstantsInit();\n DurationInit();\n ChronoUnitInit();\n ChronoFieldInit();\n LocalTimeInit();\n IsoFieldsInit();\n TemporalQueriesInit();\n DayOfWeekInit();\n InstantInit();\n LocalDateInit();\n LocalDateTimeInit();\n YearInit();\n MonthInit();\n YearMonthInit();\n MonthDayInit();\n PeriodInit();\n ZoneOffsetInit();\n ZonedDateTimeInit();\n ZoneIdInit();\n IsoChronologyInit();\n DateTimeFormatterInit();\n DateTimeFormatterBuilderInit();\n OffsetDateTimeInit();\n OffsetTimeInit();\n}\n\ninit();\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {IllegalArgumentException} from './errors';\n\nimport {LocalDate} from './LocalDate';\nimport {LocalDateTime} from './LocalDateTime';\nimport {ZonedDateTime} from './ZonedDateTime';\nimport {ZoneId} from './ZoneId';\n\nclass ToNativeJsConverter {\n /**\n * @param {!(LocalDate|LocalDateTime|ZonedDateTime)} temporal - a joda temporal instance\n * @param {ZoneId} [zone] - the zone of the temporal,\n * the default value for LocalDate and LocalDateTime is ZoneId.systemDefault().\n */\n constructor(temporal, zone){\n let zonedDateTime;\n\n if(temporal instanceof LocalDate) {\n zone = zone == null ? ZoneId.systemDefault() : zone;\n zonedDateTime = temporal.atStartOfDay(zone);\n } else if (temporal instanceof LocalDateTime) {\n zone = zone == null ? ZoneId.systemDefault() : zone;\n zonedDateTime = temporal.atZone(zone);\n } else if (temporal instanceof ZonedDateTime) {\n if (zone == null) {\n zonedDateTime = temporal;\n } else {\n zonedDateTime = temporal.withZoneSameInstant(zone);\n }\n } else {\n throw new IllegalArgumentException('unsupported instance for convert operation:' + temporal);\n }\n\n this.instant = zonedDateTime.toInstant();\n }\n\n /**\n *\n * @returns {Date}\n */\n toDate() {\n return new Date(this.instant.toEpochMilli());\n }\n\n /**\n *\n * @returns {number}\n */\n toEpochMilli() {\n return this.instant.toEpochMilli();\n }\n}\n\n/**\n * converts a LocalDate, LocalDateTime or ZonedDateTime to a native Javascript Date.\n *\n * In a first step the temporal is converted to an Instant by adding implicit values.\n * \n * A LocalDate is implicit set to a LocalDateTime at start of day. \n * A LocalDateTime is implicit set to a ZonedDateTime with \n * the passed zone or if null, with the system default time zone. \n * A ZonedDateTime is converted to an Instant, if a zone is specified the zonedDateTime is adjusted to this \n * zone, keeping the same Instant.\n *\n * In a second step the instant is converted to a native Javascript Date\n *\n * default zone for LocalDate and LocalDateTime is ZoneId.systemDefault().\n *\n * @example\n * convert(localDate).toDate() // returns a javascript Date\n * convert(localDate).toEpochMilli() // returns the epochMillis\n *\n * @param {!(LocalDate|LocalDateTime|ZonedDateTime)} temporal - a joda temporal instance\n * @param {ZoneId} [zone] - the zone of the temporal\n * @returns {ToNativeJsConverter}\n */\nexport function convert(temporal, zone){\n return new ToNativeJsConverter(temporal, zone);\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {assert, requireNonNull} from '../assert';\nimport {UnsupportedTemporalTypeException} from '../errors';\n\nimport {Instant} from '../Instant';\nimport {LocalDate} from '../LocalDate';\nimport {LocalTime} from '../LocalTime';\nimport {MathUtil} from '../MathUtil';\nimport {ZoneId} from '../ZoneId';\n\nimport {ChronoField} from './ChronoField';\nimport {TemporalQueries} from './TemporalQueries';\nimport {TemporalAccessor} from './TemporalAccessor';\n\n/**\n * A wrapper around a native javascript Date instance that\n * implements TemporalAccessor functionality\n */\nclass NativeJsTemporal extends TemporalAccessor {\n\n /**\n * @param {!(Date|moment)} date - a javascript Date or a moment instance\n * @param {ZoneId} [zone=ZoneId.systemDefault()] - the zone of the temporal, defaults to ZoneId.systemDefault()\n * @private\n */\n constructor(date, zone=ZoneId.systemDefault()){\n super();\n this._zone = zone;\n if(date instanceof Date) {\n this._epochMilli = date.getTime();\n return;\n } else if(typeof date.toDate === 'function' && date.toDate() instanceof Date) {\n // it's a moment\n this._epochMilli = date.toDate().getTime();\n return;\n }\n assert(false, 'date must be either a javascript date or a moment');\n }\n\n /**\n * @param {TemporalQuery} query the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws DateTimeException if unable to query\n */\n query(query) {\n requireNonNull(query, 'query');\n if (query === TemporalQueries.localDate()) {\n return LocalDate.ofInstant(Instant.ofEpochMilli(this._epochMilli), this._zone);\n } else if(query === TemporalQueries.localTime()){\n return LocalTime.ofInstant(Instant.ofEpochMilli(this._epochMilli), this._zone);\n } else if(query === TemporalQueries.zone()){\n return this._zone;\n }\n return super.query(query);\n }\n\n /**\n *\n * @param {TemporalField} field\n * @returns {number}\n */\n get(field) {\n return this.getLong(field);\n }\n\n /**\n *\n * @param {!TemporalField} field\n * @returns {number}\n */\n getLong(field) {\n requireNonNull(field, 'field');\n if (field instanceof ChronoField) {\n switch (field) {\n case ChronoField.NANO_OF_SECOND: return MathUtil.floorMod(this._epochMilli, 1000) * 1000000;\n case ChronoField.INSTANT_SECONDS: return MathUtil.floorDiv(this._epochMilli, 1000);\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.getFrom(this);\n }\n\n /**\n *\n * @param {TemporalField} field\n * @returns {boolean}\n */\n isSupported(field){\n return field === ChronoField.INSTANT_SECONDS || field === ChronoField.NANO_OF_SECOND;\n }\n}\n\n/**\n *\n * @param {!(Date|moment)} date - a javascript Date or a moment instance\n * @param {ZoneId} [zone=ZoneId.systemDefault()] - the zone of the temporal, defaults to ZoneId.systemDefault()\n * @returns {NativeJsTemporal}\n */\nexport function nativeJs(date, zone){\n return new NativeJsTemporal(date, zone);\n}\n","\nexport function bindUse(jsJoda) {\n const used = [];\n\n /**\n * use\n *\n * Provides a way to extend the internals of js-joda\n *\n * @param {function} fn - function to extend js-joda public api\n * @returns {this} for chaining\n */\n return function use(fn) {\n if (!~used.indexOf(fn)) {\n fn(jsJoda);\n used.push(fn);\n }\n return jsJoda;\n };\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport {\n ArithmeticException,\n DateTimeException,\n DateTimeParseException,\n IllegalArgumentException,\n IllegalStateException,\n UnsupportedTemporalTypeException,\n NullPointerException\n} from './errors';\n\nimport { Clock } from './Clock';\nimport { DayOfWeek } from './DayOfWeek';\nimport { Duration } from './Duration';\nimport { Instant } from './Instant';\nimport { LocalDate } from './LocalDate';\nimport { LocalTime } from './LocalTime';\nimport { LocalDateTime } from './LocalDateTime';\nimport { Month } from './Month';\nimport { MonthDay } from './MonthDay';\nimport { OffsetDateTime } from './OffsetDateTime';\nimport { OffsetTime } from './OffsetTime';\nimport { Period } from './Period';\nimport { Year } from './Year';\nimport { YearConstants } from './YearConstants';\nimport { YearMonth } from './YearMonth';\nimport { ZonedDateTime } from './ZonedDateTime';\nimport { ZoneOffset } from './ZoneOffset';\nimport { ZoneId } from './ZoneId';\nimport { ZoneRegion } from './ZoneRegion';\n\nimport { ZoneOffsetTransition } from './zone/ZoneOffsetTransition';\nimport { ZoneRules } from './zone/ZoneRules';\nimport { ZoneRulesProvider } from './zone/ZoneRulesProvider';\n\nimport { ChronoLocalDate } from './chrono/ChronoLocalDate';\nimport { ChronoLocalDateTime } from './chrono/ChronoLocalDateTime';\nimport { ChronoZonedDateTime } from './chrono/ChronoZonedDateTime';\nimport { IsoChronology } from './chrono/IsoChronology';\n\nimport { ChronoField } from './temporal/ChronoField';\nimport { ChronoUnit } from './temporal/ChronoUnit';\nimport { IsoFields } from './temporal/IsoFields';\nimport { Temporal } from './temporal/Temporal';\nimport { TemporalAccessor } from './temporal/TemporalAccessor';\nimport { TemporalAdjuster } from './temporal/TemporalAdjuster';\nimport { TemporalAdjusters } from './temporal/TemporalAdjusters';\nimport { TemporalAmount } from './temporal/TemporalAmount';\nimport { TemporalField } from './temporal/TemporalField';\nimport { TemporalQueries } from './temporal/TemporalQueries';\nimport { TemporalQuery } from './temporal/TemporalQuery';\nimport { TemporalUnit } from './temporal/TemporalUnit';\nimport { ValueRange } from './temporal/ValueRange';\n\nimport { DateTimeFormatter } from './format/DateTimeFormatter';\nimport { DateTimeFormatterBuilder } from './format/DateTimeFormatterBuilder';\nimport { DecimalStyle } from './format/DecimalStyle';\nimport { ResolverStyle } from './format/ResolverStyle';\nimport { SignStyle } from './format/SignStyle';\nimport { TextStyle } from './format/TextStyle';\n\n// init static properties\nimport './_init';\n\n// private/internal exports, e.g. for use in plugins\nimport { MathUtil } from './MathUtil';\nimport { StringUtil } from './StringUtil';\nimport { DateTimeBuilder } from './format/DateTimeBuilder';\nimport { DateTimeParseContext } from './format/DateTimeParseContext';\nimport { DateTimePrintContext } from './format/DateTimePrintContext';\nimport { StringBuilder } from './format/StringBuilder';\nimport * as assert from './assert';\n\nimport { convert } from './convert';\nimport { nativeJs } from './temporal/NativeJsTemporal';\nimport { bindUse } from './use';\n\nconst _ = {\n assert,\n DateTimeBuilder,\n DateTimeParseContext,\n DateTimePrintContext,\n MathUtil,\n StringUtil,\n StringBuilder,\n};\n\nconst jsJodaExports = {\n _,\n convert,\n nativeJs,\n ArithmeticException,\n DateTimeException,\n DateTimeParseException,\n IllegalArgumentException,\n IllegalStateException,\n UnsupportedTemporalTypeException,\n NullPointerException,\n Clock,\n DayOfWeek,\n Duration,\n Instant,\n LocalDate,\n LocalTime,\n LocalDateTime,\n OffsetTime,\n OffsetDateTime,\n Month,\n MonthDay,\n Period,\n Year,\n YearConstants,\n YearMonth,\n ZonedDateTime,\n ZoneOffset,\n ZoneId,\n ZoneRegion,\n ZoneOffsetTransition,\n ZoneRules,\n ZoneRulesProvider,\n ChronoLocalDate,\n ChronoLocalDateTime,\n ChronoZonedDateTime,\n IsoChronology,\n ChronoField,\n ChronoUnit,\n IsoFields,\n Temporal,\n TemporalAccessor,\n TemporalAdjuster,\n TemporalAdjusters,\n TemporalAmount,\n TemporalField,\n TemporalQueries,\n TemporalQuery,\n TemporalUnit,\n ValueRange,\n DateTimeFormatter,\n DateTimeFormatterBuilder,\n DecimalStyle,\n ResolverStyle,\n SignStyle,\n TextStyle,\n};\n\nconst use = bindUse(jsJodaExports);\njsJodaExports.use = use;\n\nexport {\n _,\n use,\n convert,\n nativeJs,\n ArithmeticException,\n DateTimeException,\n DateTimeParseException,\n IllegalArgumentException,\n IllegalStateException,\n UnsupportedTemporalTypeException,\n NullPointerException,\n Clock,\n DayOfWeek,\n Duration,\n Instant,\n LocalDate,\n LocalTime,\n LocalDateTime,\n Month,\n MonthDay,\n OffsetTime,\n OffsetDateTime,\n Period,\n Year,\n YearConstants,\n YearMonth,\n ZonedDateTime,\n ZoneOffset,\n ZoneId,\n ZoneRegion,\n ZoneOffsetTransition,\n ZoneRules,\n ZoneRulesProvider,\n ChronoLocalDate,\n ChronoLocalDateTime,\n ChronoZonedDateTime,\n IsoChronology,\n ChronoField,\n ChronoUnit,\n IsoFields,\n Temporal,\n TemporalAccessor,\n TemporalAdjuster,\n TemporalAdjusters,\n TemporalAmount,\n TemporalField,\n TemporalQueries,\n TemporalQuery,\n TemporalUnit,\n ValueRange,\n DateTimeFormatter,\n DateTimeFormatterBuilder,\n DecimalStyle,\n ResolverStyle,\n SignStyle,\n TextStyle,\n};\n"],"names":["createErrorType","name","init","superErrorClass","Error","JsJodaException","message","captureStackTrace","stack","constructor","apply","arguments","toString","prototype","Object","create","DateTimeException","messageWithCause","DateTimeParseException","messageForDateTimeParseException","UnsupportedTemporalTypeException","ArithmeticException","IllegalArgumentException","IllegalStateException","NullPointerException","cause","msg","text","index","parsedString","errorIndex","assert","assertion","error","requireNonNull","value","parameterName","requireInstance","_class","abstractMethodFail","methodName","TypeError","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","MathUtil","intDiv","x","y","r","roundDown","safeZero","intMod","Math","ceil","floor","floorDiv","floorMod","safeAdd","verifyInt","safeToInt","safeSubtract","safeMultiply","parseInt","isNaN","compareNumbers","a","b","smi","int","hash","number","Infinity","result","hashCode","numbers","n","Enum","_name","equals","other","toJSON","TemporalAmount","get","unit","units","addTo","temporal","subtractFrom","TemporalUnit","duration","isDurationEstimated","isDateBased","isTimeBased","isSupportedBy","dateTime","periodToAdd","between","temporal1","temporal2","Duration","seconds","nanos","_seconds","_nanos","ofDays","days","_create","LocalTime","SECONDS_PER_DAY","ofHours","hours","SECONDS_PER_HOUR","ofMinutes","minutes","SECONDS_PER_MINUTE","ofSeconds","nanoAdjustment","secs","NANOS_PER_SECOND","nos","ofMillis","millis","mos","ofNanos","of","amount","ZERO","plus","from","forEach","startInclusive","endExclusive","until","ChronoUnit","SECONDS","isSupported","ChronoField","NANO_OF_SECOND","startNos","getLong","adjustedEnd","with","e","parse","PATTERN","RegExp","matches","exec","negate","dayMatch","hourMatch","minuteMatch","secondMatch","fractionMatch","daysAsSecs","_parseNumber","hoursAsSecs","minsAsSecs","negativeSecs","charAt","_parseFraction","ex","parsed","multiplier","errorText","substring","parseFloat","length","_createSecondsNanos","_createNegateDaysHoursMinutesSecondsNanos","negated","NANOS","isZero","isNegative","nano","withSeconds","withNanos","nanoOfSecond","checkValidIntValue","plusDuration","durationOrNumber","unitOrNumber","plusAmountUnit","plusSecondsNanos","amountToAdd","DAYS","plusNanos","MICROS","MILLIS","plusMillis","plusSeconds","multipliedBy","plusDays","daysToAdd","plusHours","hoursToAdd","plusMinutes","minutesToAdd","secondsToAdd","millisToAdd","nanosToAdd","epochSec","minus","minusDuration","minusAmountUnit","secsToSubtract","nanosToSubtract","amountToSubtract","minusDays","daysToSubtract","minusHours","hoursToSubtract","minusMinutes","minutesToSubtract","minusSeconds","secondsToSubtract","minusMillis","millisToSubtract","minusNanos","multiplicand","dividedBy","divisor","secsMod","abs","toDays","toHours","toMinutes","toMillis","round","toNanos","totalNanos","compareTo","otherDuration","cmp","rval","nanoString","slice","_init","YearConstants","MIN_VALUE","MAX_VALUE","estimatedDuration","_duration","FOREVER","e2","MINUTES","HOURS","HALF_DAYS","WEEKS","MONTHS","YEARS","DECADES","CENTURIES","MILLENNIA","ERAS","TemporalField","baseUnit","rangeUnit","range","rangeRefinedBy","getFrom","adjustInto","newValue","displayName","ValueRange","minSmallest","minLargest","maxSmallest","maxLargest","_minSmallest","_minLargest","_maxLargest","_maxSmallest","isFixed","minimum","largestMinimum","maximum","smallestMaximum","isValidValue","checkValidValue","field","isValidIntValue","isIntValue","str","byName","fieldName","prop","_baseUnit","_rangeUnit","_range","dateBased","DAY_OF_WEEK","ALIGNED_DAY_OF_WEEK_IN_MONTH","ALIGNED_DAY_OF_WEEK_IN_YEAR","DAY_OF_MONTH","DAY_OF_YEAR","EPOCH_DAY","ALIGNED_WEEK_OF_MONTH","ALIGNED_WEEK_OF_YEAR","MONTH_OF_YEAR","YEAR_OF_ERA","YEAR","ERA","timeBased","NANO_OF_DAY","MICRO_OF_SECOND","MICRO_OF_DAY","MILLI_OF_SECOND","MILLI_OF_DAY","SECOND_OF_MINUTE","SECOND_OF_DAY","MINUTE_OF_HOUR","MINUTE_OF_DAY","HOUR_OF_AMPM","CLOCK_HOUR_OF_AMPM","HOUR_OF_DAY","CLOCK_HOUR_OF_DAY","AMPM_OF_DAY","PROLEPTIC_MONTH","INSTANT_SECONDS","OFFSET_SECONDS","TemporalQueries","zoneId","ZONE_ID","chronology","CHRONO","precision","PRECISION","zone","ZONE","offset","OFFSET","localDate","LOCAL_DATE","localTime","LOCAL_TIME","TemporalAccessor","query","queryFrom","TemporalQuery","createTemporalQuery","queryFromFunction","ExtendedTemporalQuery","DayOfWeek","ordinal","_ordinal","values","ENUMS","valueOf","dayOfWeek","style","locale","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY","FROM","Month","_value","months","newMonthVal","leapYear","FEBRUARY","APRIL","JUNE","SEPTEMBER","NOVEMBER","minLength","maxLength","firstDayOfYear","leap","JANUARY","MARCH","MAY","JULY","AUGUST","OCTOBER","DECEMBER","firstMonthOfQuarter","IsoChronology","INSTANCE","month","Period","years","_years","_months","_days","ofYears","ofMonths","ofWeeks","weeks","i","unitAmount","startDate","endDate","LocalDate","_parse","yearMatch","monthMatch","weekMatch","val","withYears","withMonths","withDays","plusYears","yearsToAdd","plusMonths","monthsToAdd","minusYears","yearsToSubtract","minusMonths","monthsToSubtract","scalar","normalized","totalMonths","toTotalMonths","splitYears","splitMonths","obj","buf","ParsePosition","_index","_errorIndex","getIndex","setIndex","getErrorIndex","setErrorIndex","EnumMap","_map","putAll","otherMap","key","containsKey","hasOwnProperty","undefined","put","set","retainAll","keyList","map","remove","keyName","keySet","clear","ResolverStyle","STRICT","SMART","LENIENT","TemporalAdjuster","Temporal","p1","p2","minusAmount","plusAmount","endTemporal","withAdjuster","withFieldValue","adjuster","DefaultInterfaceTemporal","ChronoLocalDate","fieldOrUnit","ofEpochDay","toEpochDay","format","formatter","DateTimeFormatter","StringUtil","startsWith","pattern","indexOf","len","chr","charCodeAt","ZoneId","systemDefault","getAvailableZoneIds","ofOffset","prefix","id","rules","isFixedOffset","Instant","EPOCH","ZoneRules","Fixed","instantOrLocalDateTime","offsetOfInstant","offsetOfLocalDateTime","instant","offsetOfEpochMilli","epochMilli","localDateTime","validOffsets","transition","standardOffset","daylightSavings","isDaylightSavings","isValidOffset","nextTransition","previousTransition","transitions","transitionRules","_offset","SECONDS_CACHE","ID_CACHE","ZoneOffset","totalSeconds","_validateTotalSeconds","_totalSeconds","_rules","_id","_buildId","absTotalSeconds","absHours","absMinutes","MINUTES_PER_HOUR","absSeconds","MAX_SECONDS","_validate","offsetId","first","ofHoursMinutesSeconds","pos","precededByColon","ch1","ch2","ofHoursMinutes","ofTotalSeconds","ofTotalMinutes","totalMinutes","totalSecs","UTC","MIN","MAX","DateTimeBuilder","dtb","_addFieldValue","fieldValues","chrono","date","time","leapSecond","excessDays","getFieldValue0","old","_putFieldValue0","resolve","resolverStyle","resolverFields","_mergeDate","_mergeTime","_resolveTimeInferZeroes","_resolveInstant","_checkDate","resolveDate","_addObject","val1","val2","ch","ap","hap","nod","cod","lod","sod","mod","los","cos","hod","moh","som","hodVal","mohVal","somVal","nosVal","ofNanoOfDay","ofSecondOfDay","dateOrTime","offsetSecs","atTime","atZone","build","type","DateTimeParseContext","_constructorSelf","_constructorFormatter","_constructorParam","_caseSensitive","_strict","_parsed","Parsed","symbols","_locale","_symbols","_overrideChronology","decimalStyle","_overrideZone","copy","isStrict","setStrict","strict","setLocale","startOptional","push","currentParsed","endOptional","successful","splice","isCaseSensitive","setCaseSensitive","caseSensitive","subSequenceEquals","cs1","offset1","cs2","offset2","toLowerCase","charEquals","charEqualsIgnoreCase","c1","c2","setParsedField","errorPos","successPos","currentParsedFieldValues","setParsedZone","getParsed","toParsed","setParsedLeapSecond","getEffectiveChronology","dateTimeParseContext","cloned","toBuilder","builder","overrideZone","DateTimePrintContext","localeOrFormatter","_temporal","adjust","_optional","getValueQuery","getValue","setDateTime","IsoFields","QUARTER_DAYS","Field","_isIso","_getWeekRangeByLocalDate","wby","_getWeekBasedYear","_getWeekRangeByYear","isLeapYear","_getWeek","dow0","doy0","dayOfYear","doyThu0","alignedWeek","firstThuDoy0","firstMonDoy0","withDayOfYear","week","year","doy","dow","DAY_OF_QUARTER_FIELD","QUARTER_YEARS","qoy","QUARTER_OF_YEAR","moy","curValue","partialTemporal","yearLong","qoyLong","doq","DAY_OF_QUARTER","max","QUARTER_OF_YEAR_FIELD","WEEK_OF_WEEK_BASED_YEAR_FIELD","WEEK_BASED_YEARS","wbyLong","WEEK_BASED_YEAR","dowLong","wowby","WEEK_OF_WEEK_BASED_YEAR","plusWeeks","temp","WEEK_BASED_YEAR_FIELD","newWby","resolved","Unit","added","isoWeekOfWeekyear","isoWeekyear","DecimalStyle","zeroChar","positiveSignChar","negativeSignChar","decimalPointChar","_zeroDigit","_zeroDigitCharCode","_positiveSign","_negativeSign","_decimalSeparator","positiveSign","withPositiveSign","negativeSign","withNegativeSign","zeroDigit","withZeroDigit","decimalSeparator","withDecimalSeparator","convertToDigit","char","convertNumberToI18N","numericText","diff","convertedText","String","fromCharCode","availableLocales","STANDARD","SignStyle","positive","fixedWidth","NORMAL","ALWAYS","EXCEEDS_PAD","NEVER","NOT_NEGATIVE","TextStyle","isStandalone","FULL_STANDALONE","SHORT_STANDALONE","NARROW_STANDALONE","asStandalone","FULL","SHORT","NARROW","asNormal","CharLiteralPrinterParser","literal","_literal","print","context","append","position","CompositePrinterParser","printerParsers","optional","_printerParsers","withOptional","pp","setLength","FractionPrinterParser","minWidth","maxWidth","decimalPoint","fraction","convertToFraction","outputScale","min","substr","effectiveMin","effectiveMax","minEndPos","maxEndPos","total","digit","moveLeft","scale","pow","convertFromFraction","_min","_scaled","decimal","MAX_WIDTH","EXCEED_POINTS","NumberPrinterParser","signStyle","subsequentWidth","_field","_minWidth","_maxWidth","_signStyle","_subsequentWidth","withFixedWidth","withSubsequentWidth","_isFixedWidth","contextValue","_getValue","sign","negative","effMinWidth","effMaxWidth","pass","parseLen","_setValue","ReducedPrinterParser","width","baseValue","baseDate","_baseValue","_baseDate","absValue","lastPart","basePart","isFixedWidth","PATTERNS","OffsetIdPrinterParser","noOffsetText","_checkPattern","bufPos","output","appendChar","noOffsetLen","array","arrayIndex","parseText","required","converted","replace","INSTANCE_ID","PadPrinterParserDecorator","printerParser","padWidth","padChar","_printerParser","_padWidth","_padChar","preLen","insert","endPos","resultPos","SettingsParser","SENSITIVE","INSENSITIVE","StringLiteralPrinterParser","ZoneRulesProvider","getRules","ZoneRegion","ofId","ZoneIdPrinterParser","description","nextChar","newContext","nextNextChar","_parsePrefixedOffset","availableZoneIds","zoneIdTree","size","ZoneIdTree","createTreeMap","maxParseLength","treeMap","parsedZoneId","parseLength","parsedSubZoneId","isLeaf","prefixPos","toUpperCase","sortedZoneIds","sort","ZoneIdTreeMap","add","_treeMap","idLength","subZoneId","subTreeMap","DateTimeFormatterBuilder","_active","_parent","_padNextWidth","_padNextChar","_valueParserIndex","_of","parent","dtFormatterBuilder","parseCaseSensitive","_appendInternalPrinterParser","parseCaseInsensitive","parseStrict","parseLenient","appendValue","_appendValue1","_appendValue2","_appendValue4","_appendValuePrinterParser","appendValueReduced","_appendValueReducedFieldWidthMaxWidthBaseDate","_appendValueReducedFieldWidthMaxWidthBaseValue","activeValueParser","basePP","_appendInternal","appendFraction","appendInstant","fractionalDigits","InstantPrinterParser","appendOffsetId","appendOffset","appendZoneId","appendPattern","_parsePattern","appendZoneText","appendText","appendLocalizedOffset","appendWeekField","FIELD_MAP","cur","start","count","pad","padNext","_parseField","zero","appendLiteral","optionalStart","optionalEnd","BASE_DATE","_padNext1","_padNext2","cpp","_toPrinterParser","toFormatter","SECONDS_PER_10000_YEARS","SECONDS_0000_TO_1970","inSecs","inNanos","inSec","inNano","zeroSecs","hi","lo","ldt","LocalDateTime","ofEpochSecond","second","div","minDigits","maxDigits","parser","ISO_LOCAL_DATE","yearParsed","day","hour","secVal","nanoVal","sec","instantSecs","toEpochSecond","StringBuilder","_str","end","parsedExcessDays","PARSED_EXCESS_DAYS","parsedLeapSecond","PARSED_LEAP_SECOND","ofPattern","_decimalStyle","_resolverStyle","_resolverFields","_chrono","_zone","withChronology","withLocale","withResolverStyle","_formatTo","appendable","parse1","parse2","_parseToBuilder","_createError","abbr","_parseUnresolved0","parseUnresolved","ISO_LOCAL_TIME","ISO_LOCAL_DATE_TIME","ISO_INSTANT","ISO_OFFSET_DATE_TIME","ISO_ZONED_DATE_TIME","BASIC_ISO_DATE","ISO_OFFSET_DATE","ISO_OFFSET_TIME","ISO_ORDINAL_DATE","ISO_WEEK_DATE","MonthDay","now","zoneIdOrClock","now0","nowZoneId","nowClock","Clock","systemDefaultZone","system","clock","dayOfMonth","monthOrNumber","ofMonthNumber","ofNumberNumber","parseString","parseStringFormatter","PARSER","_month","_day","monthValue","isValidYear","Year","isLeap","withMonth","withDayOfMonth","atYear","isAfter","isBefore","YearMonth","ofNumberMonth","_year","isSupportedField","isSupportedUnit","_getProlepticMonth","isValidDay","lengthOfMonth","lengthOfYear","adjusterOrField","f","withYear","newYear","monthCount","calcMonths","newMonth","monthsUntil","atDay","atEndOfMonth","isoYear","parseTextFormatter","isValidMonthDay","monthDay","ofYearDay","atMonth","atMonthMonth","atMonthNumber","atMonthDay","yearsUntil","TemporalAdjusters","firstDayOfMonth","Impl","FIRST_DAY_OF_MONTH","lastDayOfMonth","LAST_DAY_OF_MONTH","firstDayOfNextMonth","FIRST_DAY_OF_NEXT_MONTH","FIRST_DAY_OF_YEAR","lastDayOfYear","LAST_DAY_OF_YEAR","firstDayOfNextYear","FIRST_DAY_OF_NEXT_YEAR","firstInMonth","DayOfWeekInMonth","lastInMonth","dayOfWeekInMonth","next","RelativeDayOfWeek","nextOrSame","previous","previousOrSame","_dowValue","curDow","dowDiff","daysDiff","relative","_relative","calDow","prolepticYear","_updateResolveMap","current","prolepticMonth","yoeLong","era","dom","aw","ad","OffsetTime","OffsetDateTime","toOffsetTime","clockOrZone","_now","ofInstant","ofTimeAndOffset","ofNumbers","minute","secsOfDay","epochSecond","_time","toNanoOfDay","atDate","_toEpochNano","isEqual","_withLocalTimeOffset","toLocalTime","truncatedTo","nanosUntil","NANOS_PER_MINUTE","NANOS_PER_HOUR","withHour","withMinute","withSecond","withNano","withOffsetSameInstant","difference","adjusted","withOffsetSameLocal","offsetNanos","compare","ChronoZonedDateTime","toLocalDate","toInstant","epochDay","toSecondOfDay","toLocalDateTime","strcmp","thisEpochSec","otherEpochSec","ZonedDateTime","of2","of3","of8","ofLocal","dt","preferredOffset","trans","offsetAfter","some","validOffset","ofInstant2","ofInstant3","ofStrict","isGap","ofLenient","zdt","_from","__from","_dateTime","_resolveLocal","newDateTime","_resolveOffset","withEarlierOffsetAtOverlap","isOverlap","earlierOffset","offsetBefore","withLaterOffsetAtOverlap","laterOffset","withZoneSameLocal","withZoneSameInstant","withFixedOffsetZone","minusWeeks","toOffsetDateTime","_","ofDateTime","ofDateAndTime","atZoneSameInstant","atZoneSimilarLocal","toZonedDateTime","_withDateTimeOffset","atOffset","DAYS_PER_CYCLE","DAYS_0000_TO_1970","monthEnd","adjustCycles","doyEst","yearEst","zeroDay","marchDoy0","marchMonth0","_resolvePreviousValid","_get0","_prolepticMonth","m","weeksToAdd","mjDay","weeksToSubtract","until1","until2","daysUntil","_monthsUntil","packed1","packed2","calcDate","atTime1","atTime4","_atTimeOffsetTime","atStartOfDay","atStartOfDayWithZone","MIDNIGHT","dateTimeAfter","_compareTo0","otherDate","yearValue","dayValue","dayString","monthString","yearString","absYear","EPOCH_0","ChronoLocalDateTime","_ofEpochMillis","localSecond","localEpochDay","_date","_withDateTime","newDate","newTime","MICROS_PER_DAY","MILLIS_PER_DAY","_plusWithOverflow","totDays","NANOS_PER_DAY","MINUTES_PER_DAY","HOURS_PER_DAY","totNanos","curNoD","newNoD","timeUntil","endTime","secondOfDay","nanoOfDay","_hour","_minute","_second","_nanoOfSecond","_nano","ham","unitDur","dur","newHour","mofd","newMofd","newMinute","sofd","newSofd","newSecond","nofd","newNofd","newNano","hourValue","minuteValue","secondValue","nanoValue","NOON","NANOS_PER_MILLI","systemUTC","ofEpochMilli","MIN_SECONDS","nval","_plus","_nanosUntil","toEpochMilli","_secondsUntil","secsDiff","nanosDiff","otherInstant","SystemClock","fixed","fixedInstant","FixedClock","baseClock","OffsetClock","withZone","Date","getTime","_instant","_zoneId","_baseClock","ZoneOffsetTransition","_transition","_offsetBefore","_offsetAfter","dateTimeBefore","durationSeconds","d","SystemDefaultZoneRules","offsetInMinutes","getTimezoneOffset","offsetInMinutesBeforePossibleTransition","epochMilliSystemZone","offsetInMinutesAfterPossibleTransition","_throwNotSupported","SystemDefaultZoneId","ZoneIdFactory","SYSTEM_DEFAULT_ZONE_ID_INSTANCE","SYSTEM","isInit","YearConstantsInit","DurationInit","ChronoUnitInit","ChronoFieldInit","LocalTimeInit","IsoFieldsInit","TemporalQueriesInit","DayOfWeekInit","InstantInit","LocalDateInit","LocalDateTimeInit","YearInit","MonthInit","YearMonthInit","MonthDayInit","PeriodInit","ZoneOffsetInit","ZonedDateTimeInit","ZoneIdInit","IsoChronologyInit","DateTimeFormatterInit","DateTimeFormatterBuilderInit","OffsetDateTimeInit","OffsetTimeInit","ToNativeJsConverter","zonedDateTime","toDate","convert","NativeJsTemporal","_epochMilli","nativeJs","bindUse","jsJoda","used","use","fn","jsJodaExports"],"mappings":";;;;;;;;;;;IAAA;;;;IAKA,SAASA,eAAT,CAAyBC,IAAzB,EAA+BC,IAA/B,EAAqCC,eAArC,EAA8D;IAAA,MAAzBA,eAAyB;IAAzBA,IAAAA,eAAyB,GAAPC,KAAO;IAAA;;IAC1D,WAASC,eAAT,CAAyBC,OAAzB,EAAkC;IAC9B,QAAI,CAACF,KAAK,CAACG,iBAAX,EAA8B;IAC1B,WAAKC,KAAL,GAAc,IAAIJ,KAAJ,EAAD,CAAc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