{"version":3,"file":"index-vPNG9HeR.js","sources":["../../../node_modules/date-fns-tz/esm/utcToZonedTime/index.js"],"sourcesContent":["import tzParseTimezone from '../_lib/tzParseTimezone'\nimport subMilliseconds from 'date-fns/esm/subMilliseconds'\nimport toDate from '../toDate'\n\n/**\n * @name utcToZonedTime\n * @category Time Zone Helpers\n * @summary Get a date/time representing local time in a given time zone from the UTC date\n *\n * @description\n * Returns a date instance with values representing the local time in the time zone\n * specified of the UTC time from the date provided. In other words, when the new date\n * is formatted it will show the equivalent hours in the target time zone regardless\n * of the current system time zone.\n *\n * @param {Date|String|Number} date - the date with the relevant UTC time\n * @param {String} timeZone - the time zone to get local time for, can be an offset or IANA time zone\n * @param {OptionsWithTZ} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options}\n * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}\n * @returns {Date} the new date with the equivalent time in the time zone\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2\n *\n * @example\n * // In June 10am UTC is 6am in New York (-04:00)\n * const result = utcToZonedTime('2014-06-25T10:00:00.000Z', 'America/New_York')\n * //=> Jun 25 2014 06:00:00\n */\nexport default function utcToZonedTime(dirtyDate, timeZone, options) {\n var date = toDate(dirtyDate, options)\n\n // This date has the UTC time values of the input date at the system time zone\n var utcDate = new Date(\n date.getUTCFullYear(),\n date.getUTCMonth(),\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds(),\n date.getUTCMilliseconds()\n )\n // We just need to apply the offset indicated by the time zone to this localized date\n var offsetMilliseconds = tzParseTimezone(timeZone, date)\n\n return offsetMilliseconds\n ? subMilliseconds(utcDate, offsetMilliseconds)\n : utcDate\n}\n"],"names":["utcToZonedTime","dirtyDate","timeZone","options","date","toDate","utcDate","offsetMilliseconds","tzParseTimezone","subMilliseconds"],"mappings":"uFA4Be,SAASA,EAAeC,EAAWC,EAAUC,EAAS,CACnE,IAAIC,EAAOC,EAAOJ,EAAWE,CAAO,EAGhCG,EAAU,IAAI,KAChBF,EAAK,eAAgB,EACrBA,EAAK,YAAa,EAClBA,EAAK,WAAY,EACjBA,EAAK,YAAa,EAClBA,EAAK,cAAe,EACpBA,EAAK,cAAe,EACpBA,EAAK,mBAAkB,CAC3B,EAEMG,EAAqBC,EAAgBN,EAAUE,CAAI,EAEvD,OAAOG,EACHE,EAAgBH,EAASC,CAAkB,EAC3CD,CACN","x_google_ignoreList":[0]}