site/node_modules/rehype-citation/dist/browser/cite.mjs.map
2024-10-14 08:09:33 +02:00

1 line
567 KiB
XML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"file":"cite.mjs","sources":["../../src/citation-js/core/Cite/log.js","../../src/citation-js/core/Cite/validate.js","../../src/citation-js/core/Cite/options.js","../../src/citation-js/core/plugins/input/dataType.js","../../src/citation-js/core/plugins/input/graph.js","../../src/citation-js/core/logger.js","../../src/citation-js/core/plugins/input/type.js","../../src/citation-js/core/plugins/input/parser.js","../../src/citation-js/core/plugins/input/csl.js","../../src/citation-js/core/util/csl.js","../../src/citation-js/core/util/deepCopy.js","../../node_modules/base64-js/index.js","../../node_modules/ieee754/index.js","../../node_modules/buffer/index.js","../../node_modules/sync-fetch/browser.js","../../node_modules/fetch-ponyfill/build/fetch-browser.js","../../src/citation-js/core/util/fetchId.js","../../src/citation-js/core/util/fetchFile.js","../../src/citation-js/core/util/register.js","../../src/citation-js/core/util/grammar.js","../../src/citation-js/core/util/translator.js","../../src/citation-js/core/plugins/input/chain.js","../../src/citation-js/core/plugins/input/data.js","../../src/citation-js/core/plugins/input/register.js","../../src/citation-js/core/plugins/input/index.js","../../src/citation-js/core/Cite/set.js","../../src/citation-js/core/plugin-common/output/label.js","../../src/citation-js/core/Cite/sort.js","../../src/citation-js/core/plugins/output.js","../../src/citation-js/core/Cite/get.js","../../src/citation-js/core/Cite/async.js","../../src/citation-js/core/Cite/index.js","../../src/citation-js/core/plugins/dict.js","../../src/citation-js/core/plugins/config.js","../../src/citation-js/core/plugins/index.js","../../src/citation-js/core/plugin-common/input/empty.js","../../src/citation-js/core/plugin-common/input/json.js","../../src/citation-js/core/plugin-common/input/index.js","../../src/citation-js/core/plugin-common/input/jquery.js","../../src/citation-js/core/plugin-common/input/html.js","../../src/citation-js/core/plugin-common/output/json.js","../../src/citation-js/plugin-bibjson/json.js","../../src/citation-js/core/plugin-common/index.js","../../src/citation-js/core/plugin-common/output/index.js","../../src/citation-js/plugin-bibjson/index.js","../../node_modules/moo/moo.js","../../src/citation-js/plugin-bibtex/input/required.js","../../src/citation-js/plugin-bibtex/input/constants.js","../../src/citation-js/plugin-bibtex/input/fieldTypes.js","../../src/citation-js/plugin-bibtex/input/unicode.js","../../src/citation-js/plugin-bibtex/input/file.js","../../src/citation-js/plugin-bibtex/input/bibtxt.js","../../src/citation-js/plugin-bibtex/mapping/biblatexTypes.js","../../src/citation-js/plugin-bibtex/mapping/bibtexTypes.js","../../src/citation-js/plugin-bibtex/config.js","../../src/citation-js/plugin-bibtex/mapping/shared.js","../../src/citation-js/plugin-bibtex/mapping/biblatex.js","../../src/citation-js/plugin-bibtex/mapping/bibtex.js","../../src/citation-js/plugin-bibtex/mapping/index.js","../../src/citation-js/plugin-bibtex/input/name.js","../../src/citation-js/plugin-bibtex/input/value.js","../../src/citation-js/plugin-bibtex/input/entries.js","../../src/citation-js/plugin-bibtex/input/index.js","../../src/citation-js/plugin-bibtex/output/value.js","../../src/citation-js/plugin-bibtex/output/entries.js","../../src/citation-js/plugin-bibtex/output/bibtex.js","../../src/citation-js/plugin-bibtex/output/index.js","../../src/citation-js/plugin-bibtex/output/bibtxt.js","../../src/citation-js/plugin-bibtex/index.js","../../src/citation-js/plugin-csl/locales.js","../../src/citation-js/plugin-csl/styles.js","../../src/citation-js/plugin-csl/engines.js","../../src/citation-js/plugin-csl/bibliography.js","../../src/citation-js/plugin-csl/citation.js","../../src/citation-js/plugin-csl/index.js","../../src/citation-js/plugin-csl/attr.js","../../src/citation-js/plugin-yaml/index.js","../../src/citation-js/plugin-cff/index.js","../../src/cite.js"],"sourcesContent":["// @ts-nocheck\n/**\n * @memberof module: @citation-js / core.Cite#\n *\n * @return {Number} The latest version of the object\n */\nfunction currentVersion() {\n return this.log.length\n}\n\n/**\n * Returns an image of the object in the version specified.\n *\n * @memberof module:@citation-js/core.Cite#\n *\n * @param {Number} [versnum=1] - The number of the version you want to retrieve. Illegal numbers: numbers under or equal to zero, floats, numbers above the current version of the object.\n *\n * @return {module:@citation-js/core.Cite} The version of the object with the version number passed. `undefined` if an illegal number is passed.\n */\nfunction retrieveVersion(versnum = 1) {\n if (versnum <= 0 || versnum > this.currentVersion()) {\n return null\n } else {\n const [data, options] = this.log[versnum - 1]\n const image = new this.constructor(JSON.parse(data), JSON.parse(options))\n image.log = this.log.slice(0, versnum)\n return image\n }\n}\n\n/**\n * Returns the second to last saved image of the object.\n *\n * @memberof module:@citation-js/core.Cite#\n *\n * @param {Number} [number=1] - number of versions to go back.\n *\n * @return {module:@citation-js/core.Cite} The second to last version of the object. `undefined` if used on first version.\n */\nfunction undo(number = 1) {\n return this.retrieveVersion(this.currentVersion() - number)\n}\n\n/**\n * Returns the last saved image of the object.\n *\n * @memberof module:@citation-js/core.Cite#\n *\n * @return {module:@citation-js/core.Cite} The last version of the object. `undefined` if used on first version.\n */\nfunction retrieveLastVersion() {\n return this.retrieveVersion(this.currentVersion())\n}\n\n/**\n * Save an image of the current version of the object.\n *\n * @memberof module:@citation-js/core.Cite#\n *\n * @return {module:@citation-js/core.Cite} The current version of the object.\n */\nfunction save() {\n this.log.push([JSON.stringify(this.data), JSON.stringify(this._options)])\n\n return this\n}\n\nexport { currentVersion, retrieveVersion, retrieveLastVersion, undo, save }\n","// @ts-nocheck\nconst formats = ['real', 'string']\nconst types = ['json', 'html', 'string', 'rtf']\nconst styles = ['csl', 'bibtex', 'bibtxt', 'citation-*', 'ris', 'ndjson']\nconst wrapperTypes = ['string', 'function']\n\n/**\n * @access public\n * @method validateOutputOptions\n * @memberof module:@citation-js/core.Cite\n *\n * @deprecated\n * @param {module:@citation-js/core~OutputOptions} - options\n *\n * @return {Boolean} true (if valid)\n * @throws {TypeError} Options not an object\n * @throws {TypeError} Invalid options\n * @throws {Error} Invalid options combination\n *\n * @todo check registers if styles and langs are present\n */\n/* istanbul ignore next: deprecated */\nexport function validateOutputOptions(options) {\n if (typeof options !== 'object') {\n throw new TypeError('Options not an object!')\n }\n\n const { format, type, style, lang, append, prepend } = options\n\n if (format && !formats.includes(format)) {\n throw new TypeError(`Option format (\"${format}\") should be one of: ${formats}`)\n } else if (type && !types.includes(type)) {\n throw new TypeError(`Option type (\"${type}\") should be one of: ${types}`)\n } else if (style && !styles.includes(style) && !/^citation/.test(style)) {\n throw new TypeError(`Option style (\"${style}\") should be one of: ${styles}`)\n } else if (lang && typeof lang !== 'string') {\n throw new TypeError(`Option lang should be a string, but is a ${typeof lang}`)\n } else if (prepend && !wrapperTypes.includes(typeof prepend)) {\n throw new TypeError(\n `Option prepend should be a string or a function, but is a ${typeof prepend}`\n )\n } else if (append && !wrapperTypes.includes(typeof append)) {\n throw new TypeError(`Option append should be a string or a function, but is a ${typeof append}`)\n }\n\n if (/^citation/.test(style) && type === 'json') {\n throw new Error(`Combination type/style of json/citation-* is not valid: ${type}/${style}`)\n }\n\n return true\n}\n\n/**\n * @access public\n * @method valdiateOptions\n * @memberof module:@citation-js/core.Cite\n *\n * @param {module:@citation-js/core~InputOptions} - options\n *\n * @return {Boolean} true (if valid)\n * @throws {TypeError} Options not an object\n * @throws {TypeError} Invalid options\n *\n * @todo check registers if type is present\n */\nexport function validateOptions(options) {\n if (typeof options !== 'object') {\n throw new TypeError('Options should be an object')\n }\n\n /* istanbul ignore if: deprecated */\n if (options.output) {\n validateOutputOptions(options.output)\n } else if (options.maxChainLength && typeof options.maxChainLength !== 'number') {\n throw new TypeError('Option maxChainLength should be a number')\n } else if (options.forceType && typeof options.forceType !== 'string') {\n throw new TypeError('Option forceType should be a string')\n } else if (options.generateGraph != null && typeof options.generateGraph !== 'boolean') {\n throw new TypeError('Option generateGraph should be a boolean')\n } else if (options.strict != null && typeof options.strict !== 'boolean') {\n throw new TypeError('Option strict should be a boolean')\n } else if (options.target != null && typeof options.target !== 'string') {\n throw new TypeError('Option target should be a boolean')\n }\n\n return true\n}\n","import { validateOutputOptions as validate } from './validate.js'\n\n/**\n * @memberof module:@citation-js/core.Cite#\n *\n * @constant {module:@citation-js/core~OutputOptions} defaultOptions - default output options\n */\nconst defaultOptions = { format: 'real', type: 'json', style: 'csl', lang: 'en-US' }\n\n/**\n * Change the default options of a `Cite` object.\n *\n * @memberof Cite#\n *\n * @param {module:@citation-js/core~OutputOptions} options - The options for the output\n * @param {Boolean} [log=false] - Show this call in the log\n *\n * @return {module:@citation-js/core.Cite} The updated parent object\n */\nfunction options(options, log) {\n validate(options)\n\n if (log) {\n this.save()\n }\n\n Object.assign(this._options, options)\n\n return this\n}\n\nexport { options, defaultOptions }\n","/**\n * Gets the constructor name, with a special case for `null` and `undefined`\n *\n * @access public\n * @method typeOf\n * @memberof module:@citation-js/core.plugins.input.util\n *\n * @param {*} thing - input data or anything else\n *\n * @return {String} type\n */\nexport function typeOf(thing) {\n switch (thing) {\n case undefined:\n return 'Undefined'\n case null:\n return 'Null'\n default:\n return thing.constructor.name\n }\n}\n\n/**\n * @access public\n * @method dataTypeOf\n * @memberof module:@citation-js/core.plugins.input.util\n *\n * @param {*} thing - input data or anything else\n *\n * @return {module:@citation-js/core.plugins.input~dataType} dataType\n */\nexport function dataTypeOf(thing) {\n switch (typeof thing) {\n case 'string':\n return 'String'\n\n case 'object':\n if (Array.isArray(thing)) {\n return 'Array'\n } else if (typeOf(thing) === 'Object') {\n return 'SimpleObject'\n } else if (typeOf(thing) !== 'Null') {\n return 'ComplexObject'\n }\n // fall through when thing === null, return default value\n\n default:\n return 'Primitive'\n }\n}\n","/**\n * Apply a parse chain graph to an element\n *\n * @access protected\n * @method applyGraph\n * @memberof module:@citation-js/core.plugins.input.util\n *\n * @param {module:@citation-js/core~CSL} entry\n * @param {Array<Object>} graph\n *\n * @return {module:@citation-js/core~CSL} entry\n */\nexport function applyGraph(entry, graph) {\n if (entry._graph) {\n const index = graph.findIndex(({ type }) => type === '@else/list+object')\n if (index !== -1) {\n graph.splice(index + 1, 0, ...entry._graph.slice(0, -1))\n }\n }\n\n entry._graph = graph\n return entry\n}\n\n/**\n * Remove the parse chain graph from an element\n *\n * @access protected\n * @method removeGraph\n * @memberof module:@citation-js/core.plugins.input.util\n *\n * @param {module:@citation-js/core~CSL} entry\n *\n * @return {module:@citation-js/core~CSL} entry\n */\nexport function removeGraph(entry) {\n delete entry._graph\n return entry\n}\n","/**\n * @memberof module:@citation-js/core\n * @var {Object} logger\n * @property _output\n * @property {Console} _console\n * @property {Array<String>} _log\n * @property {Array<module:@citation-js/core~logLevel>} _levels\n * @property {module:@citation-js/core~logLevel} level\n */\nconst logger = {\n _output(level, scope, msg) {\n this._log.push(scope, msg)\n\n if (this._levels.indexOf(level) < this._levels.indexOf(this.level)) {\n return\n }\n\n this._console.log(scope, ...msg)\n },\n _console: null,\n _log: [],\n\n /**\n * @typedef {String} module:@citation-js/core~logLevel\n */\n _levels: ['http', 'debug', 'unmapped', 'info', 'warn', 'error', 'silent'],\n\n level: 'silent',\n}\n\nfor (const level of logger._levels) {\n logger[level] = (scope, ...msg) => logger._output(level, scope, msg)\n}\n\nif (typeof console.Console === 'function') {\n logger._console = new console.Console(process.stderr)\n} else {\n logger._console = console\n}\n\nexport default logger\n","// @ts-nocheck\nimport logger from '../../logger.js'\nimport { dataTypeOf } from './dataType.js'\n\n// register\nconst types = {}\nconst dataTypes = {}\n\n// extensions not registered as such\nconst unregExts = {}\n\n/**\n * Hard-coded, for reasons\n *\n * @access private\n * @memberof module:@citation-js/core.plugins.input\n *\n * @param {module:@citation-js/core~InputData} input\n * @param {module:@citation-js/core.plugins.input~dataType} dataType\n * @return {module:@citation-js/core.plugins.input~format} native format\n */\nfunction parseNativeTypes(input, dataType) {\n switch (dataType) {\n case 'Array':\n if (input.length === 0 || input.every((entry) => type(entry) === '@csl/object')) {\n return '@csl/list+object'\n } else {\n return '@else/list+object'\n }\n\n case 'SimpleObject':\n case 'ComplexObject':\n // might, of course, be something completely else, but this is how the parser works\n return '@csl/object'\n\n default:\n return '@invalid'\n }\n}\n\n/**\n * @access private\n * @memberof module:@citation-js/core.plugins.input\n *\n * @param {Array<module:@citation-js/core.plugins.input~format>} [typeList=[]]\n * @param {module:@citation-js/core~InputData} data\n *\n * @return {module:@citation-js/core.plugins.input~format} native format\n */\nfunction matchType(typeList = [], data) {\n for (const type of typeList) {\n if (types[type].predicate(data)) {\n return matchType(types[type].extensions, data) || type\n }\n }\n}\n\n/**\n * @access public\n * @method type\n * @memberof module:@citation-js/core.plugins.input\n *\n * @param {module:@citation-js/core~InputData} input\n *\n * @return {module:@citation-js/core.plugins.input~format} type\n */\nexport function type(input) {\n const dataType = dataTypeOf(input)\n\n // Empty array should be @csl/list+object too\n if (dataType === 'Array' && input.length === 0) {\n // Off-load to parseNativeTypes() to not repeat the name\n // '@csl/list+object' here as well, as it might change\n return parseNativeTypes(input, dataType)\n }\n\n const match = matchType(dataTypes[dataType], input)\n\n // If no matching formats found, test if native format,\n // else invalid input.\n return match || parseNativeTypes(input, dataType)\n}\n\n/**\n * @access public\n * @method addTypeParser\n * @memberof module:@citation-js/core.plugins.input\n *\n * @param {module:@citation-js/core.plugins.input~format} format\n * @param {module:@citation-js/core.plugins.input.util.TypeParser} typeParser\n */\nexport function addTypeParser(format, { dataType, predicate, extends: extend }) {\n // 1. check if any subclass formats are waiting for this format\n let extensions = []\n if (format in unregExts) {\n extensions = unregExts[format]\n delete unregExts[format]\n logger.debug(\n '[core]',\n `Subclasses \"${extensions}\" finally registered to parent type \"${format}\"`\n )\n }\n\n // 2. create object with parser info\n const object = { predicate, extensions }\n types[format] = object\n\n // 3. determine which type lists the type should be added to\n if (extend) {\n // 3.1. if format is subclass, check if parent type is registered\n const parentTypeParser = types[extend]\n\n if (parentTypeParser) {\n // 3.1.1. if it is, add the type parser\n parentTypeParser.extensions.push(format)\n } else {\n // 3.1.2. if it isn't, register type as waiting\n if (!unregExts[extend]) {\n unregExts[extend] = []\n }\n unregExts[extend].push(format)\n logger.debug('[core]', `Subclass \"${format}\" is waiting on parent type \"${extend}\"`)\n }\n } else {\n // 3.2. else, add\n const typeList = dataTypes[dataType] || (dataTypes[dataType] = [])\n typeList.push(format)\n }\n}\n\n/**\n * @access public\n * @method hasTypeParser\n * @memberof module:@citation-js/core.plugins.input\n *\n * @param {module:@citation-js/core.plugins.input~format} type\n *\n * @return {Boolean} type parser is registered\n */\nexport function hasTypeParser(type) {\n return Object.prototype.hasOwnProperty.call(types, type)\n}\n\n/**\n * @access public\n * @method removeTypeParser\n * @memberof module:@citation-js/core.plugins.input\n *\n * @param {module:@citation-js/core.plugins.input~format} type\n */\nexport function removeTypeParser(type) {\n delete types[type]\n\n // Removing orphaned type refs\n const typeLists = [\n ...Object.keys(dataTypes).map((key) => dataTypes[key]),\n ...Object.keys(types)\n .map((type) => types[type].extensions)\n .filter((list) => list.length > 0),\n ]\n typeLists.forEach((typeList) => {\n const index = typeList.indexOf(type)\n if (index > -1) {\n typeList.splice(index, 1)\n }\n })\n}\n\n/**\n * @access public\n * @method listTypeParser\n * @memberof module:@citation-js/core.plugins.input\n *\n * @return {Array<module:@citation-js/core.plugins.input~format>} list of registered type parsers\n */\nexport function listTypeParser() {\n return Object.keys(types)\n}\n\n/**\n * @access public\n * @method treeTypeParser\n * @memberof module:@citation-js/core.plugins.input\n *\n * @return {Object} tree structure\n */\n/* istanbul ignore next: debugging */\nexport function treeTypeParser() {\n const attachNode = (name) => ({ name, children: types[name].extensions.map(attachNode) })\n return {\n name: 'Type tree',\n children: Object.keys(dataTypes).map((name) => ({\n name,\n children: dataTypes[name].map(attachNode),\n })),\n }\n}\n\n/**\n * Validate and parse the format name\n *\n * @access public\n * @method typeMatcher\n * @memberof module:@citation-js/core.plugins.input\n * @type {RegExp}\n */\nexport const typeMatcher = /^(?:@(.+?))(?:\\/(?:(.+?)\\+)?(?:(.+)))?$/\n","// @ts-nocheck\nimport { type, typeMatcher } from './type.js'\n\n/**\n * @memberof module:@citation-js/core.plugins.input.util\n * @param {module:@citation-js/core.plugins.input~typeParser} data\n */\nclass TypeParser {\n /**\n * @access protected\n * @type {Array<module:@citation-js/core.plugins.input~dataType>}\n */\n validDataTypes = ['String', 'Array', 'SimpleObject', 'ComplexObject', 'Primitive']\n\n constructor(data) {\n this.data = data\n }\n\n // ==========================================================================\n // Validation\n // ==========================================================================\n\n /**\n * @access protected\n * @throws {RangeError} if dataType is not valid\n */\n validateDataType() {\n const dataType = this.data.dataType\n if (dataType && !this.validDataTypes.includes(dataType)) {\n throw new RangeError(`dataType was ${dataType}; expected one of ${this.validDataTypes}`)\n }\n }\n\n /**\n * @access protected\n * @throws {TypeError} if predicate is not valid\n */\n validateParseType() {\n const predicate = this.data.predicate\n if (predicate && !(predicate instanceof RegExp || typeof predicate === 'function')) {\n throw new TypeError(`predicate was ${typeof predicate}; expected RegExp or function`)\n }\n }\n\n /**\n * @access protected\n * @throws {TypeError} if predicate is not valid\n */\n validateTokenList() {\n const tokenList = this.data.tokenList\n if (tokenList && typeof tokenList !== 'object') {\n throw new TypeError(`tokenList was ${typeof tokenList}; expected object or RegExp`)\n }\n }\n\n /**\n * @access protected\n * @throws {TypeError} if propertyConstraint is not valid\n */\n validatePropertyConstraint() {\n const propertyConstraint = this.data.propertyConstraint\n if (propertyConstraint && typeof propertyConstraint !== 'object') {\n throw new TypeError(\n `propertyConstraint was ${typeof propertyConstraint}; expected array or object`\n )\n }\n }\n\n /**\n * @access protected\n * @throws {TypeError} if elementConstraint is not valid\n */\n validateElementConstraint() {\n const elementConstraint = this.data.elementConstraint\n if (elementConstraint && typeof elementConstraint !== 'string') {\n throw new TypeError(`elementConstraint was ${typeof elementConstraint}; expected string`)\n }\n }\n\n /**\n * @access protected\n * @throws {TypeError} if extends is not valid\n */\n validateExtends() {\n const extend = this.data.extends\n if (extend && typeof extend !== 'string') {\n throw new TypeError(`extends was ${typeof extend}; expected string`)\n }\n }\n\n /**\n * @access public\n * @throws {TypeError|RangeError} if typeParser is not valid\n */\n validate() {\n if (this.data === null || typeof this.data !== 'object') {\n throw new TypeError(`typeParser was ${typeof this.data}; expected object`)\n }\n this.validateDataType()\n this.validateParseType()\n this.validateTokenList()\n this.validatePropertyConstraint()\n this.validateElementConstraint()\n this.validateExtends()\n }\n\n // ==========================================================================\n // Simplification helpers\n // ==========================================================================\n\n /**\n * @access protected\n * @return {Array<module:@citation-js/core.plugins.input~predicate>}\n */\n parseTokenList() {\n let tokenList = this.data.tokenList\n\n if (!tokenList) {\n return []\n } else if (tokenList instanceof RegExp) {\n tokenList = { token: tokenList }\n }\n\n const { token, split = /\\s+/, trim = true, every = true } = tokenList\n\n const trimInput = (input) => (trim ? input.trim() : input)\n const testTokens = every ? 'every' : 'some'\n\n const predicate = (input) =>\n trimInput(input)\n .split(split)\n [testTokens]((part) => token.test(part))\n\n return [predicate]\n }\n\n /**\n * @access protected\n * @return {Array<module:@citation-js/core.plugins.input~predicate>}\n */\n parsePropertyConstraint() {\n const constraints = [].concat(this.data.propertyConstraint || [])\n\n return constraints.map(({ props, match, value }) => {\n props = [].concat(props)\n\n switch (match) {\n case 'any': // fall-through\n case 'some':\n return (input) => props.some((prop) => prop in input && (!value || value(input[prop])))\n case 'none':\n return (input) => !props.some((prop) => prop in input && (!value || value(input[prop])))\n case 'every': // fall-through\n default:\n return (input) => props.every((prop) => prop in input && (!value || value(input[prop])))\n }\n })\n }\n\n /**\n * @access protected\n * @return {Array<module:@citation-js/core.plugins.input~predicate>}\n */\n parseElementConstraint() {\n const constraint = this.data.elementConstraint\n return !constraint ? [] : [(input) => input.every((entry) => type(entry) === constraint)]\n }\n\n /**\n * @access protected\n * @return {Array<module:@citation-js/core.plugins.input~predicate>}\n */\n parsePredicate() {\n if (this.data.predicate instanceof RegExp) {\n return [this.data.predicate.test.bind(this.data.predicate)]\n } else if (this.data.predicate) {\n return [this.data.predicate]\n } else {\n return []\n }\n }\n\n /**\n * @access protected\n * @return {module:@citation-js/core.plugins.input~predicate}\n */\n getCombinedPredicate() {\n const predicates = [\n ...this.parsePredicate(),\n ...this.parseTokenList(),\n ...this.parsePropertyConstraint(),\n ...this.parseElementConstraint(),\n ]\n\n if (predicates.length === 0) {\n return () => true\n } else if (predicates.length === 1) {\n return predicates[0]\n } else {\n return (input) => predicates.every((predicate) => predicate(input))\n }\n }\n\n /**\n * @access protected\n * @return {module:@citation-js/core.plugins.input~dataType}\n */\n getDataType() {\n if (this.data.dataType) {\n return this.data.dataType\n } else if (this.data.predicate instanceof RegExp) {\n return 'String'\n } else if (this.data.tokenList) {\n return 'String'\n } else if (this.data.elementConstraint) {\n return 'Array'\n } else {\n return 'Primitive'\n }\n }\n\n // ==========================================================================\n // Data simplification\n // ==========================================================================\n\n /**\n * @type {module:@citation-js/core.plugins.input~dataType}\n */\n get dataType() {\n return this.getDataType()\n }\n\n /**\n * @type {module:@citation-js/core.plugins.input~predicate}\n */\n get predicate() {\n return this.getCombinedPredicate()\n }\n\n /**\n * @type {module:@citation-js/core.plugins.input~format}\n */\n get extends() {\n return this.data.extends\n }\n}\n\n/**\n * @memberof module:@citation-js/core.plugins.input.util\n * @param {module:@citation-js/core.plugins.input~dataParser|module:@citation-js/core.plugins.input~asyncDataParser} parser\n * @param {Object} options\n * @param {Boolean} [options.async=false]\n */\nclass DataParser {\n constructor(parser, { async } = {}) {\n this.parser = parser\n this.async = async\n }\n\n // ==========================================================================\n // Validation\n // ==========================================================================\n\n /**\n * @throws {TypeError} if dataParser is not valid\n */\n validate() {\n const parser = this.parser\n if (typeof parser !== 'function') {\n throw new TypeError(`parser was ${typeof parser}; expected function`)\n }\n }\n}\n\n/**\n * @memberof module:@citation-js/core.plugins.input.util\n * @param {module:@citation-js/core.plugins.input~format} format\n * @param {module:@citation-js/core.plugins.input~parsers} parsers\n */\nclass FormatParser {\n constructor(format, parsers = {}) {\n this.format = format\n\n if (parsers.parseType) {\n this.typeParser = new TypeParser(parsers.parseType)\n }\n if (parsers.parse) {\n this.dataParser = new DataParser(parsers.parse, { async: false })\n }\n if (parsers.parseAsync) {\n this.asyncDataParser = new DataParser(parsers.parseAsync, { async: true })\n }\n }\n\n // ==========================================================================\n // Validation\n // ==========================================================================\n\n /**\n * @access protected\n * @throws {TypeError} if format is not valid\n */\n validateFormat() {\n const format = this.format\n if (!typeMatcher.test(format)) {\n throw new TypeError(`format name was \"${format}\"; didn't match expected pattern`)\n }\n }\n\n /**\n * @throws {TypeError} if formatParser is not valid\n */\n validate() {\n this.validateFormat()\n if (this.typeParser) {\n this.typeParser.validate()\n }\n if (this.dataParser) {\n this.dataParser.validate()\n }\n if (this.asyncDataParser) {\n this.asyncDataParser.validate()\n }\n }\n}\n\nexport { TypeParser, DataParser, FormatParser }\n","// @ts-nocheck\nimport { parse as parseName } from '@citation-js/name'\n\nconst NAME = 1\nconst NAME_LIST = 2\nconst DATE = 3\nconst TYPE = 4\n\n/**\n * Data from https://github.com/citation-style-language/schema/blob/master/schemas/input/csl-data.json\n *\n * - true if a valid type\n * - string if another type should be used\n *\n * @access private\n * @constant entryTypes\n * @memberof module:@citation-js/core.plugins.input\n */\nconst entryTypes = {\n article: true,\n 'article-journal': true,\n 'article-magazine': true,\n 'article-newspaper': true,\n bill: true,\n book: true,\n broadcast: true,\n chapter: true,\n classic: true,\n collection: true,\n dataset: true,\n document: true,\n entry: true,\n 'entry-dictionary': true,\n 'entry-encyclopedia': true,\n event: true,\n figure: true,\n graphic: true,\n hearing: true,\n interview: true,\n legal_case: true,\n legislation: true,\n manuscript: true,\n map: true,\n motion_picture: true,\n musical_score: true,\n pamphlet: true,\n 'paper-conference': true,\n patent: true,\n performance: true,\n periodical: true,\n personal_communication: true,\n post: true,\n 'post-weblog': true,\n regulation: true,\n report: true,\n review: true,\n 'review-book': true,\n software: true,\n song: true,\n speech: true,\n standard: true,\n thesis: true,\n treaty: true,\n webpage: true,\n\n // From https://github.com/CrossRef/rest-api-doc/issues/187\n 'journal-article': 'article-journal',\n 'book-chapter': 'chapter',\n 'posted-content': 'manuscript',\n 'proceedings-article': 'paper-conference',\n}\n\n/**\n * Object containing type info on CSL-JSON fields.\n *\n * * string: primitive value type\n * * array: list of primitive value types\n * * number: special type\n *\n * Data from https://github.com/citation-style-language/schema/blob/master/csl-data.json\n *\n * @access private\n * @constant fieldTypes\n * @memberof module:@citation-js/core.plugins.input\n */\nconst fieldTypes = {\n author: NAME_LIST,\n chair: NAME_LIST,\n 'collection-editor': NAME_LIST,\n compiler: NAME_LIST,\n composer: NAME_LIST,\n 'container-author': NAME_LIST,\n contributor: NAME_LIST,\n curator: NAME_LIST,\n director: NAME_LIST,\n editor: NAME_LIST,\n 'editorial-director': NAME_LIST,\n 'executive-producer': NAME_LIST,\n guest: NAME_LIST,\n host: NAME_LIST,\n interviewer: NAME_LIST,\n illustrator: NAME_LIST,\n narrator: NAME_LIST,\n organizer: NAME_LIST,\n 'original-author': NAME_LIST,\n performer: NAME_LIST,\n producer: NAME_LIST,\n 'reviewed-author': NAME_LIST,\n recipient: NAME_LIST,\n 'script-writer': NAME_LIST,\n 'series-creator': NAME_LIST,\n translator: NAME_LIST,\n\n accessed: DATE,\n 'available-date': DATE,\n container: DATE,\n 'event-date': DATE,\n issued: DATE,\n 'original-date': DATE,\n submitted: DATE,\n\n type: TYPE,\n\n categories: 'object', // TODO Array<String>\n custom: 'object',\n\n id: ['string', 'number'],\n language: 'string',\n journalAbbreviation: 'string',\n shortTitle: 'string',\n abstract: 'string',\n annote: 'string',\n archive: 'string',\n archive_collection: 'string',\n archive_location: 'string',\n 'archive-place': 'string',\n authority: 'string',\n 'call-number': 'string',\n 'chapter-number': 'string',\n 'citation-number': 'string',\n 'citation-key': 'string',\n 'citation-label': 'string',\n 'collection-number': 'string',\n 'collection-title': 'string',\n 'container-title': 'string',\n 'container-title-short': 'string',\n dimensions: 'string',\n division: 'string',\n DOI: 'string',\n edition: ['string', 'number'],\n event: 'string', // deprecated\n 'event-title': 'string',\n 'event-place': 'string',\n 'first-reference-note-number': 'string',\n genre: 'string',\n ISBN: 'string',\n ISSN: 'string',\n issue: ['string', 'number'],\n jurisdiction: 'string',\n keyword: 'string',\n locator: 'string',\n medium: 'string',\n note: 'string',\n number: ['string', 'number'],\n 'number-of-pages': 'string',\n 'number-of-volumes': ['string', 'number'],\n 'original-publisher': 'string',\n 'original-publisher-place': 'string',\n 'original-title': 'string',\n page: 'string',\n 'page-first': 'string',\n 'part-number': ['string', 'number'],\n 'part-title': 'string',\n PMCID: 'string',\n PMID: 'string',\n printing: 'string',\n publisher: 'string',\n 'publisher-place': 'string',\n references: 'string',\n 'reviewed-title': 'string',\n 'reviewed-genre': 'string',\n scale: 'string',\n section: 'string',\n source: 'string',\n status: 'string',\n supplement: ['string', 'number'],\n title: 'string',\n 'title-short': 'string',\n URL: 'string',\n version: 'string',\n volume: ['string', 'number'],\n 'volume-title': 'string',\n 'volume-title-short': 'string',\n 'year-suffix': 'string',\n}\n\n/**\n * Correct a name.\n *\n * @access private\n * @memberof module:@citation-js/core.plugins.input\n *\n * @param {*} name - name\n * @param {Boolean} bestGuessConversions - make some best guess conversions on type mismatch\n *\n * @return {Object} returns the (corrected) value if possible, otherwise undefined\n */\nfunction correctName(name, bestGuessConversions) {\n if (typeof name === 'object' && name !== null && (name.literal || name.given || name.family)) {\n return name\n } else if (!bestGuessConversions) {\n return undefined\n } else if (typeof name === 'string') {\n return parseName(name)\n }\n}\n\n/**\n * Correct a name field.\n *\n * @access private\n * @memberof module:@citation-js/core.plugins.input\n *\n * @param {*} nameList - name list\n * @param {Boolean} bestGuessConversions - make some best guess conversions on type mismatch\n *\n * @return {Array<Object>|undefined} returns the (corrected) value if possible, otherwise undefined\n */\nfunction correctNameList(nameList, bestGuessConversions) {\n if (nameList instanceof Array) {\n const names = nameList.map((name) => correctName(name, bestGuessConversions)).filter(Boolean)\n return names.length ? names : undefined\n }\n}\n\n/**\n * Correct date parts\n *\n * @access private\n * @memberof module:@citation-js/core.plugins.input.util\n *\n * @param {Array} dateParts\n * @param {Boolean} bestGuessConversions - make some best guess conversions on type mismatch\n *\n * @return {Array<Number>|undefined}\n */\nfunction correctDateParts(dateParts, bestGuessConversions) {\n if (dateParts.every((part) => typeof part === 'number')) {\n return dateParts\n } else if (!bestGuessConversions || dateParts.some((part) => isNaN(parseInt(part)))) {\n return undefined\n } else {\n return dateParts.map((part) => parseInt(part))\n }\n}\n\n/**\n * Correct a date field.\n *\n * @access private\n * @memberof module:@citation-js/core.plugins.input.util\n *\n * @param {*} date - date\n * @param {Boolean} bestGuessConversions - make some best guess conversions on type mismatch\n *\n * @return {Array<Object>|undefined} returns the (corrected) value if possible, otherwise undefined\n */\nfunction correctDate(date, bestGuessConversions) {\n const dp = 'date-parts'\n\n if (typeof date !== 'object' || date === null) {\n return undefined\n\n // \"{'date-parts': [[2000, 1, 1], ...]}\"\n } else if (date[dp] instanceof Array && date[dp].every((part) => part instanceof Array)) {\n const range = date[dp]\n .map((dateParts) => correctDateParts(dateParts, bestGuessConversions))\n .filter(Boolean)\n return range.length ? { ...date, 'date-parts': range } : undefined\n\n // LEGACY support\n // \"[{'date-parts': [2000, 1, 1]}, ...]\"\n } else if (date instanceof Array && date.every((part) => part[dp] instanceof Array)) {\n const range = date\n .map((dateParts) => correctDateParts(dateParts[dp], bestGuessConversions))\n .filter(Boolean)\n return range.length ? { 'date-parts': range } : undefined\n\n // LEGACY support\n // \"{'date-parts': [2000, 1, 1]}\"\n } else if (date[dp] instanceof Array) {\n const dateParts = correctDateParts(date[dp], bestGuessConversions)\n return dateParts && { 'date-parts': [dateParts] }\n\n // No separate date-parts\n } else if ('literal' in date || 'raw' in date) {\n return date\n }\n}\n\n/**\n * Correct a type field.\n *\n * @access private\n * @memberof module:@citation-js/core.plugins.input.util\n *\n * @param {String|*} type - type\n * @param {Boolean} bestGuessConversions - make some best guess conversions on type mismatch\n *\n * @return {String|undefined} returns the (corrected) value if possible, otherwise undefined\n */\nfunction correctType(type, bestGuessConversions) {\n // Also anything that can be converted to a string. Taking `language` as a field\n // with similar string constraints, as fields like `title` might take HTML into\n // account in the future.\n type = correctField('language', type, bestGuessConversions)\n\n if (entryTypes[type] === true) {\n return type\n } else if (bestGuessConversions && type in entryTypes) {\n return entryTypes[type]\n } else {\n return undefined\n }\n}\n\n/**\n * Correct a field.\n *\n * @access private\n * @memberof module:@citation-js/core.plugins.input.util\n *\n * @param {String} fieldName - field name\n * @param {*} value - value\n * @param {Boolean} bestGuessConversions - make some best guess conversions on type mismatch\n *\n * @return {*|undefined} returns the (corrected) value if possible, otherwise undefined\n */\nfunction correctField(fieldName, value, bestGuessConversions) {\n const fieldType = [].concat(fieldTypes[fieldName])\n\n switch (fieldTypes[fieldName]) {\n /* istanbul ignore next: no field has this */\n case NAME:\n return correctName(value, bestGuessConversions)\n case NAME_LIST:\n return correctNameList(value, bestGuessConversions)\n case DATE:\n return correctDate(value, bestGuessConversions)\n case TYPE:\n return correctType(value, bestGuessConversions)\n }\n\n if (bestGuessConversions) {\n if (\n typeof value === 'string' &&\n fieldType.includes('number') &&\n !fieldType.includes('string') &&\n !isNaN(+value)\n ) {\n return parseFloat(value)\n } else if (\n typeof value === 'number' &&\n fieldType.includes('string') &&\n !fieldType.includes('number')\n ) {\n return value.toString()\n } else if (Array.isArray(value) && value.length) {\n return correctField(fieldName, value[0], bestGuessConversions)\n }\n }\n\n if (fieldType.includes(typeof value)) {\n return value\n }\n}\n\n/**\n * Make CSL JSON conform to standards so that plugins don't have to typecheck all the time.\n *\n * @access protected\n * @method clean\n * @memberof module:@citation-js/core.plugins.input.util\n *\n * @param {Array<module:@citation-js/core~CSL>} data - Array of CSL\n * @param {Boolean} [bestGuessConversions=true] - make some best guess conversions on type mismatch\n *\n * @return {Array<module:@citation-js/core~CSL>} Array of clean CSL\n */\nfunction parseCsl(data, bestGuessConversions = true) {\n return data.map(function (entry) {\n const clean = {}\n\n for (const field in entry) {\n const correction = correctField(field, entry[field], bestGuessConversions)\n if (correction !== undefined) {\n clean[field] = correction\n }\n }\n\n return clean\n })\n}\n\nexport { parseCsl as clean }\n","/**\n * Upgrade CSL item from 1.0.1 to 1.0.2\n *\n * @method upgradeCsl\n * @memberof module:@citation-js/core.util\n *\n * @param {Object} item - Input object\n *\n * @return {Object} upgraded item\n */\nexport function upgradeCsl(item) {\n if (Array.isArray(item)) {\n return item.map(upgradeCsl)\n }\n\n item = { ...item }\n if ('event' in item) {\n item['event-title'] = item.event\n delete item.event\n }\n if (item.type === 'book' && 'version' in item) {\n item.type = 'software'\n }\n return item\n}\n\n/**\n * Downgrade CSL item from 1.0.2 to 1.0.1\n *\n * @method downgradeCsl\n * @memberof module:@citation-js/core.util\n *\n * @param {Object} item - Input object\n *\n * @return {Object} downgraded item\n */\nexport function downgradeCsl(item) {\n if (Array.isArray(item)) {\n return item.map(downgradeCsl)\n }\n\n item = { ...item }\n if ('event-title' in item) {\n item.event = item['event-title']\n delete item['event-title']\n }\n if (item.type === 'software') {\n item.type = 'book'\n }\n return item\n}\n","// @ts-nocheck\n/**\n * Duplicate objects to prevent Cite changing values outside of own scope\n *\n * @access protected\n * @method deepCopy\n * @memberof module:@citation-js/core.util\n *\n * @param {Object} obj - Input object\n * @param {Set} [seen]\n *\n * @return {Object} Duplicated object\n * @throws {TypeError}\n */\nexport function deepCopy(value, seen = new Set()) {\n if (\n typeof value !== 'object' ||\n value === null ||\n (value.constructor !== Object && value.constructor !== Array)\n ) {\n return value\n }\n\n if (seen.has(value)) {\n throw new TypeError('Recursively copying circular structure')\n }\n\n seen.add(value)\n let copy\n\n if (value.constructor === Array) {\n copy = value.map((value) => deepCopy(value, seen))\n } else {\n const object = {}\n for (const key in value) {\n object[key] = deepCopy(value[key], seen)\n }\n copy = object\n }\n\n seen.delete(value)\n return copy\n}\n\n// // Unfortunately too costly performance-wise, but the\n// // proper way to clone any object (apart from arrays perhaps):\n// const object = Object.create(Object.getPrototypeOf(value))\n// const descriptors = Object.getOwnPropertyDescriptors(value)\n// for (let key in descriptors) {\n// const descriptor = descriptors[key]\n// if (descriptor.value) { descriptor.value = deepCopy(descriptor.value) }\n// Object.defineProperty(object, key, descriptor)\n// }\n\nexport default deepCopy\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <https://feross.org>\n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nvar K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n var arr = new Uint8Array(1)\n var proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n var buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n var valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n var b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(\n value[Symbol.toPrimitive]('string'), encodingOrOffset, length\n )\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n var length = byteLength(string, encoding) | 0\n var buf = createBuffer(length)\n\n var actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n var buf = createBuffer(length)\n for (var i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n var copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n var buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n var buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n Buffer.from(buf).copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n var len = string.length\n var mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return '<Buffer ' + str + '>'\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n var strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (var i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n var len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nvar hexSliceLookupTable = (function () {\n var alphabet = '0123456789abcdef'\n var table = new Array(256)\n for (var i = 0; i < 16; ++i) {\n var i16 = i * 16\n for (var j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n","/* eslint-env browser */\n\nconst { Buffer } = require('buffer/')\n\nfunction syncFetch (...args) {\n const request = new syncFetch.Request(...args)\n\n const xhr = new XMLHttpRequest()\n xhr.withCredentials = request.credentials === 'include'\n xhr.timeout = request[INTERNALS].timeout\n\n // Request\n xhr.open(request.method, request.url, false)\n\n let useBinaryEncoding = false\n try {\n // Only allowed in Worker scope, not available in older browsers\n // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseType#Synchronous_XHR_restrictions\n xhr.responseType = 'arraybuffer'\n } catch (e) {\n // Not in Worker scope; instead, attempt this alternative method\n // https://web.archive.org/web/20071103070418/http://mgran.blogspot.com/2006/08/downloading-binary-streams-with.html\n xhr.overrideMimeType('text/plain; charset=x-user-defined')\n useBinaryEncoding = true\n }\n\n for (const header of request.headers) {\n xhr.setRequestHeader(...header)\n }\n\n xhr.send(request.body || null)\n\n // Response\n let headers = xhr.getAllResponseHeaders()\n headers = headers && headers.split('\\r\\n').filter(Boolean).map(header => header.split(': ', 2))\n\n let body = xhr.response\n if (useBinaryEncoding) {\n const buffer = Buffer.alloc(body.length)\n for (let i = 0; i < body.length; i++) {\n buffer[i] = body.charCodeAt(i) & 0xff\n }\n body = buffer\n }\n\n const response = new syncFetch.Response(body, {\n headers,\n status: xhr.status,\n statusText: xhr.statusText\n })\n\n response[INTERNALS].url = xhr.responseURL\n response[INTERNALS].redirected = xhr.responseURL !== request.url\n\n return response\n}\n\nconst INTERNALS = Symbol('SyncFetch Internals')\nconst REQ_UNSUPPORTED = ['mode', 'cache', 'redirect', 'referrer', 'integrity']\nconst HTTP_STATUS = {\n 100: 'Continue',\n 101: 'Switching Protocols',\n 200: 'OK',\n 201: 'Created',\n 202: 'Accepted',\n 203: 'Non-Authoritative Information',\n 204: 'No Content',\n 205: 'Reset Content',\n 206: 'Partial Content',\n 300: 'Multiple Choices',\n 301: 'Moved Permanently',\n 302: 'Found',\n 303: 'See Other',\n 304: 'Not Modified',\n 305: 'Use Proxy',\n 307: 'Temporary Redirect',\n 400: 'Bad Request',\n 401: 'Unauthorized',\n 402: 'Payment Required',\n 403: 'Forbidden',\n 404: 'Not Found',\n 405: 'Method Not Allowed',\n 406: 'Not Acceptable',\n 407: 'Proxy Authentication Required',\n 408: 'Request Timeout',\n 409: 'Conflict',\n 410: 'Gone',\n 411: 'Length Required',\n 412: 'Precondition Failed',\n 413: 'Payload Too Large',\n 414: 'URI Too Long',\n 415: 'Unsupported Media Type',\n 416: 'Range Not Satisfiable',\n 417: 'Expectation Failed',\n 426: 'Upgrade Required',\n 500: 'Internal Server Error',\n 501: 'Not Implemented',\n 502: 'Bad Gateway',\n 503: 'Service Unavailable',\n 504: 'Gateway Timeout',\n 505: 'HTTP Version Not Supported'\n}\n\nclass SyncRequest {\n constructor (resource, init = {}) {\n for (const option of REQ_UNSUPPORTED) {\n if (option in init) {\n throw new TypeError(`option ${option} not supported`)\n }\n }\n\n if (init.credentials === 'same-origin') {\n throw new TypeError('option credentials with value \\'same-origin\\' not supported')\n }\n\n this[INTERNALS] = {\n method: init.method || 'GET',\n headers: new syncFetch.Headers(init.headers),\n body: init.body ? Buffer.from(init.body) : null,\n credentials: init.credentials || 'omit',\n\n // Non-spec\n timeout: init.timeout || 0\n }\n\n if (typeof resource === 'string') {\n this[INTERNALS].url = resource\n } else if (resource instanceof SyncRequest) {\n this[INTERNALS].url = resource.url\n if (!init.method) {\n this[INTERNALS].method = resource.method\n }\n if (!init.headers) {\n this[INTERNALS].headers = resource.headers\n }\n if (!init.body) {\n this[INTERNALS].body = resource[INTERNALS].body\n }\n if (!init.credentials) {\n this[INTERNALS].credentials = resource.credentials\n }\n } else {\n throw new TypeError('Request input should be a URL string or a Request object')\n }\n }\n\n get cache () {\n return 'default'\n }\n\n get credentials () {\n return this[INTERNALS].credentials\n }\n\n get destination () {\n return ''\n }\n\n get headers () {\n return this[INTERNALS].headers\n }\n\n get integrity () {\n return ''\n }\n\n get method () {\n return this[INTERNALS].method\n }\n\n get mode () {\n return 'cors'\n }\n\n get priority () {\n return 'auto'\n }\n\n get redirect () {\n return 'follow'\n }\n\n get referrer () {\n return 'about:client'\n }\n\n get referrerPolicy () {\n return ''\n }\n\n get url () {\n return this[INTERNALS].url\n }\n\n clone () {\n checkBody(this)\n return new SyncRequest(this.url, this[INTERNALS])\n }\n}\n\nclass SyncResponse {\n constructor (body, init = {}) {\n this[INTERNALS] = {\n body: body ? Buffer.from(body) : null,\n bodyUsed: false,\n\n headers: new syncFetch.Headers(init.headers),\n status: init.status,\n statusText: init.statusText\n }\n }\n\n get headers () {\n return this[INTERNALS].headers\n }\n\n get ok () {\n const status = this[INTERNALS].status\n return status >= 200 && status < 300\n }\n\n get redirected () {\n return this[INTERNALS].redirected\n }\n\n get status () {\n return this[INTERNALS].status\n }\n\n get statusText () {\n return this[INTERNALS].statusText\n }\n\n get url () {\n return this[INTERNALS].url\n }\n\n clone () {\n return this.redirect(this[INTERNALS].url, this[INTERNALS].status)\n }\n\n redirect (url, status) {\n checkBody(this)\n\n const response = new SyncResponse(this[INTERNALS].body, {\n headers: this[INTERNALS].headers,\n status: status || this[INTERNALS].status,\n statusText: HTTP_STATUS[status] || this[INTERNALS].statusText\n })\n\n response[INTERNALS].url = url || this[INTERNALS].url\n response[INTERNALS].redirected = this[INTERNALS].redirected\n\n return response\n }\n}\n\nclass Body {\n constructor (body) {\n this[INTERNALS] = {\n body: Buffer.from(body),\n bodyUsed: false\n }\n }\n\n get bodyUsed () {\n return this[INTERNALS].bodyUsed\n }\n\n static mixin (prototype) {\n for (const name of Object.getOwnPropertyNames(Body.prototype)) {\n if (name === 'constructor') { continue }\n const desc = Object.getOwnPropertyDescriptor(Body.prototype, name)\n Object.defineProperty(prototype, name, { ...desc, enumerable: true })\n }\n }\n\n arrayBuffer () {\n const buffer = consumeBody(this)\n return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength)\n }\n\n blob () {\n const type = this.headers && this.headers.get('content-type')\n return new Blob([consumeBody(this)], type && { type })\n }\n\n text () {\n return consumeBody(this).toString()\n }\n\n json () {\n try {\n return JSON.parse(consumeBody(this).toString())\n } catch (err) {\n throw new TypeError(`invalid json response body at ${this.url} reason: ${err.message}`, 'invalid-json')\n }\n }\n\n buffer () {\n return consumeBody(this).clone()\n }\n}\n\nfunction checkBody (body) {\n if (body.bodyUsed) {\n throw new TypeError(`body used already for: ${body.url}`)\n }\n}\n\nfunction consumeBody (body) {\n checkBody(body)\n body[INTERNALS].bodyUsed = true\n return body[INTERNALS].body || Buffer.alloc(0)\n}\n\nBody.mixin(SyncRequest.prototype)\nBody.mixin(SyncResponse.prototype)\n\nclass Headers {\n constructor (headers) {\n if (headers instanceof syncFetch.Headers) {\n this[INTERNALS] = { ...headers[INTERNALS] }\n } else {\n this[INTERNALS] = {}\n\n if (Array.isArray(headers)) {\n for (const [name, value] of headers) {\n this.append(name, value)\n }\n } else if (typeof headers === 'object') {\n for (const name in headers) {\n this.set(name, headers[name])\n }\n }\n }\n }\n\n // modification\n append (name, value) {\n name = name.toLowerCase()\n if (!this[INTERNALS][name]) {\n this[INTERNALS][name] = []\n }\n this[INTERNALS][name].push(value)\n }\n\n delete (name) {\n delete this[INTERNALS][name.toLowerCase()]\n }\n\n set (name, value) {\n this[INTERNALS][name.toLowerCase()] = [value]\n }\n\n // access\n entries () {\n const pairs = []\n for (const name in this[INTERNALS]) {\n for (const value of this[INTERNALS][name]) {\n pairs.push([name, value])\n }\n }\n return pairs\n }\n\n get (name) {\n name = name.toLowerCase()\n return name in this[INTERNALS] ? this[INTERNALS][name].join(', ') : null\n }\n\n keys () {\n return Object.keys(this[INTERNALS])\n }\n\n has (name) {\n return name.toLowerCase() in this[INTERNALS]\n }\n\n values () {\n const values = []\n for (const name in this[INTERNALS]) {\n for (const value of this[INTERNALS][name]) {\n values.push(value)\n }\n }\n return values\n }\n\n * [Symbol.iterator] () {\n for (const name in this[INTERNALS]) {\n for (const value of this[INTERNALS][name]) {\n yield [name, value]\n }\n }\n }\n}\n\nsyncFetch.Headers = Headers\nsyncFetch.Request = SyncRequest\nsyncFetch.Response = SyncResponse\nmodule.exports = syncFetch\n","(function (global) {\n 'use strict';\n\n function fetchPonyfill(options) {\n var Promise = options && options.Promise || global.Promise;\n var XMLHttpRequest = options && options.XMLHttpRequest || global.XMLHttpRequest;\n\n return (function () {\n var globalThis = Object.create(global, {\n fetch: {\n value: undefined,\n writable: true\n }\n });\n\n (function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (factory((global.WHATWGFetch = {})));\n }(this, (function (exports) { 'use strict';\n\n var global =\n (typeof globalThis !== 'undefined' && globalThis) ||\n (typeof self !== 'undefined' && self) ||\n (typeof global !== 'undefined' && global);\n\n var support = {\n searchParams: 'URLSearchParams' in global,\n iterable: 'Symbol' in global && 'iterator' in Symbol,\n blob:\n 'FileReader' in global &&\n 'Blob' in global &&\n (function() {\n try {\n new Blob();\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in global,\n arrayBuffer: 'ArrayBuffer' in global\n };\n\n function isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n }\n\n if (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ];\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n };\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value);\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {};\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value);\n }, this);\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1]);\n }, this);\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name]);\n }, this);\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n var oldValue = this.map[name];\n this.map[name] = oldValue ? oldValue + ', ' + value : value;\n };\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)];\n };\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null\n };\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n };\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n };\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this);\n }\n }\n };\n\n Headers.prototype.keys = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push(name);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.values = function() {\n var items = [];\n this.forEach(function(value) {\n items.push(value);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.entries = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push([name, value]);\n });\n return iteratorFor(items)\n };\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true;\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result);\n };\n reader.onerror = function() {\n reject(reader.error);\n };\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsArrayBuffer(blob);\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsText(blob);\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf);\n var chars = new Array(view.length);\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i]);\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength);\n view.set(new Uint8Array(buf));\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false;\n\n this._initBody = function(body) {\n /*\n fetch-mock wraps the Response object in an ES6 Proxy to\n provide useful test harness features such as flush. However, on\n ES5 browsers without fetch or Proxy support pollyfills must be used;\n the proxy-pollyfill is unable to proxy an attribute unless it exists\n on the object before the Proxy is created. This change ensures\n Response.bodyUsed exists on the instance, while maintaining the\n semantic of setting Request.bodyUsed in the constructor before\n _initBody is called.\n */\n this.bodyUsed = this.bodyUsed;\n this._bodyInit = body;\n if (!body) {\n this._bodyText = '';\n } else if (typeof body === 'string') {\n this._bodyText = body;\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body;\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body;\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString();\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer);\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer]);\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body);\n } else {\n this._bodyText = body = Object.prototype.toString.call(body);\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8');\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type);\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n }\n };\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n };\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n var isConsumed = consumed(this);\n if (isConsumed) {\n return isConsumed\n }\n if (ArrayBuffer.isView(this._bodyArrayBuffer)) {\n return Promise.resolve(\n this._bodyArrayBuffer.buffer.slice(\n this._bodyArrayBuffer.byteOffset,\n this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength\n )\n )\n } else {\n return Promise.resolve(this._bodyArrayBuffer)\n }\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n };\n }\n\n this.text = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n };\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n };\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n };\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase();\n return methods.indexOf(upcased) > -1 ? upcased : method\n }\n\n function Request(input, options) {\n if (!(this instanceof Request)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n\n options = options || {};\n var body = options.body;\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url;\n this.credentials = input.credentials;\n if (!options.headers) {\n this.headers = new Headers(input.headers);\n }\n this.method = input.method;\n this.mode = input.mode;\n this.signal = input.signal;\n if (!body && input._bodyInit != null) {\n body = input._bodyInit;\n input.bodyUsed = true;\n }\n } else {\n this.url = String(input);\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin';\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers);\n }\n this.method = normalizeMethod(options.method || this.method || 'GET');\n this.mode = options.mode || this.mode || null;\n this.signal = options.signal || this.signal;\n this.referrer = null;\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body);\n\n if (this.method === 'GET' || this.method === 'HEAD') {\n if (options.cache === 'no-store' || options.cache === 'no-cache') {\n // Search for a '_' parameter in the query string\n var reParamSearch = /([?&])_=[^&]*/;\n if (reParamSearch.test(this.url)) {\n // If it already exists then set the value with the current time\n this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime());\n } else {\n // Otherwise add a new '_' parameter to the end with the current time\n var reQueryString = /\\?/;\n this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime();\n }\n }\n }\n }\n\n Request.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n };\n\n function decode(body) {\n var form = new FormData();\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=');\n var name = split.shift().replace(/\\+/g, ' ');\n var value = split.join('=').replace(/\\+/g, ' ');\n form.append(decodeURIComponent(name), decodeURIComponent(value));\n }\n });\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers();\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill\n // https://github.com/github/fetch/issues/748\n // https://github.com/zloirock/core-js/issues/751\n preProcessedHeaders\n .split('\\r')\n .map(function(header) {\n return header.indexOf('\\n') === 0 ? header.substr(1, header.length) : header\n })\n .forEach(function(line) {\n var parts = line.split(':');\n var key = parts.shift().trim();\n if (key) {\n var value = parts.join(':').trim();\n headers.append(key, value);\n }\n });\n return headers\n }\n\n Body.call(Request.prototype);\n\n function Response(bodyInit, options) {\n if (!(this instanceof Response)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n if (!options) {\n options = {};\n }\n\n this.type = 'default';\n this.status = options.status === undefined ? 200 : options.status;\n this.ok = this.status >= 200 && this.status < 300;\n this.statusText = 'statusText' in options ? options.statusText : '';\n this.headers = new Headers(options.headers);\n this.url = options.url || '';\n this._initBody(bodyInit);\n }\n\n Body.call(Response.prototype);\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n };\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''});\n response.type = 'error';\n return response\n };\n\n var redirectStatuses = [301, 302, 303, 307, 308];\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n };\n\n exports.DOMException = global.DOMException;\n try {\n new exports.DOMException();\n } catch (err) {\n exports.DOMException = function(message, name) {\n this.message = message;\n this.name = name;\n var error = Error(message);\n this.stack = error.stack;\n };\n exports.DOMException.prototype = Object.create(Error.prototype);\n exports.DOMException.prototype.constructor = exports.DOMException;\n }\n\n function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init);\n\n if (request.signal && request.signal.aborted) {\n return reject(new exports.DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest();\n\n function abortXhr() {\n xhr.abort();\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n };\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n setTimeout(function() {\n resolve(new Response(body, options));\n }, 0);\n };\n\n xhr.onerror = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'));\n }, 0);\n };\n\n xhr.ontimeout = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'));\n }, 0);\n };\n\n xhr.onabort = function() {\n setTimeout(function() {\n reject(new exports.DOMException('Aborted', 'AbortError'));\n }, 0);\n };\n\n function fixUrl(url) {\n try {\n return url === '' && global.location.href ? global.location.href : url\n } catch (e) {\n return url\n }\n }\n\n xhr.open(request.method, fixUrl(request.url), true);\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true;\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false;\n }\n\n if ('responseType' in xhr) {\n if (support.blob) {\n xhr.responseType = 'blob';\n } else if (\n support.arrayBuffer &&\n request.headers.get('Content-Type') &&\n request.headers.get('Content-Type').indexOf('application/octet-stream') !== -1\n ) {\n xhr.responseType = 'arraybuffer';\n }\n }\n\n if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers)) {\n Object.getOwnPropertyNames(init.headers).forEach(function(name) {\n xhr.setRequestHeader(name, normalizeValue(init.headers[name]));\n });\n } else {\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value);\n });\n }\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr);\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr);\n }\n };\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);\n })\n }\n\n fetch.polyfill = true;\n\n if (!global.fetch) {\n global.fetch = fetch;\n global.Headers = Headers;\n global.Request = Request;\n global.Response = Response;\n }\n\n exports.Headers = Headers;\n exports.Request = Request;\n exports.Response = Response;\n exports.fetch = fetch;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n })));\n\n\n return {\n fetch: globalThis.fetch,\n Headers: globalThis.Headers,\n Request: globalThis.Request,\n Response: globalThis.Response,\n DOMException: globalThis.DOMException\n };\n }());\n }\n\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return fetchPonyfill;\n });\n } else if (typeof exports === 'object') {\n module.exports = fetchPonyfill;\n } else {\n global.fetchPonyfill = fetchPonyfill;\n }\n}(typeof globalThis !== 'undefined' ? globalThis : typeof self !== 'undefined' ? self : typeof global !== 'undefined' ? global : this));\n\n","/**\n * Generate ID\n *\n * @access protected\n * @memberof module:@citation-js/core.util\n *\n * @param {Array<String>} list - old ID list\n * @param {String} prefix - ID prefix\n *\n * @return {String} CSL ID\n */\nfunction fetchId(list, prefix) {\n let id\n\n while (id === undefined || list.includes(id)) {\n id = `${prefix}${Math.random().toString().slice(2)}`\n }\n\n return id\n}\n\nexport default fetchId\n","//@ts-nocheck\nimport syncFetch from 'sync-fetch'\nimport fetchPolyfill from 'fetch-ponyfill'\nimport logger from '../logger.js'\n// import pkg from '../../package.json';\nconst { fetch, Headers } = fetchPolyfill()\nconst corsEnabled = typeof location !== 'undefined' && typeof document !== 'undefined'\nlet userAgent = `Citation.js/0.65`\n\nfunction normaliseHeaders(headers) {\n const result = {}\n const entries =\n headers instanceof Headers || headers instanceof syncFetch.Headers\n ? Array.from(headers)\n : Object.entries(headers)\n\n for (const [name, header] of entries) {\n result[name.toLowerCase()] = header.toString()\n }\n\n return result\n}\n\nfunction parseOpts(opts = {}) {\n const reqOpts = {\n headers: {\n accept: '*/*',\n },\n method: 'GET',\n checkContentType: opts.checkContentType,\n }\n\n if (userAgent && !corsEnabled) {\n reqOpts.headers['user-agent'] = userAgent\n }\n\n if (opts.body) {\n reqOpts.method = 'POST'\n const isJson = typeof opts.body !== 'string'\n reqOpts.body = isJson ? JSON.stringify(opts.body) : opts.body\n reqOpts.headers['content-type'] = isJson ? 'application/json' : 'text/plain'\n }\n\n if (opts.headers) {\n Object.assign(reqOpts.headers, normaliseHeaders(opts.headers))\n }\n\n return reqOpts\n}\n\nfunction sameType(request, response) {\n if (!request.accept || request.accept === '*/*' || !response['content-type']) {\n return true\n }\n\n const [a, b] = response['content-type'].split(';')[0].trim().split('/')\n return request.accept\n .split(',')\n .map((type) => type.split(';')[0].trim().split('/'))\n .some(([c, d]) => (c === a || c === '*') && (d === b || d === '*'))\n}\n\nfunction checkResponse(response, opts) {\n const { status, headers } = response\n let error\n\n if (status >= 400) {\n error = new Error(`Server responded with status code ${status}`)\n } else if (opts.checkContentType === true && !sameType(opts.headers, normaliseHeaders(headers))) {\n error = new Error(`Server responded with content-type ${headers.get('content-type')}`)\n }\n\n if (error) {\n error.status = status\n error.headers = headers\n error.body = response.body\n throw error\n }\n\n return response\n}\n\nexport function fetchFile(url, opts) {\n const reqOpts = parseOpts(opts)\n logger.http('[core]', reqOpts.method, url, reqOpts)\n const response = checkResponse(syncFetch(url, reqOpts), reqOpts)\n return response.text()\n}\nexport async function fetchFileAsync(url, opts) {\n const reqOpts = parseOpts(opts)\n logger.http('[core]', reqOpts.method, url, reqOpts)\n return fetch(url, reqOpts)\n .then((response) => checkResponse(response, reqOpts))\n .then((response) => response.text())\n}\nexport function setUserAgent(newUserAgent) {\n userAgent = newUserAgent\n}\nexport default fetchFile\n","// @ts-nocheck\n/**\n * @memberof module:@citation-js/core.util\n * @param {Object} [data={}] - initial values\n */\nclass Register {\n constructor(data = {}) {\n this.data = data\n }\n\n /**\n * @param {String} key\n * @param {*} value\n * @return {Register} this\n */\n set(key, value) {\n this.data[key] = value\n return this\n }\n\n /**\n * @param {String} key\n * @param {*} value\n * @return {Register} this\n */\n add(...args) {\n return this.set(...args)\n }\n\n /**\n * @param {String} key\n * @return {Register} this\n */\n delete(key) {\n delete this.data[key]\n return this\n }\n\n /**\n * @param {String} key\n * @return {Register} this\n */\n remove(...args) {\n return this.delete(...args)\n }\n\n /**\n * @param {String} key\n * @return {*} value\n */\n get(key) {\n return this.data[key]\n }\n\n /**\n * @param {String} key\n * @return {Boolean} register has key\n */\n has(key) {\n return Object.prototype.hasOwnProperty.call(this.data, key)\n }\n\n /**\n * @return {Array<String>} list of keys\n */\n list() {\n return Object.keys(this.data)\n }\n}\n\nexport default Register\n","// @ts-nocheck\nimport { deepCopy } from './deepCopy.js'\n\n/**\n * @typedef module:@citation-js/core.util.Grammar~ruleName\n * @type {String}\n */\n\n/**\n * @callback module:@citation-js/core.util.Grammar~rule\n * @this module:@citation-js/core.util.Grammar\n */\n\n/**\n * @memberof module:@citation-js/core.util\n *\n * @param {Object<module:@citation-js/core.util.Grammar~ruleName,module:@citation-js/core.util.Grammar~rule>} rules\n * @param {Object} state\n */\nclass Grammar {\n constructor(rules, state) {\n this.rules = rules\n this.defaultState = state\n this.mainRule = Object.keys(rules)[0]\n this.log = []\n }\n\n /**\n * @param iterator - lexer supporting formatError() and next()\n * @param [mainRule] - defaults to the first rule\n * @return result of the main rule\n */\n parse(iterator, mainRule) {\n this.lexer = iterator\n this.token = this.lexer.next()\n this.state = deepCopy(this.defaultState)\n this.log = []\n return this.consumeRule(mainRule || this.mainRule)\n }\n\n /**\n * @return {Boolean} true if there are no more tokens\n */\n matchEndOfFile() {\n return !this.token\n }\n\n /**\n * @param {String} type - a token type\n * @return {Boolean} true if the current token has the given type\n */\n matchToken(type) {\n return this.token && type === this.token.type\n }\n\n /**\n * @param {String} [type] - a token type\n * @param {Boolean} [optional=false] - false if it should throw an error if the type does not match\n * @return {Object} token information\n * @throws {SyntaxError} detailed syntax error if the current token is not the expected type or if there are no tokens left\n */\n consumeToken(type, optional) {\n const token = this.token\n\n if (!type || (token && token.type === type)) {\n this.token = this.lexer.next()\n return token\n } else if (optional) {\n return undefined\n } else {\n const got = token ? `\"${token.type}\"` : 'EOF'\n const error = new SyntaxError(this.lexer.formatError(token, `expected \"${type}\", got ${got}`))\n error.message += ` (${this.log.join('->')})`\n throw error\n }\n }\n\n /**\n * @param {String} rule - a rule name\n * @return whatever the rule function returns\n */\n consumeRule(rule) {\n this.log.push(rule)\n const result = this.rules[rule].call(this)\n this.log.pop()\n return result\n }\n}\n\nexport { Grammar }\n","// @ts-nocheck\n/**\n * Mapping unit.\n *\n * @typedef {Object} module:@citation-js/core.util.Translator~statement\n * @property {String|Array<String>} [source] - properties to source value from\n * @property {String|Array<String>} [target] - properties the value should go to\n * @property {Object} [convert] - convert serialized or nested values\n * @property {module:@citation-js/core.util.Translator~convertProp} [convert.toTarget] - function to convert source prop to target\n * @property {module:@citation-js/core.util.Translator~convertProp} [convert.toSource] - function to convert target prop to source\n * @property {Object} [when] - conditions as to when this statement should apply\n * @property {module:@citation-js/core.util.Translator~condition} [when.source]\n * @property {module:@citation-js/core.util.Translator~condition} [when.target]\n */\n\n/**\n * In the case of toTarget, source is input and target is output. In the case of\n * toSource, source is output and target is input.\n *\n * @callback module:@citation-js/core.util.Translator~convertProp\n * @param {...*} input - input values\n * @return {Array|*} If output is an array and multiple output properties are\n * specified, the output is divided over those properties.\n */\n\n/**\n * A top-level Boolean enables or disables a mapping unit in a given direction.\n * Otherwise, individual properties are checked with an object specifying the\n * property name and one of four things:\n *\n * - A boolean, checking for presence of the property\n * - An array of values for checking whether the property value is in them\n * - A value that should match with the property value\n * - A predicate function taking in the value and returning a boolean\n *\n * All conditions have to be fulfilled for the mapping unit to be enabled.\n *\n * @typedef {Boolean|Object<String,Boolean|Array<*>|module:@citation-js/core.util.Translator~conditionPropPredicate|*>} module:@citation-js/core.util.Translator~condition\n */\n\n/**\n * Return, based on a property, whether a mapping should apply.\n *\n * @callback module:@citation-js/core.util.Translator~conditionPropPredicate\n * @param {*} input - input value\n * @return {Boolean}\n */\n\n/**\n * Return, whether a mapping should apply.\n *\n * @callback module:@citation-js/core.util.Translator~conditionPredicate\n * @param {Object} input - input\n * @return {Boolean}\n */\n\n/**\n * @access private\n * @memberof module:@citation-js/core.util.Translator\n * @param {module:@citation-js/core.util.Translator~condition} condition\n * @return {module:@citation-js/core.util.Translator~conditionPredicate}\n */\nfunction createConditionEval(condition) {\n return function conditionEval(input) {\n if (typeof condition === 'boolean') {\n return condition\n }\n\n return Object.keys(condition).every((prop) => {\n const value = condition[prop]\n if (value === true) {\n return prop in input\n } else if (value === false) {\n return !(prop in input)\n } else if (typeof value === 'function') {\n return value(input[prop])\n } else if (Array.isArray(value)) {\n return value.includes(input[prop])\n } else {\n return input[prop] === value\n }\n })\n }\n}\n\n/**\n * @access private\n * @typedef {Object} module:@citation-js/core.util.Translator~normalizedStatement\n * @property {Array<String>} inputProp\n * @property {Array<String>} outputProp\n * @property {module:@citation-js/core.util.Translator~convertProp} convert\n * @property {module:@citation-js/core.util.Translator~conditionPredicate} condition\n */\n\n/**\n * @access private\n * @memberof module:@citation-js/core.util.Translator\n * @param {module:@citation-js/core.util.Translator~statement} prop\n * @param {Boolean} toSource\n * @return {module:@citation-js/core.util.Translator~normalizedStatement} normalized one-directional object\n */\nfunction parsePropStatement(prop, toSource) {\n let inputProp\n let outputProp\n let convert\n let condition\n\n if (typeof prop === 'string') {\n inputProp = outputProp = prop\n } else if (prop) {\n inputProp = toSource ? prop.target : prop.source\n outputProp = toSource ? prop.source : prop.target\n\n if (prop.convert) {\n convert = toSource ? prop.convert.toSource : prop.convert.toTarget\n }\n\n if (prop.when) {\n condition = toSource ? prop.when.target : prop.when.source\n if (condition != null) {\n condition = createConditionEval(condition)\n }\n }\n } else {\n return null\n }\n\n inputProp = [].concat(inputProp).filter(Boolean)\n outputProp = [].concat(outputProp).filter(Boolean)\n\n return { inputProp, outputProp, convert, condition }\n}\n\n/**\n * Return, whether a mapping should apply.\n *\n * @callback module:@citation-js/core.util.Translator~convert\n * @param {Object} input - input\n * @return {Object} output\n */\n\n/**\n * @access private\n * @memberof module:@citation-js/core.util.Translator\n * @param {Array<module:@citation-js/core.util.Translator~statement>} props\n * @param {Boolean} toSource\n * @return {module:@citation-js/core.util.Translator~convert} converter\n */\nfunction createConverter(props, toSource) {\n toSource = toSource === Translator.CONVERT_TO_SOURCE\n props = props.map((prop) => parsePropStatement(prop, toSource)).filter(Boolean)\n\n return function converter(input) {\n const output = {}\n\n for (const { inputProp, outputProp, convert, condition } of props) {\n // Skip when no output will be assigned\n if (outputProp.length === 0) {\n continue\n // Skip when requested by the requirements of the prop converter\n } else if (condition && !condition(input)) {\n continue\n // Skip when none of the required props are in the input data\n // NOTE: if no input is required, do not skip\n } else if (inputProp.length !== 0 && inputProp.every((prop) => !(prop in input))) {\n continue\n }\n\n let outputData = inputProp.map((prop) => input[prop])\n if (convert) {\n try {\n const converted = convert.apply(input, outputData)\n outputData = outputProp.length === 1 ? [converted] : converted\n } catch (cause) {\n throw new Error(`Failed to convert ${inputProp} to ${outputProp}`, { cause })\n }\n }\n\n outputProp.forEach((prop, index) => {\n const value = outputData[index]\n if (value !== undefined) {\n output[prop] = value\n }\n })\n }\n\n return output\n }\n}\n\n/**\n * @memberof module:@citation-js/core.util\n *\n * @param {Array<module:@citation-js/core.util.Translator~statement>} props\n *\n * @todo proper merging (?)\n * @todo 'else' conditions\n */\nclass Translator {\n constructor(props) {\n /**\n * @type {module:@citation-js/core.util.Translator~convert}\n */\n this.convertToSource = createConverter(props, Translator.CONVERT_TO_SOURCE)\n\n /**\n * @type {module:@citation-js/core.util.Translator~convert}\n */\n this.convertToTarget = createConverter(props, Translator.CONVERT_TO_TARGET)\n }\n}\n\n/**\n * @memberof module:@citation-js/core.util.Translator\n * @property {Symbol} CONVERT_TO_SOURCE\n */\nTranslator.CONVERT_TO_SOURCE = Symbol('convert to source')\n\n/**\n * @memberof module:@citation-js/core.util.Translator\n * @property {Symbol} CONVERT_TO_TARGET\n */\nTranslator.CONVERT_TO_TARGET = Symbol('convert to target')\n\nexport { Translator }\n","// @ts-nocheck\nimport { deepCopy, upgradeCsl } from '../../util/index.js'\nimport logger from '../../logger.js'\n\nimport { get as getTypeInfo } from './register.js'\nimport { type as parseType } from './type.js'\nimport { data as parseData, dataAsync as parseDataAsync } from './data.js'\nimport { applyGraph, removeGraph } from './graph.js'\n\n/**\n * @access private\n * @param {Array<Object>} graph\n * @return {String}\n */\nfunction prepareParseGraph(graph) {\n return (\n graph\n // collapse continuous iterations of the same type\n .reduce((array, next) => {\n const last = array[array.length - 1]\n if (last && last.type === next.type) {\n last.count = last.count + 1 || 2\n } else {\n array.push(next)\n }\n return array\n }, [])\n // presentation\n .map((element) => (element.count > 1 ? element.count + 'x ' : '') + element.type)\n .join(' -> ')\n )\n}\n\n/**\n * @access private\n * @memberof module:@citation-js/core.plugins.input\n * @constructor ChainParser\n *\n * @param {module:@citation-js/core~InputData} input\n * @param {module:@citation-js/core~InputOptions} options\n */\nclass ChainParser {\n constructor(input, options = {}) {\n this.options = Object.assign(\n {\n generateGraph: true,\n forceType: parseType(input),\n maxChainLength: 10,\n strict: true,\n target: '@csl/list+object',\n },\n options\n )\n\n this.type = this.options.forceType\n this.data = typeof input === 'object' ? deepCopy(input) : input\n this.graph = [{ type: this.type, data: input }]\n this.iteration = 0\n }\n\n /**\n * After a round of data parsing, update type information and check targets.\n *\n * @access public\n * @return {Boolean} Whether this is the last iteration or not\n */\n iterate() {\n if (this.iteration !== 0) {\n const typeInfo = getTypeInfo(this.type)\n\n if (typeInfo && typeInfo.outputs) {\n this.type = typeInfo.outputs\n } else {\n this.type = parseType(this.data)\n }\n\n this.graph.push({ type: this.type })\n }\n\n if (this.error || this.type === this.options.target) {\n return false\n } else if (this.iteration >= this.options.maxChainLength) {\n this.error = new RangeError(\n `Max. number of parsing iterations reached (${prepareParseGraph(this.graph)})`\n )\n return false\n } else {\n this.iteration++\n return true\n }\n }\n\n /**\n * Finish the iteration and return parsed data.\n *\n * @access public\n * @return Array<module:@citation-js/core~CSL>\n */\n end() {\n if (this.error) {\n logger.error('[core]', this.error.message)\n if (this.options.strict !== false) {\n throw this.error\n } else {\n return []\n }\n } else if (this.options.target === '@csl/list+object') {\n return upgradeCsl(this.data).map(\n this.options.generateGraph ? (entry) => applyGraph(entry, this.graph) : removeGraph\n )\n } else {\n return this.data\n }\n }\n}\n\n/**\n * Parse input until success.\n *\n * @access protected\n * @method chain\n * @memberof module:@citation-js/core.plugins.input\n *\n * @param {module:@citation-js/core~InputData} input - input data\n * @param {module:@citation-js/core~InputOptions} [options] - options\n *\n * @return {Array<module:@citation-js/core~CSL>} The parsed input\n */\nexport const chain = (...args) => {\n const chain = new ChainParser(...args)\n\n while (chain.iterate()) {\n try {\n chain.data = parseData(chain.data, chain.type)\n } catch (e) {\n chain.error = e\n }\n }\n\n return chain.end()\n}\n\n/**\n * Parse input once.\n *\n * @access protected\n * @method chainLink\n * @memberof module:@citation-js/core.plugins.input\n *\n * @param {module:@citation-js/core~InputData} input - input data\n *\n * @return {module:@citation-js/core~InputData} The parsed input\n */\nexport const chainLink = (input) => {\n const type = parseType(input)\n const output = type.match(/array|object/) ? deepCopy(input) : input\n\n return parseData(output, type)\n}\n\n/**\n * Parse input until success. (async)\n *\n * @access protected\n * @method chainAsync\n * @memberof module:@citation-js/core.plugins.input\n *\n * @param {module:@citation-js/core~InputData} input - input data\n * @param {module:@citation-js/core~InputOptions} [options] - options\n *\n * @return {Promise<Array<module:@citation-js/core~CSL>>} The parsed input\n */\nexport const chainAsync = async (...args) => {\n const chain = new ChainParser(...args)\n\n while (chain.iterate()) {\n chain.data = await parseDataAsync(chain.data, chain.type).catch((e) => {\n chain.error = e\n })\n }\n\n return chain.end()\n}\n\n/**\n * Parse input once. (async)\n *\n * @access protected\n * @method chainLinkAsync\n * @memberof module:@citation-js/core.plugins.input\n *\n * @param {module:@citation-js/core~InputData} input - The input data\n *\n * @return {Promise<module:@citation-js/core~InputData>} The parsed input\n */\nexport const chainLinkAsync = async (input) => {\n const type = parseType(input)\n const output = type.match(/array|object/) ? deepCopy(input) : input\n\n return parseDataAsync(output, type)\n}\n","// @ts-nocheck\nimport { chain, chainAsync } from './chain.js'\n\n/**\n * @access private\n * @memberof module:@citation-js/core.plugins.input\n *\n * @typedef {Object<module:@citation-js/core.plugins.input~format,module:@citation-js/core.plugins.input~parse>} parsers\n */\nconst parsers = {}\n\n/**\n * @access private\n * @memberof module:@citation-js/core.plugins.input\n *\n * @typedef {Object<module:@citation-js/core.plugins.input~format,module:@citation-js/core.plugins.input~parseAsync>} asyncParsers\n */\nconst asyncParsers = {}\n\n/**\n * @access private\n * @memberof module:@citation-js/core.plugins.input\n *\n * @typedef {Object<module:@citation-js/core.plugins.input~format,module:@citation-js/core.plugins.input~parse>} nativeParsers\n */\nconst nativeParsers = {\n '@csl/object': (input) => [input],\n '@csl/list+object': (input) => input,\n '@else/list+object': (input) => input.map(chain).flat(),\n '@invalid': () => {\n throw new Error('This format is not supported or recognized')\n },\n}\n\n/**\n * @access private\n * @memberof module:@citation-js/core.plugins.input\n *\n * @typedef {Object<module:@citation-js/core.plugins.input~format,module:@citation-js/core.plugins.input~parseAsync>} nativeAsyncParsers\n */\nconst nativeAsyncParsers = {\n '@else/list+object': async (input) => (await Promise.all(input.map(chainAsync))).flat(),\n}\n\n/**\n * @access public\n * @method data\n * @memberof module:@citation-js/core.plugins.input\n *\n * @param {module:@citation-js/core~InputData} input - input data\n * @param {module:@citation-js/core.plugins.input~format} type - input type\n *\n * @return {*} parsed data\n * @return {Null} if no parser available\n */\nexport function data(input, type) {\n if (typeof parsers[type] === 'function') {\n return parsers[type](input)\n } else {\n throw new Error('This format is not supported or recognized')\n // throw new TypeError(`No synchronous parser found for ${type}`)\n }\n}\n\n/**\n * @access public\n * @method dataAsync\n * @memberof module:@citation-js/core.plugins.input\n *\n * @param {module:@citation-js/core~InputData} input - input data\n * @param {module:@citation-js/core.plugins.input~format} type - input type\n *\n * @return {Promise} parsed data\n * @return {Promise<Null>} if no parser available\n */\nexport async function dataAsync(input, type) {\n if (typeof asyncParsers[type] === 'function') {\n return asyncParsers[type](input)\n } else if (typeof nativeAsyncParsers[type] === 'function') {\n return nativeAsyncParsers[type](input)\n } else if (hasDataParser(type, false)) {\n return data(input, type)\n } else {\n throw new TypeError(`No parser found for ${type}`)\n }\n}\n\n/**\n * @access protected\n * @method addDataParser\n * @memberof module:@citation-js/core.plugins.input\n *\n * @param {module:@citation-js/core.plugins.input~format} format\n * @param {module:@citation-js/core.plugins.input~parse|module:@citation-js/core.plugins.input~parseAsync} parser\n * @param {Object} [options={}]\n * @param {Boolean} [options.async=false]\n */\nexport function addDataParser(format, { parser, async }) {\n if (async) {\n asyncParsers[format] = parser\n } else {\n parsers[format] = parser\n }\n}\n\n/**\n * @access public\n * @method hasDataParser\n * @memberof module:@citation-js/core.plugins.input\n *\n * @param {module:@citation-js/core.plugins.input~format} type\n * @param {Boolean} [async=false] - check only for async, or only sync\n *\n * @return {Boolean} parser exists\n */\nexport function hasDataParser(type, async) {\n return async\n ? asyncParsers[type] || nativeAsyncParsers[type]\n : parsers[type] || nativeParsers[type]\n}\n\n/**\n * @access public\n * @method removeDataParser\n * @memberof module:@citation-js/core.plugins.input\n *\n * @param {module:@citation-js/core.plugins.input~format} type\n * @param {Boolean} [async=false]\n */\nexport function removeDataParser(type, async) {\n delete (async ? asyncParsers : parsers)[type]\n}\n\n/**\n * @access public\n * @method listDataParser\n * @memberof module:@citation-js/core.plugins.input\n *\n * @param {Boolean} [async=false]\n */\nexport function listDataParser(async) {\n return Object.keys(async ? asyncParsers : parsers)\n}\n","// @ts-nocheck\nimport { FormatParser } from './parser.js'\nimport { addTypeParser, removeTypeParser } from './type.js'\nimport { addDataParser, removeDataParser } from './data.js'\n\n/**\n * @access private\n * @type {Object<module:@citation-js/core.plugins.input~format, Object>}\n */\nconst formats = {}\n\n/**\n * See the relevant tutorial: {@tutorial input_plugins}\n *\n * @access public\n * @method add\n * @memberof module:@citation-js/core.plugins.input\n *\n * @param {module:@citation-js/core.plugins.input~format} format - input format name\n * @param {module:@citation-js/core.plugins.input~parsers} parsers - parsers\n *\n * @tutorial input_plugins\n */\nexport function add(format, parsers) {\n const formatParser = new FormatParser(format, parsers)\n formatParser.validate()\n\n const index = formats[format] || (formats[format] = {})\n\n if (formatParser.typeParser) {\n addTypeParser(format, formatParser.typeParser)\n index.type = true\n }\n if (formatParser.dataParser) {\n addDataParser(format, formatParser.dataParser)\n index.data = true\n }\n if (formatParser.asyncDataParser) {\n addDataParser(format, formatParser.asyncDataParser)\n index.asyncData = true\n }\n\n if (parsers.outputs) {\n index.outputs = parsers.outputs\n }\n}\n\n/**\n * @access public\n * @method get\n * @memberof module:@citation-js/core.plugins.input\n *\n * @param {module:@citation-js/core.plugins.input~format} format - input format name\n * @returns {Object} index\n */\nexport function get(format) {\n return formats[format]\n}\n\n/**\n * @access public\n * @method remove\n * @memberof module:@citation-js/core.plugins.input\n *\n * @param {module:@citation-js/core.plugins.input~format} format - input format name\n */\nexport function remove(format) {\n const index = formats[format]\n\n if (!index) {\n return\n }\n\n if (index.type) {\n removeTypeParser(format)\n }\n if (index.data) {\n removeDataParser(format)\n }\n if (index.asyncData) {\n removeDataParser(format, true)\n }\n\n delete formats[format]\n}\n\n/**\n * @access public\n * @method has\n * @memberof module:@citation-js/core.plugins.input\n * @param {module:@citation-js/core.plugins.input~format} format - input format name\n * @returns {Boolean} input format is registered\n */\nexport function has(format) {\n return format in formats\n}\n\n/**\n * @access public\n * @method list\n * @memberof module:@citation-js/core.plugins.input\n * @returns {Array<module:@citation-js/core.plugins.input~format>} input format is registered\n */\nexport function list() {\n return Object.keys(formats)\n}\n","/**\n * @namespace input\n * @memberof module:@citation-js/core.plugins\n */\n\nimport * as dataType from './dataType.js'\nimport * as graph from './graph.js'\nimport * as parser from './parser.js'\nimport * as csl from './csl.js'\n\n/**\n * @namespace util\n * @memberof module:@citation-js/core.plugins.input\n */\nexport const util = Object.assign({}, dataType, graph, parser, csl)\n\nexport * from './register'\n\nexport * from './chain'\nexport * from './type'\nexport * from './data'\n","// @ts-nocheck\nimport { chain as parseInput, chainAsync as parseInputAsync } from '../plugins/input/index.js'\nimport fetchId from '../util/fetchId.js'\n\n/**\n * Add an object to the array of objects\n *\n * @memberof module:@citation-js/core.Cite#\n *\n * @param {module:@citation-js/core~InputData} data - The data to add to your object\n * @param {module:@citation-js/core~InputOptions} [options] - Options\n * @param {Boolean} [log=false] - Show this call in the log\n *\n * @return {module:@citation-js/core.Cite} The updated parent object\n */\nfunction add(data, options = {}, log = false) {\n if (options === true || log === true) {\n this.save()\n }\n\n this.data.push(...parseInput(data, options))\n\n this.data\n .filter((entry) => !Object.prototype.hasOwnProperty.call(entry, 'id'))\n .forEach((entry) => {\n entry.id = fetchId(this.getIds(), 'temp_id_')\n })\n\n return this\n}\n\n/**\n * Add an object to the array of objects\n *\n * @memberof module:@citation-js/core.Cite#\n *\n * @param {module:@citation-js/core~InputData} data - The data to add to your object\n * @param {module:@citation-js/core~InputOptions} [options] - Options\n * @param {Boolean} [log=false] - Show this call in the log\n *\n * @return {Promise<module:@citation-js/core.Cite>} The updated parent object\n */\nasync function addAsync(data, options = {}, log = false) {\n if (options === true || log === true) {\n this.save()\n }\n\n this.data.push(...(await parseInputAsync(data, options)))\n\n this.data\n .filter((entry) => !Object.prototype.hasOwnProperty.call(entry, 'id'))\n .forEach((entry) => {\n entry.id = fetchId(this.getIds(), 'temp_id_')\n })\n\n return this\n}\n\n/**\n * Recreate a `Cite` object with almost any kind of data, and manipulate it with its default methods.\n *\n * @memberof module:@citation-js/core.Cite#\n *\n * @param {module:@citation-js/core~InputData} data - Replacement data\n * @param {module:@citation-js/core~InputOptions} [options] - Options\n * @param {Boolean} [log=false] - Show this call in the log\n *\n * @return {module:@citation-js/core.Cite} The updated parent object\n */\nfunction set(data, options = {}, log = false) {\n if (options === true || log === true) {\n this.save()\n }\n\n this.data = []\n return typeof options !== 'boolean' ? this.add(data, options) : this.add(data)\n}\n\n/**\n * Recreate a `Cite` object with almost any kind of data, and manipulate it with its default methods.\n *\n * @memberof module:@citation-js/core.Cite#\n *\n * @param {module:@citation-js/core~InputData} data - Replacement data\n * @param {module:@citation-js/core~InputOptions} [options] - Options\n * @param {Boolean} [log=false] - Show this call in the log\n *\n * @return {Promise<module:@citation-js/core.Cite>} The updated parent object\n */\nasync function setAsync(data, options = {}, log = false) {\n if (options === true || log === true) {\n this.save()\n }\n\n this.data = []\n return typeof options !== 'boolean' ? this.addAsync(data, options) : this.addAsync(data)\n}\n\n/**\n * Reset a `Cite` object.\n *\n * @memberof module:@citation-js/core.Cite#\n *\n * @param {Boolean} [log=false] - Show this call in the log\n *\n * @return {module:@citation-js/core.Cite} The updated, empty parent object (except the log, the log lives)\n */\nfunction reset(log) {\n if (log) {\n this.save()\n }\n\n this.data = []\n this._options = {}\n\n return this\n}\n\nexport { add, addAsync, set, setAsync, reset }\n","// @ts-nocheck\n/**\n * @module output/label\n */\n\n/**\n * Get a label from CSL data\n *\n * @access protected\n * @method getLabel\n * @todo flavors/formats\n *\n * @param {CSL} entry - Input CSL\n *\n * @return {String} The label\n */\nfunction getLabel(entry) {\n if ('citation-label' in entry) {\n return entry['citation-label']\n }\n\n let res = ''\n\n if (entry.author) {\n res += entry.author[0].family || entry.author[0].literal\n }\n if (entry.issued && entry.issued['date-parts'] && entry.issued['date-parts'][0]) {\n res += entry.issued['date-parts'][0][0]\n }\n if (entry['year-suffix']) {\n res += entry['year-suffix']\n } else if (entry.title) {\n res += entry.title.replace(/<\\/?.*?>/g, '').match(/^(?:(?:the|a|an)\\s+)?(\\S+)/i)[1]\n }\n\n return res\n}\n\nexport { getLabel }\nexport default {\n label(data) {\n return data.reduce((object, entry) => {\n object[entry.id] = getLabel(entry)\n return object\n }, {})\n },\n}\n","import { getLabel } from '../plugin-common/output/label.js'\nimport { format as getName } from '@citation-js/name'\n\n/**\n * @callback module:@citation-js/core.Cite#sort~sort\n * @param {module:@citation-js/core~CSL} a - element a\n * @param {module:@citation-js/core~CSL} b - element b\n * @return {Number} positive for a > b, negative for b > a, zero for a = b\n */\n\n/**\n * Get value for comparing\n *\n * @access private\n * @method getComparisonValue\n *\n * @param {module:@citation-js/core~CSL} obj - obj\n * @param {String} prop - The prop in question\n * @param {Boolean} label - Prop is label\n *\n * @return {String|Number} something to compare\n */\nfunction getComparisonValue(obj, prop, label = prop === 'label') {\n let value = label ? getLabel(obj) : obj[prop]\n\n switch (prop) {\n case 'author':\n case 'editor':\n return value.map((name) => name.literal || name.family || getName(name))\n\n case 'accessed':\n case 'issued':\n return value['date-parts'][0]\n\n case 'page':\n return value.split('-').map((num) => parseInt(num))\n\n case 'edition':\n case 'issue':\n case 'volume':\n value = parseInt(value)\n return !isNaN(value) ? value : -Infinity\n\n default:\n return value || -Infinity\n }\n}\n\n/**\n * Compares props\n *\n * @access private\n * @method compareProp\n *\n * @param {module:@citation-js/core~CSL} entryA\n * @param {module:@citation-js/core~CSL} entryB\n * @param {String} prop - The prop in question. Prepend ! to sort the other way around.\n * @param {Boolean} flip - Override flip\n *\n * @return {Number} positive for a > b, negative for b > a, zero for a = b (flips if prop has !)\n */\nfunction compareProp(entryA, entryB, prop, flip = /^!/.test(prop)) {\n prop = prop.replace(/^!/, '')\n const a = getComparisonValue(entryA, prop)\n const b = getComparisonValue(entryB, prop)\n\n return (flip ? -1 : 1) * (a > b ? 1 : a < b ? -1 : 0)\n}\n\n/**\n * Generates a sorting callback based on props.\n *\n * @access private\n * @method getSortCallback\n *\n * @param {...String} props - How to sort\n *\n * @return {module:@citation-js/core.Cite#sort~sort} sorting callback\n */\nfunction getSortCallback(...props) {\n return (a, b) => {\n const keys = props.slice()\n let output = 0\n\n while (!output && keys.length) {\n output = compareProp(a, b, keys.shift())\n }\n\n return output\n }\n}\n\n/**\n * Sort the dataset\n *\n * @memberof module:@citation-js/core.Cite#\n *\n * @param {module:@citation-js/core.Cite#sort~sort|Array<String>} [method=[]] - How to sort\n * @param {Boolean} [log=false] - Show this call in the log\n *\n * @return {module:@citation-js/core.Cite} The updated parent object\n */\nfunction sort(method = [], log) {\n if (log) {\n this.save()\n }\n\n this.data.sort(typeof method === 'function' ? method : getSortCallback(...method, 'label'))\n\n return this\n}\n\nexport { sort }\n","// @ts-nocheck\n/**\n * @namespace output\n * @memberof module:@citation-js/core.plugins\n */\n\nimport Register from '../util/register.js'\n\n/**\n * @callback module:@citation-js/core.plugins.output~formatter\n * @param {Array<module:@citation-js/core~InputData>} data\n * @return {String} output\n */\n\n/**\n * @typedef module:@citation-js/core.plugins.output~formatterName\n * @type String\n */\n\n/**\n * Validate input arguments\n *\n * @access private\n * @memberof module:@citation-js/core.plugins.output\n *\n * @param {String} name - output format name\n * @param {module:@citation-js/core.plugins.output~formatter} formatter - outputting function\n * @throws {TypeError} Invalid output format name\n * @throws {TypeError} Invalid formatter\n */\nfunction validate(name, formatter) {\n if (typeof name !== 'string') {\n throw new TypeError(`Invalid output format name, expected string, got ${typeof name}`)\n } else if (typeof formatter !== 'function') {\n throw new TypeError(`Invalid formatter, expected function, got ${typeof formatter}`)\n }\n}\n\n/**\n * @access public\n * @memberof module:@citation-js/core.plugins.output\n * @constant register\n *\n * @type module:@citation-js/core.util.Register\n */\nexport const register = new Register()\n\n/**\n * Add output plugin.\n *\n * @access public\n * @memberof module:@citation-js/core.plugins.output\n * @method add\n *\n * @param {module:@citation-js/core.plugins.output~formatterName} name - output format name\n * @param {module:@citation-js/core.plugins.output~formatter} formatter - outputting function\n * @throws {TypeError} validation errors\n */\nexport function add(name, formatter) {\n validate(name, formatter)\n\n register.set(name, formatter)\n}\n\n/**\n * Remove output plugin.\n *\n * @access public\n * @memberof module:@citation-js/core.plugins.output\n * @method remove\n *\n * @param {module:@citation-js/core.plugins.output~formatterName} name - output format name\n */\nexport function remove(name) {\n register.remove(name)\n}\n\n/**\n * Check if output plugin exists.\n *\n * @access public\n * @memberof module:@citation-js/core.plugins.output\n * @method has\n *\n * @param {module:@citation-js/core.plugins.output~formatterName} name - output format name\n * @return {Boolean} register has plugin\n */\nexport function has(name) {\n return register.has(name)\n}\n\n/**\n * List output plugins.\n *\n * @access public\n * @memberof module:@citation-js/core.plugins.output\n * @method list\n *\n * @return {Array<String>} list of plugins\n */\nexport function list() {\n return register.list()\n}\n\n/**\n * Call output plugin\n *\n * @access public\n * @memberof module:@citation-js/core.plugins.output\n * @method format\n *\n * @param {module:@citation-js/core.plugins.output~formatterName} name - output format name\n * @param {Array<module:@citation-js/core~CSL>} data - all entries\n * @param {...*} options - output options\n */\nexport function format(name, data, ...options) {\n if (!register.has(name)) {\n throw new Error(`Output format \"${name}\" unavailable`)\n }\n return register.get(name)(data, ...options)\n}\n","// @ts-nocheck\nimport { validateOutputOptions as validate } from './validate.js'\nimport { format as formatData } from '../plugins/output.js'\nimport { clean as parseCsl } from '../plugins/input/csl.js'\n\n/**\n * Get a list of the data entry IDs, in the order of that list\n *\n * @access public\n * @method getIds\n * @memberof module:@citation-js/core.Cite#\n *\n * @return {Array<String>} List of IDs\n */\nexport function getIds() {\n return this.data.map((entry) => entry.id)\n}\n\n/**\n * Get formatted data from your object.\n *\n * @access public\n * @method format\n * @memberof module:@citation-js/core.Cite#\n *\n * @param {String} format - format module name\n * @param {...*} options - module options (see relevant documentation)\n *\n * @return {String|Array<Object>} formatted data\n */\nexport function format(format, ...options) {\n return formatData(format, parseCsl(this.data), ...options)\n}\n\n/**\n * Get formatted data from your object.\n *\n * @access public\n * @method get\n * @memberof module:@citation-js/core.Cite#\n * @tutorial output\n * @deprecated use {@link module:@citation-js/core.Cite#format}\n *\n * @param {module:@citation-js/core~OutputOptions} [options={}] - Output options\n *\n * @return {String|Array<Object>} The formatted data\n */\n/* istanbul ignore next: deprecated */\nexport function get(options = {}) {\n validate(options)\n\n const parsedOptions = Object.assign({}, this.defaultOptions, this._options.output, options)\n\n const { type, style } = parsedOptions\n const [styleType, styleFormat] = style.split('-')\n const newStyle =\n styleType === 'citation' ? 'bibliography' : styleType === 'csl' ? 'data' : styleType\n const newType = type === 'string' ? 'text' : type === 'json' ? 'object' : type\n\n let formatOptions\n\n switch (newStyle) {\n case 'bibliography': {\n const { lang, append, prepend } = parsedOptions\n formatOptions = { template: styleFormat, lang, format: newType, append, prepend }\n break\n }\n\n case 'data':\n case 'bibtex':\n case 'bibtxt':\n case 'ndjson':\n case 'ris':\n formatOptions = { type: newType }\n break\n\n default:\n throw new Error(`Invalid style \"${newStyle}\"`)\n }\n\n const result = this.format(newStyle, Object.assign(formatOptions, options._newOptions))\n\n const { format } = parsedOptions\n if (\n format === 'real' &&\n newType === 'html' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n ) {\n const tmp = document.createElement('div')\n tmp.innerHTML = result\n return tmp.firstChild\n } else if (format === 'string' && typeof result === 'object') {\n return JSON.stringify(result)\n } else {\n return result\n }\n}\n","// @ts-nocheck\n/**\n * @callback module:@citation-js/core.Cite~asyncCallback\n * @param {Cite} data - Cite object\n */\n\n/**\n * @access public\n * @memberof module:@citation-js/core.Cite\n *\n * @param {module:@citation-js/core~InputData} data - input data\n * @param {module:@citation-js/core~InputOptions} [options={}] - cite options\n * @param {module:@citation-js/core.Cite~asyncCallback} [callback] - if not given, function returns promise.\n *\n * @return {Promise<module:@citation-js/core.Cite>} if callback is omitted, returns a promise\n */\nfunction async(data, options, callback) {\n if (typeof options === 'function' && !callback) {\n callback = options\n options = undefined\n }\n\n const promise = new this().setAsync(data, options)\n\n if (typeof callback === 'function') {\n promise.then(callback)\n return undefined\n } else {\n return promise\n }\n}\n\nexport default async\n","//@ts-nocheck\nimport * as log from './log.js'\nimport * as options from './options.js'\nimport * as set from './set.js'\nimport * as sort from './sort.js'\nimport * as get from './get.js'\nimport * as staticMethods from './static.js'\n\n/**\n * Create a `Cite` object with almost any kind of data, and manipulate it with its default methods.\n *\n * @access public\n * @constructor Cite\n * @memberof module:@citation-js/core\n *\n * @param {module:@citation-js/core~InputData} data - Input data\n * @param {module:@citation-js/core~InputOptions} [options={}] - Input options\n */\nfunction Cite(data, options = {}) {\n // Making it Scope-Safe\n if (!(this instanceof Cite)) {\n return new Cite(data, options)\n }\n\n /**\n * The default options for the output. See [input options](../#cite.in.options)\n *\n * @access protected\n * @memberof module:@citation-js/core.Cite#\n *\n * @var {module:@citation-js/core~InputOptions} _options\n */\n this._options = options\n\n /**\n * The saved-images-log\n *\n * @access protected\n * @memberof module:@citation-js/core.Cite#\n *\n * @var {Array<Array<String>>} log\n */\n this.log = []\n\n /**\n * The parsed data\n *\n * @access protected\n * @memberof module:@citation-js/core.Cite#\n *\n * @var {Array<module:@citation-js/core~CSL>} data\n */\n this.data = []\n\n // Modified citation-js to accept an array of objects\n // Use add instead of set to retain previous data\n data.forEach((d) => {\n this.add(d, options)\n })\n // this.set(data, options)\n this.options(options)\n\n return this\n}\n\nObject.assign(Cite.prototype, log, options, set, sort, get)\n\nCite.prototype[Symbol.iterator] = function* () {\n yield* this.data\n}\n\nObject.assign(Cite, staticMethods)\n\nexport default Cite\n","// @ts-nocheck\n/**\n * @namespace dict\n * @memberof module:@citation-js/core.plugins\n */\n\nimport Register from '../util/register.js'\n\n/**\n * @typedef module:@citation-js/core.plugins.dict~dictName\n * @type String\n */\n\n/**\n * @typedef module:@citation-js/core.plugins.dict~dict\n * @type Object<module:@citation-js/core.plugins.dict~entryName,module:@citation-js/core.plugins.dict~dictEntry>\n */\n\n/**\n * @typedef module:@citation-js/core.plugins.dict~entryName\n * @type String\n */\n\n/**\n * @typedef module:@citation-js/core.plugins.dict~dictEntry\n * @type Array<String>\n */\n\n/**\n * Validate input arguments\n *\n * @access private\n * @memberof module:@citation-js/core.plugins.dict\n *\n * @param {module:@citation-js/core.plugins.dict~dictName} name - output format name\n * @param {module:@citation-js/core.plugins.dict~dict} formatter - outputting function\n * @throws {TypeError} Invalid output format name\n * @throws {TypeError} Invalid formatter\n */\nfunction validate(name, dict) {\n if (typeof name !== 'string') {\n throw new TypeError(`Invalid dict name, expected string, got ${typeof name}`)\n } else if (typeof dict !== 'object') {\n throw new TypeError(`Invalid dict, expected object, got ${typeof dict}`)\n }\n\n for (const entryName in dict) {\n const entry = dict[entryName]\n if (!Array.isArray(entry) || entry.some((part) => typeof part !== 'string')) {\n throw new TypeError(`Invalid dict entry \"${entryName}\", expected array of strings`)\n }\n }\n}\n\n/**\n * @access public\n * @memberof module:@citation-js/core.plugins.dict\n * @constant register\n *\n * @type module:@citation-js/core.util.Register\n */\nexport const register = new Register({\n html: {\n bibliographyContainer: ['<div class=\"csl-bib-body\">', '</div>'],\n entry: ['<div class=\"csl-entry\">', '</div>'],\n list: ['<ul style=\"list-style-type:none\">', '</ul>'],\n listItem: ['<li>', '</li>'],\n },\n text: {\n bibliographyContainer: ['', '\\n'],\n entry: ['', '\\n'],\n list: ['\\n', ''],\n listItem: ['\\t', '\\n'],\n },\n})\n\n/**\n * Add dictionary to register. Can be used by output plugins.\n *\n * @todo docs\n *\n * @access public\n * @memberof module:@citation-js/core.plugins.dict\n * @method add\n *\n * @param {module:@citation-js/core.plugins.dict~dictName} name - dictionary name\n * @param {module:@citation-js/core.plugins.dict~dict} dict - dictionary data\n * @throws {TypeError} argument validation error\n */\nexport function add(name, dict) {\n validate(name, dict)\n register.set(name, dict)\n}\n\n/**\n * Remove dictionary.\n *\n * @access public\n * @memberof module:@citation-js/core.plugins.dict\n * @method remove\n *\n * @param {module:@citation-js/core.plugins.dict~dictName} name - output format name\n */\nexport function remove(name) {\n register.remove(name)\n}\n\n/**\n * Check if dictionary plugin exists.\n *\n * @access public\n * @memberof module:@citation-js/core.plugins.dict\n * @method has\n *\n * @param {module:@citation-js/core.plugins.dict~dictName} name - output format name\n * @return {Boolean} register has plugin\n */\nexport function has(name) {\n return register.has(name)\n}\n\n/**\n * List dictionary plugins.\n *\n * @access public\n * @memberof module:@citation-js/core.plugins.dict\n * @method list\n *\n * @return {Array<String>} list of plugins\n */\nexport function list() {\n return register.list()\n}\n\n/**\n * Get dictionary data.\n *\n * @access public\n * @memberof module:@citation-js/core.plugins.dict\n * @method get\n *\n * @param {module:@citation-js/core.plugins.dict~dictName} name - output format name\n * @return {module:@citation-js/core.plugins.dict~dict} dictionary data\n */\nexport function get(name) {\n if (!register.has(name)) {\n throw new Error(`Dict \"${name}\" unavailable`)\n }\n return register.get(name)\n}\n\n/**\n * Object containing HTML strings for building JSON and BibTeX. Made to match citeproc, for compatibility.\n *\n * @access protected\n * @memberof module:@citation-js/core.plugins.dict\n * @deprecated use the new formatting dicts: {@link module:@citation-js/core.plugins.dict}\n */\nexport const htmlDict = {\n wr_start: '<div class=\"csl-bib-body\">',\n wr_end: '</div>',\n en_start: '<div class=\"csl-entry\">',\n en_end: '</div>',\n ul_start: '<ul style=\"list-style-type:none\">',\n ul_end: '</ul>',\n li_start: '<li>',\n li_end: '</li>',\n}\n\n/**\n * Object containing text strings for building JSON and BibTeX. Made to match citeproc, for compatibility.\n *\n * @access protected\n * @memberof module:@citation-js/core.plugins.dict\n * @deprecated use the new formatting dicts: {@link module:@citation-js/core.plugins.dict}\n */\nexport const textDict = {\n wr_start: '',\n wr_end: '\\n',\n en_start: '',\n en_end: '\\n',\n ul_start: '\\n',\n ul_end: '',\n li_start: '\\t',\n li_end: '\\n',\n}\n","// @ts-nocheck\n/**\n * @namespace config\n * @memberof module:@citation-js/core.plugins\n */\n\nconst configs = {}\n\n/**\n * @access public\n * @method add\n * @memberof module:@citation-js/core.plugins.config\n * @param {module:@citation-js/core.plugins~pluginRef} ref - plugin reference/name\n * @param {Object} config\n */\nexport function add(ref, config) {\n configs[ref] = config\n}\n\n/**\n * @access public\n * @method get\n * @memberof module:@citation-js/core.plugins.config\n * @param {module:@citation-js/core.plugins~pluginRef} ref - plugin reference/name\n * @return {Object} config\n */\nexport function get(ref) {\n return configs[ref]\n}\n\n/**\n * @access public\n * @method has\n * @memberof module:@citation-js/core.plugins.config\n * @param {module:@citation-js/core.plugins~pluginRef} ref - plugin reference/name\n * @return {Boolean}\n */\nexport function has(ref) {\n return Object.prototype.hasOwnProperty.call(configs, ref)\n}\n\n/**\n * @access public\n * @method remove\n * @memberof module:@citation-js/core.plugins.config\n * @param {module:@citation-js/core.plugins~pluginRef} ref - plugin reference/name\n */\nexport function remove(ref) {\n delete configs[ref]\n}\n\n/**\n * @access public\n * @method list\n * @memberof module:@citation-js/core.plugins.config\n * @return {Array<module:@citation-js/core.plugins~pluginRef>} list of available plugin configs\n */\nexport function list() {\n return Object.keys(configs)\n}\n","// @ts-nocheck\n/**\n * @namespace plugins\n * @memberof module:@citation-js/core\n */\n\nimport * as input from './input/index.js'\nimport * as output from './output.js'\nimport * as dict from './dict.js'\nimport * as config from './config.js'\n\nconst registers = {\n input,\n output,\n dict,\n config,\n}\n\nconst indices = {}\n\n/**\n * @access public\n * @method add\n * @memberof module:@citation-js/core.plugins\n * @param {module:@citation-js/core.plugins~pluginRef} ref - plugin reference/name\n * @param {module:@citation-js/core.plugins~plugins} [plugins={}]\n */\nexport function add(ref, plugins = {}) {\n const mainIndex = (indices[ref] = {})\n\n for (const type in plugins) {\n if (type === 'config') {\n mainIndex.config = { [ref]: plugins.config }\n registers.config.add(ref, plugins.config)\n continue\n }\n\n const typeIndex = (mainIndex[type] = {})\n const typePlugins = plugins[type]\n\n for (const name in typePlugins) {\n const typePlugin = typePlugins[name]\n\n typeIndex[name] = true\n registers[type].add(name, typePlugin)\n }\n }\n}\n\n/**\n * @access public\n * @method remove\n * @memberof module:@citation-js/core.plugins\n * @param {module:@citation-js/core.plugins~pluginRef} ref - plugin reference/name\n */\nexport function remove(ref) {\n const mainIndex = indices[ref]\n\n for (const type in mainIndex) {\n const typeIndex = mainIndex[type]\n\n for (const name in typeIndex) {\n registers[type].remove(name)\n }\n }\n\n delete indices[ref]\n}\n\n/**\n * @access public\n * @method has\n * @memberof module:@citation-js/core.plugins\n * @param {module:@citation-js/core.plugins~pluginRef} ref - plugin reference/name\n * @returns {Boolean} plugin is registered\n */\nexport function has(ref) {\n return ref in indices\n}\n\n/**\n * @access public\n * @method list\n * @memberof module:@citation-js/core.plugins\n * @returns {Array<module:@citation-js/core.plugins~pluginRef>} list of registered plugins\n */\nexport function list() {\n return Object.keys(indices)\n}\n\n/**\n * @typedef {String} module:@citation-js/core.plugins~pluginRef\n */\n\n/**\n * @typedef {Object} module:@citation-js/core.plugins~plugins\n * @property {Object<module:@citation-js/core.plugins.input~format,module:@citation-js/core.plugins.input~parsers>} input\n * @property {Object<module:@citation-js/core.plugins.output~formatterName,module:@citation-js/core.plugins.output~formatter>} output\n * @property {Object<module:@citation-js/core.plugins.dict~dictName,module:@citation-js/core.plugins.dict~dict>} dict\n * @property {Object} config\n */\n\nexport { input, output, dict, config }\n","export function parse() {\n return []\n}\n","// @ts-nocheck\n/**\n * @module input/other\n */\n\nimport logger from '../../logger.js'\n\n/**\n *\n * @access private\n * @constant substituters\n * @default\n */\nconst substituters = [\n [/((?:\\[|:|,)\\s*)'((?:\\\\'|[^'])*?[^\\\\])?'(?=\\s*(?:\\]|}|,))/g, '$1\"$2\"'],\n [\n /((?:(?:\"|]|}|\\/[gmiuys]|\\.|(?:\\d|\\.|-)*\\d)\\s*,|{)\\s*)(?:\"([^\":\\n]+?)\"|'([^\":\\n]+?)'|([^\":\\n]+?))(\\s*):/g,\n '$1\"$2$3$4\"$5:',\n ],\n]\n\n/**\n * Parse (in)valid JSON\n *\n * @access protected\n * @method parseJSON\n *\n * @param {String} str - The input string\n *\n * @return {Object|Array<Object>|Array<String>} The parsed object\n */\nfunction parseJSON(str) {\n if (typeof str !== 'string') {\n return JSON.parse(str)\n }\n\n try {\n return JSON.parse(str)\n } catch (e) {\n logger.debug('[plugin-common]', 'Invalid JSON, switching to experimental parser')\n substituters.forEach(([regex, subst]) => {\n str = str.replace(regex, subst)\n })\n return JSON.parse(str)\n }\n}\n\nexport { parseJSON as parse, parseJSON as default }\n","// @ts-nocheck\n/* global jQuery, HTMLElement */\n\n/**\n * @module input/other\n */\n\nimport * as empty from './empty.js'\nimport * as json from './json.js'\nimport * as jquery from './jquery.js'\nimport * as html from './html.js'\n\nexport const ref = '@else'\nexport const parsers = { empty, json, jquery, html }\nexport const formats = {\n '@empty/text': {\n parse: empty.parse,\n parseType: {\n dataType: 'String',\n predicate: (input) => input === '',\n },\n },\n '@empty/whitespace+text': {\n parse: empty.parse,\n parseType: {\n dataType: 'String',\n predicate: /^\\s+$/,\n },\n },\n '@empty': {\n parse: empty.parse,\n parseType: {\n dataType: 'Primitive',\n predicate: (input) => input == null,\n },\n },\n '@else/json': {\n parse: json.parse,\n parseType: {\n dataType: 'String',\n predicate: /^\\s*(\\{[\\S\\s]*\\}|\\[[\\S\\s]*\\])\\s*$/,\n },\n },\n '@else/url': {\n parseType: {\n dataType: 'String',\n predicate: /^https?:\\/\\/(([\\w-]+\\.)*[\\w-]+)(:\\d+)?(\\/[^?/]*)*(\\?[^#]*)?(#.*)?$/i,\n },\n },\n '@else/jquery': {\n parse: jquery.parse,\n parseType: {\n dataType: 'ComplexObject',\n /* istanbul ignore next: not testable in Node */\n predicate(input) {\n return typeof jQuery !== 'undefined' && input instanceof jQuery\n },\n },\n },\n '@else/html': {\n parse: html.parse,\n parseType: {\n dataType: 'ComplexObject',\n /* istanbul ignore next: not testable in Node */\n predicate(input) {\n return typeof HTMLElement !== 'undefined' && input instanceof HTMLElement\n },\n },\n },\n}\n","export /* istanbul ignore next: not testable in Node */ function parse(input) {\n return input.val() || input.text() || input.html()\n}\n","export function parse(input) {\n return input.value || input.textContent\n}\n","// @ts-nocheck\n/**\n * @module output/json\n */\n\nimport * as plugins from '../../plugins/index.js'\nimport * as util from '../../util/index.js'\nimport logger from '../../logger.js'\n\n/**\n * Append commas to every item but the last. Should unfortunately, probably be a utility.\n *\n * @access private\n *\n * @param {String} item\n * @param {Number} index\n * @param {Array<String>} array\n *\n * @return {String} modified item\n */\nfunction appendCommas(string, index, array) {\n return string + (index < array.length - 1 ? ',' : '')\n}\n\n/**\n * Convert a JSON array or object to HTML.\n *\n * @access private\n *\n * @param {Object|Array} src - The data\n * @param {Cite.get.dict~dict} dict - Dictionary\n *\n * @return {String} string form\n */\nfunction getJsonObject(src, dict) {\n const isArray = Array.isArray(src)\n let entries\n\n if (isArray) {\n entries = src.map((entry) => getJsonValue(entry, dict))\n } else {\n entries = Object.keys(src)\n // remove values that cannot be stringified, as is custom\n .filter((prop) => JSON.stringify(src[prop]))\n .map((prop) => `\"${prop}\": ${getJsonValue(src[prop], dict)}`)\n }\n\n entries = entries.map(appendCommas).map((entry) => dict.listItem.join(entry))\n entries = dict.list.join(entries.join(''))\n\n return isArray ? `[${entries}]` : `{${entries}}`\n}\n\n/**\n * Convert JSON to HTML.\n *\n * @access private\n *\n * @param {*} src - The data\n * @param {Cite.get.dict~dict} dict - Dictionary\n *\n * @return {String} string form\n */\nfunction getJsonValue(src, dict) {\n if (typeof src === 'object' && src !== null) {\n if (src.length === 0) {\n return '[]'\n } else if (Object.keys(src).length === 0) {\n return '{}'\n } else {\n return getJsonObject(src, dict)\n }\n } else {\n return JSON.stringify(src)\n }\n}\n\n/**\n * Get a JSON string from CSL\n *\n * @access protected\n * @method getJson\n *\n * @param {Array<CSL>} src - Input CSL\n * @param {Cite.get.dict~dict} dict - Dictionary\n *\n * @return {String} JSON string\n */\nfunction getJson(src, dict) {\n let entries = src.map((entry) => getJsonObject(entry, dict))\n entries = entries.map(appendCommas).map((entry) => dict.entry.join(entry))\n entries = entries.join('')\n\n return dict.bibliographyContainer.join(`[${entries}]`)\n}\n\n/**\n * Get a JSON HTML string from CSL\n *\n * @access protected\n * @method getJsonWrapper\n * @deprecated use the generalised method: {@link module:output/json~getJson}\n *\n * @param {Array<CSL>} src - Input CSL\n *\n * @return {String} JSON HTML string\n */\nexport /* istanbul ignore next: deprecated */ function getJsonWrapper(src) {\n return getJson(src, plugins.dict.get('html'))\n}\n\nexport default {\n data(data, { type, format = type || 'text', version = '1.0.2' } = {}) {\n if (version < '1.0.2') {\n data = util.downgradeCsl(data)\n }\n\n if (format === 'object') {\n return util.deepCopy(data)\n } else if (format === 'text') {\n return JSON.stringify(data, null, 2)\n } else {\n logger.warn(\n '[core]',\n 'This feature (JSON output with special formatting) is unstable. See https://github.com/larsgw/citation.js/issues/144'\n )\n return getJson(data, plugins.dict.get(format))\n }\n },\n ndjson(data, { version = '1.0.2' } = {}) {\n if (version < '1.0.2') {\n data = util.downgradeCsl(data)\n }\n\n return data.map((entry) => JSON.stringify(entry)).join('\\n')\n },\n}\n","// @ts-nocheck\nimport { parse as parseDate } from '@citation-js/date'\nimport { parse as parseName } from '@citation-js/name'\n\nfunction nameProps(person) {\n const { firstname, lastname, firstName: given = firstname, lastName: family = lastname } = person\n\n if (given && family) {\n return { given, family }\n } else if (person.name) {\n return parseName(person.name)\n }\n}\n\nconst identifiers = [\n 'PMID',\n 'PMCID',\n 'DOI',\n 'ISBN',\n // 'URL' is actually the URL of the record collection, if I understand it correctly,\n // and not of the record. Otherwise, it should be included.\n]\n\nconst journalIdentifiers = ['ISSN']\n\nfunction idProps(input, identifiers) {\n const output = {}\n\n for (const prop in input) {\n const upperCaseProp = prop.toUpperCase()\n\n if (identifiers.includes(upperCaseProp)) {\n output[upperCaseProp] = input[prop]\n }\n }\n\n if (input.identifier) {\n for (let { id, type = '' } of input.identifier) {\n type = type.toUpperCase()\n if (identifiers.includes(type)) {\n output[type] = id\n }\n }\n }\n\n return output\n}\n\n// copied from BibTeX, as BibJSON is based on BibTeX\nconst typeMap = {\n article: 'article',\n book: 'book',\n booklet: 'book',\n proceedings: 'book',\n mastersthesis: 'thesis',\n inbook: 'chapter',\n incollection: 'chapter',\n conference: 'paper-conference',\n inproceedings: 'paper-conference',\n manual: 'report',\n misc: 'document',\n online: 'website',\n patent: 'patent',\n phdthesis: 'thesis',\n techreport: 'report',\n unpublished: 'manuscript',\n}\n\nfunction quickscrapeSpecificProps() {\n return { type: 'article-journal' }\n}\n\nfunction generalProps(input) {\n const output = {\n type: typeMap[input.type] || 'document',\n title: input.title,\n }\n\n if (input.author) {\n output.author = input.author.map(nameProps).filter(Boolean)\n }\n if (input.editor) {\n output.editor = input.editor.map(nameProps).filter(Boolean)\n }\n if (input.reviewer) {\n if (input.author) {\n output['reviewed-author'] = output.author\n }\n output.author = input.reviewer.map(nameProps).filter(Boolean)\n }\n\n /* istanbul ignore next: no examples found */\n if (Array.isArray(input.keywords)) {\n output.keyword = input.keywords.join()\n } else if (input.keywords) {\n output.keyword = input.keywords\n }\n\n if (input.publisher) {\n output.publisher = input.publisher.name || input.publisher\n }\n\n if (input.date && input.date.published) {\n output.issued = parseDate(input.date.published)\n } else if (input.year) {\n output.issued = { 'date-parts': [[+input.year]] }\n }\n if (input.date && input.date.submitted) {\n output.submitted = parseDate(input.date.submitted)\n }\n\n if (input.journal) {\n const journal = input.journal\n if (journal.name) {\n output['container-title'] = journal.name\n }\n if (journal.volume) {\n output.volume = journal.volume\n }\n if (journal.issue) {\n output.issue = journal.issue\n }\n\n Object.assign(output, idProps(journal, journalIdentifiers))\n\n if (journal.firstpage) {\n output['page-first'] = journal.firstpage\n }\n /* istanbul ignore else: no examples found */\n if (journal.pages) {\n output.page = journal.pages.replace('--', '-')\n } else if (journal.firstpage && journal.lastpage) {\n output.page = journal.firstpage + '-' + journal.lastpage\n }\n }\n\n if (input.link && typeof input.link[0] === 'object') {\n output.URL = input.link[0].url\n }\n\n Object.assign(output, idProps(input, identifiers))\n\n if (input.cid) {\n output.id = input.cid\n } else if (output.DOI) {\n output.id = output.DOI\n }\n\n return output\n}\n\n/**\n * Parse ContentMine quickscrape data\n *\n * @access protected\n * @memberof module:@citation-js/plugin-bibjson.parsers.json\n * @param {Object} data - The input data\n * @return {Array<CSL>} The formatted input data\n */\nconst parseContentMine = function (data) {\n return Object.assign(generalProps(data), quickscrapeSpecificProps(data))\n}\n\n/**\n * Parse BibJSON data\n *\n * @access protected\n * @memberof module:@citation-js/plugin-bibjson.parsers.json\n * @param {Object} data - The input data\n * @return {Array<CSL>} The formatted input data\n */\nconst parseBibJson = function (data) {\n return generalProps(data)\n}\n\nexport { parseContentMine as quickscrapeRecord, parseBibJson as record }\n","import * as plugins from '../plugins/index.js'\nimport { ref, formats as input } from './input/index.js'\nimport output from './output/index.js'\nplugins.add(ref, {\n input,\n output,\n})\n","import json from './json.js'\nimport label from './label.js'\n\nexport default Object.assign({}, json, label)\n","/**\n * ## Formats\n *\n * ### BibJSON\n *\n * This plugin adds input support for the [BibJSON format](http://okfnlabs.org/bibjson/), with three variants:\n *\n * * collections, where the records are extracted and parsed\n * * records, which are parsed\n * * records of the [quickscrape](https://github.com/ContentMine/quickscrape) variant, which are parsed\n *\n * @module module:@citation-js/plugin-bibjson\n */\n\nimport * as json from './json.js'\nimport { plugins } from '../core/index.js'\n\nconst scraperLinks = ['fulltext_html', 'fulltext_xml', 'fulltext_pdf']\nconst authorNameFields = ['name', 'lastname', 'lastName', 'firstname', 'firstName']\n\n/**\n * @constant {module:@citation-js/core.plugins~pluginRef} ref\n * @memberof module:@citation-js/plugin-bibjson\n * @default '@bibjson'\n */\nconst ref = '@bibjson'\n\n/**\n * @access protected\n * @namespace parsers\n * @memberof module:@citation-js/plugin-bibjson\n */\nconst parsers = {\n /**\n * @access protected\n * @namespace json\n * @memberof module:@citation-js/plugin-bibjson.parsers\n */\n json,\n}\n\n/**\n * @namespace formats\n * @type module:@citation-js/core.plugins.input~format,module:@citation-js/core.plugins.input~parsers\n * @memberof module:@citation-js/plugin-bibjson\n */\nconst formats = {\n /**\n * Object with quickscrape-style BibJSON.\n *\n * @type module:@citation-js/core.plugins.input~parsers\n * @memberof module:@citation-js/plugin-bibjson.formats\n * @property {module:@citation-js/core.plugins.input~dataParser} parse\n * @property {module:@citation-js/core.plugins.input~typeParser} parseType\n */\n '@bibjson/quickscrape+record+object': {\n parse: json.quickscrapeRecord,\n parseType: {\n propertyConstraint: {\n props: 'link',\n value(links) {\n return scraperLinks.some((link) => links.find(({ type }) => type === link))\n },\n },\n extends: '@bibjson/record+object',\n },\n },\n /**\n * Object with BibJSON.\n *\n * @type module:@citation-js/core.plugins.input~parsers\n * @memberof module:@citation-js/plugin-bibjson.formats\n * @property {module:@citation-js/core.plugins.input~dataParser} parse\n * @property {module:@citation-js/core.plugins.input~typeParser} parseType\n */\n '@bibjson/record+object': {\n parse: json.record,\n parseType: {\n dataType: 'SimpleObject',\n propertyConstraint: [\n {\n props: 'title',\n },\n {\n props: ['author', 'editor'],\n match: 'some',\n value(authors) {\n return (\n Array.isArray(authors) &&\n authors[0] &&\n authorNameFields.some((field) => field in authors[0])\n )\n },\n },\n ],\n },\n },\n /**\n * Array of {@link module:@citation-js/plugin-bibjson.formats.\"@bibjson/record+object\"|BibJSON objects}.\n *\n * @type module:@citation-js/core.plugins.input~parsers\n * @memberof module:@citation-js/plugin-bibjson.formats\n * @property {module:@citation-js/core.plugins.input~dataParser} parse\n * @property {module:@citation-js/core.plugins.input~typeParser} parseType\n */\n '@bibjson/collection+object': {\n parse(collection) {\n return collection.records\n },\n parseType: {\n dataType: 'SimpleObject',\n propertyConstraint: [\n {\n props: 'metadata',\n value(metadata) {\n return 'collection' in metadata\n },\n },\n {\n props: 'records',\n value(records) {\n return Array.isArray(records)\n },\n },\n ],\n },\n },\n}\n\nplugins.add(ref, {\n input: formats,\n})\n\nexport { ref, parsers, formats }\n","(function(root, factory) {\n if (typeof define === 'function' && define.amd) {\n define([], factory) /* global define */\n } else if (typeof module === 'object' && module.exports) {\n module.exports = factory()\n } else {\n root.moo = factory()\n }\n}(this, function() {\n 'use strict';\n\n var hasOwnProperty = Object.prototype.hasOwnProperty\n var toString = Object.prototype.toString\n var hasSticky = typeof new RegExp().sticky === 'boolean'\n\n /***************************************************************************/\n\n function isRegExp(o) { return o && toString.call(o) === '[object RegExp]' }\n function isObject(o) { return o && typeof o === 'object' && !isRegExp(o) && !Array.isArray(o) }\n\n function reEscape(s) {\n return s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&')\n }\n function reGroups(s) {\n var re = new RegExp('|' + s)\n return re.exec('').length - 1\n }\n function reCapture(s) {\n return '(' + s + ')'\n }\n function reUnion(regexps) {\n if (!regexps.length) return '(?!)'\n var source = regexps.map(function(s) {\n return \"(?:\" + s + \")\"\n }).join('|')\n return \"(?:\" + source + \")\"\n }\n\n function regexpOrLiteral(obj) {\n if (typeof obj === 'string') {\n return '(?:' + reEscape(obj) + ')'\n\n } else if (isRegExp(obj)) {\n // TODO: consider /u support\n if (obj.ignoreCase) throw new Error('RegExp /i flag not allowed')\n if (obj.global) throw new Error('RegExp /g flag is implied')\n if (obj.sticky) throw new Error('RegExp /y flag is implied')\n if (obj.multiline) throw new Error('RegExp /m flag is implied')\n return obj.source\n\n } else {\n throw new Error('Not a pattern: ' + obj)\n }\n }\n\n function pad(s, length) {\n if (s.length > length) {\n return s\n }\n return Array(length - s.length + 1).join(\" \") + s\n }\n\n function lastNLines(string, numLines) {\n var position = string.length\n var lineBreaks = 0;\n while (true) {\n var idx = string.lastIndexOf(\"\\n\", position - 1)\n if (idx === -1) {\n break;\n } else {\n lineBreaks++\n }\n position = idx\n if (lineBreaks === numLines) {\n break;\n }\n if (position === 0) {\n break;\n }\n }\n var startPosition = \n lineBreaks < numLines ?\n 0 : \n position + 1\n return string.substring(startPosition).split(\"\\n\")\n }\n\n function objectToRules(object) {\n var keys = Object.getOwnPropertyNames(object)\n var result = []\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i]\n var thing = object[key]\n var rules = [].concat(thing)\n if (key === 'include') {\n for (var j = 0; j < rules.length; j++) {\n result.push({include: rules[j]})\n }\n continue\n }\n var match = []\n rules.forEach(function(rule) {\n if (isObject(rule)) {\n if (match.length) result.push(ruleOptions(key, match))\n result.push(ruleOptions(key, rule))\n match = []\n } else {\n match.push(rule)\n }\n })\n if (match.length) result.push(ruleOptions(key, match))\n }\n return result\n }\n\n function arrayToRules(array) {\n var result = []\n for (var i = 0; i < array.length; i++) {\n var obj = array[i]\n if (obj.include) {\n var include = [].concat(obj.include)\n for (var j = 0; j < include.length; j++) {\n result.push({include: include[j]})\n }\n continue\n }\n if (!obj.type) {\n throw new Error('Rule has no type: ' + JSON.stringify(obj))\n }\n result.push(ruleOptions(obj.type, obj))\n }\n return result\n }\n\n function ruleOptions(type, obj) {\n if (!isObject(obj)) {\n obj = { match: obj }\n }\n if (obj.include) {\n throw new Error('Matching rules cannot also include states')\n }\n\n // nb. error and fallback imply lineBreaks\n var options = {\n defaultType: type,\n lineBreaks: !!obj.error || !!obj.fallback,\n pop: false,\n next: null,\n push: null,\n error: false,\n fallback: false,\n value: null,\n type: null,\n shouldThrow: false,\n }\n\n // Avoid Object.assign(), so we support IE9+\n for (var key in obj) {\n if (hasOwnProperty.call(obj, key)) {\n options[key] = obj[key]\n }\n }\n\n // type transform cannot be a string\n if (typeof options.type === 'string' && type !== options.type) {\n throw new Error(\"Type transform cannot be a string (type '\" + options.type + \"' for token '\" + type + \"')\")\n }\n\n // convert to array\n var match = options.match\n options.match = Array.isArray(match) ? match : match ? [match] : []\n options.match.sort(function(a, b) {\n return isRegExp(a) && isRegExp(b) ? 0\n : isRegExp(b) ? -1 : isRegExp(a) ? +1 : b.length - a.length\n })\n return options\n }\n\n function toRules(spec) {\n return Array.isArray(spec) ? arrayToRules(spec) : objectToRules(spec)\n }\n\n var defaultErrorRule = ruleOptions('error', {lineBreaks: true, shouldThrow: true})\n function compileRules(rules, hasStates) {\n var errorRule = null\n var fast = Object.create(null)\n var fastAllowed = true\n var unicodeFlag = null\n var groups = []\n var parts = []\n\n // If there is a fallback rule, then disable fast matching\n for (var i = 0; i < rules.length; i++) {\n if (rules[i].fallback) {\n fastAllowed = false\n }\n }\n\n for (var i = 0; i < rules.length; i++) {\n var options = rules[i]\n\n if (options.include) {\n // all valid inclusions are removed by states() preprocessor\n throw new Error('Inheritance is not allowed in stateless lexers')\n }\n\n if (options.error || options.fallback) {\n // errorRule can only be set once\n if (errorRule) {\n if (!options.fallback === !errorRule.fallback) {\n throw new Error(\"Multiple \" + (options.fallback ? \"fallback\" : \"error\") + \" rules not allowed (for token '\" + options.defaultType + \"')\")\n } else {\n throw new Error(\"fallback and error are mutually exclusive (for token '\" + options.defaultType + \"')\")\n }\n }\n errorRule = options\n }\n\n var match = options.match.slice()\n if (fastAllowed) {\n while (match.length && typeof match[0] === 'string' && match[0].length === 1) {\n var word = match.shift()\n fast[word.charCodeAt(0)] = options\n }\n }\n\n // Warn about inappropriate state-switching options\n if (options.pop || options.push || options.next) {\n if (!hasStates) {\n throw new Error(\"State-switching options are not allowed in stateless lexers (for token '\" + options.defaultType + \"')\")\n }\n if (options.fallback) {\n throw new Error(\"State-switching options are not allowed on fallback tokens (for token '\" + options.defaultType + \"')\")\n }\n }\n\n // Only rules with a .match are included in the RegExp\n if (match.length === 0) {\n continue\n }\n fastAllowed = false\n\n groups.push(options)\n\n // Check unicode flag is used everywhere or nowhere\n for (var j = 0; j < match.length; j++) {\n var obj = match[j]\n if (!isRegExp(obj)) {\n continue\n }\n\n if (unicodeFlag === null) {\n unicodeFlag = obj.unicode\n } else if (unicodeFlag !== obj.unicode && options.fallback === false) {\n throw new Error('If one rule is /u then all must be')\n }\n }\n\n // convert to RegExp\n var pat = reUnion(match.map(regexpOrLiteral))\n\n // validate\n var regexp = new RegExp(pat)\n if (regexp.test(\"\")) {\n throw new Error(\"RegExp matches empty string: \" + regexp)\n }\n var groupCount = reGroups(pat)\n if (groupCount > 0) {\n throw new Error(\"RegExp has capture groups: \" + regexp + \"\\nUse (?: … ) instead\")\n }\n\n // try and detect rules matching newlines\n if (!options.lineBreaks && regexp.test('\\n')) {\n throw new Error('Rule should declare lineBreaks: ' + regexp)\n }\n\n // store regex\n parts.push(reCapture(pat))\n }\n\n\n // If there's no fallback rule, use the sticky flag so we only look for\n // matches at the current index.\n //\n // If we don't support the sticky flag, then fake it using an irrefutable\n // match (i.e. an empty pattern).\n var fallbackRule = errorRule && errorRule.fallback\n var flags = hasSticky && !fallbackRule ? 'ym' : 'gm'\n var suffix = hasSticky || fallbackRule ? '' : '|'\n\n if (unicodeFlag === true) flags += \"u\"\n var combined = new RegExp(reUnion(parts) + suffix, flags)\n return {regexp: combined, groups: groups, fast: fast, error: errorRule || defaultErrorRule}\n }\n\n function compile(rules) {\n var result = compileRules(toRules(rules))\n return new Lexer({start: result}, 'start')\n }\n\n function checkStateGroup(g, name, map) {\n var state = g && (g.push || g.next)\n if (state && !map[state]) {\n throw new Error(\"Missing state '\" + state + \"' (in token '\" + g.defaultType + \"' of state '\" + name + \"')\")\n }\n if (g && g.pop && +g.pop !== 1) {\n throw new Error(\"pop must be 1 (in token '\" + g.defaultType + \"' of state '\" + name + \"')\")\n }\n }\n function compileStates(states, start) {\n var all = states.$all ? toRules(states.$all) : []\n delete states.$all\n\n var keys = Object.getOwnPropertyNames(states)\n if (!start) start = keys[0]\n\n var ruleMap = Object.create(null)\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i]\n ruleMap[key] = toRules(states[key]).concat(all)\n }\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i]\n var rules = ruleMap[key]\n var included = Object.create(null)\n for (var j = 0; j < rules.length; j++) {\n var rule = rules[j]\n if (!rule.include) continue\n var splice = [j, 1]\n if (rule.include !== key && !included[rule.include]) {\n included[rule.include] = true\n var newRules = ruleMap[rule.include]\n if (!newRules) {\n throw new Error(\"Cannot include nonexistent state '\" + rule.include + \"' (in state '\" + key + \"')\")\n }\n for (var k = 0; k < newRules.length; k++) {\n var newRule = newRules[k]\n if (rules.indexOf(newRule) !== -1) continue\n splice.push(newRule)\n }\n }\n rules.splice.apply(rules, splice)\n j--\n }\n }\n\n var map = Object.create(null)\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i]\n map[key] = compileRules(ruleMap[key], true)\n }\n\n for (var i = 0; i < keys.length; i++) {\n var name = keys[i]\n var state = map[name]\n var groups = state.groups\n for (var j = 0; j < groups.length; j++) {\n checkStateGroup(groups[j], name, map)\n }\n var fastKeys = Object.getOwnPropertyNames(state.fast)\n for (var j = 0; j < fastKeys.length; j++) {\n checkStateGroup(state.fast[fastKeys[j]], name, map)\n }\n }\n\n return new Lexer(map, start)\n }\n\n function keywordTransform(map) {\n\n // Use a JavaScript Map to map keywords to their corresponding token type\n // unless Map is unsupported, then fall back to using an Object:\n var isMap = typeof Map !== 'undefined'\n var reverseMap = isMap ? new Map : Object.create(null)\n\n var types = Object.getOwnPropertyNames(map)\n for (var i = 0; i < types.length; i++) {\n var tokenType = types[i]\n var item = map[tokenType]\n var keywordList = Array.isArray(item) ? item : [item]\n keywordList.forEach(function(keyword) {\n if (typeof keyword !== 'string') {\n throw new Error(\"keyword must be string (in keyword '\" + tokenType + \"')\")\n }\n if (isMap) {\n reverseMap.set(keyword, tokenType)\n } else {\n reverseMap[keyword] = tokenType\n }\n })\n }\n return function(k) {\n return isMap ? reverseMap.get(k) : reverseMap[k]\n }\n }\n\n /***************************************************************************/\n\n var Lexer = function(states, state) {\n this.startState = state\n this.states = states\n this.buffer = ''\n this.stack = []\n this.reset()\n }\n\n Lexer.prototype.reset = function(data, info) {\n this.buffer = data || ''\n this.index = 0\n this.line = info ? info.line : 1\n this.col = info ? info.col : 1\n this.queuedToken = info ? info.queuedToken : null\n this.queuedText = info ? info.queuedText: \"\";\n this.queuedThrow = info ? info.queuedThrow : null\n this.setState(info ? info.state : this.startState)\n this.stack = info && info.stack ? info.stack.slice() : []\n return this\n }\n\n Lexer.prototype.save = function() {\n return {\n line: this.line,\n col: this.col,\n state: this.state,\n stack: this.stack.slice(),\n queuedToken: this.queuedToken,\n queuedText: this.queuedText,\n queuedThrow: this.queuedThrow,\n }\n }\n\n Lexer.prototype.setState = function(state) {\n if (!state || this.state === state) return\n this.state = state\n var info = this.states[state]\n this.groups = info.groups\n this.error = info.error\n this.re = info.regexp\n this.fast = info.fast\n }\n\n Lexer.prototype.popState = function() {\n this.setState(this.stack.pop())\n }\n\n Lexer.prototype.pushState = function(state) {\n this.stack.push(this.state)\n this.setState(state)\n }\n\n var eat = hasSticky ? function(re, buffer) { // assume re is /y\n return re.exec(buffer)\n } : function(re, buffer) { // assume re is /g\n var match = re.exec(buffer)\n // will always match, since we used the |(?:) trick\n if (match[0].length === 0) {\n return null\n }\n return match\n }\n\n Lexer.prototype._getGroup = function(match) {\n var groupCount = this.groups.length\n for (var i = 0; i < groupCount; i++) {\n if (match[i + 1] !== undefined) {\n return this.groups[i]\n }\n }\n throw new Error('Cannot find token type for matched text')\n }\n\n function tokenToString() {\n return this.value\n }\n\n Lexer.prototype.next = function() {\n var index = this.index\n\n // If a fallback token matched, we don't need to re-run the RegExp\n if (this.queuedGroup) {\n var token = this._token(this.queuedGroup, this.queuedText, index)\n this.queuedGroup = null\n this.queuedText = \"\"\n return token\n }\n\n var buffer = this.buffer\n if (index === buffer.length) {\n return // EOF\n }\n\n // Fast matching for single characters\n var group = this.fast[buffer.charCodeAt(index)]\n if (group) {\n return this._token(group, buffer.charAt(index), index)\n }\n\n // Execute RegExp\n var re = this.re\n re.lastIndex = index\n var match = eat(re, buffer)\n\n // Error tokens match the remaining buffer\n var error = this.error\n if (match == null) {\n return this._token(error, buffer.slice(index, buffer.length), index)\n }\n\n var group = this._getGroup(match)\n var text = match[0]\n\n if (error.fallback && match.index !== index) {\n this.queuedGroup = group\n this.queuedText = text\n\n // Fallback tokens contain the unmatched portion of the buffer\n return this._token(error, buffer.slice(index, match.index), index)\n }\n\n return this._token(group, text, index)\n }\n\n Lexer.prototype._token = function(group, text, offset) {\n // count line breaks\n var lineBreaks = 0\n if (group.lineBreaks) {\n var matchNL = /\\n/g\n var nl = 1\n if (text === '\\n') {\n lineBreaks = 1\n } else {\n while (matchNL.exec(text)) { lineBreaks++; nl = matchNL.lastIndex }\n }\n }\n\n var token = {\n type: (typeof group.type === 'function' && group.type(text)) || group.defaultType,\n value: typeof group.value === 'function' ? group.value(text) : text,\n text: text,\n toString: tokenToString,\n offset: offset,\n lineBreaks: lineBreaks,\n line: this.line,\n col: this.col,\n }\n // nb. adding more props to token object will make V8 sad!\n\n var size = text.length\n this.index += size\n this.line += lineBreaks\n if (lineBreaks !== 0) {\n this.col = size - nl + 1\n } else {\n this.col += size\n }\n\n // throw, if no rule with {error: true}\n if (group.shouldThrow) {\n var err = new Error(this.formatError(token, \"invalid syntax\"))\n throw err;\n }\n\n if (group.pop) this.popState()\n else if (group.push) this.pushState(group.push)\n else if (group.next) this.setState(group.next)\n\n return token\n }\n\n if (typeof Symbol !== 'undefined' && Symbol.iterator) {\n var LexerIterator = function(lexer) {\n this.lexer = lexer\n }\n\n LexerIterator.prototype.next = function() {\n var token = this.lexer.next()\n return {value: token, done: !token}\n }\n\n LexerIterator.prototype[Symbol.iterator] = function() {\n return this\n }\n\n Lexer.prototype[Symbol.iterator] = function() {\n return new LexerIterator(this)\n }\n }\n\n Lexer.prototype.formatError = function(token, message) {\n if (token == null) {\n // An undefined token indicates EOF\n var text = this.buffer.slice(this.index)\n var token = {\n text: text,\n offset: this.index,\n lineBreaks: text.indexOf('\\n') === -1 ? 0 : 1,\n line: this.line,\n col: this.col,\n }\n }\n \n var numLinesAround = 2\n var firstDisplayedLine = Math.max(token.line - numLinesAround, 1)\n var lastDisplayedLine = token.line + numLinesAround\n var lastLineDigits = String(lastDisplayedLine).length\n var displayedLines = lastNLines(\n this.buffer, \n (this.line - token.line) + numLinesAround + 1\n )\n .slice(0, 5)\n var errorLines = []\n errorLines.push(message + \" at line \" + token.line + \" col \" + token.col + \":\")\n errorLines.push(\"\")\n for (var i = 0; i < displayedLines.length; i++) {\n var line = displayedLines[i]\n var lineNo = firstDisplayedLine + i\n errorLines.push(pad(String(lineNo), lastLineDigits) + \" \" + line);\n if (lineNo === token.line) {\n errorLines.push(pad(\"\", lastLineDigits + token.col + 1) + \"^\")\n }\n }\n return errorLines.join(\"\\n\")\n }\n\n Lexer.prototype.clone = function() {\n return new Lexer(this.states, this.state)\n }\n\n Lexer.prototype.has = function(tokenType) {\n return true\n }\n\n\n return {\n compile: compile,\n states: compileStates,\n error: Object.freeze({error: true}),\n fallback: Object.freeze({fallback: true}),\n keywords: keywordTransform,\n }\n\n}));\n","const required = {\n biblatex: {\n article: ['author', 'title', 'journaltitle', ['year', 'date']],\n book: ['author', 'title', ['year', 'date']],\n mvbook: ['author', 'title', ['year', 'date']],\n inbook: ['author', 'title', 'booktitle', ['year', 'date']],\n booklet: [['author', 'editor'], 'title', ['year', 'date']],\n collection: ['editor', 'title', ['year', 'date']],\n mvcollection: ['editor', 'title', ['year', 'date']],\n incollection: ['author', 'title', 'booktitle', ['year', 'date']],\n dataset: [['author', 'editor'], 'title', ['year', 'date']],\n online: [['author', 'editor'], 'title', ['year', 'date'], ['doi', 'eprint', 'url']],\n patent: ['author', 'title', 'number', ['year', 'date']],\n periodical: ['editor', 'title', ['year', 'date']],\n proceedings: ['title', ['year', 'date']],\n mvproceedings: ['title', ['year', 'date']],\n inproceedings: ['author', 'title', 'booktitle', ['year', 'date']],\n report: ['author', 'title', 'type', 'institution', ['year', 'date']],\n thesis: ['author', 'title', 'type', 'institution', ['year', 'date']],\n unpublished: ['author', 'title', ['year', 'date']],\n conference: ['author', 'title', 'booktitle', ['year', 'date']],\n electronic: [['author', 'editor'], 'title', ['year', 'date'], ['doi', 'eprint', 'url']],\n mastersthesis: ['author', 'title', 'institution', ['year', 'date']],\n phdthesis: ['author', 'title', 'institution', ['year', 'date']],\n techreport: ['author', 'title', 'institution', ['year', 'date']],\n www: [['author', 'editor'], 'title', ['year', 'date'], ['doi', 'eprint', 'url']],\n },\n bibtex: {\n article: ['author', 'title', 'journal', 'year'],\n book: [['author', 'editor'], 'title', 'publisher', 'year'],\n booklet: ['title'],\n inbook: [['author', 'editor'], 'title', ['chapter', 'pages'], 'publisher', 'year'],\n incollection: ['author', 'title', 'booktitle', 'publisher', 'year'],\n inproceedings: ['author', 'title', 'booktitle', 'year'],\n mastersthesis: ['author', 'title', 'school', 'year'],\n phdthesis: ['author', 'title', 'school', 'year'],\n proceedings: ['title', 'year'],\n techreport: ['author', 'title', 'institution', 'year'],\n unpublished: ['author', 'title', 'note'],\n },\n}\n\nexport default required\n","import _required from './required.js'\nimport _fieldTypes from './fieldTypes.js'\nimport unicode from './unicode.js'\nexport const required = _required\nexport const fieldTypes = _fieldTypes\nexport const diacritics = unicode.diacritics\nexport const commands = unicode.commands\n\n// Adapted from astrocite-bibtex (accessed 2018-02-22)\n// https://github.com/dsifford/astrocite/blob/668a9e4/packages/astrocite-bibtex/src/constants.ts#L112-L148\nexport const defaultStrings = {\n jan: '01',\n feb: '02',\n mar: '03',\n apr: '04',\n may: '05',\n jun: '06',\n jul: '07',\n aug: '08',\n sep: '09',\n oct: '10',\n nov: '11',\n dec: '12',\n acmcs: 'ACM Computing Surveys',\n acta: 'Acta Informatica',\n cacm: 'Communications of the ACM',\n ibmjrd: 'IBM Journal of Research and Development',\n ibmsj: 'IBM Systems Journal',\n ieeese: 'IEEE Transactions on Software Engineering',\n ieeetc: 'IEEE Transactions on Computers',\n ieeetcad: 'IEEE Transactions on Computer-Aided Design of Integrated Circuits',\n ipl: 'Information Processing Letters',\n jacm: 'Journal of the ACM',\n jcss: 'Journal of Computer and System Sciences',\n scp: 'Science of Computer Programming',\n sicomp: 'SIAM Journal on Computing',\n tocs: 'ACM Transactions on Computer Systems',\n tods: 'ACM Transactions on Database Systems',\n tog: 'ACM Transactions on Graphics',\n toms: 'ACM Transactions on Mathematical Software',\n toois: 'ACM Transactions on Office Information Systems',\n toplas: 'ACM Transactions on Programming Languages and Systems',\n tcs: 'Theoretical Computer Science',\n}\nexport const formattingEnvs = {\n it: 'italics',\n itshape: 'italics',\n sl: 'italics',\n slshape: 'italics',\n em: 'italics',\n\n bf: 'bold',\n bfseries: 'bold',\n\n sc: 'smallcaps',\n scshape: 'smallcaps',\n\n // Font selection\n rm: undefined,\n sf: undefined,\n tt: undefined,\n}\n\nexport const formattingCommands = {\n textit: 'italics',\n textsl: 'italics',\n emph: 'italics',\n mkbibitalic: 'italics',\n mkbibemph: 'italics',\n\n textbf: 'bold',\n strong: 'bold',\n mkbibbold: 'bold',\n\n textsc: 'smallcaps',\n\n textsuperscript: 'superscript',\n textsubscript: 'subscript',\n\n enquote: 'quotes',\n mkbibquote: 'quotes',\n\n // Font selection\n textmd: undefined,\n textrm: undefined,\n textsf: undefined,\n texttt: undefined,\n textup: undefined,\n}\n\nexport const formatting = {\n italics: ['<i>', '</i>'],\n bold: ['<b>', '</b>'],\n superscript: ['<sup>', '</sup>'],\n subscript: ['<sub>', '</sub>'],\n smallcaps: ['<span style=\"font-variant:small-caps;\">', '</span>'],\n nocase: ['<span class=\"nocase\">', '</span>'],\n quotes: ['\\u201C', '\\u201D'],\n}\n\n// Partly adapted from retorquere/bibtex-parser (2020-11-16)\n// https://github.com/retorquere/bibtex-parser/blob/7ad73df/index.ts\nexport const argumentCommands = {\n ElsevierGlyph(glyph) {\n return String.fromCharCode(parseInt(glyph, 16))\n },\n href(url, text) {\n return url\n },\n url(url) {\n return url\n },\n}\n\nexport const ligaturePattern = /---?|''|``|~/g\n\nexport const ligatures = {\n '--': '\\u2013',\n '---': '\\u2014',\n '``': '\\u201C',\n \"''\": '\\u201D',\n '~': '\\u00A0',\n}\n\nexport const mathScriptFormatting = {\n '^': 'superscript',\n sp: 'superscript',\n\n _: 'subscript',\n sb: 'subscript',\n\n mathrm: undefined,\n}\n\n/* eslint-disable quote-props */\nexport const mathScripts = {\n '^': {\n 0: '\\u2070',\n 1: '\\u00B9',\n 2: '\\u00B2',\n 3: '\\u00B3',\n 4: '\\u2074',\n 5: '\\u2075',\n 6: '\\u2076',\n 7: '\\u2077',\n 8: '\\u2078',\n 9: '\\u2079',\n '+': '\\u207A',\n '-': '\\u207B',\n '=': '\\u207C',\n '(': '\\u207D',\n ')': '\\u207E',\n i: '\\u2071',\n n: '\\u207F',\n },\n _: {\n 0: '\\u2080',\n 1: '\\u2081',\n 2: '\\u2082',\n 3: '\\u2083',\n 4: '\\u2084',\n 5: '\\u2085',\n 6: '\\u2086',\n 7: '\\u2087',\n 8: '\\u2088',\n 9: '\\u2089',\n '+': '\\u208A',\n '-': '\\u208B',\n '=': '\\u208C',\n '(': '\\u208D',\n ')': '\\u208E',\n a: '\\u2090',\n e: '\\u2091',\n o: '\\u2092',\n x: '\\u2093',\n '\\u0259': '\\u2094',\n h: '\\u2095',\n k: '\\u2096',\n l: '\\u2097',\n m: '\\u2098',\n n: '\\u2099',\n s: '\\u209A',\n p: '\\u209B',\n t: '\\u209C',\n },\n}\n/* eslint-enable quote-props */\n\n// Adapted from retorquere/bibtex-parser (2020-10-15)\n// https://github.com/retorquere/bibtex-parser/blob/0c8bd92/index.ts#L416-L441\nexport const sentenceCaseLanguages = [\n 'american',\n 'british',\n 'canadian',\n 'english',\n 'australian',\n 'newzealand',\n 'usenglish',\n 'ukenglish',\n 'en',\n 'eng',\n 'en-au',\n 'en-bz',\n 'en-ca',\n 'en-cb',\n 'en-gb',\n 'en-ie',\n 'en-jm',\n 'en-nz',\n 'en-ph',\n 'en-tt',\n 'en-us',\n 'en-za',\n 'en-zw',\n 'anglais',\n]\n","const fieldTypes = {\n abstract: ['field', 'literal'],\n addendum: ['field', 'literal'],\n afterword: ['list', 'name'],\n annotation: ['field', 'literal'],\n annotator: ['list', 'name'],\n author: ['list', 'name'],\n authortype: ['field', 'key'],\n bookauthor: ['list', 'name'],\n bookpagination: ['field', 'key'],\n booksubtitle: ['field', 'literal'],\n booktitle: ['field', 'title'],\n booktitleaddon: ['field', 'literal'],\n chapter: ['field', 'literal'],\n commentator: ['list', 'name'],\n date: ['field', 'date'],\n doi: ['field', 'verbatim'],\n edition: ['field', 'literal'],\n editor: ['list', 'name'],\n editora: ['list', 'name'],\n editorb: ['list', 'name'],\n editorc: ['list', 'name'],\n editortype: ['field', 'key'],\n editoratype: ['field', 'key'],\n editorbtype: ['field', 'key'],\n editorctype: ['field', 'key'],\n eid: ['field', 'literal'],\n entrysubtype: ['field', 'literal'],\n eprint: ['field', 'verbatim'],\n eprintclass: ['field', 'literal'],\n eprinttype: ['field', 'literal'],\n eventdate: ['field', 'date'],\n eventtitle: ['field', 'title'],\n eventtitleaddon: ['field', 'literal'],\n file: ['field', 'verbatim'],\n foreword: ['list', 'name'],\n holder: ['list', 'name'],\n howpublished: ['field', 'literal'],\n indextitle: ['field', 'literal'],\n institution: ['list', 'literal'],\n introduction: ['list', 'name'],\n isan: ['field', 'literal'],\n isbn: ['field', 'literal'],\n ismn: ['field', 'literal'],\n isrn: ['field', 'literal'],\n issn: ['field', 'literal'],\n issue: ['field', 'literal'],\n issuesubtitle: ['field', 'literal'],\n issuetitle: ['field', 'literal'],\n iswc: ['field', 'literal'],\n journalsubtitle: ['field', 'literal'],\n journaltitle: ['field', 'literal'],\n label: ['field', 'literal'],\n language: ['list', 'key'],\n library: ['field', 'literal'],\n location: ['list', 'literal'],\n mainsubtitle: ['field', 'literal'],\n maintitle: ['field', 'title'],\n maintitleaddon: ['field', 'literal'],\n month: ['field', 'literal'],\n nameaddon: ['field', 'literal'],\n note: ['field', 'literal'],\n number: ['field', 'literal'],\n organization: ['list', 'literal'],\n origdate: ['field', 'date'],\n origlanguage: ['list', 'key'],\n origlocation: ['list', 'literal'],\n origpublisher: ['list', 'literal'],\n origtitle: ['field', 'title'],\n pages: ['field', 'range'],\n pagetotal: ['field', 'literal'],\n pagination: ['field', 'key'],\n part: ['field', 'literal'],\n publisher: ['list', 'literal'],\n pubstate: ['field', 'key'],\n reprinttitle: ['field', 'literal'],\n series: ['field', 'title'],\n shortauthor: ['list', 'name'],\n shorteditor: ['list', 'name'],\n shorthand: ['field', 'literal'],\n shorthandintro: ['field', 'literal'],\n shortjournal: ['field', 'literal'],\n shortseries: ['field', 'literal'],\n shorttitle: ['field', 'title'],\n subtitle: ['field', 'literal'],\n title: ['field', 'title'],\n titleaddon: ['field', 'literal'],\n translator: ['list', 'name'],\n type: ['field', 'title'],\n url: ['field', 'uri'],\n urldate: ['field', 'date'],\n venue: ['field', 'literal'],\n version: ['field', 'literal'],\n volume: ['field', 'integer'],\n volumes: ['field', 'integer'],\n year: ['field', 'literal'],\n crossref: ['field', 'entry key'],\n entryset: ['separated', 'literal'],\n execute: ['field', 'code'],\n gender: ['field', 'gender'],\n langid: ['field', 'identifier'],\n langidopts: ['field', 'literal'],\n ids: ['separated', 'entry key'],\n indexsorttitle: ['field', 'literal'],\n keywords: ['separated', 'literal'],\n options: ['separated', 'options'],\n presort: ['field', 'string'],\n related: ['separated', 'literal'],\n relatedoptions: ['separated', 'literal'],\n relatedtype: ['field', 'identifier'],\n relatedstring: ['field', 'literal'],\n sortkey: ['field', 'literal'],\n sortname: ['list', 'name'],\n sortshorthand: ['field', 'literal'],\n sorttitle: ['field', 'literal'],\n sortyear: ['field', 'integer'],\n xdata: ['separated', 'entry key'],\n xref: ['field', 'entry key'],\n namea: ['list', 'name'],\n nameb: ['list', 'name'],\n namec: ['list', 'name'],\n nameatype: ['field', 'key'],\n namebtype: ['field', 'key'],\n namectype: ['field', 'key'],\n lista: ['list', 'literal'],\n listb: ['list', 'literal'],\n listc: ['list', 'literal'],\n listd: ['list', 'literal'],\n liste: ['list', 'literal'],\n listf: ['list', 'literal'],\n usera: ['field', 'literal'],\n userb: ['field', 'literal'],\n userc: ['field', 'literal'],\n userd: ['field', 'literal'],\n usere: ['field', 'literal'],\n userf: ['field', 'literal'],\n verba: ['field', 'literal'],\n verbb: ['field', 'literal'],\n verbc: ['field', 'literal'],\n address: ['list', 'literal'],\n annote: ['field', 'literal'],\n archiveprefix: ['field', 'literal'],\n journal: ['field', 'literal'],\n key: ['field', 'literal'],\n pdf: ['field', 'verbatim'],\n primaryclass: ['field', 'literal'],\n school: ['list', 'literal'],\n numpages: ['field', 'integer'],\n pmid: ['field', 'literal'],\n pmcid: ['field', 'literal'],\n}\n\nexport default fieldTypes\n","const unicode = {\n diacritics: {\n '`': '̀',\n \"'\": '́',\n '^': '̂',\n '~': '̃',\n '=': '̄',\n u: '̆',\n '.': '̇',\n '\"': '̈',\n r: '̊',\n H: '̋',\n v: '̌',\n b: '̲',\n d: '̣',\n c: '̧',\n k: '̨',\n t: '͡',\n textcommabelow: '̦',\n },\n commands: {\n textquotesingle: \"'\",\n textasciigrave: '`',\n textquotedbl: '\"',\n textdollar: '$',\n textless: '<',\n textgreater: '>',\n textbackslash: '\\\\',\n textasciicircum: '^',\n textunderscore: '_',\n textbraceleft: '{',\n textbar: '|',\n textbraceright: '}',\n textasciitilde: '~',\n textexclamdown: '¡',\n textcent: '¢',\n textsterling: '£',\n textcurrency: '¤',\n textyen: '¥',\n textbrokenbar: '¦',\n textsection: '§',\n textasciidieresis: '¨',\n textcopyright: '©',\n textordfeminine: 'ª',\n guillemetleft: '«',\n guillemotleft: '«',\n textlnot: '¬',\n textregistered: '®',\n textasciimacron: '¯',\n textdegree: '°',\n textpm: '±',\n texttwosuperior: '²',\n textthreesuperior: '³',\n textasciiacute: '´',\n textmu: 'µ',\n textparagraph: '¶',\n textperiodcentered: '·',\n textonesuperior: '¹',\n textordmasculine: 'º',\n guillemetright: '»',\n guillemotright: '»',\n textonequarter: '¼',\n textonehalf: '½',\n textthreequarters: '¾',\n textquestiondown: '¿',\n AE: 'Æ',\n DH: 'Ð',\n texttimes: '×',\n O: 'Ø',\n TH: 'Þ',\n ss: 'ß',\n ae: 'æ',\n dh: 'ð',\n textdiv: '÷',\n o: 'ø',\n th: 'þ',\n DJ: 'Đ',\n dj: 'đ',\n i: 'ı',\n IJ: 'IJ',\n ij: 'ij',\n L: 'Ł',\n l: 'ł',\n NG: 'Ŋ',\n ng: 'ŋ',\n OE: 'Œ',\n oe: 'œ',\n textflorin: 'ƒ',\n j: 'ȷ',\n textasciicaron: 'ˇ',\n textasciibreve: '˘',\n textacutedbl: '˝',\n textgravedbl: '˵',\n texttildelow: '˷',\n textbaht: '฿',\n SS: 'ẞ',\n textcompwordmark: '',\n textendash: '',\n textemdash: '—',\n textbardbl: '‖',\n textquoteleft: '',\n textquoteright: '',\n quotesinglbase: '',\n textquotedblleft: '“',\n textquotedblright: '”',\n quotedblbase: '„',\n textdagger: '†',\n textdaggerdbl: '‡',\n textbullet: '•',\n textellipsis: '…',\n textperthousand: '‰',\n textpertenthousand: '‱',\n guilsinglleft: '',\n guilsinglright: '',\n textreferencemark: '※',\n textinterrobang: '‽',\n textfractionsolidus: '',\n textlquill: '⁅',\n textrquill: '⁆',\n textdiscount: '⁒',\n textcolonmonetary: '₡',\n textlira: '₤',\n textnaira: '₦',\n textwon: '₩',\n textdong: '₫',\n texteuro: '€',\n textpeso: '₱',\n textcelsius: '℃',\n textnumero: '№',\n textcircledP: '℗',\n textrecipe: '℞',\n textservicemark: '℠',\n texttrademark: '™',\n textohm: 'Ω',\n textmho: '℧',\n textestimated: '',\n textleftarrow: '←',\n textuparrow: '↑',\n textrightarrow: '→',\n textdownarrow: '↓',\n textminus: '',\n Hwithstroke: 'Ħ',\n hwithstroke: 'ħ',\n textasteriskcentered: '',\n textsurd: '√',\n textlangle: '〈',\n textrangle: '〉',\n textblank: '␢',\n textvisiblespace: '␣',\n textopenbullet: '◦',\n textbigcircle: '◯',\n textmusicalnote: '♪',\n textmarried: '⚭',\n textdivorced: '⚮',\n textinterrobangdown: '⸘',\n textcommabelow: null,\n copyright: '©',\n Gamma: 'Γ',\n Delta: 'Δ',\n Theta: 'Θ',\n Lambda: 'Λ',\n Xi: 'Ξ',\n Pi: 'Π',\n Sigma: 'Σ',\n Phi: 'Φ',\n Psi: 'Ψ',\n Omega: 'Ω',\n alpha: 'α',\n beta: 'β',\n gamma: 'γ',\n delta: 'δ',\n varepsilon: 'ε',\n zeta: 'ζ',\n eta: 'η',\n theta: 'θ',\n iota: 'ι',\n kappa: 'κ',\n lambda: 'λ',\n mu: 'μ',\n nu: 'ν',\n xi: 'ξ',\n pi: 'π',\n rho: 'ρ',\n varsigma: 'ς',\n sigma: 'σ',\n tau: 'τ',\n upsilon: 'υ',\n varphi: 'φ',\n chi: 'χ',\n psi: 'ψ',\n omega: 'ω',\n vartheta: 'ϑ',\n Upsilon: 'ϒ',\n phi: 'ϕ',\n varpi: 'ϖ',\n varrho: 'ϱ',\n epsilon: 'ϵ',\n },\n}\n\nexport default unicode\n","import { util, logger } from '../../core/index.js'\n\nimport moo from 'moo'\nimport { defaultStrings } from './constants.js'\n\nconst identifier = /[a-zA-Z_][a-zA-Z0-9_:-]*/\nconst whitespace = {\n comment: /%.*/,\n whitespace: { match: /\\s+/, lineBreaks: true },\n}\n\nconst lexer = moo.states({\n main: {\n junk: { match: /@[cC][oO][mM][mM][eE][nN][tT].+|[^@]+/, lineBreaks: true },\n at: { match: '@', push: 'entry' },\n },\n entry: {\n ...whitespace,\n otherEntryType: {\n match: /[sS][tT][rR][iI][nN][gG]|[pP][rR][eE][aA][mM][bB][lL][eE]/,\n next: 'otherEntryContents',\n },\n dataEntryType: {\n match: identifier,\n next: 'dataEntryContents',\n },\n },\n otherEntryContents: {\n ...whitespace,\n lbrace: { match: /[{(]/, next: 'fields' },\n },\n dataEntryContents: {\n ...whitespace,\n lbrace: { match: /[{(]/, next: 'dataEntryContents' },\n label: /[^,\\s]+/,\n comma: { match: ',', next: 'fields' },\n },\n fields: {\n ...whitespace,\n identifier,\n number: /-?\\d+/,\n hash: '#',\n equals: '=',\n comma: ',',\n quote: { match: '\"', push: 'quotedLiteral' },\n lbrace: { match: '{', push: 'bracedLiteral' },\n rbrace: { match: /[})]/, pop: true },\n },\n quotedLiteral: {\n lbrace: { match: '{', push: 'bracedLiteral' },\n quote: { match: '\"', pop: true },\n text: { match: /(?:\\\\[\\\\{]|[^{\"])+/, lineBreaks: true },\n },\n bracedLiteral: {\n lbrace: { match: '{', push: 'bracedLiteral' },\n rbrace: { match: '}', pop: true },\n text: { match: /(?:\\\\[\\\\{}]|[^{}])+/, lineBreaks: true },\n },\n})\n\nconst delimiters = {\n '(': ')',\n '{': '}',\n}\n\nexport const bibtexGrammar = new util.Grammar(\n {\n Main() {\n const entries = []\n\n while (true) {\n while (this.matchToken('junk')) {\n this.consumeToken('junk')\n }\n\n if (this.matchEndOfFile()) {\n break\n }\n\n entries.push(this.consumeRule('Entry'))\n }\n\n return entries.filter(Boolean)\n },\n\n _() {\n let oldToken\n while (oldToken !== this.token) {\n oldToken = this.token\n this.consumeToken('whitespace', true)\n this.consumeToken('comment', true)\n }\n },\n\n Entry() {\n this.consumeToken('at')\n this.consumeRule('_')\n\n const type = (\n this.matchToken('otherEntryType')\n ? this.consumeToken('otherEntryType')\n : this.consumeToken('dataEntryType')\n ).value.toLowerCase()\n\n this.consumeRule('_')\n const openBrace = this.consumeToken('lbrace').value\n this.consumeRule('_')\n\n let result\n\n if (type === 'string') {\n const [key, value] = this.consumeRule('Field')\n this.state.strings[key] = value\n } else if (type === 'preamble') {\n this.consumeRule('Expression')\n } else {\n const label = this.consumeToken('label').value\n\n this.consumeRule('_')\n this.consumeToken('comma')\n this.consumeRule('_')\n\n const properties = this.consumeRule('EntryBody')\n\n result = { type, label, properties }\n }\n\n this.consumeRule('_')\n const closeBrace = this.consumeToken('rbrace').value\n if (closeBrace !== delimiters[openBrace]) {\n logger.warn(\n '[plugin-bibtex]',\n `entry started with \"${openBrace}\", but ends with \"${closeBrace}\"`\n )\n }\n\n return result\n },\n\n EntryBody() {\n const properties = {}\n\n while (this.matchToken('identifier')) {\n const [field, value] = this.consumeRule('Field')\n properties[field] = value\n\n this.consumeRule('_')\n if (this.consumeToken('comma', true)) {\n this.consumeRule('_')\n } else {\n break\n }\n }\n\n return properties\n },\n\n Field() {\n const field = this.consumeToken('identifier').value.toLowerCase()\n\n this.consumeRule('_')\n this.consumeToken('equals')\n this.consumeRule('_')\n\n const value = this.consumeRule('Expression')\n\n return [field, value]\n },\n\n Expression() {\n let output = this.consumeRule('ExpressionPart')\n this.consumeRule('_')\n\n while (this.matchToken('hash')) {\n this.consumeToken('hash')\n this.consumeRule('_')\n output += this.consumeRule('ExpressionPart').toString()\n this.consumeRule('_')\n }\n\n return output\n },\n\n ExpressionPart() {\n if (this.matchToken('identifier')) {\n return this.state.strings[this.consumeToken('identifier').value.toLowerCase()] || ''\n } else if (this.matchToken('number')) {\n return parseInt(this.consumeToken('number'))\n } else if (this.matchToken('quote')) {\n return this.consumeRule('QuoteString')\n } else {\n return this.consumeRule('BracketString')\n }\n },\n\n QuoteString() {\n let output = ''\n this.consumeToken('quote')\n while (!this.matchToken('quote')) {\n output += this.consumeRule('Text')\n }\n this.consumeToken('quote')\n return output\n },\n\n BracketString() {\n let output = ''\n this.consumeToken('lbrace')\n while (!this.matchToken('rbrace')) {\n output += this.consumeRule('Text')\n }\n this.consumeToken('rbrace')\n return output\n },\n\n Text() {\n if (this.matchToken('lbrace')) {\n return `{${this.consumeRule('BracketString')}}`\n } else {\n return this.consumeToken('text').value\n }\n },\n },\n {\n strings: defaultStrings,\n }\n)\n\nexport function parse(text) {\n return bibtexGrammar.parse(lexer.reset(text))\n}\n","/**\n * @access private\n * @constant bibTxtRegex\n * @default\n */\nconst bibTxtRegex = {\n splitEntries: /\\n\\s*(?=\\[)/g,\n parseEntry: /^\\[(.+?)\\]\\s*(?:\\n([\\s\\S]+))?$/,\n splitPairs: /((?=.)\\s)*\\n\\s*/g,\n splitPair: /:(.*)/,\n}\n\n/**\n * Parse single Bib.TXT entry\n *\n * @access private\n * @method parseBibTxtEntry\n *\n * @param {String} entry - The input data\n *\n * @return {Object} Array of BibTeX-JSON\n */\nconst parseBibTxtEntry = (entry) => {\n const [, label, pairs] = entry.match(bibTxtRegex.parseEntry) || []\n\n if (!label || !pairs) {\n return {}\n } else {\n const out = {\n type: 'book',\n label,\n properties: {},\n }\n\n pairs\n .trim()\n .split(bibTxtRegex.splitPairs)\n .filter((v) => v)\n .forEach((pair) => {\n let [key, value] = pair.split(bibTxtRegex.splitPair)\n\n /* istanbul ignore else */\n if (value) {\n key = key.trim()\n value = value.trim()\n\n if (key === 'type') {\n out.type = value\n } else {\n out.properties[key] = value\n }\n }\n })\n\n return out\n }\n}\n\n/**\n * Parse Bib.TXT data\n *\n * @access private\n * @method parseBibTxt\n *\n * @param {String} src - The input data\n *\n * @return {Array<Object>} Array of BibTeX-JSON\n */\nconst parseBibTxt = (src) => src.trim().split(bibTxtRegex.splitEntries).map(parseBibTxtEntry)\n\nexport { parseBibTxt as parse, parseBibTxt as text, parseBibTxtEntry as textEntry }\n","const biblatexTypes = {\n source: {\n article: 'article-journal',\n book: 'book',\n mvbook: 'book',\n inbook: 'chapter',\n bookinbook: 'book',\n booklet: 'book',\n collection: 'book',\n mvcollection: 'book',\n incollection: 'chapter',\n dataset: 'dataset',\n online: 'webpage',\n patent: 'patent',\n periodical: 'article-journal',\n proceedings: 'book',\n mvproceedings: 'book',\n inproceedings: 'paper-conference',\n reference: 'book',\n mvreference: 'book',\n inreference: 'entry',\n report: 'report',\n software: 'book',\n thesis: 'thesis',\n unpublished: 'manuscript',\n artwork: 'graphic',\n audio: 'song',\n image: 'figure',\n jurisdiction: 'legal_case',\n legislation: 'legislation',\n legal: 'treaty',\n letter: 'personal_communication',\n movie: 'motion_picture',\n music: 'musical_score',\n review: 'review',\n video: 'motion_picture',\n conference: 'paper-conference',\n electronic: 'webpage',\n mastersthesis: 'thesis',\n phdthesis: 'thesis',\n techreport: 'report',\n www: 'webpage',\n },\n target: {\n article: 'article',\n 'article-journal': 'article',\n 'article-magazine': 'article',\n 'article-newspaper': 'article',\n bill: 'legislation',\n book: 'book',\n broadcast: 'audio',\n chapter: 'inbook',\n dataset: 'dataset',\n entry: 'inreference',\n 'entry-dictionary': 'inreference',\n 'entry-encyclopedia': 'inreference',\n figure: 'artwork',\n graphic: 'artwork',\n interview: 'audio',\n legal_case: 'jurisdiction',\n legislation: 'legislation',\n manuscript: 'unpublished',\n motion_picture: 'movie',\n musical_score: 'music',\n 'paper-conference': 'inproceedings',\n patent: 'patent',\n personal_communication: 'letter',\n post: 'online',\n 'post-weblog': 'online',\n report: 'report',\n review: 'review',\n 'review-book': 'review',\n song: 'music',\n speech: 'audio',\n thesis: 'thesis',\n treaty: 'legal',\n webpage: 'online',\n },\n}\n\nexport default biblatexTypes\n","const bibtexTypes = {\n source: {\n article: 'article-journal',\n book: 'book',\n booklet: 'book',\n conference: 'paper-conference',\n inbook: 'chapter',\n incollection: 'chapter',\n inproceedings: 'paper-conference',\n mastersthesis: 'thesis',\n phdthesis: 'thesis',\n proceedings: 'book',\n techreport: 'report',\n unpublished: 'manuscript',\n },\n target: {\n article: 'article',\n 'article-journal': 'article',\n 'article-magazine': 'article',\n 'article-newspaper': 'article',\n book: 'book',\n chapter: 'inbook',\n manuscript: 'unpublished',\n 'paper-conference': 'inproceedings',\n report: 'techreport',\n review: 'article',\n 'review-book': 'article',\n },\n}\n\nexport default bibtexTypes\n","import biblatex from './mapping/biblatexTypes.js'\nimport bibtex from './mapping/bibtexTypes.js'\nimport * as constants from './input/constants.js'\nexport default {\n constants,\n types: {\n biblatex,\n bibtex,\n },\n parse: {\n biblatex: true,\n strict: false,\n sentenceCase: 'never',\n },\n format: {\n useIdAsLabel: false,\n },\n}\n","//@ts-nocheck\nimport { util } from '../../core/index.js'\nimport config from '../config.js'\nconst stopWords = new Set(['the', 'a', 'an'])\nconst unsafeChars = /(?:<\\/?.*?>|[\\u0020-\\u002F\\u003A-\\u0040\\u005B-\\u005E\\u0060\\u007B-\\u007F])+/g\nconst unicode = /[^\\u0020-\\u007F]+/g\n\nfunction firstWord(text) {\n if (!text) {\n return ''\n } else {\n return text\n .normalize('NFKD')\n .replace(unicode, '')\n .split(unsafeChars)\n .find((word) => word.length && !stopWords.has(word.toLowerCase()))\n }\n}\n\nconst name = new util.Translator([\n {\n source: 'given',\n target: 'given',\n },\n {\n source: 'family',\n target: 'family',\n },\n {\n source: 'suffix',\n target: 'suffix',\n },\n {\n source: 'prefix',\n target: 'non-dropping-particle',\n },\n {\n source: 'family',\n target: 'literal',\n when: {\n source: false,\n target: {\n family: false,\n given: false,\n },\n },\n },\n])\nconst months = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec']\nexport const TYPE = 'BibTeX type'\nexport const LABEL = 'BibTeX label'\nexport const MONTHS = {\n jan: 1,\n feb: 2,\n mar: 3,\n apr: 4,\n may: 5,\n jun: 6,\n jul: 7,\n aug: 8,\n sep: 9,\n oct: 10,\n nov: 11,\n dec: 12,\n january: 1,\n february: 2,\n march: 3,\n april: 4,\n may: 5,\n june: 6,\n july: 7,\n august: 8,\n september: 9,\n october: 10,\n november: 11,\n december: 12,\n}\nexport const TYPE_KEYS = {\n bathesis: \"Bachelor's thesis\",\n mathesis: \"Master's thesis\",\n phdthesis: 'PhD thesis',\n candthesis: 'Candidate thesis',\n techreport: 'technical report',\n resreport: 'research report',\n software: 'computer software',\n datacd: 'data cd',\n audiocd: 'audio cd',\n patent: 'patent',\n patentde: 'German patent',\n patenteu: 'European patent',\n patentfr: 'French patent',\n patentuk: 'British patent',\n patentus: 'U.S. patent',\n patreq: 'patent request',\n patreqde: 'German patent request',\n patreqeu: 'European patent request',\n patreqfr: 'French patent request',\n patrequk: 'British patent request',\n patrequs: 'U.S. patent request',\n}\nexport const STANDARD_NUMBERS_PATTERN =\n /(^(?:ISAN )?(?:[0-9a-f]{4}-){4}[0-9a-z](?:-(?:[0-9a-f]{4}-){2}[0-9a-z])?$)|(^(?:979-?0-?|M-?)(?:\\d{9}|(?=[\\d-]{11}$)\\d+-\\d+-\\d)$)|(^ISRN .{1,36}$)|(^(?:ISWC )?T-?\\d{9}-?\\d$)/i\nexport function parseDate(date) {\n const parts = date\n .split('T')[0]\n .replace(/[?~%]$/, '')\n .split('-')\n const year = +parts[0].replace(/^Y(?=-?\\d{4}\\d+)/, '').replace(/X/g, '0')\n const month = +parts[1]\n const day = +parts[2]\n\n if (!month || month > 20) {\n return [year]\n } else if (!day) {\n return [year, month]\n } else {\n return [year, month, day]\n }\n}\nexport function parseMonth(value) {\n if (value == null) {\n return []\n }\n\n if (+value) {\n return [parseInt(value, 10)]\n }\n\n value = value.trim().toLowerCase()\n\n if (value in MONTHS) {\n return [MONTHS[value]]\n }\n\n const parts = value.split(/\\s+/)\n let month\n let day\n\n if (parts[0] in MONTHS) {\n month = MONTHS[parts[0]]\n day = parseInt(parts[1])\n } else if (parts[1] in MONTHS) {\n month = MONTHS[parts[1]]\n day = parseInt(parts[0])\n }\n\n return day ? [month, day] : month ? [month] : []\n}\nexport function formatLabel(author, issued, suffix, title) {\n let label = ''\n\n if (author && author[0]) {\n label += firstWord(author[0].family || author[0].literal)\n }\n\n if (issued && issued['date-parts'] && issued['date-parts'][0]) {\n label += issued['date-parts'][0][0]\n }\n\n if (suffix) {\n label += suffix\n } else if (title) {\n label += firstWord(title)\n }\n\n return label\n}\nexport const Converters = {\n PICK: {\n toTarget(...args) {\n return args.find(Boolean)\n },\n\n toSource(value) {\n return [value]\n },\n },\n DATE: {\n toTarget(date) {\n const parts = date\n .split('/')\n .map((part) => (part && part !== '..' ? parseDate(part) : undefined))\n return isNaN(parts[0][0])\n ? {\n literal: date,\n }\n : {\n 'date-parts': parts,\n }\n },\n\n toSource(date) {\n if ('date-parts' in date) {\n return date['date-parts']\n .map((datePart) =>\n datePart.map((datePart) => datePart.toString().padStart(2, '0')).join('-')\n )\n .join('/')\n }\n },\n },\n YEAR_MONTH: {\n toTarget(year, month, day) {\n if (isNaN(+year)) {\n return {\n literal: year,\n }\n } else if (!isNaN(+day) && !isNaN(+month)) {\n return {\n 'date-parts': [[+year, +month, +day]],\n }\n } else {\n return {\n 'date-parts': [[+year, ...parseMonth(month)]],\n }\n }\n },\n\n toSource(date) {\n if ('date-parts' in date) {\n const [year, month, day] = date['date-parts'][0]\n return [year.toString(), month ? (day ? `${months[month - 1]} ${day}` : month) : undefined]\n }\n },\n },\n EPRINT: {\n toTarget(id, type) {\n if (type === 'pubmed') {\n return id\n }\n },\n\n toSource(id) {\n return [id, 'pubmed']\n },\n },\n HOW_PUBLISHED: {\n toTarget(howPublished) {\n if (howPublished.startsWith('http')) {\n return howPublished\n }\n },\n },\n KEYWORDS: {\n toTarget(list) {\n return list.join(',')\n },\n\n toSource(list) {\n return list.split(',')\n },\n },\n LABEL: {\n toTarget(label) {\n return [label, label]\n },\n\n toSource(id, label, author, issued, suffix, title) {\n let safeId\n\n if (id === null) {\n safeId = 'null'\n } else if (id === undefined) {\n safeId = 'undefined'\n } else {\n safeId = id.toString().replace(unsafeChars, '')\n }\n\n if (config.format.useIdAsLabel) {\n return safeId\n }\n\n if (label && !unsafeChars.test(label)) {\n return label\n } else {\n return formatLabel(author, issued, suffix, title) || safeId\n }\n },\n },\n NAMES: {\n toTarget(list) {\n return list.map(name.convertToTarget)\n },\n\n toSource(list) {\n return list.map(name.convertToSource)\n },\n },\n STANDARD_NUMBERS: {\n toTarget(...args) {\n return args.find(Boolean)\n },\n\n toSource(number) {\n const match = number.toString().match(STANDARD_NUMBERS_PATTERN)\n return match ? match.slice(1, 5) : []\n },\n },\n STATUS: {\n toSource(state) {\n if (/^(inpreparation|submitted|forthcoming|inpress|prepublished)$/i.test(state)) {\n return state\n }\n },\n },\n TITLE: {\n toTarget(title, subtitle, addon) {\n if (subtitle) {\n title += ': ' + subtitle\n }\n\n return title\n },\n\n toSource(title) {\n return [title]\n },\n },\n}\n","import { util } from '../../core/index.js'\nimport { format as formatDate } from '@citation-js/date'\nimport types from './biblatexTypes.js'\nimport { TYPE, LABEL, TYPE_KEYS, Converters } from './shared.js'\nconst nonSpec = [\n {\n source: 'note',\n target: 'accessed',\n when: {\n source: false,\n target: { note: false, addendum: false },\n },\n convert: {\n toSource(accessed) {\n return `[Online; accessed ${formatDate(accessed)}]`\n },\n },\n },\n {\n source: 'numpages',\n target: 'number-of-pages',\n when: {\n source: { pagetotal: false },\n target: false,\n },\n },\n {\n source: 'pmid',\n target: 'PMID',\n when: {\n source: {\n eprinttype(type) {\n return type !== 'pmid'\n },\n archiveprefix(type) {\n return type !== 'pmid'\n },\n },\n target: false,\n },\n },\n {\n source: 'pmcid',\n target: 'PMCID',\n when: {\n target: false,\n },\n },\n {\n source: 's2id',\n target: 'custom',\n convert: {\n toTarget(S2ID) {\n return { S2ID }\n },\n toSource({ S2ID }) {\n return S2ID\n },\n },\n },\n]\n\nconst aliases = [\n {\n source: 'annote',\n target: 'annote',\n when: {\n source: { annotation: false },\n target: false,\n },\n },\n {\n source: 'address',\n target: 'publisher-place',\n convert: Converters.PICK,\n when: {\n source: { location: false },\n target: false,\n },\n },\n {\n source: ['eprint', 'archiveprefix'],\n target: 'PMID',\n convert: Converters.EPRINT,\n when: {\n source: { eprinttype: false },\n target: false,\n },\n },\n {\n source: 'journal',\n target: 'container-title',\n when: {\n source: {\n maintitle: false,\n booktitle: false,\n journaltitle: false,\n },\n target: false,\n },\n },\n {\n source: 'school',\n target: 'publisher',\n convert: Converters.PICK,\n when: {\n source: {\n institution: false,\n organization: false,\n publisher: false,\n },\n target: false,\n },\n },\n]\n\nexport default new util.Translator([\n ...aliases,\n ...nonSpec,\n {\n source: 'abstract',\n target: 'abstract',\n },\n {\n source: 'urldate',\n target: 'accessed',\n convert: Converters.DATE,\n },\n {\n source: 'annotation',\n target: 'annote',\n },\n {\n source: 'author',\n target: 'author',\n convert: Converters.NAMES,\n },\n {\n source: 'library',\n target: 'call-number',\n },\n {\n source: 'chapter',\n target: 'chapter-number',\n },\n {\n source: 'bookauthor',\n target: 'container-author',\n convert: Converters.NAMES,\n },\n\n // Regarding maintitle, booktitle & journaltitle:\n // When importing, maintitle is preferred, since it represents the\n // larger container. When exporting, booktitle is preferred since\n // it is more common, unless number-of-volumes is present indicating a\n // multi-volume book.\n // journaltitle is only used for articles.\n {\n source: ['maintitle', 'mainsubtitle', 'maintitleaddon'],\n target: 'container-title',\n when: {\n source: true,\n target: { 'number-of-volumes': true },\n },\n convert: Converters.TITLE,\n },\n {\n source: ['booktitle', 'booksubtitle', 'booktitleaddon'],\n target: 'container-title',\n when: {\n source: { maintitle: false },\n target: {\n 'number-of-volumes': false,\n type(type) {\n return !type || !type.startsWith('article')\n },\n },\n },\n convert: Converters.TITLE,\n },\n {\n source: ['journaltitle', 'journalsubtitle', 'journaltitleaddon'],\n target: 'container-title',\n when: {\n source: { [TYPE]: 'article' },\n target: {\n type: ['article', 'article-newspaper', 'article-journal', 'article-magazine'],\n },\n },\n convert: Converters.TITLE,\n },\n {\n source: 'shortjournal',\n target: 'container-title-short',\n when: {\n source: { [TYPE]: 'article' },\n target: {\n type: ['article', 'article-newspaper', 'article-journal', 'article-magazine'],\n },\n },\n },\n {\n source: 'shortjournal',\n target: 'journalAbbreviation',\n when: {\n source: false,\n target: {\n 'container-title-short': false,\n },\n },\n },\n {\n source: 'number',\n target: 'collection-number',\n when: {\n source: {\n [TYPE]: [\n 'book',\n 'mvbook',\n 'inbook',\n 'bookinbook',\n 'suppbook',\n 'collection',\n 'mvcollection',\n 'incollection',\n 'suppcollection',\n 'manual',\n 'suppperiodical',\n 'proceedings',\n 'mvproceedings',\n 'refererence',\n ],\n },\n target: {\n type: [\n 'bill',\n 'book',\n 'broadcast',\n 'chapter',\n 'dataset',\n 'entry',\n 'entry-dictionary',\n 'entry-encyclopedia',\n 'figure',\n 'graphic',\n 'interview',\n 'legislation',\n 'legal_case',\n 'manuscript',\n 'map',\n 'motion_picture',\n 'musical_score',\n 'pamphlet',\n 'post',\n 'post-weblog',\n 'personal_communication',\n 'review',\n 'review-book',\n 'song',\n 'speech',\n 'thesis',\n 'treaty',\n 'webpage',\n ],\n },\n },\n },\n {\n source: 'series',\n target: 'collection-title',\n },\n {\n source: 'shortseries',\n target: 'collection-title-short',\n },\n {\n source: 'doi',\n target: 'DOI',\n },\n {\n source: 'edition',\n target: 'edition',\n },\n {\n source: 'editor',\n target: 'editor',\n convert: Converters.NAMES,\n },\n {\n source: [TYPE, 'entrysubtype', 'type'],\n target: ['type', 'genre'],\n convert: {\n toTarget(type, subtype, typeKey) {\n if (!typeKey) {\n if (type === 'mastersthesis') {\n typeKey = 'mathesis'\n }\n if (type === 'phdthesis') {\n typeKey = 'phdthesis'\n }\n if (type === 'techreport') {\n typeKey = 'techreport'\n }\n }\n\n return [types.source[type] || 'document', typeKey || subtype]\n },\n toSource(type, genre) {\n const sourceType = types.target[type] || 'misc'\n return genre in TYPE_KEYS ? [sourceType, undefined, genre] : [sourceType, genre]\n },\n },\n },\n {\n source: TYPE,\n when: { target: { type: false } },\n convert: {\n toSource() {\n return 'misc'\n },\n },\n },\n {\n source: 'eventdate',\n target: 'event-date',\n convert: Converters.DATE,\n },\n {\n source: 'venue',\n target: 'event-place',\n },\n {\n source: ['eventtitle', 'eventtitleaddon'],\n target: 'event-title',\n convert: Converters.EVENT_TITLE,\n },\n {\n source: ['eventtitle', 'eventtitleaddon'],\n target: 'event',\n convert: Converters.EVENT_TITLE,\n when: { source: false, target: { 'event-title': false } },\n },\n {\n source: LABEL,\n target: ['id', 'citation-key', 'author', 'issued', 'year-suffix', 'title'],\n convert: Converters.LABEL,\n },\n {\n source: 'isbn',\n target: 'ISBN',\n },\n {\n source: 'issn',\n target: 'ISSN',\n },\n {\n source: 'issue',\n target: 'issue',\n when: {\n source: {\n number: false,\n [TYPE]: ['article', 'periodical'],\n },\n target: {\n issue(issue) {\n return typeof issue === 'string' && !issue.match(/\\d+/)\n },\n type: ['article', 'article-journal', 'article-newspaper', 'article-magazine', 'periodical'],\n },\n },\n },\n {\n source: 'number',\n target: 'issue',\n when: {\n source: {\n [TYPE]: ['article', 'periodical', 'inproceedings'],\n },\n target: {\n issue(issue) {\n return issue && (typeof issue === 'number' || issue.match(/\\d+/))\n },\n type: [\n 'article',\n 'article-journal',\n 'article-newspaper',\n 'article-magazine',\n 'paper-conference',\n 'periodical',\n ],\n },\n },\n },\n {\n source: 'date',\n target: 'issued',\n convert: Converters.DATE,\n },\n {\n source: ['year', 'month', 'day'],\n target: 'issued',\n convert: Converters.YEAR_MONTH,\n when: {\n source: { date: false },\n target: false,\n },\n },\n {\n source: 'location',\n target: 'jurisdiction',\n when: {\n source: { type: 'patent' },\n target: { type: 'patent' },\n },\n },\n {\n source: 'keywords',\n target: 'keyword',\n convert: Converters.KEYWORDS,\n },\n {\n source: 'language',\n target: 'language',\n convert: Converters.PICK,\n },\n {\n source: 'langid',\n target: 'language',\n when: { source: { language: false }, target: false },\n },\n {\n source: 'note',\n target: 'note',\n },\n {\n source: 'addendum',\n target: 'note',\n when: { source: { note: false }, target: false },\n },\n {\n source: 'eid',\n target: 'number',\n when: { target: { type: ['article-journal'] } },\n },\n {\n source: ['isan', 'ismn', 'isrn', 'iswc'],\n target: 'number',\n convert: Converters.STANDARD_NUMBERS,\n when: {\n source: {\n [TYPE](type) {\n return type !== 'patent'\n },\n },\n target: {\n type(type) {\n return type !== 'patent'\n },\n },\n },\n },\n {\n source: 'number',\n target: 'number',\n when: {\n source: { [TYPE]: ['patent', 'report', 'techreport', 'legislation'] },\n target: { type: ['patent', 'report', 'legislation'] },\n },\n },\n {\n source: 'origdate',\n target: 'original-date',\n convert: Converters.DATE,\n },\n {\n source: 'origlocation',\n target: 'original-publisher-place',\n convert: Converters.PICK,\n },\n {\n source: 'origpublisher',\n target: 'original-publisher',\n convert: Converters.PICK,\n },\n {\n source: 'origtitle',\n target: 'original-title',\n },\n {\n source: 'pages',\n target: 'page',\n when: { source: { bookpagination: [undefined, 'page'] } },\n convert: Converters.PAGES,\n },\n {\n source: 'pagetotal',\n target: 'number-of-pages',\n },\n {\n source: 'part',\n target: 'part-number',\n },\n {\n source: ['eprint', 'eprinttype'],\n target: 'PMID',\n convert: Converters.EPRINT,\n },\n {\n source: 'location',\n target: 'publisher-place',\n convert: Converters.PICK,\n },\n {\n source: 'publisher',\n target: 'publisher',\n convert: Converters.PICK,\n when: {\n source: true,\n target: {\n // All except:\n // - thesis, report: institution\n // - webpage: organization\n type: [\n 'article',\n 'article-journal',\n 'article-magazine',\n 'article-newspaper',\n 'bill',\n 'book',\n 'broadcast',\n 'chapter',\n 'classic',\n 'collection',\n 'dataset',\n 'document',\n 'entry',\n 'entry-dictionary',\n 'entry-encyclopedia',\n 'event',\n 'figure',\n 'graphic',\n 'hearing',\n 'interview',\n 'legal_case',\n 'legislation',\n 'manuscript',\n 'map',\n 'motion_picture',\n 'musical_score',\n 'pamphlet',\n 'paper-conference',\n 'patent',\n 'performance',\n 'periodical',\n 'personal_communication',\n 'post',\n 'post-weblog',\n 'regulation',\n 'review',\n 'review-book',\n 'software',\n 'song',\n 'speech',\n 'standard',\n 'treaty',\n ],\n },\n },\n },\n {\n source: 'organization',\n target: 'publisher',\n convert: Converters.PICK,\n when: {\n source: {\n publisher: false,\n },\n target: {\n type: 'webpage', // TODO paper-conference?\n },\n },\n },\n {\n source: 'institution',\n target: 'publisher',\n convert: Converters.PICK,\n when: {\n source: {\n publisher: false,\n organization: false,\n },\n target: {\n type: ['report', 'thesis'],\n },\n },\n },\n {\n source: 'howpublished',\n target: 'publisher',\n convert: Converters.PICK,\n when: {\n source: {\n howpublished(howPublished) {\n return howPublished && !howPublished.startsWith('http')\n },\n publisher: false,\n organization: false,\n institution: false,\n },\n target: {\n type: 'manuscript',\n },\n },\n },\n {\n source: ['pages', 'bookpagination'],\n target: 'section',\n when: {\n source: { bookpagination: 'section' },\n target: { page: false },\n },\n convert: {\n toTarget(section) {\n return section\n },\n toSource(section) {\n return [section, 'section']\n },\n },\n },\n {\n source: 'pubstate',\n target: 'status',\n convert: Converters.STATUS,\n },\n {\n source: 'shorttitle',\n target: 'title-short',\n },\n {\n source: 'shorttitle',\n target: 'shortTitle',\n when: { source: false, target: { 'title-short': false } },\n },\n {\n source: ['title', 'subtitle', 'titleaddon'],\n target: 'title',\n convert: Converters.TITLE,\n },\n {\n source: 'translator',\n target: 'translator',\n convert: Converters.NAMES,\n },\n {\n source: 'url',\n target: 'URL',\n },\n {\n source: 'howpublished',\n target: 'URL',\n convert: Converters.HOW_PUBLISHED,\n when: {\n source: {\n url: false,\n },\n target: false,\n },\n },\n {\n source: 'version',\n target: 'version',\n },\n {\n source: 'volume',\n target: 'volume',\n },\n {\n source: 'volumes',\n target: 'number-of-volumes',\n },\n {\n source: ['issuetitle', 'issuesubtitle', 'issuetitleaddon'],\n target: 'volume-title',\n convert: Converters.TITLE,\n },\n])\n","import { util } from '../../core/index.js'\nimport { format as formatDate } from '@citation-js/date'\nimport types from './bibtexTypes.js'\nimport { TYPE, LABEL, Converters } from './shared.js'\nexport default new util.Translator([\n {\n source: 'note',\n target: 'accessed',\n when: {\n source: false,\n target: { note: false },\n },\n convert: {\n toSource(accessed) {\n return `[Online; accessed ${formatDate(accessed)}]`\n },\n },\n },\n {\n source: 'annote',\n target: 'annote',\n },\n {\n source: 'address',\n target: 'publisher-place',\n convert: Converters.PICK,\n },\n {\n source: 'author',\n target: 'author',\n convert: Converters.NAMES,\n },\n {\n source: 'chapter',\n target: 'chapter-number',\n },\n {\n source: 'number',\n target: 'collection-number',\n when: {\n source: {\n [TYPE]: [\n 'book',\n 'mvbook',\n 'inbook',\n 'collection',\n 'mvcollection',\n 'incollection',\n 'suppcollection',\n 'manual',\n 'suppperiodical',\n 'proceedings',\n 'mvproceedings',\n 'refererence',\n ],\n },\n target: {\n type: [\n 'bill',\n 'book',\n 'broadcast',\n 'chapter',\n 'dataset',\n 'entry',\n 'entry-dictionary',\n 'entry-encyclopedia',\n 'figure',\n 'graphic',\n 'interview',\n 'legislation',\n 'legal_case',\n 'manuscript',\n 'map',\n 'motion_picture',\n 'musical_score',\n 'pamphlet',\n 'post',\n 'post-weblog',\n 'personal_communication',\n 'review',\n 'review-book',\n 'song',\n 'speech',\n 'thesis',\n 'treaty',\n 'webpage',\n ],\n },\n },\n },\n {\n source: 'series',\n target: 'collection-title',\n },\n {\n source: 'booktitle',\n target: 'container-title',\n when: {\n target: {\n type: ['chapter', 'paper-conference'],\n },\n },\n },\n {\n source: 'journal',\n target: 'container-title',\n when: {\n source: {\n [TYPE]: 'article',\n },\n target: {\n type: ['article', 'article-newspaper', 'article-journal', 'article-magazine'],\n },\n },\n },\n {\n source: 'edition',\n target: 'edition',\n },\n {\n source: 'editor',\n target: 'editor',\n convert: Converters.NAMES,\n },\n {\n source: LABEL,\n target: ['id', 'citation-key', 'author', 'issued', 'year-suffix', 'title'],\n convert: Converters.LABEL,\n },\n {\n source: 'number',\n target: 'issue',\n when: {\n source: {\n [TYPE]: ['article', 'periodical', 'inproceedings'],\n },\n target: {\n issue(issue) {\n return typeof issue === 'number' || (typeof issue === 'string' && issue.match(/\\d+/))\n },\n type: [\n 'article',\n 'article-journal',\n 'article-newspaper',\n 'article-magazine',\n 'paper-conference',\n 'periodical',\n ],\n },\n },\n },\n {\n source: ['year', 'month', 'day'],\n target: 'issued',\n convert: Converters.YEAR_MONTH,\n },\n {\n source: 'note',\n target: 'note',\n },\n {\n source: 'number',\n target: 'number',\n when: {\n source: { [TYPE]: ['patent', 'report', 'techreport'] },\n target: { type: ['patent', 'report'] },\n },\n },\n {\n source: 'pages',\n target: 'page',\n convert: Converters.PAGES,\n },\n {\n source: 'publisher',\n target: 'publisher',\n convert: Converters.PICK,\n when: {\n target: {\n // All except manuscript, paper-conference, techreport and thesis\n type: [\n 'article',\n 'article-journal',\n 'article-magazine',\n 'article-newspaper',\n 'bill',\n 'book',\n 'broadcast',\n 'chapter',\n 'classic',\n 'collection',\n 'dataset',\n 'document',\n 'entry',\n 'entry-dictionary',\n 'entry-encyclopedia',\n 'event',\n 'figure',\n 'graphic',\n 'hearing',\n 'interview',\n 'legal_case',\n 'legislation',\n 'map',\n 'motion_picture',\n 'musical_score',\n 'pamphlet',\n 'patent',\n 'performance',\n 'periodical',\n 'personal_communication',\n 'post',\n 'post-weblog',\n 'regulation',\n 'review',\n 'review-book',\n 'software',\n 'song',\n 'speech',\n 'standard',\n 'treaty',\n 'webpage',\n ],\n },\n },\n },\n {\n source: 'organization',\n target: 'publisher',\n convert: Converters.PICK,\n when: {\n source: { publisher: false },\n target: { type: 'paper-conference' },\n },\n },\n {\n source: 'institution',\n target: 'publisher',\n convert: Converters.PICK,\n when: {\n source: {\n publisher: false,\n organization: false,\n },\n target: { type: 'report' },\n },\n },\n {\n source: 'school',\n target: 'publisher',\n convert: Converters.PICK,\n when: {\n source: {\n institution: false,\n organization: false,\n publisher: false,\n },\n target: { type: 'thesis' },\n },\n },\n {\n source: 'howpublished',\n target: 'publisher',\n convert: Converters.PICK,\n when: {\n source: {\n howpublished(howPublished) {\n return howPublished && !howPublished.startsWith('http')\n },\n publisher: false,\n organization: false,\n institution: false,\n school: false,\n },\n target: {\n type: 'manuscript',\n },\n },\n },\n {\n source: 'title',\n target: 'title',\n },\n {\n source: [TYPE, 'type'],\n target: ['type', 'genre'],\n convert: {\n toTarget(sourceType, subType) {\n /* istanbul ignore next */\n const type = types.source[sourceType] || 'document'\n\n if (subType) {\n return [type, subType]\n } else if (sourceType === 'mastersthesis') {\n return [type, \"Master's thesis\"]\n } else if (sourceType === 'phdthesis') {\n return [type, 'PhD thesis']\n } else {\n return [type]\n }\n },\n toSource(targetType, genre) {\n const type = types.target[targetType] || 'misc'\n\n if (/^(master'?s|diploma) thesis$/i.test(genre)) {\n return ['mastersthesis']\n } else if (/^(phd|doctoral) thesis$/i.test(genre)) {\n return ['phdthesis']\n } else {\n return [type, genre]\n }\n },\n },\n },\n {\n source: TYPE,\n when: {\n target: { type: false },\n },\n convert: {\n toSource() {\n return 'misc'\n },\n },\n },\n {\n source: 'howpublished',\n target: 'URL',\n convert: Converters.HOW_PUBLISHED,\n when: {\n target: {\n publisher: false,\n },\n },\n },\n {\n source: 'volume',\n target: 'volume',\n },\n])\n","function _objectWithoutProperties(source, excluded) {\n if (source == null) return {}\n var target = _objectWithoutPropertiesLoose(source, excluded)\n var key, i\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source)\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i]\n if (excluded.indexOf(key) >= 0) continue\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue\n target[key] = source[key]\n }\n }\n return target\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {}\n var target = {}\n var sourceKeys = Object.keys(source)\n var key, i\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i]\n if (excluded.indexOf(key) >= 0) continue\n target[key] = source[key]\n }\n return target\n}\n\nfunction _toPropertyKey(arg) {\n var key = _toPrimitive(arg, 'string')\n return typeof key === 'symbol' ? key : String(key)\n}\n\nfunction _toPrimitive(input, hint) {\n if (typeof input !== 'object' || input === null) return input\n var prim = input[Symbol.toPrimitive]\n if (prim !== undefined) {\n var res = prim.call(input, hint || 'default')\n if (typeof res !== 'object') return res\n throw new TypeError('@@toPrimitive must return a primitive value.')\n }\n return (hint === 'string' ? String : Number)(input)\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object)\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object)\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable\n })\n }\n keys.push.apply(keys, symbols)\n }\n return keys\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {}\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key])\n })\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source))\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key))\n })\n }\n }\n return target\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true,\n })\n } else {\n obj[key] = value\n }\n return obj\n}\n\nimport { TYPE, LABEL } from './shared.js'\nimport biblatex from './biblatex.js'\nimport bibtex from './bibtex.js'\n\nfunction crossref(entry, registry) {\n if (entry.crossref in registry) {\n const parent = registry[entry.crossref].properties\n\n if (parent === entry) {\n return entry\n }\n\n return Object.assign({}, crossref(parent, registry), entry)\n }\n\n return entry\n}\n\nfunction _parse(input, spec) {\n const registry = {}\n\n for (const entry of input) {\n registry[entry.label] = entry\n }\n\n return input.map(({ type, label, properties }) =>\n spec.convertToTarget(\n _objectSpread(\n {\n [TYPE]: type,\n [LABEL]: label,\n },\n crossref(properties, registry)\n )\n )\n )\n}\n\nfunction _format(input, spec) {\n return input.map((entry) => {\n const _spec$convertToSource = spec.convertToSource(entry),\n { [TYPE]: type, [LABEL]: label } = _spec$convertToSource,\n properties = _objectWithoutProperties(\n _spec$convertToSource,\n [TYPE, LABEL].map(_toPropertyKey)\n )\n\n return {\n type,\n label,\n properties,\n }\n })\n}\n\nexport function parseBibtex(input) {\n return _parse(input, bibtex)\n}\nexport function formatBibtex(input) {\n return _format(input, bibtex)\n}\nexport function parse(input) {\n return _parse(input, biblatex)\n}\nexport function format(input) {\n return _format(input, biblatex)\n}\n","// @ts-nocheck\n/**\n * @access private\n * @param {String}\n * @returns {Boolean|null} true if uppercase, false if lowercase, null if neither\n */\nexport function getStringCase(string) {\n const a = string.toUpperCase()\n const b = string.toLowerCase()\n\n for (let i = 0; i < string.length; i++) {\n if (a[i] !== b[i]) {\n return a[i] === string[i]\n }\n }\n\n return null\n}\n\n/**\n * @access private\n * @param {Array<Object>} parts\n * @return {String|undefined}\n */\nexport function formatNameParts(parts) {\n if (parts.length === 0) {\n return undefined\n }\n\n let piece = ''\n\n while (parts.length > 1) {\n const { value, hyphenated } = parts.shift()\n piece += value + (hyphenated ? '-' : ' ')\n }\n\n const output = piece + parts[0].value\n return output[0] && output\n}\n\n/**\n * @access private\n * @param {Array<Object>} parts\n * @param {Boolean} [orderGiven=true] - also consider the given name\n * @return {Array<String>}\n */\nexport function orderNameParts(parts, /* istanbul ignore next */ orderGiven = true) {\n const given = []\n const undecided = []\n\n if (orderGiven) {\n while (parts.length > 1 && parts[0].upperCase !== false) {\n given.push(...undecided)\n undecided.length = 0\n\n while (parts.length > 1 && parts[0].upperCase !== false && !parts[0].hyphenated) {\n given.push(parts.shift())\n }\n\n while (parts.length > 0 && parts[0].upperCase !== false && parts[0].hyphenated) {\n undecided.push(parts.shift())\n }\n }\n }\n\n const prefix = []\n const family = []\n\n while (parts.length > 1) {\n prefix.push(...family)\n family.length = 0\n\n while (parts.length > 1 && parts[0].upperCase === false) {\n prefix.push(parts.shift())\n }\n\n while (parts.length > 0 && parts[0].upperCase !== false) {\n family.push(parts.shift())\n }\n }\n\n if (undecided.length) {\n family.unshift(...undecided)\n }\n if (parts.length) {\n family.push(parts[0])\n }\n\n return [formatNameParts(given), formatNameParts(prefix), formatNameParts(family)]\n}\n\n/**\n * @access private\n * @param {Array<Array<Object>>} pieces\n * @return {Object}\n */\nexport function orderNamePieces(pieces) {\n if (pieces[0][0].label) {\n const name = {}\n for (const [{ value, label }] of pieces) {\n name[label] = value\n }\n return name\n }\n\n const name = {}\n const [given, prefix, family] = orderNameParts(pieces[0], pieces.length === 1)\n\n if (family) {\n name.family = family\n }\n if (prefix) {\n name.prefix = prefix\n }\n\n if (pieces.length === 3) {\n name.given = formatNameParts(pieces[2])\n name.suffix = formatNameParts(pieces[1])\n } else if (pieces.length === 2) {\n name.given = formatNameParts(pieces[1])\n } else if (given) {\n name.given = given\n }\n\n return name\n}\n","import { util } from '../../core/index.js'\nimport moo from 'moo'\nimport config from '../config.js'\nimport * as constants from './constants.js'\nimport { orderNamePieces, formatNameParts, getStringCase } from './name.js'\n\nconst text = {\n command: {\n match: /\\\\(?:[a-zA-Z]+|.) */,\n type: moo.keywords({\n commandBegin: '\\\\begin',\n commandEnd: '\\\\end',\n }),\n value: (s) => s.slice(1).trim(),\n },\n lbrace: { match: '{', push: 'bracedLiteral' },\n mathShift: { match: '$', push: 'mathLiteral' },\n whitespace: {\n match: /[\\s]+|~/,\n lineBreaks: true,\n // \\xa0 = Non-breakable space\n value(token) {\n return token === '~' ? '\\xa0' : ' '\n },\n },\n}\n\nconst lexer = moo.states({\n stringLiteral: {\n ...text,\n text: /[^{$}\\s~\\\\]+/,\n },\n namesLiteral: {\n and: /\\s+[aA][nN][dD]\\s+/,\n comma: ',',\n hyphen: '-',\n equals: '=',\n ...text,\n text: /[^{$}\\s~\\\\,=-]+/,\n },\n listLiteral: {\n and: /\\s+and\\s+/,\n ...text,\n text: /[^{$}\\s~\\\\]+/,\n },\n separatedLiteral: {\n comma: ',',\n ...text,\n text: /[^{$}\\s~\\\\,]+/,\n },\n bracedLiteral: {\n ...text,\n rbrace: { match: '}', pop: true },\n text: /[^{$}\\s~\\\\]+/,\n },\n mathLiteral: {\n ...text,\n mathShift: { match: '$', pop: true },\n script: /[\\^_]/,\n text: /[^{$}\\s~\\\\^_]+/,\n },\n})\n\nfunction flattenConsString(string) {\n // eslint-disable-next-line no-unused-expressions\n string[0]\n return string\n}\n\nfunction applyFormatting(text, format) {\n if (format in constants.formatting) {\n return text && constants.formatting[format].join(text)\n } else {\n return text\n }\n}\n\nexport const valueGrammar = new util.Grammar(\n {\n String() {\n let output = ''\n while (!this.matchEndOfFile()) {\n output += this.consumeRule('Text')\n }\n return flattenConsString(output)\n },\n\n StringNames() {\n const list = []\n\n while (true) {\n this.consumeToken('whitespace', true)\n list.push(this.consumeRule('Name'))\n this.consumeToken('whitespace', true)\n\n if (this.matchEndOfFile()) {\n return list\n } else {\n this.consumeToken('and')\n }\n }\n },\n\n Name() {\n const pieces = []\n\n while (true) {\n pieces.push(this.consumeRule('NamePiece'))\n\n if (this.matchEndOfFile() || this.matchToken('and')) {\n return orderNamePieces(pieces)\n } else {\n this.consumeToken('comma')\n this.consumeToken('whitespace', true)\n }\n }\n },\n\n NamePiece() {\n const parts = []\n\n while (true) {\n const part = this.consumeRule('NameToken')\n\n if (part.label) {\n part.label = formatNameParts([...parts, { value: part.label }])\n return [part]\n }\n\n parts.push(part)\n\n if (this.matchEndOfFile() || this.matchToken('and') || this.matchToken('comma')) {\n return parts\n } else {\n while (this.matchToken('hyphen') || this.matchToken('whitespace')) {\n this.consumeToken()\n }\n }\n }\n },\n\n NameToken() {\n let upperCase = null\n let value = ''\n\n while (true) {\n // If needed, test regular text for case\n if (upperCase === null && this.matchToken('text')) {\n const text = this.consumeToken().value\n value += text\n upperCase = getStringCase(text)\n\n // If end of name part, return up\n } else if (\n this.matchEndOfFile() ||\n this.matchToken('and') ||\n this.matchToken('comma') ||\n this.matchToken('whitespace')\n ) {\n return { value, upperCase }\n\n // Same for hyphen, but note it is hyphenated\n } else if (this.matchToken('hyphen')) {\n return { value, upperCase, hyphenated: true }\n\n // If equals we are in BibLaTeX extended mode\n // 'family=Last, given=First, prefix=von'\n } else if (this.matchToken('equals')) {\n this.consumeToken('equals')\n const text = this.consumeRule('NamePiece')\n if (text[0].label) {\n value += '=' + text[0].label\n }\n return { value: formatNameParts(text), label: value }\n\n // Else consume other text\n } else {\n value += this.consumeRule('Text')\n }\n }\n },\n\n StringList() {\n const list = []\n while (!this.matchEndOfFile()) {\n let output = ''\n while (!this.matchEndOfFile() && !this.matchToken('and')) {\n output += this.consumeRule('Text')\n }\n list.push(flattenConsString(output))\n\n this.consumeToken('and', true)\n }\n return list.length === 1 ? list[0] : list\n },\n\n StringSeparated() {\n const list = []\n while (!this.matchEndOfFile()) {\n let output = ''\n while (!this.matchEndOfFile() && !this.matchToken('comma')) {\n output += this.consumeRule('Text')\n }\n list.push(output.trim())\n\n this.consumeToken('comma', true)\n this.consumeToken('whitespace', true)\n }\n return list\n },\n\n StringVerbatim() {\n let output = ''\n while (!this.matchEndOfFile()) {\n output += this.consumeToken().text\n }\n return flattenConsString(output)\n },\n\n StringUri() {\n const uri = this.consumeRule('StringVerbatim')\n try {\n if (decodeURI(uri) === uri) {\n return encodeURI(uri)\n } else {\n return uri\n }\n } catch (e) {\n // malformed URI\n return encodeURI(uri)\n }\n },\n\n StringTitleCase() {\n this.state.sentenceCase = true\n let output = ''\n\n while (!this.matchEndOfFile()) {\n output += this.consumeRule('Text')\n }\n\n return flattenConsString(output)\n },\n\n BracketString() {\n let output = ''\n this.consumeToken('lbrace')\n\n const sentenceCase = this.state.sentenceCase\n // If the bracket string starts with a command the sentence case behavior\n // is maintained within the brackets.\n this.state.sentenceCase = sentenceCase && this.matchToken('command')\n this.state.partlyLowercase &&= this.state.sentenceCase\n\n while (!this.matchToken('rbrace')) {\n output += this.consumeRule('Text')\n }\n\n // topLevel meaning that the bracket string is not top level but a direct\n // child of the top level value.\n const topLevel = sentenceCase && !this.state.sentenceCase\n // Protect the case of the bracket string if it is a direct child of the top\n // level, and the string is partly lowercase.\n const protectCase = topLevel && this.state.partlyLowercase\n // Restore the sentence case of the outside of the brackets.\n this.state.sentenceCase = sentenceCase\n\n this.consumeToken('rbrace')\n\n return protectCase ? applyFormatting(output, 'nocase') : output\n },\n\n MathString() {\n let output = ''\n this.consumeToken('mathShift')\n while (!this.matchToken('mathShift')) {\n if (this.matchToken('script')) {\n const script = this.consumeToken('script').value\n const text = this.consumeRule('Text').split('')\n if (text.every((char) => char in constants.mathScripts[script])) {\n output += text.map((char) => constants.mathScripts[script][char]).join('')\n } else {\n const formatName = constants.mathScriptFormatting[script]\n output += constants.formatting[formatName].join(text.join(''))\n }\n\n continue\n }\n\n if (this.matchToken('command')) {\n const command = this.token.value\n if (command in constants.mathScriptFormatting) {\n this.consumeToken('command')\n const text = this.consumeRule('BracketString')\n output += applyFormatting(text, constants.mathScriptFormatting[command])\n continue\n }\n }\n\n output += this.consumeRule('Text')\n }\n this.consumeToken('mathShift')\n return output\n },\n\n Text() {\n /* eslint-disable padded-blocks */\n if (this.matchToken('lbrace')) {\n return this.consumeRule('BracketString')\n } else if (this.matchToken('mathShift')) {\n return this.consumeRule('MathString')\n } else if (this.matchToken('whitespace')) {\n return this.consumeToken('whitespace').value\n } else if (this.matchToken('commandBegin')) {\n return this.consumeRule('EnclosedEnv')\n } else if (this.matchToken('command')) {\n return this.consumeRule('Command')\n }\n /* eslint-enable padded-blocks */\n\n const text = this.consumeToken('text').value.replace(\n constants.ligaturePattern,\n (ligature) => constants.ligatures[ligature]\n )\n\n const afterPunctuation = this.state.afterPunctuation\n this.state.afterPunctuation = /[?!.:]$/.test(text)\n\n // If the text fragment is not topLevel and has a case, check whether lowercase\n if (!this.state.sentenceCase) {\n this.state.partlyLowercase ||= text === text.toLowerCase() && text !== text.toUpperCase()\n return text\n }\n\n // Unicode-safe splitting (as in, accounting for surrogate pairs)\n const [first, ...otherCharacters] = text\n const rest = otherCharacters.join('')\n const restLowerCase = rest.toLowerCase()\n\n // Word case should be preserved for proper nouns (e.g. those with capital\n // letters in other places than the first letter).\n if (rest !== restLowerCase) {\n return text\n }\n\n if (!afterPunctuation) {\n return text.toLowerCase()\n }\n\n return first + restLowerCase\n // return first.toUpperCase() + restLowerCase\n },\n\n Command() {\n const commandToken = this.consumeToken('command')\n const command = commandToken.value\n\n // formatting envs\n if (command in constants.formattingEnvs) {\n const text = this.consumeRule('Env')\n const format = constants.formattingEnvs[command]\n return applyFormatting(text, format)\n\n // formatting commands\n } else if (command in constants.formattingCommands) {\n const text = this.consumeRule('BracketString')\n const format = constants.formattingCommands[command]\n return applyFormatting(text, format)\n\n // commands\n } else if (command in constants.commands) {\n return constants.commands[command]\n\n // diacritics\n } else if (command in constants.diacritics && !this.matchEndOfFile()) {\n const text = this.consumeRule('Text')\n const diacritic = text[0] + constants.diacritics[command]\n return diacritic.normalize('NFC') + text.slice(1)\n\n // argument commands\n } else if (command in constants.argumentCommands) {\n const func = constants.argumentCommands[command]\n const args = []\n let arity = func.length\n\n while (arity-- > 0) {\n this.consumeToken('whitespace', true)\n args.push(this.consumeRule('BracketString'))\n }\n\n return func(...args)\n\n // escapes\n } else if (/^[&%$#_{}]$/.test(command)) {\n return commandToken.text.slice(1)\n\n // unknown commands\n } else {\n return commandToken.text\n }\n },\n\n Env() {\n let output = ''\n while (!this.matchEndOfFile() && !this.matchToken('rbrace')) {\n output += this.consumeRule('Text')\n }\n return output\n },\n\n EnclosedEnv() {\n this.consumeToken('commandBegin')\n const beginEnv = this.consumeRule('BracketString')\n\n let output = ''\n\n while (!this.matchToken('commandEnd')) {\n output += this.consumeRule('Text')\n }\n\n const end = this.consumeToken('commandEnd')\n const endEnv = this.consumeRule('BracketString')\n\n if (beginEnv !== endEnv) {\n throw new SyntaxError(\n this.lexer.formatError(\n end,\n `environment started with \"${beginEnv}\", ended with \"${endEnv}\"`\n )\n )\n }\n\n return applyFormatting(output, constants.formattingEnvs[beginEnv])\n },\n },\n {\n sentenceCase: false,\n partlyLowercase: false,\n afterPunctuation: true,\n }\n)\n\nfunction singleLanguageIsEnglish(language) {\n return constants.sentenceCaseLanguages.includes(language.toLowerCase())\n}\n\nfunction isEnglish(languages) {\n if (Array.isArray(languages)) {\n return languages.every(singleLanguageIsEnglish)\n }\n return singleLanguageIsEnglish(languages)\n}\n\nfunction getMainRule(fieldType, languages) {\n if (fieldType[1] === 'name') {\n /* istanbul ignore next: does not exist */\n return fieldType[0] === 'list' ? 'StringNames' : 'Name'\n }\n\n if (fieldType[1] === 'title') {\n const option = config.parse.sentenceCase\n if (option === 'always' || (option === 'english' && isEnglish(languages))) {\n return 'StringTitleCase'\n } else {\n return 'String'\n }\n }\n\n switch (fieldType[0] === 'field' ? fieldType[1] : fieldType[0]) {\n case 'list':\n return 'StringList'\n case 'separated':\n return 'StringSeparated'\n case 'verbatim':\n return 'StringVerbatim'\n case 'uri':\n return 'StringUri'\n case 'title':\n case 'literal':\n default:\n return 'String'\n }\n}\n\nfunction getLexerState(fieldType) {\n if (fieldType[1] === 'name') {\n return 'namesLiteral'\n }\n\n switch (fieldType[0]) {\n case 'list':\n return 'listLiteral'\n case 'separated':\n return 'separatedLiteral'\n case 'field':\n default:\n return 'stringLiteral'\n }\n}\n\nexport function parse(text, field, languages = []) {\n const fieldType = constants.fieldTypes[field] || []\n return valueGrammar.parse(\n lexer.reset(text, {\n state: getLexerState(fieldType),\n line: 0,\n col: 0,\n }),\n getMainRule(fieldType, languages)\n )\n}\n","import config from '../config.js'\nimport { parse as mapBiblatex, parseBibtex as mapBibtex } from '../mapping/index.js'\nimport { parse as parseValue } from './value.js'\nimport { required } from './constants.js'\n\nfunction validate(entries, requirements) {\n const problems = []\n\n for (const { type, label, properties } of entries) {\n if (type in requirements) {\n const missing = []\n for (const field of requirements[type]) {\n if (Array.isArray(field) && !field.some((field) => field in properties)) {\n missing.push(field.join('/'))\n } else if (typeof field === 'string' && !(field in properties)) {\n missing.push(field)\n }\n }\n if (missing.length) {\n problems.push([label, `missing fields: ${missing.join(', ')}`])\n }\n } else {\n problems.push([label, `invalid type: \"${type}\"`])\n }\n }\n\n if (problems.length) {\n throw new RangeError(\n ['Invalid entries:']\n .concat(problems.map(([label, problem]) => ` - ${label} has ${problem}`))\n .join('\\n')\n )\n }\n}\n\nfunction parseEntryValues(entry) {\n const output = {}\n\n if ('language' in entry.properties) {\n output.language = parseValue(entry.properties.language, 'language')\n }\n\n for (const property in entry.properties) {\n const value = entry.properties[property]\n if (value === '') {\n continue\n }\n output[property] = parseValue(value + '', property, output.language)\n }\n\n return { ...entry, properties: output }\n}\n\nexport function parse(entries) {\n if (config.parse.strict) {\n validate(entries, required.biblatex)\n }\n\n return mapBiblatex(entries.map(parseEntryValues))\n}\n\nexport function parseBibtex(entries) {\n if (config.parse.strict) {\n validate(entries, required.bibtex)\n }\n\n return mapBibtex(entries.map(parseEntryValues))\n}\n","import { parse as parseFile } from './file.js'\nimport { parse as parseBibtxt } from './bibtxt.js'\nimport { parse as parseEntries, parseBibtex } from './entries.js'\n\n/**\n * @constant {module:@citation-js/core.plugins~pluginRef} ref\n * @memberof module:@citation-js/plugin-bibtex\n * @default '@bibtex'\n */\nexport const ref = '@bibtex'\n\n/**\n * @namespace formats\n * @type module:@citation-js/core.plugins.input~format,module:@citation-js/core.plugins.input~parsers\n * @memberof module:@citation-js/plugin-bibtex\n */\nexport const formats = {\n /**\n * BibLaTeX file.\n *\n * @type module:@citation-js/core.plugins.input~parsers\n * @memberof module:@citation-js/plugin-bibtex.formats\n * @property {module:@citation-js/core.plugins.input~dataParser} parse\n * @property {module:@citation-js/core.plugins.input~typeParser} parseType\n */\n '@biblatex/text': {\n parse: parseFile,\n parseType: {\n dataType: 'String',\n predicate: /@\\s{0,5}[A-Za-z]{1,13}\\s{0,5}\\{\\s{0,5}[^@{}\"=,\\\\\\s]{0,100}\\s{0,5},[\\s\\S]*\\}/,\n },\n },\n\n /**\n * BibLaTeX object.\n *\n * ```js\n * {\n * type: '...',\n * label: '...',\n * properties: {...}\n * }\n * ```\n *\n * @type module:@citation-js/core.plugins.input~parsers\n * @memberof module:@citation-js/plugin-bibtex.formats\n * @property {module:@citation-js/core.plugins.input~dataParser} parse\n * @property {module:@citation-js/core.plugins.input~typeParser} parseType\n */\n '@biblatex/entry+object': {\n parse(input) {\n return parseEntries([input])\n },\n parseType: {\n dataType: 'SimpleObject',\n propertyConstraint: { props: ['type', 'label', 'properties'] },\n },\n },\n\n /**\n * Array of {@link module:@citation-js/plugin-bibtex.formats.\"@biblatex/entries+list\"|BibLaTeX objects}.\n *\n * @type module:@citation-js/core.plugins.input~parsers\n * @memberof module:@citation-js/plugin-bibtex.formats\n * @property {module:@citation-js/core.plugins.input~dataParser} parse\n * @property {module:@citation-js/core.plugins.input~typeParser} parseType\n */\n '@biblatex/entries+list': {\n parse: parseEntries,\n parseType: { elementConstraint: '@biblatex/entry+object' },\n },\n\n /**\n * BibTeX file.\n *\n * @type module:@citation-js/core.plugins.input~parsers\n * @memberof module:@citation-js/plugin-bibtex.formats\n * @property {module:@citation-js/core.plugins.input~dataParser} parse\n * @property {module:@citation-js/core.plugins.input~format} outputs\n */\n '@bibtex/text': {\n parse: parseFile,\n outputs: '@bibtex/entries+list',\n },\n\n /**\n * BibTeX object.\n *\n * ```js\n * {\n * type: '...',\n * label: '...',\n * properties: {...}\n * }\n * ```\n *\n * @type module:@citation-js/core.plugins.input~parsers\n * @memberof module:@citation-js/plugin-bibtex.formats\n * @property {module:@citation-js/core.plugins.input~dataParser} parse\n */\n '@bibtex/entry+object': {\n parse(input) {\n return parseBibtex([input])\n },\n },\n\n /**\n * Array of {@link module:@citation-js/plugin-bibtex.formats.\"@bibtex/entries+list\"|BibTeX objects}.\n *\n * @type module:@citation-js/core.plugins.input~parsers\n * @memberof module:@citation-js/plugin-bibtex.formats\n * @property {module:@citation-js/core.plugins.input~dataParser} parse\n */\n '@bibtex/entries+list': {\n parse: parseBibtex,\n },\n\n /**\n * Bib.TXT file.\n *\n * @type module:@citation-js/core.plugins.input~parsers\n * @memberof module:@citation-js/plugin-bibtex.formats\n * @property {module:@citation-js/core.plugins.input~dataParser} parse\n * @property {module:@citation-js/core.plugins.input~typeParser} parseType\n */\n '@bibtxt/text': {\n parse: parseBibtxt,\n parseType: {\n dataType: 'String',\n predicate: /^\\s*(\\[(?!\\s*[{[]).*?\\]\\s*(\\n\\s*[^[]((?!:)\\S)+\\s*:\\s*.+?\\s*)*\\s*)+$/,\n },\n },\n}\n","//@ts-nocheck\nimport { diacritics, commands, ligatures, fieldTypes } from '../input/constants.js'\nconst unicode = {}\n\nfor (const command in commands) {\n unicode[commands[command]] = command\n}\n\nfor (const diacritic in diacritics) {\n unicode[diacritics[diacritic]] = diacritic\n}\n\nfor (const ligature in ligatures) {\n unicode[ligatures[ligature]] = ligature\n}\n\nconst UNSAFE_UNICODE =\n /[^a-zA-Z0-9\\s!\"#%&'()*+,\\-./:;=?@[\\]{}\\u0300-\\u0308\\u030a-\\u030c\\u0332\\u0323\\u0327\\u0328\\u0361\\u0326]/g\nconst DIACRITIC_PATTERN = /.[\\u0300-\\u0308\\u030a-\\u030c\\u0332\\u0323\\u0327\\u0328\\u0361\\u0326]+/g\nconst listDelimiters = {\n separated: ',',\n list: ' and ',\n}\nconst richTextMappings = {\n i: '\\\\textit{',\n b: '\\\\textbf{',\n sc: '\\\\textsc{',\n sup: '\\\\textsuperscript{',\n sub: '\\\\textsubscript{',\n 'span style=\"font-variant:small-caps;\"': '\\\\textsc{',\n 'span class=\"nocase\"': '{',\n}\n\nfunction escapeValue(value) {\n return value\n .normalize('NFKD')\n .replace(UNSAFE_UNICODE, (char) =>\n char in unicode ? (unicode[char] in ligatures ? unicode[char] : `\\\\${unicode[char]}{}`) : ''\n )\n .replace(DIACRITIC_PATTERN, (match) =>\n Array.from(match).reduce((subject, diacritic) => `{\\\\${unicode[diacritic]} ${subject}}`)\n )\n}\n\nfunction formatRichText(value) {\n const closingTags = []\n let tokens = value.split(/<(\\/?(?:i|b|sc|sup|sub|span)|span .*?)>/g)\n tokens = tokens.map((token, index) => {\n if (index % 2 === 0) {\n return escapeValue(token)\n } else if (token in richTextMappings) {\n closingTags.push('/' + token.split(' ')[0])\n return richTextMappings[token]\n } else if (token === closingTags[closingTags.length - 1]) {\n closingTags.pop()\n return '}'\n } else {\n return ''\n }\n })\n return tokens.join('')\n}\n\nfunction formatName(name) {\n if (name.family && !name.prefix && !name.given & !name.suffix) {\n return name.family.includes(listDelimiters.list) ? name.family : `{${name.family}}`\n }\n\n const parts = ['']\n\n if (name.prefix && name.family) {\n parts[0] += name.prefix + ' '\n }\n\n if (name.family) {\n parts[0] += name.family\n }\n\n if (name.suffix) {\n parts.push(name.suffix)\n parts.push(name.given || '')\n } else {\n parts.push(name.given)\n }\n\n return escapeValue(parts.join(', ').trim())\n}\n\nfunction formatTitle(title) {\n return formatRichText(title)\n .split(/(:\\s*)/)\n .map((part, i) => (i % 2 ? part : part.replace(/(?!^)\\b[a-z]*[A-Z].*?\\b/g, '{$&}')))\n .join('')\n}\n\nfunction formatSingleValue(value, valueType) {\n switch (valueType) {\n case 'title':\n return formatTitle(value)\n\n case 'literal':\n return formatRichText(value.toString())\n\n case 'name':\n return formatName(value)\n\n case 'verbatim':\n case 'uri':\n return value.toString()\n\n default:\n return escapeValue(value.toString())\n }\n}\n\nfunction formatList(values, valueType, listType) {\n const delimiter = listDelimiters[listType]\n return values\n .map((value) => {\n const formatted = formatSingleValue(value, valueType)\n return formatted.includes(delimiter) ? `{${formatted}}` : formatted\n })\n .join(delimiter)\n}\n\nexport function format(field, value) {\n if (!(field in fieldTypes)) {\n return formatSingleValue(value, 'verbatim')\n }\n\n const [listType, valueType] = fieldTypes[field]\n\n if (listType in listDelimiters) {\n return formatList(value, valueType, listType)\n } else {\n return formatSingleValue(value, valueType)\n }\n}\n","import { format as mapBiblatex, formatBibtex as mapBibtex } from '../mapping/index.js'\nimport { format as formatValue } from './value.js'\n\nfunction formatEntryValues({ type, label, properties }) {\n const output = {}\n\n for (const property in properties) {\n const value = properties[property]\n output[property] = formatValue(property, value)\n }\n\n return {\n type,\n label,\n properties: output,\n }\n}\n\nexport function format(entries) {\n return mapBiblatex(entries).map(formatEntryValues)\n}\nexport function formatBibtex(entries) {\n return mapBibtex(entries).map(formatEntryValues)\n}\n","function formatEntry({ type, label, properties }, dict) {\n const fields = Object.entries(properties).map(([field, value]) =>\n dict.listItem.join(`${field} = {${value}},`)\n )\n return dict.entry.join(`@${type}{${label},${dict.list.join(fields.join(''))}}`)\n}\n\nexport function format(src, dict) {\n const entries = src.map((entry) => formatEntry(entry, dict)).join('')\n return dict.bibliographyContainer.join(entries)\n}\n","import { plugins } from '../../core/index.js'\nimport { format as mapBiblatex, formatBibtex as mapBibtex } from './entries.js'\nimport { format } from './bibtex.js'\nimport { format as formatBibtxt } from './bibtxt.js'\n\nconst factory = function (mapper, formatter) {\n return function (data, opts = {}) {\n const { type, format = type || 'text' } = opts\n data = mapper(data)\n\n if (format === 'object') {\n return data\n } else if (plugins.dict.has(format)) {\n return formatter(data, plugins.dict.get(format), opts)\n } else {\n throw new RangeError(`Output dictionary \"${format}\" not available`)\n }\n }\n}\n\nexport default {\n bibtex: factory(mapBibtex, format),\n biblatex: factory(mapBiblatex, format),\n bibtxt: factory(mapBibtex, formatBibtxt),\n}\n","function formatEntry({ type, label, properties }, dict) {\n const fields = Object.entries(properties)\n .concat([['type', type]])\n .map(([field, value]) => dict.listItem.join(`${field}: ${value}`))\n return dict.entry.join(`[${label}]${dict.list.join(fields.join(''))}`)\n}\n\nexport function format(src, dict) {\n const entries = src.map((entry) => formatEntry(entry, dict)).join('\\n')\n return dict.bibliographyContainer.join(entries)\n}\n","import { plugins } from '../core/index.js'\nimport { ref, formats as input } from './input/index.js'\nimport config from './config.js'\nimport output from './output/index.js'\nplugins.add(ref, {\n input,\n output,\n config,\n})\n","import { util } from '../core/index.js'\n\nconst defaultLocales = {\n 'en-US': `<?xml version=\"1.0\" encoding=\"utf-8\"?><locale xmlns=\"http://purl.org/net/xbiblio/csl\" version=\"1.0\" xml:lang=\"en-US\"><info><translator><name>Andrew Dunning</name></translator><translator><name>Sebastian Karcher</name></translator><translator><name>Rintze M. Zelle</name></translator><translator><name>Denis Meier</name></translator><translator><name>Brenton M. Wiernik</name></translator><rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights><updated>2015-10-10T23:31:02+00:00</updated></info><style-options punctuation-in-quote=\"true\"/><date form=\"text\"><date-part name=\"month\" suffix=\" \"/><date-part name=\"day\" suffix=\", \"/><date-part name=\"year\"/></date><date form=\"numeric\"><date-part name=\"month\" form=\"numeric-leading-zeros\" suffix=\"/\"/><date-part name=\"day\" form=\"numeric-leading-zeros\" suffix=\"/\"/><date-part name=\"year\"/></date><terms><term name=\"advance-online-publication\">advance online publication</term><term name=\"album\">album</term><term name=\"audio-recording\">audio recording</term><term name=\"film\">film</term><term name=\"henceforth\">henceforth</term><term name=\"loc-cit\">loc. cit.</term><term name=\"no-place\">no place</term><term name=\"no-place\" form=\"short\">n.p.</term><term name=\"no-publisher\">no publisher</term><term name=\"no-publisher\" form=\"short\">n.p.</term><term name=\"on\">on</term><term name=\"op-cit\">op. cit.</term><term name=\"original-work-published\">original work published</term><term name=\"personal-communication\">personal communication</term><term name=\"podcast\">podcast</term><term name=\"podcast-episode\">podcast episode</term><term name=\"preprint\">preprint</term><term name=\"radio-broadcast\">radio broadcast</term><term name=\"radio-series\">radio series</term><term name=\"radio-series-episode\">radio series episode</term><term name=\"special-issue\">special issue</term><term name=\"special-section\">special section</term><term name=\"television-broadcast\">television broadcast</term><term name=\"television-series\">television series</term><term name=\"television-series-episode\">television series episode</term><term name=\"video\">video</term><term name=\"working-paper\">working paper</term><term name=\"accessed\">accessed</term><term name=\"and\">and</term><term name=\"and others\">and others</term><term name=\"anonymous\">anonymous</term><term name=\"anonymous\" form=\"short\">anon.</term><term name=\"at\">at</term><term name=\"available at\">available at</term><term name=\"by\">by</term><term name=\"circa\">circa</term><term name=\"circa\" form=\"short\">c.</term><term name=\"cited\">cited</term><term name=\"edition\"><single>edition</single><multiple>editions</multiple></term><term name=\"edition\" form=\"short\">ed.</term><term name=\"et-al\">et al.</term><term name=\"forthcoming\">forthcoming</term><term name=\"from\">from</term><term name=\"ibid\">ibid.</term><term name=\"in\">in</term><term name=\"in press\">in press</term><term name=\"internet\">internet</term><term name=\"interview\">interview</term><term name=\"letter\">letter</term><term name=\"no date\">no date</term><term name=\"no date\" form=\"short\">n.d.</term><term name=\"online\">online</term><term name=\"presented at\">presented at the</term><term name=\"reference\"><single>reference</single><multiple>references</multiple></term><term name=\"reference\" form=\"short\"><single>ref.</single><multiple>refs.</multiple></term><term name=\"retrieved\">retrieved</term><term name=\"scale\">scale</term><term name=\"version\">version</term><term name=\"article\">preprint</term><term name=\"article-journal\">journal article</term><term name=\"article-magazine\">magazine article</term><term name=\"article-newspaper\">newspaper article</term><term name=\"bill\">bill</term><term name=\"book\">book</term><term name=\"broadcast\">broadcast</term><term name=\"chapter\">book chapter</term><term name=\"classic\">classic</term><term name=\"collection\">collection</term><term name=\"dataset\">dataset</term><term name=\"document\">document</term><term name=\"entry\">entry</term><term name=\"entry-dictionary\">dictionary entry</term><term name=\"entry-encyclopedia\">encyclopedia entry</term><term name=\"event\">event</term><term name=\"graphic\">graphic</term><term name=\"hearing\">hearing</term><term name=\"interview\">interview</term><term name=\"legal_case\">legal case</term><term name=\"legislation\">legislation</term><term name=\"manuscript\">manuscript</term><term name=\"map\">map</term><term name=\"motion_picture\">video recording</term><term name=\"musical_score\">musical score</term><term name=\"pamphlet\">pamphlet</term><term name=\"paper-conference\">conference paper</term><term name=\"patent\">patent</term><term name=\"performance\">performance</term><term name=\"periodical\">periodical</term><term name=\"personal_communication\">personal communication</term><term name=\"post\">post</term><term name=\"post-weblog\">blog post</term><term name=\"regulation\">regulation</term><term name=\"report\">report</term><term name=\"review\">review</term><term name=\"review-book\">book review</term><term name=\"software\">software</term><term name=\"song\">audio recording</term><term name=\"speech\">presentation</term><term name=\"standard\">standard</term><term name=\"thesis\">thesis</term><term name=\"treaty\">treaty</term><term name=\"webpage\">webpage</term><term name=\"article-journal\" form=\"short\">journal art.</term><term name=\"article-magazine\" form=\"short\">mag. art.</term><term name=\"article-newspaper\" form=\"short\">newspaper art.</term><term name=\"book\" form=\"short\">bk.</term><term name=\"chapter\" form=\"short\">bk. chap.</term><term name=\"document\" form=\"short\">doc.</term><term name=\"graphic\" form=\"short\">graph.</term><term name=\"interview\" form=\"short\">interv.</term><term name=\"manuscript\" form=\"short\">MS</term><term name=\"motion_picture\" form=\"short\">video rec.</term><term name=\"report\" form=\"short\">rep.</term><term name=\"review\" form=\"short\">rev.</term><term name=\"review-book\" form=\"short\">bk. rev.</term><term name=\"song\" form=\"short\">audio rec.</term><term name=\"ad\">AD</term><term name=\"bc\">BC</term><term name=\"bce\">BCE</term><term name=\"ce\">CE</term><term name=\"open-quote\"></term><term name=\"close-quote\"></term><term name=\"open-inner-quote\"></term><term name=\"close-inner-quote\"></term><term name=\"page-range-delimiter\"></term><term name=\"colon\">:</term><term name=\"comma\">,</term><term name=\"semicolon\">;</term><term name=\"ordinal\">th</term><term name=\"ordinal-01\">st</term><term name=\"ordinal-02\">nd</term><term name=\"ordinal-03\">rd</term><term name=\"ordinal-11\">th</term><term name=\"ordinal-12\">th</term><term name=\"ordinal-13\">th</term><term name=\"long-ordinal-01\">first</term><term name=\"long-ordinal-02\">second</term><term name=\"long-ordinal-03\">third</term><term name=\"long-ordinal-04\">fourth</term><term name=\"long-ordinal-05\">fifth</term><term name=\"long-ordinal-06\">sixth</term><term name=\"long-ordinal-07\">seventh</term><term name=\"long-ordinal-08\">eighth</term><term name=\"long-ordinal-09\">ninth</term><term name=\"long-ordinal-10\">tenth</term><term name=\"act\"><single>act</single><multiple>acts</multiple></term><term name=\"appendix\"><single>appendix</single><multiple>appendices</multiple></term><term name=\"article-locator\"><single>article</single><multiple>articles</multiple></term><term name=\"canon\"><single>canon</single><multiple>canons</multiple></term><term name=\"elocation\"><single>location</single><multiple>locations</multiple></term><term name=\"equation\"><single>equation</single><multiple>equations</multiple></term><term name=\"rule\"><single>rule</single><multiple>rules</multiple></term><term name=\"scene\"><single>scene</single><multiple>scenes</multiple></term><term name=\"table\"><single>table</single><multiple>tables</multiple></term><term name=\"timestamp\"><single></single><multiple></multiple></term><term name=\"title-locator\"><single>title</single><multiple>titles</multiple></term><term name=\"book\"><single>book</single><multiple>books</multiple></term><term name=\"chapter\"><single>chapter</single><multiple>chapters</multiple></term><term name=\"column\"><single>column</single><multiple>columns</multiple></term><term name=\"figure\"><single>figure</single><multiple>figures</multiple></term><term name=\"folio\"><single>folio</single><multiple>folios</multiple></term><term name=\"issue\"><single>number</single><multiple>numbers</multiple></term><term name=\"line\"><single>line</single><multiple>lines</multiple></term><term name=\"note\"><single>note</single><multiple>notes</multiple></term><term name=\"opus\"><single>opus</single><multiple>opera</multiple></term><term name=\"page\"><single>page</single><multiple>pages</multiple></term><term name=\"number-of-pages\"><single>page</single><multiple>pages</multiple></term><term name=\"paragraph\"><single>paragraph</single><multiple>paragraphs</multiple></term><term name=\"part\"><single>part</single><multiple>parts</multiple></term><term name=\"section\"><single>section</single><multiple>sections</multiple></term><term name=\"sub-verbo\"><single>sub verbo</single><multiple>sub verbis</multiple></term><term name=\"verse\"><single>verse</single><multiple>verses</multiple></term><term name=\"volume\"><single>volume</single><multiple>volumes</multiple></term><term name=\"appendix\"><single>app.</single><multiple>apps.</multiple></term><term name=\"article-locator\"><single>art.</single><multiple>arts.</multiple></term><term name=\"elocation\"><single>loc.</single><multiple>locs.</multiple></term><term name=\"equation\"><single>eq.</single><multiple>eqs.</multiple></term><term name=\"rule\"><single>r.</single><multiple>rr.</multiple></term><term name=\"scene\"><single>sc.</single><multiple>scs.</multiple></term><term name=\"table\"><single>tbl.</single><multiple>tbls.</multiple></term><term name=\"timestamp\"><single></single><multiple></multiple></term><term name=\"title-locator\"><single>tit.</single><multiple>tits.</multiple></term><term name=\"book\" form=\"short\"><single>bk.</single><multiple>bks.</multiple></term><term name=\"chapter\" form=\"short\"><single>chap.</single><multiple>chaps.</multiple></term><term name=\"column\" form=\"short\"><single>col.</single><multiple>cols.</multiple></term><term name=\"figure\" form=\"short\"><single>fig.</single><multiple>figs.</multiple></term><term name=\"folio\" form=\"short\"><single>fol.</single><multiple>fols.</multiple></term><term name=\"issue\" form=\"short\"><single>no.</single><multiple>nos.</multiple></term><term name=\"line\" form=\"short\"><single>l.</single><multiple>ll.</multiple></term><term name=\"note\" form=\"short\"><single>n.</single><multiple>nn.</multiple></term><term name=\"opus\" form=\"short\"><single>op.</single><multiple>opp.</multiple></term><term name=\"page\" form=\"short\"><single>p.</single><multiple>pp.</multiple></term><term name=\"number-of-pages\" form=\"short\"><single>p.</single><multiple>pp.</multiple></term><term name=\"paragraph\" form=\"short\"><single>para.</single><multiple>paras.</multiple></term><term name=\"part\" form=\"short\"><single>pt.</single><multiple>pts.</multiple></term><term name=\"section\" form=\"short\"><single>sec.</single><multiple>secs.</multiple></term><term name=\"sub-verbo\" form=\"short\"><single>s.v.</single><multiple>s.vv.</multiple></term><term name=\"verse\" form=\"short\"><single>v.</single><multiple>vv.</multiple></term><term name=\"volume\" form=\"short\"><single>vol.</single><multiple>vols.</multiple></term><term name=\"paragraph\" form=\"symbol\"><single></single><multiple>¶¶</multiple></term><term name=\"section\" form=\"symbol\"><single>§</single><multiple>§§</multiple></term><term name=\"chair\"><single>chair</single><multiple>chairs</multiple></term><term name=\"compiler\"><single>compiler</single><multiple>compilers</multiple></term><term name=\"contributor\"><single>contributor</single><multiple>contributors</multiple></term><term name=\"curator\"><single>curator</single><multiple>curators</multiple></term><term name=\"executive-producer\"><single>executive producer</single><multiple>executive producers</multiple></term><term name=\"guest\"><single>guest</single><multiple>guests</multiple></term><term name=\"host\"><single>host</single><multiple>hosts</multiple></term><term name=\"narrator\"><single>narrator</single><multiple>narrators</multiple></term><term name=\"organizer\"><single>organizer</single><multiple>organizers</multiple></term><term name=\"performer\"><single>performer</single><multiple>performers</multiple></term><term name=\"producer\"><single>producer</single><multiple>producers</multiple></term><term name=\"script-writer\"><single>writer</single><multiple>writers</multiple></term><term name=\"series-creator\"><single>series creator</single><multiple>series creators</multiple></term><term name=\"director\"><single>director</single><multiple>directors</multiple></term><term name=\"editor\"><single>editor</single><multiple>editors</multiple></term><term name=\"editorial-director\"><single>editor</single><multiple>editors</multiple></term><term name=\"illustrator\"><single>illustrator</single><multiple>illustrators</multiple></term><term name=\"translator\"><single>translator</single><multiple>translators</multiple></term><term name=\"editortranslator\"><single>editor &amp; translator</single><multiple>editors &amp; translators</multiple></term><term name=\"compiler\" form=\"short\"><single>comp.</single><multiple>comps.</multiple></term><term name=\"contributor\" form=\"short\"><single>contrib.</single><multiple>contribs.</multiple></term><term name=\"curator\" form=\"short\"><single>cur.</single><multiple>curs.</multiple></term><term name=\"executive-producer\" form=\"short\"><single>exec. prod.</single><multiple>exec. prods.</multiple></term><term name=\"narrator\" form=\"short\"><single>narr.</single><multiple>narrs.</multiple></term><term name=\"organizer\" form=\"short\"><single>org.</single><multiple>orgs.</multiple></term><term name=\"performer\" form=\"short\"><single>perf.</single><multiple>perfs.</multiple></term><term name=\"producer\" form=\"short\"><single>prod.</single><multiple>prods.</multiple></term><term name=\"script-writer\" form=\"short\"><single>writ.</single><multiple>writs.</multiple></term><term name=\"series-creator\" form=\"short\"><single>cre.</single><multiple>cres.</multiple></term><term name=\"director\" form=\"short\"><single>dir.</single><multiple>dirs.</multiple></term><term name=\"editor\" form=\"short\"><single>ed.</single><multiple>eds.</multiple></term><term name=\"editorial-director\" form=\"short\"><single>ed.</single><multiple>eds.</multiple></term><term name=\"illustrator\" form=\"short\"><single>ill.</single><multiple>ills.</multiple></term><term name=\"translator\" form=\"short\"><single>tran.</single><multiple>trans.</multiple></term><term name=\"editortranslator\" form=\"short\"><single>ed. &amp; tran.</single><multiple>eds. &amp; trans.</multiple></term><term name=\"chair\" form=\"verb\">chaired by</term><term name=\"compiler\" form=\"verb\">compiled by</term><term name=\"contributor\" form=\"verb\">with</term><term name=\"curator\" form=\"verb\">curated by</term><term name=\"executive-producer\" form=\"verb\">executive produced by</term><term name=\"guest\" form=\"verb\">with guest</term><term name=\"host\" form=\"verb\">hosted by</term><term name=\"narrator\" form=\"verb\">narrated by</term><term name=\"organizer\" form=\"verb\">organized by</term><term name=\"performer\" form=\"verb\">performed by</term><term name=\"producer\" form=\"verb\">produced by</term><term name=\"script-writer\" form=\"verb\">written by</term><term name=\"series-creator\" form=\"verb\">created by</term><term name=\"container-author\" form=\"verb\">by</term><term name=\"director\" form=\"verb\">directed by</term><term name=\"editor\" form=\"verb\">edited by</term><term name=\"editorial-director\" form=\"verb\">edited by</term><term name=\"illustrator\" form=\"verb\">illustrated by</term><term name=\"interviewer\" form=\"verb\">interview by</term><term name=\"recipient\" form=\"verb\">to</term><term name=\"reviewed-author\" form=\"verb\">by</term><term name=\"translator\" form=\"verb\">translated by</term><term name=\"editortranslator\" form=\"verb\">edited &amp; translated by</term><term name=\"compiler\" form=\"verb-short\">comp. by</term><term name=\"contributor\" form=\"verb-short\">w.</term><term name=\"curator\" form=\"verb-short\">cur. by</term><term name=\"executive-producer\" form=\"verb-short\">exec. prod. by</term><term name=\"guest\" form=\"verb-short\">w. guest</term><term name=\"host\" form=\"verb-short\">hosted by</term><term name=\"narrator\" form=\"verb-short\">narr. by</term><term name=\"organizer\" form=\"verb-short\">org. by</term><term name=\"performer\" form=\"verb-short\">perf. by</term><term name=\"producer\" form=\"verb-short\">prod. by</term><term name=\"script-writer\" form=\"verb-short\">writ. by</term><term name=\"series-creator\" form=\"verb-short\">cre. by</term><term name=\"director\" form=\"verb-short\">dir. by</term><term name=\"editor\" form=\"verb-short\">ed. by</term><term name=\"editorial-director\" form=\"verb-short\">ed. by</term><term name=\"illustrator\" form=\"verb-short\">illus. by</term><term name=\"translator\" form=\"verb-short\">trans. by</term><term name=\"editortranslator\" form=\"verb-short\">ed. &amp; trans. by</term><term name=\"month-01\">January</term><term name=\"month-02\">February</term><term name=\"month-03\">March</term><term name=\"month-04\">April</term><term name=\"month-05\">May</term><term name=\"month-06\">June</term><term name=\"month-07\">July</term><term name=\"month-08\">August</term><term name=\"month-09\">September</term><term name=\"month-10\">October</term><term name=\"month-11\">November</term><term name=\"month-12\">December</term><term name=\"month-01\" form=\"short\">Jan.</term><term name=\"month-02\" form=\"short\">Feb.</term><term name=\"month-03\" form=\"short\">Mar.</term><term name=\"month-04\" form=\"short\">Apr.</term><term name=\"month-05\" form=\"short\">May</term><term name=\"month-06\" form=\"short\">Jun.</term><term name=\"month-07\" form=\"short\">Jul.</term><term name=\"month-08\" form=\"short\">Aug.</term><term name=\"month-09\" form=\"short\">Sep.</term><term name=\"month-10\" form=\"short\">Oct.</term><term name=\"month-11\" form=\"short\">Nov.</term><term name=\"month-12\" form=\"short\">Dec.</term><term name=\"season-01\">Spring</term><term name=\"season-02\">Summer</term><term name=\"season-03\">Autumn</term><term name=\"season-04\">Winter</term></terms></locale>`,\n}\n\nconst locales = new util.Register(defaultLocales)\n\nconst fetchLocale = (lang) => {\n if (locales.has(lang)) {\n return locales.get(lang)\n } else {\n return locales.get('en-US')\n }\n}\n\nexport default fetchLocale\nexport { locales }\n","import { util } from '../core/index.js'\n\nconst defaultTemplates = {\n apa: `<?xml version=\"1.0\" encoding=\"utf-8\"?><style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"in-text\" version=\"1.0\" demote-non-dropping-particle=\"never\" page-range-format=\"expanded\"><info><title>American Psychological Association 7th edition</title><title-short>APA</title-short><id>http://www.zotero.org/styles/apa</id><link href=\"http://www.zotero.org/styles/apa\" rel=\"self\"/><link href=\"http://www.zotero.org/styles/apa-6th-edition\" rel=\"template\"/><link href=\"https://apastyle.apa.org/style-grammar-guidelines/references/examples\" rel=\"documentation\"/><author><name>Brenton M. Wiernik</name><email>zotero@wiernik.org</email></author><category citation-format=\"author-date\"/><category field=\"psychology\"/><category field=\"generic-base\"/><updated>2022-01-31T14:30:00+00:00</updated><rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights></info><locale xml:lang=\"en\"><terms><term name=\"editortranslator\" form=\"short\"><single>ed. &amp; trans.</single><multiple>eds. &amp; trans.</multiple></term><term name=\"translator\" form=\"short\">trans.</term><term name=\"interviewer\" form=\"short\"><single>interviewer</single><multiple>interviewers</multiple></term><term name=\"collection-editor\" form=\"short\"><single>ed.</single><multiple>eds.</multiple></term><term name=\"circa\" form=\"short\">ca.</term><term name=\"bc\"> B.C.E.</term><term name=\"ad\"> C.E.</term><term name=\"letter\">personal communication</term><term name=\"letter\" form=\"short\">letter</term><term name=\"issue\" form=\"long\"><single>issue</single><multiple>issues</multiple></term></terms></locale><locale xml:lang=\"af\"><terms><term name=\"letter\">persoonlike kommunikasie</term><term name=\"letter\" form=\"short\">brief</term></terms></locale><locale xml:lang=\"ar\"><terms><term name=\"letter\">اتصال شخصي</term><term name=\"letter\" form=\"short\">خطاب</term></terms></locale><locale xml:lang=\"bg\"><terms><term name=\"letter\">лична комуникация</term><term name=\"letter\" form=\"short\">писмо</term></terms></locale><locale xml:lang=\"ca\"><terms><term name=\"letter\">comunicació personal</term><term name=\"letter\" form=\"short\">carta</term></terms></locale><locale xml:lang=\"cs\"><terms><term name=\"letter\">osobní komunikace</term><term name=\"letter\" form=\"short\">dopis</term></terms></locale><locale xml:lang=\"cy\"><terms><term name=\"letter\">cyfathrebu personol</term><term name=\"letter\" form=\"short\">llythyr</term></terms></locale><locale xml:lang=\"da\"><terms><term name=\"et-al\">et al.</term><term name=\"letter\">personlig kommunikation</term><term name=\"letter\" form=\"short\">brev</term></terms></locale><locale xml:lang=\"de\"><terms><term name=\"et-al\">et al.</term><term name=\"letter\">persönliche Kommunikation</term><term name=\"letter\" form=\"short\">Brief</term></terms></locale><locale xml:lang=\"el\"><terms><term name=\"letter\">προσωπική επικοινωνία</term><term name=\"letter\" form=\"short\">επιστολή</term></terms></locale><locale xml:lang=\"es\"><terms><term name=\"from\">de</term><term name=\"letter\">comunicación personal</term><term name=\"letter\" form=\"short\">carta</term></terms></locale><locale xml:lang=\"et\"><terms><term name=\"letter\">isiklik suhtlus</term><term name=\"letter\" form=\"short\">kiri</term></terms></locale><locale xml:lang=\"eu\"><terms><term name=\"letter\">komunikazio pertsonala</term><term name=\"letter\" form=\"short\">gutuna</term></terms></locale><locale xml:lang=\"fa\"><terms><term name=\"letter\">ارتباط شخصی</term><term name=\"letter\" form=\"short\">نامه</term></terms></locale><locale xml:lang=\"fi\"><terms><term name=\"letter\">henkilökohtainen viestintä</term><term name=\"letter\" form=\"short\">kirje</term></terms></locale><locale xml:lang=\"fr\"><terms><term name=\"letter\">communication personnelle</term><term name=\"letter\" form=\"short\">lettre</term><term name=\"editor\" form=\"short\"><single>éd.</single><multiple>éds.</multiple></term></terms></locale><locale xml:lang=\"he\"><terms><term name=\"letter\">תקשורת אישית</term><term name=\"letter\" form=\"short\">מכתב</term></terms></locale><locale xml:lang=\"hr\"><terms><term name=\"letter\">osobna komunikacija</term><term name=\"letter\" form=\"short\">pismo</term></terms></locale><locale xml:lang=\"hu\"><terms><term name=\"letter\">személyes kommunikáció</term><term name=\"letter\" form=\"short\">levél</term></terms></locale><locale xml:lang=\"id\"><terms><term name=\"letter\">komunikasi pribadi</term><term name=\"letter\" form=\"short\">surat</term></terms></locale><locale xml:lang=\"is\"><terms><term name=\"letter\">persónuleg samskipti</term><term name=\"letter\" form=\"short\">bréf</term></terms></locale><locale xml:lang=\"it\"><terms><term name=\"letter\">comunicazione personale</term><term name=\"letter\" form=\"short\">lettera</term></terms></locale><locale xml:lang=\"ja\"><terms><term name=\"letter\">個人的なやり取り</term><term name=\"letter\" form=\"short\">手紙</term></terms></locale><locale xml:lang=\"ko\"><terms><term name=\"letter\">개인 서신</term><term name=\"letter\" form=\"short\">편지</term></terms></locale><locale xml:lang=\"la\"><terms><term name=\"letter\"/><term name=\"letter\" form=\"short\">epistula</term></terms></locale><locale xml:lang=\"lt\"><terms><term name=\"letter\">communicationis personalis</term><term name=\"letter\" form=\"short\"/></terms></locale><locale xml:lang=\"lv\"><terms><term name=\"letter\">personīga komunikācija</term><term name=\"letter\" form=\"short\">vēstule</term></terms></locale><locale xml:lang=\"mn\"><terms><term name=\"letter\">хувийн харилцаа холбоо</term><term name=\"letter\" form=\"short\">захиа</term></terms></locale><locale xml:lang=\"nb\"><terms><term name=\"et-al\">et al.</term><term name=\"letter\">personlig kommunikasjon</term><term name=\"letter\" form=\"short\">brev</term></terms></locale><locale xml:lang=\"nl\"><terms><term name=\"et-al\">et al.</term><term name=\"letter\">persoonlijke communicatie</term><term name=\"letter\" form=\"short\">brief</term></terms></locale><locale xml:lang=\"nn\"><terms><term name=\"et-al\">et al.</term><term name=\"letter\">personlig kommunikasjon</term><term name=\"letter\" form=\"short\">brev</term></terms></locale><locale xml:lang=\"pl\"><terms><term name=\"letter\">osobista komunikacja</term><term name=\"letter\" form=\"short\">list</term></terms></locale><locale xml:lang=\"pt\"><terms><term name=\"letter\">comunicação pessoal</term><term name=\"letter\" form=\"short\">carta</term></terms></locale><locale xml:lang=\"ro\"><terms><term name=\"letter\">comunicare personală</term><term name=\"letter\" form=\"short\">scrisoare</term></terms></locale><locale xml:lang=\"ru\"><terms><term name=\"letter\">личная переписка</term><term name=\"letter\" form=\"short\">письмо</term></terms></locale><locale xml:lang=\"sk\"><terms><term name=\"letter\">osobná komunikácia</term><term name=\"letter\" form=\"short\">list</term></terms></locale><locale xml:lang=\"sl\"><terms><term name=\"letter\">osebna komunikacija</term><term name=\"letter\" form=\"short\">pismo</term></terms></locale><locale xml:lang=\"sr\"><terms><term name=\"letter\">лична комуникација</term><term name=\"letter\" form=\"short\">писмо</term></terms></locale><locale xml:lang=\"sv\"><terms><term name=\"letter\">personlig kommunikation</term><term name=\"letter\" form=\"short\">brev</term></terms></locale><locale xml:lang=\"th\"><terms><term name=\"letter\">การสื่อสารส่วนบุคคล</term><term name=\"letter\" form=\"short\">จดหมาย</term></terms></locale><locale xml:lang=\"tr\"><terms><term name=\"letter\">kişisel iletişim</term><term name=\"letter\" form=\"short\">mektup</term></terms></locale><locale xml:lang=\"uk\"><terms><term name=\"letter\">особисте спілкування</term><term name=\"letter\" form=\"short\">лист</term></terms></locale><locale xml:lang=\"vi\"><terms><term name=\"letter\">giao tiếp cá nhân</term><term name=\"letter\" form=\"short\">thư</term></terms></locale><locale xml:lang=\"zh-CN\"><terms><term name=\"letter\">的私人交流</term><term name=\"letter\" form=\"short\">信函</term></terms></locale><locale xml:lang=\"zh-TW\"><terms><term name=\"letter\">私人通訊</term><term name=\"letter\" form=\"short\">信函</term></terms></locale><macro name=\"author-bib\"><names variable=\"composer\" delimiter=\", \"><name name-as-sort-order=\"all\" and=\"symbol\" sort-separator=\", \" initialize-with=\". \" delimiter=\", \" delimiter-precedes-last=\"always\"/><substitute><names variable=\"author\"/><names variable=\"illustrator\"/><names variable=\"director\"><name name-as-sort-order=\"all\" and=\"symbol\" sort-separator=\", \" initialize-with=\". \" delimiter=\", \" delimiter-precedes-last=\"always\"/><label form=\"long\" prefix=\" (\" suffix=\")\" text-case=\"title\"/></names><choose><if variable=\"container-title\"><choose><if type=\"book entry entry-dictionary entry-encyclopedia\" match=\"any\"><choose><if variable=\"title\"><group delimiter=\" \"><text macro=\"title\"/><text macro=\"parenthetical\"/></group></if><else><text macro=\"title-and-descriptions\"/></else></choose></if></choose></if></choose><names variable=\"editor\" delimiter=\", \"><name name-as-sort-order=\"all\" and=\"symbol\" sort-separator=\", \" initialize-with=\". \" delimiter=\", \" delimiter-precedes-last=\"always\"/><label form=\"short\" prefix=\" (\" suffix=\")\" text-case=\"title\"/></names><names variable=\"editorial-director\"><name name-as-sort-order=\"all\" and=\"symbol\" sort-separator=\", \" initialize-with=\". \" delimiter=\", \" delimiter-precedes-last=\"always\"/><label form=\"short\" prefix=\" (\" suffix=\")\" text-case=\"title\"/></names><names variable=\"collection-editor\"><name name-as-sort-order=\"all\" and=\"symbol\" sort-separator=\", \" initialize-with=\". \" delimiter=\", \" delimiter-precedes-last=\"always\"/><label form=\"short\" prefix=\" (\" suffix=\")\" text-case=\"title\"/></names><choose><if variable=\"title\"><group delimiter=\" \"><text macro=\"title\"/><text macro=\"parenthetical\"/></group></if><else><text macro=\"title-and-descriptions\"/></else></choose></substitute></names></macro><macro name=\"author-intext\"><choose><if type=\"bill legal_case legislation treaty\" match=\"any\"><text macro=\"title-intext\"/></if><else-if type=\"interview personal_communication\" match=\"any\"><choose><if variable=\"archive container-title DOI publisher URL\" match=\"none\"><group delimiter=\", \"><names variable=\"author\"><name and=\"symbol\" delimiter=\", \" initialize-with=\". \"/><substitute><text macro=\"title-intext\"/></substitute></names><text term=\"letter\"/></group></if><else><names variable=\"author\" delimiter=\", \"><name form=\"short\" and=\"symbol\" delimiter=\", \" initialize-with=\". \"/><substitute><text macro=\"title-intext\"/></substitute></names></else></choose></else-if><else><names variable=\"composer\" delimiter=\", \"><name form=\"short\" and=\"symbol\" delimiter=\", \" initialize-with=\". \"/><substitute><names variable=\"author\"/><names variable=\"illustrator\"/><names variable=\"director\"/><choose><if variable=\"container-title\"><choose><if type=\"book entry entry-dictionary entry-encyclopedia\" match=\"any\"><text macro=\"title-intext\"/></if></choose></if></choose><names variable=\"editor\"/><names variable=\"editorial-director\"/><text macro=\"title-intext\"/></substitute></names></else></choose></macro><macro name=\"date-bib\"><group delimiter=\" \" prefix=\"(\" suffix=\")\"><choose><if is-uncertain-date=\"issued\"><text term=\"circa\" form=\"short\"/></if></choose><group><choose><if variable=\"issued\"><date variable=\"issued\"><date-part name=\"year\"/></date><text variable=\"year-suffix\"/><choose><if type=\"article-magazine article-newspaper broadcast interview motion_picture pamphlet personal_communication post post-weblog song speech webpage\" match=\"any\"><date variable=\"issued\"><date-part prefix=\", \" name=\"month\"/><date-part prefix=\" \" name=\"day\"/></date></if><else-if type=\"paper-conference\"><choose><if variable=\"collection-editor editor editorial-director issue page volume\" match=\"none\"><date variable=\"issued\"><date-part prefix=\", \" name=\"month\"/><date-part prefix=\" \" name=\"day\"/></date></if></choose></else-if></choose></if><else-if variable=\"status\"><group><text variable=\"status\" text-case=\"lowercase\"/><text variable=\"year-suffix\" prefix=\"-\"/></group></else-if><else><text term=\"no date\" form=\"short\"/><text variable=\"year-suffix\" prefix=\"-\"/></else></choose></group></group></macro><macro name=\"date-sort-group\"><choose><if variable=\"issued\"><text value=\"1\"/></if><else-if variable=\"status\"><text value=\"2\"/></else-if><else><text value=\"0\"/></else></choose></macro><macro name=\"date-sort-date\"><date variable=\"issued\" form=\"numeric\"/></macro><macro name=\"date-intext\"><choose><if variable=\"issued\"><group delimiter=\"/\"><group delimiter=\" \"><choose><if is-uncertain-date=\"original-date\"><text term=\"circa\" form=\"short\"/></if></choose><date variable=\"original-date\"><date-part name=\"year\"/></date></group><group delimiter=\" \"><choose><if is-uncertain-date=\"issued\"><text term=\"circa\" form=\"short\"/></if></choose><group><choose><if type=\"interview personal_communication\" match=\"any\"><choose><if variable=\"archive container-title DOI publisher URL\" match=\"none\"><date variable=\"issued\" form=\"text\"/></if><else><date variable=\"issued\"><date-part name=\"year\"/></date></else></choose></if><else><date variable=\"issued\"><date-part name=\"year\"/></date></else></choose><text variable=\"year-suffix\"/></group></group></group></if><else-if variable=\"status\"><text variable=\"status\" text-case=\"lowercase\"/><text variable=\"year-suffix\" prefix=\"-\"/></else-if><else><text term=\"no date\" form=\"short\"/><text variable=\"year-suffix\" prefix=\"-\"/></else></choose></macro><macro name=\"title-and-descriptions\"><choose><if variable=\"title\"><group delimiter=\" \"><text macro=\"title\"/><text macro=\"parenthetical\"/><text macro=\"bracketed\"/></group></if><else><group delimiter=\" \"><text macro=\"bracketed\"/><text macro=\"parenthetical\"/></group></else></choose></macro><macro name=\"title\"><choose><if type=\"post webpage\" match=\"any\"><text variable=\"title\" font-style=\"italic\"/></if><else-if variable=\"container-title\" match=\"any\"><text variable=\"title\"/></else-if><else><choose><if type=\"article-journal article-magazine article-newspaper post-weblog review review-book\" match=\"any\"><text variable=\"title\" font-style=\"italic\"/></if><else-if type=\"paper-conference\"><choose><if variable=\"collection-editor editor editorial-director\" match=\"any\"><group delimiter=\": \" font-style=\"italic\"><text variable=\"title\"/><choose><if is-numeric=\"volume\" match=\"none\"><group delimiter=\" \"><label variable=\"volume\" form=\"short\" text-case=\"capitalize-first\"/><text variable=\"volume\"/></group></if></choose></group></if><else><text variable=\"title\" font-style=\"italic\"/></else></choose></else-if><else><group delimiter=\": \" font-style=\"italic\"><text variable=\"title\"/><choose><if is-numeric=\"volume\" match=\"none\"><group delimiter=\" \"><label variable=\"volume\" form=\"short\" text-case=\"capitalize-first\"/><text variable=\"volume\"/></group></if></choose></group></else></choose></else></choose></macro><macro name=\"title-intext\"><choose><if variable=\"title\" match=\"none\"><text macro=\"bracketed-intext\" prefix=\"[\" suffix=\"]\"/></if><else-if type=\"bill\"><choose><if variable=\"number container-title\" match=\"none\"><text variable=\"title\" form=\"short\" font-style=\"italic\" text-case=\"title\"/></if><else-if variable=\"title\"><text variable=\"title\" form=\"short\" text-case=\"title\"/></else-if><else><group delimiter=\" \"><text variable=\"genre\"/><group delimiter=\" \"><choose><if variable=\"chapter-number container-title\" match=\"none\"><text term=\"issue\" form=\"short\"/></if></choose><text variable=\"number\"/></group></group></else></choose></else-if><else-if type=\"legal_case\" match=\"any\"><text variable=\"title\" font-style=\"italic\"/></else-if><else-if type=\"legislation treaty\" match=\"any\"><text variable=\"title\" form=\"short\" text-case=\"title\"/></else-if><else-if type=\"post webpage\" match=\"any\"><text variable=\"title\" form=\"short\" font-style=\"italic\" text-case=\"title\"/></else-if><else-if variable=\"container-title\" match=\"any\"><text variable=\"title\" form=\"short\" quotes=\"true\" text-case=\"title\"/></else-if><else><text variable=\"title\" form=\"short\" font-style=\"italic\" text-case=\"title\"/></else></choose></macro><macro name=\"parenthetical\"><group prefix=\"(\" suffix=\")\"><choose><if type=\"patent\"><group delimiter=\" \"><text variable=\"authority\" form=\"short\"/><choose><if variable=\"genre\"><text variable=\"genre\" text-case=\"capitalize-first\"/></if><else><text value=\"patent\" text-case=\"capitalize-first\"/></else></choose><group delimiter=\" \"><text term=\"issue\" form=\"short\" text-case=\"capitalize-first\"/><text variable=\"number\"/></group></group></if><else-if type=\"post webpage\" match=\"any\"><group delimiter=\"; \"><text macro=\"secondary-contributors\"/><text macro=\"database-location\"/><text macro=\"number\"/><text macro=\"locators-booklike\"/></group></else-if><else-if variable=\"container-title\"><group delimiter=\"; \"><text macro=\"secondary-contributors\"/><choose><if type=\"broadcast graphic map motion_picture song\" match=\"any\"><text macro=\"number\"/></if></choose></group></else-if><else><group delimiter=\"; \"><text macro=\"secondary-contributors\"/><text macro=\"database-location\"/><text macro=\"number\"/><text macro=\"locators-booklike\"/></group></else></choose></group></macro><macro name=\"parenthetical-container\"><choose><if variable=\"container-title\" match=\"any\"><group prefix=\"(\" suffix=\")\"><group delimiter=\"; \"><text macro=\"database-location\"/><choose><if type=\"broadcast graphic map motion_picture song\" match=\"none\"><text macro=\"number\"/></if></choose><text macro=\"locators-booklike\"/></group></group></if></choose></macro><macro name=\"bracketed\"><group prefix=\"[\" suffix=\"]\"><choose><if variable=\"reviewed-author reviewed-title\" type=\"review review-book\" match=\"any\"><group delimiter=\"; \"><group delimiter=\", \"><group delimiter=\" \"><choose><if variable=\"number\" match=\"none\"><choose><if variable=\"genre\"><text variable=\"genre\" text-case=\"capitalize-first\"/></if><else-if variable=\"medium\"><text variable=\"medium\" text-case=\"capitalize-first\"/></else-if><else><text value=\"Review of\"/></else></choose></if><else><choose><if variable=\"medium\"><text variable=\"medium\" text-case=\"capitalize-first\"/></if><else><text value=\"Review of\"/></else></choose></else></choose><text macro=\"reviewed-title\"/></group><names variable=\"reviewed-author\"><label form=\"verb-short\" suffix=\" \"/><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/></names></group><choose><if variable=\"genre\" match=\"any\"><choose><if variable=\"number\" match=\"none\"><text variable=\"medium\" text-case=\"capitalize-first\"/></if></choose></if></choose></group></if><else-if type=\"thesis\"><group delimiter=\"; \"><choose><if variable=\"number\" match=\"none\"><group delimiter=\", \"><text variable=\"genre\" text-case=\"capitalize-first\"/><choose><if variable=\"archive DOI URL\" match=\"any\"><text variable=\"publisher\"/></if></choose></group></if></choose><text variable=\"medium\" text-case=\"capitalize-first\"/></group></else-if><else-if variable=\"interviewer\" type=\"interview\" match=\"any\"><choose><if variable=\"title\"><text macro=\"format\"/></if><else-if variable=\"genre\"><group delimiter=\"; \"><group delimiter=\" \"><text variable=\"genre\" text-case=\"capitalize-first\"/><group delimiter=\" \"><text term=\"author\" form=\"verb\"/><names variable=\"interviewer\"><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/></names></group></group></group></else-if><else-if variable=\"interviewer\"><group delimiter=\"; \"><names variable=\"interviewer\"><label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/></names><text variable=\"medium\" text-case=\"capitalize-first\"/></group></else-if><else><text macro=\"format\"/></else></choose></else-if><else-if type=\"personal_communication\"><choose><if variable=\"recipient\"><group delimiter=\"; \"><group delimiter=\" \"><choose><if variable=\"number\" match=\"none\"><choose><if variable=\"genre\"><text variable=\"genre\" text-case=\"capitalize-first\"/></if><else-if variable=\"medium\"><text variable=\"medium\" text-case=\"capitalize-first\"/></else-if><else><text term=\"letter\" form=\"short\" text-case=\"capitalize-first\"/></else></choose></if><else><choose><if variable=\"medium\"><text variable=\"medium\" text-case=\"capitalize-first\"/></if><else><text term=\"letter\" form=\"short\" text-case=\"capitalize-first\"/></else></choose></else></choose><names variable=\"recipient\" delimiter=\", \"><label form=\"verb\" suffix=\" \"/><name and=\"symbol\" delimiter=\", \"/></names></group><choose><if variable=\"genre\" match=\"any\"><choose><if variable=\"number\" match=\"none\"><text variable=\"medium\" text-case=\"capitalize-first\"/></if></choose></if></choose></group></if><else><text macro=\"format\"/></else></choose></else-if><else-if variable=\"composer\" type=\"song\" match=\"all\"><group delimiter=\"; \"><choose><if variable=\"number\" match=\"none\"><group delimiter=\" \"><choose><if variable=\"genre\"><text variable=\"genre\" text-case=\"capitalize-first\"/><names variable=\"author\" prefix=\"recorded by \"><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/></names></if><else-if variable=\"medium\"><text variable=\"medium\" text-case=\"capitalize-first\"/><names variable=\"author\" prefix=\"recorded by \"><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/></names></else-if><else><names variable=\"author\" prefix=\"Recorded by \"><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/></names></else></choose></group></if><else><group delimiter=\" \"><choose><if variable=\"medium\"><text variable=\"medium\" text-case=\"capitalize-first\"/><names variable=\"author\" prefix=\"recorded by \"><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/></names></if><else><names variable=\"author\" prefix=\"Recorded by \"><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/></names></else></choose></group></else></choose><choose><if variable=\"genre\" match=\"any\"><choose><if variable=\"number\" match=\"none\"><text variable=\"medium\" text-case=\"capitalize-first\"/></if></choose></if></choose></group></else-if><else-if variable=\"container-title\" match=\"none\"><text macro=\"format\"/></else-if><else><choose><if type=\"paper-conference speech\" match=\"any\"><choose><if variable=\"collection-editor editor editorial-director issue page volume\" match=\"any\"><text macro=\"format\"/></if></choose></if><else-if type=\"book\"><choose><if variable=\"version\" match=\"none\"><text macro=\"format\"/></if></choose></else-if><else-if type=\"report\" match=\"none\"><text macro=\"format\"/></else-if></choose></else></choose></group></macro><macro name=\"bracketed-intext\"><group prefix=\"[\" suffix=\"]\"><choose><if variable=\"reviewed-author reviewed-title\" type=\"review review-book\" match=\"any\"><text macro=\"reviewed-title-intext\" prefix=\"Review of \"/></if><else-if variable=\"interviewer\" type=\"interview\" match=\"any\"><names variable=\"interviewer\"><label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/><substitute><text macro=\"format-intext\"/></substitute></names></else-if><else-if type=\"personal_communication\"><choose><if variable=\"recipient\"><group delimiter=\" \"><choose><if variable=\"number\" match=\"none\"><text variable=\"genre\" text-case=\"capitalize-first\"/></if><else><text term=\"letter\" form=\"short\" text-case=\"capitalize-first\"/></else></choose><names variable=\"recipient\" delimiter=\", \"><label form=\"verb\" suffix=\" \"/><name and=\"symbol\" delimiter=\", \"/></names></group></if><else><text macro=\"format-intext\"/></else></choose></else-if><else><text macro=\"format-intext\"/></else></choose></group></macro><macro name=\"bracketed-container\"><group prefix=\"[\" suffix=\"]\"><choose><if type=\"paper-conference speech\" match=\"any\"><choose><if variable=\"collection-editor editor editorial-director issue page volume\" match=\"none\"><text macro=\"format\"/></if></choose></if><else-if type=\"book\" variable=\"version\" match=\"all\"><text macro=\"format\"/></else-if><else-if type=\"report\"><text macro=\"format\"/></else-if></choose></group></macro><macro name=\"secondary-contributors\"><choose><if type=\"article-journal article-magazine article-newspaper post-weblog review review-book\" match=\"any\"><text macro=\"secondary-contributors-periodical\"/></if><else-if type=\"paper-conference\"><choose><if variable=\"collection-editor editor editorial-director\" match=\"any\"><text macro=\"secondary-contributors-booklike\"/></if><else><text macro=\"secondary-contributors-periodical\"/></else></choose></else-if><else><text macro=\"secondary-contributors-booklike\"/></else></choose></macro><macro name=\"secondary-contributors-periodical\"><group delimiter=\"; \"><choose><if variable=\"title\"><names variable=\"interviewer\" delimiter=\"; \"><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/><label form=\"short\" prefix=\", \" text-case=\"title\"/></names></if></choose><names variable=\"translator\" delimiter=\"; \"><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/><label form=\"short\" prefix=\", \" text-case=\"title\"/></names></group></macro><macro name=\"secondary-contributors-booklike\"><group delimiter=\"; \"><choose><if variable=\"title\"><names variable=\"interviewer\"><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/><label form=\"short\" prefix=\", \" text-case=\"title\"/></names></if></choose><choose><if type=\"post webpage\" match=\"none\"><choose><if variable=\"container-title\" match=\"none\"><group delimiter=\"; \"><names variable=\"container-author\"><label form=\"verb-short\" suffix=\" \" text-case=\"title\"/><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/></names><names variable=\"editor translator\" delimiter=\"; \"><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/><label form=\"short\" prefix=\", \" text-case=\"title\"/></names></group></if></choose></if><else><group delimiter=\"; \"><names variable=\"container-author\"><label form=\"verb-short\" suffix=\" \" text-case=\"title\"/><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/></names><names variable=\"editor translator\" delimiter=\"; \"><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/><label form=\"short\" prefix=\", \" text-case=\"title\"/></names></group></else></choose></group></macro><macro name=\"database-location\"><choose><if variable=\"archive-place\" match=\"none\"><text variable=\"archive_location\"/></if></choose></macro><macro name=\"number\"><choose><if variable=\"number\"><group delimiter=\", \"><group delimiter=\" \"><text variable=\"genre\" text-case=\"title\"/><choose><if is-numeric=\"number\"><text term=\"issue\" form=\"short\" text-case=\"capitalize-first\"/><text variable=\"number\"/></if><else><text variable=\"number\"/></else></choose></group><choose><if type=\"thesis\"><choose><if variable=\"archive DOI URL\" match=\"any\"><text variable=\"publisher\"/></if></choose></if></choose></group></if></choose></macro><macro name=\"locators-booklike\"><choose><if type=\"article-journal article-magazine article-newspaper broadcast interview patent post post-weblog review review-book speech webpage\" match=\"any\"/><else-if type=\"paper-conference\"><choose><if variable=\"collection-editor editor editorial-director\" match=\"any\"><group delimiter=\", \"><text macro=\"version\"/><text macro=\"edition\"/><text macro=\"volume-booklike\"/></group></if></choose></else-if><else><group delimiter=\", \"><text macro=\"version\"/><text macro=\"edition\"/><text macro=\"volume-booklike\"/></group></else></choose></macro><macro name=\"version\"><choose><if is-numeric=\"version\"><group delimiter=\" \"><text term=\"version\" text-case=\"capitalize-first\"/><text variable=\"version\"/></group></if><else><text variable=\"version\"/></else></choose></macro><macro name=\"edition\"><choose><if is-numeric=\"edition\"><group delimiter=\" \"><number variable=\"edition\" form=\"ordinal\"/><label variable=\"edition\" form=\"short\"/></group></if><else><text variable=\"edition\"/></else></choose></macro><macro name=\"volume-booklike\"><group delimiter=\", \"><choose><if type=\"report\"><group delimiter=\" \"><text variable=\"collection-title\" text-case=\"title\"/><text variable=\"collection-number\"/></group></if></choose><choose><if variable=\"volume\" match=\"any\"><choose><if is-numeric=\"volume\" match=\"none\"/><else><group delimiter=\" \"><label variable=\"volume\" form=\"short\" text-case=\"capitalize-first\"/><number variable=\"volume\" form=\"numeric\"/></group></else></choose></if><else><group><text term=\"volume\" form=\"short\" text-case=\"capitalize-first\" suffix=\" \"/><text term=\"page-range-delimiter\" prefix=\"1\"/><number variable=\"number-of-volumes\" form=\"numeric\"/></group></else></choose><group delimiter=\" \"><label variable=\"issue\" text-case=\"capitalize-first\"/><text variable=\"issue\"/></group><group delimiter=\" \"><label variable=\"page\" form=\"short\" suffix=\" \"/><text variable=\"page\"/></group></group></macro><macro name=\"reviewed-title\"><choose><if variable=\"reviewed-title\"><text variable=\"reviewed-title\" font-style=\"italic\"/></if><else><text variable=\"title\" font-style=\"italic\"/></else></choose></macro><macro name=\"reviewed-title-intext\"><choose><if variable=\"reviewed-title\"><text variable=\"reviewed-title\" form=\"short\" font-style=\"italic\" text-case=\"title\"/></if><else><text variable=\"title\" form=\"short\" font-style=\"italic\" text-case=\"title\"/></else></choose></macro><macro name=\"format\"><choose><if variable=\"genre medium\" match=\"any\"><group delimiter=\"; \"><choose><if variable=\"number\" match=\"none\"><text variable=\"genre\" text-case=\"capitalize-first\"/></if></choose><text variable=\"medium\" text-case=\"capitalize-first\"/></group></if><else-if type=\"dataset\"><text value=\"Data set\"/></else-if><else-if type=\"book\" variable=\"version\" match=\"all\"><text value=\"Computer software\"/></else-if><else-if type=\"interview personal_communication\" match=\"any\"><choose><if variable=\"archive container-title DOI publisher URL\" match=\"none\"><text term=\"letter\" text-case=\"capitalize-first\"/></if><else-if type=\"interview\"><text term=\"interview\" text-case=\"capitalize-first\"/></else-if></choose></else-if><else-if type=\"map\"><text value=\"Map\"/></else-if></choose></macro><macro name=\"format-intext\"><choose><if variable=\"genre\" match=\"any\"><text variable=\"genre\" text-case=\"capitalize-first\"/></if><else-if variable=\"medium\"><text variable=\"medium\" text-case=\"capitalize-first\"/></else-if><else-if type=\"dataset\"><text value=\"Data set\"/></else-if><else-if type=\"book\" variable=\"version\" match=\"all\"><text value=\"Computer software\"/></else-if><else-if type=\"interview personal_communication\" match=\"any\"><choose><if variable=\"archive container-title DOI publisher URL\" match=\"none\"><text term=\"letter\" text-case=\"capitalize-first\"/></if><else-if type=\"interview\"><text term=\"interview\" text-case=\"capitalize-first\"/></else-if></choose></else-if><else-if type=\"map\"><text value=\"Map\"/></else-if></choose></macro><macro name=\"container\"><choose><if type=\"article-journal article-magazine article-newspaper post-weblog review review-book\" match=\"any\"><text macro=\"container-periodical\"/></if><else-if type=\"paper-conference\"><choose><if variable=\"editor editorial-director collection-editor container-author\" match=\"any\"><text macro=\"container-booklike\"/></if><else><text macro=\"container-periodical\"/></else></choose></else-if><else-if type=\"post webpage\" match=\"none\"><text macro=\"container-booklike\"/></else-if></choose></macro><macro name=\"container-periodical\"><group delimiter=\". \"><group delimiter=\", \"><text variable=\"container-title\" font-style=\"italic\" text-case=\"title\"/><choose><if variable=\"volume\"><group><text variable=\"volume\" font-style=\"italic\"/><text variable=\"issue\" prefix=\"(\" suffix=\")\"/></group></if><else><text variable=\"issue\" font-style=\"italic\"/></else></choose><choose><if variable=\"page\"><text variable=\"page\"/></if><else><text variable=\"number\" prefix=\"Article \"/></else></choose></group><choose><if variable=\"issued\"><choose><if variable=\"issue page volume\" match=\"none\"><text variable=\"status\" text-case=\"capitalize-first\"/></if></choose></if></choose></group></macro><macro name=\"container-booklike\"><choose><if variable=\"container-title\" match=\"any\"><group delimiter=\" \"><text term=\"in\" text-case=\"capitalize-first\"/><group delimiter=\", \"><names variable=\"editor translator\" delimiter=\", &amp; \"><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/><label form=\"short\" text-case=\"title\" prefix=\" (\" suffix=\")\"/><substitute><names variable=\"editorial-director\"/><names variable=\"collection-editor\"/><names variable=\"container-author\"/></substitute></names><group delimiter=\": \" font-style=\"italic\"><text variable=\"container-title\"/><choose><if is-numeric=\"volume\" match=\"none\"><group delimiter=\" \"><label variable=\"volume\" form=\"short\" text-case=\"capitalize-first\"/><text variable=\"volume\"/></group></if></choose></group></group><text macro=\"parenthetical-container\"/><text macro=\"bracketed-container\"/></group></if></choose></macro><macro name=\"publisher\"><group delimiter=\"; \"><choose><if type=\"thesis\"><choose><if variable=\"archive DOI URL\" match=\"none\"><text variable=\"publisher\"/></if></choose></if><else-if type=\"post webpage\" match=\"any\"><group delimiter=\"; \"><text variable=\"container-title\" text-case=\"title\"/><text variable=\"publisher\"/></group></else-if><else-if type=\"paper-conference\"><choose><if variable=\"collection-editor editor editorial-director\" match=\"any\"><text variable=\"publisher\"/></if></choose></else-if><else-if type=\"article-journal article-magazine article-newspaper post-weblog\" match=\"none\"><text variable=\"publisher\"/></else-if></choose><group delimiter=\", \"><choose><if variable=\"archive-place\"><text variable=\"archive_location\"/></if></choose><text variable=\"archive\"/><text variable=\"archive-place\"/></group></group></macro><macro name=\"access\"><choose><if variable=\"DOI\" match=\"any\"><text variable=\"DOI\" prefix=\"https://doi.org/\"/></if><else-if variable=\"URL\"><group delimiter=\" \"><choose><if variable=\"issued status\" match=\"none\"><group delimiter=\" \"><text term=\"retrieved\" text-case=\"capitalize-first\"/><date variable=\"accessed\" form=\"text\" suffix=\",\"/><text term=\"from\"/></group></if></choose><text variable=\"URL\"/></group></else-if></choose></macro><macro name=\"event\"><choose><if variable=\"event\"><choose><if variable=\"collection-editor editor editorial-director issue page volume\" match=\"none\"><group delimiter=\", \"><text variable=\"event\"/><text variable=\"event-place\"/></group></if></choose></if></choose></macro><macro name=\"publication-history\"><choose><if type=\"patent\" match=\"none\"><group prefix=\"(\" suffix=\")\"><choose><if variable=\"references\"><text variable=\"references\"/></if><else><group delimiter=\" \"><text value=\"Original work published\"/><choose><if is-uncertain-date=\"original-date\"><text term=\"circa\" form=\"short\"/></if></choose><date variable=\"original-date\"><date-part name=\"year\"/></date></group></else></choose></group></if><else><text variable=\"references\" prefix=\"(\" suffix=\")\"/></else></choose></macro><macro name=\"legal-cites\"><choose><if type=\"legal_case\"><group delimiter=\". \"><group delimiter=\", \"><text variable=\"title\"/><group delimiter=\" \"><text macro=\"container-legal\"/><text macro=\"date-legal\"/></group><text variable=\"references\"/></group><text macro=\"access\"/></group></if><else-if type=\"bill\"><group delimiter=\". \"><group delimiter=\", \"><choose><if variable=\"number container-title\" match=\"none\"><text variable=\"title\" font-style=\"italic\"/></if><else><text variable=\"title\"/></else></choose><group delimiter=\" \"><text macro=\"container-legal\"/><text macro=\"date-legal\"/><choose><if variable=\"number container-title\" match=\"none\"><names variable=\"author\" prefix=\"(testimony of \" suffix=\")\"><name and=\"symbol\" delimiter=\", \"/></names></if><else><text variable=\"status\" prefix=\"(\" suffix=\")\"/></else></choose></group><text variable=\"references\"/></group><text macro=\"access\"/></group></else-if><else-if type=\"legislation\"><group delimiter=\". \"><group delimiter=\", \"><text variable=\"title\"/><group delimiter=\" \"><text macro=\"container-legal\"/><text macro=\"date-legal\"/><text variable=\"status\" prefix=\"(\" suffix=\")\"/></group><text variable=\"references\"/></group><text macro=\"access\"/></group></else-if><else-if type=\"treaty\"><group delimiter=\", \"><text variable=\"title\" text-case=\"title\"/><names variable=\"author\"><name initialize-with=\".\" form=\"short\" delimiter=\"-\"/></names><text macro=\"date-legal\"/><text macro=\"container-legal\"/><text macro=\"access\"/></group></else-if></choose></macro><macro name=\"date-legal\"><choose><if type=\"legal_case\"><group prefix=\"(\" suffix=\")\" delimiter=\" \"><text variable=\"authority\"/><choose><if variable=\"container-title\" match=\"any\"><date variable=\"issued\" form=\"numeric\" date-parts=\"year\"/></if><else><date variable=\"issued\" form=\"text\"/></else></choose></group></if><else-if type=\"bill legislation\" match=\"any\"><group prefix=\"(\" suffix=\")\" delimiter=\" \"><group delimiter=\" \"><date variable=\"original-date\"><date-part name=\"year\"/></date><text term=\"and\" form=\"symbol\"/></group><date variable=\"issued\"><date-part name=\"year\"/></date></group></else-if><else-if type=\"treaty\"><date variable=\"issued\" form=\"text\"/></else-if></choose></macro><macro name=\"container-legal\"><choose><if type=\"legal_case\"><group delimiter=\" \"><choose><if variable=\"container-title\"><group delimiter=\" \"><text variable=\"volume\"/><text variable=\"container-title\"/><group delimiter=\" \"><text term=\"section\" form=\"symbol\"/><text variable=\"section\"/></group><choose><if variable=\"page page-first\" match=\"any\"><text variable=\"page-first\"/></if><else><text value=\"___\"/></else></choose></group></if><else><group delimiter=\" \"><choose><if is-numeric=\"number\"><text term=\"issue\" form=\"short\" text-case=\"capitalize-first\"/></if></choose><text variable=\"number\"/></group></else></choose></group></if><else-if type=\"bill\"><group delimiter=\", \"><group delimiter=\" \"><text variable=\"genre\"/><group delimiter=\" \"><choose><if variable=\"chapter-number container-title\" match=\"none\"><text term=\"issue\" form=\"short\"/></if></choose><text variable=\"number\"/></group></group><text variable=\"authority\"/><text variable=\"chapter-number\"/><group delimiter=\" \"><text variable=\"volume\"/><text variable=\"container-title\"/><text variable=\"page-first\"/></group></group></else-if><else-if type=\"legislation\"><choose><if variable=\"number\"><group delimiter=\", \"><text variable=\"number\" prefix=\"Pub. L. No. \"/><group delimiter=\" \"><text variable=\"volume\"/><text variable=\"container-title\"/><text variable=\"page-first\"/></group></group></if><else><group delimiter=\" \"><text variable=\"volume\"/><text variable=\"container-title\"/><choose><if variable=\"section\"><group delimiter=\" \"><text term=\"section\" form=\"symbol\"/><text variable=\"section\"/></group></if><else><text variable=\"page-first\"/></else></choose></group></else></choose></else-if><else-if type=\"treaty\"><group delimiter=\" \"><number variable=\"volume\"/><text variable=\"container-title\"/><choose><if variable=\"page page-first\" match=\"any\"><text variable=\"page-first\"/></if><else><group delimiter=\" \"><text term=\"issue\" form=\"short\" text-case=\"capitalize-first\"/><text variable=\"number\"/></group></else></choose></group></else-if></choose></macro><macro name=\"citation-locator\"><group delimiter=\" \"><choose><if locator=\"chapter\"><label variable=\"locator\" text-case=\"capitalize-first\"/></if><else><label variable=\"locator\" form=\"short\"/></else></choose><text variable=\"locator\"/></group></macro><citation et-al-min=\"3\" et-al-use-first=\"1\" disambiguate-add-year-suffix=\"true\" disambiguate-add-names=\"true\" disambiguate-add-givenname=\"true\" collapse=\"year\" givenname-disambiguation-rule=\"primary-name-with-initials\"><sort><key macro=\"author-bib\" names-min=\"3\" names-use-first=\"1\"/><key macro=\"date-sort-group\"/><key macro=\"date-sort-date\" sort=\"ascending\"/><key variable=\"status\"/></sort><layout prefix=\"(\" suffix=\")\" delimiter=\"; \"><group delimiter=\", \"><text macro=\"author-intext\"/><text macro=\"date-intext\"/><text macro=\"citation-locator\"/></group></layout></citation><bibliography hanging-indent=\"true\" et-al-min=\"21\" et-al-use-first=\"19\" et-al-use-last=\"true\" entry-spacing=\"0\" line-spacing=\"2\"><sort><key macro=\"author-bib\"/><key macro=\"date-sort-group\"/><key macro=\"date-sort-date\" sort=\"ascending\"/><key variable=\"status\"/><key macro=\"title\"/></sort><layout><choose><if type=\"bill legal_case legislation treaty\" match=\"any\"><choose><if variable=\"DOI URL\" match=\"any\"><text macro=\"legal-cites\"/></if><else><text macro=\"legal-cites\" suffix=\".\"/></else></choose></if><else><group delimiter=\" \"><group delimiter=\". \" suffix=\".\"><text macro=\"author-bib\"/><text macro=\"date-bib\"/><text macro=\"title-and-descriptions\"/><text macro=\"container\"/><text macro=\"event\"/><text macro=\"publisher\"/></group><text macro=\"access\"/><text macro=\"publication-history\"/></group></else></choose></layout></bibliography></style>`,\n}\nconst templates = new util.Register(defaultTemplates)\n\nconst fetchStyle = (style) => {\n if (templates.has(style)) {\n return templates.get(style)\n } else {\n return templates.get('apa')\n }\n}\n\nexport default fetchStyle\nexport { templates }\n","// @ts-nocheck\nimport CSL from 'citeproc'\n\nimport { templates } from './styles.js'\nimport { locales } from './locales.js'\n\n// BEGIN add sys function\nconst proxied = Symbol.for('proxied')\nconst getWrapperProxy = function (original) {\n const proxy = function (state, entry) {\n if (state.sys.wrapBibliographyEntry) {\n const [prefix, postfix] = state.sys.wrapBibliographyEntry(this.system_id)\n entry = [prefix, entry, postfix].join('')\n }\n return original.call(this, state, entry)\n }\n proxy[proxied] = true\n return proxy\n}\n\nfor (const format in CSL.Output.Formats) {\n const original = CSL.Output.Formats[format]['@bibliography/entry']\n\n /* istanbul ignore if: currently unreachable */\n if (!original || original[proxied]) {\n continue\n }\n\n CSL.Output.Formats[format]['@bibliography/entry'] = getWrapperProxy(original)\n}\n// END\n\n/**\n * @access private\n * @param {String} locale - locale code\n * @return {String} locale XML\n */\nfunction retrieveLocale(locale) {\n if (locales.has(locale)) {\n return locales.get(locale)\n }\n\n const unnormalised = locale.replace('-', '_')\n if (locales.has(unnormalised)) {\n return locales.get(unnormalised)\n }\n\n // Should only occur when a cs:style default-locale is unknown\n return {}\n}\n\n/**\n * Object containing CSL Engines\n *\n * @access private\n * @constant\n */\nconst engines = {}\n\n/**\n * Retrieve CSL parsing engine\n *\n * @access private\n *\n * @param {String} style - CSL style id\n * @param {String} lang - Language code\n * @param {String} template - CSL XML template\n * @param {module:output/csl~retrieveItem} retrieveItem - Code to retreive item\n * @param {module:output/csl~retrieveLocale} retrieveLocale - Code to retreive locale\n *\n * @return {Object} CSL Engine\n */\nconst fetchEngine = function (style, locale, styleXml, retrieveItem, retrieveLocale) {\n const engineHash = `${style}|${locale}`\n let engine\n\n if (engines[engineHash] instanceof CSL.Engine) {\n engine = engines[engineHash]\n engine.sys.retrieveItem = retrieveItem\n engine.sys.wrapBibliographyEntry = undefined\n engine.updateItems([])\n } else {\n engine = engines[engineHash] = new CSL.Engine(\n { retrieveLocale, retrieveItem },\n styleXml,\n locale,\n true\n )\n }\n\n return engine\n}\n\n/**\n * Prepare CSL parsing engine\n *\n * @access private\n *\n * @param {Array<CSL>} data\n * @param {String} templateName\n * @param {String} language\n * @param {String} format\n *\n * @return {Object} CSL Engine\n */\nconst prepareEngine = function (data, style, locale, format) {\n if (!CSL.Output.Formats[format] || !CSL.Output.Formats[format]['@bibliography/entry']) {\n throw new TypeError(`Cannot find format '${format}'`)\n }\n\n const items = data.reduce((store, entry) => {\n store[entry.id] = entry\n return store\n }, {})\n const template = templates.get(templates.has(style) ? style : 'apa')\n locale = locales.has(locale) ? locale : undefined\n\n const callback = function (key) {\n if (Object.prototype.hasOwnProperty.call(items, key)) {\n return items[key]\n } else {\n throw new Error(`Cannot find entry with id '${key}'`)\n }\n }\n\n const engine = fetchEngine(style, locale, template, callback, retrieveLocale)\n engine.setOutputFormat(format)\n\n return engine\n}\n\nexport default prepareEngine\nexport { fetchEngine }\n","// @ts-nocheck\nimport { util } from '../core/index.js'\nimport prepareEngine from './engines.js'\nimport { getPrefixedEntry } from './attr.js'\n\n/**\n * Get a rendered affix\n *\n * @access private\n *\n * @param {CSL} source - source element\n * @param {String|Cite~wrapper} affix\n *\n * @return {String} Rendered affixs\n */\nconst getAffix = (source, affix) => (typeof affix === 'function' ? affix(source) : affix || '')\n\n/**\n * This plugin adds the output format `bibliography`, and accepts the following specific options:\n *\n * * `prepend` (`String`, `Function`): prepend static or dynamic text to each entry\n * * `append` (`String`, `Function`): append static or dynamic text to each entry\n * * `nosort` (`Boolean`, default: `false`): do not sort according to the style-defined rules\n * * `asEntryArray` (`Boolean`, default: `false`): return an array of entries consisting of an id and the output for that individual entry\n *\n * Here's an example for `prepend` and `append`:\n *\n * ```js\n * let cite = new Cite({ id: 'a', title: 'Item A' })\n *\n * cite.format('bibliography', { append: ' [foobar]' })\n * // 'Item A. (n.d.). [foobar]\\n'\n *\n * cite.format('bibliography', { prepend (entry) { return `${entry.id}: ` } })\n * // 'a: Item A. (n.d.).\\n'\n * ```\n *\n * And here's another example, possibly more realistic:\n *\n * ```js\n * let cite = new Cite('Q30000000')\n *\n * let date = (new Date()).toLocaleDateString()\n *\n * cite.format('bibliography', {\n * format: 'html',\n * template: 'apa',\n * prepend (entry) {\n * return `[${entry.id}]: `\n * },\n * append: ` [Retrieved on ${date}]`\n * })\n *\n * // `<div class=\"csl-bib-body\">\n * // <div data-csl-entry-id=\"Q30000000\" class=\"csl-entry\">\n * // [Q30000000]: Miccadei, S., De Leo, R., Zammarchi, E., Natali, P. G., &#38; Civitareale, D. (2002). The Synergistic Activity of Thyroid Transcription Factor 1 and Pax 8 Relies on the Promoter/Enhancer Interplay. <i>Molecular Endocrinology</i>, <i>16</i>(4), 837846. https://doi.org/10.1210/MEND.16.4.0808 [Retrieved on 2018-7-10]\n * // </div>\n * // </div>`\n * ```\n *\n * This prepends `[$ID]: ` to each entry, where `$ID` is the ID of that entry, and appends ` [Retrieved on $DATE]`, where `$DATE` is today (constant for all entries).\n *\n * Here's an example for `asEntryArray`:\n *\n * ```js\n * const cite = new Cite([\n * { id: 'a', title: 'Item A', issued: { literal: 2021 } },\n * { id: 'b', title: 'Item B', issued: { literal: 2021 } }\n * ])\n *\n * cite.format('bibliography', { asEntryArray: true })\n * // [\n * // [\n * // \"a\"\n * // \"Item A. (2021).\\n\"\n * // ],\n * // [\n * // \"b\"\n * // \"Item B. (2021).\\n\"\n * // ]\n * // ]\n * ```\n *\n * @memberof module:@citation-js/plugin-csl.output\n * @implements module:@citation-js/core.plugins.output~formatter\n * @method bibliography\n *\n * @param {Array<CSL>} data\n * @param {Object} [options={}]\n * @param {String} [options.template='apa']\n * @param {String} [options.lang]\n * @param {String} [options.format='text']\n * @param {Booolean} [options.asEntryArray=false]\n * @param {Booolean} [options.nosort=false]\n * @param {String|Array<String>} [options.entry]\n * @param {Cite~wrapper} [options.prepend]\n * @param {Cite~wrapper} [options.append]\n *\n * @return {String} output\n */\nexport default function bibliography(data, options = {}) {\n const { template = 'apa', lang, format = 'text', nosort = false } = options\n const ids = options.entry ? [].concat(options.entry) : data.map(({ id }) => id)\n data = util.downgradeCsl(data)\n\n const citeproc = prepareEngine(data, template, lang, format)\n const sortedIds = citeproc.updateItems(ids, nosort)\n\n if (options.append || options.prepend) {\n const items = data.reduce((items, entry) => {\n items[entry.id] = entry\n return items\n }, {})\n\n citeproc.sys.wrapBibliographyEntry = function (id) {\n const entry = items[id]\n return [getAffix(entry, options.prepend), getAffix(entry, options.append)]\n }\n }\n\n const bibliography = citeproc.makeBibliography()\n const [{ bibstart, bibend }, bibBody] = bibliography\n const entries = bibBody.map((element, index) => getPrefixedEntry(element, sortedIds[index]))\n\n if (options.asEntryArray) {\n return entries.map((element, index) => [sortedIds[index], element])\n }\n\n return bibstart + entries.join('') + bibend\n}\n","// @ts-nocheck\nimport { util } from '../core/index.js'\nimport prepareEngine from './engines.js'\n\n/**\n * https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html#cite-items\n *\n * @typedef {Object} module:@citation-js/plugin-csl.output~CiteItem\n * @property {String} id\n */\n\n/**\n * https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html#citations\n *\n * @typedef {Object} module:@citation-js/plugin-csl.output~Citation\n * @property {Array<module:@citation-js/plugin-csl.output~CiteItem>} citationItems\n * @property {Object} properties\n * @property {Number} properties.noteIndex\n */\n\n/**\n * @access private\n * @param {String|module:@citation-js/plugin-csl.output~CiteItem} citeItem\n * @return {module:@citation-js/plugin-csl.output~CiteItem} citeItem\n */\nfunction prepareCiteItem(citeItem) {\n return typeof citeItem === 'object' ? citeItem : { id: citeItem }\n}\n\n/**\n * @access private\n * @param {String|Array<String>|Array<module:@citation-js/plugin-csl.output~CiteItem>|module:@citation-js/plugin-csl.output~CiteItem|module:@citation-js/plugin-csl.output~Citation} citation\n * @return {module:@citation-js/plugin-csl.output~Citation} citation\n */\nfunction prepareCitation(citation) {\n if (citation.citationItems) {\n return citation\n }\n\n return {\n citationItems: [].concat(citation).map(prepareCiteItem),\n properties: { noteIndex: 0 },\n }\n}\n\n/**\n * @access private\n * @param {Array<String>|Array<module:@citation-js/plugin-csl.output~CiteItem>|Array<module:@citation-js/plugin-csl.output~Citation>} [context=[]]\n * @return {Array<module:@citation-js/plugin-csl.output~Citation>} citations\n */\nfunction prepareCitations(context) {\n if (!context) {\n return []\n }\n return context.map(prepareCitation)\n}\n\n/**\n * Here's an example for `entry`:\n *\n * ```js\n * let cite = new Cite([\n * { id: 'a', title: 'Item A', issued: { 'date-parts': [[2016]] } },\n * { id: 'b', title: 'Item B', issued: { 'date-parts': [[2017]] } },\n * { id: 'c', title: 'Item C', issued: { 'date-parts': [[2018]] } }\n * ])\n *\n * cite.format('citation')\n * // '(“Item A,” 2016; “Item B,” 2017; “Item C,” 2018)'\n *\n * cite.format('citation', { entry: ['a', 'b'] })\n * // '(“Item A,” 2016; “Item B,” 2017)'\n *\n * cite.format('citation', { entry: 'a' })\n * // '(“Item A,” 2016)'\n *\n * cite.format('citation', { entry: [{ id: 'a', label: 'page', locator: 123 }] })\n * // '(“Item A,” 2016, p. 123)'\n * ```\n *\n * @memberof module:@citation-js/plugin-csl.output\n * @implements module:@citation-js/core.plugins.output~formatter\n * @method citation\n *\n * @param {Array<CSL>} data\n * @param {Object} [options={}]\n * @param {String} [options.template='apa']\n * @param {String} [options.lang]\n * @param {String} [options.format='text']\n * @param {module:@citation-js/plugin-csl.output~Entries} [options.entry] - list of ids or cite-items of entries to include in the citation (defaults to all)\n * @param {Array<String>} [options.citationsPre=[]]\n * @param {Array<String>} [options.citationsPost=[]]\n *\n * @return {String} output\n */\nexport default function citation(data, options = {}) {\n const { template = 'apa', lang, format = 'text' } = options\n const ids = data.map(({ id }) => id)\n const entries = options.entry ? options.entry : ids\n data = util.downgradeCsl(data)\n\n const citeproc = prepareEngine(data, template, lang, format)\n\n const before = prepareCitations(options.citationsPre)\n const citation = prepareCitation(entries)\n const after = prepareCitations(options.citationsPost)\n const output = citeproc.rebuildProcessorState([...before, citation, ...after], format, [])\n\n return output[before.length][2]\n}\n","// @ts-nocheck\n/**\n * ## Formats\n *\n * Formats and other features added by this plugin. General output options:\n *\n * * `template`: the style template to use. Currently, the following are built-in:\n * * `apa` (default)\n * * `vancouver`\n * * `harvard1`\n * * `lang`: the locale to use. Currently, the following are built-in:\n * * `en-US` (default)\n * * `es-ES`\n * * `de-DE`\n * * `fr-FR`\n * * `nl-NL`\n * * `format`: output (markup) format. Note: this doesn't support the output format dictionaries\n * * `entry` (`String`, `Array[String]`): entry ID or list of entry IDs to identify the items to cite\n *\n * For all formats and format-specific options, check out {@link module:@citation-js/plugin-csl.output}.\n *\n * @module @citation-js/plugin-csl\n */\n\n/**\n * @callback module:output/csl~retrieveItem\n * @param {String} id - Citation id\n * @return {CSL} CSL Citation object\n */\n\n/**\n * @callback module:output/csl~retrieveLocale\n * @param {String} lang - Language code\n * @return {String} CSL Locale\n */\n\n/**\n * @typedef {module:@citation-js/plugin-csl.output~Entry|Array<module:@citation-js/plugin-csl.output~Entry>} module:@citation-js/plugin-csl.output~Entries\n */\n\n/**\n * @typedef {String|module:@citation-js/plugin-csl.output~DetailedEntry} module:@citation-js/plugin-csl.output~Entry\n */\n\n/**\n * Corresponds directly to the {@link https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html#cite-items|cite-items of citeproc-js}.\n *\n * @typedef {Object} module:@citation-js/plugin-csl.output~DetailedEntry\n * @property {Number|String} [locator] - page, figure, section etc. number of the citation\n * @property {String} [label='page'] - type of locator to accompany the locator number\n * @property {Boolean} [suppress-author=false]\n * @property {Boolean} [author-only=false]\n * @property {String} [prefix]\n * @property {String} [suffix]\n */\n\nimport { plugins } from '../core/index.js'\n\nimport { locales } from './locales.js'\nimport { templates } from './styles.js'\nimport engine from './engines.js'\n\nimport bibliography from './bibliography.js'\nimport citation from './citation.js'\n\nplugins.add('@csl', {\n /**\n * @namespace output\n * @type Object<module:@citation-js/core.plugins.output~formatterName,module:@citation-js/core.plugins.output~formatter>\n * @memberof module:@citation-js/plugin-csl\n */\n output: {\n bibliography,\n citation,\n },\n\n /**\n * @namespace config\n * @memberof module:@citation-js/plugin-csl\n */\n config: {\n /**\n * The configuration object also exposes an internal method to prepare a Citeproc engine with given data and configuration:\n *\n * ```js\n * let config = plugins.config.get('@csl')\n *\n * let citeproc = plugins.engine(\n * [{ ... }], // data\n * 'apa', // style\n * 'en-US', // locale\n * 'html' // format\n * )\n *\n * let sortedIds = citeproc.updateItems(\n * [...] // data ids\n * )\n * let makeBibliography = citeproc.makeBibliography()\n * ```\n *\n * @memberof module:@citation-js/plugin-csl.config\n * @method engine\n * @param {module:@citation-js/core~CSL} data\n * @param {String} style\n * @param {String} locale\n * @param {String} format\n */\n engine,\n\n /**\n * Different [CSL Locales](https://github.com/citation-style-language/locales) can be registered like this:\n *\n * ```js\n * let language = 'en-GB'\n * let locale = '<?xml version=\"1.0\" encoding=\"utf-8\"?><locale ...>...</locale>' // The actual XML file\n *\n * let config = plugins.config.get('@csl')\n * config.locales.add(language, locale)\n *\n * let example = new Cite(...)\n * example.format('bibliography', {\n * format: 'html',\n * template: 'apa',\n * lang: language\n * })\n * ```\n *\n * @memberof module:@citation-js/plugin-csl.config\n * @var {module:@citation-js/core.util.Register} locales\n */\n locales,\n\n /**\n * Different [CSL Templates](https://github.com/citation-style-language/styles) can be registered like this:\n *\n * ```js\n * let templateName = 'custom'\n * let template = '<?xml version=\"1.0\" encoding=\"utf-8\"?><style ...>...</style>' // The actual XML file\n *\n * let config = plugins.config.get('@csl')\n * config.templates.add(templateName, template)\n *\n * let example = new Cite(...)\n * example.format('bibliography', {\n * format: 'html',\n * template: templateName,\n * lang: 'en-US'\n * })\n * ```\n *\n * @memberof module:@citation-js/plugin-csl.config\n * @var {module:@citation-js/core.util.Register} templates\n */\n templates,\n },\n})\n","/**\n * Add data-* attribute to a HTML string\n *\n * @access private\n *\n * @param {String} string - HTML string\n * @param {String} name - attribute name\n * @param {String} value - attribute value\n *\n * @return {String} HTML string with attribute\n */\nconst getAttributedEntry = (string, name, value) =>\n string.replace(/^\\s*<[a-z]+/i, `$& data-${name}=\"${value}\"`)\n\n/**\n * Add CSL identifiers to entry\n *\n * @access private\n *\n * @param {String} value - HTML string\n * @param {String} id - ID\n *\n * @return {String} HTML string with CSL ID\n */\nconst getPrefixedEntry = (value, id) => getAttributedEntry(value, 'csl-entry-id', id)\n\nexport { getAttributedEntry, getPrefixedEntry }\n","import yaml from 'js-yaml'\nimport { plugins } from '../core/index.js'\n\n// See https://github.com/nodeca/js-yaml/issues/569\nconst timestampTag = 'tag:yaml.org,2002:timestamp'\nconst timestamp = yaml.DEFAULT_SCHEMA.compiledTypeMap.scalar[timestampTag]\n\nconst date = new yaml.Type(timestampTag, {\n kind: 'scalar',\n resolve: timestamp.resolve,\n construct: timestamp.construct,\n instanceOf: Date,\n represent(object) {\n return object.toISOString().split('T')[0]\n },\n})\n\nconst CFF_SCHEMA = yaml.DEFAULT_SCHEMA.extend({\n implicit: [date],\n explicit: [],\n})\n\nplugins.add('@else', {\n input: {\n '@else/yaml': {\n parseType: {\n dataType: 'String',\n tokenList: {\n split: /\\n(\\s{2})*(-\\s)?/,\n token: /^[\\w-]*: /,\n every: false,\n },\n },\n parse(file) {\n return yaml.load(file, { json: true })\n },\n },\n },\n output: {\n yaml(data) {\n return yaml.dump(data, { schema: CFF_SCHEMA })\n },\n },\n})\n","import { plugins, util } from '../core/index.js'\nimport { parse as parseDate } from '@citation-js/date'\n\nimport '../plugin-yaml/index.js'\n\n/**\n * Format: Citation File Format (CFF) version 1.2.0\n * Spec: https://github.com/citation-file-format/citation-file-format/blob/1.2.0/schema-guide.md\n */\n\nconst TYPES_TO_TARGET = {\n art: 'graphic',\n article: 'article-journal', // more likely\n audiovisual: 'motion_picture',\n bill: 'bill',\n blog: 'post-weblog',\n book: 'book',\n catalogue: 'collection',\n conference: 'event',\n 'conference-paper': 'paper-conference',\n data: 'dataset',\n database: 'dataset',\n dictionary: 'entry-dictionary',\n 'edited-work': 'document', // unmapped\n encyclopedia: 'entry-encyclopedia',\n 'film-broadcast': 'broadcast',\n generic: 'document',\n 'government-document': 'regulation',\n grant: 'document', // unmapped\n hearing: 'hearing',\n 'historical-work': 'classic',\n 'legal-case': 'legal_case',\n 'legal-rule': 'legislation',\n 'magazine-article': 'article-magazine',\n manual: 'report', // substitute presented in the CSL specification\n map: 'map',\n multimedia: 'motion_picture',\n music: 'musical_score',\n 'newspaper-article': 'article-newspaper',\n pamphlet: 'pamphlet',\n patent: 'patent',\n 'personal-communication': 'personal_communication',\n proceedings: 'book', // substitute presented in the CSL specification\n report: 'report',\n serial: 'periodical',\n slides: 'speech',\n software: 'software',\n 'software-code': 'software',\n 'software-container': 'software',\n 'software-executable': 'software',\n 'software-virtual-machine': 'software',\n 'sound-recording': 'song',\n standard: 'standard',\n statute: 'legislation',\n thesis: 'thesis',\n unpublished: 'article',\n video: 'motion_picture',\n website: 'webpage',\n}\n\nconst TYPES_TO_SOURCE = {\n article: 'article',\n 'article-journal': 'article',\n 'article-magazine': 'magazine-article',\n 'article-newspaper': 'newspaper-article',\n bill: 'bill',\n book: 'book',\n broadcast: 'film-broadcast',\n chapter: 'generic', // unmapped\n classic: 'historical-work',\n collection: 'catalogue',\n dataset: 'data',\n document: 'generic',\n entry: 'generic', // unmapped\n 'entry-dictionary': 'dictionary',\n 'entry-encyclopedia': 'encyclopedia',\n event: 'conference',\n figure: 'generic', // unmapped\n graphic: 'art',\n hearing: 'hearing',\n interview: 'sound-recording',\n legal_case: 'legal-case',\n legislation: 'statute',\n manuscript: 'historical-work',\n map: 'map',\n motion_picture: 'film-broadcast',\n musical_score: 'music',\n pamphlet: 'pamphlet',\n 'paper-conference': 'conference-paper',\n patent: 'patent',\n performance: 'generic', // unmapped\n periodical: 'serial',\n personal_communication: 'personal-communication',\n post: 'serial',\n 'post-weblog': 'blog',\n regulation: 'government-document',\n report: 'report',\n review: 'generic', // unmapped\n 'review-book': 'generic', // unmapped\n software: 'software',\n song: 'sound-recording',\n speech: 'slides',\n standard: 'standard',\n thesis: 'thesis',\n treaty: 'generic',\n webpage: 'website',\n}\n\nconst ENTITY_PROPS = [\n { source: 'family-names', target: 'family' },\n { source: 'given-names', target: 'given' },\n { source: 'name-particle', target: 'non-dropping-particle' },\n { source: 'name-suffix', target: 'suffix' },\n { source: 'name', target: 'literal' },\n { source: 'orcid', target: '_orcid' },\n]\n\nconst entity = new util.Translator(ENTITY_PROPS)\n\nconst PROP_CONVERTERS = {\n names: {\n toTarget(names) {\n return names.map(entity.convertToTarget)\n },\n toSource(names) {\n return names.map(entity.convertToSource)\n },\n },\n publisher: {\n toTarget({ name, city, region, country }) {\n const place = [city, region, country].filter(Boolean).join(', ')\n return [name, place || undefined]\n },\n toSource(name, place) {\n const entity = { name }\n\n if (place) {\n // Parse the following:\n // - Country\n // - City, Country\n // - City, Region, Country\n const parts = place.split(', ')\n entity.country = parts.pop()\n if (parts.length === 2) {\n entity.region = parts.pop()\n }\n if (parts.length === 1) {\n entity.city = parts.pop()\n }\n }\n\n return entity\n },\n },\n date: {\n toTarget(date) {\n if (date instanceof Date) {\n return parseDate(date.toISOString())\n } else {\n return parseDate(new Date(date).toISOString())\n }\n },\n toSource(date) {\n if (date.raw) {\n return date.raw\n }\n const [year, month, day] = date['date-parts'][0]\n if (day) {\n return new Date(Date.UTC(year, month - 1, day))\n } else if (month) {\n return new Date(Date.UTC(year, month - 1))\n } else {\n return new Date(Date.UTC(year))\n }\n },\n },\n}\n\nconst SHARED_PROPS = [\n 'abstract',\n\n { source: 'authors', target: 'author', convert: PROP_CONVERTERS.names },\n\n // TODO cff: commit\n\n // TODO cff: contact\n\n {\n source: 'date-released',\n target: 'issued',\n when: { target: { type: 'software' } },\n convert: PROP_CONVERTERS.date,\n },\n\n { source: 'doi', target: 'DOI' },\n\n {\n source: 'identifiers',\n target: ['DOI', 'ISBN', 'ISSN', 'PMCID', 'PMID', 'URL'],\n convert: {\n toTarget(identifiers) {\n const newIdentifiers = Array(6).fill(undefined)\n for (const { type, value } of identifiers) {\n if (!this.doi && type === 'doi') {\n newIdentifiers[0] = value\n }\n if (!this.url && type === 'url') {\n newIdentifiers[5] = value\n }\n if (type === 'other' && value.startsWith('urn:isbn:')) {\n newIdentifiers[1] = value.slice(9)\n }\n if (type === 'other' && value.startsWith('urn:issn:')) {\n newIdentifiers[2] = value.slice(9)\n }\n if (type === 'other' && value.startsWith('pmcid:')) {\n newIdentifiers[3] = value.slice(6)\n }\n if (type === 'other' && value.startsWith('pmid:')) {\n newIdentifiers[4] = value.slice(5)\n }\n }\n return newIdentifiers\n },\n toSource(doi, isbn, issn, pmcid, pmid, url) {\n return [\n doi && { type: 'doi', value: doi },\n url && { type: 'url', value: url },\n\n isbn && { type: 'other', value: `urn:isbn:${isbn}` },\n issn && { type: 'other', value: `urn:issn:${issn}` },\n pmcid && { type: 'other', value: `pmcid:${pmcid}` },\n pmid && { type: 'other', value: `pmid:${pmid}` },\n ].filter(Boolean)\n },\n },\n },\n\n {\n source: 'keywords',\n target: 'keyword',\n convert: {\n toTarget(keywords) {\n return keywords.join(',')\n },\n toSource(keywords) {\n return keywords.split(/,\\s*/g)\n },\n },\n },\n\n // TODO cff: license\n // TODO cff: license-url\n\n // TODO cff: message *\n\n // TODO cff: repository\n // TODO cff: repository-code\n // TODO cff: repository-artifact\n\n {\n source: 'title',\n target: 'title',\n when: {\n source: { term: false, entry: false },\n target: {\n type(type) {\n return !['entry', 'entry-dictionary', 'entry-encyclopedia'].includes(type)\n },\n },\n },\n },\n\n {\n source: 'title',\n target: 'container-title',\n when: {\n source: { entry: true, journal: false },\n target: { type: ['entry'] },\n },\n },\n\n {\n source: 'title',\n target: 'container-title',\n when: {\n source: { term: true, journal: false },\n target: { type: ['entry-dictionary', 'entry-encyclopedia'] },\n },\n },\n\n { source: 'url', target: 'URL' },\n\n 'version',\n]\n\nconst MAIN_PROPS = [\n // TYPES\n {\n source: 'type',\n target: 'type',\n convert: {\n toSource(type) {\n return type === 'dataset' ? 'dataset' : 'software'\n },\n toTarget(type) {\n return type === 'dataset' ? 'dataset' : 'software'\n },\n },\n },\n\n // Include main mappings\n ...SHARED_PROPS,\n]\n\nconst REF_PROPS = [\n // Include main mappings\n ...SHARED_PROPS,\n\n // ABBREVIATION\n { source: 'abbreviation', target: 'title-short' },\n { source: 'abbreviation', target: 'shortTitle' },\n\n // COLLECTIONS\n // TODO cff: collection-doi\n // TODO cff: collection-type\n 'collection-title',\n\n // COMMUNICATION\n { source: 'recipients', target: 'recipient', convert: PROP_CONVERTERS.names },\n { source: 'senders', target: 'authors', convert: PROP_CONVERTERS.names },\n\n // CONFERENCE\n {\n source: 'conference',\n target: ['event-title', 'event-date', 'event-place', 'event'],\n convert: {\n toSource(name, date, place, nameFallback) {\n const entity = { name: name || nameFallback }\n\n if (place) {\n entity.location = place\n }\n if (date) {\n entity['date-start'] = PROP_CONVERTERS.date.toSource(date)\n\n if (date['date-parts'] && date['date-parts'].length === 2) {\n entity['date-end'] = PROP_CONVERTERS.date.toSource({\n 'date-parts': [date['date-parts'][1]],\n })\n }\n }\n\n return entity\n },\n toTarget(event) {\n return [\n event.name,\n parseDate(event['date-start'].toISOString(), event['date-end'].toISOString()),\n event.location,\n ]\n },\n },\n },\n\n // COPYRIGHT\n // TODO cff: contact\n // TODO cff: copyright\n\n // DATABASE\n { source: 'database', target: 'source' },\n // TODO cff: database-provider NOTE entity\n\n // DATE\n { source: 'date-accessed', target: 'accessed', convert: PROP_CONVERTERS.date },\n\n {\n source: 'date-downloaded',\n target: 'accessed',\n convert: PROP_CONVERTERS.date,\n when: { source: { 'date-accessed': false }, target: false },\n },\n\n {\n source: 'date-published',\n target: 'issued',\n convert: PROP_CONVERTERS.date,\n when: {\n source: { 'date-released': false },\n target() {\n return this.type !== 'book' || !this.version\n },\n },\n },\n\n {\n source: ['year', 'month'],\n target: 'issued',\n when: { source: { 'date-published': false, 'date-released': false, year: true } },\n convert: {\n toTarget(year, month) {\n const date = month ? [year, month] : [year]\n return { 'date-parts': [date] }\n },\n toSource(issued) {\n const [year, month] = issued['date-parts'][0]\n return [year, month]\n },\n },\n },\n\n {\n source: 'year-original',\n target: 'original-date',\n convert: {\n toTarget(year) {\n return { 'date-parts': [[year]] }\n },\n toSource(date) {\n return date['date-parts'][0][0]\n },\n },\n },\n\n // EDITION\n 'edition',\n\n // EDITORS\n { source: 'editors', target: 'editor', convert: PROP_CONVERTERS.names },\n { source: 'editors-series', target: 'collection-editor', convert: PROP_CONVERTERS.names },\n\n // ENTRY\n {\n source: 'entry',\n target: 'title',\n when: {\n source: { term: false },\n target: { type: 'entry' },\n },\n },\n {\n source: 'term',\n target: 'title',\n when: {\n target: { type: ['entry-dictionary', 'entry-encyclopedia'] },\n },\n },\n\n // FORMAT\n { source: 'format', target: 'dimensions' },\n 'medium',\n\n // GENRE\n {\n source: 'data-type',\n target: 'genre',\n when: {\n target: {\n type(type) {\n return type !== 'thesis'\n },\n },\n },\n },\n {\n source: 'thesis-type',\n target: 'genre',\n when: {\n source: { 'data-type': false },\n target: { type: 'thesis' },\n },\n },\n\n // IDENTIFIERS\n { source: 'isbn', target: 'ISBN' },\n { source: 'issn', target: 'ISSN' },\n // TODO cff: nihmsid\n { source: 'pmcid', target: 'PMCID' },\n\n // ISSUE\n 'issue',\n\n // JOURNAL\n { source: 'journal', target: 'container-title' },\n { source: 'volume-title', target: 'volume-title' },\n {\n source: 'issue-title',\n target: 'volume-title',\n when: {\n source: { 'volume-title': false },\n target: false,\n },\n },\n // TODO cff: issue-date\n\n // LANGUAGE\n {\n source: 'languages',\n target: 'language',\n when: {\n target: true,\n // NOTE: possible values not as strict in csl, so test (crudely) if the value is ok first\n source: {\n language(code) {\n return /[a-z]{2,3}/.test(code)\n },\n },\n },\n convert: {\n // NOTE: CSL can only hold one language\n toSource(language) {\n return [language]\n },\n toTarget(languages) {\n return languages[0]\n },\n },\n },\n\n // LOCATION\n {\n source: 'location',\n target: ['archive', 'archive-place'],\n convert: PROP_CONVERTERS.publisher,\n },\n\n // LOCATION (CODE)\n // TODO cff: filename\n // TODO cff: loc-start\n // TODO cff: loc-end\n\n // NOTES\n { source: 'notes', target: 'note', when: { source: { scope: false } } },\n { source: 'scope', target: 'note', when: { target: false } },\n\n // NUMBER\n 'number',\n\n // PATENT\n {\n source: 'patent-states',\n target: 'jurisdiction',\n // NOTE: CSL jurisdiction can contain more than just US states\n when: { target: false },\n convert: {\n toTarget(states) {\n return states.join(', ')\n },\n },\n },\n\n // PUBLISHER\n {\n source: ['institution', 'department'],\n target: ['publisher', 'publisher-place'],\n when: { source: { publisher: false }, target: { type: 'thesis' } },\n convert: {\n toTarget(institution, department) {\n const [name, place] = PROP_CONVERTERS.publisher.toTarget(institution)\n return [department ? `${department}, ${name}` : name, place]\n },\n toSource(name, place) {\n return [PROP_CONVERTERS.publisher.toSource(name, place)]\n },\n },\n },\n {\n source: 'publisher',\n target: ['publisher', 'publisher-place'],\n when: {\n target: {\n type(type) {\n return type !== 'thesis'\n },\n },\n },\n convert: PROP_CONVERTERS.publisher,\n },\n\n // SECTION\n 'section',\n\n // STATUS\n {\n source: 'status',\n target: 'status',\n when: {\n source: true,\n // NOTE: possible values not as strict in csl, so test if the value is ok first\n target: {\n status: [\n 'in-preparation',\n 'abstract',\n 'submitted',\n 'in-press',\n 'advance-online',\n 'preprint',\n ],\n },\n },\n },\n\n // PAGES\n { source: 'start', target: 'page-first', when: { target: { page: false } } },\n {\n source: ['start', 'end'],\n target: 'page',\n convert: {\n toTarget(start, end) {\n return end ? `${start}-${end}` : start\n },\n toSource(page) {\n const [start, end] = page.split('-')\n return end ? [start, end] : [start]\n },\n },\n },\n { source: 'pages', target: 'number-of-pages' },\n\n // TRANSLATORS\n { source: 'translators', target: 'translator', convert: PROP_CONVERTERS.names },\n\n // TYPES\n {\n source: 'type',\n target: 'type',\n convert: {\n toTarget(type) {\n return TYPES_TO_TARGET[type] || 'document'\n },\n toSource(type) {\n if (type === 'book' && this['event-title']) {\n return 'proceedings'\n }\n return TYPES_TO_SOURCE[type] || 'generic'\n },\n },\n },\n\n // VOLUMES\n 'volume',\n { source: 'number-volumes', target: 'number-of-volumes' },\n]\n\nconst mainTranslator = new util.Translator(MAIN_PROPS)\nconst refTranslator = new util.Translator(REF_PROPS)\nconst CFF_VERSION = '1.2.0'\n\n/** Add doi or url as unique id if available to make citation easy */\nfunction addId(entry) {\n if ('DOI' in entry) {\n entry.id = entry.DOI\n } else if ('URL' in entry) {\n entry.id = entry.URL.replace('http://', '').replace('https://', '')\n }\n}\n\nfunction parse(input) {\n const main = mainTranslator.convertToTarget(input)\n if (input['cff-version'] <= '1.1.0') {\n main.type = TYPES_TO_TARGET.software\n }\n main._cff_mainReference = true\n addId(main)\n\n const output = [main]\n if (input['preferred-citation']) {\n const preferredCitation = refTranslator.convertToTarget(input['preferred-citation'])\n addId(preferredCitation)\n output.push(preferredCitation)\n }\n\n if (Array.isArray(input.references)) {\n output.push(...input.references.map(refTranslator.convertToTarget))\n }\n\n return output\n}\n\nfunction format(input, options = {}) {\n input = input.slice()\n const {\n main,\n preferred,\n cffVersion = CFF_VERSION,\n message = 'Please cite the following works when using this software.',\n } = options\n\n let preferredCitation\n const preferredIndex = input.findIndex((entry) => preferred && entry.id === preferred)\n if (cffVersion >= '1.2.0' && preferredIndex > -1) {\n preferredCitation = refTranslator.convertToSource(...input.splice(preferredIndex, 1))\n }\n\n let mainIndex = input.findIndex((entry) => (main ? entry.id === main : entry._cff_mainReference))\n mainIndex = mainIndex > -1 ? mainIndex : 0\n const mainRef = input[mainIndex]\n ? mainTranslator.convertToSource(...input.splice(mainIndex, 1))\n : {}\n if (mainRef && cffVersion < '1.2.0') {\n delete mainRef.type\n }\n\n const cff = { 'cff-version': cffVersion, message, ...mainRef }\n\n if (preferredCitation) {\n cff['preferred-citation'] = preferredCitation\n }\n\n if (input.length) {\n cff.references = input.map(refTranslator.convertToSource)\n }\n\n return cff\n}\n\nplugins.add('@cff', {\n input: {\n '@cff/object': {\n parseType: {\n dataType: 'SimpleObject',\n propertyConstraint: {\n props: 'cff-version',\n },\n },\n parse,\n },\n },\n output: {\n cff(data, options = {}) {\n const output = format(data, options)\n if (options.type === 'object') {\n return output\n } else {\n return plugins.output.format('yaml', output)\n }\n },\n },\n})\n","import { Cite as CiteCore, plugins } from './citation-js/core/index.js'\nimport './citation-js/plugin-bibjson/index.js'\nimport './citation-js/plugin-bibtex/index.js'\nimport './citation-js/plugin-csl/index.js'\nimport './citation-js/plugin-cff/index.js'\n\nfunction clone(obj) {\n const copy = {}\n for (const key in obj) {\n copy[key] = typeof obj[key] === 'object' ? clone(obj[key]) : obj[key]\n }\n return copy\n}\n\nfunction Cite(data, opts) {\n if (!(this instanceof Cite)) {\n return new Cite(data, opts)\n }\n\n const self = new CiteCore(data, opts)\n this._options = self._options\n this.log = self.log\n this.data = self.data\n}\n\nCite.plugins = clone(plugins)\n\nexport default Cite\n"],"names":["log","length","versnum","this","currentVersion","data","options","image","constructor","JSON","parse","slice","retrieveVersion","number","push","stringify","_options","formats","types","styles","wrapperTypes","validateOutputOptions","TypeError","format","type","style","lang","append","prepend","includes","test","Error","validate","save","Object","assign","typeOf","thing","undefined","name","dataTypeOf","Array","isArray","applyGraph","entry","graph","_graph","index","findIndex","splice","removeGraph","logger","_output","level","scope","msg","_log","_levels","indexOf","_console","console","Console","process","stderr","dataTypes","unregExts","parseNativeTypes","input","dataType","every","matchType","typeList","predicate","extensions","addTypeParser","extends","extend","debug","parentTypeParser","removeTypeParser","typeLists","keys","map","key","filter","list","forEach","typeMatcher","TypeParser","validDataTypes","validateDataType","RangeError","validateParseType","RegExp","validateTokenList","tokenList","validatePropertyConstraint","propertyConstraint","validateElementConstraint","elementConstraint","validateExtends","parseTokenList","token","split","trim","testTokens","trimInput","part","parsePropertyConstraint","concat","props","match","value","some","prop","parseElementConstraint","constraint","parsePredicate","bind","getCombinedPredicate","predicates","getDataType","DataParser","parser","async","FormatParser","parsers","parseType","typeParser","dataParser","parseAsync","asyncDataParser","validateFormat","NAME","NAME_LIST","DATE","TYPE","entryTypes","article","bill","book","broadcast","chapter","classic","collection","dataset","document","event","figure","graphic","hearing","interview","legal_case","legislation","manuscript","motion_picture","musical_score","pamphlet","patent","performance","periodical","personal_communication","post","regulation","report","review","software","song","speech","standard","thesis","treaty","webpage","fieldTypes","author","chair","compiler","composer","contributor","curator","director","editor","guest","host","interviewer","illustrator","narrator","organizer","performer","producer","recipient","translator","accessed","container","issued","submitted","categories","custom","id","language","journalAbbreviation","shortTitle","abstract","annote","archive","archive_collection","archive_location","authority","dimensions","division","DOI","edition","genre","ISBN","ISSN","issue","jurisdiction","keyword","locator","medium","note","page","PMCID","PMID","printing","publisher","references","scale","section","source","status","supplement","title","URL","version","volume","correctName","bestGuessConversions","literal","given","family","parseName","correctDateParts","dateParts","isNaN","parseInt","correctField","fieldName","fieldType","nameList","names","Boolean","correctNameList","date","dp","range","_extends","correctDate","correctType","parseFloat","toString","parseCsl","clean","field","correction","upgradeCsl","item","downgradeCsl","deepCopy","seen","Set","has","copy","add","object","delete","lookup","revLookup","Arr","Uint8Array","code","i","charCodeAt","encodeChunk","uint8","start","end","num","output","join","buffer","offset","isLE","mLen","nBytes","e","m","eLen","eMax","eBias","nBits","d","s","NaN","Infinity","Math","pow","c","rt","abs","floor","LN2","customInspectSymbol","Symbol","exports","Buffer","SlowBuffer","alloc","INSPECT_MAX_BYTES","K_MAX_LENGTH","createBuffer","buf","setPrototypeOf","prototype","arg","encodingOrOffset","allocUnsafe","from","string","encoding","isEncoding","byteLength","actual","write","fromString","ArrayBuffer","isView","arrayView","isInstance","fromArrayBuffer","byteOffset","fromArrayLike","fromArrayView","SharedArrayBuffer","valueOf","b","obj","isBuffer","len","checked","numberIsNaN","fromObject","toPrimitive","assertSize","size","array","mustMatch","arguments","loweredCase","utf8ToBytes","base64ToBytes","toLowerCase","slowToString","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","swap","n","bidirectionalIndexOf","val","dir","arrayIndexOf","call","lastIndexOf","arr","indexSize","arrLength","valLength","String","read","readUInt16BE","foundIndex","found","j","hexWrite","Number","remaining","strLen","parsed","substr","utf8Write","blitBuffer","asciiWrite","str","byteArray","asciiToBytes","base64Write","ucs2Write","units","hi","utf16leToBytes","tmp","extraBytes","parts","maxChunkLength","len2","base64","min","res","secondByte","thirdByte","fourthByte","tempCodePoint","firstByte","codePoint","bytesPerSequence","codePoints","MAX_ARGUMENTS_LENGTH","fromCharCode","apply","decodeCodePointsArray","kMaxLength","TYPED_ARRAY_SUPPORT","proto","foo","typedArraySupport","error","defineProperty","enumerable","get","poolSize","fill","allocUnsafeSlow","_isBuffer","compare","a","x","y","pos","set","swap16","swap32","swap64","toLocaleString","equals","inspect","max","replace","target","thisStart","thisEnd","thisCopy","targetCopy","isFinite","toJSON","_arr","ret","out","hexSliceLookupTable","bytes","checkOffset","ext","checkInt","checkIEEE754","writeFloat","littleEndian","noAssert","ieee754","writeDouble","newBuf","subarray","readUintLE","readUIntLE","mul","readUintBE","readUIntBE","readUint8","readUInt8","readUint16LE","readUInt16LE","readUint16BE","readUint32LE","readUInt32LE","readUint32BE","readUInt32BE","readIntLE","readIntBE","readInt8","readInt16LE","readInt16BE","readInt32LE","readInt32BE","readFloatLE","readFloatBE","readDoubleLE","readDoubleBE","writeUintLE","writeUIntLE","writeUintBE","writeUIntBE","writeUint8","writeUInt8","writeUint16LE","writeUInt16LE","writeUint16BE","writeUInt16BE","writeUint32LE","writeUInt32LE","writeUint32BE","writeUInt32BE","writeIntLE","limit","sub","writeIntBE","writeInt8","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","writeFloatLE","writeFloatBE","writeDoubleLE","writeDoubleBE","targetStart","copyWithin","INVALID_BASE64_RE","leadSurrogate","b64","lens","validLen","getLens","placeHoldersLen","_byteLength","curByte","base64clean","src","dst","alphabet","table","i16","require$$0","syncFetch","args","request","Request","xhr","XMLHttpRequest","withCredentials","credentials","timeout","INTERNALS","open","method","url","useBinaryEncoding","responseType","overrideMimeType","header","headers","setRequestHeader","send","body","getAllResponseHeaders","response","Response","statusText","responseURL","redirected","REQ_UNSUPPORTED","HTTP_STATUS","SyncRequest","resource","init","option","Headers","cache","destination","integrity","mode","priority","redirect","referrer","referrerPolicy","clone","checkBody","SyncResponse","bodyUsed","ok","Body","mixin","getOwnPropertyNames","desc","getOwnPropertyDescriptor","arrayBuffer","consumeBody","blob","Blob","text","json","err","message","entries","pairs","values","iterator","global","module","Promise","globalThis","create","fetch","writable","self","support","viewClasses","isArrayBufferView","normalizeName","normalizeValue","iteratorFor","items","next","shift","done","consumed","reject","fileReaderReady","reader","resolve","onload","result","onerror","readBlobAsArrayBuffer","FileReader","promise","readAsArrayBuffer","bufferClone","view","_initBody","_bodyInit","_bodyText","isPrototypeOf","_bodyBlob","FormData","_bodyFormData","URLSearchParams","DataView","_bodyArrayBuffer","rejected","then","readAsText","chars","readArrayBufferAsText","formData","decode","oldValue","hasOwnProperty","callback","thisArg","methods","upcased","signal","toUpperCase","reParamSearch","Date","getTime","form","decodeURIComponent","bodyInit","redirectStatuses","location","DOMException","stack","aborted","abortXhr","abort","rawHeaders","line","responseText","setTimeout","ontimeout","onabort","href","fixUrl","addEventListener","onreadystatechange","readyState","removeEventListener","polyfill","factory","fetchId","prefix","random","fetchPolyfill","Register","remove","Grammar","rules","state","defaultState","mainRule","lexer","consumeRule","matchEndOfFile","matchToken","consumeToken","optional","SyntaxError","formatError","rule","pop","createConverter","toSource","Translator","CONVERT_TO_SOURCE","inputProp","outputProp","convert","condition","toTarget","when","createConditionEval","parsePropStatement","outputData","converted","cause","convertToSource","convertToTarget","CONVERT_TO_TARGET","ChainParser","generateGraph","forceType","maxChainLength","strict","iteration","iterate","typeInfo","getTypeInfo","outputs","reduce","last","count","element","prepareParseGraph","chain","parseData","chainAsync","parseDataAsync","catch","asyncParsers","nativeParsers","flat","@invalid","nativeAsyncParsers","all","dataAsync","hasDataParser","addDataParser","removeDataParser","csl","formatParser","asyncData","attachNode","children","parseInput","getIds","parseInputAsync","addAsync","getLabel","label","getComparisonValue","getName","compareProp","entryA","entryB","flip","sort","getSortCallback","register","formatter","formatData","parsedOptions","defaultOptions","styleType","styleFormat","newStyle","newType","formatOptions","template","_newOptions","createElement","innerHTML","firstChild","setAsync","Cite","staticMethods","html","bibliographyContainer","listItem","dict","entryName","wr_start","wr_end","en_start","en_end","ul_start","ul_end","li_start","li_end","configs","ref","config","registers","indices","plugins","mainIndex","typeIndex","typePlugins","typePlugin","substituters","empty","regex","subst","jQuery","textContent","HTMLElement","appendCommas","getJsonObject","getJsonValue","util","warn","getJson","ndjson","nameProps","person","firstname","lastname","firstName","lastName","identifiers","journalIdentifiers","idProps","upperCaseProp","identifier","typeMap","booklet","proceedings","mastersthesis","inbook","incollection","conference","inproceedings","manual","misc","online","phdthesis","techreport","unpublished","generalProps","reviewer","keywords","published","parseDate","year","journal","firstpage","pages","lastpage","link","cid","scraperLinks","authorNameFields","links","find","authors","records","metadata","root","moo","hasSticky","sticky","isRegExp","o","isObject","reUnion","regexps","regexpOrLiteral","ignoreCase","multiline","pad","ruleOptions","include","defaultType","lineBreaks","fallback","shouldThrow","toRules","spec","arrayToRules","objectToRules","defaultErrorRule","compileRules","hasStates","errorRule","fast","fastAllowed","unicodeFlag","groups","unicode","pat","regexp","exec","fallbackRule","flags","suffix","checkStateGroup","g","Lexer","states","startState","reset","info","col","queuedToken","queuedText","queuedThrow","setState","re","popState","pushState","eat","tokenToString","_getGroup","groupCount","queuedGroup","_token","group","charAt","lastIndex","matchNL","nl","LexerIterator","firstDisplayedLine","lastLineDigits","displayedLines","numLines","position","idx","substring","lastNLines","errorLines","lineNo","tokenType","compile","$all","ruleMap","included","newRules","k","newRule","fastKeys","freeze","isMap","Map","reverseMap","required","biblatex","mvbook","mvcollection","mvproceedings","electronic","www","bibtex","addendum","afterword","annotation","annotator","authortype","bookauthor","bookpagination","booksubtitle","booktitle","booktitleaddon","commentator","doi","editora","editorb","editorc","editortype","editoratype","editorbtype","editorctype","eid","entrysubtype","eprint","eprintclass","eprinttype","eventdate","eventtitle","eventtitleaddon","file","foreword","holder","howpublished","indextitle","institution","introduction","isan","isbn","ismn","isrn","issn","issuesubtitle","issuetitle","iswc","journalsubtitle","journaltitle","library","mainsubtitle","maintitle","maintitleaddon","month","nameaddon","organization","origdate","origlanguage","origlocation","origpublisher","origtitle","pagetotal","pagination","pubstate","reprinttitle","series","shortauthor","shorteditor","shorthand","shorthandintro","shortjournal","shortseries","shorttitle","subtitle","titleaddon","urldate","venue","volumes","crossref","entryset","execute","gender","langid","langidopts","ids","indexsorttitle","presort","related","relatedoptions","relatedtype","relatedstring","sortkey","sortname","sortshorthand","sorttitle","sortyear","xdata","xref","namea","nameb","namec","nameatype","namebtype","namectype","lista","listb","listc","listd","liste","listf","usera","userb","userc","userd","usere","userf","verba","verbb","verbc","address","archiveprefix","pdf","primaryclass","school","numpages","pmid","pmcid","diacritics","u","r","H","v","t","textcommabelow","commands","textquotesingle","textasciigrave","textquotedbl","textdollar","textless","textgreater","textbackslash","textasciicircum","textunderscore","textbraceleft","textbar","textbraceright","textasciitilde","textexclamdown","textcent","textsterling","textcurrency","textyen","textbrokenbar","textsection","textasciidieresis","textcopyright","textordfeminine","guillemetleft","guillemotleft","textlnot","textregistered","textasciimacron","textdegree","textpm","texttwosuperior","textthreesuperior","textasciiacute","textmu","textparagraph","textperiodcentered","textonesuperior","textordmasculine","guillemetright","guillemotright","textonequarter","textonehalf","textthreequarters","textquestiondown","AE","DH","texttimes","O","TH","ss","ae","dh","textdiv","th","DJ","dj","IJ","ij","L","l","NG","ng","OE","oe","textflorin","textasciicaron","textasciibreve","textacutedbl","textgravedbl","texttildelow","textbaht","SS","textcompwordmark","textendash","textemdash","textbardbl","textquoteleft","textquoteright","quotesinglbase","textquotedblleft","textquotedblright","quotedblbase","textdagger","textdaggerdbl","textbullet","textellipsis","textperthousand","textpertenthousand","guilsinglleft","guilsinglright","textreferencemark","textinterrobang","textfractionsolidus","textlquill","textrquill","textdiscount","textcolonmonetary","textlira","textnaira","textwon","textdong","texteuro","textpeso","textcelsius","textnumero","textcircledP","textrecipe","textservicemark","texttrademark","textohm","textmho","textestimated","textleftarrow","textuparrow","textrightarrow","textdownarrow","textminus","Hwithstroke","hwithstroke","textasteriskcentered","textsurd","textlangle","textrangle","textblank","textvisiblespace","textopenbullet","textbigcircle","textmusicalnote","textmarried","textdivorced","textinterrobangdown","copyright","Gamma","Delta","Theta","Lambda","Xi","Pi","Sigma","Phi","Psi","Omega","alpha","beta","gamma","delta","varepsilon","zeta","eta","theta","iota","kappa","lambda","mu","nu","xi","pi","rho","varsigma","sigma","tau","upsilon","varphi","chi","psi","omega","vartheta","Upsilon","phi","varpi","varrho","epsilon","defaultStrings","jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec","acmcs","acta","cacm","ibmjrd","ibmsj","ieeese","ieeetc","ieeetcad","ipl","jacm","jcss","scp","sicomp","tocs","tods","tog","toms","toois","toplas","tcs","formattingEnvs","it","itshape","sl","slshape","em","bf","bfseries","sc","scshape","rm","sf","tt","formattingCommands","textit","textsl","emph","mkbibitalic","mkbibemph","textbf","strong","mkbibbold","textsc","textsuperscript","textsubscript","enquote","mkbibquote","textmd","textrm","textsf","texttt","textup","formatting","italics","bold","superscript","subscript","smallcaps","nocase","quotes","argumentCommands","ElsevierGlyph","glyph","ligaturePattern","ligatures","mathScriptFormatting","sp","_","sb","mathrm","mathScripts","h","p","sentenceCaseLanguages","whitespace","comment","main","junk","at","otherEntryType","dataEntryType","otherEntryContents","lbrace","dataEntryContents","comma","fields","hash","quote","rbrace","quotedLiteral","bracedLiteral","delimiters","bibtexGrammar","Main","oldToken","Entry","openBrace","strings","properties","closeBrace","EntryBody","Field","Expression","ExpressionPart","QuoteString","BracketString","Text","bibTxtRegex","parseBibTxtEntry","pair","biblatexTypes","bookinbook","reference","mvreference","inreference","artwork","audio","legal","letter","movie","music","video","bibtexTypes","constants","sentenceCase","useIdAsLabel","stopWords","unsafeChars","firstWord","normalize","word","months","LABEL","MONTHS","january","february","march","april","june","july","august","september","october","november","december","TYPE_KEYS","bathesis","mathesis","candthesis","resreport","datacd","audiocd","patentde","patenteu","patentfr","patentuk","patentus","patreq","patreqde","patreqeu","patreqfr","patrequk","patrequs","STANDARD_NUMBERS_PATTERN","parseMonth","day","Converters","PICK","datePart","padStart","YEAR_MONTH","EPRINT","HOW_PUBLISHED","howPublished","startsWith","KEYWORDS","safeId","formatLabel","NAMES","STANDARD_NUMBERS","STATUS","TITLE","addon","nonSpec","formatDate","S2ID","subtype","typeKey","sourceType","EVENT_TITLE","PAGES","subType","targetType","_objectWithoutProperties","excluded","sourceKeys","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","_toPropertyKey","hint","prim","_toPrimitive","ownKeys","enumerableOnly","symbols","sym","_defineProperty","configurable","registry","parent","_parse","getOwnPropertyDescriptors","defineProperties","_objectSpread","_format","_spec$convertToSource","getStringCase","formatNameParts","piece","hyphenated","orderNamePieces","pieces","orderGiven","undecided","upperCase","unshift","orderNameParts","command","commandBegin","commandEnd","mathShift","stringLiteral","namesLiteral","and","hyphen","listLiteral","separatedLiteral","mathLiteral","script","applyFormatting","valueGrammar","StringNames","Name","NamePiece","NameToken","StringList","StringSeparated","StringVerbatim","StringUri","uri","decodeURI","encodeURI","StringTitleCase","_this$state","partlyLowercase","protectCase","MathString","char","ligature","afterPunctuation","_this$state2","first","otherCharacters","rest","restLowerCase","Command","commandToken","func","arity","Env","EnclosedEnv","beginEnv","endEnv","singleLanguageIsEnglish","getLexerState","languages","isEnglish","getMainRule","requirements","problems","missing","problem","parseEntryValues","parseValue","property","mapBiblatex","parseBibtex","mapBibtex","parseFile","parseEntries","diacritic","UNSAFE_UNICODE","DIACRITIC_PATTERN","listDelimiters","separated","richTextMappings","sup","escapeValue","subject","formatRichText","closingTags","tokens","formatSingleValue","valueType","formatName","listType","delimiter","formatted","formatList","formatEntryValues","formatValue","formatBibtex","formatEntry","mapper","opts","bibtxt","locales","templates","apa","proxied","for","getWrapperProxy","original","proxy","sys","wrapBibliographyEntry","postfix","system_id","CSL","Output","Formats","retrieveLocale","locale","unnormalised","engines","prepareEngine","store","engine","styleXml","retrieveItem","engineHash","Engine","updateItems","fetchEngine","setOutputFormat","getAffix","affix","prepareCiteItem","citeItem","prepareCitation","citation","citationItems","noteIndex","prepareCitations","context","bibliography","nosort","citeproc","sortedIds","makeBibliography","bibstart","bibend","bibBody","asEntryArray","before","citationsPre","after","citationsPost","rebuildProcessorState","timestampTag","timestamp","yaml","DEFAULT_SCHEMA","compiledTypeMap","scalar","Type","kind","construct","instanceOf","represent","toISOString","CFF_SCHEMA","implicit","explicit","load","dump","schema","TYPES_TO_TARGET","art","audiovisual","blog","catalogue","database","dictionary","encyclopedia","generic","grant","multimedia","serial","slides","statute","website","TYPES_TO_SOURCE","entity","PROP_CONVERTERS","city","region","country","place","raw","UTC","SHARED_PROPS","newIdentifiers","term","MAIN_PROPS","REF_PROPS","nameFallback","department","mainTranslator","refTranslator","CFF_VERSION","addId","CiteCore","_cff_mainReference","preferredCitation","cff","preferred","cffVersion","preferredIndex","mainRef"],"mappings":"gMAMA,WACE,YAAYA,IAAIC,MAClB,kBAWA,SAAyBC,EAAU,GACjC,GAAIA,GAAW,GAAKA,EAAUC,KAAKC,iBACjC,YACK,CACL,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