{ "version": 3, "sources": ["../node_modules/maplibre-gl/rollup/maplibregl.js", "../node_modules/xtend/immutable.js", "../node_modules/fuzzy/lib/fuzzy.js", "../node_modules/suggestions/src/list.js", "../node_modules/suggestions/src/suggestions.js", "../node_modules/suggestions/index.js", "../node_modules/lodash.debounce/index.js", "../node_modules/events/events.js", "../node_modules/@mapbox/mapbox-gl-geocoder/lib/exceptions.js", "../node_modules/@mapbox/mapbox-sdk/lib/helpers/parse-link-header.js", "../node_modules/@mapbox/mapbox-sdk/lib/classes/mapi-response.js", "../node_modules/@mapbox/mapbox-sdk/lib/constants.js", "../node_modules/@mapbox/mapbox-sdk/lib/classes/mapi-error.js", "../node_modules/@mapbox/mapbox-sdk/lib/helpers/parse-headers.js", "../node_modules/@mapbox/mapbox-sdk/lib/browser/browser-layer.js", "../node_modules/base-64/base64.js", "../node_modules/@mapbox/parse-mapbox-token/index.js", "../node_modules/eventemitter3/index.js", "../node_modules/@mapbox/mapbox-sdk/lib/helpers/url-utils.js", "../node_modules/@mapbox/mapbox-sdk/lib/classes/mapi-request.js", "../node_modules/@mapbox/mapbox-sdk/lib/classes/mapi-client.js", "../node_modules/@mapbox/mapbox-sdk/lib/browser/browser-client.js", "../node_modules/@mapbox/mapbox-sdk/index.js", "../node_modules/is-plain-obj/index.js", "../node_modules/@mapbox/fusspot/lib/index.js", "../node_modules/@mapbox/mapbox-sdk/services/service-helpers/validator.js", "../node_modules/@mapbox/mapbox-sdk/services/service-helpers/pick.js", "../node_modules/@mapbox/mapbox-sdk/services/service-helpers/object-map.js", "../node_modules/@mapbox/mapbox-sdk/services/service-helpers/stringify-booleans.js", "../node_modules/@mapbox/mapbox-sdk/services/service-helpers/create-service-factory.js", "../node_modules/@mapbox/mapbox-sdk/services/geocoding.js", "../node_modules/nanoid/url-alphabet/index.js", "../node_modules/nanoid/index.browser.js", "../node_modules/@mapbox/mapbox-gl-geocoder/lib/events.js", "../node_modules/@mapbox/mapbox-gl-geocoder/lib/localization.js", "../node_modules/subtag/subtag.js", "../node_modules/@mapbox/mapbox-gl-geocoder/lib/geolocation.js", "../node_modules/@mapbox/mapbox-gl-geocoder/lib/utils.js", "../node_modules/@mapbox/mapbox-gl-geocoder/lib/index.js", "../src/app.ts", "../src/geocoded.json", "../node_modules/protomaps-themes-base/dist/index.mjs", "../node_modules/pmtiles/dist/index.mjs", "../node_modules/luxon/src/errors.js", "../node_modules/luxon/src/impl/formats.js", "../node_modules/luxon/src/zone.js", "../node_modules/luxon/src/zones/systemZone.js", "../node_modules/luxon/src/zones/IANAZone.js", "../node_modules/luxon/src/impl/locale.js", "../node_modules/luxon/src/zones/fixedOffsetZone.js", "../node_modules/luxon/src/zones/invalidZone.js", "../node_modules/luxon/src/impl/zoneUtil.js", "../node_modules/luxon/src/impl/digits.js", "../node_modules/luxon/src/settings.js", "../node_modules/luxon/src/impl/invalid.js", "../node_modules/luxon/src/impl/conversions.js", "../node_modules/luxon/src/impl/util.js", "../node_modules/luxon/src/impl/english.js", "../node_modules/luxon/src/impl/formatter.js", "../node_modules/luxon/src/impl/regexParser.js", "../node_modules/luxon/src/duration.js", "../node_modules/luxon/src/interval.js", "../node_modules/luxon/src/info.js", "../node_modules/luxon/src/impl/diff.js", "../node_modules/luxon/src/impl/tokenParser.js", "../node_modules/luxon/src/datetime.js", "../src/parser.ts"], "sourcesContent": ["//\n// Our custom intro provides a specialized \"define()\" function, called by the\n// AMD modules below, that sets up the worker blob URL and then executes the\n// main module, storing its exported value as 'maplibregl'\n\n// The three \"chunks\" imported here are produced by a first Rollup pass,\n// which outputs them as AMD modules.\n\n// Shared dependencies, i.e.:\n/*\ndefine(['exports'], function (exports) {\n // Code for all common dependencies\n // Each module's exports are attached attached to 'exports' (with\n // names rewritten to avoid collisions, etc.)\n})\n*/\nimport './build/maplibregl/shared';\n\n// Worker and its unique dependencies, i.e.:\n/*\ndefine(['./shared.js'], function (__shared__js) {\n // Code for worker script and its unique dependencies.\n // Expects the output of 'shared' module to be passed in as an argument,\n // since all references to common deps look like, e.g.,\n // __shared__js.shapeText().\n});\n*/\n// When this wrapper function is passed to our custom define() above,\n// it gets stringified, together with the shared wrapper (using\n// Function.toString()), and the resulting string of code is made into a\n// Blob URL that gets used by the main module to create the web workers.\nimport './build/maplibregl/worker';\n\n// Main module and its unique dependencies\n/*\ndefine(['./shared.js'], function (__shared__js) {\n // Code for main GL JS module and its unique dependencies.\n // Expects the output of 'shared' module to be passed in as an argument,\n // since all references to common deps look like, e.g.,\n // __shared__js.shapeText().\n //\n // Returns the actual maplibregl (i.e. src/index.js)\n});\n*/\nimport './build/maplibregl/index';\n\nexport default maplibregl;\n", "module.exports = extend\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction extend() {\n var target = {}\n\n for (var i = 0; i < arguments.length; i++) {\n var source = arguments[i]\n\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n target[key] = source[key]\n }\n }\n }\n\n return target\n}\n", "/*\n * Fuzzy\n * https://github.com/myork/fuzzy\n *\n * Copyright (c) 2012 Matt York\n * Licensed under the MIT license.\n */\n\n(function() {\n\nvar root = this;\n\nvar fuzzy = {};\n\n// Use in node or in browser\nif (typeof exports !== 'undefined') {\n module.exports = fuzzy;\n} else {\n root.fuzzy = fuzzy;\n}\n\n// Return all elements of `array` that have a fuzzy\n// match against `pattern`.\nfuzzy.simpleFilter = function(pattern, array) {\n return array.filter(function(str) {\n return fuzzy.test(pattern, str);\n });\n};\n\n// Does `pattern` fuzzy match `str`?\nfuzzy.test = function(pattern, str) {\n return fuzzy.match(pattern, str) !== null;\n};\n\n// If `pattern` matches `str`, wrap each matching character\n// in `opts.pre` and `opts.post`. If no match, return null\nfuzzy.match = function(pattern, str, opts) {\n opts = opts || {};\n var patternIdx = 0\n , result = []\n , len = str.length\n , totalScore = 0\n , currScore = 0\n // prefix\n , pre = opts.pre || ''\n // suffix\n , post = opts.post || ''\n // String to compare against. This might be a lowercase version of the\n // raw string\n , compareString = opts.caseSensitive && str || str.toLowerCase()\n , ch;\n\n pattern = opts.caseSensitive && pattern || pattern.toLowerCase();\n\n // For each character in the string, either add it to the result\n // or wrap in template if it's the next string in the pattern\n for(var idx = 0; idx < len; idx++) {\n ch = str[idx];\n if(compareString[idx] === pattern[patternIdx]) {\n ch = pre + ch + post;\n patternIdx += 1;\n\n // consecutive characters should increase the score more than linearly\n currScore += 1 + currScore;\n } else {\n currScore = 0;\n }\n totalScore += currScore;\n result[result.length] = ch;\n }\n\n // return rendered string if we have a match for every char\n if(patternIdx === pattern.length) {\n // if the string is an exact match with pattern, totalScore should be maxed\n totalScore = (compareString === pattern) ? Infinity : totalScore;\n return {rendered: result.join(''), score: totalScore};\n }\n\n return null;\n};\n\n// The normal entry point. Filters `arr` for matches against `pattern`.\n// It returns an array with matching values of the type:\n//\n// [{\n// string: 'lah' // The rendered string\n// , index: 2 // The index of the element in `arr`\n// , original: 'blah' // The original element in `arr`\n// }]\n//\n// `opts` is an optional argument bag. Details:\n//\n// opts = {\n// // string to put before a matching character\n// pre: ''\n//\n// // string to put after matching character\n// , post: ''\n//\n// // Optional function. Input is an entry in the given arr`,\n// // output should be the string to test `pattern` against.\n// // In this example, if `arr = [{crying: 'koala'}]` we would return\n// // 'koala'.\n// , extract: function(arg) { return arg.crying; }\n// }\nfuzzy.filter = function(pattern, arr, opts) {\n if(!arr || arr.length === 0) {\n return [];\n }\n if (typeof pattern !== 'string') {\n return arr;\n }\n opts = opts || {};\n return arr\n .reduce(function(prev, element, idx, arr) {\n var str = element;\n if(opts.extract) {\n str = opts.extract(element);\n }\n var rendered = fuzzy.match(pattern, str, opts);\n if(rendered != null) {\n prev[prev.length] = {\n string: rendered.rendered\n , score: rendered.score\n , index: idx\n , original: element\n };\n }\n return prev;\n }, [])\n\n // Sort by score. Browsers are inconsistent wrt stable/unstable\n // sorting, so force stable by using the index in the case of tie.\n // See http://ofb.net/~sethml/is-sort-stable.html\n .sort(function(a,b) {\n var compare = b.score - a.score;\n if(compare) return compare;\n return a.index - b.index;\n });\n};\n\n\n}());\n\n", "'use strict';\n\nvar List = function(component) {\n this.component = component;\n this.items = [];\n this.active = 0;\n this.wrapper = document.createElement('div');\n this.wrapper.className = 'suggestions-wrapper';\n this.element = document.createElement('ul');\n this.element.className = 'suggestions';\n this.wrapper.appendChild(this.element);\n\n // selectingListItem is set to true in the time between the mousedown and mouseup when clicking an item in the list\n // mousedown on a list item will cause the input to blur which normally hides the list, so this flag is used to keep\n // the list open until the mouseup\n this.selectingListItem = false;\n\n component.el.parentNode.insertBefore(this.wrapper, component.el.nextSibling);\n return this;\n};\n\nList.prototype.show = function() {\n this.element.style.display = 'block';\n};\n\nList.prototype.hide = function() {\n this.element.style.display = 'none';\n};\n\nList.prototype.add = function(item) {\n this.items.push(item);\n};\n\nList.prototype.clear = function() {\n this.items = [];\n this.active = 0;\n};\n\nList.prototype.isEmpty = function() {\n return !this.items.length;\n};\n\nList.prototype.isVisible = function() {\n return this.element.style.display === 'block';\n};\n\nList.prototype.draw = function() {\n this.element.innerHTML = '';\n\n if (this.items.length === 0) {\n this.hide();\n return;\n }\n\n for (var i = 0; i < this.items.length; i++) {\n this.drawItem(this.items[i], this.active === i);\n }\n\n this.show();\n};\n\nList.prototype.drawItem = function(item, active) {\n var li = document.createElement('li'),\n a = document.createElement('a');\n\n if (active) li.className += ' active';\n\n a.innerHTML = item.string;\n\n li.appendChild(a);\n this.element.appendChild(li);\n\n li.addEventListener('mousedown', function() {\n this.selectingListItem = true;\n }.bind(this));\n\n li.addEventListener('mouseup', function() {\n this.handleMouseUp.call(this, item);\n }.bind(this));\n};\n\nList.prototype.handleMouseUp = function(item) {\n this.selectingListItem = false;\n this.component.value(item.original);\n this.clear();\n this.draw();\n};\n\nList.prototype.move = function(index) {\n this.active = index;\n this.draw();\n};\n\nList.prototype.previous = function() {\n this.move(this.active === 0 ? this.items.length - 1 : this.active - 1);\n};\n\nList.prototype.next = function() {\n this.move(this.active === this.items.length - 1 ? 0 : this.active + 1);\n};\n\nList.prototype.drawError = function(msg){\n var li = document.createElement('li');\n\n li.innerHTML = msg;\n\n this.element.appendChild(li);\n this.show();\n}\n\nmodule.exports = List;\n", "'use strict';\n\nvar extend = require('xtend');\nvar fuzzy = require('fuzzy');\nvar List = require('./list');\n\nvar Suggestions = function(el, data, options) {\n options = options || {};\n\n this.options = extend({\n minLength: 2,\n limit: 5,\n filter: true,\n hideOnBlur: true\n }, options);\n\n this.el = el;\n this.data = data || [];\n this.list = new List(this);\n\n this.query = '';\n this.selected = null;\n\n this.list.draw();\n\n this.el.addEventListener('keyup', function(e) {\n this.handleKeyUp(e.keyCode);\n }.bind(this), false);\n\n this.el.addEventListener('keydown', function(e) {\n this.handleKeyDown(e);\n }.bind(this));\n\n this.el.addEventListener('focus', function() {\n this.handleFocus();\n }.bind(this));\n\n this.el.addEventListener('blur', function() {\n this.handleBlur();\n }.bind(this));\n\n this.el.addEventListener('paste', function(e) {\n this.handlePaste(e);\n }.bind(this));\n\n // use user-provided render function if given, otherwise just use the default\n this.render = (this.options.render) ? this.options.render.bind(this) : this.render.bind(this)\n\n this.getItemValue = (this.options.getItemValue) ? this.options.getItemValue.bind(this) : this.getItemValue.bind(this);\n\n return this;\n};\n\nSuggestions.prototype.handleKeyUp = function(keyCode) {\n // 40 - DOWN\n // 38 - UP\n // 27 - ESC\n // 13 - ENTER\n // 9 - TAB\n\n if (keyCode === 40 ||\n keyCode === 38 ||\n keyCode === 27 ||\n keyCode === 13 ||\n keyCode === 9) return;\n\n this.handleInputChange(this.el.value);\n};\n\nSuggestions.prototype.handleKeyDown = function(e) {\n switch (e.keyCode) {\n case 13: // ENTER\n case 9: // TAB\n if (!this.list.isEmpty()) {\n if (this.list.isVisible()) {\n e.preventDefault();\n }\n this.value(this.list.items[this.list.active].original);\n this.list.hide();\n }\n break;\n case 27: // ESC\n if (!this.list.isEmpty()) this.list.hide();\n break;\n case 38: // UP\n this.list.previous();\n break;\n case 40: // DOWN\n this.list.next();\n break;\n }\n};\n\nSuggestions.prototype.handleBlur = function() {\n if (!this.list.selectingListItem && this.options.hideOnBlur) {\n this.list.hide();\n }\n};\n\nSuggestions.prototype.handlePaste = function(e) {\n if (e.clipboardData) {\n this.handleInputChange(e.clipboardData.getData('Text'));\n } else {\n var self = this;\n setTimeout(function () {\n self.handleInputChange(e.target.value);\n }, 100);\n }\n};\n\nSuggestions.prototype.handleInputChange = function(query) {\n this.query = this.normalize(query);\n\n this.list.clear();\n\n if (this.query.length < this.options.minLength) {\n this.list.draw();\n return;\n }\n\n this.getCandidates(function(data) {\n for (var i = 0; i < data.length; i++) {\n this.list.add(data[i]);\n if (i === (this.options.limit - 1)) break;\n }\n this.list.draw();\n }.bind(this));\n};\n\nSuggestions.prototype.handleFocus = function() {\n if (!this.list.isEmpty()) this.list.show();\n this.list.selectingListItem = false;\n};\n\n/**\n * Update data previously passed\n *\n * @param {Array} revisedData\n */\nSuggestions.prototype.update = function(revisedData) {\n this.data = revisedData;\n this.handleKeyUp();\n};\n\n/**\n * Clears data\n */\nSuggestions.prototype.clear = function() {\n this.data = [];\n this.list.clear();\n};\n\n/**\n * Normalize the results list and input value for matching\n *\n * @param {String} value\n * @return {String}\n */\nSuggestions.prototype.normalize = function(value) {\n value = value.toLowerCase();\n return value;\n};\n\n/**\n * Evaluates whether an array item qualifies as a match with the current query\n *\n * @param {String} candidate a possible item from the array passed\n * @param {String} query the current query\n * @return {Boolean}\n */\nSuggestions.prototype.match = function(candidate, query) {\n return candidate.indexOf(query) > -1;\n};\n\nSuggestions.prototype.value = function(value) {\n this.selected = value;\n this.el.value = this.getItemValue(value);\n\n if (document.createEvent) {\n var e = document.createEvent('HTMLEvents');\n e.initEvent('change', true, false);\n this.el.dispatchEvent(e);\n } else {\n this.el.fireEvent('onchange');\n }\n};\n\nSuggestions.prototype.getCandidates = function(callback) {\n var options = {\n pre: '',\n post: '',\n extract: function(d) { return this.getItemValue(d); }.bind(this)\n };\n var results;\n if(this.options.filter){\n results = fuzzy.filter(this.query, this.data, options);\n\n results = results.map(function(item){\n return {\n original: item.original,\n string: this.render(item.original, item.string)\n };\n }.bind(this))\n }else{\n results = this.data.map(function(d) {\n var renderedString = this.render(d);\n return {\n original: d,\n string: renderedString\n };\n }.bind(this));\n }\n callback(results);\n};\n\n/**\n * For a given item in the data array, return what should be used as the candidate string\n *\n * @param {Object|String} item an item from the data array\n * @return {String} item\n */\nSuggestions.prototype.getItemValue = function(item) {\n return item;\n};\n\n/**\n * For a given item in the data array, return a string of html that should be rendered in the dropdown\n * @param {Object|String} item an item from the data array\n * @param {String} sourceFormatting a string that has pre-formatted html that should be passed directly through the render function \n * @return {String} html\n */\nSuggestions.prototype.render = function(item, sourceFormatting) {\n if (sourceFormatting){\n // use existing formatting on the source string\n return sourceFormatting;\n }\n var boldString = (item.original) ? this.getItemValue(item.original) : this.getItemValue(item);\n var indexString = this.normalize(boldString);\n var indexOfQuery = indexString.lastIndexOf(this.query);\n while (indexOfQuery > -1) {\n var endIndexOfQuery = indexOfQuery + this.query.length;\n boldString = boldString.slice(0, indexOfQuery) + '' + boldString.slice(indexOfQuery, endIndexOfQuery) + '' + boldString.slice(endIndexOfQuery);\n indexOfQuery = indexString.slice(0, indexOfQuery).lastIndexOf(this.query);\n }\n return boldString\n}\n\n/**\n * Render an custom error message in the suggestions list\n * @param {String} msg An html string to render as an error message\n */\nSuggestions.prototype.renderError = function(msg){\n this.list.drawError(msg);\n}\n\nmodule.exports = Suggestions;\n", "'use strict';\n\n/**\n * A typeahead component for inputs\n * @class Suggestions\n *\n * @param {HTMLInputElement} el A valid HTML input element\n * @param {Array} data An array of data used for results\n * @param {Object} options\n * @param {Number} [options.limit=5] Max number of results to display in the auto suggest list.\n * @param {Number} [options.minLength=2] Number of characters typed into an input to trigger suggestions.\n * @param {Boolean} [options.hideOnBlur=true] If `true`, hides the suggestions when focus is lost.\n * @return {Suggestions} `this`\n * @example\n * // in the browser\n * var input = document.querySelector('input');\n * var data = [\n * 'Roy Eldridge',\n * 'Roy Hargrove',\n * 'Rex Stewart'\n * ];\n *\n * new Suggestions(input, data);\n *\n * // with options\n * var input = document.querySelector('input');\n * var data = [{\n * name: 'Roy Eldridge',\n * year: 1911\n * }, {\n * name: 'Roy Hargrove',\n * year: 1969\n * }, {\n * name: 'Rex Stewart',\n * year: 1907\n * }];\n *\n * var typeahead = new Suggestions(input, data, {\n * filter: false, // Disable filtering\n * minLength: 3, // Number of characters typed into an input to trigger suggestions.\n * limit: 3, // Max number of results to display.\n * hideOnBlur: false // Don't hide results when input loses focus\n * });\n *\n * // As we're passing an object of an arrays as data, override\n * // `getItemValue` by specifying the specific property to search on.\n * typeahead.getItemValue = function(item) { return item.name };\n *\n * input.addEventListener('change', function() {\n * console.log(typeahead.selected); // Current selected item.\n * });\n *\n * // With browserify\n * var Suggestions = require('suggestions');\n *\n * new Suggestions(input, data);\n */\nvar Suggestions = require('./src/suggestions');\nmodule.exports = Suggestions;\n\nif (typeof window !== 'undefined') {\n window.Suggestions = Suggestions;\n}\n", "/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = debounce;\n", "// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function errorListener(err) {\n emitter.removeListener(name, resolver);\n reject(err);\n }\n\n function resolver() {\n if (typeof emitter.removeListener === 'function') {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n\n eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });\n if (name !== 'error') {\n addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });\n }\n });\n}\n\nfunction addErrorHandlerIfEventEmitter(emitter, handler, flags) {\n if (typeof emitter.on === 'function') {\n eventTargetAgnosticAddListener(emitter, 'error', handler, flags);\n }\n}\n\nfunction eventTargetAgnosticAddListener(emitter, name, listener, flags) {\n if (typeof emitter.on === 'function') {\n if (flags.once) {\n emitter.once(name, listener);\n } else {\n emitter.on(name, listener);\n }\n } else if (typeof emitter.addEventListener === 'function') {\n // EventTarget does not have `error` event semantics like Node\n // EventEmitters, we do not listen for `error` events here.\n emitter.addEventListener(name, function wrapListener(arg) {\n // IE does not have builtin `{ once: true }` support so we\n // have to do it manually.\n if (flags.once) {\n emitter.removeEventListener(name, wrapListener);\n }\n listener(arg);\n });\n } else {\n throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type ' + typeof emitter);\n }\n}\n", "module.exports = {\n 'fr': {\n 'name': 'France',\n 'bbox': [[-4.59235, 41.380007], [9.560016, 51.148506]]\n },\n 'us': {\n 'name': 'United States',\n 'bbox': [[-171.791111, 18.91619], [-66.96466, 71.357764]]\n },\n 'ru': {\n 'name': 'Russia',\n 'bbox': [[19.66064, 41.151416], [190.10042, 81.2504]]\n },\n 'ca': {\n 'name': 'Canada',\n 'bbox': [[-140.99778, 41.675105], [-52.648099, 83.23324]]\n }\n};\n", "'use strict';\n\n// Like https://github.com/thlorenz/lib/parse-link-header but without any\n// additional dependencies.\n\nfunction parseParam(param) {\n var parts = param.match(/\\s*(.+)\\s*=\\s*\"?([^\"]+)\"?/);\n if (!parts) return null;\n\n return {\n key: parts[1],\n value: parts[2]\n };\n}\n\nfunction parseLink(link) {\n var parts = link.match(/]*)>(.*)/);\n if (!parts) return null;\n\n var linkUrl = parts[1];\n var linkParams = parts[2].split(';');\n var rel = null;\n var parsedLinkParams = linkParams.reduce(function(result, param) {\n var parsed = parseParam(param);\n if (!parsed) return result;\n if (parsed.key === 'rel') {\n if (!rel) {\n rel = parsed.value;\n }\n return result;\n }\n result[parsed.key] = parsed.value;\n return result;\n }, {});\n if (!rel) return null;\n\n return {\n url: linkUrl,\n rel: rel,\n params: parsedLinkParams\n };\n}\n\n/**\n * Parse a Link header.\n *\n * @param {string} linkHeader\n * @returns {{\n * [string]: {\n * url: string,\n * params: { [string]: string }\n * }\n * }}\n */\nfunction parseLinkHeader(linkHeader) {\n if (!linkHeader) return {};\n\n return linkHeader.split(/,\\s*= 400) {\n var mapiError = new MapiError({\n request: request,\n body: xhr.response,\n statusCode: xhr.status\n });\n reject(mapiError);\n return;\n }\n resolve(xhr);\n };\n\n var body = request.body;\n\n // matching service needs to send a www-form-urlencoded request\n if (typeof body === 'string') {\n xhr.send(body);\n } else if (body) {\n xhr.send(JSON.stringify(body));\n } else if (file) {\n xhr.send(file);\n } else {\n xhr.send();\n }\n\n requestsUnderway[request.id] = xhr;\n }).then(function(xhr) {\n return createResponse(request, xhr);\n });\n}\n\n// The accessToken argument gives this function flexibility\n// for Mapbox's internal client.\nfunction createRequestXhr(request, accessToken) {\n var url = request.url(accessToken);\n var xhr = new window.XMLHttpRequest();\n xhr.open(request.method, url);\n Object.keys(request.headers).forEach(function(key) {\n xhr.setRequestHeader(key, request.headers[key]);\n });\n return xhr;\n}\n\nfunction browserSend(request) {\n return Promise.resolve().then(function() {\n var xhr = createRequestXhr(request, request.client.accessToken);\n return sendRequestXhr(request, xhr);\n });\n}\n\nmodule.exports = {\n browserAbort: browserAbort,\n sendRequestXhr: sendRequestXhr,\n browserSend: browserSend,\n createRequestXhr: createRequestXhr\n};\n", "/*! http://mths.be/base64 v0.1.0 by @mathias | MIT license */\n;(function(root) {\n\n\t// Detect free variables `exports`.\n\tvar freeExports = typeof exports == 'object' && exports;\n\n\t// Detect free variable `module`.\n\tvar freeModule = typeof module == 'object' && module &&\n\t\tmodule.exports == freeExports && module;\n\n\t// Detect free variable `global`, from Node.js or Browserified code, and use\n\t// it as `root`.\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {\n\t\troot = freeGlobal;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar InvalidCharacterError = function(message) {\n\t\tthis.message = message;\n\t};\n\tInvalidCharacterError.prototype = new Error;\n\tInvalidCharacterError.prototype.name = 'InvalidCharacterError';\n\n\tvar error = function(message) {\n\t\t// Note: the error messages used throughout this file match those used by\n\t\t// the native `atob`/`btoa` implementation in Chromium.\n\t\tthrow new InvalidCharacterError(message);\n\t};\n\n\tvar TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\t// http://whatwg.org/html/common-microsyntaxes.html#space-character\n\tvar REGEX_SPACE_CHARACTERS = /[\\t\\n\\f\\r ]/g;\n\n\t// `decode` is designed to be fully compatible with `atob` as described in the\n\t// HTML Standard. http://whatwg.org/html/webappapis.html#dom-windowbase64-atob\n\t// The optimized base64-decoding algorithm used is based on @atk\u2019s excellent\n\t// implementation. https://gist.github.com/atk/1020396\n\tvar decode = function(input) {\n\t\tinput = String(input)\n\t\t\t.replace(REGEX_SPACE_CHARACTERS, '');\n\t\tvar length = input.length;\n\t\tif (length % 4 == 0) {\n\t\t\tinput = input.replace(/==?$/, '');\n\t\t\tlength = input.length;\n\t\t}\n\t\tif (\n\t\t\tlength % 4 == 1 ||\n\t\t\t// http://whatwg.org/C#alphanumeric-ascii-characters\n\t\t\t/[^+a-zA-Z0-9/]/.test(input)\n\t\t) {\n\t\t\terror(\n\t\t\t\t'Invalid character: the string to be decoded is not correctly encoded.'\n\t\t\t);\n\t\t}\n\t\tvar bitCounter = 0;\n\t\tvar bitStorage;\n\t\tvar buffer;\n\t\tvar output = '';\n\t\tvar position = -1;\n\t\twhile (++position < length) {\n\t\t\tbuffer = TABLE.indexOf(input.charAt(position));\n\t\t\tbitStorage = bitCounter % 4 ? bitStorage * 64 + buffer : buffer;\n\t\t\t// Unless this is the first of a group of 4 characters\u2026\n\t\t\tif (bitCounter++ % 4) {\n\t\t\t\t// \u2026convert the first 8 bits to a single ASCII character.\n\t\t\t\toutput += String.fromCharCode(\n\t\t\t\t\t0xFF & bitStorage >> (-2 * bitCounter & 6)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t};\n\n\t// `encode` is designed to be fully compatible with `btoa` as described in the\n\t// HTML Standard: http://whatwg.org/html/webappapis.html#dom-windowbase64-btoa\n\tvar encode = function(input) {\n\t\tinput = String(input);\n\t\tif (/[^\\0-\\xFF]/.test(input)) {\n\t\t\t// Note: no need to special-case astral symbols here, as surrogates are\n\t\t\t// matched, and the input is supposed to only contain ASCII anyway.\n\t\t\terror(\n\t\t\t\t'The string to be encoded contains characters outside of the ' +\n\t\t\t\t'Latin1 range.'\n\t\t\t);\n\t\t}\n\t\tvar padding = input.length % 3;\n\t\tvar output = '';\n\t\tvar position = -1;\n\t\tvar a;\n\t\tvar b;\n\t\tvar c;\n\t\tvar d;\n\t\tvar buffer;\n\t\t// Make sure any padding is handled outside of the loop.\n\t\tvar length = input.length - padding;\n\n\t\twhile (++position < length) {\n\t\t\t// Read three bytes, i.e. 24 bits.\n\t\t\ta = input.charCodeAt(position) << 16;\n\t\t\tb = input.charCodeAt(++position) << 8;\n\t\t\tc = input.charCodeAt(++position);\n\t\t\tbuffer = a + b + c;\n\t\t\t// Turn the 24 bits into four chunks of 6 bits each, and append the\n\t\t\t// matching character for each of them to the output.\n\t\t\toutput += (\n\t\t\t\tTABLE.charAt(buffer >> 18 & 0x3F) +\n\t\t\t\tTABLE.charAt(buffer >> 12 & 0x3F) +\n\t\t\t\tTABLE.charAt(buffer >> 6 & 0x3F) +\n\t\t\t\tTABLE.charAt(buffer & 0x3F)\n\t\t\t);\n\t\t}\n\n\t\tif (padding == 2) {\n\t\t\ta = input.charCodeAt(position) << 8;\n\t\t\tb = input.charCodeAt(++position);\n\t\t\tbuffer = a + b;\n\t\t\toutput += (\n\t\t\t\tTABLE.charAt(buffer >> 10) +\n\t\t\t\tTABLE.charAt((buffer >> 4) & 0x3F) +\n\t\t\t\tTABLE.charAt((buffer << 2) & 0x3F) +\n\t\t\t\t'='\n\t\t\t);\n\t\t} else if (padding == 1) {\n\t\t\tbuffer = input.charCodeAt(position);\n\t\t\toutput += (\n\t\t\t\tTABLE.charAt(buffer >> 2) +\n\t\t\t\tTABLE.charAt((buffer << 4) & 0x3F) +\n\t\t\t\t'=='\n\t\t\t);\n\t\t}\n\n\t\treturn output;\n\t};\n\n\tvar base64 = {\n\t\t'encode': encode,\n\t\t'decode': decode,\n\t\t'version': '0.1.0'\n\t};\n\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine(function() {\n\t\t\treturn base64;\n\t\t});\n\t}\telse if (freeExports && !freeExports.nodeType) {\n\t\tif (freeModule) { // in Node.js or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = base64;\n\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\tfor (var key in base64) {\n\t\t\t\tbase64.hasOwnProperty(key) && (freeExports[key] = base64[key]);\n\t\t\t}\n\t\t}\n\t} else { // in Rhino or a web browser\n\t\troot.base64 = base64;\n\t}\n\n}(this));\n", "'use strict';\n\nvar base64 = require('base-64');\n\nvar tokenCache = {};\n\nfunction parseToken(token) {\n if (tokenCache[token]) {\n return tokenCache[token];\n }\n\n var parts = token.split('.');\n var usage = parts[0];\n var rawPayload = parts[1];\n if (!rawPayload) {\n throw new Error('Invalid token');\n }\n\n var parsedPayload = parsePaylod(rawPayload);\n\n var result = {\n usage: usage,\n user: parsedPayload.u\n };\n if (has(parsedPayload, 'a')) result.authorization = parsedPayload.a;\n if (has(parsedPayload, 'exp')) result.expires = parsedPayload.exp * 1000;\n if (has(parsedPayload, 'iat')) result.created = parsedPayload.iat * 1000;\n if (has(parsedPayload, 'scopes')) result.scopes = parsedPayload.scopes;\n if (has(parsedPayload, 'client')) result.client = parsedPayload.client;\n if (has(parsedPayload, 'll')) result.lastLogin = parsedPayload.ll;\n if (has(parsedPayload, 'iu')) result.impersonator = parsedPayload.iu;\n\n tokenCache[token] = result;\n return result;\n}\n\nfunction parsePaylod(rawPayload) {\n try {\n return JSON.parse(base64.decode(rawPayload));\n } catch (parseError) {\n throw new Error('Invalid token');\n }\n}\n\nfunction has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nmodule.exports = parseToken;\n", "'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n", "'use strict';\n\n// Encode each item of an array individually. The comma\n// delimiters should not themselves be encoded.\nfunction encodeArray(arrayValue) {\n return arrayValue.map(encodeURIComponent).join(',');\n}\n\nfunction encodeValue(value) {\n if (Array.isArray(value)) {\n return encodeArray(value);\n }\n return encodeURIComponent(String(value));\n}\n\n/**\n * Append a query parameter to a URL.\n *\n * @param {string} url\n * @param {string} key\n * @param {string|number|boolean|Array<*>>} [value] - Provide an array\n * if the value is a list and commas between values need to be\n * preserved, unencoded.\n * @returns {string} - Modified URL.\n */\nfunction appendQueryParam(url, key, value) {\n if (value === false || value === null) {\n return url;\n }\n var punctuation = /\\?/.test(url) ? '&' : '?';\n var query = encodeURIComponent(key);\n if (value !== undefined && value !== '' && value !== true) {\n query += '=' + encodeValue(value);\n }\n return '' + url + punctuation + query;\n}\n\n/**\n * Derive a query string from an object and append it\n * to a URL.\n *\n * @param {string} url\n * @param {Object} [queryObject] - Values should be primitives.\n * @returns {string} - Modified URL.\n */\nfunction appendQueryObject(url, queryObject) {\n if (!queryObject) {\n return url;\n }\n\n var result = url;\n Object.keys(queryObject).forEach(function(key) {\n var value = queryObject[key];\n if (value === undefined) {\n return;\n }\n if (Array.isArray(value)) {\n value = value\n .filter(function(v) {\n return v !== null && v !== undefined;\n })\n .join(',');\n }\n result = appendQueryParam(result, key, value);\n });\n return result;\n}\n\n/**\n * Prepend an origin to a URL. If the URL already has an\n * origin, do nothing.\n *\n * @param {string} url\n * @param {string} origin\n * @returns {string} - Modified URL.\n */\nfunction prependOrigin(url, origin) {\n if (!origin) {\n return url;\n }\n\n if (url.slice(0, 4) === 'http') {\n return url;\n }\n\n var delimiter = url[0] === '/' ? '' : '/';\n return '' + origin.replace(/\\/$/, '') + delimiter + url;\n}\n\n/**\n * Interpolate values into a route with express-style,\n * colon-prefixed route parameters.\n *\n * @param {string} route\n * @param {Object} [params] - Values should be primitives\n * or arrays of primitives. Provide an array if the value\n * is a list and commas between values need to be\n * preserved, unencoded.\n * @returns {string} - Modified URL.\n */\nfunction interpolateRouteParams(route, params) {\n if (!params) {\n return route;\n }\n return route.replace(/\\/:([a-zA-Z0-9]+)/g, function(_, paramId) {\n var value = params[paramId];\n if (value === undefined) {\n throw new Error('Unspecified route parameter ' + paramId);\n }\n var preppedValue = encodeValue(value);\n return '/' + preppedValue;\n });\n}\n\nmodule.exports = {\n appendQueryObject: appendQueryObject,\n appendQueryParam: appendQueryParam,\n prependOrigin: prependOrigin,\n interpolateRouteParams: interpolateRouteParams\n};\n", "'use strict';\n\nvar parseToken = require('@mapbox/parse-mapbox-token');\nvar xtend = require('xtend');\nvar EventEmitter = require('eventemitter3');\nvar urlUtils = require('../helpers/url-utils');\nvar constants = require('../constants');\n\nvar requestId = 1;\n\n/**\n * A Mapbox API request.\n *\n * Note that creating a `MapiRequest` does *not* send the request automatically.\n * Use the request's `send` method to send it off and get a `Promise`.\n *\n * The `emitter` property is an `EventEmitter` that emits the following events:\n *\n * - `'response'` - Listeners will be called with a `MapiResponse`.\n * - `'error'` - Listeners will be called with a `MapiError`.\n * - `'downloadProgress'` - Listeners will be called with `ProgressEvents`.\n * - `'uploadProgress'` - Listeners will be called with `ProgressEvents`.\n * Upload events are only available when the request includes a file.\n *\n * @class MapiRequest\n * @property {EventEmitter} emitter - An event emitter. See above.\n * @property {MapiClient} client - This request's `MapiClient`.\n * @property {MapiResponse|null} response - If this request has been sent and received\n * a response, the response is available on this property.\n * @property {MapiError|Error|null} error - If this request has been sent and\n * received an error in response, the error is available on this property.\n * @property {boolean} aborted - If the request has been aborted\n * (via [`abort`](#abort)), this property will be `true`.\n * @property {boolean} sent - If the request has been sent, this property will\n * be `true`. You cannot send the same request twice, so if you need to create\n * a new request that is the equivalent of an existing one, use\n * [`clone`](#clone).\n * @property {string} path - The request's path, including colon-prefixed route\n * parameters.\n * @property {string} origin - The request's origin.\n * @property {string} method - The request's HTTP method.\n * @property {Object} query - A query object, which will be transformed into\n * a URL query string.\n * @property {Object} params - A route parameters object, whose values will\n * be interpolated the path.\n * @property {Object} headers - The request's headers.\n * @property {Object|string|null} body - Data to send with the request.\n * If the request has a body, it will also be sent with the header\n * `'Content-Type: application/json'`.\n * @property {Blob|ArrayBuffer|string|ReadStream} file - A file to\n * send with the request. The browser client accepts Blobs and ArrayBuffers;\n * the Node client accepts strings (filepaths) and ReadStreams.\n * @property {string} encoding - The encoding of the response.\n * @property {string} sendFileAs - The method to send the `file`. Options are\n * `data` (x-www-form-urlencoded) or `form` (multipart/form-data).\n */\n\n/**\n * @ignore\n * @param {MapiClient} client\n * @param {Object} options\n * @param {string} options.method\n * @param {string} options.path\n * @param {Object} [options.query={}]\n * @param {Object} [options.params={}]\n * @param {string} [options.origin]\n * @param {Object} [options.headers]\n * @param {Object} [options.body=null]\n * @param {Blob|ArrayBuffer|string|ReadStream} [options.file=null]\n * @param {string} [options.encoding=utf8]\n */\nfunction MapiRequest(client, options) {\n if (!client) {\n throw new Error('MapiRequest requires a client');\n }\n if (!options || !options.path || !options.method) {\n throw new Error(\n 'MapiRequest requires an options object with path and method properties'\n );\n }\n\n var defaultHeaders = {};\n if (options.body) {\n defaultHeaders['content-type'] = 'application/json';\n }\n\n var headersWithDefaults = xtend(defaultHeaders, options.headers);\n\n // Disallows duplicate header names of mixed case,\n // e.g. Content-Type and content-type.\n var headers = Object.keys(headersWithDefaults).reduce(function(memo, name) {\n memo[name.toLowerCase()] = headersWithDefaults[name];\n return memo;\n }, {});\n\n this.id = requestId++;\n this._options = options;\n\n this.emitter = new EventEmitter();\n this.client = client;\n this.response = null;\n this.error = null;\n this.sent = false;\n this.aborted = false;\n this.path = options.path;\n this.method = options.method;\n this.origin = options.origin || client.origin;\n this.query = options.query || {};\n this.params = options.params || {};\n this.body = options.body || null;\n this.file = options.file || null;\n this.encoding = options.encoding || 'utf8';\n this.sendFileAs = options.sendFileAs || null;\n this.headers = headers;\n}\n\n/**\n * Get the URL of the request.\n *\n * @param {string} [accessToken] - By default, the access token of the request's\n * client is used.\n * @return {string}\n */\nMapiRequest.prototype.url = function url(accessToken) {\n var url = urlUtils.prependOrigin(this.path, this.origin);\n url = urlUtils.appendQueryObject(url, this.query);\n var routeParams = this.params;\n var actualAccessToken =\n accessToken == null ? this.client.accessToken : accessToken;\n if (actualAccessToken) {\n url = urlUtils.appendQueryParam(url, 'access_token', actualAccessToken);\n var accessTokenOwnerId = parseToken(actualAccessToken).user;\n routeParams = xtend({ ownerId: accessTokenOwnerId }, routeParams);\n }\n url = urlUtils.interpolateRouteParams(url, routeParams);\n return url;\n};\n\n/**\n * Send the request. Returns a Promise that resolves with a `MapiResponse`.\n * You probably want to use `response.body`.\n *\n * `send` only retrieves the first page of paginated results. You can get\n * the next page by using the `MapiResponse`'s [`nextPage`](#nextpage)\n * function, or iterate through all pages using [`eachPage`](#eachpage)\n * instead of `send`.\n *\n * @returns {Promise}\n */\nMapiRequest.prototype.send = function send() {\n var self = this;\n\n if (self.sent) {\n throw new Error(\n 'This request has already been sent. Check the response and error properties. Create a new request with clone().'\n );\n }\n self.sent = true;\n\n return self.client.sendRequest(self).then(\n function(response) {\n self.response = response;\n self.emitter.emit(constants.EVENT_RESPONSE, response);\n return response;\n },\n function(error) {\n self.error = error;\n self.emitter.emit(constants.EVENT_ERROR, error);\n throw error;\n }\n );\n};\n\n/**\n * Abort the request.\n *\n * Any pending `Promise` returned by [`send`](#send) will be rejected with\n * an error with `type: 'RequestAbortedError'`. If you've created a request\n * that might be aborted, you need to catch and handle such errors.\n *\n * This method will also abort any requests created while fetching subsequent\n * pages via [`eachPage`](#eachpage).\n *\n * If the request has not been sent or has already been aborted, nothing\n * will happen.\n */\nMapiRequest.prototype.abort = function abort() {\n if (this._nextPageRequest) {\n this._nextPageRequest.abort();\n delete this._nextPageRequest;\n }\n\n if (this.response || this.error || this.aborted) return;\n\n this.aborted = true;\n this.client.abortRequest(this);\n};\n\n/**\n * Invoke a callback for each page of a paginated API response.\n *\n * The callback should have the following signature:\n *\n * ```js\n * (\n * error: MapiError,\n * response: MapiResponse,\n * next: () => void\n * ) => void\n * ```\n *\n * **The next page will not be fetched until you've invoked the\n * `next` callback**, indicating that you're ready for it.\n *\n * @param {Function} callback\n */\nMapiRequest.prototype.eachPage = function eachPage(callback) {\n var self = this;\n\n function handleResponse(response) {\n function getNextPage() {\n delete self._nextPageRequest;\n var nextPageRequest = response.nextPage();\n if (nextPageRequest) {\n self._nextPageRequest = nextPageRequest;\n getPage(nextPageRequest);\n }\n }\n callback(null, response, getNextPage);\n }\n\n function handleError(error) {\n callback(error, null, function() {});\n }\n\n function getPage(request) {\n request.send().then(handleResponse, handleError);\n }\n getPage(this);\n};\n\n/**\n * Clone this request.\n *\n * Each request can only be sent *once*. So if you'd like to send the\n * same request again, clone it and send away.\n *\n * @returns {MapiRequest} - A new `MapiRequest` configured just like this one.\n */\nMapiRequest.prototype.clone = function clone() {\n return this._extend();\n};\n\n/**\n * @ignore\n */\nMapiRequest.prototype._extend = function _extend(options) {\n var extendedOptions = xtend(this._options, options);\n return new MapiRequest(this.client, extendedOptions);\n};\n\nmodule.exports = MapiRequest;\n", "'use strict';\n\nvar parseToken = require('@mapbox/parse-mapbox-token');\nvar MapiRequest = require('./mapi-request');\nvar constants = require('../constants');\n\n/**\n * A low-level Mapbox API client. Use it to create service clients\n * that share the same configuration.\n *\n * Services and `MapiRequest`s use the underlying `MapiClient` to\n * determine how to create, send, and abort requests in a way\n * that is appropriate to the configuration and environment\n * (Node or the browser).\n *\n * @class MapiClient\n * @property {string} accessToken - The Mapbox access token assigned\n * to this client.\n * @property {string} [origin] - The origin\n * to use for API requests. Defaults to https://api.mapbox.com.\n */\n\nfunction MapiClient(options) {\n if (!options || !options.accessToken) {\n throw new Error('Cannot create a client without an access token');\n }\n // Try parsing the access token to determine right away if it's valid.\n parseToken(options.accessToken);\n\n this.accessToken = options.accessToken;\n this.origin = options.origin || constants.API_ORIGIN;\n}\n\nMapiClient.prototype.createRequest = function createRequest(requestOptions) {\n return new MapiRequest(this, requestOptions);\n};\n\nmodule.exports = MapiClient;\n", "'use strict';\n\nvar browser = require('./browser-layer');\nvar MapiClient = require('../classes/mapi-client');\n\nfunction BrowserClient(options) {\n MapiClient.call(this, options);\n}\nBrowserClient.prototype = Object.create(MapiClient.prototype);\nBrowserClient.prototype.constructor = BrowserClient;\n\nBrowserClient.prototype.sendRequest = browser.browserSend;\nBrowserClient.prototype.abortRequest = browser.browserAbort;\n\n/**\n * Create a client for the browser.\n *\n * @param {Object} options\n * @param {string} options.accessToken\n * @param {string} [options.origin]\n * @returns {MapiClient}\n */\nfunction createBrowserClient(options) {\n return new BrowserClient(options);\n}\n\nmodule.exports = createBrowserClient;\n", "'use strict';\n\nvar client = require('./lib/client');\n\nmodule.exports = client;\n", "'use strict';\nvar toString = Object.prototype.toString;\n\nmodule.exports = function (x) {\n\tvar prototype;\n\treturn toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({}));\n};\n", "'use strict';\n/**\n * Validators are functions which assert certain type.\n * They can return a string which can then be used\n * to display a helpful error message.\n * They can also return a function for a custom error message.\n */\nvar isPlainObject = require('is-plain-obj');\nvar xtend = require('xtend');\n\nvar DEFAULT_ERROR_PATH = 'value';\nvar NEWLINE_INDENT = '\\n ';\n\nvar v = {};\n\n/**\n * Runners\n *\n * Take root validators and run assertion\n */\nv.assert = function(rootValidator, options) {\n options = options || {};\n return function(value) {\n var message = validate(rootValidator, value);\n // all good\n if (!message) {\n return;\n }\n\n var errorMessage = processMessage(message, options);\n\n if (options.apiName) {\n errorMessage = options.apiName + ': ' + errorMessage;\n }\n\n throw new Error(errorMessage);\n };\n};\n\n/**\n * Higher Order Validators\n *\n * validators which take other validators as input\n * and output a new validator\n */\nv.shape = function shape(validatorObj) {\n var validators = objectEntries(validatorObj);\n return function shapeValidator(value) {\n var validationResult = validate(v.plainObject, value);\n\n if (validationResult) {\n return validationResult;\n }\n\n var key, validator;\n var errorMessages = [];\n\n for (var i = 0; i < validators.length; i++) {\n key = validators[i].key;\n validator = validators[i].value;\n validationResult = validate(validator, value[key]);\n\n if (validationResult) {\n // return [key].concat(validationResult);\n errorMessages.push([key].concat(validationResult));\n }\n }\n\n if (errorMessages.length < 2) {\n return errorMessages[0];\n }\n\n // enumerate all the error messages\n return function(options) {\n errorMessages = errorMessages.map(function(message) {\n var key = message[0];\n var renderedMessage = processMessage(message, options)\n .split('\\n')\n .join(NEWLINE_INDENT); // indents any inner nesting\n return '- ' + key + ': ' + renderedMessage;\n });\n\n var objectId = options.path.join('.');\n var ofPhrase = objectId === DEFAULT_ERROR_PATH ? '' : ' of ' + objectId;\n\n return (\n 'The following properties' +\n ofPhrase +\n ' have invalid values:' +\n NEWLINE_INDENT +\n errorMessages.join(NEWLINE_INDENT)\n );\n };\n };\n};\n\nv.strictShape = function strictShape(validatorObj) {\n var shapeValidator = v.shape(validatorObj);\n return function strictShapeValidator(value) {\n var shapeResult = shapeValidator(value);\n if (shapeResult) {\n return shapeResult;\n }\n\n var invalidKeys = Object.keys(value).reduce(function(memo, valueKey) {\n if (validatorObj[valueKey] === undefined) {\n memo.push(valueKey);\n }\n return memo;\n }, []);\n\n if (invalidKeys.length !== 0) {\n return function() {\n return 'The following keys are invalid: ' + invalidKeys.join(', ');\n };\n }\n };\n};\n\nv.arrayOf = function arrayOf(validator) {\n return createArrayValidator(validator);\n};\n\nv.tuple = function tuple() {\n var validators = Array.isArray(arguments[0])\n ? arguments[0]\n : Array.prototype.slice.call(arguments);\n return createArrayValidator(validators);\n};\n\n// Currently array validation fails when the first invalid item is found.\nfunction createArrayValidator(validators) {\n var validatingTuple = Array.isArray(validators);\n var getValidator = function(index) {\n if (validatingTuple) {\n return validators[index];\n }\n return validators;\n };\n\n return function arrayValidator(value) {\n var validationResult = validate(v.plainArray, value);\n if (validationResult) {\n return validationResult;\n }\n\n if (validatingTuple && value.length !== validators.length) {\n return 'an array with ' + validators.length + ' items';\n }\n\n for (var i = 0; i < value.length; i++) {\n validationResult = validate(getValidator(i), value[i]);\n if (validationResult) {\n return [i].concat(validationResult);\n }\n }\n };\n}\n\nv.required = function required(validator) {\n function requiredValidator(value) {\n if (value == null) {\n return function(options) {\n return formatErrorMessage(\n options,\n isArrayCulprit(options.path)\n ? 'cannot be undefined/null.'\n : 'is required.'\n );\n };\n }\n return validator.apply(this, arguments);\n }\n requiredValidator.__required = true;\n\n return requiredValidator;\n};\n\nv.oneOfType = function oneOfType() {\n var validators = Array.isArray(arguments[0])\n ? arguments[0]\n : Array.prototype.slice.call(arguments);\n return function oneOfTypeValidator(value) {\n var messages = validators\n .map(function(validator) {\n return validate(validator, value);\n })\n .filter(Boolean);\n\n // If we don't have as many messages as no. of validators,\n // then at least one validator was ok with the value.\n if (messages.length !== validators.length) {\n return;\n }\n\n // check primitive type\n if (\n messages.every(function(message) {\n return message.length === 1 && typeof message[0] === 'string';\n })\n ) {\n return orList(\n messages.map(function(m) {\n return m[0];\n })\n );\n }\n\n // Complex oneOfTypes like\n // `v.oneOftypes(v.shape({name: v.string})`, `v.shape({name: v.number}))`\n // are complex \u00AF\\_(\u30C4)_/\u00AF. For the current scope only returning the longest message.\n return messages.reduce(function(max, arr) {\n return arr.length > max.length ? arr : max;\n });\n };\n};\n\n/**\n * Meta Validators\n * which take options as argument (not validators)\n * and return a new primitive validator\n */\nv.equal = function equal(compareWith) {\n return function equalValidator(value) {\n if (value !== compareWith) {\n return JSON.stringify(compareWith);\n }\n };\n};\n\nv.oneOf = function oneOf() {\n var options = Array.isArray(arguments[0])\n ? arguments[0]\n : Array.prototype.slice.call(arguments);\n var validators = options.map(function(value) {\n return v.equal(value);\n });\n\n return v.oneOfType.apply(this, validators);\n};\n\nv.range = function range(compareWith) {\n var min = compareWith[0];\n var max = compareWith[1];\n return function rangeValidator(value) {\n var validationResult = validate(v.number, value);\n\n if (validationResult || value < min || value > max) {\n return 'number between ' + min + ' & ' + max + ' (inclusive)';\n }\n };\n};\n\n/**\n * Primitive validators\n *\n * simple validators which return a string or undefined\n */\nv.any = function any() {\n return;\n};\n\nv.boolean = function boolean(value) {\n if (typeof value !== 'boolean') {\n return 'boolean';\n }\n};\n\nv.number = function number(value) {\n if (typeof value !== 'number') {\n return 'number';\n }\n};\n\nv.plainArray = function plainArray(value) {\n if (!Array.isArray(value)) {\n return 'array';\n }\n};\n\nv.plainObject = function plainObject(value) {\n if (!isPlainObject(value)) {\n return 'object';\n }\n};\n\nv.string = function string(value) {\n if (typeof value !== 'string') {\n return 'string';\n }\n};\n\nv.func = function func(value) {\n if (typeof value !== 'function') {\n return 'function';\n }\n};\n\nfunction validate(validator, value) {\n // assertions are optional by default unless wrapped in v.require\n if (value == null && !validator.hasOwnProperty('__required')) {\n return;\n }\n\n var result = validator(value);\n\n if (result) {\n return Array.isArray(result) ? result : [result];\n }\n}\n\nfunction processMessage(message, options) {\n // message array follows the convention\n // [...path, result]\n // path is an array of object keys / array indices\n // result is output of the validator\n var len = message.length;\n\n var result = message[len - 1];\n var path = message.slice(0, len - 1);\n\n if (path.length === 0) {\n path = [DEFAULT_ERROR_PATH];\n }\n options = xtend(options, { path: path });\n\n return typeof result === 'function'\n ? result(options) // allows customization of result\n : formatErrorMessage(options, prettifyResult(result));\n}\n\nfunction orList(list) {\n if (list.length < 2) {\n return list[0];\n }\n if (list.length === 2) {\n return list.join(' or ');\n }\n return list.slice(0, -1).join(', ') + ', or ' + list.slice(-1);\n}\n\nfunction prettifyResult(result) {\n return 'must be ' + addArticle(result) + '.';\n}\n\nfunction addArticle(nounPhrase) {\n if (/^an? /.test(nounPhrase)) {\n return nounPhrase;\n }\n if (/^[aeiou]/i.test(nounPhrase)) {\n return 'an ' + nounPhrase;\n }\n if (/^[a-z]/i.test(nounPhrase)) {\n return 'a ' + nounPhrase;\n }\n return nounPhrase;\n}\n\nfunction formatErrorMessage(options, prettyResult) {\n var arrayCulprit = isArrayCulprit(options.path);\n var output = options.path.join('.') + ' ' + prettyResult;\n var prepend = arrayCulprit ? 'Item at position ' : '';\n\n return prepend + output;\n}\n\nfunction isArrayCulprit(path) {\n return typeof path[path.length - 1] == 'number' || typeof path[0] == 'number';\n}\n\nfunction objectEntries(obj) {\n return Object.keys(obj || {}).map(function(key) {\n return { key: key, value: obj[key] };\n });\n}\n\nv.validate = validate;\nv.processMessage = processMessage;\n\nmodule.exports = v;\n", "'use strict';\n\nvar xtend = require('xtend');\nvar v = require('@mapbox/fusspot');\n\nfunction file(value) {\n // If we're in a browser so Blob is available, the file must be that.\n // In Node, however, it could be a filepath or a pipeable (Readable) stream.\n if (typeof window !== 'undefined') {\n if (value instanceof global.Blob || value instanceof global.ArrayBuffer) {\n return;\n }\n return 'Blob or ArrayBuffer';\n }\n if (typeof value === 'string' || value.pipe !== undefined) {\n return;\n }\n return 'Filename or Readable stream';\n}\n\nfunction assertShape(validatorObj, apiName) {\n return v.assert(v.strictShape(validatorObj), apiName);\n}\n\nfunction date(value) {\n var msg = 'date';\n if (typeof value === 'boolean') {\n return msg;\n }\n try {\n var date = new Date(value);\n if (date.getTime && isNaN(date.getTime())) {\n return msg;\n }\n } catch (e) {\n return msg;\n }\n}\n\nfunction coordinates(value) {\n return v.tuple(v.number, v.number)(value);\n}\n\nmodule.exports = xtend(v, {\n file: file,\n date: date,\n coordinates: coordinates,\n assertShape: assertShape\n});\n", "'use strict';\n\n/**\n * Create a new object by picking properties off an existing object.\n * The second param can be overloaded as a callback for\n * more fine grained picking of properties.\n * @param {Object} source\n * @param {Array|function(string, Object):boolean} keys\n * @returns {Object}\n */\nfunction pick(source, keys) {\n var filter = function(key, val) {\n return keys.indexOf(key) !== -1 && val !== undefined;\n };\n\n if (typeof keys === 'function') {\n filter = keys;\n }\n\n return Object.keys(source)\n .filter(function(key) {\n return filter(key, source[key]);\n })\n .reduce(function(result, key) {\n result[key] = source[key];\n return result;\n }, {});\n}\n\nmodule.exports = pick;\n", "'use strict';\n\nfunction objectMap(obj, cb) {\n return Object.keys(obj).reduce(function(result, key) {\n result[key] = cb(key, obj[key]);\n return result;\n }, {});\n}\n\nmodule.exports = objectMap;\n", "'use strict';\n\nvar objectMap = require('./object-map');\n\n/**\n * Stringify all the boolean values in an object, so true becomes \"true\".\n *\n * @param {Object} obj\n * @returns {Object}\n */\nfunction stringifyBoolean(obj) {\n return objectMap(obj, function(_, value) {\n return typeof value === 'boolean' ? JSON.stringify(value) : value;\n });\n}\n\nmodule.exports = stringifyBoolean;\n", "'use strict';\n\nvar MapiClient = require('../../lib/classes/mapi-client');\n// This will create the environment-appropriate client.\nvar createClient = require('../../lib/client');\n\nfunction createServiceFactory(ServicePrototype) {\n return function(clientOrConfig) {\n var client;\n if (MapiClient.prototype.isPrototypeOf(clientOrConfig)) {\n client = clientOrConfig;\n } else {\n client = createClient(clientOrConfig);\n }\n var service = Object.create(ServicePrototype);\n service.client = client;\n return service;\n };\n}\n\nmodule.exports = createServiceFactory;\n", "'use strict';\n\nvar xtend = require('xtend');\nvar v = require('./service-helpers/validator');\nvar pick = require('./service-helpers/pick');\nvar stringifyBooleans = require('./service-helpers/stringify-booleans');\nvar createServiceFactory = require('./service-helpers/create-service-factory');\n\n/**\n * Geocoding API service.\n *\n * Learn more about this service and its responses in\n * [the HTTP service documentation](https://docs.mapbox.com/api/search/#geocoding).\n */\nvar Geocoding = {};\n\nvar featureTypes = [\n 'country',\n 'region',\n 'postcode',\n 'district',\n 'place',\n 'locality',\n 'neighborhood',\n 'address',\n 'poi',\n 'poi.landmark'\n];\n\n/**\n * Search for a place.\n *\n * See the [public documentation](https://docs.mapbox.com/api/search/#forward-geocoding).\n *\n * @param {Object} config\n * @param {string} config.query - A place name.\n * @param {'mapbox.places'|'mapbox.places-permanent'} [config.mode=\"mapbox.places\"] - Either `mapbox.places` for ephemeral geocoding, or `mapbox.places-permanent` for storing results and batch geocoding.\n * @param {Array} [config.countries] - Limits results to the specified countries.\n * Each item in the array should be an [ISO 3166 alpha 2 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).\n * @param {Coordinates|'ip'} [config.proximity] - Bias local results based on a provided coordinate location or a user's IP address.\n * @param {Array<'country'|'region'|'postcode'|'district'|'place'|'locality'|'neighborhood'|'address'|'poi'|'poi.landmark'>} [config.types] - Filter results by feature types.\n * @param {boolean} [config.autocomplete=true] - Return autocomplete results or not.\n * @param {BoundingBox} [config.bbox] - Limit results to a bounding box.\n * @param {number} [config.limit=5] - Limit the number of results returned.\n * @param {Array} [config.language] - Specify the language to use for response text and, for forward geocoding, query result weighting.\n * Options are [IETF language tags](https://en.wikipedia.org/wiki/IETF_language_tag) comprised of a mandatory\n * [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) and optionally one or more IETF subtags for country or script.\n * @param {boolean} [config.routing=false] - Specify whether to request additional metadata about the recommended navigation destination. Only applicable for address features.\n * @param {boolean} [config.fuzzyMatch=true] - Specify whether the Geocoding API should attempt approximate, as well as exact, matching.\n * @param {String} [config.worldview=\"us\"] - Filter results to geographic features whose characteristics are defined differently by audiences belonging to various regional, cultural, or political groups.\n * @param {String} [config.session_token] - A unique session identifier generated by the client.\n * @return {MapiRequest}\n *\n * @example\n * geocodingClient.forwardGeocode({\n * query: 'Paris, France',\n * limit: 2\n * })\n * .send()\n * .then(response => {\n * const match = response.body;\n * });\n *\n * @example\n * // geocoding with proximity\n * geocodingClient.forwardGeocode({\n * query: 'Paris, France',\n * proximity: [-95.4431142, 33.6875431]\n * })\n * .send()\n * .then(response => {\n * const match = response.body;\n * });\n *\n * // geocoding with countries\n * geocodingClient.forwardGeocode({\n * query: 'Paris, France',\n * countries: ['fr']\n * })\n * .send()\n * .then(response => {\n * const match = response.body;\n * });\n *\n * // geocoding with bounding box\n * geocodingClient.forwardGeocode({\n * query: 'Paris, France',\n * bbox: [2.14, 48.72, 2.55, 48.96]\n * })\n * .send()\n * .then(response => {\n * const match = response.body;\n * });\n */\nGeocoding.forwardGeocode = function(config) {\n v.assertShape({\n query: v.required(v.string),\n mode: v.oneOf('mapbox.places', 'mapbox.places-permanent'),\n countries: v.arrayOf(v.string),\n proximity: v.oneOf(v.coordinates, 'ip'),\n types: v.arrayOf(v.oneOf(featureTypes)),\n autocomplete: v.boolean,\n bbox: v.arrayOf(v.number),\n limit: v.number,\n language: v.arrayOf(v.string),\n routing: v.boolean,\n fuzzyMatch: v.boolean,\n worldview: v.string,\n session_token: v.string\n })(config);\n\n config.mode = config.mode || 'mapbox.places';\n\n var query = stringifyBooleans(\n xtend(\n { country: config.countries },\n pick(config, [\n 'proximity',\n 'types',\n 'autocomplete',\n 'bbox',\n 'limit',\n 'language',\n 'routing',\n 'fuzzyMatch',\n 'worldview',\n 'session_token'\n ])\n )\n );\n\n return this.client.createRequest({\n method: 'GET',\n path: '/geocoding/v5/:mode/:query.json',\n params: pick(config, ['mode', 'query']),\n query: query\n });\n};\n\n/**\n * Search for places near coordinates.\n *\n * See the [public documentation](https://docs.mapbox.com/api/search/#reverse-geocoding).\n *\n * @param {Object} config\n * @param {Coordinates} config.query - Coordinates at which features will be searched.\n * @param {'mapbox.places'|'mapbox.places-permanent'} [config.mode=\"mapbox.places\"] - Either `mapbox.places` for ephemeral geocoding, or `mapbox.places-permanent` for storing results and batch geocoding.\n * @param {Array} [config.countries] - Limits results to the specified countries.\n * Each item in the array should be an [ISO 3166 alpha 2 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).\n * @param {Array<'country'|'region'|'postcode'|'district'|'place'|'locality'|'neighborhood'|'address'|'poi'|'poi.landmark'>} [config.types] - Filter results by feature types.\n * @param {BoundingBox} [config.bbox] - Limit results to a bounding box.\n * @param {number} [config.limit=1] - Limit the number of results returned. If using this option, you must provide a single item for `types`.\n * @param {Array} [config.language] - Specify the language to use for response text and, for forward geocoding, query result weighting.\n * Options are [IETF language tags](https://en.wikipedia.org/wiki/IETF_language_tag) comprised of a mandatory\n * [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) and optionally one or more IETF subtags for country or script.\n * @param {'distance'|'score'} [config.reverseMode='distance'] - Set the factors that are used to sort nearby results.\n * @param {boolean} [config.routing=false] - Specify whether to request additional metadata about the recommended navigation destination. Only applicable for address features.\n * @param {String} [config.worldview=\"us\"] - Filter results to geographic features whose characteristics are defined differently by audiences belonging to various regional, cultural, or political groups.\n * @param {String} [config.session_token] - A unique session identifier generated by the client.\n * @return {MapiRequest}\n *\n * @example\n * geocodingClient.reverseGeocode({\n * query: [-95.4431142, 33.6875431]\n * })\n * .send()\n * .then(response => {\n * // GeoJSON document with geocoding matches\n * const match = response.body;\n * });\n */\nGeocoding.reverseGeocode = function(config) {\n v.assertShape({\n query: v.required(v.coordinates),\n mode: v.oneOf('mapbox.places', 'mapbox.places-permanent'),\n countries: v.arrayOf(v.string),\n types: v.arrayOf(v.oneOf(featureTypes)),\n bbox: v.arrayOf(v.number),\n limit: v.number,\n language: v.arrayOf(v.string),\n reverseMode: v.oneOf('distance', 'score'),\n routing: v.boolean,\n worldview: v.string,\n session_token: v.string\n })(config);\n\n config.mode = config.mode || 'mapbox.places';\n\n var query = stringifyBooleans(\n xtend(\n { country: config.countries },\n pick(config, [\n 'country',\n 'types',\n 'bbox',\n 'limit',\n 'language',\n 'reverseMode',\n 'routing',\n 'worldview',\n 'session_token'\n ])\n )\n );\n\n return this.client.createRequest({\n method: 'GET',\n path: '/geocoding/v5/:mode/:query.json',\n params: pick(config, ['mode', 'query']),\n query: query\n });\n};\n\nmodule.exports = createServiceFactory(Geocoding);\n", "let urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\nexport { urlAlphabet }\n", "import { urlAlphabet } from './url-alphabet/index.js'\nlet random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\nlet customRandom = (alphabet, defaultSize, getRandom) => {\n let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1\n let step = -~((1.6 * mask * defaultSize) / alphabet.length)\n return (size = defaultSize) => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\nlet customAlphabet = (alphabet, size = 21) =>\n customRandom(alphabet, size, random)\nlet nanoid = (size = 21) =>\n crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {\n byte &= 63\n if (byte < 36) {\n id += byte.toString(36)\n } else if (byte < 62) {\n id += (byte - 26).toString(36).toUpperCase()\n } else if (byte > 62) {\n id += '-'\n } else {\n id += '_'\n }\n return id\n }, '')\nexport { nanoid, customAlphabet, customRandom, urlAlphabet, random }\n", "'use strict';\nvar nanoid = require('nanoid').nanoid;\n\n/**\n * Construct a new mapbox event client to send interaction events to the mapbox event service\n * @param {Object} options options with which to create the service\n * @param {String} options.accessToken the mapbox access token to make requests\n * @param {Number} [options.flushInterval=1000] the number of ms after which to flush the event queue\n * @param {Number} [options.maxQueueSize=100] the number of events to queue before flushing\n * @private\n */\nfunction MapboxEventManager(options) {\n this.origin = options.origin || 'https://api.mapbox.com';\n this.endpoint = 'events/v2';\n this.access_token = options.accessToken;\n this.version = '0.3.0'\n this.pluginSessionID = this.generateSessionID();\n this.sessionIncrementer = 0;\n this.userAgent = this.getUserAgent();\n\n this.options = options;\n this.send = this.send.bind(this);\n\n\n // parse global options to be sent with each request\n this.countries = (options.countries) ? options.countries.split(\",\") : null;\n this.types = (options.types) ? options.types.split(\",\") : null;\n this.bbox = (options.bbox) ? options.bbox : null;\n this.language = (options.language) ? options.language.split(\",\") : null;\n this.limit = (options.limit) ? +options.limit : null;\n this.locale = navigator.language || null;\n this.enableEventLogging = this.shouldEnableLogging(options);\n this.eventQueue = new Array();\n this.flushInterval = options.flushInterval || 1000;\n this.maxQueueSize = options.maxQueueSize || 100;\n this.timer = (this.flushInterval) ? setTimeout(this.flush.bind(this), this.flushInterval) : null;\n // keep some state to deduplicate requests if necessary\n this.lastSentInput = \"\";\n this.lastSentIndex = 0;\n}\n\nMapboxEventManager.prototype = {\n /**\n * Send a search.select event to the mapbox events service\n * This event marks the array index of the item selected by the user out of the array of possible options\n * @private\n * @param {Object} selected the geojson feature selected by the user\n * @param {Object} geocoder a mapbox-gl-geocoder instance\n * @returns {Promise}\n */\n select: function(selected, geocoder){\n var payload = this.getEventPayload('search.select', geocoder, { selectedFeature: selected });\n if (!payload) return; // reject malformed event\n if ((payload.resultIndex === this.lastSentIndex && payload.queryString === this.lastSentInput) || payload.resultIndex == -1) {\n // don't log duplicate events if the user re-selected the same feature on the same search\n return;\n }\n this.lastSentIndex = payload.resultIndex;\n this.lastSentInput = payload.queryString;\n return this.push(payload)\n },\n\n /**\n * Send a search-start event to the mapbox events service\n * This turnstile event marks when a user starts a new search\n * @private\n * @param {Object} geocoder a mapbox-gl-geocoder instance\n * @returns {Promise}\n */\n start: function(geocoder){\n var payload = this.getEventPayload('search.start', geocoder);\n if (!payload) return; // reject malformed event\n return this.push(payload);\n },\n\n /**\n * Send a search-keyevent event to the mapbox events service\n * This event records each keypress in sequence\n * @private\n * @param {Object} keyEvent the keydown event to log\n * @param {Object} geocoder a mapbox-gl-geocoder instance\n * \n */\n keyevent: function(keyEvent, geocoder){\n\n //pass invalid event\n if (!keyEvent.key) return;\n // don't send events for keys that don't change the input\n // TAB, ESC, LEFT, RIGHT, ENTER, UP, DOWN\n if (keyEvent.metaKey || [9, 27, 37, 39, 13, 38, 40].indexOf(keyEvent.keyCode) !== -1) return;\n var payload = this.getEventPayload('search.keystroke', geocoder, { key: keyEvent.key });\n if (!payload) return; // reject malformed event\n return this.push(payload);\n },\n\n /**\n * Send an event to the events service\n *\n * The event is skipped if the instance is not enabled to send logging events\n *\n * @private\n * @param {Object} payload the http POST body of the event\n * @param {Function} [callback] a callback function to invoke when the send has completed\n * @returns {Promise}\n */\n send: function (payload, callback) {\n if (!this.enableEventLogging) {\n if (callback) return callback();\n return;\n }\n var options = this.getRequestOptions(payload);\n this.request(options, function(err){\n if (err) return this.handleError(err, callback);\n if (callback) {\n return callback();\n }\n }.bind(this))\n },\n /**\n * Get http request options\n * @private\n * @param {*} payload\n */\n getRequestOptions: function(payload){\n if (!Array.isArray(payload)) payload = [payload];\n var options = {\n // events must be sent with POST\n method: \"POST\",\n host: this.origin,\n path: this.endpoint + \"?access_token=\" + this.access_token,\n headers: {\n 'Content-Type': 'application/json'\n },\n body:JSON.stringify(payload) //events are arrays\n }\n return options\n },\n\n /**\n * Get the event payload to send to the events service\n * Most payload properties are shared across all events\n * @private\n * @param {String} event the name of the event to send to the events service. Valid options are 'search.start', 'search.select', 'search.feedback'.\n * @param {Object} geocoder a mapbox-gl-geocoder instance\n * @param {Object} eventArgs Additional arguments needed for certain event types\n * @param {Object} eventArgs.key The key pressed by the user\n * @param {Object} eventArgs.selectedFeature GeoJSON Feature selected by the user\n * @returns {Object} an event payload\n */\n getEventPayload: function (event, geocoder, eventArgs = {}) {\n // Make sure required arguments are present for certain event types\n if (\n (event === 'search.select' && !eventArgs.selectedFeature) ||\n (event === 'search.keystroke' && !eventArgs.key)\n ) {\n return null;\n }\n\n // Handle proximity, whether null, lat/lng coordinate object, or 'ip'\n var proximity;\n if (!geocoder.options.proximity) {\n proximity = null;\n } else if (typeof geocoder.options.proximity === 'object') {\n proximity = [geocoder.options.proximity.longitude, geocoder.options.proximity.latitude];\n } else if (geocoder.options.proximity === 'ip') {\n var ipProximityHeader = geocoder._headers ? geocoder._headers['ip-proximity'] : null;\n if (ipProximityHeader && typeof ipProximityHeader === 'string') {\n proximity = ipProximityHeader.split(',').map(parseFloat);\n } else {\n proximity = [999,999]; // Alias for 'ip' in event logs\n }\n } else {\n proximity = geocoder.options.proximity;\n }\n\n var zoom = (geocoder._map) ? geocoder._map.getZoom() : undefined;\n var payload = {\n event: event,\n version: this.getEventSchemaVersion(event),\n created: +new Date(),\n sessionIdentifier: this.getSessionId(),\n country: this.countries,\n userAgent: this.userAgent,\n language: this.language,\n bbox: this.bbox,\n types: this.types,\n endpoint: 'mapbox.places',\n autocomplete: geocoder.options.autocomplete,\n fuzzyMatch: geocoder.options.fuzzyMatch,\n proximity: proximity,\n limit: geocoder.options.limit,\n routing: geocoder.options.routing,\n worldview: geocoder.options.worldview,\n mapZoom: zoom,\n keyboardLocale: this.locale\n }\n\n // get the text in the search bar\n if (event === \"search.select\"){\n payload.queryString = geocoder.inputString;\n } else if (event != \"search.select\" && geocoder._inputEl){\n payload.queryString = geocoder._inputEl.value;\n } else {\n payload.queryString = geocoder.inputString;\n }\n\n // add additional properties for certain event types\n if (['search.keystroke', 'search.select'].includes(event)) {\n payload.path = 'geocoding/v5/mapbox.places';\n }\n if (event === 'search.keystroke' && eventArgs.key) {\n payload.lastAction = eventArgs.key;\n } else if (event === 'search.select' && eventArgs.selectedFeature) {\n var selected = eventArgs.selectedFeature;\n var resultIndex = this.getSelectedIndex(selected, geocoder);\n payload.resultIndex = resultIndex;\n payload.resultPlaceName = selected.place_name;\n payload.resultId = selected.id;\n if (selected.properties) {\n payload.resultMapboxId = selected.properties.mapbox_id;\n }\n if (geocoder._typeahead) {\n var results = geocoder._typeahead.data;\n if (results && results.length > 0) {\n payload.suggestionIds = this.getSuggestionIds(results);\n payload.suggestionNames = this.getSuggestionNames(results);\n payload.suggestionTypes = this.getSuggestionTypes(results);\n payload.suggestionSources = this.getSuggestionSources(results);\n }\n }\n }\n\n // Finally, validate that required properties are present for API compatibility\n if (!this.validatePayload(payload)) {\n return null;\n }\n\n return payload;\n },\n\n /**\n * Wraps the request function for easier testing\n * Make an http request and invoke a callback\n * @private\n * @param {Object} opts options describing the http request to be made\n * @param {Function} callback the callback to invoke when the http request is completed\n */\n request: function (opts, callback) {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 ) {\n if (this.status == 204){\n //success\n return callback(null);\n }else {\n return callback(this.statusText);\n }\n }\n };\n\n xhttp.open(opts.method, opts.host + '/' + opts.path, true);\n for (var header in opts.headers){\n var headerValue = opts.headers[header];\n xhttp.setRequestHeader(header, headerValue)\n }\n xhttp.send(opts.body);\n },\n\n /**\n * Handle an error that occurred while making a request\n * @param {Object} err an error instance to log\n * @private\n */\n handleError: function (err, callback) {\n if (callback) return callback(err);\n },\n\n /**\n * Generate a session ID to be returned with all of the searches made by this geocoder instance\n * ID is random and cannot be tracked across sessions\n * @private\n */\n generateSessionID: function () {\n return nanoid();\n },\n\n /**\n * Get the a unique session ID for the current plugin session and increment the session counter.\n *\n * @returns {String} The session ID\n */\n getSessionId: function(){\n return this.pluginSessionID + '.' + this.sessionIncrementer;\n },\n\n /**\n * Get a user agent string to send with the request to the events service\n * @private\n */\n getUserAgent: function () {\n return 'mapbox-gl-geocoder.' + this.version + \".\" + navigator.userAgent;\n },\n\n /**\n * Get the 0-based numeric index of the item that the user selected out of the list of options\n * @private\n * @param {Object} selected the geojson feature selected by the user\n * @param {Object} geocoder a Mapbox-GL-Geocoder instance\n * @returns {Number} the index of the selected result\n */\n getSelectedIndex: function(selected, geocoder){\n if (!geocoder._typeahead) return;\n var results = geocoder._typeahead.data;\n var selectedID = selected.id;\n var resultIDs = results.map(function (feature) {\n return feature.id;\n });\n var selectedIdx = resultIDs.indexOf(selectedID);\n return selectedIdx;\n },\n\n getSuggestionIds: function (results) {\n return results.map(function (feature) {\n if (feature.properties) {\n return feature.properties.mapbox_id || '';\n }\n return feature.id || '';\n });\n },\n\n getSuggestionNames: function (results) {\n return results.map(function (feature) {\n return feature.place_name || '';\n });\n },\n \n getSuggestionTypes: function (results) {\n return results.map(function (feature) {\n if (feature.place_type && Array.isArray(feature.place_type)) {\n return feature.place_type[0] || '';\n }\n return '';\n });\n },\n \n getSuggestionSources: function (results) {\n return results.map(function (feature) {\n return feature._source || '';\n });\n },\n\n /**\n * Get the correct schema version for the event\n * @private\n * @param {String} event Name of the event\n * @returns \n */\n getEventSchemaVersion: function(event) {\n if (['search.keystroke', 'search.select'].includes(event)) {\n return '2.2';\n } else {\n return '2.0';\n }\n },\n\n /**\n * Checks if a payload has all the required properties for the event type\n * @private\n * @param {Object} payload \n * @returns \n */\n validatePayload: function(payload) {\n if (!payload || !payload.event) return false;\n\n var searchStartRequiredProps = ['event', 'created', 'sessionIdentifier', 'queryString'];\n var searchKeystrokeRequiredProps = ['event', 'created', 'sessionIdentifier', 'queryString', 'lastAction'];\n var searchSelectRequiredProps = ['event', 'created', 'sessionIdentifier', 'queryString', 'resultIndex', 'path', 'suggestionIds'];\n\n var event = payload.event;\n if (event === 'search.start') {\n return this.objectHasRequiredProps(payload, searchStartRequiredProps);\n } else if (event === 'search.keystroke') {\n return this.objectHasRequiredProps(payload, searchKeystrokeRequiredProps);\n } else if (event === 'search.select') {\n return this.objectHasRequiredProps(payload, searchSelectRequiredProps);\n }\n\n return true;\n },\n\n /**\n * Checks of an object has all the required properties\n * @private\n * @param {Object} obj \n * @param {Array} requiredProps \n * @returns \n */\n objectHasRequiredProps: function(obj, requiredProps) {\n return requiredProps.every(function(prop) {\n if (prop === 'queryString') {\n return typeof obj[prop] === 'string' && obj[prop].length > 0;\n }\n return obj[prop] !== undefined;\n });\n },\n\n /**\n * Check whether events should be logged\n * Clients using a localGeocoder or an origin other than mapbox should not have events logged\n * @private\n */\n shouldEnableLogging: function(options){\n if (options.enableEventLogging === false) return false;\n if (options.origin && options.origin !== 'https://api.mapbox.com') return false;\n return true;\n },\n\n /**\n * Flush out the event queue by sending events to the events service\n * @private\n */\n flush: function(){\n if (this.eventQueue.length > 0){\n this.send(this.eventQueue);\n this.eventQueue = new Array();\n }\n // //reset the timer\n if (this.timer) clearTimeout(this.timer);\n if (this.flushInterval) this.timer = setTimeout(this.flush.bind(this), this.flushInterval)\n },\n\n /**\n * Push event into the pending queue\n * @param {Object} evt the event to send to the events service\n * @param {Boolean} forceFlush indicates that the event queue should be flushed after adding this event regardless of size of the queue\n * @private\n */\n push: function(evt, forceFlush){\n this.eventQueue.push(evt);\n if (this.eventQueue.length >= this.maxQueueSize || forceFlush){\n this.flush();\n }\n },\n\n /**\n * Flush any remaining events from the queue before it is removed\n * @private\n */\n remove: function(){\n this.flush();\n }\n}\n\n\n\nmodule.exports = MapboxEventManager;\n", "'use strict';\n\n/**\n * Localized values for the placeholder string\n * \n * @private\n */\nvar placeholder = {\n // list drawn from https://docs.mapbox.com/api/search/#language-coverage\n 'de': 'Suche', // german\n 'it': 'Ricerca', //italian\n 'en': 'Search', // english\n 'nl': 'Zoeken', //dutch\n 'fr': 'Chercher', //french\n 'ca': 'Cerca', //catalan\n 'he': '\u05DC\u05D7\u05E4\u05E9', //hebrew\n 'ja': '\u30B5\u30FC\u30C1', //japanese\n 'lv': 'Mekl\u0113t', //latvian\n 'pt': 'Procurar', //portuguese \n 'sr': '\u041F\u0440\u0435\u0442\u0440\u0430\u0433\u0430', //serbian\n 'zh': '\u641C\u7D22', //chinese-simplified\n 'cs': 'Vyhled\u00E1v\u00E1n\u00ED', //czech\n 'hu': 'Keres\u00E9s', //hungarian\n 'ka': '\u10EB\u10D8\u10D4\u10D1\u10D0', // georgian\n 'nb': 'S\u00F8ke', //norwegian\n 'sk': 'Vyh\u013Ead\u00E1vanie', //slovak\n 'th': '\u0E04\u0E49\u0E19\u0E2B\u0E32', //thai\n 'fi': 'Hae',//finnish\n 'is': 'Leita',//icelandic\n 'ko': '\uC218\uC0C9',//korean\n 'pl': 'Szukaj', //polish\n 'sl': 'Iskanje', //slovenian\n 'fa': '\u062C\u0633\u062A\u062C\u0648', //persian(aka farsi)\n 'ru': '\u041F\u043E\u0438\u0441\u043A'//russian\n}\n\nmodule.exports = {placeholder: placeholder};\n", "!function(root, name, make) {\r\n if (typeof module != 'undefined' && module.exports) module.exports = make()\r\n else root[name] = make()\r\n}(this, 'subtag', function() {\r\n\r\n var empty = ''\r\n var pattern = /^([a-zA-Z]{2,3})(?:[_-]+([a-zA-Z]{3})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{4})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{2}|[0-9]{3})(?=$|[_-]+))?/\r\n\r\n function match(tag) {\r\n return tag.match(pattern) || []\r\n }\r\n\r\n function split(tag) {\r\n return match(tag).filter(function(v, i) { return v && i })\r\n }\r\n\r\n function api(tag) {\r\n tag = match(tag)\r\n return {\r\n language: tag[1] || empty,\r\n extlang: tag[2] || empty,\r\n script: tag[3] || empty,\r\n region: tag[4] || empty\r\n }\r\n }\r\n\r\n function expose(target, key, value) {\r\n Object.defineProperty(target, key, {\r\n value: value,\r\n enumerable: true\r\n })\r\n }\r\n\r\n function part(position, pattern, type) {\r\n function method(tag) {\r\n return match(tag)[position] || empty\r\n }\r\n expose(method, 'pattern', pattern)\r\n expose(api, type, method)\r\n }\r\n\r\n part(1, /^[a-zA-Z]{2,3}$/, 'language')\r\n part(2, /^[a-zA-Z]{3}$/, 'extlang')\r\n part(3, /^[a-zA-Z]{4}$/, 'script')\r\n part(4, /^[a-zA-Z]{2}$|^[0-9]{3}$/, 'region')\r\n\r\n expose(api, 'split', split)\r\n\r\n return api\r\n});\r\n", "function Geolocation() {}\n\nGeolocation.prototype = {\n\n isSupport: function() {\n return Boolean(window.navigator.geolocation);\n },\n\n getCurrentPosition: function() {\n const positionOptions = {\n enableHighAccuracy: true\n };\n\n return new Promise(function(resolve, reject) {\n window.navigator.geolocation.getCurrentPosition(resolve, reject, positionOptions);\n });\n },\n}\n\nmodule.exports = Geolocation;\n", "/**\n * This function transforms the feature from reverse geocoding to plain text with specified accuracy\n * @param {object} feature \n * @param {string} accuracy \n * @returns \n */\nfunction transformFeatureToGeolocationText(feature, accuracy) {\n const addrInfo = getAddressInfo(feature);\n\n const addressAccuracy = ['address', 'street', 'place', 'country'];\n var currentAccuracy;\n\n if (typeof accuracy === 'function') {\n return accuracy(addrInfo)\n }\n\n const accuracyIndex = addressAccuracy.indexOf(accuracy);\n\n if (accuracyIndex === -1) {\n currentAccuracy = addressAccuracy;\n } else {\n currentAccuracy = addressAccuracy.slice(accuracyIndex);\n }\n\n return currentAccuracy.reduce(function(acc, name) {\n if (!addrInfo[name]) {\n return acc;\n }\n\n if (acc !== '') {\n acc = acc + ', ';\n }\n\n return acc + addrInfo[name];\n }, '');\n}\n/**\n * This function transforms the feature from reverse geocoding to AddressInfo object\n * @param {object} feature \n * @returns {object}\n */\nfunction getAddressInfo(feature) {\n const houseNumber = feature.address || '';\n const street = feature.text || '';\n const placeName = feature.place_name || '';\n const address = placeName.split(',')[0];\n\n const addrInfo = {\n address: address,\n houseNumber: houseNumber,\n street: street,\n placeName: placeName,\n }\n\n feature.context.forEach(function (context) {\n const layer = context.id.split('.')[0];\n addrInfo[layer] = context.text;\n });\n\n return addrInfo;\n}\n\nconst REVERSE_GEOCODE_COORD_RGX = /^[ ]*(-?\\d{1,3}(\\.\\d{0,256})?)[, ]+(-?\\d{1,3}(\\.\\d{0,256})?)[ ]*$/;\n\nmodule.exports = {\n transformFeatureToGeolocationText: transformFeatureToGeolocationText,\n getAddressInfo: getAddressInfo,\n REVERSE_GEOCODE_COORD_RGX: REVERSE_GEOCODE_COORD_RGX,\n}", "'use strict';\n\nvar Typeahead = require('suggestions');\nvar debounce = require('lodash.debounce');\nvar extend = require('xtend');\nvar EventEmitter = require('events').EventEmitter;\nvar exceptions = require('./exceptions');\nvar MapboxClient = require('@mapbox/mapbox-sdk');\nvar mbxGeocoder = require('@mapbox/mapbox-sdk/services/geocoding');\nvar MapboxEventManager = require('./events');\nvar localization = require('./localization');\nvar subtag = require('subtag');\nvar Geolocation = require('./geolocation');\nvar utils = require('./utils');\n\n\nconst GEOCODE_REQUEST_TYPE = {\n FORWARD: 0,\n LOCAL: 1,\n REVERSE: 2,\n};\n\n/**\n * Don't include this as part of the options object when creating a new MapboxGeocoder instance.\n */\nfunction getFooterNode() {\n var div = document.createElement('div');\n div.className = 'mapboxgl-ctrl-geocoder--powered-by';\n div.innerHTML = 'Powered by Mapbox';\n\n return div;\n}\n\n/**\n * A geocoder component using the [Mapbox Geocoding API](https://docs.mapbox.com/api/search/#geocoding)\n * @class MapboxGeocoder\n * @param {Object} options\n * @param {String} options.accessToken Required.\n * @param {String} [options.origin=https://api.mapbox.com] Use to set a custom API origin.\n * @param {Object} [options.mapboxgl] A [mapbox-gl](https://github.com/mapbox/mapbox-gl-js) instance to use when creating [Markers](https://docs.mapbox.com/mapbox-gl-js/api/#marker). Required if `options.marker` is `true`.\n * @param {Number} [options.zoom=16] On geocoded result what zoom level should the map animate to when a `bbox` isn't found in the response. If a `bbox` is found the map will fit to the `bbox`.\n * @param {Boolean|Object} [options.flyTo=true] If `false`, animating the map to a selected result is disabled. If `true`, animating the map will use the default animation parameters. If an object, it will be passed as `options` to the map [`flyTo`](https://docs.mapbox.com/mapbox-gl-js/api/#map#flyto) or [`fitBounds`](https://docs.mapbox.com/mapbox-gl-js/api/#map#fitbounds) method providing control over the animation of the transition.\n * @param {String} [options.placeholder=Search] Override the default placeholder attribute value.\n * @param {Object|'ip'} [options.proximity] a geographical point given as an object with `latitude` and `longitude` properties, or the string 'ip' to use a user's IP address location. Search results closer to this point will be given higher priority.\n * @param {Boolean} [options.trackProximity=true] If `true`, the geocoder proximity will dynamically update based on the current map view or user's IP location, depending on zoom level.\n * @param {Boolean} [options.collapsed=false] If `true`, the geocoder control will collapse until hovered or in focus.\n * @param {Boolean} [options.clearAndBlurOnEsc=false] If `true`, the geocoder control will clear it's contents and blur when user presses the escape key.\n * @param {Boolean} [options.clearOnBlur=false] If `true`, the geocoder control will clear its value when the input blurs.\n * @param {Array} [options.bbox] a bounding box argument: this is\n * a bounding box given as an array in the format `[minX, minY, maxX, maxY]`.\n * Search results will be limited to the bounding box.\n * @param {string} [options.countries] a comma separated list of country codes to\n * limit results to specified country or countries.\n * @param {string} [options.types] a comma seperated list of types that filter\n * results to match those specified. See https://docs.mapbox.com/api/search/#data-types\n * for available types.\n * If reverseGeocode is enabled and no type is specified, the type defaults to POIs. Otherwise, if you configure more than one type, the first type will be used.\n * @param {Number} [options.minLength=2] Minimum number of characters to enter before results are shown.\n * @param {Number} [options.limit=5] Maximum number of results to show.\n * @param {string} [options.language] Specify the language to use for response text and query result weighting. Options are IETF language tags comprised of a mandatory ISO 639-1 language code and optionally one or more IETF subtags for country or script. More than one value can also be specified, separated by commas. Defaults to the browser's language settings.\n * @param {Function} [options.filter] A function which accepts a Feature in the [extended GeoJSON](https://docs.mapbox.com/api/search/geocoding-v5/#geocoding-response-object) format to filter out results from the Geocoding API response before they are included in the suggestions list. Return `true` to keep the item, `false` otherwise.\n * @param {Function} [options.localGeocoder] A function accepting the query string which performs local geocoding to supplement results from the Mapbox Geocoding API. Expected to return an Array of GeoJSON Features in the [extended GeoJSON](https://docs.mapbox.com/api/search/geocoding-v5/#geocoding-response-object) format.\n * @param {Function} [options.externalGeocoder] A function accepting the query string and current features list which performs geocoding to supplement results from the Mapbox Geocoding API. Expected to return a Promise which resolves to an Array of GeoJSON Features in the [extended GeoJSON](https://docs.mapbox.com/api/search/geocoding-v5/#geocoding-response-object) format.\n * @param {distance|score} [options.reverseMode=distance] - Set the factors that are used to sort nearby results.\n * @param {boolean} [options.reverseGeocode=false] If `true`, enable reverse geocoding mode. In reverse geocoding, search input is expected to be coordinates in the form `lat, lon`, with suggestions being the reverse geocodes.\n * @param {boolean} [options.flipCoordinates=false] If `true`, search input coordinates for reverse geocoding is expected to be in the form `lon, lat` instead of the default `lat, lon`.\n * @param {Boolean} [options.enableEventLogging=true] Allow Mapbox to collect anonymous usage statistics from the plugin.\n * @param {Boolean|Object} [options.marker=true] If `true`, a [Marker](https://docs.mapbox.com/mapbox-gl-js/api/#marker) will be added to the map at the location of the user-selected result using a default set of Marker options. If the value is an object, the marker will be constructed using these options. If `false`, no marker will be added to the map. Requires that `options.mapboxgl` also be set.\n * @param {Function} [options.render] A function that specifies how the results should be rendered in the dropdown menu. This function should accepts a single [extended GeoJSON](https://docs.mapbox.com/api/search/geocoding-v5/#geocoding-response-object) object as input and return a string. Any HTML in the returned string will be rendered.\n * @param {Function} [options.getItemValue] A function that specifies how the selected result should be rendered in the search bar. This function should accept a single [extended GeoJSON](https://docs.mapbox.com/api/search/geocoding-v5/#geocoding-response-object) object as input and return a string. HTML tags in the output string will not be rendered. Defaults to `(item) => item.place_name`.\n * @param {String} [options.mode=mapbox.places] A string specifying the geocoding [endpoint](https://docs.mapbox.com/api/search/#endpoints) to query. Options are `mapbox.places` and `mapbox.places-permanent`. The `mapbox.places-permanent` mode requires an enterprise license for permanent geocodes.\n * @param {Boolean} [options.localGeocoderOnly=false] If `true`, indicates that the `localGeocoder` results should be the only ones returned to the user. If `false`, indicates that the `localGeocoder` results should be combined with those from the Mapbox API with the `localGeocoder` results ranked higher.\n * @param {Boolean} [options.autocomplete=true] Specify whether to return autocomplete results or not. When autocomplete is enabled, results will be included that start with the requested string, rather than just responses that match it exactly.\n * @param {Boolean} [options.fuzzyMatch=true] Specify whether the Geocoding API should attempt approximate, as well as exact, matching when performing searches, or whether it should opt out of this behavior and only attempt exact matching.\n * @param {Boolean} [options.routing=false] Specify whether to request additional metadata about the recommended navigation destination corresponding to the feature or not. Only applicable for address features.\n * @param {String} [options.worldview=\"us\"] Filter results to geographic features whose characteristics are defined differently by audiences belonging to various regional, cultural, or political groups.\n * @param {Boolean} [options.enableGeolocation=false] If `true` enable user geolocation feature.\n * @param {('address'|'street'|'place'|'country')} [options.addressAccuracy=\"street\"] The accuracy for the geolocation feature with which we define the address line to fill. The browser API returns the user's position with accuracy, and sometimes we can get the neighbor's address. To prevent receiving an incorrect address, you can reduce the accuracy of the definition.\n * @example\n * var geocoder = new MapboxGeocoder({ accessToken: mapboxgl.accessToken });\n * map.addControl(geocoder);\n * @return {MapboxGeocoder} `this`\n *\n */\n\nfunction MapboxGeocoder(options) {\n this._eventEmitter = new EventEmitter();\n this.options = extend({}, this.options, options);\n this.inputString = '';\n this.fresh = true;\n this.lastSelected = null;\n this.geolocation = new Geolocation();\n}\n\nMapboxGeocoder.prototype = {\n options: {\n zoom: 16,\n flyTo: true,\n trackProximity: true,\n minLength: 2,\n reverseGeocode: false,\n flipCoordinates: false,\n limit: 5,\n origin: 'https://api.mapbox.com',\n enableEventLogging: true,\n marker: true,\n mapboxgl: null,\n collapsed: false,\n clearAndBlurOnEsc: false,\n clearOnBlur: false,\n enableGeolocation: false,\n addressAccuracy: 'street',\n getItemValue: function(item) {\n return item.place_name\n },\n render: function(item) {\n var placeName = item.place_name.split(',');\n return '
' + placeName[0]+ '
' + placeName.splice(1, placeName.length).join(',') + '
';\n }\n },\n \n _headers: {},\n\n /**\n * Add the geocoder to a container. The container can be either a `mapboxgl.Map`, an `HTMLElement` or a CSS selector string.\n *\n * If the container is a [`mapboxgl.Map`](https://docs.mapbox.com/mapbox-gl-js/api/map/), this function will behave identically to [`Map.addControl(geocoder)`](https://docs.mapbox.com/mapbox-gl-js/api/map/#map#addcontrol).\n * If the container is an instance of [`HTMLElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement), then the geocoder will be appended as a child of that [`HTMLElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement).\n * If the container is a [CSS selector string](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors), the geocoder will be appended to the element returned from the query.\n *\n * This function will throw an error if the container is none of the above.\n * It will also throw an error if the referenced HTML element cannot be found in the `document.body`.\n *\n * For example, if the HTML body contains the element `
`, the following script will append the geocoder to `#geocoder-container`:\n *\n * ```javascript\n * var geocoder = new MapboxGeocoder({ accessToken: mapboxgl.accessToken });\n * geocoder.addTo('#geocoder-container');\n * ```\n * @param {String|HTMLElement|mapboxgl.Map} container A reference to the container to which to add the geocoder\n */\n addTo: function(container){\n\n function addToExistingContainer (geocoder, container) {\n if (!document.body.contains(container)) {\n throw new Error(\"Element provided to #addTo() exists, but is not in the DOM\")\n }\n const el = geocoder.onAdd(); //returns the input elements, which are then added to the requested html container\n container.appendChild(el);\n }\n\n // if the container is a map, add the control like normal\n if (container._controlContainer){\n // it's a mapbox-gl map, add like normal\n container.addControl(this);\n }\n // if the container is an HTMLElement, then set the parent to be that element\n else if (container instanceof HTMLElement) {\n addToExistingContainer(this, container);\n }\n // if the container is a string, treat it as a CSS query\n else if (typeof container == 'string'){\n const parent = document.querySelectorAll(container);\n if (parent.length === 0){\n throw new Error(\"Element \", container, \"not found.\")\n }\n\n if (parent.length > 1){\n throw new Error(\"Geocoder can only be added to a single html element\")\n }\n\n addToExistingContainer(this, parent[0]);\n }else{\n throw new Error(\"Error: addTo must be a mapbox-gl-js map, an html element, or a CSS selector query for a single html element\")\n }\n },\n\n onAdd: function(map) {\n if (map && typeof map != 'string'){\n this._map = map;\n }\n\n this.setLanguage();\n\n if (!this.options.localGeocoderOnly){\n this.geocoderService = mbxGeocoder(\n MapboxClient({\n accessToken: this.options.accessToken,\n origin: this.options.origin\n })\n );\n }\n\n if (this.options.localGeocoderOnly && !this.options.localGeocoder){\n throw new Error(\"A localGeocoder function must be specified to use localGeocoderOnly mode\")\n }\n\n this.eventManager = new MapboxEventManager(this.options);\n\n this._onChange = this._onChange.bind(this);\n this._onKeyDown = this._onKeyDown.bind(this);\n this._onPaste = this._onPaste.bind(this);\n this._onBlur = this._onBlur.bind(this);\n this._showButton = this._showButton.bind(this);\n this._hideButton = this._hideButton.bind(this);\n this._onQueryResult = this._onQueryResult.bind(this);\n this.clear = this.clear.bind(this);\n this._updateProximity = this._updateProximity.bind(this);\n this._collapse = this._collapse.bind(this);\n this._unCollapse = this._unCollapse.bind(this);\n this._clear = this._clear.bind(this);\n this._clearOnBlur = this._clearOnBlur.bind(this);\n this._geolocateUser = this._geolocateUser.bind(this);\n\n var el = (this.container = document.createElement('div'));\n el.className = 'mapboxgl-ctrl-geocoder mapboxgl-ctrl';\n\n var searchIcon = this.createIcon('search', '')\n\n this._inputEl = document.createElement('input');\n this._inputEl.type = 'text';\n this._inputEl.className = 'mapboxgl-ctrl-geocoder--input';\n\n this.setPlaceholder();\n\n if (this.options.collapsed) {\n this._collapse();\n this.container.addEventListener('mouseenter', this._unCollapse);\n this.container.addEventListener('mouseleave', this._collapse);\n this._inputEl.addEventListener('focus', this._unCollapse);\n }\n\n if (this.options.collapsed || this.options.clearOnBlur) {\n this._inputEl.addEventListener('blur', this._onBlur);\n }\n\n this._inputEl.addEventListener('keydown', debounce(this._onKeyDown, 200));\n this._inputEl.addEventListener('paste', this._onPaste);\n this._inputEl.addEventListener('change', this._onChange);\n this.container.addEventListener('mouseenter', this._showButton);\n this.container.addEventListener('mouseleave', this._hideButton);\n this._inputEl.addEventListener('keyup', function(e){\n this.eventManager.keyevent(e, this);\n }.bind(this));\n\n var actions = document.createElement('div');\n actions.classList.add('mapboxgl-ctrl-geocoder--pin-right');\n\n this._clearEl = document.createElement('button');\n this._clearEl.setAttribute('aria-label', 'Clear');\n this._clearEl.addEventListener('click', this.clear);\n this._clearEl.className = 'mapboxgl-ctrl-geocoder--button';\n\n var buttonIcon = this.createIcon('close', '')\n this._clearEl.appendChild(buttonIcon);\n\n this._loadingEl = this.createIcon('loading', '');\n\n actions.appendChild(this._clearEl);\n actions.appendChild(this._loadingEl);\n\n el.appendChild(searchIcon);\n el.appendChild(this._inputEl);\n el.appendChild(actions);\n\n if (this.options.enableGeolocation && this.geolocation.isSupport()) {\n this._geolocateEl = document.createElement('button');\n this._geolocateEl.setAttribute('aria-label', 'Geolocate');\n this._geolocateEl.addEventListener('click', this._geolocateUser);\n this._geolocateEl.className = 'mapboxgl-ctrl-geocoder--button';\n\n var geolocateIcon = this.createIcon('geolocate', '');\n this._geolocateEl.appendChild(geolocateIcon);\n\n actions.appendChild(this._geolocateEl);\n this._showGeolocateButton();\n }\n\n var typeahead = this._typeahead = new Typeahead(this._inputEl, [], {\n filter: false,\n minLength: this.options.minLength,\n limit: this.options.limit\n });\n\n this.setRenderFunction(this.options.render);\n typeahead.getItemValue = this.options.getItemValue;\n\n // Add support for footer.\n var parentDraw = typeahead.list.draw;\n var footerNode = this._footerNode = getFooterNode();\n typeahead.list.draw = function() {\n parentDraw.call(this);\n\n footerNode.addEventListener('mousedown', function() {\n this.selectingListItem = true;\n }.bind(this));\n \n footerNode.addEventListener('mouseup', function() {\n this.selectingListItem = false;\n }.bind(this));\n\n this.element.appendChild(footerNode);\n };\n\n this.mapMarker = null;\n this._handleMarker = this._handleMarker.bind(this);\n if (this._map){\n if (this.options.trackProximity ) {\n this._updateProximity();\n this._map.on('moveend', this._updateProximity);\n }\n this._mapboxgl = this.options.mapboxgl;\n if (!this._mapboxgl && this.options.marker) {\n // eslint-disable-next-line no-console\n console.error(\"No mapboxgl detected in options. Map markers are disabled. Please set options.mapboxgl.\");\n this.options.marker = false;\n }\n }\n return el;\n },\n\n _geolocateUser: function () {\n this._hideGeolocateButton();\n this._showLoadingIcon();\n\n this.geolocation.getCurrentPosition().then(function(geolocationPosition) {\n this._hideLoadingIcon();\n\n const geojson = {\n geometry: {\n type: 'Point',\n coordinates: [geolocationPosition.coords.longitude, geolocationPosition.coords.latitude]\n }\n };\n\n this._handleMarker(geojson);\n this._fly(geojson);\n\n this._typeahead.clear();\n this._typeahead.selected = true;\n this.lastSelected = JSON.stringify(geojson);\n this._showClearButton();\n this.fresh = false;\n\n const config = {\n limit: 1,\n language: [this.options.language],\n query: geojson.geometry.coordinates,\n types: [\"address\"]\n };\n\n if (this.options.localGeocoderOnly) {\n const text = geojson.geometry.coordinates[0] + ',' + geojson.geometry.coordinates[1]\n this._setInputValue(text);\n\n this._eventEmitter.emit('result', { result: geojson });\n } else {\n this.geocoderService.reverseGeocode(config).send().then(function (resp) {\n const feature = resp.body.features[0];\n \n if (feature) {\n const locationText = utils.transformFeatureToGeolocationText(feature, this.options.addressAccuracy);\n this._setInputValue(locationText);\n \n feature.user_coordinates = geojson.geometry.coordinates;\n this._eventEmitter.emit('result', { result: feature });\n } else {\n this._eventEmitter.emit('result', { result: { user_coordinates: geojson.geometry.coordinates } });\n }\n }.bind(this));\n }\n }.bind(this)).catch(function(error) {\n if (error.code === 1) {\n this._renderUserDeniedGeolocationError();\n } else {\n this._renderLocationError();\n }\n\n this._hideLoadingIcon();\n this._showGeolocateButton();\n this._hideAttribution();\n }.bind(this));\n },\n\n createIcon: function(name, path) {\n var icon = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n icon.setAttribute('class', 'mapboxgl-ctrl-geocoder--icon mapboxgl-ctrl-geocoder--icon-' + name);\n icon.setAttribute('viewBox', '0 0 18 18');\n icon.setAttribute('xml:space','preserve');\n icon.setAttribute('width', 18);\n icon.setAttribute('height', 18);\n icon.innerHTML = path;\n return icon;\n },\n\n onRemove: function() {\n this.container.parentNode.removeChild(this.container);\n\n if (this.options.trackProximity && this._map) {\n this._map.off('moveend', this._updateProximity);\n }\n\n this._removeMarker();\n\n this._map = null;\n\n return this;\n },\n\n _setInputValue: function (value) {\n this._inputEl.value = value;\n \n setTimeout(function () {\n this._inputEl.focus();\n this._inputEl.scrollLeft = 0;\n this._inputEl.setSelectionRange(0, 0);\n }.bind(this), 1);\n },\n\n _onPaste: function(e){\n var value = (e.clipboardData || window.clipboardData).getData('text');\n if (value.length >= this.options.minLength) {\n this._geocode(value);\n }\n },\n\n _onKeyDown: function(e) {\n var ESC_KEY_CODE = 27,\n TAB_KEY_CODE = 9;\n\n if (e.keyCode === ESC_KEY_CODE && this.options.clearAndBlurOnEsc) {\n this._clear(e);\n return this._inputEl.blur();\n }\n\n // if target has shadowRoot, then get the actual active element inside the shadowRoot\n var target = e.target && e.target.shadowRoot\n ? e.target.shadowRoot.activeElement\n : e.target;\n var value = target ? target.value : '';\n\n if (!value) {\n this.fresh = true;\n // the user has removed all the text\n if (e.keyCode !== TAB_KEY_CODE) this.clear(e);\n this._showGeolocateButton();\n return this._hideClearButton();\n }\n\n this._hideGeolocateButton();\n\n // TAB, ESC, LEFT, RIGHT, ENTER, UP, DOWN\n if ((e.metaKey || [TAB_KEY_CODE, ESC_KEY_CODE, 37, 39, 13, 38, 40].indexOf(e.keyCode) !== -1))\n return;\n\n if (target.value.length >= this.options.minLength) {\n this._geocode(target.value);\n }\n },\n\n _showButton: function() {\n if (this._typeahead.selected) this._showClearButton();\n },\n\n _hideButton: function() {\n if (this._typeahead.selected) this._hideClearButton();\n },\n\n _showClearButton: function() {\n this._clearEl.style.display = 'block';\n },\n\n _hideClearButton: function() {\n this._clearEl.style.display = 'none'\n },\n\n _showGeolocateButton: function() {\n if (this._geolocateEl && this.geolocation.isSupport()) {\n this._geolocateEl.style.display = 'block';\n }\n },\n\n _hideGeolocateButton: function() {\n if (this._geolocateEl) {\n this._geolocateEl.style.display = 'none';\n }\n },\n\n _showLoadingIcon: function() {\n this._loadingEl.style.display = 'block';\n },\n \n _hideLoadingIcon: function() {\n this._loadingEl.style.display = 'none';\n },\n\n _showAttribution: function() {\n this._footerNode.style.display = 'block'\n },\n \n _hideAttribution: function() {\n this._footerNode.style.display = 'none'\n },\n\n _onBlur: function(e) {\n if (this.options.clearOnBlur) {\n this._clearOnBlur(e);\n }\n if (this.options.collapsed) {\n this._collapse();\n }\n },\n _onChange: function() {\n var selected = this._typeahead.selected;\n if (selected && JSON.stringify(selected) !== this.lastSelected) {\n this._hideClearButton();\n if (this.options.flyTo) {\n this._fly(selected);\n }\n if (this.options.marker && this._mapboxgl){\n this._handleMarker(selected);\n }\n\n // After selecting a feature, re-focus the textarea and set\n // cursor at start.\n this._inputEl.focus();\n this._inputEl.scrollLeft = 0;\n this._inputEl.setSelectionRange(0, 0);\n this.lastSelected = JSON.stringify(selected);\n this._eventEmitter.emit('result', { result: selected });\n this.eventManager.select(selected, this);\n }\n },\n\n _fly: function(selected) {\n var flyOptions;\n if (selected.properties && exceptions[selected.properties.short_code]) {\n // Certain geocoder search results return (and therefore zoom to fit)\n // an unexpectedly large bounding box: for example, both Russia and the\n // USA span both sides of -180/180, or France includes the island of\n // Reunion in the Indian Ocean. An incomplete list of these exceptions\n // at ./exceptions.json provides \"reasonable\" bounding boxes as a\n // short-term solution; this may be amended as necessary.\n flyOptions = extend({}, this.options.flyTo);\n if (this._map){\n this._map.fitBounds(exceptions[selected.properties.short_code].bbox, flyOptions);\n }\n } else if (selected.bbox) {\n var bbox = selected.bbox;\n flyOptions = extend({}, this.options.flyTo);\n if (this._map){\n this._map.fitBounds([[bbox[0], bbox[1]], [bbox[2], bbox[3]]], flyOptions);\n }\n } else {\n var defaultFlyOptions = {\n zoom: this.options.zoom\n }\n flyOptions = extend({}, defaultFlyOptions, this.options.flyTo);\n // ensure that center is not overriden by custom options\n if (selected.center) {\n flyOptions.center = selected.center;\n } else if (selected.geometry && selected.geometry.type && selected.geometry.type === 'Point' && selected.geometry.coordinates) {\n flyOptions.center = selected.geometry.coordinates;\n }\n\n if (this._map){\n this._map.flyTo(flyOptions);\n }\n }\n },\n\n _requestType: function(options, search) {\n var type;\n if (options.localGeocoderOnly) {\n type = GEOCODE_REQUEST_TYPE.LOCAL;\n } else if (options.reverseGeocode && utils.REVERSE_GEOCODE_COORD_RGX.test(search)) {\n type = GEOCODE_REQUEST_TYPE.REVERSE;\n } else {\n type = GEOCODE_REQUEST_TYPE.FORWARD;\n }\n return type;\n },\n\n _setupConfig: function(requestType, search) {\n // Possible config properties to pass to client\n const keys = [\n 'bbox',\n 'limit',\n 'proximity',\n 'countries',\n 'types',\n 'language',\n 'reverseMode',\n 'mode',\n 'autocomplete',\n 'fuzzyMatch',\n 'routing',\n 'worldview'\n ];\n const spacesOrCommaRgx = /[\\s,]+/;\n\n var self = this;\n var config = keys.reduce(function(config, key) {\n // don't include undefined/null params, but allow boolean, among other, values\n if (self.options[key] === undefined || self.options[key] === null) {\n return config;\n }\n\n // countries, types, and language need to be passed in as arrays to client\n // https://github.com/mapbox/mapbox-sdk-js/blob/master/services/geocoding.js#L38-L47\n ['countries', 'types', 'language'].indexOf(key) > -1\n ? (config[key] = self.options[key].split(spacesOrCommaRgx))\n : (config[key] = self.options[key]);\n\n const isCoordKey =\n typeof self.options[key].longitude === 'number' &&\n typeof self.options[key].latitude === 'number';\n\n if (key === 'proximity' && isCoordKey) {\n const lng = self.options[key].longitude;\n const lat = self.options[key].latitude;\n\n config[key] = [lng, lat];\n }\n\n return config;\n }, {});\n\n switch (requestType) {\n case GEOCODE_REQUEST_TYPE.REVERSE: {\n var coords = search.split(spacesOrCommaRgx).map(function(c) {\n return parseFloat(c, 10);\n })\n if (!self.options.flipCoordinates) {\n coords.reverse();\n }\n\n // client only accepts one type for reverseGeocode, so\n // use first config type if one, if not default to poi\n config.types ? [config.types[0]] : [\"poi\"];\n config = extend(config, { query: coords, limit: 1 });\n\n // Remove config options not supported by the reverseGeocoder\n ['proximity', 'autocomplete', 'fuzzyMatch', 'bbox'].forEach(function(key) {\n if (key in config) {\n delete config[key]\n }\n });\n } break;\n case GEOCODE_REQUEST_TYPE.FORWARD: {\n // Ensure that any reverse geocoding looking request is cleaned up\n // to be processed as only a forward geocoding request by the server.\n const trimmedSearch = search.trim();\n const reverseGeocodeCoordRgx = /^(-?\\d{1,3}(\\.\\d{0,256})?)[, ]+(-?\\d{1,3}(\\.\\d{0,256})?)?$/;\n if (reverseGeocodeCoordRgx.test(trimmedSearch)) {\n search = search.replace(/,/g, ' ');\n }\n config = extend(config, { query: search });\n } break;\n }\n\n config.session_token = this.eventManager.getSessionId();\n\n return config;\n },\n\n _geocode: function(searchInput) {\n this.inputString = searchInput;\n this._showLoadingIcon();\n this._eventEmitter.emit('loading', { query: searchInput });\n\n const requestType = this._requestType(this.options, searchInput);\n const config = this._setupConfig(requestType, searchInput);\n\n var request;\n switch (requestType) {\n case GEOCODE_REQUEST_TYPE.LOCAL:\n request = Promise.resolve();\n break;\n case GEOCODE_REQUEST_TYPE.FORWARD:\n request = this.geocoderService.forwardGeocode(config).send();\n break;\n case GEOCODE_REQUEST_TYPE.REVERSE:\n request = this.geocoderService.reverseGeocode(config).send();\n break;\n }\n\n var localGeocoderRes = this.options.localGeocoder ? this.options.localGeocoder(searchInput) || [] : [];\n var externalGeocoderRes = [];\n\n var geocoderError = null;\n request.catch(function(error) {\n geocoderError = error;\n }.bind(this))\n .then(\n function(response) {\n this._hideLoadingIcon();\n var res = {};\n\n if (!response){\n res = {\n type: 'FeatureCollection',\n features: []\n }\n } else if (response.statusCode == '200') {\n res = response.body;\n res.request = response.request;\n res.headers = response.headers;\n this._headers = response.headers;\n }\n\n res.config = config;\n\n if (this.fresh){\n this.eventManager.start(this);\n this.fresh = false;\n }\n\n // Tag Mapbox as the source for Geocoding API results, to differentiate from local or external geocoder federated results\n if (res.features && res.features.length) {\n res.features.map(function (feature) {\n feature._source = 'mapbox';\n })\n }\n\n // supplement Mapbox Geocoding API results with locally populated results\n res.features = res.features\n ? localGeocoderRes.concat(res.features)\n : localGeocoderRes;\n\n if (this.options.externalGeocoder) {\n\n externalGeocoderRes = this.options.externalGeocoder(searchInput, res.features) || Promise.resolve([]);\n // supplement Mapbox Geocoding API results with features returned by a promise\n return externalGeocoderRes.then(function(features) {\n res.features = res.features ? features.concat(res.features) : features;\n return res;\n }, function(){\n // on error, display the original result\n return res;\n });\n }\n return res;\n\n }.bind(this)).then(\n function(res) {\n if (geocoderError) {\n throw geocoderError;\n }\n\n // apply results filter if provided\n if (this.options.filter && res.features.length) {\n res.features = res.features.filter(this.options.filter);\n }\n\n if (res.features.length) {\n this._showClearButton();\n this._hideGeolocateButton();\n this._showAttribution();\n this._eventEmitter.emit('results', res);\n this._typeahead.update(res.features);\n } else {\n this._hideClearButton();\n this._hideAttribution();\n this._typeahead.selected = null;\n this._renderNoResults();\n this._eventEmitter.emit('results', res);\n }\n\n }.bind(this)\n ).catch(\n function(err) {\n this._hideLoadingIcon();\n this._hideAttribution();\n\n // in the event of an error in the Mapbox Geocoding API still display results from the localGeocoder\n if ((localGeocoderRes.length && this.options.localGeocoder) || (externalGeocoderRes.length && this.options.externalGeocoder) ) {\n this._showClearButton();\n this._hideGeolocateButton();\n this._typeahead.update(localGeocoderRes);\n } else {\n this._hideClearButton();\n this._typeahead.selected = null;\n this._renderError();\n }\n\n this._eventEmitter.emit('results', { features: localGeocoderRes });\n this._eventEmitter.emit('error', { error: err });\n }.bind(this)\n );\n\n return request;\n },\n\n /**\n * Shared logic for clearing input\n * @param {Event} [ev] the event that triggered the clear, if available\n * @private\n *\n */\n _clear: function(ev) {\n if (ev) ev.preventDefault();\n this._inputEl.value = '';\n this._typeahead.selected = null;\n this._typeahead.clear();\n this.eventManager.sessionIncrementer++;\n this._onChange();\n this._hideClearButton();\n this._showGeolocateButton();\n this._removeMarker();\n this.lastSelected = null;\n this._eventEmitter.emit('clear');\n this.fresh = true;\n },\n\n /**\n * Clear and then focus the input.\n * @param {Event} [ev] the event that triggered the clear, if available\n *\n */\n clear: function(ev) {\n this._clear(ev);\n this._inputEl.focus();\n },\n\n\n /**\n * Clear the input, without refocusing it. Used to implement clearOnBlur\n * constructor option.\n * @param {Event} [ev] the blur event\n * @private\n */\n _clearOnBlur: function(ev) {\n var ctx = this;\n\n /*\n * If relatedTarget is not found, assume user targeted the suggestions list.\n * In that case, do not clear on blur. There are other edge cases where\n * ev.relatedTarget could be null. Clicking on list always results in null\n * relatedtarget because of upstream behavior in `suggestions`.\n *\n * The ideal solution would be to check if ev.relatedTarget is a child of\n * the list. See issue #258 for details on why we can't do that yet.\n */\n if (ev.relatedTarget) {\n ctx._clear(ev);\n }\n },\n\n _onQueryResult: function(response) {\n var results = response.body;\n if (!results.features.length) return;\n var result = results.features[0];\n this._typeahead.selected = result;\n this._inputEl.value = result.place_name;\n this._onChange();\n },\n\n _updateProximity: function() {\n // proximity is designed for local scale, if the user is looking at the whole world,\n // it doesn't make sense to factor in the arbitrary centre of the map\n if (!this._map || !this.options.trackProximity){\n return;\n }\n if (this._map.getZoom() > 9) {\n var center = this._map.getCenter().wrap();\n this.setProximity({ longitude: center.lng, latitude: center.lat }, false);\n } else {\n this.setProximity(null, false);\n }\n },\n\n _collapse: function() {\n // do not collapse if input is in focus\n if (!this._inputEl.value && this._inputEl !== document.activeElement) this.container.classList.add('mapboxgl-ctrl-geocoder--collapsed');\n },\n\n _unCollapse: function() {\n this.container.classList.remove('mapboxgl-ctrl-geocoder--collapsed');\n },\n\n /**\n * Set & query the input\n * @param {string} searchInput location name or other search input\n * @returns {MapboxGeocoder} this\n */\n query: function(searchInput) {\n this._geocode(searchInput).then(this._onQueryResult);\n return this;\n },\n\n _renderError: function(){\n var errorMessage = \"
There was an error reaching the server
\"\n this._renderMessage(errorMessage);\n },\n\n _renderLocationError: function(){\n var errorMessage = \"
A location error has occurred
\"\n this._renderMessage(errorMessage);\n },\n\n _renderNoResults: function(){\n var errorMessage = \"
No results found
\";\n this._renderMessage(errorMessage);\n },\n\n _renderUserDeniedGeolocationError: function() {\n var errorMessage = \"
Geolocation permission denied
\"\n this._renderMessage(errorMessage);\n },\n\n _renderMessage: function(msg){\n this._typeahead.update([]);\n this._typeahead.selected = null;\n this._typeahead.clear();\n this._typeahead.renderError(msg);\n },\n\n /**\n * Get the text to use as the search bar placeholder\n *\n * If placeholder is provided in options, then use options.placeholder\n * Otherwise, if language is provided in options, then use the localized string of the first language if available\n * Otherwise use the default\n *\n * @returns {String} the value to use as the search bar placeholder\n * @private\n */\n _getPlaceholderText: function(){\n if (this.options.placeholder) return this.options.placeholder;\n if (this.options.language){\n var firstLanguage = this.options.language.split(\",\")[0];\n var language = subtag.language(firstLanguage);\n var localizedValue = localization.placeholder[language];\n if (localizedValue) return localizedValue;\n }\n return 'Search';\n },\n\n /**\n * Set input\n * @param {string} searchInput location name or other search input\n * @param {boolean} [showSuggestions=false] display suggestion on setInput call\n * @returns {MapboxGeocoder} this\n */\n setInput: function(searchInput, showSuggestions) {\n if (showSuggestions === undefined) {\n showSuggestions = false\n }\n // Set input value to passed value and clear everything else.\n this._inputEl.value = searchInput;\n this._typeahead.selected = null;\n this._typeahead.clear();\n if (searchInput.length >= this.options.minLength) {\n showSuggestions ? this._geocode(searchInput) : this._onChange();\n }\n return this;\n },\n\n /**\n * Set proximity\n * @param {Object|'ip'} proximity The new `options.proximity` value. This is a geographical point given as an object with `latitude` and `longitude` properties or the string 'ip'.\n * @param {Boolean} disableTrackProximity If true, sets `trackProximity` to false. True by default to prevent `trackProximity` from unintentionally overriding an explicitly set proximity value.\n * @returns {MapboxGeocoder} this\n */\n setProximity: function(proximity, disableTrackProximity = true) {\n this.options.proximity = proximity;\n if (disableTrackProximity) {\n this.options.trackProximity = false;\n }\n return this;\n },\n\n /**\n * Get proximity\n * @returns {Object} The geocoder proximity\n */\n getProximity: function() {\n return this.options.proximity;\n },\n\n /**\n * Set the render function used in the results dropdown\n * @param {Function} fn The function to use as a render function. This function accepts a single [extended GeoJSON](https://docs.mapbox.com/api/search/geocoding-v5/#geocoding-response-object) object as input and returns a string.\n * @returns {MapboxGeocoder} this\n */\n setRenderFunction: function(fn){\n if (fn && typeof(fn) == \"function\"){\n this._typeahead.render = fn;\n }\n return this;\n },\n\n /**\n * Get the function used to render the results dropdown\n *\n * @returns {Function} the render function\n */\n getRenderFunction: function(){\n return this._typeahead.render;\n },\n\n /**\n * Get the language to use in UI elements and when making search requests\n *\n * Look first at the explicitly set options otherwise use the browser's language settings\n * @param {String} language Specify the language to use for response text and query result weighting. Options are IETF language tags comprised of a mandatory ISO 639-1 language code and optionally one or more IETF subtags for country or script. More than one value can also be specified, separated by commas.\n * @returns {MapboxGeocoder} this\n */\n setLanguage: function(language){\n var browserLocale = navigator.language || navigator.userLanguage || navigator.browserLanguage;\n this.options.language = language || this.options.language || browserLocale;\n return this;\n },\n\n /**\n * Get the language to use in UI elements and when making search requests\n * @returns {String} The language(s) used by the plugin, if any\n */\n getLanguage: function(){\n return this.options.language;\n },\n\n /**\n * Get the zoom level the map will move to when there is no bounding box on the selected result\n * @returns {Number} the map zoom\n */\n getZoom: function(){\n return this.options.zoom;\n },\n\n /**\n * Set the zoom level\n * @param {Number} zoom The zoom level that the map should animate to when a `bbox` isn't found in the response. If a `bbox` is found the map will fit to the `bbox`.\n * @returns {MapboxGeocoder} this\n */\n setZoom: function(zoom){\n this.options.zoom = zoom;\n return this;\n },\n\n /**\n * Get the parameters used to fly to the selected response, if any\n * @returns {Boolean|Object} The `flyTo` option\n */\n getFlyTo: function(){\n return this.options.flyTo;\n },\n\n /**\n * Set the flyTo options\n * @param {Boolean|Object} flyTo If false, animating the map to a selected result is disabled. If true, animating the map will use the default animation parameters. If an object, it will be passed as `options` to the map [`flyTo`](https://docs.mapbox.com/mapbox-gl-js/api/#map#flyto) or [`fitBounds`](https://docs.mapbox.com/mapbox-gl-js/api/#map#fitbounds) method providing control over the animation of the transition.\n */\n setFlyTo: function(flyTo){\n this.options.flyTo = flyTo;\n return this;\n },\n\n /**\n * Get the value of the placeholder string\n * @returns {String} The input element's placeholder value\n */\n getPlaceholder: function(){\n return this.options.placeholder;\n },\n\n /**\n * Set the value of the input element's placeholder\n * @param {String} placeholder the text to use as the input element's placeholder\n * @returns {MapboxGeocoder} this\n */\n setPlaceholder: function(placeholder){\n this.options.placeholder = (placeholder) ? placeholder : this._getPlaceholderText();\n this._inputEl.placeholder = this.options.placeholder;\n this._inputEl.setAttribute('aria-label', this.options.placeholder);\n return this\n },\n\n /**\n * Get the bounding box used by the plugin\n * @returns {Array} the bounding box, if any\n */\n getBbox: function(){\n return this.options.bbox;\n },\n\n /**\n * Set the bounding box to limit search results to\n * @param {Array} bbox a bounding box given as an array in the format [minX, minY, maxX, maxY].\n * @returns {MapboxGeocoder} this\n */\n setBbox: function(bbox){\n this.options.bbox = bbox;\n return this;\n },\n\n /**\n * Get a list of the countries to limit search results to\n * @returns {String} a comma separated list of countries to limit to, if any\n */\n getCountries: function(){\n return this.options.countries;\n },\n\n /**\n * Set the countries to limit search results to\n * @param {String} countries a comma separated list of countries to limit to\n * @returns {MapboxGeocoder} this\n */\n setCountries: function(countries){\n this.options.countries = countries;\n return this;\n },\n\n /**\n * Get a list of the types to limit search results to\n * @returns {String} a comma separated list of types to limit to\n */\n getTypes: function(){\n return this.options.types;\n },\n\n /**\n * Set the types to limit search results to\n * @param {String} countries a comma separated list of types to limit to\n * @returns {MapboxGeocoder} this\n */\n setTypes: function(types){\n this.options.types = types;\n return this;\n },\n\n /**\n * Get the minimum number of characters typed to trigger results used in the plugin\n * @returns {Number} The minimum length in characters before a search is triggered\n */\n getMinLength: function(){\n return this.options.minLength;\n },\n\n /**\n * Set the minimum number of characters typed to trigger results used by the plugin\n * @param {Number} minLength the minimum length in characters\n * @returns {MapboxGeocoder} this\n */\n setMinLength: function(minLength){\n this.options.minLength = minLength;\n if (this._typeahead) this._typeahead.options.minLength = minLength;\n return this;\n },\n\n /**\n * Get the limit value for the number of results to display used by the plugin\n * @returns {Number} The limit value for the number of results to display used by the plugin\n */\n getLimit: function(){\n return this.options.limit;\n },\n\n /**\n * Set the limit value for the number of results to display used by the plugin\n * @param {Number} limit the number of search results to return\n * @returns {MapboxGeocoder}\n */\n setLimit: function(limit){\n this.options.limit = limit;\n if (this._typeahead) this._typeahead.options.limit = limit;\n return this;\n },\n\n /**\n * Get the filter function used by the plugin\n * @returns {Function} the filter function\n */\n getFilter: function(){\n return this.options.filter;\n },\n\n /**\n * Set the filter function used by the plugin.\n * @param {Function} filter A function which accepts a Feature in the [extended GeoJSON](https://docs.mapbox.com/api/search/geocoding-v5/#geocoding-response-object) format to filter out results from the Geocoding API response before they are included in the suggestions list. Return `true` to keep the item, `false` otherwise.\n * @returns {MapboxGeocoder} this\n */\n setFilter: function(filter){\n this.options.filter = filter;\n return this;\n },\n\n /**\n * Set the geocoding endpoint used by the plugin.\n * @param {Function} origin A function which accepts an HTTPS URL to specify the endpoint to query results from.\n * @returns {MapboxGeocoder} this\n */\n setOrigin: function(origin){\n this.options.origin = origin;\n this.geocoderService = mbxGeocoder(\n MapboxClient({\n accessToken: this.options.accessToken,\n origin: this.options.origin\n })\n );\n return this;\n },\n\n /**\n * Get the geocoding endpoint the plugin is currently set to\n * @returns {Function} the endpoint URL\n */\n getOrigin: function(){\n return this.options.origin;\n },\n\n /**\n * Set the accessToken option used for the geocoding request endpoint.\n * @param {String} accessToken value\n * @returns {MapboxGeocoder} this\n */\n setAccessToken: function(accessToken){\n this.options.accessToken = accessToken;\n this.geocoderService = mbxGeocoder(\n MapboxClient({\n accessToken: this.options.accessToken,\n origin: this.options.origin\n })\n );\n return this;\n },\n\n /**\n * Set the autocomplete option used for geocoding requests\n * @param {Boolean} value The boolean value to set autocomplete to\n * @returns\n */\n setAutocomplete: function(value){\n this.options.autocomplete = value;\n return this;\n },\n\n /**\n * Get the current autocomplete parameter value used for requests\n * @returns {Boolean} The autocomplete parameter value\n */\n getAutocomplete: function(){\n return this.options.autocomplete\n },\n\n /**\n * Set the fuzzyMatch option used for approximate matching in geocoding requests\n * @param {Boolean} value The boolean value to set fuzzyMatch to\n * @returns\n */\n setFuzzyMatch: function(value){\n this.options.fuzzyMatch = value;\n return this;\n },\n\n /**\n * Get the current fuzzyMatch parameter value used for requests\n * @returns {Boolean} The fuzzyMatch parameter value\n */\n getFuzzyMatch: function(){\n return this.options.fuzzyMatch\n },\n\n /**\n * Set the routing parameter used to ask for routable point metadata in geocoding requests\n * @param {Boolean} value The boolean value to set routing to\n * @returns\n */\n setRouting: function(value){\n this.options.routing = value;\n return this;\n },\n\n /**\n * Get the current routing parameter value used for requests\n * @returns {Boolean} The routing parameter value\n */\n getRouting: function(){\n return this.options.routing\n },\n\n /**\n * Set the worldview parameter\n * @param {String} code The country code representing the worldview (e.g. \"us\" | \"cn\" | \"jp\", \"in\")\n * @returns\n */\n setWorldview: function(code){\n this.options.worldview = code;\n return this;\n },\n\n /**\n * Get the current worldview parameter value used for requests\n * @returns {String} The worldview parameter value\n */\n getWorldview: function(){\n return this.options.worldview\n },\n\n /**\n * Handle the placement of a result marking the selected result\n * @private\n * @param {Object} selected the selected geojson feature\n * @returns {MapboxGeocoder} this\n */\n _handleMarker: function(selected){\n // clean up any old marker that might be present\n if (!this._map){\n return;\n }\n this._removeMarker();\n var defaultMarkerOptions = {\n color: '#4668F2'\n }\n var markerOptions = extend({}, defaultMarkerOptions, this.options.marker)\n this.mapMarker = new this._mapboxgl.Marker(markerOptions);\n if (selected.center) {\n this.mapMarker\n .setLngLat(selected.center)\n .addTo(this._map);\n } else if (selected.geometry && selected.geometry.type && selected.geometry.type === 'Point' && selected.geometry.coordinates) {\n this.mapMarker\n .setLngLat(selected.geometry.coordinates)\n .addTo(this._map);\n }\n return this;\n },\n\n /**\n * Handle the removal of a result marker\n * @private\n */\n _removeMarker: function(){\n if (this.mapMarker){\n this.mapMarker.remove();\n this.mapMarker = null;\n }\n },\n\n /**\n * Subscribe to events that happen within the plugin.\n * @param {String} type name of event. Available events and the data passed into their respective event objects are:\n *\n * - __clear__ `Emitted when the input is cleared`\n * - __loading__ `{ query } Emitted when the geocoder is looking up a query`\n * - __results__ `{ results } Fired when the geocoder returns a response`\n * - __result__ `{ result } Fired when input is set`\n * - __error__ `{ error } Error as string`\n * @param {Function} fn function that's called when the event is emitted.\n * @returns {MapboxGeocoder} this;\n */\n on: function(type, fn) {\n this._eventEmitter.on(type, fn);\n return this;\n },\n\n /**\n * Remove an event\n * @returns {MapboxGeocoder} this\n * @param {String} type Event name.\n * @param {Function} fn Function that should unsubscribe to the event emitted.\n */\n off: function(type, fn) {\n this._eventEmitter.removeListener(type, fn);\n this.eventManager.remove();\n return this;\n }\n};\n\nmodule.exports = MapboxGeocoder;\n", "import maplibregl from \"maplibre-gl\";\n\nimport MapboxGeocoder from \"@mapbox/mapbox-gl-geocoder\";\nimport \"@mapbox/mapbox-gl-geocoder/dist/mapbox-gl-geocoder.css\";\nimport { venues } from \"./geocoded.json\";\nimport layers from \"protomaps-themes-base\";\n\nimport { Feature, FeatureCollection, Point } from \"geojson\";\nimport * as pmtiles from \"pmtiles\";\n\nimport \"./styles.css\";\nimport Parser from \"./parser\";\nimport { DateItem } from \"./interfaces\";\nimport { DateTime } from \"luxon\";\n\nconst showsSource = \"shows\";\nconst clustersLayer = \"clusters\";\nconst clusterCountLayer = \"cluster-count\";\nconst showLayer = \"show\";\nconst start = {\n // start in the mission\n lng: -122.416,\n lat: 37.76,\n zoom: 10,\n};\n\nclass MapHandler {\n // These three things are initialized and become the basis for\n // all other operations going forward by this class.\n map: maplibregl.Map;\n featureCollection: FeatureCollection;\n dates: DateItem[];\n popup: maplibregl.Popup;\n setup = false;\n\n constructor() {\n this.map = this.createMap();\n this.popup = new maplibregl.Popup({\n closeButton: false,\n closeOnClick: true,\n });\n const parsed = Parser.parseData();\n\n parsed.then(({ featureCollection, dates }) => {\n this.featureCollection = featureCollection;\n this.dates = dates;\n this.setupMap();\n\n // https://github.com/mapbox/mapbox-gl-js/issues/6707\n const loop = () => {\n if (this.setup) {\n return;\n } else if (this.map.loaded()) {\n this.setupMap();\n } else {\n // Poll\n requestAnimationFrame(() => {\n this.setupMap();\n });\n }\n };\n loop();\n\n this.setupDates();\n this.updateListingsAndMap();\n this.addListeners();\n\n // Uncomment to update\n // this.devTools();\n });\n }\n\n createMap(): maplibregl.Map {\n // https://docs.protomaps.com/pmtiles/maplibre\n let protocol = new pmtiles.Protocol();\n maplibregl.addProtocol(\"pmtiles\", protocol.tile);\n const map = new maplibregl.Map({\n container: \"map\", // container id\n // See https://docs.mapbox.com/mapbox-gl-js/example/map-tiles/\n // for the example of using raster tiles this way\n style: {\n version: 8,\n sources: {\n protomaps: {\n type: \"vector\",\n // url: `pmtiles://${urlRoot()}/pmtiles`,\n tiles: [\n \"https://api.protomaps.com/tiles/v3/{z}/{x}/{y}.mvt?key=8cac4d994ec600c4\",\n ],\n attribution:\n 'Protomaps \u00A9 OpenStreetMap',\n maxzoom: 14,\n },\n },\n layers: layers(\"protomaps\", \"black\"),\n glyphs: \"https://cdn.protomaps.com/fonts/pbf/{fontstack}/{range}.pbf\",\n },\n center: [start.lng, start.lat],\n zoom: start.zoom,\n });\n\n // Add locator control\n map.addControl(\n new maplibregl.GeolocateControl({\n positionOptions: {\n enableHighAccuracy: true,\n },\n trackUserLocation: false,\n })\n );\n\n return map;\n }\n\n setupMap(): void {\n // Add the actual shows\n this.map.addSource(showsSource, {\n type: \"geojson\",\n data: this.featureCollection,\n cluster: true,\n clusterMaxZoom: 14,\n clusterRadius: 50,\n });\n\n // Main layer\n this.map.addLayer({\n id: showLayer,\n type: \"circle\",\n source: showsSource,\n filter: [\"!\", [\"has\", \"point_count\"]],\n paint: {\n \"circle-color\": \"#4CAF50\",\n \"circle-radius\": 10,\n \"circle-stroke-width\": 1,\n \"circle-stroke-color\": \"#fff\",\n },\n });\n\n this.map.addLayer({\n id: clustersLayer,\n type: \"circle\",\n source: showsSource,\n filter: [\"has\", \"point_count\"],\n paint: {\n // Use step expressions (https://www.mapbox.com/mapbox-gl-js/style-spec/#expressions-step)\n // with three steps to implement three types of circles:\n \"circle-color\": [\n \"step\",\n [\"get\", \"point_count\"],\n \"#51bbd6\",\n 50,\n \"#f1f075\",\n 100,\n \"#f28cb1\",\n ],\n \"circle-radius\": [\"step\", [\"get\", \"point_count\"], 20, 50, 30, 100, 40],\n },\n });\n\n this.map.addLayer({\n id: clusterCountLayer,\n type: \"symbol\",\n source: showsSource,\n filter: [\"has\", \"point_count\"],\n layout: {\n \"text-field\": \"{point_count_abbreviated}\",\n // Needs to be a font that is available from the glyphs link above\n // It will render lots of 404s if its missing, and the aggregate bubbles\n // wont show up\n \"text-font\": [\"Roboto Regular\"],\n \"text-size\": 12,\n },\n });\n\n // inspect a cluster on click\n this.map.on(\"click\", clustersLayer, (e) => {\n const features = this.map.queryRenderedFeatures(e.point, {\n layers: [clustersLayer],\n });\n const clusterId = features[0].properties.cluster_id;\n const source: maplibregl.GeoJSONSource = this.map.getSource(\n showsSource\n ) as maplibregl.GeoJSONSource;\n\n source.getClusterExpansionZoom(clusterId, (err, zoom) => {\n if (err || !zoom) return;\n const item = features[0].geometry;\n if (item.type == \"Point\") {\n this.map.easeTo({\n center: [item.coordinates[0], item.coordinates[1]],\n zoom: zoom + 1, // extra zooming\n });\n }\n });\n });\n\n // When a click event occurs on a feature in\n // the unclustered-point layer, open a popup at\n // the location of the feature, with\n // description HTML from its properties.\n this.map.on(\"click\", showLayer, (e) => {\n if (e && e.features && e.features[0].geometry.type == \"Point\") {\n const item = e.features[0];\n const geometry = item.geometry as Point;\n const coordinates = geometry.coordinates.slice();\n\n // TODO is this needed?\n // Ensure that if the map is zoomed out such that\n // multiple copies of the feature are visible, the\n // popup appears over the copy being pointed to.\n while (Math.abs(e.lngLat.lng - coordinates[0]) > 180) {\n coordinates[0] += e.lngLat.lng > coordinates[0] ? 360 : -360;\n }\n\n const container = document.createElement(\"div\");\n container.classList.add(\"popup-listing\");\n\n // Get all shows related to this point, even if\n // we've clikced on particular date\n const venue = e.features[0].properties?.venue;\n this.map\n .queryRenderedFeatures()\n .filter((x) => x.properties?.venue === venue)\n // @ts-ignore\n .sort((a, b) => a.properties?.date > b.properties?.date)\n .forEach((x) => {\n container.appendChild(this.makeShowDetailsHtml(x.properties, true));\n });\n\n // Attach single venue\n const p = document.createElement(\"p\");\n p.innerText = venue;\n p.setAttribute(\"class\", \"venue\");\n const html = p.outerHTML + container.outerHTML;\n\n this.popup\n .setLngLat([coordinates[0], coordinates[1]])\n .setHTML(html)\n .addTo(this.map);\n }\n });\n\n this.map.on(\"mouseenter\", clustersLayer, () => {\n this.map.getCanvas().style.cursor = \"pointer\";\n });\n\n this.map.on(\"mouseleave\", clustersLayer, () => {\n this.map.getCanvas().style.cursor = \"\";\n });\n\n this.map.on(\"move\", () => {\n this.updateListingsAndMap();\n });\n\n // Display the listing if the the map is loaded and we're\n // not in a mobile view\n if (window.innerWidth > 580) {\n document.getElementById(\"map-overlay\")?.classList.remove(\"hidden\");\n } else {\n document.getElementById(\"mobile-nav\")?.classList.remove(\"hidden\");\n const attr = document.getElementsByClassName(\n \"maplibregl-ctrl-attrib-button\"\n );\n // @ts-ignore\n attr && attr.length && attr[0].click();\n }\n\n let overlay = document.getElementById(\"loading-overlay\");\n overlay?.classList.add(\"fade\");\n setTimeout(() => overlay?.remove(), 750);\n\n this.setup = true;\n }\n\n makeShowDetailsHtml(\n props: GeoJSON.GeoJsonProperties,\n skipVenue = false\n ): HTMLDivElement {\n const div = document.createElement(\"div\");\n div.setAttribute(\"class\", \"listing-item\");\n\n if (props) {\n [\"venue\", \"date\", \"details\", \"artists\"].forEach((x) => {\n if (props[x] !== undefined) {\n switch (x) {\n case \"artists\":\n {\n const li = document.createElement(\"li\");\n // TODO: why is this ever a string?\n const artists =\n typeof props[x] === \"string\"\n ? JSON.parse(props[x])\n : props[x];\n\n artists.forEach((a: string) => {\n const ul = document.createElement(\"ul\");\n ul.innerText = a;\n li.append(ul);\n });\n\n if (props[\"link\"]) {\n const a = document.createElement(\"a\");\n const ul = document.createElement(\"ul\");\n a.setAttribute(\"href\", props[\"link\"]);\n a.innerText = \"Link\";\n ul.appendChild(a);\n li.appendChild(ul);\n }\n\n div.appendChild(li);\n }\n break;\n default: {\n if (skipVenue && x === \"venue\") {\n break;\n }\n // Format date\n let inner =\n x === \"date\" ? this.formatDateString(props[x]) : props[x];\n\n const p = document.createElement(\"p\");\n p.innerText = inner;\n p.classList.add(x);\n div.appendChild(p);\n }\n }\n }\n });\n }\n return div;\n }\n\n updateListingsAndMap(): void {\n const bounds = this.map.getBounds();\n\n const filtered = this.featureCollection.features.filter((f) => {\n if (f.geometry.type === \"Point\") {\n const onMap = bounds.contains([\n f.geometry.coordinates[0],\n f.geometry.coordinates[1],\n ]);\n const validDate = this.isSelected(f.properties?.date);\n return onMap && validDate;\n }\n return false;\n });\n\n // Filter on source, for clusters\n const source: maplibregl.GeoJSONSource = this.map.getSource(\n showsSource\n ) as maplibregl.GeoJSONSource;\n\n if (source) {\n source.setData({\n type: \"FeatureCollection\",\n features: filtered,\n });\n }\n\n // Filter listings\n const listingEl = document.getElementById(\"listing\");\n if (listingEl) {\n listingEl.innerHTML = \"\";\n\n filtered.forEach((f) => {\n const div = this.makeShowDetailsHtml(f.properties);\n div.setAttribute(\"class\", \"listing-item\");\n\n const setPopup = (f: Feature) => {\n if (f.geometry.type === \"Point\") {\n this.popup\n .setLngLat([f.geometry.coordinates[0], f.geometry.coordinates[1]])\n .setHTML(div.outerHTML)\n .addTo(this.map);\n }\n };\n\n const easeTo = (f: Feature) => {\n if (f.geometry.type === \"Point\") {\n this.map.easeTo({\n center: [f.geometry.coordinates[0], f.geometry.coordinates[1]],\n zoom: 16,\n duration: 1000,\n });\n }\n };\n\n div.addEventListener(\"click\", () => {\n setPopup(f);\n easeTo(f);\n\n // If we're on mobile, hide the listings after click\n const showMapButton = document.getElementById(\"show-map-button\");\n if (showMapButton) {\n showMapButton.click();\n }\n });\n\n div.addEventListener(\"mouseover\", () => {\n setPopup(f);\n });\n\n listingEl.appendChild(div);\n });\n\n listingEl.addEventListener(\"hover\", (e) => {\n console.log(e);\n });\n }\n }\n\n formatDateString(s: string): string {\n return DateTime.fromISO(s).toFormat(\"ccc LL-dd\");\n }\n\n setupDates(): void {\n // Set the main dates\n this.setDates(this.dates);\n const dateStrings = this.getDateStrings();\n\n const dateSelectors = document.getElementById(\"date-selectors\");\n\n if (dateSelectors) {\n dateStrings.forEach((d) => {\n const p = document.createElement(\"p\");\n const label = document.createElement(\"label\");\n\n let s = this.formatDateString(d);\n label.setAttribute(\"for\", d);\n\n const check = document.createElement(\"input\");\n check.setAttribute(\"id\", d);\n check.setAttribute(\"type\", \"checkbox\");\n check.setAttribute(\"checked\", \"true\");\n\n label.appendChild(check);\n label.appendChild(document.createTextNode(s));\n\n p.appendChild(label);\n\n check.addEventListener(\"click\", (e) => {\n const el = e.target as HTMLInputElement;\n this.setDate(el.id, el.checked);\n });\n\n dateSelectors.appendChild(p);\n });\n }\n }\n\n syncDateSelector(): void {\n document.querySelectorAll(\"#date-selectors input\").forEach((i) => {\n const t = i as HTMLInputElement;\n t.checked = this.isSelected(t.id);\n });\n }\n\n addListeners(): void {\n const filterButton = document.getElementById(\"filter-button\");\n const hideFilterButton = document.getElementById(\"hide-filter-button\");\n const resetFilterButton = document.getElementById(\"reset-filter-button\");\n const filters = document.getElementById(\"filters\");\n const todayButton = document.getElementById(\"today-button\");\n const tomorrowButton = document.getElementById(\"tomorrow-button\");\n const byDateButton = document.getElementById(\"by-date-button\");\n\n const map = document.getElementById(\"map\");\n const mapOverlay = document.getElementById(\"map-overlay\");\n\n const dateSelectors = document.getElementById(\"date-selectors\");\n const showMapButton = document.getElementById(\"show-map-button\");\n const showListButton = document.getElementById(\"show-list-button\");\n const aboutIcon = document.getElementById(\"about-icon\");\n const aboutOverlay = document.getElementById(\"about-overlay\");\n const aboutIconOpen = document.getElementById(\"about-icon-open\");\n const aboutIconClose = document.getElementById(\"about-icon-close\");\n const mobileNav = document.getElementById(\"mobile-nav\");\n\n filterButton?.addEventListener(\"click\", () => {\n filterButton.classList.toggle(\"hidden\");\n hideFilterButton?.classList.toggle(\"hidden\");\n resetFilterButton?.classList.toggle(\"hidden\");\n filters?.classList.toggle(\"hidden\");\n });\n\n hideFilterButton?.addEventListener(\"click\", () => {\n filterButton?.classList.toggle(\"hidden\");\n hideFilterButton.classList.toggle(\"hidden\");\n resetFilterButton?.classList.toggle(\"hidden\");\n filters?.classList.toggle(\"hidden\");\n dateSelectors?.classList.add(\"hidden\");\n });\n\n showMapButton?.addEventListener(\"click\", () => {\n showMapButton.classList.add(\"hidden\");\n mapOverlay?.classList.add(\"hidden\");\n showListButton?.classList.remove(\"hidden\");\n map?.classList.remove(\"hidden\");\n aboutIcon?.classList.remove(\"hidden\");\n });\n\n showListButton?.addEventListener(\"click\", () => {\n map?.classList.add(\"hidden\");\n showListButton.classList.add(\"hidden\");\n mapOverlay?.classList.remove(\"hidden\");\n showMapButton?.classList.remove(\"hidden\");\n aboutIcon?.classList.add(\"hidden\");\n });\n\n todayButton?.addEventListener(\"click\", () => this.today());\n tomorrowButton?.addEventListener(\"click\", () => this.tomorrow());\n\n byDateButton?.addEventListener(\"click\", () => {\n document.getElementById(\"date-selectors\")?.classList.toggle(\"hidden\");\n });\n\n resetFilterButton?.addEventListener(\"click\", () => {\n this.resetDateSelections();\n this.map.easeTo(start);\n });\n\n aboutIcon?.addEventListener(\"click\", () => {\n aboutIcon.classList.toggle(\"invert\");\n aboutOverlay?.classList.toggle(\"hidden\");\n aboutIconClose?.classList.toggle(\"hidden\");\n aboutIconOpen?.classList.toggle(\"hidden\");\n mobileNav?.classList.toggle(\"hidden\");\n });\n }\n\n createGeocoder(): MapboxGeocoder {\n const accessToken =\n \"pk.eyJ1IjoibWV0YXN5biIsImEiOiIwN2FmMDNhNTRhOWQ3NDExODI1MTllMDk1ODc3NTllZiJ9.Bye80QJ4r0RJsKj4Sre6KQ\";\n return new MapboxGeocoder({\n accessToken,\n // mapboxgl: maplibregl,\n types: \"poi\",\n proximity: {\n longitude: -122.416,\n latitude: 37.76,\n },\n countries: \"us\", // ISO 3166\n bbox: [-125.222168, 35.728677, -118.048096, 41.845013],\n filter: (f: Feature) => {\n return [\n \"music\",\n \"event\",\n \"venue\",\n \"concert\",\n \"band\",\n \"show\",\n \"stage\",\n \"hall\",\n \"club\",\n \"disco\",\n \"punk\",\n \"jazz\",\n \"rock\",\n \"theater\",\n \"theatre\",\n \"gallery\",\n \"art\",\n \"alcohol\",\n \"auditorium\",\n \"amphitheater\",\n \"bar\",\n ].some((cat) => f.properties?.category?.toLowerCase().includes(cat));\n },\n });\n }\n\n devTools(): void {\n const geocoder = this.createGeocoder();\n\n geocoder.addTo(\"#geocoder\");\n\n // Get the geocoder results container.\n const results = document.createElement(\"pre\");\n results.setAttribute(\"id\", \"result\");\n document.getElementsByTagName(\"body\")[0].appendChild(results);\n const geocodedResults = {}\n\n this.featureCollection.features.forEach((f) => {\n const venue = f.properties?.venue;\n if (venues[venue] === undefined) {\n console.log(`Querying: ${venue}`);\n geocoder.query(venue);\n }\n });\n\n geocoder.on(\"results\", (e) => {\n try {\n if (\n e.request &&\n e.request.params &&\n e.request.params.query &&\n e.features.length\n ) {\n const item = e.features[0];\n geocodedResults[e.request.params.query] = { \"coordinates\": item.geometry.coordinates }\n results.innerHTML = JSON.stringify(geocodedResults, null, \"\\t\")\n results.addEventListener(\"click\", () => {\n navigator.clipboard.writeText(results.innerHTML).then(() => alert(\"copied\"))\n });\n }\n } catch (err) {\n console.error(err);\n }\n });\n\n // Clear results container when search is cleared.\n geocoder.on(\"clear\", () => {\n if (results) {\n results.innerText = \"\";\n }\n });\n }\n\n setDates(items: DateItem[]): void {\n this.dates = items;\n }\n\n getDateStrings(): string[] {\n return this.dates.map((x) => x.date);\n }\n\n resetDateSelections(): void {\n this.dates.forEach((x) => {\n x.checked = true;\n });\n this.syncDateSelector();\n this.updateListingsAndMap();\n this.popup.remove();\n }\n\n setDate(s: string, val: boolean): void {\n this.dates\n .filter((x) => x.date === s)\n .forEach((x) => {\n x.checked = val;\n });\n this.updateListingsAndMap();\n this.popup.remove();\n }\n\n only(s: string): void {\n this.dates.forEach((x) => {\n x.checked = x.date === s;\n });\n this.syncDateSelector();\n this.updateListingsAndMap();\n this.popup.remove();\n }\n\n today(): void {\n const now = DateTime.now().setZone(\"America/Los_Angeles\");\n // toString returns an ISO 8601 string\n // where we are just interested in YYYY-MM-DD which is\n // only the first 10 characters\n const today = now.toString().slice(0, 10);\n this.only(today);\n }\n\n tomorrow(): void {\n const now = DateTime.now().setZone(\"America/Los_Angeles\");\n const tomorrow = now.plus({ hours: 24 }).toString().slice(0, 10);\n this.only(tomorrow);\n }\n\n isSelected(s: string): boolean {\n return this.dates.filter((x) => x.date === s).some((x) => x.checked);\n }\n}\n\nnew MapHandler();\n", "{\n \"venues\": {\n \"1015 Folsom (San Francisco)\": {\n \"coordinates\": [\n -122.405774,\n 37.778204\n ]\n },\n \"1015 Folsom, S.F.\": {\n \"coordinates\": [\n -122.405774,\n 37.778204\n ]\n },\n \"3 Disciples Brewing (Santa Rosa)\": {\n \"coordinates\": [\n -122.7157993,\n 38.4392011\n ]\n },\n \"7th West (Oakland)\": {\n \"coordinates\": [\n -122.290732,\n 37.804128\n ]\n },\n \"924 Gilman St., Berkeley\": {\n \"coordinates\": [\n -122.299317,\n 37.879581\n ]\n },\n \"924 Gilman Street\": {\n \"coordinates\": [\n -122.299327,\n 37.879571\n ]\n },\n \"924 Gilman Street, Berkeley\": {\n \"coordinates\": [\n -122.299317,\n 37.8795805\n ]\n },\n \"Above DNA Lounge, S.F.\": {\n \"coordinates\": [\n -122.4126915,\n 37.770982000000004\n ]\n },\n \"Above the DNA Lounge, S.F.\": {\n \"coordinates\": [\n -122.4126915,\n 37.770982000000004\n ]\n },\n \"Ace Of Spades (Sacramento)\": {\n \"coordinates\": [\n -121.4909317,\n 38.5699587\n ]\n },\n \"Almost Famous Wine Lounge, Livermore\": {\n \"coordinates\": [\n -121.769592,\n 37.683284\n ]\n },\n \"Amber Lounge (Oakland)\": {\n \"coordinates\": [\n -122.2694513,\n 37.805209\n ]\n },\n \"Amoeba Records, S.F.\": {\n \"coordinates\": [\n -122.4528919,\n 37.7691509\n ]\n },\n \"Amoeba, S.F.\": {\n \"coordinates\": [\n -122.407632,\n 37.765532\n ]\n },\n \"Arcana (San Francisco)\": {\n \"coordinates\": [\n -122.41906361547177,\n 37.75674104734676\n ]\n },\n \"Arena, Oakland\": {\n \"coordinates\": [\n -122.20304,\n 37.750338\n ]\n },\n \"Ashkenaz, Berkeley\": {\n \"coordinates\": [\n -122.2957155,\n 37.8801265\n ]\n },\n \"Asiento (San Francisco)\": {\n \"coordinates\": [\n -122.409501,\n 37.757703\n ]\n },\n \"Au Lounge (Oakland)\": {\n \"coordinates\": [\n -122.264959,\n 37.814026\n ]\n },\n \"Audio (San Francisco)\": {\n \"coordinates\": [\n -122.413832,\n 37.771378\n ]\n },\n \"Audio Nightclub (San Francisco)\": {\n \"coordinates\": [\n -122.413832,\n 37.771378\n ]\n },\n \"Audio, S.F.\": {\n \"coordinates\": [\n -122.413832,\n 37.771378\n ]\n },\n \"August Hall (San Francisco)\": {\n \"coordinates\": [\n -122.409894,\n 37.787443\n ]\n },\n \"August Hall, S.F.\": {\n \"coordinates\": [\n -122.409894,\n 37.787443\n ]\n },\n \"BRIX 581 (Oakland)\": {\n \"coordinates\": [\n -122.27835,\n 37.79926\n ]\n },\n \"Bal Theater, San Leandro\": {\n \"coordinates\": [\n -122.132881,\n 37.708818\n ]\n },\n \"Baltic Kiss, Point Richmond\": {\n \"coordinates\": [\n -122.3849101,\n 37.9263479\n ]\n },\n \"Bandshell, 8204 Music Concourse Drive, Golden Gate Park, S.F.\": {\n \"coordinates\": [\n -122.467235,\n 37.770615\n ]\n },\n \"Bar Part Time (San Francisco)\": {\n \"coordinates\": [\n -122.42417220176682,\n 37.76812113169017\n ]\n },\n \"Beaux (San Francisco)\": {\n \"coordinates\": [\n -122.434132,\n 37.763493\n ]\n },\n \"Bender's, S.F.\": {\n \"coordinates\": [\n -122.417171,\n 37.760218\n ]\n },\n \"Bergerac (San Francisco)\": {\n \"coordinates\": [\n -122.413712,\n 37.771563\n ]\n },\n \"Big Easy, 128 American Alley, Petaluma\": {\n \"coordinates\": [\n -122.641287,\n 38.234616\n ]\n },\n \"Bill Graham Civic Auditorium (San Francisco)\": {\n \"coordinates\": [\n -122.4171575,\n 37.778162\n ]\n },\n \"Bimbo's 365 Club, S.F.\": {\n \"coordinates\": [\n -122.41565750000001,\n 37.803768500000004\n ]\n },\n \"Bistro, Hayward\": {\n \"coordinates\": [\n -122.0826,\n 37.672883\n ]\n },\n \"Blondie's Bar (San Francisco)\": {\n \"coordinates\": [\n -122.421886,\n 37.764238\n ]\n },\n \"Blue Lagoon, Santa Cruz\": {\n \"coordinates\": [\n -122.025316,\n 36.970636\n ]\n },\n \"Blue Note, Napa\": {\n \"coordinates\": [\n -122.258949,\n 37.863923\n ]\n },\n \"Boom Boom Room, S.F\": {\n \"coordinates\": [\n -122.4332374,\n 37.7846065\n ]\n },\n \"Boom Boom Room, San Francisco\": {\n \"coordinates\": [\n -122.4332374,\n 37.7846065\n ]\n },\n \"Bottom Of The Hill (San Francisco)\": {\n \"coordinates\": [\n -122.396109,\n 37.765108\n ]\n },\n \"Bottom of the Hill, S.F.\": {\n \"coordinates\": [\n -122.396109,\n 37.765108\n ]\n },\n \"Brentwood Emporium, 561 1st Street, Brentwood\": {\n \"coordinates\": [\n -121.693961,\n 37.931293\n ]\n },\n \"Brick and Mortar, S.F.\": {\n \"coordinates\": [\n -122.420181,\n 37.76991\n ]\n },\n \"Butter (San Francisco)\": {\n \"coordinates\": [\n -122.413315,\n 37.771127\n ]\n },\n \"Buzzworks (San Francisco)\": {\n \"coordinates\": [\n -122.412997,\n 37.771245\n ]\n },\n \"Cafe Du Nord (San Francisco)\": {\n \"coordinates\": [\n -122.43010000000001,\n 37.766594999999995\n ]\n },\n \"Cafe Du Nord, S.F.\": {\n \"coordinates\": [\n -122.43010000000001,\n 37.766594999999995\n ]\n },\n \"Cafe du Nord, S.F.\": {\n \"coordinates\": [\n -122.43010000000001,\n 37.766594999999995\n ]\n },\n \"Caravan Lounge, San Jose\": {\n \"coordinates\": [\n -121.892253,\n 37.332907\n ]\n },\n \"Caravan, San Jose\": {\n \"coordinates\": [\n -121.8923531,\n 37.3329778\n ]\n },\n \"Cardiff Lounge (Campbell)\": {\n \"coordinates\": [\n -121.945388,\n 37.286885\n ]\n },\n \"Cat Club (San Francisco)\": {\n \"coordinates\": [\n -122.409901,\n 37.775324\n ]\n },\n \"Catalyst Atrium, Santa Cruz\": {\n \"coordinates\": [\n -122.025597,\n 36.971359\n ]\n },\n \"Catalyst, Santa Cruz\": {\n \"coordinates\": [\n -122.025597,\n 36.971359\n ]\n },\n \"Chapel, S.F.\": {\n \"coordinates\": [\n -122.42138,\n 37.76052\n ]\n },\n \"Chase Center (San Francisco)\": {\n \"coordinates\": [\n -122.387426,\n 37.7678485\n ]\n },\n \"Churchil Arms Pub (Folsom)\": {\n \"coordinates\": [\n -121.162887,\n 38.672264\n ]\n },\n \"Civic Auditorium, S.F.\": {\n \"coordinates\": [\n -122.4171575,\n 37.77816\n ]\n },\n \"Club Six (San Francisco)\": {\n \"coordinates\": [\n -122.4096056,\n 37.7813345\n ]\n },\n \"Club Waziema (San Francisco)\": {\n \"coordinates\": [\n -122.437952,\n 37.7746527\n ]\n },\n \"Cornerstone, Berkeley\": {\n \"coordinates\": [\n -122.267336,\n 37.866325\n ]\n },\n \"Crepe Place, Santa Cruz\": {\n \"coordinates\": [\n -122.010887,\n 36.979573\n ]\n },\n \"Crybaby, Oakland\": {\n \"coordinates\": [\n -122.2694797,\n 37.8085784\n ]\n },\n \"DNA Lounge (San Francisco)\": {\n \"coordinates\": [\n -122.4126915,\n 37.770982000000004\n ]\n },\n \"DNA Lounge Above, S.F.\": {\n \"coordinates\": [\n -122.4126915,\n 37.770982000000004\n ]\n },\n \"DNA Lounge, S.F.\": {\n \"coordinates\": [\n -122.4126915,\n 37.770982000000004\n ]\n },\n \"Drop 84 (Berkeley)\": {\n \"coordinates\": [\n -122.268118,\n 37.8678016\n ]\n },\n \"Edinburgh Castle, S.F.\": {\n \"coordinates\": [\n -122.419002,\n 37.786163\n ]\n },\n \"El Rio (San Francisco)\": {\n \"coordinates\": [\n -122.419465,\n 37.746845\n ]\n },\n \"Elbo Room Jack London (Oakland)\": {\n \"coordinates\": [\n -122.275896,\n 37.796961\n ]\n },\n \"Elbo Room, Oakland\": {\n \"coordinates\": [\n -119.770712,\n 39.535467\n ]\n },\n \"Eli's Mile High Club\": {\n \"coordinates\": [\n -122.269884,\n 37.825789\n ]\n },\n \"Eli's Mile High Club, Oakland\": {\n \"coordinates\": [\n -122.269884,\n 37.825789\n ]\n },\n \"Emporium SF (San Francisco)\": {\n \"coordinates\": [\n -122.437701,\n 37.775316\n ]\n },\n \"Empress Theater, Vallejo\": {\n \"coordinates\": [\n -122.257631,\n 38.1022315\n ]\n },\n \"Envelop at The Midway (San Francisco)\": {\n \"coordinates\": [\n -122.3856944,\n 37.7492774\n ]\n },\n \"Ez5 Bar (San Francisco)\": {\n \"coordinates\": [\n -122.404395,\n 37.794108\n ]\n },\n \"F8 (San Francisco)\": {\n \"coordinates\": [\n -122.409973,\n 37.77526\n ]\n },\n \"F8 1192 Folsom (San Francisco)\": {\n \"coordinates\": [\n -122.409973,\n 37.77526\n ]\n },\n \"Faces Nightclub (Sacramento)\": {\n \"coordinates\": [\n -121.4802576,\n 38.5752187\n ]\n },\n \"Faction Brewing, 2501 Monarch Street, Alameda\": {\n \"coordinates\": [\n -122.3097144,\n 37.7867214\n ]\n },\n \"Fillmore (San Francisco)\": {\n \"coordinates\": [\n -122.4330825,\n 37.784025\n ]\n },\n \"Fillmore, S.F.\": {\n \"coordinates\": [\n -122.4330825,\n 37.784025\n ]\n },\n \"First Church of the Buzzard, 2601 Adeline at 26th St., Oakland\": {\n \"coordinates\": [\n -122.283272,\n 37.819053\n ]\n },\n \"Flamingo Resort (Santa Rosa)\": {\n \"coordinates\": [\n -122.6884229,\n 38.4512947\n ]\n },\n \"Folsom Street Foundry (San Francisco)\": {\n \"coordinates\": [\n -122.412972,\n 37.772382\n ]\n },\n \"Folsom, S.F.\": {\n \"coordinates\": [\n -122.412972,\n 37.772382\n ]\n },\n \"Fortheculture Oak (Oakland)\": {\n \"coordinates\": [\n -122.2767756,\n 37.800767\n ]\n },\n \"Fox Theater, Oakland\": {\n \"coordinates\": [\n -122.27067,\n 37.808136\n ]\n },\n \"Freight\": {\n \"coordinates\": [\n -122.269551,\n 37.871025\n ]\n },\n \"Freight and Salvage, Berkeley\": {\n \"coordinates\": [\n -122.2695846,\n 37.8708514\n ]\n },\n \"Fresh Blades Barbershop (San Francisco)\": {\n \"coordinates\": [\n -122.42041,\n 37.789474\n ]\n },\n \"Frost Amphitheater, Palo Alto\": {\n \"coordinates\": [\n -122.165985,\n 37.430602\n ]\n },\n \"Fulton 55 (Fresno)\": {\n \"coordinates\": [\n -119.800556,\n 36.74374\n ]\n },\n \"Golden Bull, Oakland\": {\n \"coordinates\": [\n -122.270409,\n 37.803999\n ]\n },\n \"Goldfield Trading Post (Roseville)\": {\n \"coordinates\": [\n -121.484119,\n 38.577715\n ]\n },\n \"Goldfield Trading Post, Sacramento\": {\n \"coordinates\": [\n -121.484119,\n 38.577715\n ]\n },\n \"Grace Cathedral (San Francisco)\": {\n \"coordinates\": [\n -122.413174,\n 37.791782999999995\n ]\n },\n \"Gray Area (San Francisco)\": {\n \"coordinates\": [\n -122.41848,\n 37.754367\n ]\n },\n \"Great American Music Hall (San Francisco)\": {\n \"coordinates\": [\n -122.418953,\n 37.78498999999999\n ]\n },\n \"Great American Music Hall, S.F.\": {\n \"coordinates\": [\n -122.418953,\n 37.78498999999999\n ]\n },\n \"Great Northern, S.F\": {\n \"coordinates\": [\n -122.406406,\n 37.767478\n ]\n },\n \"Greek Theatre (Berkeley)\": {\n \"coordinates\": [\n -122.2542195,\n 37.873721\n ]\n },\n \"Greek Theatre, UC Berkeley Campus\": {\n \"coordinates\": [\n -122.2542195,\n 37.873721\n ]\n },\n \"Guild Theater, Menlo Park\": {\n \"coordinates\": [\n -122.181271,\n 37.452414\n ]\n },\n \"Halcyon (San Francisco)\": {\n \"coordinates\": [\n -122.413905,\n 37.771575\n ]\n },\n \"Halcyon, 314 11th Street, S.F.\": {\n \"coordinates\": [\n -122.413905,\n 37.771575\n ]\n },\n \"Harlan Records (San Francisco)\": {\n \"coordinates\": [\n -122.43357,\n 37.77169\n ]\n },\n \"Harlow's, Sacramento\": {\n \"coordinates\": [\n -121.469989,\n 38.573963\n ]\n },\n \"Hawthorn (San Francisco)\": {\n \"coordinates\": [\n -122.404167,\n 37.787846\n ]\n },\n \"Henry Miller Library, Big Sur\": {\n \"coordinates\": [\n -121.753744,\n 36.220643\n ]\n },\n \"Herbst Theater, S.F.\": {\n \"coordinates\": [\n -122.420953,\n 37.779548\n ]\n },\n \"Hibernia (San Francisco)\": {\n \"coordinates\": [\n -122.4122892391,\n 37.781308592396016\n ]\n },\n \"Hopmonk Tavern, Novato\": {\n \"coordinates\": [\n -122.822841,\n 38.401164\n ]\n },\n \"Hotel Utah (San Francisco)\": {\n \"coordinates\": [\n -122.398139,\n 37.779308\n ]\n },\n \"Hotel Utah, S.F.\": {\n \"coordinates\": [\n -122.39806,\n 37.779381\n ]\n },\n \"Hotel Via (San Francisco)\": {\n \"coordinates\": [\n -122.390658,\n 37.779213\n ]\n },\n \"Hoza Pizzeria (Oakland)\": {\n \"coordinates\": [\n -122.269378,\n 37.804986\n ]\n },\n \"Independent, S.F.\": {\n \"coordinates\": [\n -122.437835,\n 37.775573\n ]\n },\n \"Ivy Room, Albany\": {\n \"coordinates\": [\n -122.299128,\n 37.890431\n ]\n },\n \"Jam Cellars Ballroom, Napa\": {\n \"coordinates\": [\n -122.289293,\n 38.297617\n ]\n },\n \"Jury Room, 712 Ocean Street, Santa Cruz\": {\n \"coordinates\": [\n -122.020753,\n 36.978459\n ]\n },\n \"Jury Room, Santa Cruz\": {\n \"coordinates\": [\n -122.020753,\n 36.978459\n ]\n },\n \"Kilowatt, S.F.\": {\n \"coordinates\": [\n -122.423204,\n 37.764971\n ]\n },\n \"Kip's (Berkeley)\": {\n \"coordinates\": [\n -122.2595917,\n 37.8679934\n ]\n },\n \"Knockout, S.F.\": {\n \"coordinates\": [\n -122.420015,\n 37.745174\n ]\n },\n \"Kuumbwa Jazz Center, Santa Cruz\": {\n \"coordinates\": [\n -122.026127,\n 36.969856\n ]\n },\n \"Longboard Margarita Bar, Pacifica\": {\n \"coordinates\": [\n -122.488115,\n 37.633134\n ]\n },\n \"Lost Church, S.F.\": {\n \"coordinates\": [\n -122.418452,\n 37.765748\n ]\n },\n \"Lowbrau (Sacramento)\": {\n \"coordinates\": [\n -121.48042,\n 38.575804\n ]\n },\n \"Lucky Duck Bike Cafe, Oakland\": {\n \"coordinates\": [\n -122.268656,\n 37.801684\n ]\n },\n \"Luther Burbank Center for the Arts, 50 Mark West Springs, Santa Rosa\": {\n \"coordinates\": [\n -122.74963525,\n 38.49275325\n ]\n },\n \"Luxx Event Space (San Francisco)\": {\n \"coordinates\": [\n -122.409551,\n 37.7813734\n ]\n },\n \"MOTIV (Santa Cruz)\": {\n \"coordinates\": [\n -122.025856,\n 36.973082\n ]\n },\n \"Madarae (San Francisco)\": {\n \"coordinates\": [\n -122.39825071778282,\n 37.78859528688151\n ]\n },\n \"Madrone Art Bar (San Francisco)\": {\n \"coordinates\": [\n -122.43743,\n 37.774025\n ]\n },\n \"Make-Out Room (San Francisco)\": {\n \"coordinates\": [\n -122.419419,\n 37.75537\n ]\n },\n \"Make-Out Room, S.F.\": {\n \"coordinates\": [\n -122.419419,\n 37.75537\n ]\n },\n \"Maonic, S.F.\": {\n \"coordinates\": [\n -122.413022,\n 37.791188\n ]\n },\n \"Mars Bar (San Francisco)\": {\n \"coordinates\": [\n -122.4032609,\n 37.7732839\n ]\n },\n \"Masonic (San Francisco)\": {\n \"coordinates\": [\n -122.413022,\n 37.791188\n ]\n },\n \"Masonic, S.F.\": {\n \"coordinates\": [\n -122.413022,\n 37.791188\n ]\n },\n \"Mazzotti's (Arcata)\": {\n \"coordinates\": [\n -124.0868234,\n 40.8681176\n ]\n },\n \"Melo Melo Kava Bar (Oakland)\": {\n \"coordinates\": [\n -122.2470815,\n 37.8124911\n ]\n },\n \"Midtown Barfly (Sacramento)\": {\n \"coordinates\": [\n -121.479138,\n 38.574531\n ]\n },\n \"Midway, S.F.\": {\n \"coordinates\": [\n -122.3856944,\n 37.7492774\n ]\n },\n \"Moe's Alley, Santa Cruz\": {\n \"coordinates\": [\n -121.982871,\n 36.987674\n ]\n },\n \"Monarch (San Francisco)\": {\n \"coordinates\": [\n -122.408555,\n 37.781002\n ]\n },\n \"Monarch Gardens (San Francisco)\": {\n \"coordinates\": [\n -122.4120333,\n 37.769775\n ]\n },\n \"Monarch, S.F.\": {\n \"coordinates\": [\n -122.408555,\n 37.781002\n ]\n },\n \"Monroe (San Francisco)\": {\n \"coordinates\": [\n -122.405067,\n 37.79808\n ]\n },\n \"Monroe SF (San Francisco)\": {\n \"coordinates\": [\n -122.405067,\n 37.79808\n ]\n },\n \"Mothership (San Francisco)\": {\n \"coordinates\": [\n -122.419351,\n 37.7469249\n ]\n },\n \"Mothership Bar (San Francisco)\": {\n \"coordinates\": [\n -122.419351,\n 37.7469249\n ]\n },\n \"Mountain Winery, Saratoga\": {\n \"coordinates\": [\n -122.0647455,\n 37.260274499999994\n ]\n },\n \"Mystic Theater, Petaluma\": {\n \"coordinates\": [\n -122.64012,\n 38.233202\n ]\n },\n \"Neck Of The Woods (San Francisco)\": {\n \"coordinates\": [\n -122.463689,\n 37.783052\n ]\n },\n \"Neck of the Woods, S.F.\": {\n \"coordinates\": [\n -122.463689,\n 37.783052\n ]\n },\n \"Nectar Social Club (Oakland)\": {\n \"coordinates\": [\n -122.423282,\n 37.767868\n ]\n },\n \"New Parish, Oakland\": {\n \"coordinates\": [\n -122.272751,\n 37.807796\n ]\n },\n \"No Name Bar, 757 Bridgeway, Sausalito\": {\n \"coordinates\": [\n -122.480223,\n 37.856795\n ]\n },\n \"Noisebridge Hackerspace (San Francisco)\": {\n \"coordinates\": [\n -122.4185361,\n 37.7624302\n ]\n },\n \"Oakland Musium of Calfornia, Oakland\": {\n \"coordinates\": [\n -122.2638015,\n 37.798667\n ]\n },\n \"Oakland Secret Gallery, Oakland\": {\n \"coordinates\": [\n -122.275344,\n 37.800213\n ]\n },\n \"Oakland Secret, Oakland\": {\n \"coordinates\": [\n -122.244192,\n 37.816089\n ]\n },\n \"Oasis (San Francisco)\": {\n \"coordinates\": [\n -122.4144155,\n 37.7718948\n ]\n },\n \"Old Ironsides (Sacramento)\": {\n \"coordinates\": [\n -121.497634,\n 38.570281\n ]\n },\n \"On The Y (Sacramento)\": {\n \"coordinates\": [\n -121.401738,\n 38.577064\n ]\n },\n \"Origin (San Francisco)\": {\n \"coordinates\": [\n -122.432804,\n 37.783863\n ]\n },\n \"Palace of Fine Arts, S.F.\": {\n \"coordinates\": [\n -122.44871,\n 37.802068\n ]\n },\n \"Paramount Theater, Oakland\": {\n \"coordinates\": [\n -122.268377,\n 37.80994\n ]\n },\n \"Parliament Event Venue (Oakland)\": {\n \"coordinates\": [\n -122.275047,\n 37.8010164\n ]\n },\n \"Peacock Lounge (San Francisco)\": {\n \"coordinates\": [\n -122.431239,\n 37.772039\n ]\n },\n \"Peacock Lounge, 552 Haight Street, S.F.\": {\n \"coordinates\": [\n -122.431239,\n 37.772039\n ]\n },\n \"Peacock Lounge, S.F.\": {\n \"coordinates\": [\n -122.431239,\n 37.772039\n ]\n },\n \"Peri's Tavern Patio, Fairfax\": {\n \"coordinates\": [\n -122.588562,\n 37.9868736\n ]\n },\n \"Persona (San Francisco)\": {\n \"coordinates\": [\n -122.4115129,\n 37.7886674\n ]\n },\n \"Phoenix Theater, Petaluma\": {\n \"coordinates\": [\n -122.64300349999999,\n 38.234977\n ]\n },\n \"Phonobar (San Francisco)\": {\n \"coordinates\": [\n -122.422815,\n 37.777882\n ]\n },\n \"Plough\": {\n \"coordinates\": [\n -122.460546,\n 37.783194\n ]\n },\n \"Pop's Bar (San Francisco)\": {\n \"coordinates\": [\n -122.408297,\n 37.753024\n ]\n },\n \"Powerhouse (San Francisco)\": {\n \"coordinates\": [\n -122.412284,\n 37.773311\n ]\n },\n \"Public Works (San Francisco)\": {\n \"coordinates\": [\n -122.419391,\n 37.768948\n ]\n },\n \"Public Works Loft (San Francisco)\": {\n \"coordinates\": [\n -122.419391,\n 37.768948\n ]\n },\n \"Public Works, S.F.\": {\n \"coordinates\": [\n -122.419391,\n 37.768948\n ]\n },\n \"Pure Night Club (Sunnyvale)\": {\n \"coordinates\": [\n -122.419391,\n 37.768948\n ]\n },\n \"Pure Nightclub (Sunnyvale)\": {\n \"coordinates\": [\n -122.0298038,\n 37.3768037\n ]\n },\n \"Purple House,\": {\n \"coordinates\": [\n -122.401337,\n 37.788248\n ]\n },\n \"Radio Habana Social Club, S.F.\": {\n \"coordinates\": [\n -122.420913,\n 37.755237\n ]\n },\n \"Record Bar (San Francisco)\": {\n \"coordinates\": [\n -122.4100788,\n 37.7841668\n ]\n },\n \"Regency Ballroom (San Francisco)\": {\n \"coordinates\": [\n -122.421384,\n 37.787763\n ]\n },\n \"Regency Ballroom, S.F.\": {\n \"coordinates\": [\n -122.421384,\n 37.787763\n ]\n },\n \"Rickshaw Stop (San Francisco)\": {\n \"coordinates\": [\n -122.420431,\n 37.776105\n ]\n },\n \"Rickshaw Stop, S.F.\": {\n \"coordinates\": [\n -122.420431,\n 37.776105\n ]\n },\n \"Rio Theater, Santa Cruz\": {\n \"coordinates\": [\n -122.010467,\n 36.9799735\n ]\n },\n \"Ritz, San Jose\": {\n \"coordinates\": [\n -121.88583,\n 37.32997\n ]\n },\n \"SF Eagle, S.F.\": {\n \"coordinates\": [\n -122.413305,\n 37.769995\n ]\n },\n \"SF Jazz Center, S.F.\": {\n \"coordinates\": [\n -122.421631,\n 37.7764351\n ]\n },\n \"San Jose Civic, San Jose\": {\n \"coordinates\": [\n -121.885985,\n 37.337789\n ]\n },\n \"Sebastiani Theater, Sonoma\": {\n \"coordinates\": [\n -122.456673,\n 38.293099\n ]\n },\n \"Shark Tank, San Jose\": {\n \"coordinates\": [\n -121.901202,\n 37.332866499999994\n ]\n },\n \"Shoreline Amphitheater, Mountain View\": {\n \"coordinates\": [\n -122.080363,\n 37.426615999999996\n ]\n },\n \"Silverado Resort, Napa\": {\n \"coordinates\": [\n -122.2673178,\n 38.3483878\n ]\n },\n \"Slate Bar (San Francisco)\": {\n \"coordinates\": [\n -122.418122,\n 37.765035\n ]\n },\n \"Spats (Berkeley)\": {\n \"coordinates\": [\n -122.26864,\n 37.872647\n ]\n },\n \"Stay Gold Deli, Oakland\": {\n \"coordinates\": [\n -122.275856,\n 37.817699\n ]\n },\n \"Stern Grove, S.F.\": {\n \"coordinates\": [\n -122.2595917,\n 37.8679934\n ]\n },\n \"Stork Club, Oakland\": {\n \"coordinates\": [\n -122.2683657,\n 37.8131757\n ]\n },\n \"Streetlight Records, San Jose\": {\n \"coordinates\": [\n -121.931276,\n 37.307959\n ]\n },\n \"Subrosa, Santa Cruz\": {\n \"coordinates\": [\n -122.183019,\n 37.453264\n ]\n },\n \"Svn West (San Francisco)\": {\n \"coordinates\": [\n -122.419648,\n 37.774356\n ]\n },\n \"Swedish American Hall, S.F.\": {\n \"coordinates\": [\n -122.430563,\n 37.766756\n ]\n },\n \"Sweetwater Music Hall, Mill Valley\": {\n \"coordinates\": [\n -122.547954,\n 37.907057\n ]\n },\n \"Tamarack, 1501 Harrison Street, Oakland\": {\n \"coordinates\": [\n -122.267566,\n 37.804392\n ]\n },\n \"Tamarack, Oakland\": {\n \"coordinates\": [\n -122.267566,\n 37.804392\n ]\n },\n \"Temple (San Francisco)\": {\n \"coordinates\": [\n -122.397227,\n 37.787898\n ]\n },\n \"Temple Nightclub (San Francisco)\": {\n \"coordinates\": [\n -122.397227,\n 37.787898\n ]\n },\n \"Tequila Mockingbird, 86 2nd Street, S.F.\": {\n \"coordinates\": [\n -122.400041,\n 37.788263\n ]\n },\n \"The Blue Lagoon, Santa Cruz\": {\n \"coordinates\": [\n -122.025316,\n 36.970636\n ]\n },\n \"The Catalyst Club (Santa Cruz)\": {\n \"coordinates\": [\n -122.025597,\n 36.971359\n ]\n },\n \"The Center SF (San Francisco)\": {\n \"coordinates\": [\n -122.4307162,\n 37.7744549\n ]\n },\n \"The Colonial Theatre (Sacramento)\": {\n \"coordinates\": [\n -121.4515798,\n 38.5424065\n ]\n },\n \"The Continental Bar (San Jose)\": {\n \"coordinates\": [\n -121.886756,\n 37.330589\n ]\n },\n \"The Continental Bar Lounge & Patio (San Jose)\": {\n \"coordinates\": [\n -121.886756,\n 37.330589\n ]\n },\n \"The Drop 84 (Berkeley)\": {\n \"coordinates\": [\n -122.268118,\n 37.8678016\n ]\n },\n \"The Eagle (San Francisco)\": {\n \"coordinates\": [\n -122.413406,\n 37.7699936\n ]\n },\n \"The Endup (San Francisco)\": {\n \"coordinates\": [\n -122.403872,\n 37.777338\n ]\n },\n \"The Felix (San Francisco)\": {\n \"coordinates\": [\n -122.401279,\n 37.791856\n ]\n },\n \"The Fillmore (San Francisco)\": {\n \"coordinates\": [\n -122.4330825,\n 37.784025\n ]\n },\n \"The Flamingo House (Sacramento)\": {\n \"coordinates\": [\n -121.4757194,\n 38.5745331\n ]\n },\n \"The Foundry (San Francisco)\": {\n \"coordinates\": [\n -122.4130137,\n 37.7723519\n ]\n },\n \"The Gallery (Sacramento)\": {\n \"coordinates\": [\n -122.289105,\n 37.814805\n ]\n },\n \"The Grand Nightclub (San Francisco)\": {\n \"coordinates\": [\n -122.397692,\n 37.779125\n ]\n },\n \"The Great Northern (San Francisco)\": {\n \"coordinates\": [\n -122.406406,\n 37.767478\n ]\n },\n \"The Guild Theatre (Menlo Park)\": {\n \"coordinates\": [\n -122.181271,\n 37.452414\n ]\n },\n \"The Hotel Utah Saloon (San Francisco)\": {\n \"coordinates\": [\n -122.39806,\n 37.779381\n ]\n },\n \"The Independent (San Francisco)\": {\n \"coordinates\": [\n -122.437835,\n 37.775573\n ]\n },\n \"The Jam (Arcata)\": {\n \"coordinates\": [\n -124.086986,\n 40.869227\n ]\n },\n \"The Knockout (San Francisco)\": {\n \"coordinates\": [\n -122.420015,\n 37.745174\n ]\n },\n \"The Lab (San Francisco)\": {\n \"coordinates\": [\n -122.418845,\n 37.765133\n ]\n },\n \"The Midway (San Francisco)\": {\n \"coordinates\": [\n -122.3856944,\n 37.7492774\n ]\n },\n \"The Midway Patio (San Francisco)\": {\n \"coordinates\": [\n -122.3856944,\n 37.7492774\n ]\n },\n \"The New Parish (Oakland)\": {\n \"coordinates\": [\n -122.272751,\n 37.807796\n ]\n },\n \"The Park Ultra Lounge (Sacramento)\": {\n \"coordinates\": [\n -121.487594,\n 38.576646\n ]\n },\n \"The Record Bar (San Francisco)\": {\n \"coordinates\": [\n -122.4100788,\n 37.7841668\n ]\n },\n \"The Regency Ballroom (San Francisco)\": {\n \"coordinates\": [\n -122.421384,\n 37.787763\n ]\n },\n \"The Rink Studios (Sacramento)\": {\n \"coordinates\": [\n -121.483114,\n 38.575061\n ]\n },\n \"The Ritz (San Jose)\": {\n \"coordinates\": [\n -121.88583,\n 37.32997\n ]\n },\n \"The Royale (San Francisco)\": {\n \"coordinates\": [\n -122.415215,\n 37.787487\n ]\n },\n \"The Rumpus Room (San Francisco)\": {\n \"coordinates\": [\n -122.409952,\n 37.781955\n ]\n },\n \"The Stud (San Francisco)\": {\n \"coordinates\": [\n -122.448689,\n 37.76982\n ]\n },\n \"The Uc Theatre (Berkeley)\": {\n \"coordinates\": [\n -122.269954,\n 37.871631\n ]\n },\n \"The Valencia Room (San Francisco)\": {\n \"coordinates\": [\n -122.421559,\n 37.762505\n ]\n },\n \"The Warfield (San Francisco)\": {\n \"coordinates\": [\n -122.410151,\n 37.782675499999996\n ]\n },\n \"Thee Parkside, S.F.\": {\n \"coordinates\": [\n -122.399842,\n 37.765067\n ]\n },\n \"Thee Storke Club, Oakland\": {\n \"coordinates\": [\n -122.2683657,\n 37.8131757\n ]\n },\n \"Thrillhouse Records, S.F.\": {\n \"coordinates\": [\n -122.422312,\n 37.742173\n ]\n },\n \"Tiger (Sacramento)\": {\n \"coordinates\": [\n -121.3288,\n 38.62563\n ]\n },\n \"UC Theater, Berkeley\": {\n \"coordinates\": [\n -122.269958,\n 37.871601\n ]\n },\n \"Underground (San Francisco)\": {\n \"coordinates\": [\n -122.429336,\n 37.772305\n ]\n },\n \"Uptown Theater, Napa\": {\n \"coordinates\": [\n -122.287376,\n 38.29635\n ]\n },\n \"Uptown, Napa\": {\n \"coordinates\": [\n -122.418449,\n 37.763451\n ]\n },\n \"Vinnies Bar and Grill, 2045 Mount Diablo St, Concord\": {\n \"coordinates\": [\n -122.035169,\n 37.977914\n ]\n },\n \"Vinnies's, 2045 Mt. Diablo Street, Concord\": {\n \"coordinates\": [\n -122.46989,\n 38.50465\n ]\n },\n \"Warfield, S.F.\": {\n \"coordinates\": [\n -122.410151,\n 37.782675499999996\n ]\n },\n \"Warriors Stadium, S.F.\": {\n \"coordinates\": [\n -122.387877,\n 37.7680183\n ]\n },\n \"White Rabbit (San Francisco)\": {\n \"coordinates\": [\n -122.435835,\n 37.798712\n ]\n },\n \"Winters Tavern, Pacifica\": {\n \"coordinates\": [\n -122.490455,\n 37.636643\n ]\n },\n \"Yolo Nightclub (San Francisco)\": {\n \"coordinates\": [\n -122.4133157,\n 37.7715426\n ]\n },\n \"Yoshi's, Oakland\": {\n \"coordinates\": [\n -122.2788889,\n 37.7963889\n ]\n },\n \"Zanzi (Oakland)\": {\n \"coordinates\": [\n -122.2663121,\n 37.8112817\n ]\n },\n \"Zoe Bar (San Francisco)\": {\n \"coordinates\": [\n -122.418564,\n 37.751658\n ]\n }\n }\n}\n", "// src/debug_layers.ts\nfunction debug_layers_default(source) {\n return [\n {\n id: \"background\",\n type: \"background\",\n paint: {\n \"background-color\": \"black\"\n }\n },\n {\n id: \"natural\",\n type: \"fill\",\n source,\n \"source-layer\": \"natural\",\n paint: {\n \"fill-color\": \"#19A974\",\n \"fill-opacity\": 0.5\n }\n },\n {\n id: \"landuse\",\n type: \"fill\",\n source,\n \"source-layer\": \"landuse\",\n paint: {\n \"fill-color\": \"white\",\n \"fill-opacity\": 0.25\n }\n },\n {\n id: \"water\",\n type: \"fill\",\n source,\n \"source-layer\": \"water\",\n paint: {\n \"fill-color\": \"#268bd2\",\n \"fill-opacity\": 0.5\n }\n },\n {\n id: \"physical\",\n type: \"line\",\n source,\n \"source-layer\": \"physical\",\n paint: {\n \"line-color\": \"#357EDD\",\n \"line-opacity\": 0.5\n }\n },\n {\n id: \"buildings\",\n type: \"fill\",\n source,\n \"source-layer\": \"buildings\",\n paint: {\n \"fill-color\": \"#6c71c4\",\n \"fill-opacity\": 0.8\n }\n },\n {\n id: \"roads\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n paint: {\n \"line-color\": \"white\",\n \"line-opacity\": 0.5\n }\n },\n {\n id: \"boundaries\",\n type: \"line\",\n source,\n \"source-layer\": \"boundaries\",\n paint: {\n \"line-color\": \"#5E2CA5\",\n \"line-opacity\": 0.5\n }\n },\n {\n id: \"transit\",\n type: \"line\",\n source,\n \"source-layer\": \"transit\",\n paint: {\n \"line-color\": \"#dc322f\",\n \"line-opacity\": 0.5\n }\n },\n {\n id: \"pois\",\n type: \"circle\",\n source,\n \"source-layer\": \"pois\",\n paint: {\n \"circle-radius\": 2,\n \"circle-color\": \"#268bd2\",\n \"circle-opacity\": 0.9\n }\n },\n {\n id: \"places\",\n type: \"circle\",\n source,\n \"source-layer\": \"places\",\n paint: {\n \"circle-radius\": 5,\n \"circle-color\": \"#b58900\",\n \"circle-opacity\": 0.9\n }\n },\n {\n id: \"mask\",\n type: \"fill\",\n source,\n \"source-layer\": \"mask\",\n paint: {\n \"fill-color\": \"#000000\",\n \"fill-opacity\": 0.5\n }\n }\n ];\n}\n\n// src/base_layers.ts\nfunction nolabels_layers(source, c) {\n const casingVisibility = c.hasCasings ? \"visible\" : \"none\";\n return [\n {\n id: \"background\",\n type: \"background\",\n paint: {\n \"background-color\": c.background\n }\n },\n {\n id: \"earth\",\n type: \"fill\",\n source,\n \"source-layer\": \"earth\",\n paint: {\n \"fill-color\": c.earth\n }\n },\n {\n id: \"landuse_park\",\n type: \"fill\",\n source,\n \"source-layer\": \"landuse\",\n filter: [\n \"any\",\n [\"==\", \"pmap:kind\", \"park\"],\n [\"==\", \"landuse\", \"cemetery\"]\n ],\n paint: {\n \"fill-color\": c.park\n }\n },\n {\n id: \"landuse_hospital\",\n type: \"fill\",\n source,\n \"source-layer\": \"landuse\",\n filter: [\"any\", [\"==\", \"pmap:kind\", \"hospital\"]],\n paint: {\n \"fill-color\": c.hospital\n }\n },\n {\n id: \"landuse_industrial\",\n type: \"fill\",\n source,\n \"source-layer\": \"landuse\",\n filter: [\"any\", [\"==\", \"pmap:kind\", \"industrial\"]],\n paint: {\n \"fill-color\": c.industrial\n }\n },\n {\n id: \"landuse_school\",\n type: \"fill\",\n source,\n \"source-layer\": \"landuse\",\n filter: [\"any\", [\"==\", \"pmap:kind\", \"school\"]],\n paint: {\n \"fill-color\": c.school\n }\n },\n {\n id: \"natural_wood\",\n type: \"fill\",\n source,\n \"source-layer\": \"natural\",\n filter: [\n \"any\",\n [\"==\", \"natural\", \"wood\"],\n [\"==\", \"leisure\", \"nature_reserve\"],\n [\"==\", \"landuse\", \"forest\"]\n ],\n paint: {\n \"fill-color\": c.wood\n }\n },\n {\n id: \"landuse_pedestrian\",\n type: \"fill\",\n source,\n \"source-layer\": \"landuse\",\n filter: [\"any\", [\"==\", \"highway\", \"footway\"]],\n paint: {\n \"fill-color\": c.pedestrian\n }\n },\n {\n id: \"natural_scrub\",\n type: \"fill\",\n source,\n \"source-layer\": \"natural\",\n filter: [\"in\", \"natural\", \"scrub\", \"grassland\"],\n paint: {\n \"fill-color\": c.scrub\n }\n },\n {\n id: \"natural_glacier\",\n type: \"fill\",\n source,\n \"source-layer\": \"natural\",\n filter: [\"==\", \"natural\", \"glacier\"],\n paint: {\n \"fill-color\": c.glacier\n }\n },\n {\n id: \"natural_sand\",\n type: \"fill\",\n source,\n \"source-layer\": \"natural\",\n filter: [\"==\", \"natural\", \"sand\"],\n paint: {\n \"fill-color\": c.sand\n }\n },\n {\n id: \"landuse_aerodrome\",\n type: \"fill\",\n source,\n \"source-layer\": \"landuse\",\n filter: [\"==\", \"aeroway\", \"aerodrome\"],\n paint: {\n \"fill-color\": c.aerodrome\n }\n },\n {\n id: \"transit_runway\",\n type: \"line\",\n source,\n \"source-layer\": \"transit\",\n filter: [\"has\", \"aeroway\"],\n paint: {\n \"line-color\": c.runway,\n \"line-width\": 6\n }\n },\n {\n id: \"landuse_runway\",\n type: \"fill\",\n source,\n \"source-layer\": \"landuse\",\n filter: [\n \"any\",\n [\"==\", \"aeroway\", \"runway\"],\n [\"==\", \"area:aeroway\", \"runway\"],\n [\"==\", \"area:aeroway\", \"taxiway\"]\n ],\n paint: {\n \"fill-color\": c.runway\n }\n },\n {\n id: \"water\",\n type: \"fill\",\n source,\n \"source-layer\": \"water\",\n paint: {\n \"fill-color\": c.water\n }\n },\n {\n id: \"landuse_pier\",\n type: \"fill\",\n source,\n \"source-layer\": \"landuse\",\n filter: [\n \"any\",\n [\"==\", \"man_made\", \"pier\"]\n ],\n paint: {\n \"fill-color\": c.earth\n }\n },\n {\n id: \"roads_tunnels_other_casing\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\"all\", [\"<\", \"pmap:level\", 0], [\"==\", \"pmap:kind\", \"other\"]],\n paint: {\n \"line-color\": c.tunnel_other_casing,\n \"line-gap-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 14,\n 0,\n 14.5,\n 0.5,\n 20,\n 12\n ]\n },\n layout: {\n visibility: casingVisibility\n }\n },\n {\n id: \"roads_tunnels_minor_casing\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\n \"all\",\n [\"<\", \"pmap:level\", 0],\n [\"==\", \"pmap:kind\", \"minor_road\"]\n ],\n paint: {\n \"line-color\": c.tunnel_minor_casing,\n \"line-dasharray\": [3, 2],\n \"line-gap-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 12,\n 0,\n 12.5,\n 0.5,\n 20,\n 32\n ],\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 12,\n 0,\n 12.5,\n 1\n ]\n },\n layout: {\n visibility: casingVisibility\n }\n },\n {\n id: \"roads_tunnels_medium_casing\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\n \"all\",\n [\"<\", \"pmap:level\", 0],\n [\"==\", \"pmap:kind\", \"medium_road\"]\n ],\n paint: {\n \"line-color\": c.tunnel_medium_casing,\n \"line-dasharray\": [3, 2],\n \"line-gap-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 7,\n 0,\n 7.5,\n 0.5,\n 20,\n 32\n ],\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 10,\n 0,\n 10.5,\n 1\n ]\n },\n layout: {\n visibility: casingVisibility\n }\n },\n {\n id: \"roads_tunnels_major_casing\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\n \"all\",\n [\"<\", \"pmap:level\", 0],\n [\"==\", \"pmap:kind\", \"major_road\"]\n ],\n paint: {\n \"line-color\": c.tunnel_major_casing,\n \"line-dasharray\": [3, 2],\n \"line-gap-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 7,\n 0,\n 7.5,\n 0.5,\n 19,\n 32\n ],\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 9,\n 0,\n 9.5,\n 1\n ]\n },\n layout: {\n visibility: casingVisibility\n }\n },\n {\n id: \"roads_tunnels_highway_casing\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\"all\", [\"<\", \"pmap:level\", 0], [\"==\", \"pmap:kind\", \"highway\"]],\n paint: {\n \"line-color\": c.tunnel_highway_casing,\n \"line-dasharray\": [3, 2],\n \"line-gap-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 3,\n 0,\n 3.5,\n 0.5,\n 18,\n 32\n ],\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 7,\n 0,\n 7.5,\n 1\n ]\n },\n layout: {\n visibility: casingVisibility\n }\n },\n {\n id: \"roads_tunnels_other\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\"all\", [\"<\", \"pmap:level\", 0], [\"==\", \"pmap:kind\", \"other\"]],\n paint: {\n \"line-color\": c.tunnel_other,\n \"line-dasharray\": [1, 1],\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 14,\n 0,\n 14.5,\n 0.5,\n 20,\n 12\n ]\n }\n },\n {\n id: \"roads_tunnels_minor\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\n \"all\",\n [\"<\", \"pmap:level\", 0],\n [\"==\", \"pmap:kind\", \"minor_road\"]\n ],\n paint: {\n \"line-color\": c.tunnel_minor,\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 12,\n 0,\n 12.5,\n 0.5,\n 20,\n 32\n ]\n }\n },\n {\n id: \"roads_tunnels_medium\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\n \"all\",\n [\"<\", \"pmap:level\", 0],\n [\"==\", \"pmap:kind\", \"medium_road\"]\n ],\n paint: {\n \"line-color\": c.tunnel_medium,\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 7,\n 0,\n 7.5,\n 0.5,\n 20,\n 32\n ]\n }\n },\n {\n id: \"roads_tunnels_major\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\n \"all\",\n [\"<\", \"pmap:level\", 0],\n [\"==\", \"pmap:kind\", \"major_road\"]\n ],\n paint: {\n \"line-color\": c.tunnel_major,\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 7,\n 0,\n 7.5,\n 0.5,\n 19,\n 32\n ]\n }\n },\n {\n id: \"roads_tunnels_highway\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\"all\", [\"<\", \"pmap:level\", 0], [\"==\", \"pmap:kind\", \"highway\"]],\n paint: {\n \"line-color\": c.tunnel_highway,\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 3,\n 0,\n 3.5,\n 0.5,\n 18,\n 32\n ]\n }\n },\n {\n id: \"physical_line_waterway\",\n type: \"line\",\n source,\n \"source-layer\": \"physical_line\",\n filter: [\"==\", [\"get\", \"pmap:kind\"], \"waterway\"],\n paint: {\n \"line-color\": c.water,\n \"line-width\": 0.5\n }\n },\n {\n id: \"buildings\",\n type: \"fill-extrusion\",\n source,\n \"source-layer\": \"buildings\",\n paint: {\n \"fill-extrusion-color\": c.buildings,\n \"fill-extrusion-height\": [\"to-number\", [\"get\", \"height\"]],\n \"fill-extrusion-opacity\": 0.5\n }\n },\n {\n id: \"roads_minor_casing\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\n \"all\",\n [\"==\", \"pmap:level\", 0],\n [\"==\", \"pmap:kind\", \"minor_road\"]\n ],\n paint: {\n \"line-color\": c.minor_casing,\n \"line-gap-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 12,\n 0,\n 12.5,\n 0.5,\n 20,\n 32\n ],\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 12,\n 0,\n 12.5,\n 1\n ]\n },\n layout: {\n visibility: casingVisibility\n }\n },\n {\n id: \"roads_medium_casing\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\n \"all\",\n [\"==\", \"pmap:level\", 0],\n [\"==\", \"pmap:kind\", \"medium_road\"]\n ],\n paint: {\n \"line-color\": c.medium_casing,\n \"line-gap-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 7,\n 0,\n 7.5,\n 0.5,\n 20,\n 32\n ],\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 10,\n 0,\n 10.5,\n 1\n ]\n },\n layout: {\n visibility: casingVisibility\n }\n },\n {\n id: \"roads_major_casing\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\n \"all\",\n [\"==\", \"pmap:level\", 0],\n [\"==\", \"pmap:kind\", \"major_road\"]\n ],\n paint: {\n \"line-color\": c.major_casing,\n \"line-gap-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 7,\n 0,\n 7.5,\n 0.5,\n 19,\n 32\n ],\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 9,\n 0,\n 9.5,\n 1\n ]\n },\n layout: {\n visibility: casingVisibility\n }\n },\n {\n id: \"roads_highway_casing\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\"all\", [\"==\", \"pmap:level\", 0], [\"==\", \"pmap:kind\", \"highway\"]],\n paint: {\n \"line-color\": c.highway_casing,\n \"line-gap-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 3,\n 0,\n 3.5,\n 0.5,\n 18,\n 32\n ],\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 7,\n 0,\n 7.5,\n 1\n ]\n },\n layout: {\n visibility: casingVisibility\n }\n },\n {\n id: \"roads_other\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\"all\", [\"==\", \"pmap:level\", 0], [\"==\", \"pmap:kind\", \"other\"]],\n paint: {\n \"line-color\": c.other,\n \"line-dasharray\": [2, 1],\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 14,\n 0,\n 14.5,\n 0.5,\n 20,\n 12\n ]\n }\n },\n {\n id: \"transit_pier\",\n type: \"line\",\n source,\n \"source-layer\": \"transit\",\n filter: [\n \"any\",\n [\"==\", \"pmap:kind\", \"pier\"]\n ],\n paint: {\n \"line-color\": c.minor,\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 12,\n 0,\n 12.5,\n 0.5,\n 20,\n 16\n ]\n }\n },\n {\n id: \"roads_minor\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\n \"all\",\n [\"==\", \"pmap:level\", 0],\n [\"==\", \"pmap:kind\", \"minor_road\"]\n ],\n paint: {\n \"line-color\": c.minor,\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 12,\n 0,\n 12.5,\n 0.5,\n 20,\n 32\n ]\n }\n },\n {\n id: \"roads_medium\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\n \"all\",\n [\"==\", \"pmap:level\", 0],\n [\"==\", \"pmap:kind\", \"medium_road\"]\n ],\n paint: {\n \"line-color\": c.medium,\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 7,\n 0,\n 7.5,\n 0.5,\n 20,\n 32\n ]\n }\n },\n {\n id: \"roads_major\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\n \"all\",\n [\"==\", \"pmap:level\", 0],\n [\"==\", \"pmap:kind\", \"major_road\"]\n ],\n paint: {\n \"line-color\": c.major,\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 7,\n 0,\n 7.5,\n 0.5,\n 19,\n 32\n ]\n }\n },\n {\n id: \"roads_highway\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\"all\", [\"==\", \"pmap:level\", 0], [\"==\", \"pmap:kind\", \"highway\"]],\n paint: {\n \"line-color\": c.highway,\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 3,\n 0,\n 3.5,\n 0.5,\n 18,\n 32\n ]\n }\n },\n {\n id: \"transit_railway\",\n type: \"line\",\n source,\n \"source-layer\": \"transit\",\n filter: [\"all\", [\"==\", \"pmap:kind\", \"railway\"]],\n paint: {\n \"line-color\": c.railway,\n \"line-width\": 2\n }\n },\n {\n id: \"transit_railway_tracks\",\n type: \"line\",\n source,\n \"source-layer\": \"transit\",\n filter: [\"all\", [\"==\", \"pmap:kind\", \"railway\"]],\n paint: {\n \"line-color\": c.railway_tracks,\n \"line-width\": 0.8,\n \"line-dasharray\": [6, 10]\n }\n },\n {\n id: \"boundaries\",\n type: \"line\",\n source,\n \"source-layer\": \"boundaries\",\n paint: {\n \"line-color\": c.boundaries,\n \"line-width\": 0.5,\n \"line-dasharray\": [3, 2]\n }\n },\n {\n id: \"roads_bridges_other_casing\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\"all\", [\">\", \"pmap:level\", 0], [\"==\", \"pmap:kind\", \"other\"]],\n paint: {\n \"line-color\": c.bridges_other_casing,\n \"line-gap-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 14,\n 0,\n 14.5,\n 0.5,\n 20,\n 12\n ]\n },\n layout: {\n visibility: casingVisibility\n }\n },\n {\n id: \"roads_bridges_minor_casing\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\n \"all\",\n [\">\", \"pmap:level\", 0],\n [\"==\", \"pmap:kind\", \"minor_road\"]\n ],\n paint: {\n \"line-color\": c.bridges_minor_casing,\n \"line-gap-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 12,\n 0,\n 12.5,\n 0.5,\n 20,\n 32\n ],\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 12,\n 0,\n 12.5,\n 1\n ]\n },\n layout: {\n visibility: casingVisibility\n }\n },\n {\n id: \"roads_bridges_medium_casing\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\n \"all\",\n [\">\", \"pmap:level\", 0],\n [\"==\", \"pmap:kind\", \"medium_road\"]\n ],\n paint: {\n \"line-color\": c.bridges_medium_casing,\n \"line-gap-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 7,\n 0,\n 7.5,\n 0.5,\n 20,\n 32\n ],\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 10,\n 0,\n 10.5,\n 1\n ]\n },\n layout: {\n visibility: casingVisibility\n }\n },\n {\n id: \"roads_bridges_major_casing\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\n \"all\",\n [\">\", \"pmap:level\", 0],\n [\"==\", \"pmap:kind\", \"major_road\"]\n ],\n paint: {\n \"line-color\": c.bridges_major_casing,\n \"line-gap-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 7,\n 0,\n 7.5,\n 0.5,\n 19,\n 32\n ],\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 9,\n 0,\n 9.5,\n 1\n ]\n },\n layout: {\n visibility: casingVisibility\n }\n },\n {\n id: \"roads_bridges_highway_casing\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\"all\", [\">\", \"pmap:level\", 0], [\"==\", \"pmap:kind\", \"highway\"]],\n paint: {\n \"line-color\": c.bridges_highway_casing,\n \"line-gap-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 3,\n 0,\n 3.5,\n 0.5,\n 18,\n 32\n ],\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 7,\n 0,\n 7.5,\n 1\n ]\n },\n layout: {\n visibility: casingVisibility\n }\n },\n {\n id: \"roads_bridges_other\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\"all\", [\">\", \"pmap:level\", 0], [\"==\", \"pmap:kind\", \"other\"]],\n paint: {\n \"line-color\": c.bridges_other,\n \"line-dasharray\": [2, 1],\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 14,\n 0,\n 14.5,\n 0.5,\n 20,\n 12\n ]\n }\n },\n {\n id: \"roads_bridges_minor\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\n \"all\",\n [\">\", \"pmap:level\", 0],\n [\"==\", \"pmap:kind\", \"minor_road\"]\n ],\n paint: {\n \"line-color\": c.bridges_minor,\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 12,\n 0,\n 12.5,\n 0.5,\n 20,\n 32\n ]\n }\n },\n {\n id: \"roads_bridges_medium\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\n \"all\",\n [\">\", \"pmap:level\", 0],\n [\"==\", \"pmap:kind\", \"medium_road\"]\n ],\n paint: {\n \"line-color\": c.bridges_medium,\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 7,\n 0,\n 7.5,\n 0.5,\n 20,\n 32\n ]\n }\n },\n {\n id: \"roads_bridges_major\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\n \"all\",\n [\">\", \"pmap:level\", 0],\n [\"==\", \"pmap:kind\", \"major_road\"]\n ],\n paint: {\n \"line-color\": c.bridges_major,\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 7,\n 0,\n 7.5,\n 0.5,\n 19,\n 32\n ]\n }\n },\n {\n id: \"roads_bridges_highway\",\n type: \"line\",\n source,\n \"source-layer\": \"roads\",\n filter: [\"all\", [\">\", \"pmap:level\", 0], [\"==\", \"pmap:kind\", \"highway\"]],\n paint: {\n \"line-color\": c.bridges_highway,\n \"line-width\": [\n \"interpolate\",\n [\"exponential\", 1.6],\n [\"zoom\"],\n 3,\n 0,\n 3.5,\n 0.5,\n 18,\n 32\n ]\n }\n }\n ];\n}\nfunction labels_layers(source, c) {\n return [\n {\n id: \"physical_line_waterway_label\",\n type: \"symbol\",\n source,\n \"source-layer\": \"physical_line\",\n minzoom: 14,\n layout: {\n \"symbol-placement\": \"line\",\n \"text-font\": [\"NotoSans-Regular\"],\n \"text-field\": [\"get\", \"name\"],\n \"text-size\": 14,\n \"text-letter-spacing\": 0.3\n },\n paint: {\n \"text-color\": c.waterway_label,\n \"text-halo-color\": c.waterway_label_halo,\n \"text-halo-width\": 2\n }\n },\n {\n id: \"roads_labels\",\n type: \"symbol\",\n source,\n \"source-layer\": \"roads\",\n layout: {\n \"symbol-placement\": \"line\",\n \"text-font\": [\"NotoSans-Regular\"],\n \"text-field\": [\"get\", \"name\"],\n \"text-size\": 12\n },\n paint: {\n \"text-color\": c.roads_label,\n \"text-halo-color\": c.roads_label_halo,\n \"text-halo-width\": 2\n }\n },\n {\n id: \"mask\",\n type: \"fill\",\n source,\n \"source-layer\": \"mask\",\n paint: {\n \"fill-color\": c.background\n }\n },\n {\n id: \"physical_point_ocean\",\n type: \"symbol\",\n source,\n \"source-layer\": \"physical_point\",\n filter: [\"any\", [\"==\", \"place\", \"sea\"], [\"==\", \"place\", \"ocean\"]],\n layout: {\n \"text-font\": [\"NotoSans-Regular\"],\n \"text-field\": [\"get\", \"name\"],\n \"text-size\": 13,\n \"text-letter-spacing\": 0.1\n },\n paint: {\n \"text-color\": c.ocean_label,\n \"text-halo-color\": c.ocean_label_halo,\n \"text-halo-width\": 1\n }\n },\n {\n id: \"physical_point_peak\",\n type: \"symbol\",\n source,\n \"source-layer\": \"physical_point\",\n filter: [\"any\", [\"==\", \"natural\", \"peak\"]],\n layout: {\n \"text-font\": [\"NotoSans-Regular\"],\n \"text-field\": [\"get\", \"name\"],\n \"text-size\": 14\n },\n paint: {\n \"text-color\": c.peak_label,\n \"text-halo-color\": c.peak_label_halo,\n \"text-halo-width\": 1.5\n }\n },\n {\n id: \"pois\",\n type: \"symbol\",\n source,\n minzoom: 17,\n \"source-layer\": \"pois\",\n layout: {\n \"text-font\": [\"NotoSans-Regular\"],\n \"text-field\": [\"get\", \"name\"],\n \"text-size\": 12\n },\n paint: {\n \"text-color\": c.subplace_label,\n \"text-halo-color\": c.subplace_label_halo,\n \"text-halo-width\": 1.5\n }\n },\n {\n id: \"places_subplace\",\n type: \"symbol\",\n source,\n \"source-layer\": \"places\",\n filter: [\"==\", \"pmap:kind\", \"neighbourhood\"],\n layout: {\n \"text-field\": \"{name}\",\n \"text-font\": [\"NotoSans-Regular\"],\n \"text-size\": {\n base: 1.2,\n stops: [\n [11, 10],\n [14, 12]\n ]\n },\n \"text-transform\": \"uppercase\"\n },\n paint: {\n \"text-color\": c.subplace_label,\n \"text-halo-color\": c.subplace_label_halo,\n \"text-halo-width\": 0.5\n }\n },\n {\n id: \"places_city_circle\",\n type: \"circle\",\n source,\n \"source-layer\": \"places\",\n filter: [\"==\", \"pmap:kind\", \"city\"],\n paint: {\n \"circle-radius\": 2,\n \"circle-stroke-width\": 2,\n \"circle-stroke-color\": c.city_circle_stroke,\n \"circle-color\": c.city_circle\n },\n maxzoom: 8\n },\n {\n id: \"places_city\",\n type: \"symbol\",\n source,\n \"source-layer\": \"places\",\n filter: [\"==\", \"pmap:kind\", \"city\"],\n layout: {\n \"symbol-sort-key\": [\"number\", [\"get\", \"pmap:min_zoom\"]],\n \"text-field\": \"{name}\",\n \"text-font\": [\"NotoSans-Bold\"],\n \"text-size\": [\"step\", [\"get\", \"pmap:rank\"], 0, 1, 12, 2, 10],\n \"text-anchor\": {\n stops: [\n [7, \"left\"],\n [8, \"center\"]\n ]\n },\n \"text-radial-offset\": 0.2\n },\n paint: {\n \"text-color\": c.city_label,\n \"text-halo-color\": c.city_label_halo,\n \"text-halo-width\": 1\n }\n },\n {\n id: \"places_state\",\n type: \"symbol\",\n source,\n \"source-layer\": \"places\",\n filter: [\"==\", \"pmap:kind\", \"state\"],\n layout: {\n \"text-field\": \"{name}\",\n \"text-font\": [\"NotoSans-Regular\"],\n \"text-size\": 12,\n \"text-radial-offset\": 0.2,\n \"text-anchor\": \"center\",\n \"text-transform\": \"uppercase\"\n },\n paint: {\n \"text-color\": c.state_label,\n \"text-halo-color\": c.state_label_halo,\n \"text-halo-width\": 0.5\n }\n },\n {\n id: \"places_country\",\n type: \"symbol\",\n source,\n \"source-layer\": \"places\",\n filter: [\"==\", \"place\", \"country\"],\n layout: {\n \"text-field\": \"{name}\",\n \"text-font\": [\"NotoSans-Bold\"],\n \"text-size\": {\n base: 1.2,\n stops: [\n [2, 13],\n [6, 13],\n [8, 20]\n ]\n },\n \"text-transform\": \"uppercase\"\n },\n paint: {\n \"text-color\": c.country_label,\n \"text-halo-color\": c.country_label_halo,\n \"text-halo-width\": 1\n }\n }\n ];\n}\n\n// src/colors.ts\nvar LIGHT = {\n hasCasings: true,\n background: \"#dddddd\",\n earth: \"#e7f1ee\",\n park: \"#c2f7d1\",\n hospital: \"#ffeae8\",\n industrial: \"#f8ffed\",\n school: \"#f2fef9\",\n wood: \"#eafbe9\",\n pedestrian: \"#eef0f0\",\n scrub: \"rgb(219,239,209)\",\n glacier: \"white\",\n sand: \"#eff5e7\",\n aerodrome: \"#dbe7e7\",\n runway: \"#d1d9d9\",\n water: \"#a4cae1\",\n tunnel_other_casing: \"#ffffff\",\n tunnel_other: \"#f7f7f7\",\n tunnel_minor_casing: \"#e2e2e2\",\n tunnel_minor: \"#ebebeb\",\n tunnel_medium_casing: \"#e1e1e1\",\n tunnel_medium: \"#ebebeb\",\n tunnel_major_casing: \"#e3cfd3\",\n tunnel_major: \"#ebebeb\",\n tunnel_highway_casing: \"#ebcea2\",\n tunnel_highway: \"#ebebeb\",\n buildings: \"#cbcece\",\n other: \"#ffffff\",\n minor_casing: \"#e2e2e2\",\n minor: \"white\",\n medium_casing: \"#e1e1e1\",\n medium: \"#ffffff\",\n major_casing: \"#e3cfd3\",\n major: \"#ffffff\",\n highway_casing: \"#ebcea2\",\n highway: \"#fefffc\",\n railway: \"#b3bcc9\",\n railway_tracks: \"#ffffff\",\n boundaries: \"#5c4a6b\",\n waterway_label_halo: \"white\",\n waterway_label: \"#a4cae1\",\n bridges_other_casing: \"#ffffff\",\n bridges_other: \"#ffffff\",\n bridges_minor_casing: \"#e2e2e2\",\n bridges_minor: \"white\",\n bridges_medium_casing: \"#e1e1e1\",\n bridges_medium: \"#ffffff\",\n bridges_major_casing: \"#e3cfd3\",\n bridges_major: \"#ffffff\",\n bridges_highway_casing: \"#ebcea2\",\n bridges_highway: \"#fefffc\",\n roads_label: \"#91888b\",\n roads_label_halo: \"white\",\n ocean_label: \"white\",\n ocean_label_halo: \"#a4cae1\",\n peak_label: \"#61bb5b\",\n peak_label_halo: \"#ffffff\",\n subplace_label: \"#757d91\",\n subplace_label_halo: \"white\",\n city_circle: \"#666666\",\n city_circle_stroke: \"white\",\n city_label: \"#787878\",\n city_label_halo: \"white\",\n state_label: \"#bdbdbd\",\n state_label_halo: \"White\",\n country_label: \"#9590aa\",\n country_label_halo: \"white\"\n};\nvar DARK = {\n hasCasings: true,\n background: \"#dddddd\",\n earth: \"#151515\",\n park: \"#1d3e2e\",\n hospital: \"#2e2226\",\n industrial: \"#20201e\",\n school: \"#193a3c\",\n wood: \"#212e25\",\n pedestrian: \"#1a1a1a\",\n scrub: \"#27362a\",\n glacier: \"#1c1c1c\",\n sand: \"#374238\",\n aerodrome: \"#000000\",\n runway: \"#000000\",\n water: \"#1e293b\",\n tunnel_other_casing: \"#ffffff\",\n tunnel_other: \"#000000\",\n tunnel_minor_casing: \"#ffffff\",\n tunnel_minor: \"#000000\",\n tunnel_medium_casing: \"#ffffff\",\n tunnel_medium: \"#000000\",\n tunnel_major_casing: \"#ffffff\",\n tunnel_major: \"#000000\",\n tunnel_highway_casing: \"#ffffff\",\n tunnel_highway: \"#000000\",\n buildings: \"#393f43\",\n other: \"#000000\",\n minor_casing: \"#222222\",\n minor: \"#000000\",\n medium_casing: \"#222222\",\n medium: \"#282828\",\n major_casing: \"#222222\",\n major: \"#2f2f2f\",\n highway_casing: \"#222222\",\n highway: \"#3b3b3b\",\n railway: \"#bbbbbb\",\n railway_tracks: \"#000000\",\n boundaries: \"#6b1001\",\n waterway_label_halo: \"#000000\",\n waterway_label: \"#ffffff\",\n bridges_other_casing: \"#ffffff\",\n bridges_other: \"#000000\",\n bridges_minor_casing: \"#ffffff\",\n bridges_minor: \"#000000\",\n bridges_medium_casing: \"#ffffff\",\n bridges_medium: \"#000000\",\n bridges_major_casing: \"#ffffff\",\n bridges_major: \"#000000\",\n bridges_highway_casing: \"#ffffff\",\n bridges_highway: \"#000000\",\n roads_label: \"#7a7a7a\",\n roads_label_halo: \"#000000\",\n ocean_label: \"#ffffff\",\n ocean_label_halo: \"#000000\",\n peak_label: \"#ffffff\",\n peak_label_halo: \"#000000\",\n subplace_label: \"#8e8e8e\",\n subplace_label_halo: \"#000000\",\n city_circle: \"#ffffff\",\n city_circle_stroke: \"#000000\",\n city_label: \"#ffffff\",\n city_label_halo: \"#000000\",\n state_label: \"#ffffff\",\n state_label_halo: \"#000000\",\n country_label: \"#ffffff\",\n country_label_halo: \"#000000\"\n};\nvar WHITE = {\n hasCasings: false,\n background: \"#fff\",\n earth: \"#fff\",\n park: \"#fafafa\",\n hospital: \"#fafafa\",\n industrial: \"#fafafa\",\n school: \"#fafafa\",\n wood: \"#fafafa\",\n pedestrian: \"#fafafa\",\n scrub: \"#fafafa\",\n glacier: \"#ffffff\",\n sand: \"#eee\",\n aerodrome: \"#eee\",\n runway: \"#eee\",\n water: \"#eeeeee\",\n tunnel_other_casing: \"#ff00ff\",\n tunnel_other: \"#c8c8c8\",\n tunnel_minor_casing: \"#ff00ff\",\n tunnel_minor: \"#c8c8c8\",\n tunnel_medium_casing: \"#ff00ff\",\n tunnel_medium: \"#c8c8c8\",\n tunnel_major_casing: \"#ff00ff\",\n tunnel_major: \"#c8c8c8\",\n tunnel_highway_casing: \"#ff00ff\",\n tunnel_highway: \"#c8c8c8\",\n buildings: \"#ffffff\",\n other: \"#c8c8c8\",\n minor_casing: \"#ff00ff\",\n minor: \"#c8c8c8\",\n medium_casing: \"#ff00ff\",\n medium: \"#c8c8c8\",\n major_casing: \"#ff00ff\",\n major: \"#c8c8c8\",\n highway_casing: \"#ff00ff\",\n highway: \"#c8c8c8\",\n railway: \"#eee\",\n railway_tracks: \"#ffffff\",\n boundaries: \"#000000\",\n waterway_label_halo: \"#ffffff\",\n waterway_label: \"#000000\",\n bridges_other_casing: \"#ff00ff\",\n bridges_other: \"#c8c8c8\",\n bridges_minor_casing: \"#ff00ff\",\n bridges_minor: \"#c8c8c8\",\n bridges_medium_casing: \"#ff00ff\",\n bridges_medium: \"#c8c8c8\",\n bridges_major_casing: \"#ff00ff\",\n bridges_major: \"#c8c8c8\",\n bridges_highway_casing: \"#ff00ff\",\n bridges_highway: \"#ffffff\",\n roads_label: \"#888\",\n roads_label_halo: \"#ffffff\",\n ocean_label: \"#aaa\",\n ocean_label_halo: \"#ffffff\",\n peak_label: \"#888\",\n peak_label_halo: \"#ffffff\",\n subplace_label: \"#888\",\n subplace_label_halo: \"#ffffff\",\n city_circle: \"#aaa\",\n city_circle_stroke: \"#ffffff\",\n city_label: \"#888\",\n city_label_halo: \"#ffffff\",\n state_label: \"#999\",\n state_label_halo: \"#ffffff\",\n country_label: \"#bbb\",\n country_label_halo: \"#ffffff\"\n};\nvar BLACK = {\n hasCasings: false,\n background: \"#000000\",\n earth: \"#000000\",\n park: \"#060606\",\n hospital: \"#060606\",\n industrial: \"#060606\",\n school: \"#060606\",\n wood: \"#060606\",\n pedestrian: \"#060606\",\n scrub: \"#060606\",\n glacier: \"#060606\",\n sand: \"#060606\",\n aerodrome: \"#060606\",\n runway: \"#060606\",\n water: \"#333\",\n tunnel_other_casing: \"#ff00ff\",\n tunnel_other: \"#222\",\n tunnel_minor_casing: \"#ff00ff\",\n tunnel_minor: \"#222\",\n tunnel_medium_casing: \"#ff00ff\",\n tunnel_medium: \"#222\",\n tunnel_major_casing: \"#ff00ff\",\n tunnel_major: \"#222\",\n tunnel_highway_casing: \"#ff00ff\",\n tunnel_highway: \"#222\",\n buildings: \"#101010\",\n other: \"#000000\",\n minor_casing: \"#ff00ff\",\n minor: \"#222\",\n medium_casing: \"#ff00ff\",\n medium: \"#222\",\n major_casing: \"#ff00ff\",\n major: \"#222\",\n highway_casing: \"#ff00ff\",\n highway: \"#222\",\n railway: \"#121212\",\n railway_tracks: \"#121212\",\n boundaries: \"#555\",\n waterway_label_halo: \"#333\",\n waterway_label: \"#888\",\n bridges_other_casing: \"#ff00ff\",\n bridges_other: \"#222\",\n bridges_minor_casing: \"#ff00ff\",\n bridges_minor: \"#222\",\n bridges_medium_casing: \"#ff00ff\",\n bridges_medium: \"#222\",\n bridges_major_casing: \"#ff00ff\",\n bridges_major: \"#222\",\n bridges_highway_casing: \"#ff00ff\",\n bridges_highway: \"#222\",\n roads_label: \"#666\",\n roads_label_halo: \"#000\",\n ocean_label: \"#666\",\n ocean_label_halo: \"#333\",\n peak_label: \"#777\",\n peak_label_halo: \"#000000\",\n subplace_label: \"#777\",\n subplace_label_halo: \"#000000\",\n city_circle: \"#777\",\n city_circle_stroke: \"#000000\",\n city_label: \"#777\",\n city_label_halo: \"#000000\",\n state_label: \"#555\",\n state_label_halo: \"#000000\",\n country_label: \"#555\",\n country_label_halo: \"#000000\"\n};\nvar GRAYSCALE = {\n hasCasings: false,\n background: \"#eee\",\n earth: \"#eee\",\n park: \"#e8e8e8\",\n hospital: \"#e8e8e8\",\n industrial: \"#e8e8e8\",\n school: \"#e8e8e8\",\n wood: \"#e8e8e8\",\n pedestrian: \"#e8e8e8\",\n scrub: \"#e8e8e8\",\n glacier: \"#e8e8e8\",\n sand: \"#e8e8e8\",\n aerodrome: \"#e8e8e8\",\n runway: \"#e8e8e8\",\n water: \"#ddd\",\n tunnel_other_casing: \"#ff00ff\",\n tunnel_other: \"#ffffff\",\n tunnel_minor_casing: \"#ff00ff\",\n tunnel_minor: \"#ffffff\",\n tunnel_medium_casing: \"#ff00ff\",\n tunnel_medium: \"#ffffff\",\n tunnel_major_casing: \"#ff00ff\",\n tunnel_major: \"#ffffff\",\n tunnel_highway_casing: \"#ff00ff\",\n tunnel_highway: \"#ffffff\",\n buildings: \"#ffffff\",\n other: \"#fff\",\n minor_casing: \"#ff00ff\",\n minor: \"#fff\",\n medium_casing: \"#ff00ff\",\n medium: \"#fff\",\n major_casing: \"#ff00ff\",\n major: \"#fff\",\n highway_casing: \"#ff00ff\",\n highway: \"#fff\",\n railway: \"#fff\",\n railway_tracks: \"#eee\",\n boundaries: \"#666\",\n waterway_label_halo: \"#bbbbbb\",\n waterway_label: \"#ffffff\",\n bridges_other_casing: \"#ff00ff\",\n bridges_other: \"#ffffff\",\n bridges_minor_casing: \"#ff00ff\",\n bridges_minor: \"#ffffff\",\n bridges_medium_casing: \"#ff00ff\",\n bridges_medium: \"#ffffff\",\n bridges_major_casing: \"#ff00ff\",\n bridges_major: \"#ffffff\",\n bridges_highway_casing: \"#ff00ff\",\n bridges_highway: \"#ffffff\",\n roads_label: \"#888\",\n roads_label_halo: \"#ffffff\",\n ocean_label: \"#666\",\n ocean_label_halo: \"#ffffff\",\n peak_label: \"#000000\",\n peak_label_halo: \"#ffffff\",\n subplace_label: \"#888\",\n subplace_label_halo: \"#ffffff\",\n city_circle: \"#666\",\n city_circle_stroke: \"#ffffff\",\n city_label: \"#888\",\n city_label_halo: \"#ffffff\",\n state_label: \"#888\",\n state_label_halo: \"#ffffff\",\n country_label: \"#888\",\n country_label_halo: \"#ffffff\"\n};\nvar colors_default = {\n light: LIGHT,\n dark: DARK,\n white: WHITE,\n black: BLACK,\n grayscale: GRAYSCALE\n};\n\n// src/index.ts\nfunction src_default(source, variant) {\n if (variant == \"debug\")\n return debug_layers_default(source);\n let theme = colors_default[variant];\n return nolabels_layers(source, theme).concat(labels_layers(source, theme));\n}\nfunction noLabels(source, variant) {\n let theme = colors_default[variant];\n return nolabels_layers(source, theme);\n}\nfunction labels(source, variant) {\n let theme = colors_default[variant];\n return labels_layers(source, theme);\n}\nexport {\n src_default as default,\n labels,\n noLabels\n};\n", "var __async = (__this, __arguments, generator) => {\n return new Promise((resolve, reject) => {\n var fulfilled = (value) => {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n };\n var rejected = (value) => {\n try {\n step(generator.throw(value));\n } catch (e) {\n reject(e);\n }\n };\n var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);\n step((generator = generator.apply(__this, __arguments)).next());\n });\n};\n\n// node_modules/fflate/esm/browser.js\nvar u8 = Uint8Array;\nvar u16 = Uint16Array;\nvar i32 = Int32Array;\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0]);\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0]);\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\nvar freb = function(eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n var r = new i32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = j - b[i] << 5 | i;\n }\n }\n return { b, r };\n};\nvar _a = freb(fleb, 2);\nvar fl = _a.b;\nvar revfl = _a.r;\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0);\nvar fd = _b.b;\nvar revfd = _b.r;\nvar rev = new u16(32768);\nfor (i = 0; i < 32768; ++i) {\n x = (i & 43690) >> 1 | (i & 21845) << 1;\n x = (x & 52428) >> 2 | (x & 13107) << 2;\n x = (x & 61680) >> 4 | (x & 3855) << 4;\n rev[i] = ((x & 65280) >> 8 | (x & 255) << 8) >> 1;\n}\nvar x;\nvar i;\nvar hMap = function(cd, mb, r) {\n var s = cd.length;\n var i = 0;\n var l = new u16(mb);\n for (; i < s; ++i) {\n if (cd[i])\n ++l[cd[i] - 1];\n }\n var le = new u16(mb);\n for (i = 1; i < mb; ++i) {\n le[i] = le[i - 1] + l[i - 1] << 1;\n }\n var co;\n if (r) {\n co = new u16(1 << mb);\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n var sv = i << 4 | cd[i];\n var r_1 = mb - cd[i];\n var v = le[cd[i] - 1]++ << r_1;\n for (var m = v | (1 << r_1) - 1; v <= m; ++v) {\n co[rev[v] >> rvb] = sv;\n }\n }\n }\n } else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >> 15 - cd[i];\n }\n }\n }\n return co;\n};\nvar flt = new u8(288);\nfor (i = 0; i < 144; ++i)\n flt[i] = 8;\nvar i;\nfor (i = 144; i < 256; ++i)\n flt[i] = 9;\nvar i;\nfor (i = 256; i < 280; ++i)\n flt[i] = 7;\nvar i;\nfor (i = 280; i < 288; ++i)\n flt[i] = 8;\nvar i;\nvar fdt = new u8(32);\nfor (i = 0; i < 32; ++i)\n fdt[i] = 5;\nvar i;\nvar flrm = /* @__PURE__ */ hMap(flt, 9, 1);\nvar fdrm = /* @__PURE__ */ hMap(fdt, 5, 1);\nvar max = function(a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\nvar bits = function(d, p, m) {\n var o = p / 8 | 0;\n return (d[o] | d[o + 1] << 8) >> (p & 7) & m;\n};\nvar bits16 = function(d, p) {\n var o = p / 8 | 0;\n return (d[o] | d[o + 1] << 8 | d[o + 2] << 16) >> (p & 7);\n};\nvar shft = function(p) {\n return (p + 7) / 8 | 0;\n};\nvar slc = function(v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n var n = new u8(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\nvar ec = [\n \"unexpected EOF\",\n \"invalid block type\",\n \"invalid length/literal\",\n \"invalid distance\",\n \"stream finished\",\n \"no stream handler\",\n ,\n \"no callback\",\n \"invalid UTF-8 data\",\n \"extra field too long\",\n \"date not in range 1980-2099\",\n \"filename too long\",\n \"stream finishing\",\n \"invalid zip data\"\n];\nvar err = function(ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\nvar inflt = function(dat, st, buf, dict) {\n var sl = dat.length, dl = dict ? dict.length : 0;\n if (!sl || st.f && !st.l)\n return buf || new u8(0);\n var noBuf = !buf || st.i != 2;\n var noSt = st.i;\n if (!buf)\n buf = new u8(sl * 3);\n var cbuf = function(l2) {\n var bl = buf.length;\n if (l2 > bl) {\n var nbuf = new u8(Math.max(bl * 2, l2));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n var tbts = sl * 8;\n do {\n if (!lm) {\n final = bits(dat, pos, 1);\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n var s = shft(pos) + 4, l = dat[s - 4] | dat[s - 3] << 8, t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n if (noBuf)\n cbuf(bt + l);\n buf.set(dat.subarray(s, t), bt);\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n } else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n var ldt = new u8(tl);\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl; ) {\n var r = clm[bits(dat, pos, clbmsk)];\n pos += r & 15;\n var s = r >> 4;\n if (s < 16) {\n ldt[i++] = s;\n } else {\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n lbt = max(lt);\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n } else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (; ; lpos = pos) {\n var c = lm[bits16(dat, pos) & lms], sym = c >> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n } else {\n var add = sym - 254;\n if (sym > 264) {\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n var d = dm[bits16(dat, pos) & dms], dsym = d >> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & (1 << b) - 1, pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n if (bt < dt) {\n var shift2 = dl - dt, dend = Math.min(dt, end);\n if (shift2 + bt < 0)\n err(3);\n for (; bt < dend; ++bt)\n buf[bt] = dict[shift2 + bt];\n }\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\nvar et = /* @__PURE__ */ new u8(0);\nvar gzs = function(d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, \"invalid gzip data\");\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += (d[10] | d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\nvar gzl = function(d) {\n var l = d.length;\n return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16 | d[l - 1] << 24) >>> 0;\n};\nvar zls = function(d, dict) {\n if ((d[0] & 15) != 8 || d[0] >> 4 > 7 || (d[0] << 8 | d[1]) % 31)\n err(6, \"invalid zlib data\");\n if ((d[1] >> 5 & 1) == +!dict)\n err(6, \"invalid zlib data: \" + (d[1] & 32 ? \"need\" : \"unexpected\") + \" dictionary\");\n return (d[1] >> 3 & 4) + 2;\n};\nfunction inflateSync(data, opts) {\n return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary);\n}\nfunction gunzipSync(data, opts) {\n var st = gzs(data);\n if (st + 8 > data.length)\n err(6, \"invalid gzip data\");\n return inflt(data.subarray(st, -8), { i: 2 }, opts && opts.out || new u8(gzl(data)), opts && opts.dictionary);\n}\nfunction unzlibSync(data, opts) {\n return inflt(data.subarray(zls(data, opts && opts.dictionary), -4), { i: 2 }, opts && opts.out, opts && opts.dictionary);\n}\nfunction decompressSync(data, opts) {\n return data[0] == 31 && data[1] == 139 && data[2] == 8 ? gunzipSync(data, opts) : (data[0] & 15) != 8 || data[0] >> 4 > 7 || (data[0] << 8 | data[1]) % 31 ? inflateSync(data, opts) : unzlibSync(data, opts);\n}\nvar td = typeof TextDecoder != \"undefined\" && /* @__PURE__ */ new TextDecoder();\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n} catch (e) {\n}\n\n// v2.ts\nvar shift = (n, shift2) => {\n return n * Math.pow(2, shift2);\n};\nvar unshift = (n, shift2) => {\n return Math.floor(n / Math.pow(2, shift2));\n};\nvar getUint24 = (view, pos) => {\n return shift(view.getUint16(pos + 1, true), 8) + view.getUint8(pos);\n};\nvar getUint48 = (view, pos) => {\n return shift(view.getUint32(pos + 2, true), 16) + view.getUint16(pos, true);\n};\nvar compare = (tz, tx, ty, view, i) => {\n if (tz != view.getUint8(i))\n return tz - view.getUint8(i);\n const x = getUint24(view, i + 1);\n if (tx != x)\n return tx - x;\n const y = getUint24(view, i + 4);\n if (ty != y)\n return ty - y;\n return 0;\n};\nvar queryLeafdir = (view, z, x, y) => {\n const offset_len = queryView(view, z | 128, x, y);\n if (offset_len) {\n return {\n z,\n x,\n y,\n offset: offset_len[0],\n length: offset_len[1],\n is_dir: true\n };\n }\n return null;\n};\nvar queryTile = (view, z, x, y) => {\n const offset_len = queryView(view, z, x, y);\n if (offset_len) {\n return {\n z,\n x,\n y,\n offset: offset_len[0],\n length: offset_len[1],\n is_dir: false\n };\n }\n return null;\n};\nvar queryView = (view, z, x, y) => {\n let m = 0;\n let n = view.byteLength / 17 - 1;\n while (m <= n) {\n const k = n + m >> 1;\n const cmp = compare(z, x, y, view, k * 17);\n if (cmp > 0) {\n m = k + 1;\n } else if (cmp < 0) {\n n = k - 1;\n } else {\n return [getUint48(view, k * 17 + 7), view.getUint32(k * 17 + 13, true)];\n }\n }\n return null;\n};\nvar entrySort = (a, b) => {\n if (a.is_dir && !b.is_dir) {\n return 1;\n }\n if (!a.is_dir && b.is_dir) {\n return -1;\n }\n if (a.z !== b.z) {\n return a.z - b.z;\n }\n if (a.x !== b.x) {\n return a.x - b.x;\n }\n return a.y - b.y;\n};\nvar parseEntry = (dataview, i) => {\n const z_raw = dataview.getUint8(i * 17);\n const z = z_raw & 127;\n return {\n z,\n x: getUint24(dataview, i * 17 + 1),\n y: getUint24(dataview, i * 17 + 4),\n offset: getUint48(dataview, i * 17 + 7),\n length: dataview.getUint32(i * 17 + 13, true),\n is_dir: z_raw >> 7 === 1\n };\n};\nvar sortDir = (a) => {\n const entries = [];\n const view = new DataView(a);\n for (let i = 0; i < view.byteLength / 17; i++) {\n entries.push(parseEntry(view, i));\n }\n return createDirectory(entries);\n};\nvar createDirectory = (entries) => {\n entries.sort(entrySort);\n const buffer = new ArrayBuffer(17 * entries.length);\n const arr = new Uint8Array(buffer);\n for (let i = 0; i < entries.length; i++) {\n const entry = entries[i];\n let z = entry.z;\n if (entry.is_dir)\n z = z | 128;\n arr[i * 17] = z;\n arr[i * 17 + 1] = entry.x & 255;\n arr[i * 17 + 2] = entry.x >> 8 & 255;\n arr[i * 17 + 3] = entry.x >> 16 & 255;\n arr[i * 17 + 4] = entry.y & 255;\n arr[i * 17 + 5] = entry.y >> 8 & 255;\n arr[i * 17 + 6] = entry.y >> 16 & 255;\n arr[i * 17 + 7] = entry.offset & 255;\n arr[i * 17 + 8] = unshift(entry.offset, 8) & 255;\n arr[i * 17 + 9] = unshift(entry.offset, 16) & 255;\n arr[i * 17 + 10] = unshift(entry.offset, 24) & 255;\n arr[i * 17 + 11] = unshift(entry.offset, 32) & 255;\n arr[i * 17 + 12] = unshift(entry.offset, 48) & 255;\n arr[i * 17 + 13] = entry.length & 255;\n arr[i * 17 + 14] = entry.length >> 8 & 255;\n arr[i * 17 + 15] = entry.length >> 16 & 255;\n arr[i * 17 + 16] = entry.length >> 24 & 255;\n }\n return buffer;\n};\nvar deriveLeaf = (view, tile) => {\n if (view.byteLength < 17)\n return null;\n const numEntries = view.byteLength / 17;\n const entry = parseEntry(view, numEntries - 1);\n if (entry.is_dir) {\n const leaf_level = entry.z;\n const level_diff = tile.z - leaf_level;\n const leaf_x = Math.trunc(tile.x / (1 << level_diff));\n const leaf_y = Math.trunc(tile.y / (1 << level_diff));\n return { z: leaf_level, x: leaf_x, y: leaf_y };\n }\n return null;\n};\nfunction getHeader(source) {\n return __async(this, null, function* () {\n const resp = yield source.getBytes(0, 512e3);\n const dataview = new DataView(resp.data);\n const json_size = dataview.getUint32(4, true);\n const root_entries = dataview.getUint16(8, true);\n const dec = new TextDecoder(\"utf-8\");\n const json_metadata = JSON.parse(\n dec.decode(new DataView(resp.data, 10, json_size))\n );\n let tile_compression = 0 /* Unknown */;\n if (json_metadata.compression === \"gzip\") {\n tile_compression = 2 /* Gzip */;\n }\n let minzoom = 0;\n if (\"minzoom\" in json_metadata) {\n minzoom = +json_metadata.minzoom;\n }\n let maxzoom = 0;\n if (\"maxzoom\" in json_metadata) {\n maxzoom = +json_metadata.maxzoom;\n }\n let center_lon = 0;\n let center_lat = 0;\n let center_zoom = 0;\n let min_lon = -180;\n let min_lat = -85;\n let max_lon = 180;\n let max_lat = 85;\n if (json_metadata.bounds) {\n const split = json_metadata.bounds.split(\",\");\n min_lon = +split[0];\n min_lat = +split[1];\n max_lon = +split[2];\n max_lat = +split[3];\n }\n if (json_metadata.center) {\n const split = json_metadata.center.split(\",\");\n center_lon = +split[0];\n center_lat = +split[1];\n center_zoom = +split[2];\n }\n const header = {\n specVersion: dataview.getUint16(2, true),\n rootDirectoryOffset: 10 + json_size,\n rootDirectoryLength: root_entries * 17,\n jsonMetadataOffset: 10,\n jsonMetadataLength: json_size,\n leafDirectoryOffset: 0,\n leafDirectoryLength: void 0,\n tileDataOffset: 0,\n tileDataLength: void 0,\n numAddressedTiles: 0,\n numTileEntries: 0,\n numTileContents: 0,\n clustered: false,\n internalCompression: 1 /* None */,\n tileCompression: tile_compression,\n tileType: 1 /* Mvt */,\n minZoom: minzoom,\n maxZoom: maxzoom,\n minLon: min_lon,\n minLat: min_lat,\n maxLon: max_lon,\n maxLat: max_lat,\n centerZoom: center_zoom,\n centerLon: center_lon,\n centerLat: center_lat,\n etag: resp.etag\n };\n return header;\n });\n}\nfunction getZxy(header, source, cache, z, x, y, signal) {\n return __async(this, null, function* () {\n let root_dir = yield cache.getArrayBuffer(\n source,\n header.rootDirectoryOffset,\n header.rootDirectoryLength,\n header\n );\n if (header.specVersion === 1) {\n root_dir = sortDir(root_dir);\n }\n const entry = queryTile(new DataView(root_dir), z, x, y);\n if (entry) {\n const resp = yield source.getBytes(entry.offset, entry.length, signal);\n let tile_data = resp.data;\n const view = new DataView(tile_data);\n if (view.getUint8(0) == 31 && view.getUint8(1) == 139) {\n tile_data = decompressSync(new Uint8Array(tile_data));\n }\n return {\n data: tile_data\n };\n }\n const leafcoords = deriveLeaf(new DataView(root_dir), { z, x, y });\n if (leafcoords) {\n const leafdir_entry = queryLeafdir(\n new DataView(root_dir),\n leafcoords.z,\n leafcoords.x,\n leafcoords.y\n );\n if (leafdir_entry) {\n let leaf_dir = yield cache.getArrayBuffer(\n source,\n leafdir_entry.offset,\n leafdir_entry.length,\n header\n );\n if (header.specVersion === 1) {\n leaf_dir = sortDir(leaf_dir);\n }\n const tile_entry = queryTile(new DataView(leaf_dir), z, x, y);\n if (tile_entry) {\n const resp = yield source.getBytes(\n tile_entry.offset,\n tile_entry.length,\n signal\n );\n let tile_data = resp.data;\n const view = new DataView(tile_data);\n if (view.getUint8(0) == 31 && view.getUint8(1) == 139) {\n tile_data = decompressSync(new Uint8Array(tile_data));\n }\n return {\n data: tile_data\n };\n }\n }\n }\n return void 0;\n });\n}\nvar v2_default = {\n getHeader,\n getZxy\n};\n\n// adapters.ts\nvar leafletRasterLayer = (source, options) => {\n let loaded = false;\n let mimeType = \"\";\n const cls = L.GridLayer.extend({\n createTile: function(coord, done) {\n const el = document.createElement(\"img\");\n const controller = new AbortController();\n const signal = controller.signal;\n el.cancel = () => {\n controller.abort();\n };\n if (!loaded) {\n source.getHeader().then((header) => {\n if (header.tileType == 1 /* Mvt */) {\n console.error(\n \"Error: archive contains MVT vector tiles, but leafletRasterLayer is for displaying raster tiles. See https://github.com/protomaps/PMTiles/tree/main/js for details.\"\n );\n } else if (header.tileType == 2) {\n mimeType = \"image/png\";\n } else if (header.tileType == 3) {\n mimeType = \"image/jpeg\";\n } else if (header.tileType == 4) {\n mimeType = \"image/webp\";\n } else if (header.tileType == 5) {\n mimeType = \"image/avif\";\n }\n });\n loaded = true;\n }\n source.getZxy(coord.z, coord.x, coord.y, signal).then((arr) => {\n if (arr) {\n const blob = new Blob([arr.data], { type: mimeType });\n const imageUrl = window.URL.createObjectURL(blob);\n el.src = imageUrl;\n el.cancel = null;\n done(null, el);\n }\n }).catch((e) => {\n if (e.name !== \"AbortError\") {\n throw e;\n }\n });\n return el;\n },\n _removeTile: function(key) {\n const tile = this._tiles[key];\n if (!tile) {\n return;\n }\n if (tile.el.cancel)\n tile.el.cancel();\n tile.el.width = 0;\n tile.el.height = 0;\n tile.el.deleted = true;\n L.DomUtil.remove(tile.el);\n delete this._tiles[key];\n this.fire(\"tileunload\", {\n tile: tile.el,\n coords: this._keyToTileCoords(key)\n });\n }\n });\n return new cls(options);\n};\nvar Protocol = class {\n constructor() {\n this.tile = (params, callback) => {\n if (params.type == \"json\") {\n const pmtiles_url = params.url.substr(10);\n let instance = this.tiles.get(pmtiles_url);\n if (!instance) {\n instance = new PMTiles(pmtiles_url);\n this.tiles.set(pmtiles_url, instance);\n }\n instance.getHeader().then((h) => {\n const tilejson = {\n tiles: [params.url + \"/{z}/{x}/{y}\"],\n minzoom: h.minZoom,\n maxzoom: h.maxZoom,\n bounds: [h.minLon, h.minLat, h.maxLon, h.maxLat]\n };\n callback(null, tilejson, null, null);\n }).catch((e) => {\n callback(e, null, null, null);\n });\n return {\n cancel: () => {\n }\n };\n } else {\n const re = new RegExp(/pmtiles:\\/\\/(.+)\\/(\\d+)\\/(\\d+)\\/(\\d+)/);\n const result = params.url.match(re);\n if (!result) {\n throw new Error(\"Invalid PMTiles protocol URL\");\n return {\n cancel: () => {\n }\n };\n }\n const pmtiles_url = result[1];\n let instance = this.tiles.get(pmtiles_url);\n if (!instance) {\n instance = new PMTiles(pmtiles_url);\n this.tiles.set(pmtiles_url, instance);\n }\n const z = result[2];\n const x = result[3];\n const y = result[4];\n const controller = new AbortController();\n const signal = controller.signal;\n let cancel = () => {\n controller.abort();\n };\n instance.getHeader().then((header) => {\n instance.getZxy(+z, +x, +y, signal).then((resp) => {\n if (resp) {\n callback(\n null,\n new Uint8Array(resp.data),\n resp.cacheControl,\n resp.expires\n );\n } else {\n if (header.tileType == 1 /* Mvt */) {\n callback(null, new Uint8Array(), null, null);\n } else {\n callback(null, null, null, null);\n }\n }\n }).catch((e) => {\n if (e.name !== \"AbortError\") {\n callback(e, null, null, null);\n }\n });\n });\n return {\n cancel\n };\n }\n };\n this.tiles = /* @__PURE__ */ new Map();\n }\n add(p) {\n this.tiles.set(p.source.getKey(), p);\n }\n get(url) {\n return this.tiles.get(url);\n }\n};\n\n// index.ts\nfunction toNum(low, high) {\n return (high >>> 0) * 4294967296 + (low >>> 0);\n}\nfunction readVarintRemainder(l, p) {\n const buf = p.buf;\n let h, b;\n b = buf[p.pos++];\n h = (b & 112) >> 4;\n if (b < 128)\n return toNum(l, h);\n b = buf[p.pos++];\n h |= (b & 127) << 3;\n if (b < 128)\n return toNum(l, h);\n b = buf[p.pos++];\n h |= (b & 127) << 10;\n if (b < 128)\n return toNum(l, h);\n b = buf[p.pos++];\n h |= (b & 127) << 17;\n if (b < 128)\n return toNum(l, h);\n b = buf[p.pos++];\n h |= (b & 127) << 24;\n if (b < 128)\n return toNum(l, h);\n b = buf[p.pos++];\n h |= (b & 1) << 31;\n if (b < 128)\n return toNum(l, h);\n throw new Error(\"Expected varint not more than 10 bytes\");\n}\nfunction readVarint(p) {\n const buf = p.buf;\n let val, b;\n b = buf[p.pos++];\n val = b & 127;\n if (b < 128)\n return val;\n b = buf[p.pos++];\n val |= (b & 127) << 7;\n if (b < 128)\n return val;\n b = buf[p.pos++];\n val |= (b & 127) << 14;\n if (b < 128)\n return val;\n b = buf[p.pos++];\n val |= (b & 127) << 21;\n if (b < 128)\n return val;\n b = buf[p.pos];\n val |= (b & 15) << 28;\n return readVarintRemainder(val, p);\n}\nfunction rotate(n, xy, rx, ry) {\n if (ry == 0) {\n if (rx == 1) {\n xy[0] = n - 1 - xy[0];\n xy[1] = n - 1 - xy[1];\n }\n const t = xy[0];\n xy[0] = xy[1];\n xy[1] = t;\n }\n}\nfunction idOnLevel(z, pos) {\n const n = Math.pow(2, z);\n let rx = pos;\n let ry = pos;\n let t = pos;\n const xy = [0, 0];\n let s = 1;\n while (s < n) {\n rx = 1 & t / 2;\n ry = 1 & (t ^ rx);\n rotate(s, xy, rx, ry);\n xy[0] += s * rx;\n xy[1] += s * ry;\n t = t / 4;\n s *= 2;\n }\n return [z, xy[0], xy[1]];\n}\nvar tzValues = [\n 0,\n 1,\n 5,\n 21,\n 85,\n 341,\n 1365,\n 5461,\n 21845,\n 87381,\n 349525,\n 1398101,\n 5592405,\n 22369621,\n 89478485,\n 357913941,\n 1431655765,\n 5726623061,\n 22906492245,\n 91625968981,\n 366503875925,\n 1466015503701,\n 5864062014805,\n 23456248059221,\n 93824992236885,\n 375299968947541,\n 1501199875790165\n];\nfunction zxyToTileId(z, x, y) {\n if (z > 26) {\n throw Error(\"Tile zoom level exceeds max safe number limit (26)\");\n }\n if (x > Math.pow(2, z) - 1 || y > Math.pow(2, z) - 1) {\n throw Error(\"tile x/y outside zoom level bounds\");\n }\n const acc = tzValues[z];\n const n = Math.pow(2, z);\n let rx = 0;\n let ry = 0;\n let d = 0;\n const xy = [x, y];\n let s = n / 2;\n while (s > 0) {\n rx = (xy[0] & s) > 0 ? 1 : 0;\n ry = (xy[1] & s) > 0 ? 1 : 0;\n d += s * s * (3 * rx ^ ry);\n rotate(s, xy, rx, ry);\n s = s / 2;\n }\n return acc + d;\n}\nfunction tileIdToZxy(i) {\n let acc = 0;\n let z = 0;\n for (let z2 = 0; z2 < 27; z2++) {\n const num_tiles = (1 << z2) * (1 << z2);\n if (acc + num_tiles > i) {\n return idOnLevel(z2, i - acc);\n }\n acc += num_tiles;\n }\n throw Error(\"Tile zoom level exceeds max safe number limit (26)\");\n}\nvar Compression = /* @__PURE__ */ ((Compression2) => {\n Compression2[Compression2[\"Unknown\"] = 0] = \"Unknown\";\n Compression2[Compression2[\"None\"] = 1] = \"None\";\n Compression2[Compression2[\"Gzip\"] = 2] = \"Gzip\";\n Compression2[Compression2[\"Brotli\"] = 3] = \"Brotli\";\n Compression2[Compression2[\"Zstd\"] = 4] = \"Zstd\";\n return Compression2;\n})(Compression || {});\nfunction defaultDecompress(buf, compression) {\n return __async(this, null, function* () {\n if (compression === 1 /* None */ || compression === 0 /* Unknown */) {\n return buf;\n } else if (compression === 2 /* Gzip */) {\n if (typeof globalThis.DecompressionStream == \"undefined\") {\n return decompressSync(new Uint8Array(buf));\n } else {\n let stream = new Response(buf).body;\n let result = stream.pipeThrough(\n new globalThis.DecompressionStream(\"gzip\")\n );\n return new Response(result).arrayBuffer();\n }\n } else {\n throw Error(\"Compression method not supported\");\n }\n });\n}\nvar TileType = /* @__PURE__ */ ((TileType2) => {\n TileType2[TileType2[\"Unknown\"] = 0] = \"Unknown\";\n TileType2[TileType2[\"Mvt\"] = 1] = \"Mvt\";\n TileType2[TileType2[\"Png\"] = 2] = \"Png\";\n TileType2[TileType2[\"Jpeg\"] = 3] = \"Jpeg\";\n TileType2[TileType2[\"Webp\"] = 4] = \"Webp\";\n TileType2[TileType2[\"Avif\"] = 5] = \"Avif\";\n return TileType2;\n})(TileType || {});\nvar HEADER_SIZE_BYTES = 127;\nfunction findTile(entries, tileId) {\n let m = 0;\n let n = entries.length - 1;\n while (m <= n) {\n const k = n + m >> 1;\n const cmp = tileId - entries[k].tileId;\n if (cmp > 0) {\n m = k + 1;\n } else if (cmp < 0) {\n n = k - 1;\n } else {\n return entries[k];\n }\n }\n if (n >= 0) {\n if (entries[n].runLength === 0) {\n return entries[n];\n }\n if (tileId - entries[n].tileId < entries[n].runLength) {\n return entries[n];\n }\n }\n return null;\n}\nvar FileAPISource = class {\n constructor(file) {\n this.file = file;\n }\n getKey() {\n return this.file.name;\n }\n getBytes(offset, length) {\n return __async(this, null, function* () {\n const blob = this.file.slice(offset, offset + length);\n const a = yield blob.arrayBuffer();\n return { data: a };\n });\n }\n};\nvar FetchSource = class {\n constructor(url, customHeaders = new Headers()) {\n this.url = url;\n this.customHeaders = customHeaders;\n }\n getKey() {\n return this.url;\n }\n setHeaders(customHeaders) {\n this.customHeaders = customHeaders;\n }\n getBytes(offset, length, signal) {\n return __async(this, null, function* () {\n let controller;\n if (!signal) {\n controller = new AbortController();\n signal = controller.signal;\n }\n const requestHeaders = new Headers(this.customHeaders);\n requestHeaders.set(\n \"Range\",\n \"bytes=\" + offset + \"-\" + (offset + length - 1)\n );\n let resp = yield fetch(this.url, {\n signal,\n headers: requestHeaders\n });\n if (resp.status === 416 && offset === 0) {\n const content_range = resp.headers.get(\"Content-Range\");\n if (!content_range || !content_range.startsWith(\"bytes */\")) {\n throw Error(\"Missing content-length on 416 response\");\n }\n const actual_length = +content_range.substr(8);\n resp = yield fetch(this.url, {\n signal,\n headers: { Range: \"bytes=0-\" + (actual_length - 1) }\n });\n }\n if (resp.status >= 300) {\n throw Error(\"Bad response code: \" + resp.status);\n }\n const content_length = resp.headers.get(\"Content-Length\");\n if (resp.status === 200 && (!content_length || +content_length > length)) {\n if (controller)\n controller.abort();\n throw Error(\n \"Server returned no content-length header or content-length exceeding request. Check that your storage backend supports HTTP Byte Serving.\"\n );\n }\n const a = yield resp.arrayBuffer();\n return {\n data: a,\n etag: resp.headers.get(\"ETag\") || void 0,\n cacheControl: resp.headers.get(\"Cache-Control\") || void 0,\n expires: resp.headers.get(\"Expires\") || void 0\n };\n });\n }\n};\nfunction getUint64(v, offset) {\n const wh = v.getUint32(offset + 4, true);\n const wl = v.getUint32(offset + 0, true);\n return wh * Math.pow(2, 32) + wl;\n}\nfunction bytesToHeader(bytes, etag) {\n const v = new DataView(bytes);\n const spec_version = v.getUint8(7);\n if (spec_version > 3) {\n throw Error(\n `Archive is spec version ${spec_version} but this library supports up to spec version 3`\n );\n }\n return {\n specVersion: spec_version,\n rootDirectoryOffset: getUint64(v, 8),\n rootDirectoryLength: getUint64(v, 16),\n jsonMetadataOffset: getUint64(v, 24),\n jsonMetadataLength: getUint64(v, 32),\n leafDirectoryOffset: getUint64(v, 40),\n leafDirectoryLength: getUint64(v, 48),\n tileDataOffset: getUint64(v, 56),\n tileDataLength: getUint64(v, 64),\n numAddressedTiles: getUint64(v, 72),\n numTileEntries: getUint64(v, 80),\n numTileContents: getUint64(v, 88),\n clustered: v.getUint8(96) === 1,\n internalCompression: v.getUint8(97),\n tileCompression: v.getUint8(98),\n tileType: v.getUint8(99),\n minZoom: v.getUint8(100),\n maxZoom: v.getUint8(101),\n minLon: v.getInt32(102, true) / 1e7,\n minLat: v.getInt32(106, true) / 1e7,\n maxLon: v.getInt32(110, true) / 1e7,\n maxLat: v.getInt32(114, true) / 1e7,\n centerZoom: v.getUint8(118),\n centerLon: v.getInt32(119, true) / 1e7,\n centerLat: v.getInt32(123, true) / 1e7,\n etag\n };\n}\nfunction deserializeIndex(buffer) {\n const p = { buf: new Uint8Array(buffer), pos: 0 };\n const numEntries = readVarint(p);\n const entries = [];\n let lastId = 0;\n for (let i = 0; i < numEntries; i++) {\n const v = readVarint(p);\n entries.push({ tileId: lastId + v, offset: 0, length: 0, runLength: 1 });\n lastId += v;\n }\n for (let i = 0; i < numEntries; i++) {\n entries[i].runLength = readVarint(p);\n }\n for (let i = 0; i < numEntries; i++) {\n entries[i].length = readVarint(p);\n }\n for (let i = 0; i < numEntries; i++) {\n const v = readVarint(p);\n if (v === 0 && i > 0) {\n entries[i].offset = entries[i - 1].offset + entries[i - 1].length;\n } else {\n entries[i].offset = v - 1;\n }\n }\n return entries;\n}\nfunction detectVersion(a) {\n const v = new DataView(a);\n if (v.getUint16(2, true) === 2) {\n console.warn(\n \"PMTiles spec version 2 has been deprecated; please see github.com/protomaps/PMTiles for tools to upgrade\"\n );\n return 2;\n } else if (v.getUint16(2, true) === 1) {\n console.warn(\n \"PMTiles spec version 1 has been deprecated; please see github.com/protomaps/PMTiles for tools to upgrade\"\n );\n return 1;\n }\n return 3;\n}\nvar EtagMismatch = class extends Error {\n};\nfunction getHeaderAndRoot(source, decompress, prefetch, current_etag) {\n return __async(this, null, function* () {\n const resp = yield source.getBytes(0, 16384);\n const v = new DataView(resp.data);\n if (v.getUint16(0, true) !== 19792) {\n throw new Error(\"Wrong magic number for PMTiles archive\");\n }\n if (detectVersion(resp.data) < 3) {\n return [yield v2_default.getHeader(source)];\n }\n const headerData = resp.data.slice(0, HEADER_SIZE_BYTES);\n let resp_etag = resp.etag;\n if (current_etag && resp.etag != current_etag) {\n console.warn(\n \"ETag conflict detected; your HTTP server might not support content-based ETag headers. ETags disabled for \" + source.getKey()\n );\n resp_etag = void 0;\n }\n const header = bytesToHeader(headerData, resp_etag);\n if (prefetch) {\n const rootDirData = resp.data.slice(\n header.rootDirectoryOffset,\n header.rootDirectoryOffset + header.rootDirectoryLength\n );\n const dirKey = source.getKey() + \"|\" + (header.etag || \"\") + \"|\" + header.rootDirectoryOffset + \"|\" + header.rootDirectoryLength;\n const rootDir = deserializeIndex(\n yield decompress(rootDirData, header.internalCompression)\n );\n return [header, [dirKey, rootDir.length, rootDir]];\n }\n return [header, void 0];\n });\n}\nfunction getDirectory(source, decompress, offset, length, header) {\n return __async(this, null, function* () {\n const resp = yield source.getBytes(offset, length);\n if (header.etag && header.etag !== resp.etag) {\n throw new EtagMismatch(resp.etag);\n }\n const data = yield decompress(resp.data, header.internalCompression);\n const directory = deserializeIndex(data);\n if (directory.length === 0) {\n throw new Error(\"Empty directory is invalid\");\n }\n return directory;\n });\n}\nvar ResolvedValueCache = class {\n constructor(maxCacheEntries = 100, prefetch = true, decompress = defaultDecompress) {\n this.cache = /* @__PURE__ */ new Map();\n this.maxCacheEntries = maxCacheEntries;\n this.counter = 1;\n this.prefetch = prefetch;\n this.decompress = decompress;\n }\n getHeader(source, current_etag) {\n return __async(this, null, function* () {\n const cacheKey = source.getKey();\n if (this.cache.has(cacheKey)) {\n this.cache.get(cacheKey).lastUsed = this.counter++;\n const data = this.cache.get(cacheKey).data;\n return data;\n }\n const res = yield getHeaderAndRoot(\n source,\n this.decompress,\n this.prefetch,\n current_etag\n );\n if (res[1]) {\n this.cache.set(res[1][0], {\n lastUsed: this.counter++,\n data: res[1][2]\n });\n }\n this.cache.set(cacheKey, {\n lastUsed: this.counter++,\n data: res[0]\n });\n this.prune();\n return res[0];\n });\n }\n getDirectory(source, offset, length, header) {\n return __async(this, null, function* () {\n const cacheKey = source.getKey() + \"|\" + (header.etag || \"\") + \"|\" + offset + \"|\" + length;\n if (this.cache.has(cacheKey)) {\n this.cache.get(cacheKey).lastUsed = this.counter++;\n const data = this.cache.get(cacheKey).data;\n return data;\n }\n const directory = yield getDirectory(\n source,\n this.decompress,\n offset,\n length,\n header\n );\n this.cache.set(cacheKey, {\n lastUsed: this.counter++,\n data: directory\n });\n this.prune();\n return directory;\n });\n }\n getArrayBuffer(source, offset, length, header) {\n return __async(this, null, function* () {\n const cacheKey = source.getKey() + \"|\" + (header.etag || \"\") + \"|\" + offset + \"|\" + length;\n if (this.cache.has(cacheKey)) {\n this.cache.get(cacheKey).lastUsed = this.counter++;\n const data = yield this.cache.get(cacheKey).data;\n return data;\n }\n const resp = yield source.getBytes(offset, length);\n if (header.etag && header.etag !== resp.etag) {\n throw new EtagMismatch(header.etag);\n }\n this.cache.set(cacheKey, {\n lastUsed: this.counter++,\n data: resp.data\n });\n this.prune();\n return resp.data;\n });\n }\n prune() {\n if (this.cache.size > this.maxCacheEntries) {\n let minUsed = Infinity;\n let minKey = void 0;\n this.cache.forEach((cache_value, key) => {\n if (cache_value.lastUsed < minUsed) {\n minUsed = cache_value.lastUsed;\n minKey = key;\n }\n });\n if (minKey) {\n this.cache.delete(minKey);\n }\n }\n }\n invalidate(source, current_etag) {\n return __async(this, null, function* () {\n this.cache.delete(source.getKey());\n yield this.getHeader(source, current_etag);\n });\n }\n};\nvar SharedPromiseCache = class {\n constructor(maxCacheEntries = 100, prefetch = true, decompress = defaultDecompress) {\n this.cache = /* @__PURE__ */ new Map();\n this.maxCacheEntries = maxCacheEntries;\n this.counter = 1;\n this.prefetch = prefetch;\n this.decompress = decompress;\n }\n getHeader(source, current_etag) {\n return __async(this, null, function* () {\n const cacheKey = source.getKey();\n if (this.cache.has(cacheKey)) {\n this.cache.get(cacheKey).lastUsed = this.counter++;\n const data = yield this.cache.get(cacheKey).data;\n return data;\n }\n const p = new Promise((resolve, reject) => {\n getHeaderAndRoot(source, this.decompress, this.prefetch, current_etag).then((res) => {\n if (res[1]) {\n this.cache.set(res[1][0], {\n lastUsed: this.counter++,\n data: Promise.resolve(res[1][2])\n });\n }\n resolve(res[0]);\n this.prune();\n }).catch((e) => {\n reject(e);\n });\n });\n this.cache.set(cacheKey, { lastUsed: this.counter++, data: p });\n return p;\n });\n }\n getDirectory(source, offset, length, header) {\n return __async(this, null, function* () {\n const cacheKey = source.getKey() + \"|\" + (header.etag || \"\") + \"|\" + offset + \"|\" + length;\n if (this.cache.has(cacheKey)) {\n this.cache.get(cacheKey).lastUsed = this.counter++;\n const data = yield this.cache.get(cacheKey).data;\n return data;\n }\n const p = new Promise((resolve, reject) => {\n getDirectory(source, this.decompress, offset, length, header).then((directory) => {\n resolve(directory);\n this.prune();\n }).catch((e) => {\n reject(e);\n });\n });\n this.cache.set(cacheKey, { lastUsed: this.counter++, data: p });\n return p;\n });\n }\n getArrayBuffer(source, offset, length, header) {\n return __async(this, null, function* () {\n const cacheKey = source.getKey() + \"|\" + (header.etag || \"\") + \"|\" + offset + \"|\" + length;\n if (this.cache.has(cacheKey)) {\n this.cache.get(cacheKey).lastUsed = this.counter++;\n const data = yield this.cache.get(cacheKey).data;\n return data;\n }\n const p = new Promise((resolve, reject) => {\n source.getBytes(offset, length).then((resp) => {\n if (header.etag && header.etag !== resp.etag) {\n throw new EtagMismatch(resp.etag);\n }\n resolve(resp.data);\n if (this.cache.has(cacheKey)) {\n }\n this.prune();\n }).catch((e) => {\n reject(e);\n });\n });\n this.cache.set(cacheKey, { lastUsed: this.counter++, data: p });\n return p;\n });\n }\n prune() {\n if (this.cache.size >= this.maxCacheEntries) {\n let minUsed = Infinity;\n let minKey = void 0;\n this.cache.forEach(\n (cache_value, key) => {\n if (cache_value.lastUsed < minUsed) {\n minUsed = cache_value.lastUsed;\n minKey = key;\n }\n }\n );\n if (minKey) {\n this.cache.delete(minKey);\n }\n }\n }\n invalidate(source, current_etag) {\n return __async(this, null, function* () {\n this.cache.delete(source.getKey());\n yield this.getHeader(source, current_etag);\n });\n }\n};\nvar PMTiles = class {\n constructor(source, cache, decompress) {\n if (typeof source === \"string\") {\n this.source = new FetchSource(source);\n } else {\n this.source = source;\n }\n if (decompress) {\n this.decompress = decompress;\n } else {\n this.decompress = defaultDecompress;\n }\n if (cache) {\n this.cache = cache;\n } else {\n this.cache = new SharedPromiseCache();\n }\n }\n getHeader() {\n return __async(this, null, function* () {\n return yield this.cache.getHeader(this.source);\n });\n }\n getZxyAttempt(z, x, y, signal) {\n return __async(this, null, function* () {\n const tile_id = zxyToTileId(z, x, y);\n const header = yield this.cache.getHeader(this.source);\n if (header.specVersion < 3) {\n return v2_default.getZxy(header, this.source, this.cache, z, x, y, signal);\n }\n if (z < header.minZoom || z > header.maxZoom) {\n return void 0;\n }\n let d_o = header.rootDirectoryOffset;\n let d_l = header.rootDirectoryLength;\n for (let depth = 0; depth <= 3; depth++) {\n const directory = yield this.cache.getDirectory(\n this.source,\n d_o,\n d_l,\n header\n );\n const entry = findTile(directory, tile_id);\n if (entry) {\n if (entry.runLength > 0) {\n const resp = yield this.source.getBytes(\n header.tileDataOffset + entry.offset,\n entry.length,\n signal\n );\n if (header.etag && header.etag !== resp.etag) {\n throw new EtagMismatch(resp.etag);\n }\n return {\n data: yield this.decompress(resp.data, header.tileCompression),\n cacheControl: resp.cacheControl,\n expires: resp.expires\n };\n } else {\n d_o = header.leafDirectoryOffset + entry.offset;\n d_l = entry.length;\n }\n } else {\n return void 0;\n }\n }\n throw Error(\"Maximum directory depth exceeded\");\n });\n }\n getZxy(z, x, y, signal) {\n return __async(this, null, function* () {\n try {\n return yield this.getZxyAttempt(z, x, y, signal);\n } catch (e) {\n if (e instanceof EtagMismatch) {\n this.cache.invalidate(this.source, e.message);\n return yield this.getZxyAttempt(z, x, y, signal);\n } else {\n throw e;\n }\n }\n });\n }\n getMetadataAttempt() {\n return __async(this, null, function* () {\n const header = yield this.cache.getHeader(this.source);\n const resp = yield this.source.getBytes(\n header.jsonMetadataOffset,\n header.jsonMetadataLength\n );\n if (header.etag && header.etag !== resp.etag) {\n throw new EtagMismatch(resp.etag);\n }\n const decompressed = yield this.decompress(\n resp.data,\n header.internalCompression\n );\n const dec = new TextDecoder(\"utf-8\");\n return JSON.parse(dec.decode(decompressed));\n });\n }\n getMetadata() {\n return __async(this, null, function* () {\n try {\n return yield this.getMetadataAttempt();\n } catch (e) {\n if (e instanceof EtagMismatch) {\n this.cache.invalidate(this.source, e.message);\n return yield this.getMetadataAttempt();\n } else {\n throw e;\n }\n }\n });\n }\n};\nexport {\n Compression,\n EtagMismatch,\n FetchSource,\n FileAPISource,\n PMTiles,\n Protocol,\n ResolvedValueCache,\n SharedPromiseCache,\n TileType,\n bytesToHeader,\n findTile,\n getUint64,\n leafletRasterLayer,\n readVarint,\n tileIdToZxy,\n zxyToTileId\n};\n", "// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nexport class InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nexport class InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nexport class ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n", "/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nexport const DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nexport const DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nexport const DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nexport const DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nexport const DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nexport const TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nexport const TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nexport const TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nexport const TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nexport const DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nexport const DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n", "import { ZoneIsAbstractError } from \"./errors.js\";\n\n/**\n * @interface\n */\nexport default class Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The IANA name of this zone.\n * Defaults to `name` if not overwritten by a subclass.\n * @abstract\n * @type {string}\n */\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n", "import { formatOffset, parseZoneInfo } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nexport default class SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton === null) {\n singleton = new SystemZone();\n }\n return singleton;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n", "import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet dtfCache = {};\nfunction makeDTF(zone) {\n if (!dtfCache[zone]) {\n dtfCache[zone] = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zone,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n }\n return dtfCache[zone];\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nlet ianaZoneCache = {};\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nexport default class IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n if (!ianaZoneCache[name]) {\n ianaZoneCache[name] = new IANAZone(name);\n }\n return ianaZoneCache[name];\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache = {};\n dtfCache = {};\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated For backward compatibility, this forwards to isValidZone, better use `isValidZone()` directly instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /**\n * The type of zone. `iana` for all instances of `IANAZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"iana\";\n }\n\n /**\n * The name of this zone (i.e. the IANA zone name).\n * @override\n * @type {string}\n */\n get name() {\n return this.zoneName;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns false for all IANA zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return false;\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @override\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /**\n * Return whether this Zone is valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return this.valid;\n }\n}\n", "import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlDTCache = {};\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache[key];\n if (!dtf) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlNumCache = {};\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache[key];\n if (!inf) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache[key] = inf;\n }\n return inf;\n}\n\nlet intlRelCache = {};\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache[key];\n if (!inf) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache[key] = inf;\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nlet weekInfoCache = {};\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache[locString];\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n weekInfoCache[locString] = data;\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\n\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human-readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache = {};\n intlNumCache = {};\n intlRelCache = {};\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, \"month\"));\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n\n toString() {\n return `Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`;\n }\n}\n", "import { formatOffset, signedOffset } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nexport default class FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /**\n * The type of zone. `fixed` for all instances of `FixedOffsetZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"fixed\";\n }\n\n /**\n * The name of this zone.\n * All fixed zones' names always start with \"UTC\" (plus optional offset)\n * @override\n * @type {string}\n */\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n /**\n * The IANA name of this zone, i.e. `Etc/UTC` or `Etc/GMT+/-nn`\n *\n * @override\n * @type {string}\n */\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /**\n * Returns the offset's common name at the specified timestamp.\n *\n * For fixed offset zones this equals to the zone name.\n * @override\n */\n offsetName() {\n return this.name;\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns true for all fixed offset zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return true;\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n *\n * For fixed offset zones, this is constant and does not depend on a timestamp.\n * @override\n * @return {number}\n */\n offset() {\n return this.fixed;\n }\n\n /**\n * Return whether this Zone is equal to another zone (i.e. also fixed and same offset)\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /**\n * Return whether this Zone is valid:\n * All fixed offset zones are valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return true;\n }\n}\n", "import Zone from \"../zone.js\";\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nexport default class InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n", "/**\n * @private\n */\n\nimport Zone from \"../zone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport InvalidZone from \"../zones/invalidZone.js\";\n\nimport { isUndefined, isString, isNumber } from \"./util.js\";\nimport SystemZone from \"../zones/systemZone.js\";\n\nexport function normalizeZone(input, defaultZone) {\n let offset;\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && \"offset\" in input && typeof input.offset === \"function\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n", "const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\n// cache of {numberingSystem: {append: regex}}\nlet digitRegexCache = {};\nexport function resetDigitRegexCache() {\n digitRegexCache = {};\n}\n\nexport function digitRegex({ numberingSystem }, append = \"\") {\n const ns = numberingSystem || \"latn\";\n\n if (!digitRegexCache[ns]) {\n digitRegexCache[ns] = {};\n }\n if (!digitRegexCache[ns][append]) {\n digitRegexCache[ns][append] = new RegExp(`${numberingSystems[ns]}${append}`);\n }\n\n return digitRegexCache[ns][append];\n}\n", "import SystemZone from \"./zones/systemZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport DateTime from \"./datetime.js\";\n\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport { validateWeekSettings } from \"./impl/util.js\";\nimport { resetDigitRegexCache } from \"./impl/digits.js\";\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n twoDigitCutoffYear = 60,\n throwOnInvalid,\n defaultWeekSettings = null;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nexport default class Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * @typedef {Object} WeekSettings\n * @property {number} firstDay\n * @property {number} minimalDays\n * @property {number[]} weekend\n */\n\n /**\n * @return {WeekSettings|null}\n */\n static get defaultWeekSettings() {\n return defaultWeekSettings;\n }\n\n /**\n * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and\n * how many days are required in the first week of a year.\n * Does not affect existing instances.\n *\n * @param {WeekSettings|null} weekSettings\n */\n static set defaultWeekSettings(weekSettings) {\n defaultWeekSettings = validateWeekSettings(weekSettings);\n }\n\n /**\n * Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n */\n static get twoDigitCutoffYear() {\n return twoDigitCutoffYear;\n }\n\n /**\n * Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n * @example Settings.twoDigitCutoffYear = 0 // all 'yy' are interpreted as 20th century\n * @example Settings.twoDigitCutoffYear = 99 // all 'yy' are interpreted as 21st century\n * @example Settings.twoDigitCutoffYear = 50 // '49' -> 2049; '50' -> 1950\n * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50\n * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50\n */\n static set twoDigitCutoffYear(cutoffYear) {\n twoDigitCutoffYear = cutoffYear % 100;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n DateTime.resetCache();\n resetDigitRegexCache();\n }\n}\n", "export default class Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n", "import {\n integerBetween,\n isLeapYear,\n timeObject,\n daysInYear,\n daysInMonth,\n weeksInWeekYear,\n isInteger,\n isUndefined,\n} from \"./util.js\";\nimport Invalid from \"./invalid.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nexport function dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\nexport function isoWeekdayToLocal(isoWeekday, startOfWeek) {\n return ((isoWeekday - startOfWeek + 7) % 7) + 1;\n}\n\n/**\n * @private\n */\n\nexport function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);\n\n let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);\n } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nexport function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nexport function gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nexport function ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\n/**\n * Check if local week units like localWeekday are used in obj.\n * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties.\n * Modifies obj in-place!\n * @param obj the object values\n */\nexport function usesLocalWeekValues(obj, loc) {\n const hasLocaleWeekData =\n !isUndefined(obj.localWeekday) ||\n !isUndefined(obj.localWeekNumber) ||\n !isUndefined(obj.localWeekYear);\n if (hasLocaleWeekData) {\n const hasIsoWeekData =\n !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);\n\n if (hasIsoWeekData) {\n throw new ConflictingSpecificationError(\n \"Cannot mix locale-based week fields with ISO-based week fields\"\n );\n }\n if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;\n if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;\n if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;\n delete obj.localWeekday;\n delete obj.localWeekNumber;\n delete obj.localWeekYear;\n return {\n minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),\n startOfWeek: loc.getStartOfWeek(),\n };\n } else {\n return { minDaysInFirstWeek: 4, startOfWeek: 1 };\n }\n}\n\nexport function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(\n obj.weekNumber,\n 1,\n weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)\n ),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.weekNumber);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nexport function hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nexport function hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nexport function hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n", "/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\nimport { InvalidArgumentError } from \"../errors.js\";\nimport Settings from \"../settings.js\";\nimport { dayOfWeek, isoWeekdayToLocal } from \"./conversions.js\";\n\n/**\n * @private\n */\n\n// TYPES\n\nexport function isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nexport function isNumber(o) {\n return typeof o === \"number\";\n}\n\nexport function isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nexport function isString(o) {\n return typeof o === \"string\";\n}\n\nexport function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nexport function hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\nexport function hasLocaleWeekInfo() {\n try {\n return (\n typeof Intl !== \"undefined\" &&\n !!Intl.Locale &&\n (\"weekInfo\" in Intl.Locale.prototype || \"getWeekInfo\" in Intl.Locale.prototype)\n );\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nexport function maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nexport function bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nexport function pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nexport function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function validateWeekSettings(settings) {\n if (settings == null) {\n return null;\n } else if (typeof settings !== \"object\") {\n throw new InvalidArgumentError(\"Week settings must be an object\");\n } else {\n if (\n !integerBetween(settings.firstDay, 1, 7) ||\n !integerBetween(settings.minimalDays, 1, 7) ||\n !Array.isArray(settings.weekend) ||\n settings.weekend.some((v) => !integerBetween(v, 1, 7))\n ) {\n throw new InvalidArgumentError(\"Invalid week settings\");\n }\n return {\n firstDay: settings.firstDay,\n minimalDays: settings.minimalDays,\n weekend: Array.from(settings.weekend),\n };\n }\n}\n\n// NUMBERS AND STRINGS\n\nexport function integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nexport function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nexport function padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nexport function parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nexport function parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nexport function parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nexport function roundTo(number, digits, towardZero = false) {\n const factor = 10 ** digits,\n rounder = towardZero ? Math.trunc : Math.round;\n return rounder(number * factor) / factor;\n}\n\n// DATE BASICS\n\nexport function isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nexport function daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// convert a calendar object to a local timestamp (epoch, but with the offset baked in)\nexport function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not\n // so if obj.year is in 99, but obj.day makes it roll over into year 100,\n // the calculations done by Date.UTC are using year 2000 - which is incorrect\n d.setUTCFullYear(obj.year, obj.month - 1, obj.day);\n }\n return +d;\n}\n\n// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js\nfunction firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {\n const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);\n return -fwdlw + minDaysInFirstWeek - 1;\n}\n\nexport function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);\n const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);\n return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;\n}\n\nexport function untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nexport function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nexport function signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nexport function asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || Number.isNaN(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nexport function normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\n/**\n * Returns the offset's value as a string\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\nexport function formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nexport function timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n", "import * as Formats from \"./formats.js\";\nimport { pick } from \"./util.js\";\n\nfunction stringify(obj) {\n return JSON.stringify(obj, Object.keys(obj).sort());\n}\n\n/**\n * @private\n */\n\nexport const monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nexport const monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nexport const monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nexport function months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nexport const weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nexport const weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nexport const weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nexport function weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nexport const meridiems = [\"AM\", \"PM\"];\n\nexport const erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nexport const erasShort = [\"BC\", \"AD\"];\n\nexport const erasNarrow = [\"B\", \"A\"];\n\nexport function eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nexport function meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nexport function weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nexport function monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nexport function eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nexport function formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n default: // fall through\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nexport function formatString(knownFormat) {\n // these all have the offsets removed because we don't have access to them\n // without all the intl stuff this is backfilling\n const filtered = pick(knownFormat, [\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n \"hourCycle\",\n ]),\n key = stringify(filtered),\n dateTimeHuge = \"EEEE, LLLL d, yyyy, h:mm a\";\n switch (key) {\n case stringify(Formats.DATE_SHORT):\n return \"M/d/yyyy\";\n case stringify(Formats.DATE_MED):\n return \"LLL d, yyyy\";\n case stringify(Formats.DATE_MED_WITH_WEEKDAY):\n return \"EEE, LLL d, yyyy\";\n case stringify(Formats.DATE_FULL):\n return \"LLLL d, yyyy\";\n case stringify(Formats.DATE_HUGE):\n return \"EEEE, LLLL d, yyyy\";\n case stringify(Formats.TIME_SIMPLE):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_SECONDS):\n return \"h:mm:ss a\";\n case stringify(Formats.TIME_WITH_SHORT_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_LONG_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_24_SIMPLE):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_SECONDS):\n return \"HH:mm:ss\";\n case stringify(Formats.TIME_24_WITH_SHORT_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_LONG_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.DATETIME_SHORT):\n return \"M/d/yyyy, h:mm a\";\n case stringify(Formats.DATETIME_MED):\n return \"LLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL):\n return \"LLLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_HUGE):\n return dateTimeHuge;\n case stringify(Formats.DATETIME_SHORT_WITH_SECONDS):\n return \"M/d/yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_SECONDS):\n return \"LLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_WEEKDAY):\n return \"EEE, d LLL yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL_WITH_SECONDS):\n return \"LLLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_HUGE_WITH_SECONDS):\n return \"EEEE, LLLL d, yyyy, h:mm:ss a\";\n default:\n return dateTimeHuge;\n }\n}\n", "import * as English from \"./english.js\";\nimport * as Formats from \"./formats.js\";\nimport { padStart } from \"./util.js\";\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: Formats.DATE_SHORT,\n DD: Formats.DATE_MED,\n DDD: Formats.DATE_FULL,\n DDDD: Formats.DATE_HUGE,\n t: Formats.TIME_SIMPLE,\n tt: Formats.TIME_WITH_SECONDS,\n ttt: Formats.TIME_WITH_SHORT_OFFSET,\n tttt: Formats.TIME_WITH_LONG_OFFSET,\n T: Formats.TIME_24_SIMPLE,\n TT: Formats.TIME_24_WITH_SECONDS,\n TTT: Formats.TIME_24_WITH_SHORT_OFFSET,\n TTTT: Formats.TIME_24_WITH_LONG_OFFSET,\n f: Formats.DATETIME_SHORT,\n ff: Formats.DATETIME_MED,\n fff: Formats.DATETIME_FULL,\n ffff: Formats.DATETIME_HUGE,\n F: Formats.DATETIME_SHORT_WITH_SECONDS,\n FF: Formats.DATETIME_MED_WITH_SECONDS,\n FFF: Formats.DATETIME_FULL_WITH_SECONDS,\n FFFF: Formats.DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nexport default class Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n // white-space is always considered a literal in user-provided formats\n // the \" \" token has a special meaning (see unitForToken)\n\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: /^\\s+$/.test(currentFull), val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n dtFormatter(dt, opts = {}) {\n return this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n }\n\n formatDateTime(dt, opts) {\n return this.dtFormatter(dt, opts).format();\n }\n\n formatDateTimeParts(dt, opts) {\n return this.dtFormatter(dt, opts).formatToParts();\n }\n\n formatInterval(interval, opts) {\n const df = this.dtFormatter(interval.start, opts);\n return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());\n }\n\n resolvedOptions(dt, opts) {\n return this.dtFormatter(dt, opts).resolvedOptions();\n }\n\n num(n, p = 0) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? English.meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? English.monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? English.weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? English.eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"n\":\n return this.num(dt.localWeekNumber);\n case \"nn\":\n return this.num(dt.localWeekNumber, 2);\n case \"ii\":\n return this.num(dt.localWeekYear.toString().slice(-2), 2);\n case \"iiii\":\n return this.num(dt.localWeekYear, 4);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"w\":\n return \"week\";\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n default:\n return null;\n }\n },\n tokenToString = (lildur) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n return this.num(lildur.get(mapped), token.length);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t));\n return stringifyTokens(tokens, tokenToString(collapsed));\n }\n}\n", "import {\n untruncateYear,\n signedOffset,\n parseInteger,\n parseMillis,\n isUndefined,\n parseFloating,\n} from \"./util.js\";\nimport * as English from \"./english.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nconst ianaRegex = /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:(Z)|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: English.monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? English.weekdaysLong.indexOf(weekdayStr) + 1\n : English.weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nexport function parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nexport function parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nexport function parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nexport function parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nexport function parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nexport function parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n", "import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from \"./errors.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Locale from \"./impl/locale.js\";\nimport { parseISODuration, parseISOTimeOnly } from \"./impl/regexParser.js\";\nimport {\n asNumber,\n hasOwnProperty,\n isNumber,\n isUndefined,\n normalizeObject,\n roundTo,\n} from \"./impl/util.js\";\nimport Settings from \"./settings.js\";\nimport DateTime from \"./datetime.js\";\n\nconst INVALID = \"Invalid Duration\";\n\n// unit conversion constants\nexport const lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction durationToMillis(matrix, vals) {\n let sum = vals.milliseconds ?? 0;\n for (const unit of reverseUnits.slice(1)) {\n if (vals[unit]) {\n sum += vals[unit] * matrix[unit][\"milliseconds\"];\n }\n }\n return sum;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n // the logic below assumes the overall value of the duration is positive\n // if this is not the case, factor is used to make it so\n const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;\n\n orderedUnits.reduceRight((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const previousVal = vals[previous] * factor;\n const conv = matrix[current][previous];\n\n // if (previousVal < 0):\n // lower order unit is negative (e.g. { years: 2, days: -2 })\n // normalize this by reducing the higher order unit by the appropriate amount\n // and increasing the lower order unit\n // this can never make the higher order unit negative, because this function only operates\n // on positive durations, so the amount of time represented by the lower order unit cannot\n // be larger than the higher order unit\n // else:\n // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })\n // in this case we attempt to convert as much as possible from the lower order unit into\n // the higher order one\n //\n // Math.floor takes care of both of these cases, rounding away from 0\n // if previousVal < 0 it makes the absolute value larger\n // if previousVal >= it makes the absolute value smaller\n const rollUp = Math.floor(previousVal / conv);\n vals[current] += rollUp * factor;\n vals[previous] -= rollUp * conv * factor;\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n\n // try to convert any decimals into smaller units if possible\n // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }\n orderedUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const fraction = vals[previous] % 1;\n vals[previous] -= fraction;\n vals[current] += fraction * matrix[previous][current];\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nexport default class Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options\n * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.\n * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.\n * @example\n * ```js\n * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 day, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 day, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 day, 5 hr, 6 min'\n * ```\n */\n toHuman(opts = {}) {\n if (!this.isValid) return INVALID;\n\n const l = orderedUnits\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n includeOffset: false,\n };\n\n const dateTime = DateTime.fromMillis(millis, { zone: \"UTC\" });\n return dateTime.toISOTime(opts);\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns a string representation of this Duration appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Duration { values: ${JSON.stringify(this.values)} }`;\n } else {\n return `Duration { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n if (!this.isValid) return NaN;\n\n return durationToMillis(this.matrix, this.values);\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * Assuming the overall value of the Duration is positive, this means:\n * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)\n * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise\n * the overall value would be negative, see third example)\n * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)\n *\n * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n // only keep the integer part for now in the hopes of putting any decimal part\n // into a smaller unit later\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n normalizeValues(this.matrix, built);\n return clone(this, { values: built }, true);\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone(this, { values: negated }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n", "import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `/`, `/`, and `/` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Returns true if this Interval fully contains the specified Interval, specifically if the intersect (of this Interval and the other Interval) is equal to the other Interval; false otherwise.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into a equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} \u2013 ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 \u2013 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 \u2013 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7\u20138 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 \u2013 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 \u2013 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' \u2013 '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" \u2013 \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n", "import DateTime from \"./datetime.js\";\nimport Settings from \"./settings.js\";\nimport Locale from \"./impl/locale.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\n\nimport { hasLocaleWeekInfo, hasRelative } from \"./impl/util.js\";\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nexport default class Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Get the weekday on which the week starts according to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number} the start of the week, 1 for Monday through 7 for Sunday\n */\n static getStartOfWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getStartOfWeek();\n }\n\n /**\n * Get the minimum number of days necessary in a week before it is considered part of the next year according\n * to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number}\n */\n static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getMinDaysInFirstWeek();\n }\n\n /**\n * Get the weekdays, which are considered the weekend according to the given locale\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday\n */\n static getWeekendWeekdays({ locale = null, locObj = null } = {}) {\n // copy the array, because we cache it internally\n return (locObj || Locale.create(locale)).getWeekendDays().slice();\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '\u0661'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabi\u02BB I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> '\u0627\u0644\u0627\u062B\u0646\u064A\u0646'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ '\u1014\u1036\u1014\u1000\u103A', '\u100A\u1014\u1031' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant J\u00E9sus-Christ', 'apr\u00E8s J\u00E9sus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale\n * @example Info.features() //=> { relative: false, localeWeek: true }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };\n }\n}\n", "import Duration from \"../duration.js\";\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n const earlier = cursor;\n let lowestOrder, highWater;\n\n /* This loop tries to diff using larger units first.\n If we overshoot, we backtrack and try the next smaller unit.\n \"cursor\" starts out at the earlier timestamp and moves closer and closer to \"later\"\n as we use smaller and smaller units.\n highWater keeps track of where we would be if we added one more of the smallest unit,\n this is used later to potentially convert any difference smaller than the smallest higher order unit\n into a fraction of that smallest higher order unit\n */\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n results[unit] = differ(cursor, later);\n highWater = earlier.plus(results);\n\n if (highWater > later) {\n // we overshot the end point, backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n\n // if we are still overshooting now, we need to backtrack again\n // this happens in certain situations when diffing times in different zones,\n // because this calculation ignores time zones\n if (cursor > later) {\n // keep the \"overshot by 1\" around as highWater\n highWater = cursor;\n // backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n }\n } else {\n cursor = highWater;\n }\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nexport default function (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n", "import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from \"./util.js\";\nimport Formatter from \"./formatter.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport DateTime from \"../datetime.js\";\nimport { digitRegex, parseDigits } from \"./digits.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\n/**\n * @param token\n * @param {Locale} loc\n */\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\"), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\"), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n // this special-case \"token\" represents a place where a macro-token expanded into a white-space literal\n // in this case we accept any non-newline white-space\n case \" \":\n return simple(/[^\\S\\n\\r]/);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour12: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n hour24: {\n numeric: \"H\",\n \"2-digit\": \"HH\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, formatOpts, resolvedOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n const isSpace = /^\\s+$/.test(value);\n return {\n literal: !isSpace,\n val: isSpace ? \" \" : value,\n };\n }\n\n const style = formatOpts[type];\n\n // The user might have explicitly specified hour12 or hourCycle\n // if so, respect their decision\n // if not, refer back to the resolvedOpts, which are based on the locale\n let actualType = type;\n if (type === \"hour\") {\n if (formatOpts.hour12 != null) {\n actualType = formatOpts.hour12 ? \"hour12\" : \"hour24\";\n } else if (formatOpts.hourCycle != null) {\n if (formatOpts.hourCycle === \"h11\" || formatOpts.hourCycle === \"h12\") {\n actualType = \"hour12\";\n } else {\n actualType = \"hour24\";\n }\n } else {\n // tokens only differentiate between 24 hours or not,\n // so we do not need to check hourCycle here, which is less supported anyways\n actualType = resolvedOpts.hour12 ? \"hour12\" : \"hour24\";\n }\n }\n let val = partTypeStyleToTokenVal[actualType];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nexport function expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nexport class TokenParser {\n constructor(locale, format) {\n this.locale = locale;\n this.format = format;\n this.tokens = expandMacroTokens(Formatter.parseFormat(format), locale);\n this.units = this.tokens.map((t) => unitForToken(t, locale));\n this.disqualifyingUnit = this.units.find((t) => t.invalidReason);\n\n if (!this.disqualifyingUnit) {\n const [regexString, handlers] = buildRegex(this.units);\n this.regex = RegExp(regexString, \"i\");\n this.handlers = handlers;\n }\n }\n\n explainFromTokens(input) {\n if (!this.isValid) {\n return { input, tokens: this.tokens, invalidReason: this.invalidReason };\n } else {\n const [rawMatches, matches] = match(input, this.regex, this.handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return {\n input,\n tokens: this.tokens,\n regex: this.regex,\n rawMatches,\n matches,\n result,\n zone,\n specificOffset,\n };\n }\n }\n\n get isValid() {\n return !this.disqualifyingUnit;\n }\n\n get invalidReason() {\n return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null;\n }\n}\n\nexport function explainFromTokens(locale, input, format) {\n const parser = new TokenParser(locale, format);\n return parser.explainFromTokens(input);\n}\n\nexport function parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nexport function formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const df = formatter.dtFormatter(getDummyDateTime());\n const parts = df.formatToParts();\n const resolvedOpts = df.resolvedOptions();\n return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));\n}\n", "import Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Settings from \"./settings.js\";\nimport Info from \"./info.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport {\n isUndefined,\n maybeArray,\n isDate,\n isNumber,\n bestBy,\n daysInMonth,\n daysInYear,\n isLeapYear,\n weeksInWeekYear,\n normalizeObject,\n roundTo,\n objToLocalTS,\n padStart,\n} from \"./impl/util.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport diff from \"./impl/diff.js\";\nimport { parseRFC2822Date, parseISODate, parseHTTPDate, parseSQL } from \"./impl/regexParser.js\";\nimport {\n parseFromTokens,\n explainFromTokens,\n formatOptsToTokens,\n expandMacroTokens,\n TokenParser,\n} from \"./impl/tokenParser.js\";\nimport {\n gregorianToWeek,\n weekToGregorian,\n gregorianToOrdinal,\n ordinalToGregorian,\n hasInvalidGregorianData,\n hasInvalidWeekData,\n hasInvalidOrdinalData,\n hasInvalidTimeData,\n usesLocalWeekValues,\n isoWeekdayToLocal,\n} from \"./impl/conversions.js\";\nimport * as Formats from \"./impl/formats.js\";\nimport {\n InvalidArgumentError,\n ConflictingSpecificationError,\n InvalidUnitError,\n InvalidDateTimeError,\n} from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedLocalWeekData(dt) {\n if (dt.localWeekData === null) {\n dt.localWeekData = gregorianToWeek(\n dt.c,\n dt.loc.getMinDaysInFirstWeek(),\n dt.loc.getStartOfWeek()\n );\n }\n return dt.localWeekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n c += \"-\";\n c += padStart(o.c.day);\n } else {\n c += padStart(o.c.month);\n c += padStart(o.c.day);\n }\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n) {\n let c = padStart(o.c.hour);\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += \":\";\n }\n } else {\n c += padStart(o.c.minute);\n }\n\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += padStart(o.c.second);\n\n if (o.c.millisecond !== 0 || !suppressMilliseconds) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\nfunction normalizeUnitWithLocalWeeks(unit) {\n switch (unit.toLowerCase()) {\n case \"localweekday\":\n case \"localweekdays\":\n return \"localWeekday\";\n case \"localweeknumber\":\n case \"localweeknumbers\":\n return \"localWeekNumber\";\n case \"localweekyear\":\n case \"localweekyears\":\n return \"localWeekYear\";\n default:\n return normalizeUnit(unit);\n }\n}\n\n// cache offsets for zones based on the current timestamp when this function is\n// first called. When we are handling a datetime from components like (year,\n// month, day, hour) in a time zone, we need a guess about what the timezone\n// offset is so that we can convert into a UTC timestamp. One way is to find the\n// offset of now in the zone. The actual date may have a different offset (for\n// example, if we handle a date in June while we're in December in a zone that\n// observes DST), but we can check and adjust that.\n//\n// When handling many dates, calculating the offset for now every time is\n// expensive. It's just a guess, so we can cache the offset to use even if we\n// are right on a time change boundary (we'll just correct in the other\n// direction). Using a timestamp from first read is a slight optimization for\n// handling dates close to the current date, since those dates will usually be\n// in the same offset (we could set the timestamp statically, instead). We use a\n// single timestamp for all zones to make things a bit more predictable.\n//\n// This is safe for quickDT (used by local() and utc()) because we don't fill in\n// higher-order units from tsNow (as we do in fromObject, this requires that\n// offset is calculated from tsNow).\nfunction guessOffsetForZone(zone) {\n if (!zoneOffsetGuessCache[zone]) {\n if (zoneOffsetTs === undefined) {\n zoneOffsetTs = Settings.now();\n }\n\n zoneOffsetGuessCache[zone] = zone.offset(zoneOffsetTs);\n }\n return zoneOffsetGuessCache[zone];\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n }\n\n const loc = Locale.fromObject(opts);\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = guessOffsetForZone(zone);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = Settings.now();\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, true);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * Timestamp to use for cached zone offset guesses (exposed for test)\n */\nlet zoneOffsetTs;\n/**\n * Cache for zone offset guesses (exposed for test).\n *\n * This optimizes quickDT via guessOffsetForZone to avoid repeated calls of\n * zone.offset().\n */\nlet zoneOffsetGuessCache = {};\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nexport default class DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n // If an offset has been passed and we have not been called from\n // clone(), we can trust it and avoid the offset calculation.\n const ot = isNumber(config.o) && !config.old ? config.o : zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.localWeekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [options.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.localWeekYear - a week year, according to the locale\n * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale\n * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system\\'s locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: \"en-US\" }).toISODate() //=> '2021-12-26'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const loc = Locale.fromObject(opts);\n const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n if (!inst.isValid) {\n return DateTime.invalid(inst.invalid);\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [opts.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n static resetCache() {\n zoneOffsetTs = undefined;\n zoneOffsetGuessCache = {};\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Returns true if this date is on a weekend according to the locale, false otherwise\n * @returns {boolean}\n */\n get isWeekend() {\n return this.isValid && this.loc.getWeekendDays().includes(this.weekday);\n }\n\n /**\n * Get the day of the week according to the locale.\n * 1 is the first day of the week and 7 is the last day of the week.\n * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1,\n * @returns {number}\n */\n get localWeekday() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the week number of the week year according to the locale. Different locales assign week numbers differently,\n * because the week can start on different days of the week (see localWeekday) and because a different number of days\n * is required for a week to count as the first week of a year.\n * @returns {number}\n */\n get localWeekNumber() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the week year according to the locale. Different locales assign week numbers (and therefor week years)\n * differently, see localWeekNumber.\n * @returns {number}\n */\n get localWeekYear() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC\n * in this DateTime's zone. During DST changes local time can be ambiguous, for example\n * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.\n * This method will return both possible DateTimes if this DateTime's local time is ambiguous.\n * @returns {DateTime[]}\n */\n getPossibleOffsets() {\n if (!this.isValid || this.isOffsetFixed) {\n return [this];\n }\n const dayMs = 86400000;\n const minuteMs = 60000;\n const localTS = objToLocalTS(this.c);\n const oEarlier = this.zone.offset(localTS - dayMs);\n const oLater = this.zone.offset(localTS + dayMs);\n\n const o1 = this.zone.offset(localTS - oEarlier * minuteMs);\n const o2 = this.zone.offset(localTS - oLater * minuteMs);\n if (o1 === o2) {\n return [this];\n }\n const ts1 = localTS - o1 * minuteMs;\n const ts2 = localTS - o2 * minuteMs;\n const c1 = tsToObj(ts1, o1);\n const c2 = tsToObj(ts2, o2);\n if (\n c1.hour === c2.hour &&\n c1.minute === c2.minute &&\n c1.second === c2.second &&\n c1.millisecond === c2.millisecond\n ) {\n return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })];\n }\n return [this];\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's local week year\n * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52\n * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53\n * @type {number}\n */\n get weeksInLocalWeekYear() {\n return this.isValid\n ? weeksInWeekYear(\n this.localWeekYear,\n this.loc.getMinDaysInFirstWeek(),\n this.loc.getStartOfWeek()\n )\n : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n *\n * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.\n * They cannot be mixed with ISO-week units like `weekday`.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);\n\n const settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian(\n { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },\n minDaysInFirstWeek,\n startOfWeek\n );\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit, { useLocaleWeeks = false } = {}) {\n if (!this.isValid) return this;\n\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n case \"milliseconds\":\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n if (useLocaleWeeks) {\n const startOfWeek = this.loc.getStartOfWeek();\n const { weekday } = this;\n if (weekday < startOfWeek) {\n o.weekNumber = this.weekNumber - 1;\n }\n o.weekday = startOfWeek;\n } else {\n o.weekday = 1;\n }\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit, opts) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit, opts)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 ao\u00FBt 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @return {string}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext);\n c += \"T\";\n c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @return {string}\n */\n toISODate({ format = \"extended\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return toISODate(this, format === \"extended\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n let c = includePrefix ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;\n } else {\n return `DateTime { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit, opts) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return (\n adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)\n );\n }\n\n /**\n * Equality check\n * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds down by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 d\u00EDa\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"ma\u00F1ana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n /**\n * Build a parser for `fmt` using the given locale. This parser can be passed\n * to {@link DateTime.fromFormatParser} to a parse a date in this format. This\n * can be used to optimize cases where many dates need to be parsed in a\n * specific format.\n *\n * @param {String} fmt - the format the string is expected to be in (see\n * description)\n * @param {Object} options - options used to set locale and numberingSystem\n * for parser\n * @returns {TokenParser} - opaque object to be used\n */\n static buildFormatParser(fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return new TokenParser(localeToUse, fmt);\n }\n\n /**\n * Create a DateTime from an input string and format parser.\n *\n * The format parser must have been created with the same locale as this call.\n *\n * @param {String} text - the string to parse\n * @param {TokenParser} formatParser - parser from {@link DateTime.buildFormatParser}\n * @param {Object} opts - options taken by fromFormat()\n * @returns {DateTime}\n */\n static fromFormatParser(text, formatParser, opts = {}) {\n if (isUndefined(text) || isUndefined(formatParser)) {\n throw new InvalidArgumentError(\n \"fromFormatParser requires an input string and a format parser\"\n );\n }\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n\n if (!localeToUse.equals(formatParser.locale)) {\n throw new InvalidArgumentError(\n `fromFormatParser called with a locale of ${localeToUse}, ` +\n `but the format parser was created for ${formatParser.locale}`\n );\n }\n\n const { result, zone, specificOffset, invalidReason } = formatParser.explainFromTokens(text);\n\n if (invalidReason) {\n return DateTime.invalid(invalidReason);\n } else {\n return parseDataToDateTime(\n result,\n zone,\n opts,\n `format ${formatParser.format}`,\n text,\n specificOffset\n );\n }\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return Formats.DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return Formats.DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return Formats.DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return Formats.DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return Formats.DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return Formats.TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return Formats.TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return Formats.TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return Formats.TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return Formats.TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return Formats.TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return Formats.TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return Formats.TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return Formats.DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return Formats.DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return Formats.DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return Formats.DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return Formats.DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return Formats.DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return Formats.DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return Formats.DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return Formats.DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nexport function friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n", "import { venues } from \"./geocoded.json\";\nimport { DateTime } from \"luxon\";\nimport { Feature, FeatureCollection } from \"geojson\";\nimport { Show, ShowsByDate, DateItem, ParsedData } from \"./interfaces\";\n\nconst isDev = () => window.location.host.includes(\"localhost\");\n\nexport const urlRoot = () =>\n isDev() ? \"http://localhost:8000\" : \"https://shows.metasyn.pw\";\n\nexport default class Parser {\n static async getFoopeeJson(): Promise {\n const list = `${urlRoot()}/scrape/foopee/`;\n try {\n return await fetch(list).then((r) => r.json());\n } catch (err) {\n return err;\n }\n }\n\n static async get19hzJson(): Promise {\n const list = `${urlRoot()}/scrape/19hz/`;\n try {\n return await fetch(list).then((r) => r.json());\n } catch (err) {\n return err;\n }\n }\n\n static async parseData(): Promise {\n return await Promise.all([\n Parser.getFoopeeJson(),\n Parser.get19hzJson(),\n ]).then((values) => {\n const data = values.flat(1);\n const showsByDate: ShowsByDate = Parser.sortByDate(data);\n return {\n featureCollection: Parser.geojsonify(showsByDate),\n dates: Parser.getDates(showsByDate),\n };\n });\n }\n\n static getDates(organized: ShowsByDate): DateItem[] {\n return Object.keys(organized).map((x) => {\n return { date: x, checked: true };\n });\n }\n\n static sortByDate(data: Show[]): ShowsByDate {\n const organized = {};\n for (let i = 0; i < data.length; i += 1) {\n if (!organized[data[i].date]) {\n organized[data[i].date] = [];\n }\n organized[data[i].date].push(data[i]);\n }\n return organized;\n }\n\n static geojsonify(data: ShowsByDate): FeatureCollection {\n const features: Feature[] = [];\n const dateKeys = Object.keys(data);\n\n // loop through dates\n for (let i = 0; i < dateKeys.length; i += 1) {\n const now = DateTime.now().setZone(\"America/Los_Angeles\");\n // toString returns an ISO 8601 string\n // where we are just interested in YYYY-MM-DD which is\n // only the first 10 characters\n const today = now.toString().slice(0, 10);\n let date = dateKeys[i];\n\n // Don't add shows form dates that happened before today\n if (date < today) {\n continue;\n }\n\n const venueList = Object.keys(venues);\n\n // loop through shows\n for (let j = 0; j < data[dateKeys[i]].length; j += 1) {\n const item = data[dateKeys[i]][j];\n\n // check for misspellings\n if (!venues[item.venue]) {\n try {\n for (let v = 0; v < venueList.length; v += 1) {\n const misspelled = item.venue.replace(/\\W/g, \"\").toLowerCase();\n const spelledCorrect = venueList[v]\n .replace(/\\(San Francisco\\)/, \"S.F.\")\n .replace(/\\W/g, \"\")\n .toLowerCase();\n const editDistance = Parser.getEditDistance(\n misspelled,\n spelledCorrect\n );\n if (editDistance <= 2) {\n console.log(\n `'${item.venue}' has been replaced with '${venueList[v]}'`\n );\n item.venue = venueList[v];\n }\n }\n } catch (e) {\n console.error(\"Something wrong:\", e);\n }\n }\n\n if (!venues[item.venue]) {\n\n if (item.venue.includes(\"TBA\")) {\n continue\n }\n }\n\n const coordinates = venues[item.venue]\n ? venues[item.venue].coordinates\n : [-122.42296, 37.826524]; // alcatraz\n\n const show: Feature = {\n type: \"Feature\",\n geometry: {\n type: \"Point\",\n coordinates,\n },\n properties: {\n sid: `${i}-${j}`,\n date: dateKeys[i],\n venue: item.venue,\n link: item.link,\n artists: item.artists,\n details: item.details\n .replace(/ ,/g, \"\") // too many commas\n .replace(\"***\", \"\"), // unuseful\n },\n };\n\n // add show to features array\n features.push(show);\n }\n }\n\n // format for valid geojson\n const output: FeatureCollection = {\n type: \"FeatureCollection\",\n features,\n };\n return output;\n }\n\n // Compute the edit distance between the two given strings\n static getEditDistance(a: string, b: string): number {\n if (a.length === 0) return b.length;\n if (b.length === 0) return a.length;\n\n const matrix: number[][] = [];\n\n // increment along the first column of each row\n let i: number;\n for (i = 0; i <= b.length; i += 1) {\n matrix[i] = [i];\n }\n\n // increment each column in the first row\n let j: number;\n for (j = 0; j <= a.length; j += 1) {\n matrix[0][j] = j;\n }\n\n // Fill in the rest of the matrix\n for (i = 1; i <= b.length; i += 1) {\n for (j = 1; j <= a.length; j += 1) {\n if (b.charAt(i - 1) === a.charAt(j - 1)) {\n matrix[i][j] = matrix[i - 1][j - 1];\n } else {\n matrix[i][j] = Math.min(\n matrix[i - 1][j - 1] + 1, // substitution\n Math.min(\n matrix[i][j - 1] + 1, // insertion\n matrix[i - 1][j] + 1\n )\n ); // deletion\n }\n }\n }\n\n return matrix[b.length][a.length];\n }\n\n static formatDate(dateString: string): string {\n const date = DateTime.fromISO(dateString); // force pacific timezone\n date.setZone(\"America/Los_Angeles\");\n return `${date.month}-${date.day} ${date.weekdayShort} `;\n }\n}\n"], "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2u+BA8CA,IAAAA,EAAeC,eC9Cf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aAAa,OAAO,EAClB,IACT,CACF,EAEAxF,GAAO,QAAUgB,KC11CjB,IAAAuF,GAAuB,WAEvBC,GAA2B,WCDzB,IAAAC,GAAU,CACR,8BAA+B,CAC7B,YAAe,CACb,YACA,SACF,CACF,EACA,oBAAqB,CACnB,YAAe,CACb,YACA,SACF,CACF,EACA,mCAAoC,CAClC,YAAe,CACb,aACA,UACF,CACF,EACA,qBAAsB,CACpB,YAAe,CACb,YACA,SACF,CACF,EACA,2BAA4B,CAC1B,YAAe,CACb,YACA,SACF,CACF,EACA,oBAAqB,CACnB,YAAe,CACb,YACA,SACF,CACF,EACA,8BAA+B,CAC7B,YAAe,CACb,YACA,UACF,CACF,EACA,yBAA0B,CACxB,YAAe,CACb,aACA,kBACF,CACF,EACA,6BAA8B,CAC5B,YAAe,CACb,aACA,kBACF,CACF,EACA,6BAA8B,CAC5B,YAAe,CACb,aACA,UACF,CACF,EACA,uCAAwC,CACtC,YAAe,CACb,YACA,SACF,CACF,EACA,yBAA0B,CACxB,YAAe,CACb,aACA,SACF,CACF,EACA,uBAAwB,CACtB,YAAe,CACb,aACA,UACF,CACF,EACA,eAAgB,CACd,YAAe,CACb,YACA,SACF,CACF,EACA,yBAA0B,CACxB,YAAe,CACb,oBACA,iBACF,CACF,EACA,iBAAkB,CAChB,YAAe,CACb,WACA,SACF,CACF,EACA,qBAAsB,CACpB,YAAe,CACb,aACA,UACF,CACF,EACA,0BAA2B,CACzB,YAAe,CACb,YACA,SACF,CACF,EACA,sBAAuB,CACrB,YAAe,CACb,YACA,SACF,CACF,EACA,wBAAyB,CACvB,YAAe,CACb,YACA,SACF,CACF,EACA,kCAAmC,CACjC,YAAe,CACb,YACA,SACF,CACF,EACA,cAAe,CACb,YAAe,CACb,YACA,SACF,CACF,EACA,8BAA+B,CAC7B,YAAe,CACb,YACA,SACF,CACF,EACA,oBAAqB,CACnB,YAAe,CACb,YACA,SACF,CACF,EACA,qBAAsB,CACpB,YAAe,CACb,WACA,QACF,CACF,EACA,2BAA4B,CAC1B,YAAe,CACb,YACA,SACF,CACF,EACA,8BAA+B,CAC7B,YAAe,CACb,aACA,UACF,CACF,EACA,gEAAiE,CAC/D,YAAe,CACb,YACA,SACF,CACF,EACA,gCAAiC,CAC/B,YAAe,CACb,oBACA,iBACF,CACF,EACA,wBAAyB,CACvB,YAAe,CACb,YACA,SACF,CACF,EACA,iBAAkB,CAChB,YAAe,CACb,YACA,SACF,CACF,EACA,2BAA4B,CAC1B,YAAe,CACb,YACA,SACF,CACF,EACA,yCAA0C,CACxC,YAAe,CACb,YACA,SACF,CACF,EACA,+CAAgD,CAC9C,YAAe,CACb,aACA,SACF,CACF,EACA,yBAA0B,CACxB,YAAe,CACb,oBACA,kBACF,CACF,EACA,kBAAmB,CACjB,YAAe,CACb,UACA,SACF,CACF,EACA,gCAAiC,CAC/B,YAAe,CACb,YACA,SACF,CACF,EACA,0BAA2B,CACzB,YAAe,CACb,YACA,SACF,CACF,EACA,kBAAmB,CACjB,YAAe,CACb,YACA,SACF,CACF,EACA,sBAAuB,CACrB,YAAe,CACb,aACA,UACF,CACF,EACA,gCAAiC,CAC/B,YAAe,CACb,aACA,UACF,CACF,EACA,qCAAsC,CACpC,YAAe,CACb,YACA,SACF,CACF,EACA,2BAA4B,CAC1B,YAAe,CACb,YACA,SACF,CACF,EACA,gDAAiD,CAC/C,YAAe,CACb,YACA,SACF,CACF,EACA,yBAA0B,CACxB,YAAe,CACb,YACA,QACF,CACF,EACA,yBAA0B,CACxB,YAAe,CACb,YACA,SACF,CACF,EACA,4BAA6B,CAC3B,YAAe,CACb,YACA,SACF,CACF,EACA,+BAAgC,CAC9B,YAAe,CACb,oBACA,kBACF,CACF,EACA,qBAAsB,CACpB,YAAe,CACb,oBACA,kBACF,CACF,EACA,qBAAsB,CACpB,YAAe,CACb,oBACA,kBACF,CACF,EACA,2BAA4B,CAC1B,YAAe,CACb,YACA,SACF,CACF,EACA,oBAAqB,CACnB,YAAe,CACb,aACA,UACF,CACF,EACA,4BAA6B,CAC3B,YAAe,CACb,YACA,SACF,CACF,EACA,2BAA4B,CAC1B,YAAe,CACb,YACA,SACF,CACF,EACA,8BAA+B,CAC7B,YAAe,CACb,YACA,SACF,CACF,EACA,uBAAwB,CACtB,YAAe,CACb,YACA,SACF,CACF,EACA,eAAgB,CACd,YAAe,CACb,WACA,QACF,CACF,EACA,+BAAgC,CAC9B,YAAe,CACb,YACA,UACF,CACF,EACA,6BAA8B,CAC5B,YAAe,CACb,YACA,SACF,CACF,EACA,yBAA0B,CACxB,YAAe,CACb,aACA,QACF,CACF,EACA,2BAA4B,CAC1B,YAAe,CACb,aACA,UACF,CACF,EACA,+BAAgC,CAC9B,YAAe,CACb,YACA,UACF,CACF,EACA,wBAAyB,CACvB,YAAe,CACb,YACA,SACF,CACF,EACA,0BAA2B,CACzB,YAAe,CACb,YACA,SACF,CACF,EACA,mBAAoB,CAClB,YAAe,CACb,aACA,UACF,CACF,EACA,6BAA8B,CAC5B,YAAe,CACb,aACA,kBACF,CACF,EACA,yBAA0B,CACxB,YAAe,CACb,aACA,kBACF,CACF,EACA,mBAAoB,CAClB,YAAe,CACb,aACA,kBACF,CACF,EACA,qBAAsB,CACpB,YAAe,CACb,YACA,UACF,CACF,EACA,yBAA0B,CACxB,YAAe,CACb,YACA,SACF,CACF,EACA,yBAA0B,CACxB,YAAe,CACb,YACA,SACF,CACF,EACA,kCAAmC,CACjC,YAAe,CACb,YACA,SACF,CACF,EACA,qBAAsB,CACpB,YAAe,CACb,YACA,SACF,CACF,EACA,uBAAwB,CACtB,YAAe,CACb,YACA,SACF,CACF,EACA,gCAAiC,CAC/B,YAAe,CACb,YACA,SACF,CACF,EACA,8BAA+B,CAC7B,YAAe,CACb,YACA,SACF,CACF,EACA,2BAA4B,CAC1B,YAAe,CACb,YACA,UACF,CACF,EACA,wCAAyC,CACvC,YAAe,CACb,aACA,UACF,CACF,EACA,0BAA2B,CACzB,YAAe,CACb,YACA,SACF,CACF,EACA,qBAAsB,CACpB,YAAe,CACb,YACA,QACF,CACF,EACA,iCAAkC,CAChC,YAAe,CACb,YACA,QACF,CACF,EACA,+BAAgC,CAC9B,YAAe,CACb,aACA,UACF,CACF,EACA,gDAAiD,CAC/C,YAAe,CACb,aACA,UACF,CACF,EACA,2BAA4B,CAC1B,YAAe,CACb,aACA,SACF,CACF,EACA,iBAAkB,CAChB,YAAe,CACb,aACA,SACF,CACF,EACA,iEAAkE,CAChE,YAAe,CACb,YACA,SACF,CACF,EACA,+BAAgC,CAC9B,YAAe,CACb,aACA,UACF,CACF,EACA,wCAAyC,CACvC,YAAe,CACb,YACA,SACF,CACF,EACA,eAAgB,CACd,YAAe,CACb,YACA,SACF,CACF,EACA,8BAA+B,CAC7B,YAAe,CACb,aACA,SACF,CACF,EACA,uBAAwB,CACtB,YAAe,CACb,WACA,SACF,CACF,EACA,QAAW,CACT,YAAe,CACb,YACA,SACF,CACF,EACA,gCAAiC,CAC/B,YAAe,CACb,aACA,UACF,CACF,EACA,0CAA2C,CACzC,YAAe,CACb,WACA,SACF,CACF,EACA,gCAAiC,CAC/B,YAAe,CACb,YACA,SACF,CACF,EACA,qBAAsB,CACpB,YAAe,CACb,YACA,QACF,CACF,EACA,uBAAwB,CACtB,YAAe,CACb,YACA,SACF,CACF,EACA,qCAAsC,CACpC,YAAe,CACb,YACA,SACF,CACF,EACA,qCAAsC,CACpC,YAAe,CACb,YACA,SACF,CACF,EACA,kCAAmC,CACjC,YAAe,CACb,YACA,kBACF,CACF,EACA,4BAA6B,CAC3B,YAAe,CACb,WACA,SACF,CACF,EACA,4CAA6C,CAC3C,YAAe,CACb,YACA,iBACF,CACF,EACA,kCAAmC,CACjC,YAAe,CACb,YACA,iBACF,CACF,EACA,sBAAuB,CACrB,YAAe,CACb,YACA,SACF,CACF,EACA,2BAA4B,CAC1B,YAAe,CACb,aACA,SACF,CACF,EACA,oCAAqC,CACnC,YAAe,CACb,aACA,SACF,CACF,EACA,4BAA6B,CAC3B,YAAe,CACb,YACA,SACF,CACF,EACA,0BAA2B,CACzB,YAAe,CACb,YACA,SACF,CACF,EACA,iCAAkC,CAChC,YAAe,CACb,YACA,SACF,CACF,EACA,iCAAkC,CAChC,YAAe,CACb,WACA,QACF,CACF,EACA,uBAAwB,CACtB,YAAe,CACb,YACA,SACF,CACF,EACA,2BAA4B,CAC1B,YAAe,CACb,YACA,SACF,CACF,EACA,gCAAiC,CAC/B,YAAe,CACb,YACA,SACF,CACF,EACA,uBAAwB,CACtB,YAAe,CACb,YACA,SACF,CACF,EACA,2BAA4B,CAC1B,YAAe,CACb,gBACA,kBACF,CACF,EACA,yBAA0B,CACxB,YAAe,CACb,YACA,SACF,CACF,EACA,6BAA8B,CAC5B,YAAe,CACb,YACA,SACF,CACF,EACA,mBAAoB,CAClB,YAAe,CACb,WACA,SACF,CACF,EACA,4BAA6B,CAC3B,YAAe,CACb,YACA,SACF,CACF,EACA,0BAA2B,CACzB,YAAe,CACb,YACA,SACF,CACF,EACA,oBAAqB,CACnB,YAAe,CACb,YACA,SACF,CACF,EACA,mBAAoB,CAClB,YAAe,CACb,YACA,SACF,CACF,EACA,6BAA8B,CAC5B,YAAe,CACb,YACA,SACF,CACF,EACA,0CAA2C,CACzC,YAAe,CACb,YACA,SACF,CACF,EACA,wBAAyB,CACvB,YAAe,CACb,YACA,SACF,CACF,EACA,iBAAkB,CAChB,YAAe,CACb,YACA,SACF,CACF,EACA,mBAAoB,CAClB,YAAe,CACb,aACA,UACF,CACF,EACA,iBAAkB,CAChB,YAAe,CACb,YACA,SACF,CACF,EACA,kCAAmC,CACjC,YAAe,CACb,YACA,SACF,CACF,EACA,oCAAqC,CACnC,YAAe,CACb,YACA,SACF,CACF,EACA,oBAAqB,CACnB,YAAe,CACb,YACA,SACF,CACF,EACA,uBAAwB,CACtB,YAAe,CACb,WACA,SACF,CACF,EACA,gCAAiC,CAC/B,YAAe,CACb,YACA,SACF,CACF,EACA,uEAAwE,CACtE,YAAe,CACb,cACA,WACF,CACF,EACA,mCAAoC,CAClC,YAAe,CACb,YACA,UACF,CACF,EACA,qBAAsB,CACpB,YAAe,CACb,YACA,SACF,CACF,EACA,0BAA2B,CACzB,YAAe,CACb,oBACA,iBACF,CACF,EACA,kCAAmC,CACjC,YAAe,CACb,WACA,SACF,CACF,EACA,gCAAiC,CAC/B,YAAe,CACb,YACA,QACF,CACF,EACA,sBAAuB,CACrB,YAAe,CACb,YACA,QACF,CACF,EACA,eAAgB,CACd,YAAe,CACb,YACA,SACF,CACF,EACA,2BAA4B,CAC1B,YAAe,CACb,aACA,UACF,CACF,EACA,0BAA2B,CACzB,YAAe,CACb,YACA,SACF,CACF,EACA,gBAAiB,CACf,YAAe,CACb,YACA,SACF,CACF,EACA,sBAAuB,CACrB,YAAe,CACb,aACA,UACF,CACF,EACA,+BAAgC,CAC9B,YAAe,CACb,aACA,UACF,CACF,EACA,8BAA+B,CAC7B,YAAe,CACb,YACA,SACF,CACF,EACA,eAAgB,CACd,YAAe,CACb,aACA,UACF,CACF,EACA,0BAA2B,CACzB,YAAe,CACb,YACA,SACF,CACF,EACA,0BAA2B,CACzB,YAAe,CACb,YACA,SACF,CACF,EACA,kCAAmC,CACjC,YAAe,CACb,aACA,SACF,CACF,EACA,gBAAiB,CACf,YAAe,CACb,YACA,SACF,CACF,EACA,yBAA0B,CACxB,YAAe,CACb,YACA,QACF,CACF,EACA,4BAA6B,CAC3B,YAAe,CACb,YACA,QACF,CACF,EACA,6BAA8B,CAC5B,YAAe,CACb,YACA,UACF,CACF,EACA,iCAAkC,CAChC,YAAe,CACb,YACA,UACF,CACF,EACA,4BAA6B,CAC3B,YAAe,CACb,aACA,kBACF,CACF,EACA,2BAA4B,CAC1B,YAAe,CACb,WACA,SACF,CACF,EACA,oCAAqC,CACnC,YAAe,CACb,YACA,SACF,CACF,EACA,0BAA2B,CACzB,YAAe,CACb,YACA,SACF,CACF,EACA,+BAAgC,CAC9B,YAAe,CACb,YACA,SACF,CACF,EACA,sBAAuB,CACrB,YAAe,CACb,YACA,SACF,CACF,EACA,wCAAyC,CACvC,YAAe,CACb,YACA,SACF,CACF,EACA,0CAA2C,CACzC,YAAe,CACb,aACA,UACF,CACF,EACA,uCAAwC,CACtC,YAAe,CACb,aACA,SACF,CACF,EACA,kCAAmC,CACjC,YAAe,CACb,YACA,SACF,CACF,EACA,0BAA2B,CACzB,YAAe,CACb,YACA,SACF,CACF,EACA,wBAAyB,CACvB,YAAe,CACb,aACA,UACF,CACF,EACA,6BAA8B,CAC5B,YAAe,CACb,YACA,SACF,CACF,EACA,wBAAyB,CACvB,YAAe,CACb,YACA,SACF,CACF,EACA,yBAA0B,CACxB,YAAe,CACb,YACA,SACF,CACF,EACA,4BAA6B,CAC3B,YAAe,CACb,WACA,SACF,CACF,EACA,6BAA8B,CAC5B,YAAe,CACb,YACA,QACF,CACF,EACA,mCAAoC,CAClC,YAAe,CACb,YACA,UACF,CACF,EACA,iCAAkC,CAChC,YAAe,CACb,YACA,SACF,CACF,EACA,0CAA2C,CACzC,YAAe,CACb,YACA,SACF,CACF,EACA,uBAAwB,CACtB,YAAe,CACb,YACA,SACF,CACF,EACA,+BAAgC,CAC9B,YAAe,CACb,YACA,UACF,CACF,EACA,0BAA2B,CACzB,YAAe,CACb,aACA,UACF,CACF,EACA,4BAA6B,CAC3B,YAAe,CACb,oBACA,SACF,CACF,EACA,2BAA4B,CAC1B,YAAe,CACb,YACA,SACF,CACF,EACA,OAAU,CACR,YAAe,CACb,YACA,SACF,CACF,EACA,4BAA6B,CAC3B,YAAe,CACb,YACA,SACF,CACF,EACA,6BAA8B,CAC5B,YAAe,CACb,YACA,SACF,CACF,EACA,+BAAgC,CAC9B,YAAe,CACb,YACA,SACF,CACF,EACA,oCAAqC,CACnC,YAAe,CACb,YACA,SACF,CACF,EACA,qBAAsB,CACpB,YAAe,CACb,YACA,SACF,CACF,EACA,8BAA+B,CAC7B,YAAe,CACb,YACA,SACF,CACF,EACA,6BAA8B,CAC5B,YAAe,CACb,aACA,UACF,CACF,EACA,gBAAiB,CACf,YAAe,CACb,YACA,SACF,CACF,EACA,iCAAkC,CAChC,YAAe,CACb,YACA,SACF,CACF,EACA,6BAA8B,CAC5B,YAAe,CACb,aACA,UACF,CACF,EACA,mCAAoC,CAClC,YAAe,CACb,YACA,SACF,CACF,EACA,yBAA0B,CACxB,YAAe,CACb,YACA,SACF,CACF,EACA,gCAAiC,CAC/B,YAAe,CACb,YACA,SACF,CACF,EACA,sBAAuB,CACrB,YAAe,CACb,YACA,SACF,CACF,EACA,0BAA2B,CACzB,YAAe,CACb,YACA,UACF,CACF,EACA,iBAAkB,CAChB,YAAe,CACb,WACA,QACF,CACF,EACA,iBAAkB,CAChB,YAAe,CACb,YACA,SACF,CACF,EACA,uBAAwB,CACtB,YAAe,CACb,YACA,UACF,CACF,EACA,2BAA4B,CAC1B,YAAe,CACb,YACA,SACF,CACF,EACA,6BAA8B,CAC5B,YAAe,CACb,YACA,SACF,CACF,EACA,uBAAwB,CACtB,YAAe,CACb,YACA,kBACF,CACF,EACA,wCAAyC,CACvC,YAAe,CACb,YACA,kBACF,CACF,EACA,yBAA0B,CACxB,YAAe,CACb,aACA,UACF,CACF,EACA,4BAA6B,CAC3B,YAAe,CACb,YACA,SACF,CACF,EACA,mBAAoB,CAClB,YAAe,CACb,WACA,SACF,CACF,EACA,0BAA2B,CACzB,YAAe,CACb,YACA,SACF,CACF,EACA,oBAAqB,CACnB,YAAe,CACb,aACA,UACF,CACF,EACA,sBAAuB,CACrB,YAAe,CACb,aACA,UACF,CACF,EACA,gCAAiC,CAC/B,YAAe,CACb,YACA,SACF,CACF,EACA,sBAAuB,CACrB,YAAe,CACb,YACA,SACF,CACF,EACA,2BAA4B,CAC1B,YAAe,CACb,YACA,SACF,CACF,EACA,8BAA+B,CAC7B,YAAe,CACb,YACA,SACF,CACF,EACA,qCAAsC,CACpC,YAAe,CACb,YACA,SACF,CACF,EACA,0CAA2C,CACzC,YAAe,CACb,YACA,SACF,CACF,EACA,oBAAqB,CACnB,YAAe,CACb,YACA,SACF,CACF,EACA,yBAA0B,CACxB,YAAe,CACb,YACA,SACF,CACF,EACA,mCAAoC,CAClC,YAAe,CACb,YACA,SACF,CACF,EACA,2CAA4C,CAC1C,YAAe,CACb,YACA,SACF,CACF,EACA,8BAA+B,CAC7B,YAAe,CACb,YACA,SACF,CACF,EACA,iCAAkC,CAChC,YAAe,CACb,YACA,SACF,CACF,EACA,gCAAiC,CAC/B,YAAe,CACb,aACA,UACF,CACF,EACA,oCAAqC,CACnC,YAAe,CACb,aACA,UACF,CACF,EACA,iCAAkC,CAChC,YAAe,CACb,YACA,SACF,CACF,EACA,oDAAqD,CACnD,YAAe,CACb,YACA,SACF,CACF,EACA,yBAA0B,CACxB,YAAe,CACb,YACA,UACF,CACF,EACA,4BAA6B,CAC3B,YAAe,CACb,YACA,UACF,CACF,EACA,4BAA6B,CAC3B,YAAe,CACb,YACA,SACF,CACF,EACA,4BAA6B,CAC3B,YAAe,CACb,YACA,SACF,CACF,EACA,+BAAgC,CAC9B,YAAe,CACb,aACA,SACF,CACF,EACA,kCAAmC,CACjC,YAAe,CACb,aACA,UACF,CACF,EACA,8BAA+B,CAC7B,YAAe,CACb,aACA,UACF,CACF,EACA,2BAA4B,CAC1B,YAAe,CACb,YACA,SACF,CACF,EACA,sCAAuC,CACrC,YAAe,CACb,YACA,SACF,CACF,EACA,qCAAsC,CACpC,YAAe,CACb,YACA,SACF,CACF,EACA,iCAAkC,CAChC,YAAe,CACb,YACA,SACF,CACF,EACA,wCAAyC,CACvC,YAAe,CACb,WACA,SACF,CACF,EACA,kCAAmC,CACjC,YAAe,CACb,YACA,SACF,CACF,EACA,mBAAoB,CAClB,YAAe,CACb,YACA,SACF,CACF,EACA,+BAAgC,CAC9B,YAAe,CACb,YACA,SACF,CACF,EACA,0BAA2B,CACzB,YAAe,CACb,YACA,SACF,CACF,EACA,6BAA8B,CAC5B,YAAe,CACb,aACA,UACF,CACF,EACA,mCAAoC,CAClC,YAAe,CACb,aACA,UACF,CACF,EACA,2BAA4B,CAC1B,YAAe,CACb,YACA,SACF,CACF,EACA,qCAAsC,CACpC,YAAe,CACb,YACA,SACF,CACF,EACA,iCAAkC,CAChC,YAAe,CACb,aACA,UACF,CACF,EACA,uCAAwC,CACtC,YAAe,CACb,YACA,SACF,CACF,EACA,gCAAiC,CAC/B,YAAe,CACb,YACA,SACF,CACF,EACA,sBAAuB,CACrB,YAAe,CACb,WACA,QACF,CACF,EACA,6BAA8B,CAC5B,YAAe,CACb,YACA,SACF,CACF,EACA,kCAAmC,CACjC,YAAe,CACb,YACA,SACF,CACF,EACA,2BAA4B,CAC1B,YAAe,CACb,YACA,QACF,CACF,EACA,4BAA6B,CAC3B,YAAe,CACb,YACA,SACF,CACF,EACA,oCAAqC,CACnC,YAAe,CACb,YACA,SACF,CACF,EACA,+BAAgC,CAC9B,YAAe,CACb,YACA,kBACF,CACF,EACA,sBAAuB,CACrB,YAAe,CACb,YACA,SACF,CACF,EACA,4BAA6B,CAC3B,YAAe,CACb,aACA,UACF,CACF,EACA,4BAA6B,CAC3B,YAAe,CACb,YACA,SACF,CACF,EACA,qBAAsB,CACpB,YAAe,CACb,UACA,QACF,CACF,EACA,uBAAwB,CACtB,YAAe,CACb,YACA,SACF,CACF,EACA,8BAA+B,CAC7B,YAAe,CACb,YACA,SACF,CACF,EACA,uBAAwB,CACtB,YAAe,CACb,YACA,QACF,CACF,EACA,eAAgB,CACd,YAAe,CACb,YACA,SACF,CACF,EACA,uDAAwD,CACtD,YAAe,CACb,YACA,SACF,CACF,EACA,6CAA8C,CAC5C,YAAe,CACb,WACA,QACF,CACF,EACA,iBAAkB,CAChB,YAAe,CACb,YACA,kBACF,CACF,EACA,yBAA0B,CACxB,YAAe,CACb,YACA,UACF,CACF,EACA,+BAAgC,CAC9B,YAAe,CACb,YACA,SACF,CACF,EACA,2BAA4B,CAC1B,YAAe,CACb,YACA,SACF,CACF,EACA,iCAAkC,CAChC,YAAe,CACb,aACA,UACF,CACF,EACA,mBAAoB,CAClB,YAAe,CACb,aACA,UACF,CACF,EACA,kBAAmB,CACjB,YAAe,CACb,aACA,UACF,CACF,EACA,0BAA2B,CACzB,YAAe,CACb,YACA,SACF,CACF,CACF,EC7mDF,SAASC,GAAqBC,EAAQ,CACpC,MAAO,CACL,CACE,GAAI,aACJ,KAAM,aACN,MAAO,CACL,mBAAoB,OACtB,CACF,EACA,CACE,GAAI,UACJ,KAAM,OACN,OAAAA,EACA,eAAgB,UAChB,MAAO,CACL,aAAc,UACd,eAAgB,EAClB,CACF,EACA,CACE,GAAI,UACJ,KAAM,OACN,OAAAA,EACA,eAAgB,UAChB,MAAO,CACL,aAAc,QACd,eAAgB,GAClB,CACF,EACA,CACE,GAAI,QACJ,KAAM,OACN,OAAAA,EACA,eAAgB,QAChB,MAAO,CACL,aAAc,UACd,eAAgB,EAClB,CACF,EACA,CACE,GAAI,WACJ,KAAM,OACN,OAAAA,EACA,eAAgB,WAChB,MAAO,CACL,aAAc,UACd,eAAgB,EAClB,CACF,EACA,CACE,GAAI,YACJ,KAAM,OACN,OAAAA,EACA,eAAgB,YAChB,MAAO,CACL,aAAc,UACd,eAAgB,EAClB,CACF,EACA,CACE,GAAI,QACJ,KAAM,OACN,OAAAA,EACA,eAAgB,QAChB,MAAO,CACL,aAAc,QACd,eAAgB,EAClB,CACF,EACA,CACE,GAAI,aACJ,KAAM,OACN,OAAAA,EACA,eAAgB,aAChB,MAAO,CACL,aAAc,UACd,eAAgB,EAClB,CACF,EACA,CACE,GAAI,UACJ,KAAM,OACN,OAAAA,EACA,eAAgB,UAChB,MAAO,CACL,aAAc,UACd,eAAgB,EAClB,CACF,EACA,CACE,GAAI,OACJ,KAAM,SACN,OAAAA,EACA,eAAgB,OAChB,MAAO,CACL,gBAAiB,EACjB,eAAgB,UAChB,iBAAkB,EACpB,CACF,EACA,CACE,GAAI,SACJ,KAAM,SACN,OAAAA,EACA,eAAgB,SAChB,MAAO,CACL,gBAAiB,EACjB,eAAgB,UAChB,iBAAkB,EACpB,CAC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,EAAG,CAAC,KAAM,YAAa,OAAO,CAAC,EACpE,MAAO,CACL,aAAcE,EAAE,qBAChB,iBAAkB,CAChB,cACA,CAAC,cAAe,GAAG,EACnB,CAAC,MAAM,EACP,GACA,EACA,KACA,GACA,GACA,EACF,CACF,EACA,OAAQ,CACN,WAAYC,CACd,CACF,EACA,CACE,GAAI,6BACJ,KAAM,OACN,OAAAH,EACA,eAAgB,QAChB,OAAQ,CACN,MACA,CAAC,IAAK,aAAc,CAAC,EACrB,CAAC,KAAM,YAAa,YAAY,CAClC,EACA,MAAO,CACL,aAAcE,EAAE,qBAChB,iBAAkB,CAChB,cACA,CAAC,cAAe,GAAG,EACnB,CAAC,MAAM,EACP,GACA,EACA,KACA,GACA,GACA,EACF,EACA,aAAc,CACZ,cACA,CAAC,cAAe,GAAG,EACnB,CAAC,MAAM,EACP,GACA,EACA,KACA,CACF,CACF,EACA,OAAQ,CACN,WAAYC,CACd,CACF,EACA,CACE,GAAI,8BACJ,KAAM,OACN,OAAAH,EACA,eAAgB,QAChB,OAAQ,CACN,MACA,CAAC,IAAK,aAAc,CAAC,EACrB,CAAC,KAAM,YAAa,aAAa,CACnC,EACA,MAAO,CACL,aAAcE,EAAE,sBAChB,iBAAkB,CAChB,cACA,CAAC,cAAe,GAAG,EACnB,CAAC,MAAM,EACP,EACA,EACA,IACA,GACA,GACA,EACF,EACA,aAAc,CACZ,cACA,CAAC,cAAe,GAAG,EACnB,CAAC,MAAM,EACP,GACA,EACA,KACA,CACF,CACF,EACA,OAAQ,CACN,WAAYC,CACd,CACF,EACA,CACE,GAAI,6BACJ,KAAM,OACN,OAAAH,EACA,eAAgB,QAChB,OAAQ,CACN,MACA,CAAC,IAAK,aAAc,CAAC,EACrB,CAAC,KAAM,YAAa,YAAY,CAClC,EACA,MAAO,CACL,aAAcE,EAAE,qBAChB,iBAAkB,CAChB,cACA,CAAC,cAAe,GAAG,EACnB,CAAC,MAAM,EACP,EACA,EACA,IACA,GACA,GACA,EACF,EACA,a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iB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,MAAM,OAAO,CACpB,CAEA,QAAQuB,EAAWgC,EAAoB,CACrC,KAAK,MACF,OAAQvD,GAAMA,EAAE,OAASuB,CAAC,EAC1B,QAASvB,GAAM,CACdA,EAAE,QAAUuD,CACd,CAAC,EACH,KAAK,qBAAqB,EAC1B,KAAK,MAAM,OAAO,CACpB,CAEA,KAAKhC,EAAiB,CACpB,KAAK,MAAM,QAASvB,GAAM,CACxBA,EAAE,QAAUA,EAAE,OAASuB,CACzB,CAAC,EACD,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,MAAM,OAAO,CACpB,CAEA,OAAc,CAKZ,IAAMiC,EAJMhC,GAAS,IAAI,EAAE,QAAQ,qBAAqB,EAItC,SAAS,EAAE,MAAM,EAAG,EAAE,EACxC,KAAK,KAAKgC,CAAK,CACjB,CAEA,UAAiB,CAEf,IAAMC,EADMjC,GAAS,IAAI,EAAE,QAAQ,qBAAqB,EACnC,KAAK,CAAE,MAAO,EAAG,CAAC,EAAE,SAAS,EAAE,MAAM,EAAG,EAAE,EAC/D,KAAK,KAAKiC,CAAQ,CACpB,CAEA,WAAWlC,EAAoB,CAC7B,OAAO,KAAK,MAAM,OAAQvB,GAAMA,EAAE,OAASuB,CAAC,EAAE,KAAMvB,GAAMA,EAAE,OAAO,CACrE,CACF,EAEA,IAAIlB", "names": ["maplibregl$1", "maplibregl", "require_immutable", "__commonJSMin", "exports", "module", "extend", "hasOwnProperty", "target", "i", "source", "key", "require_fuzzy", "__commonJSMin", "exports", "module", "root", "fuzzy", "pattern", "array", "str", "opts", "patternIdx", "result", "len", "totalScore", "currScore", "pre", "post", "compareString", "ch", "idx", "arr", "prev", "element", "rendered", "a", "b", "compare", "require_list", "__commonJSMin", "exports", "module", "List", "component", "item", "i", "active", "li", "a", "index", "msg", "require_suggestions", "__commonJSMin", "exports", "module", "extend", "fuzzy", "List", "Suggestions", "el", "data", "options", "e", "keyCode", "self", "query", "i", "revisedData", "value", "candidate", "callback", "d", "results", "item", "renderedString", "sourceFormatting", "boldString", "indexString", "indexOfQuery", "endIndexOfQuery", "msg", "require_suggestions", "__commonJSMin", "exports", "module", "Suggestions", "require_lodash", "__commonJSMin", "exports", "module", "FUNC_ERROR_TEXT", "NAN", "symbolTag", "reTrim", "reIsBadHex", "reIsBinary", "reIsOctal", "freeParseInt", "freeGlobal", "freeSelf", "root", "objectProto", "objectToString", "nativeMax", "nativeMin", "now", "debounce", "func", "wait", "options", "lastArgs", "lastThis", "maxWait", "result", "timerId", "lastCallTime", "lastInvokeTime", "leading", "maxing", "trailing", "toNumber", "isObject", "invokeFunc", "time", "args", "thisArg", "leadingEdge", "timerExpired", "remainingWait", "timeSinceLastCall", "timeSinceLastInvoke", "shouldInvoke", "trailingEdge", "cancel", "flush", "debounced", "isInvoking", "value", "type", "isObjectLike", "isSymbol", "other", "isBinary", "require_events", "__commonJSMin", "exports", "module", "R", "ReflectApply", "target", "receiver", "args", "ReflectOwnKeys", "ProcessEmitWarning", "warning", "NumberIsNaN", "value", "EventEmitter", "once", "defaultMaxListeners", "checkListener", "listener", "arg", "n", "_getMaxListeners", "that", "type", "i", "doError", "events", "er", "err", "handler", "len", "listeners", "arrayClone", "_addListener", "prepend", "m", "existing", "w", "onceWrapper", "_onceWrap", "state", "wrapped", "list", "position", "originalListener", "spliceOne", "keys", "key", "_listeners", "unwrap", "evlistener", "unwrapListeners", "emitter", "listenerCount", "arr", "copy", "index", "ret", "name", "resolve", "reject", "errorListener", "resolver", "eventTargetAgnosticAddListener", "addErrorHandlerIfEventEmitter", "flags", "wrapListener", "require_exceptions", "__commonJSMin", "exports", "module", "require_parse_link_header", "__commonJSMin", "exports", "module", "parseParam", "param", "parts", "parseLink", "link", "linkUrl", "linkParams", "rel", "parsedLinkParams", "result", "parsed", "parseLinkHeader", "linkHeader", "splitRel", "require_mapi_response", "__commonJSMin", "exports", "module", "parseLinkHeader", "MapiResponse", "request", "responseData", "require_constants", "__commonJSMin", "exports", "module", "require_mapi_error", "__commonJSMin", "exports", "module", "constants", "MapiError", "options", "errorType", "body", "message", "require_parse_headers", "__commonJSMin", "exports", "module", "parseSingleHeader", "raw", "boundary", "name", "value", "parseHeaders", "headers", "rawHeader", "parsed", "require_browser_layer", "__commonJSMin", "exports", "module", "MapiResponse", "MapiError", "constants", "parseHeaders", "requestsUnderway", "browserAbort", "request", "xhr", "createResponse", "normalizeBrowserProgressEvent", "event", "total", "transferred", "percent", "sendRequestXhr", "resolve", "reject", "file", "error", "mapiError", "body", "createRequestXhr", "accessToken", "url", "key", "browserSend", "require_base64", "__commonJSMin", "exports", "module", "root", "freeExports", "freeModule", "freeGlobal", "InvalidCharacterError", "message", "error", "TABLE", "REGEX_SPACE_CHARACTERS", "decode", "input", "length", "bitCounter", "bitStorage", "buffer", "output", "position", "encode", "padding", "a", "b", "c", "d", "base64", "key", "require_parse_mapbox_token", "__commonJSMin", "exports", "module", "base64", "tokenCache", "parseToken", "token", "parts", "usage", "rawPayload", "parsedPayload", "parsePaylod", "result", "has", "obj", "key", "require_eventemitter3", "__commonJSMin", "exports", "module", "has", "prefix", "Events", "EE", "fn", "context", "once", "addListener", "emitter", "event", "listener", "evt", "clearEvent", "EventEmitter", "names", "events", "name", "handlers", "i", "l", "ee", "listeners", "a1", "a2", "a3", "a4", "a5", "len", "args", "length", "j", "require_url_utils", "__commonJSMin", "exports", "module", "encodeArray", "arrayValue", "encodeValue", "value", "appendQueryParam", "url", "key", "punctuation", "query", "appendQueryObject", "queryObject", "result", "v", "prependOrigin", "origin", "delimiter", "interpolateRouteParams", "route", "params", "_", "paramId", "preppedValue", "require_mapi_request", "__commonJSMin", "exports", "module", "parseToken", "xtend", "EventEmitter", "urlUtils", "constants", "requestId", "MapiRequest", "client", "options", "defaultHeaders", "headersWithDefaults", "headers", "memo", "name", "accessToken", "url", "routeParams", "actualAccessToken", "accessTokenOwnerId", "self", "response", "error", "callback", "handleResponse", "getNextPage", "nextPageRequest", "getPage", "handleError", "request", "extendedOptions", "require_mapi_client", "__commonJSMin", "exports", "module", "parseToken", "MapiRequest", "constants", "MapiClient", "options", "requestOptions", "require_browser_client", "__commonJSMin", "exports", "module", "browser", "MapiClient", "BrowserClient", "options", "createBrowserClient", "require_mapbox_sdk", "__commonJSMin", "exports", "module", "client", "require_is_plain_obj", "__commonJSMin", "exports", "module", "toString", "x", "prototype", "require_lib", "__commonJSMin", "exports", "module", "isPlainObject", "xtend", "DEFAULT_ERROR_PATH", "NEWLINE_INDENT", "v", "rootValidator", "options", "value", "message", "validate", "errorMessage", "processMessage", "validatorObj", "validators", "objectEntries", "validationResult", "key", "validator", "errorMessages", "i", "renderedMessage", "objectId", "ofPhrase", "shapeValidator", "shapeResult", "invalidKeys", "memo", "valueKey", "createArrayValidator", "validatingTuple", "getValidator", "index", "requiredValidator", "formatErrorMessage", "isArrayCulprit", "messages", "orList", "m", "max", "arr", "compareWith", "min", "result", "len", "path", "prettifyResult", "list", "addArticle", "nounPhrase", "prettyResult", "arrayCulprit", "output", "prepend", "obj", "require_validator", "__commonJSMin", "exports", "module", "xtend", "v", "file", "value", "assertShape", "validatorObj", "apiName", "date", "msg", "coordinates", "require_pick", "__commonJSMin", "exports", "module", "pick", "source", "keys", "filter", "key", "val", "result", "require_object_map", "__commonJSMin", "exports", "module", "objectMap", "obj", "cb", "result", "key", "require_stringify_booleans", "__commonJSMin", "exports", "module", "objectMap", "stringifyBoolean", "obj", "_", "value", "require_create_service_factory", "__commonJSMin", "exports", "module", "MapiClient", "createClient", "createServiceFactory", "ServicePrototype", "clientOrConfig", "client", "service", "require_geocoding", "__commonJSMin", "exports", "module", "xtend", "v", "pick", "stringifyBooleans", "createServiceFactory", "Geocoding", "featureTypes", "config", "query", "urlAlphabet", "init_url_alphabet", "__esmMin", "index_browser_exports", "__export", "customAlphabet", "customRandom", "nanoid", "random", "urlAlphabet", "init_index_browser", "__esmMin", "init_url_alphabet", "bytes", "alphabet", "defaultSize", "getRandom", "mask", "step", "size", "id", "j", "byte", "require_events", "__commonJSMin", "exports", "module", "nanoid", "MapboxEventManager", "options", "selected", "geocoder", "payload", "keyEvent", "callback", "err", "event", "eventArgs", "proximity", "ipProximityHeader", "zoom", "resultIndex", "results", "opts", "xhttp", "header", "headerValue", "selectedID", "resultIDs", "feature", "selectedIdx", "searchStartRequiredProps", "searchKeystrokeRequiredProps", "searchSelectRequiredProps", "obj", "requiredProps", "prop", "evt", "forceFlush", "require_localization", "__commonJSMin", "exports", "module", "placeholder", "require_subtag", "__commonJSMin", "exports", "module", "root", "name", "make", "empty", "pattern", "match", "tag", "split", "v", "i", "api", "expose", "target", "key", "value", "part", "position", "type", "method", "require_geolocation", "__commonJSMin", "exports", "module", "Geolocation", "positionOptions", "resolve", "reject", "require_utils", "__commonJSMin", "exports", "module", "transformFeatureToGeolocationText", "feature", "accuracy", "addrInfo", "getAddressInfo", "addressAccuracy", "currentAccuracy", "accuracyIndex", "acc", "name", "houseNumber", "street", "placeName", "context", "layer", "REVERSE_GEOCODE_COORD_RGX", "require_lib", "__commonJSMin", "exports", "module", "Typeahead", "debounce", "extend", "EventEmitter", "exceptions", "MapboxClient", "mbxGeocoder", "MapboxEventManager", "localization", "subtag", "Geolocation", "utils", "GEOCODE_REQUEST_TYPE", "getFooterNode", "div", "MapboxGeocoder", "options", "item", "placeName", "container", "addToExistingContainer", "geocoder", "el", "parent", "map", "searchIcon", "e", "actions", "buttonIcon", "geolocateIcon", "typeahead", "parentDraw", "footerNode", "geolocationPosition", "geojson", "config", "text", "resp", "feature", "locationText", "error", "name", "path", "icon", "value", "ESC_KEY_CODE", "TAB_KEY_CODE", "target", "selected", "flyOptions", "bbox", "defaultFlyOptions", "search", "type", "requestType", "keys", "spacesOrCommaRgx", "self", "key", "isCoordKey", "lng", "lat", "coords", "c", "trimmedSearch", "searchInput", "request", "localGeocoderRes", "externalGeocoderRes", "geocoderError", "response", "res", "features", "err", "ev", "ctx", "results", "result", "center", "errorMessage", "msg", "firstLanguage", "language", "localizedValue", "showSuggestions", "proximity", "disableTrackProximity", "fn", "browserLocale", "zoom", "flyTo", "placeholder", "countries", "types", "minLength", "limit", "filter", "origin", "accessToken", "code", "defaultMarkerOptions", "markerOptions", "import_maplibre_gl", "import_mapbox_gl_geocoder", "venues", "debug_layers_default", "source", "nolabels_layers", "c", "casingVisibility", "labels_layers", "LIGHT", "DARK", "WHITE", "BLACK", "GRAYSCALE", "colors_default", "src_default", "variant", "theme", "__async", "__this", "__arguments", "generator", "resolve", "reject", "fulfilled", "value", "step", "e", "rejected", "x", "u8", "u16", "i32", "fleb", "fdeb", "clim", "freb", "eb", "start", "b", "i", "r", "j", "_a", "fl", "revfl", "_b", "fd", "revfd", "rev", "hMap", "cd", "mb", "s", "l", "le", "co", "rvb", "sv", "r_1", "v", "m", "flt", "fdt", "flrm", "fdrm", "max", "a", "bits", "d", "p", "o", "bits16", "shft", "slc", "n", "ec", "err", "ind", "msg", "nt", "inflt", "dat", "st", "buf", "dict", "sl", "dl", "noBuf", "noSt", "cbuf", "l2", "bl", "nbuf", "final", "pos", "bt", "lm", "dm", "lbt", "dbt", "tbts", "type", "hLit", "hcLen", "tl", "ldt", "clt", "clb", "clbmsk", "clm", "c", "lt", "dt", "t", "lms", "dms", "lpos", "sym", "add", "dsym", "end", "shift2", "dend", "et", "gzs", "flg", "zs", "gzl", "zls", "inflateSync", "data", "opts", "gunzipSync", "unzlibSync", "decompressSync", "td", "tds", "shift", "unshift", "getUint24", "view", "getUint48", "compare", "tz", "tx", "ty", "y", "queryLeafdir", "z", "offset_len", "queryView", "queryTile", "cmp", "entrySort", "parseEntry", "dataview", "z_raw", "sortDir", "entries", "createDirectory", "buffer", "arr", "entry", "deriveLeaf", "tile", "numEntries", "leaf_level", "level_diff", "leaf_x", "leaf_y", "getHeader", "source", "resp", "json_size", "root_entries", "dec", "json_metadata", "tile_compression", "minzoom", "maxzoom", "center_lon", "center_lat", "center_zoom", "min_lon", "min_lat", "max_lon", "max_lat", "split", "getZxy", "header", "cache", "signal", "root_dir", "tile_data", "leafcoords", "leafdir_entry", "leaf_dir", "tile_entry", "v2_default", "Protocol", "params", "callback", "pmtiles_url", "instance", "PMTiles", "h", "tilejson", "e", "re", "result", "z", "x", "y", "controller", "signal", "cancel", "header", "resp", "p", "url", "toNum", "low", "high", "readVarintRemainder", "buf", "b", "readVarint", "val", "rotate", "n", "xy", "rx", "ry", "t", "tzValues", "zxyToTileId", "z", "x", "y", "acc", "n", "rx", "ry", "d", "xy", "s", "rotate", "defaultDecompress", "buf", "compression", "__async", "decompressSync", "result", "HEADER_SIZE_BYTES", "findTile", "entries", "tileId", "m", "n", "k", "cmp", "FetchSource", "url", "customHeaders", "offset", "length", "signal", "__async", "controller", "requestHeaders", "resp", "content_range", "actual_length", "content_length", "getUint64", "v", "wh", "wl", "bytesToHeader", "bytes", "etag", "spec_version", "deserializeIndex", "buffer", "p", "numEntries", "readVarint", "entries", "lastId", "i", "detectVersion", "a", "EtagMismatch", "getHeaderAndRoot", "source", "decompress", "prefetch", "current_etag", "v2_default", "headerData", "HEADER_SIZE_BYTES", "resp_etag", "header", "rootDirData", "dirKey", "rootDir", "getDirectory", "data", "directory", "SharedPromiseCache", "maxCacheEntries", "prefetch", "decompress", "defaultDecompress", "source", "current_etag", "__async", "cacheKey", "p", "resolve", "reject", "getHeaderAndRoot", "res", "e", "offset", "length", "header", "getDirectory", "directory", "resp", "EtagMismatch", "minUsed", "minKey", "cache_value", "key", "PMTiles", "cache", "FetchSource", "z", "x", "y", "signal", "tile_id", "zxyToTileId", "v2_default", "d_o", "d_l", "depth", "entry", "findTile", "decompressed", "dec", "LuxonError", "InvalidDateTimeError", "reason", "InvalidIntervalError", "InvalidDurationError", "ConflictingSpecificationError", "InvalidUnitError", "unit", "InvalidArgumentError", "ZoneIsAbstractError", "n", "s", "l", "DATE_SHORT", "DATE_MED", "DATE_MED_WITH_WEEKDAY", "DATE_FULL", "DATE_HUGE", "TIME_SIMPLE", "TIME_WITH_SECONDS", "TIME_WITH_SHORT_OFFSET", "TIME_WITH_LONG_OFFSET", "TIME_24_SIMPLE", "TIME_24_WITH_SECONDS", "TIME_24_WITH_SHORT_OFFSET", "TIME_24_WITH_LONG_OFFSET", "DATETIME_SHORT", "DATETIME_SHORT_WITH_SECONDS", "DATETIME_MED", "DATETIME_MED_WITH_SECONDS", "DATETIME_MED_WITH_WEEKDAY", "DATETIME_FULL", "DATETIME_FULL_WITH_SECONDS", "DATETIME_HUGE", "DATETIME_HUGE_WITH_SECONDS", "Zone", "ZoneIsAbstractError", "ts", "opts", "format", "otherZone", "singleton", "SystemZone", "_SystemZone", "Zone", "ts", "format", "locale", "parseZoneInfo", "formatOffset", "otherZone", "dtfCache", "makeDTF", "zone", "typeToPos", "hackyOffset", "dtf", "date", "formatted", "parsed", "fMonth", "fDay", "fYear", "fadOrBc", "fHour", "fMinute", "fSecond", "partsOffset", "filled", "i", "type", "value", "pos", "isUndefined", "ianaZoneCache", "IANAZone", "_IANAZone", "Zone", "name", "s", "ts", "format", "locale", "parseZoneInfo", "formatOffset", "year", "month", "day", "adOrBc", "hour", "minute", "second", "asUTC", "objToLocalTS", "asTS", "over", "otherZone", "intlLFCache", "getCachedLF", "locString", "opts", "key", "dtf", "intlDTCache", "getCachedDTF", "intlNumCache", "getCachedINF", "inf", "intlRelCache", "getCachedRTF", "base", "cacheKeyOpts", "sysLocaleCache", "systemLocale", "weekInfoCache", "getCachedWeekInfo", "data", "locale", "parseLocaleString", "localeStr", "xIndex", "uIndex", "options", "selectedStr", "smaller", "numberingSystem", "calendar", "intlConfigString", "outputCalendar", "mapMonths", "f", "ms", "i", "dt", "DateTime", "mapWeekdays", "listStuff", "loc", "length", "englishFn", "intlFn", "mode", "supportsFastNumbers", "PolyNumberFormatter", "intl", "forceSimple", "padTo", "floor", "otherOpts", "intlOpts", "fixed", "roundTo", "padStart", "PolyDateFormatter", "z", "gmtOffset", "offsetZ", "IANAZone", "value", "parts", "part", "offsetName", "PolyRelFormatter", "isEnglish", "hasRelative", "count", "unit", "formatRelativeTime", "fallbackWeekSettings", "Locale", "_Locale", "weekSettings", "defaultToEN", "specifiedLocale", "Settings", "localeR", "numberingSystemR", "outputCalendarR", "weekSettingsR", "validateWeekSettings", "numbering", "parsedLocale", "parsedNumberingSystem", "parsedOutputCalendar", "isActuallyEn", "hasNoWeirdness", "alts", "format", "months", "formatStr", "weekdays", "meridiems", "eras", "field", "df", "results", "matching", "m", "hasLocaleWeekInfo", "other", "singleton", "FixedOffsetZone", "_FixedOffsetZone", "Zone", "offset", "s", "r", "signedOffset", "formatOffset", "ts", "format", "otherZone", "InvalidZone", "Zone", "zoneName", "normalizeZone", "input", "defaultZone", "offset", "isUndefined", "Zone", "isString", "lowered", "SystemZone", "FixedOffsetZone", "IANAZone", "isNumber", "InvalidZone", "numberingSystems", "numberingSystemsUTF16", "hanidecChars", "parseDigits", "str", "value", "i", "code", "key", "min", "max", "digitRegexCache", "resetDigitRegexCache", "digitRegex", "numberingSystem", "append", "ns", "now", "defaultZone", "defaultLocale", "defaultNumberingSystem", "defaultOutputCalendar", "twoDigitCutoffYear", "throwOnInvalid", "defaultWeekSettings", "Settings", "n", "zone", "normalizeZone", "SystemZone", "locale", "numberingSystem", "outputCalendar", "weekSettings", "validateWeekSettings", "cutoffYear", "t", "Locale", "IANAZone", "DateTime", "resetDigitRegexCache", "Invalid", "reason", "explanation", "nonLeapLadder", "leapLadder", "unitOutOfRange", "unit", "value", "Invalid", "dayOfWeek", "year", "month", "day", "d", "js", "computeOrdinal", "isLeapYear", "uncomputeOrdinal", "ordinal", "table", "month0", "i", "isoWeekdayToLocal", "isoWeekday", "startOfWeek", "gregorianToWeek", "gregObj", "minDaysInFirstWeek", "weekday", "weekNumber", "weekYear", "weeksInWeekYear", "timeObject", "weekToGregorian", "weekData", "weekdayOfJan4", "yearInDays", "daysInYear", "gregorianToOrdinal", "gregData", "ordinalToGregorian", "ordinalData", "usesLocalWeekValues", "obj", "loc", "isUndefined", "ConflictingSpecificationError", "hasInvalidWeekData", "validYear", "isInteger", "validWeek", "integerBetween", "validWeekday", "hasInvalidOrdinalData", "validOrdinal", "hasInvalidGregorianData", "validMonth", "validDay", "daysInMonth", "hasInvalidTimeData", "hour", "minute", "second", "millisecond", "validHour", "validMinute", "validSecond", "validMillisecond", "isUndefined", "o", "isNumber", "isInteger", "isString", "isDate", "hasRelative", "hasLocaleWeekInfo", "maybeArray", "thing", "bestBy", "arr", "by", "compare", "best", "next", "pair", "pick", "obj", "keys", "a", "k", "hasOwnProperty", "prop", "validateWeekSettings", "settings", "InvalidArgumentError", "integerBetween", "v", "bottom", "top", "floorMod", "x", "n", "padStart", "input", "isNeg", "padded", "parseInteger", "string", "parseFloating", "parseMillis", "fraction", "f", "roundTo", "number", "digits", "towardZero", "factor", "isLeapYear", "year", "daysInYear", "daysInMonth", "month", "modMonth", "modYear", "objToLocalTS", "d", "firstWeekOffset", "minDaysInFirstWeek", "startOfWeek", "isoWeekdayToLocal", "dayOfWeek", "weeksInWeekYear", "weekYear", "weekOffset", "weekOffsetNext", "untruncateYear", "Settings", "parseZoneInfo", "ts", "offsetFormat", "locale", "timeZone", "date", "intlOpts", "modified", "parsed", "m", "signedOffset", "offHourStr", "offMinuteStr", "offHour", "offMin", "offMinSigned", "asNumber", "value", "numericValue", "normalizeObject", "normalizer", "normalized", "u", "formatOffset", "offset", "format", "hours", "minutes", "sign", "timeObject", "monthsLong", "monthsShort", "monthsNarrow", "months", "length", "weekdaysLong", "weekdaysShort", "weekdaysNarrow", "weekdays", "meridiems", "erasLong", "erasShort", "erasNarrow", "eras", "meridiemForDateTime", "dt", "weekdayForDateTime", "monthForDateTime", "eraForDateTime", "formatRelativeTime", "unit", "count", "numeric", "narrow", "units", "lastable", "isDay", "isInPast", "fmtValue", "singular", "lilUnits", "fmtUnit", "stringifyTokens", "splits", "tokenToString", "s", "token", "macroTokenToFormatOpts", "DATE_SHORT", "DATE_MED", "DATE_FULL", "DATE_HUGE", "TIME_SIMPLE", "TIME_WITH_SECONDS", "TIME_WITH_SHORT_OFFSET", "TIME_WITH_LONG_OFFSET", "TIME_24_SIMPLE", "TIME_24_WITH_SECONDS", "TIME_24_WITH_SHORT_OFFSET", "TIME_24_WITH_LONG_OFFSET", "DATETIME_SHORT", "DATETIME_MED", "DATETIME_FULL", "DATETIME_HUGE", "DATETIME_SHORT_WITH_SECONDS", "DATETIME_MED_WITH_SECONDS", "DATETIME_FULL_WITH_SECONDS", "DATETIME_HUGE_WITH_SECONDS", "Formatter", "_Formatter", "locale", "opts", "fmt", "current", "currentFull", "bracketed", "i", "c", "formatOpts", "dt", "interval", "n", "padStart", "knownEnglish", "useDateTimeFormatter", "string", "extract", "formatOffset", "meridiem", "meridiemForDateTime", "month", "length", "standalone", "monthForDateTime", "weekday", "weekdayForDateTime", "maybeMacro", "era", "eraForDateTime", "dur", "tokenToField", "lildur", "mapped", "tokens", "realTokens", "found", "literal", "val", "collapsed", "t", "ianaRegex", "combineRegexes", "regexes", "full", "f", "r", "combineExtractors", "extractors", "m", "mergedVals", "mergedZone", "cursor", "ex", "val", "zone", "next", "parse", "s", "patterns", "regex", "extractor", "simpleParse", "keys", "match", "ret", "i", "parseInteger", "offsetRegex", "isoExtendedZone", "isoTimeBaseRegex", "isoTimeRegex", "isoTimeExtensionRegex", "isoYmdRegex", "isoWeekRegex", "isoOrdinalRegex", "extractISOWeekData", "extractISOOrdinalData", "sqlYmdRegex", "sqlTimeRegex", "sqlTimeExtensionRegex", "int", "pos", "fallback", "isUndefined", "extractISOYmd", "extractISOTime", "parseMillis", "extractISOOffset", "local", "fullOffset", "signedOffset", "FixedOffsetZone", "extractIANAZone", "IANAZone", "isoTimeOnly", "isoDuration", "extractISODuration", "yearStr", "monthStr", "weekStr", "dayStr", "hourStr", "minuteStr", "secondStr", "millisecondsStr", "hasNegativePrefix", "negativeSeconds", "maybeNegate", "num", "force", "parseFloating", "obsOffsets", "fromStrings", "weekdayStr", "result", "untruncateYear", "monthsShort", "weekdaysLong", "weekdaysShort", "rfc2822", "extractRFC2822", "obsOffset", "milOffset", "offHourStr", "offMinuteStr", "offset", "preprocessRFC2822", "rfc1123", "rfc850", "ascii", "extractRFC1123Or850", "extractASCII", "isoYmdWithTimeExtensionRegex", "isoWeekWithTimeExtensionRegex", "isoOrdinalWithTimeExtensionRegex", "isoTimeCombinedRegex", "extractISOYmdTimeAndOffset", "extractISOWeekTimeAndOffset", "extractISOOrdinalDateAndTime", "extractISOTimeAndOffset", "parseISODate", "parseRFC2822Date", "parseHTTPDate", "parseISODuration", "extractISOTimeOnly", "parseISOTimeOnly", "sqlYmdWithTimeExtensionRegex", "sqlTimeCombinedRegex", "extractISOTimeOffsetAndIANAZone", "parseSQL", "INVALID", "lowOrderMatrix", "casualMatrix", "daysInYearAccurate", "daysInMonthAccurate", "accurateMatrix", "orderedUnits", "reverseUnits", "clone", "dur", "alts", "clear", "conf", "Duration", "durationToMillis", "matrix", "vals", "sum", "unit", "normalizeValues", "factor", "previous", "current", "isUndefined", "previousVal", "conv", "rollUp", "fraction", "removeZeroes", "newVals", "key", "value", "_Duration", "config", "accurate", "Locale", "count", "opts", "obj", "InvalidArgumentError", "normalizeObject", "durationLike", "isNumber", "text", "parsed", "parseISODuration", "parseISOTimeOnly", "reason", "explanation", "invalid", "Invalid", "Settings", "InvalidDurationError", "normalized", "InvalidUnitError", "fmt", "fmtOpts", "Formatter", "l", "val", "n", "s", "roundTo", "millis", "DateTime", "duration", "result", "k", "hasOwnProperty", "fn", "asNumber", "values", "mixed", "locale", "numberingSystem", "conversionAccuracy", "units", "u", "built", "accumulated", "lastUnit", "own", "ak", "i", "negated", "other", "eq", "v1", "v2", "INVALID", "validateStartEnd", "start", "end", "Interval", "_Interval", "config", "reason", "explanation", "InvalidArgumentError", "invalid", "Invalid", "Settings", "InvalidIntervalError", "builtStart", "friendlyDateTime", "builtEnd", "validateError", "duration", "dur", "Duration", "dt", "text", "opts", "s", "e", "startIsValid", "DateTime", "endIsValid", "unit", "dateTime", "dateTimes", "sorted", "d", "a", "b", "results", "i", "added", "next", "idx", "x", "numberOfParts", "other", "intervals", "found", "final", "sofar", "current", "item", "currentCount", "ends", "flattened", "arr", "formatOpts", "DATE_SHORT", "Formatter", "dateFormat", "separator", "mapFn", "Info", "zone", "Settings", "proto", "DateTime", "IANAZone", "input", "normalizeZone", "locale", "locObj", "Locale", "length", "numberingSystem", "outputCalendar", "hasRelative", "hasLocaleWeekInfo", "dayDiff", "earlier", "later", "utcDayStart", "dt", "ms", "Duration", "highOrderDiffs", "cursor", "units", "differs", "a", "b", "days", "results", "lowestOrder", "highWater", "unit", "differ", "diff_default", "opts", "remainingMillis", "lowerOrderUnits", "u", "duration", "MISSING_FTP", "intUnit", "regex", "post", "i", "s", "parseDigits", "NBSP", "spaceOrNBSP", "spaceOrNBSPRegExp", "fixListRegex", "stripInsensitivities", "oneOf", "strings", "startIndex", "offset", "groups", "h", "m", "signedOffset", "simple", "escapeToken", "value", "unitForToken", "token", "loc", "one", "digitRegex", "two", "three", "four", "six", "oneOrTwo", "oneToThree", "oneToSix", "oneToNine", "twoToFour", "fourToSix", "literal", "t", "unit", "untruncateYear", "partTypeStyleToTokenVal", "tokenForPart", "part", "formatOpts", "resolvedOpts", "type", "isSpace", "style", "actualType", "val", "buildRegex", "units", "u", "f", "r", "match", "input", "handlers", "matches", "all", "matchIndex", "hasOwnProperty", "dateTimeFromMatches", "toField", "zone", "specificOffset", "isUndefined", "IANAZone", "FixedOffsetZone", "parseMillis", "dummyDateTimeCache", "getDummyDateTime", "DateTime", "maybeExpandMacroToken", "locale", "Formatter", "tokens", "formatOptsToTokens", "expandMacroTokens", "TokenParser", "format", "regexString", "rawMatches", "result", "ConflictingSpecificationError", "explainFromTokens", "parseFromTokens", "invalidReason", "df", "parts", "p", "INVALID", "MAX_DATE", "unsupportedZone", "zone", "Invalid", "possiblyCachedWeekData", "dt", "gregorianToWeek", "possiblyCachedLocalWeekData", "clone", "inst", "alts", "current", "DateTime", "fixOffset", "localTS", "tz", "utcGuess", "o2", "o3", "tsToObj", "ts", "offset", "d", "objToTS", "obj", "objToLocalTS", "adjustTime", "dur", "oPre", "year", "month", "c", "daysInMonth", "millisToAdd", "Duration", "o", "parseDataToDateTime", "parsed", "parsedZone", "opts", "format", "text", "specificOffset", "setZone", "interpretationZone", "toTechFormat", "allowZ", "Formatter", "Locale", "toISODate", "extended", "longFormat", "padStart", "toISOTime", "suppressSeconds", "suppressMilliseconds", "includeOffset", "extendedZone", "defaultUnitValues", "defaultWeekUnitValues", "defaultOrdinalUnitValues", "orderedUnits", "orderedWeekUnits", "orderedOrdinalUnits", "normalizeUnit", "unit", "normalized", "InvalidUnitError", "normalizeUnitWithLocalWeeks", "guessOffsetForZone", "zoneOffsetGuessCache", "zoneOffsetTs", "Settings", "quickDT", "normalizeZone", "loc", "isUndefined", "u", "invalid", "hasInvalidGregorianData", "hasInvalidTimeData", "offsetProvis", "diffRelative", "start", "end", "round", "roundTo", "differ", "count", "lastOpts", "argList", "args", "_DateTime", "config", "ot", "isNumber", "day", "hour", "minute", "second", "millisecond", "FixedOffsetZone", "date", "options", "isDate", "zoneToUse", "milliseconds", "InvalidArgumentError", "seconds", "normalizeObject", "minDaysInFirstWeek", "startOfWeek", "usesLocalWeekValues", "tsNow", "containsOrdinal", "containsGregorYear", "containsGregorMD", "containsGregor", "definiteWeekDef", "ConflictingSpecificationError", "useWeekData", "units", "defaultValues", "objNow", "gregorianToOrdinal", "foundFirst", "v", "higherOrderInvalid", "hasInvalidWeekData", "hasInvalidOrdinalData", "gregorian", "weekToGregorian", "ordinalToGregorian", "tsFinal", "offsetFinal", "vals", "parseISODate", "parseRFC2822Date", "parseHTTPDate", "fmt", "locale", "numberingSystem", "localeToUse", "parseFromTokens", "parseSQL", "reason", "explanation", "InvalidDateTimeError", "formatOpts", "localeOpts", "tokenList", "formatOptsToTokens", "t", "expandMacroTokens", "Info", "dayMs", "minuteMs", "oEarlier", "oLater", "o1", "ts1", "ts2", "c1", "c2", "isLeapYear", "daysInYear", "weeksInWeekYear", "calendar", "keepLocalTime", "keepCalendarTime", "newTS", "offsetGuess", "asObj", "outputCalendar", "values", "settingWeekStuff", "mixed", "duration", "useLocaleWeeks", "normalizedUnit", "weekday", "q", "DATE_SHORT", "ext", "includePrefix", "includeZone", "includeOffsetSpace", "base", "otherDateTime", "durOpts", "maybeArray", "otherIsLater", "earlier", "later", "diffed", "diff_default", "Interval", "inputMs", "adjustedToZone", "other", "padding", "dateTimes", "bestBy", "i", "explainFromTokens", "TokenParser", "formatParser", "result", "invalidReason", "DATE_MED", "DATE_MED_WITH_WEEKDAY", "DATE_FULL", "DATE_HUGE", "TIME_SIMPLE", "TIME_WITH_SECONDS", "TIME_WITH_SHORT_OFFSET", "TIME_WITH_LONG_OFFSET", "TIME_24_SIMPLE", "TIME_24_WITH_SECONDS", "TIME_24_WITH_SHORT_OFFSET", "TIME_24_WITH_LONG_OFFSET", "DATETIME_SHORT", "DATETIME_SHORT_WITH_SECONDS", "DATETIME_MED", "DATETIME_MED_WITH_SECONDS", "DATETIME_MED_WITH_WEEKDAY", "DATETIME_FULL", "DATETIME_FULL_WITH_SECONDS", "DATETIME_HUGE", "DATETIME_HUGE_WITH_SECONDS", "friendlyDateTime", "dateTimeish", "isDev", "urlRoot", "Parser", "_Parser", "list", "r", "err", "values", "data", "showsByDate", "organized", "x", "i", "features", "dateKeys", "today", "DateTime", "venueList", "venues", "j", "item", "v", "misspelled", "spelledCorrect", "e", "show", "a", "b", "matrix", "dateString", "date", "showsSource", "clustersLayer", "clusterCountLayer", "showLayer", "start", "MapHandler", "maplibregl", "Parser", "featureCollection", "dates", "protocol", "Protocol", "map", "src_default", "e", "features", "clusterId", "err", "zoom", "item", "coordinates", "container", "venue", "x", "a", "b", "p", "html", "attr", "overlay", "props", "skipVenue", "div", "li", "ul", "inner", "bounds", "filtered", "f", "onMap", "validDate", "source", "listingEl", "setPopup", "easeTo", "showMapButton", "s", "DateTime", "dateStrings", "dateSelectors", "d", "label", "check", "el", "i", "t", "filterButton", "hideFilterButton", "resetFilterButton", "filters", "todayButton", "tomorrowButton", "byDateButton", "mapOverlay", "showListButton", "aboutIcon", "aboutOverlay", "aboutIconOpen", "aboutIconClose", "mobileNav", "accessToken", "MapboxGeocoder", "cat", "geocoder", "results", "geocodedResults", "venues", "items", "val", "today", "tomorrow"] }