/* * Citation.js -0.4.0-10 taken from https://citation.js.org/ **** * NOTE: This JS lirary is incompatible with RequireJS since it also defines a global variable `require`. * To make this library compatible with MetacatUI, I renamed the `require` variable here to `citationRequire` */ citationRequire=(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof citationRequire&&citationRequire;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof citationRequire&&citationRequire,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(citationRequire,module,exports){ (function (global){ "use strict"; citationRequire("core-js/es6"); citationRequire("core-js/fn/array/includes"); citationRequire("core-js/fn/string/pad-start"); citationRequire("core-js/fn/string/pad-end"); citationRequire("core-js/fn/symbol/async-iterator"); citationRequire("core-js/fn/object/get-own-property-descriptors"); citationRequire("core-js/fn/object/values"); citationRequire("core-js/fn/object/entries"); citationRequire("core-js/fn/promise/finally"); citationRequire("core-js/web"); citationRequire("regenerator-runtime/runtime"); if (global._babelPolyfill && typeof console !== "undefined" && console.warn) { console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended " + "and may have consequences if different versions of the polyfills are applied sequentially. " + "If you do need to load the polyfill more than once, use @babel/polyfill/noConflict " + "instead to bypass the warning."); } global._babelPolyfill = true; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"core-js/es6":2,"core-js/fn/array/includes":3,"core-js/fn/object/entries":4,"core-js/fn/object/get-own-property-descriptors":5,"core-js/fn/object/values":6,"core-js/fn/promise/finally":7,"core-js/fn/string/pad-end":8,"core-js/fn/string/pad-start":9,"core-js/fn/symbol/async-iterator":10,"core-js/web":275,"regenerator-runtime/runtime":290}],2:[function(citationRequire,module,exports){ citationRequire('../modules/es6.symbol'); citationRequire('../modules/es6.object.create'); citationRequire('../modules/es6.object.define-property'); citationRequire('../modules/es6.object.define-properties'); citationRequire('../modules/es6.object.get-own-property-descriptor'); citationRequire('../modules/es6.object.get-prototype-of'); citationRequire('../modules/es6.object.keys'); citationRequire('../modules/es6.object.get-own-property-names'); citationRequire('../modules/es6.object.freeze'); citationRequire('../modules/es6.object.seal'); citationRequire('../modules/es6.object.prevent-extensions'); citationRequire('../modules/es6.object.is-frozen'); citationRequire('../modules/es6.object.is-sealed'); citationRequire('../modules/es6.object.is-extensible'); citationRequire('../modules/es6.object.assign'); citationRequire('../modules/es6.object.is'); citationRequire('../modules/es6.object.set-prototype-of'); citationRequire('../modules/es6.object.to-string'); citationRequire('../modules/es6.function.bind'); citationRequire('../modules/es6.function.name'); citationRequire('../modules/es6.function.has-instance'); citationRequire('../modules/es6.parse-int'); citationRequire('../modules/es6.parse-float'); citationRequire('../modules/es6.number.constructor'); citationRequire('../modules/es6.number.to-fixed'); citationRequire('../modules/es6.number.to-precision'); citationRequire('../modules/es6.number.epsilon'); citationRequire('../modules/es6.number.is-finite'); citationRequire('../modules/es6.number.is-integer'); citationRequire('../modules/es6.number.is-nan'); citationRequire('../modules/es6.number.is-safe-integer'); citationRequire('../modules/es6.number.max-safe-integer'); citationRequire('../modules/es6.number.min-safe-integer'); citationRequire('../modules/es6.number.parse-float'); citationRequire('../modules/es6.number.parse-int'); citationRequire('../modules/es6.math.acosh'); citationRequire('../modules/es6.math.asinh'); citationRequire('../modules/es6.math.atanh'); citationRequire('../modules/es6.math.cbrt'); citationRequire('../modules/es6.math.clz32'); citationRequire('../modules/es6.math.cosh'); citationRequire('../modules/es6.math.expm1'); citationRequire('../modules/es6.math.fround'); citationRequire('../modules/es6.math.hypot'); citationRequire('../modules/es6.math.imul'); citationRequire('../modules/es6.math.log10'); citationRequire('../modules/es6.math.log1p'); citationRequire('../modules/es6.math.log2'); citationRequire('../modules/es6.math.sign'); citationRequire('../modules/es6.math.sinh'); citationRequire('../modules/es6.math.tanh'); citationRequire('../modules/es6.math.trunc'); citationRequire('../modules/es6.string.from-code-point'); citationRequire('../modules/es6.string.raw'); citationRequire('../modules/es6.string.trim'); citationRequire('../modules/es6.string.iterator'); citationRequire('../modules/es6.string.code-point-at'); citationRequire('../modules/es6.string.ends-with'); citationRequire('../modules/es6.string.includes'); citationRequire('../modules/es6.string.repeat'); citationRequire('../modules/es6.string.starts-with'); citationRequire('../modules/es6.string.anchor'); citationRequire('../modules/es6.string.big'); citationRequire('../modules/es6.string.blink'); citationRequire('../modules/es6.string.bold'); citationRequire('../modules/es6.string.fixed'); citationRequire('../modules/es6.string.fontcolor'); citationRequire('../modules/es6.string.fontsize'); citationRequire('../modules/es6.string.italics'); citationRequire('../modules/es6.string.link'); citationRequire('../modules/es6.string.small'); citationRequire('../modules/es6.string.strike'); citationRequire('../modules/es6.string.sub'); citationRequire('../modules/es6.string.sup'); citationRequire('../modules/es6.date.now'); citationRequire('../modules/es6.date.to-json'); citationRequire('../modules/es6.date.to-iso-string'); citationRequire('../modules/es6.date.to-string'); citationRequire('../modules/es6.date.to-primitive'); citationRequire('../modules/es6.array.is-array'); citationRequire('../modules/es6.array.from'); citationRequire('../modules/es6.array.of'); citationRequire('../modules/es6.array.join'); citationRequire('../modules/es6.array.slice'); citationRequire('../modules/es6.array.sort'); citationRequire('../modules/es6.array.for-each'); citationRequire('../modules/es6.array.map'); citationRequire('../modules/es6.array.filter'); citationRequire('../modules/es6.array.some'); citationRequire('../modules/es6.array.every'); citationRequire('../modules/es6.array.reduce'); citationRequire('../modules/es6.array.reduce-right'); citationRequire('../modules/es6.array.index-of'); citationRequire('../modules/es6.array.last-index-of'); citationRequire('../modules/es6.array.copy-within'); citationRequire('../modules/es6.array.fill'); citationRequire('../modules/es6.array.find'); citationRequire('../modules/es6.array.find-index'); citationRequire('../modules/es6.array.species'); citationRequire('../modules/es6.array.iterator'); citationRequire('../modules/es6.regexp.constructor'); citationRequire('../modules/es6.regexp.to-string'); citationRequire('../modules/es6.regexp.flags'); citationRequire('../modules/es6.regexp.match'); citationRequire('../modules/es6.regexp.replace'); citationRequire('../modules/es6.regexp.search'); citationRequire('../modules/es6.regexp.split'); citationRequire('../modules/es6.promise'); citationRequire('../modules/es6.map'); citationRequire('../modules/es6.set'); citationRequire('../modules/es6.weak-map'); citationRequire('../modules/es6.weak-set'); citationRequire('../modules/es6.typed.array-buffer'); citationRequire('../modules/es6.typed.data-view'); citationRequire('../modules/es6.typed.int8-array'); citationRequire('../modules/es6.typed.uint8-array'); citationRequire('../modules/es6.typed.uint8-clamped-array'); citationRequire('../modules/es6.typed.int16-array'); citationRequire('../modules/es6.typed.uint16-array'); citationRequire('../modules/es6.typed.int32-array'); citationRequire('../modules/es6.typed.uint32-array'); citationRequire('../modules/es6.typed.float32-array'); citationRequire('../modules/es6.typed.float64-array'); citationRequire('../modules/es6.reflect.apply'); citationRequire('../modules/es6.reflect.construct'); citationRequire('../modules/es6.reflect.define-property'); citationRequire('../modules/es6.reflect.delete-property'); citationRequire('../modules/es6.reflect.enumerate'); citationRequire('../modules/es6.reflect.get'); citationRequire('../modules/es6.reflect.get-own-property-descriptor'); citationRequire('../modules/es6.reflect.get-prototype-of'); citationRequire('../modules/es6.reflect.has'); citationRequire('../modules/es6.reflect.is-extensible'); citationRequire('../modules/es6.reflect.own-keys'); citationRequire('../modules/es6.reflect.prevent-extensions'); citationRequire('../modules/es6.reflect.set'); citationRequire('../modules/es6.reflect.set-prototype-of'); module.exports = citationRequire('../modules/_core'); },{"../modules/_core":29,"../modules/es6.array.copy-within":127,"../modules/es6.array.every":128,"../modules/es6.array.fill":129,"../modules/es6.array.filter":130,"../modules/es6.array.find":132,"../modules/es6.array.find-index":131,"../modules/es6.array.for-each":133,"../modules/es6.array.from":134,"../modules/es6.array.index-of":135,"../modules/es6.array.is-array":136,"../modules/es6.array.iterator":137,"../modules/es6.array.join":138,"../modules/es6.array.last-index-of":139,"../modules/es6.array.map":140,"../modules/es6.array.of":141,"../modules/es6.array.reduce":143,"../modules/es6.array.reduce-right":142,"../modules/es6.array.slice":144,"../modules/es6.array.some":145,"../modules/es6.array.sort":146,"../modules/es6.array.species":147,"../modules/es6.date.now":148,"../modules/es6.date.to-iso-string":149,"../modules/es6.date.to-json":150,"../modules/es6.date.to-primitive":151,"../modules/es6.date.to-string":152,"../modules/es6.function.bind":153,"../modules/es6.function.has-instance":154,"../modules/es6.function.name":155,"../modules/es6.map":156,"../modules/es6.math.acosh":157,"../modules/es6.math.asinh":158,"../modules/es6.math.atanh":159,"../modules/es6.math.cbrt":160,"../modules/es6.math.clz32":161,"../modules/es6.math.cosh":162,"../modules/es6.math.expm1":163,"../modules/es6.math.fround":164,"../modules/es6.math.hypot":165,"../modules/es6.math.imul":166,"../modules/es6.math.log10":167,"../modules/es6.math.log1p":168,"../modules/es6.math.log2":169,"../modules/es6.math.sign":170,"../modules/es6.math.sinh":171,"../modules/es6.math.tanh":172,"../modules/es6.math.trunc":173,"../modules/es6.number.constructor":174,"../modules/es6.number.epsilon":175,"../modules/es6.number.is-finite":176,"../modules/es6.number.is-integer":177,"../modules/es6.number.is-nan":178,"../modules/es6.number.is-safe-integer":179,"../modules/es6.number.max-safe-integer":180,"../modules/es6.number.min-safe-integer":181,"../modules/es6.number.parse-float":182,"../modules/es6.number.parse-int":183,"../modules/es6.number.to-fixed":184,"../modules/es6.number.to-precision":185,"../modules/es6.object.assign":186,"../modules/es6.object.create":187,"../modules/es6.object.define-properties":188,"../modules/es6.object.define-property":189,"../modules/es6.object.freeze":190,"../modules/es6.object.get-own-property-descriptor":191,"../modules/es6.object.get-own-property-names":192,"../modules/es6.object.get-prototype-of":193,"../modules/es6.object.is":197,"../modules/es6.object.is-extensible":194,"../modules/es6.object.is-frozen":195,"../modules/es6.object.is-sealed":196,"../modules/es6.object.keys":198,"../modules/es6.object.prevent-extensions":199,"../modules/es6.object.seal":200,"../modules/es6.object.set-prototype-of":201,"../modules/es6.object.to-string":202,"../modules/es6.parse-float":203,"../modules/es6.parse-int":204,"../modules/es6.promise":205,"../modules/es6.reflect.apply":206,"../modules/es6.reflect.construct":207,"../modules/es6.reflect.define-property":208,"../modules/es6.reflect.delete-property":209,"../modules/es6.reflect.enumerate":210,"../modules/es6.reflect.get":213,"../modules/es6.reflect.get-own-property-descriptor":211,"../modules/es6.reflect.get-prototype-of":212,"../modules/es6.reflect.has":214,"../modules/es6.reflect.is-extensible":215,"../modules/es6.reflect.own-keys":216,"../modules/es6.reflect.prevent-extensions":217,"../modules/es6.reflect.set":219,"../modules/es6.reflect.set-prototype-of":218,"../modules/es6.regexp.constructor":220,"../modules/es6.regexp.flags":221,"../modules/es6.regexp.match":222,"../modules/es6.regexp.replace":223,"../modules/es6.regexp.search":224,"../modules/es6.regexp.split":225,"../modules/es6.regexp.to-string":226,"../modules/es6.set":227,"../modules/es6.string.anchor":228,"../modules/es6.string.big":229,"../modules/es6.string.blink":230,"../modules/es6.string.bold":231,"../modules/es6.string.code-point-at":232,"../modules/es6.string.ends-with":233,"../modules/es6.string.fixed":234,"../modules/es6.string.fontcolor":235,"../modules/es6.string.fontsize":236,"../modules/es6.string.from-code-point":237,"../modules/es6.string.includes":238,"../modules/es6.string.italics":239,"../modules/es6.string.iterator":240,"../modules/es6.string.link":241,"../modules/es6.string.raw":242,"../modules/es6.string.repeat":243,"../modules/es6.string.small":244,"../modules/es6.string.starts-with":245,"../modules/es6.string.strike":246,"../modules/es6.string.sub":247,"../modules/es6.string.sup":248,"../modules/es6.string.trim":249,"../modules/es6.symbol":250,"../modules/es6.typed.array-buffer":251,"../modules/es6.typed.data-view":252,"../modules/es6.typed.float32-array":253,"../modules/es6.typed.float64-array":254,"../modules/es6.typed.int16-array":255,"../modules/es6.typed.int32-array":256,"../modules/es6.typed.int8-array":257,"../modules/es6.typed.uint16-array":258,"../modules/es6.typed.uint32-array":259,"../modules/es6.typed.uint8-array":260,"../modules/es6.typed.uint8-clamped-array":261,"../modules/es6.weak-map":262,"../modules/es6.weak-set":263}],3:[function(citationRequire,module,exports){ citationRequire('../../modules/es7.array.includes'); module.exports = citationRequire('../../modules/_core').Array.includes; },{"../../modules/_core":29,"../../modules/es7.array.includes":264}],4:[function(citationRequire,module,exports){ citationRequire('../../modules/es7.object.entries'); module.exports = citationRequire('../../modules/_core').Object.entries; },{"../../modules/_core":29,"../../modules/es7.object.entries":265}],5:[function(citationRequire,module,exports){ citationRequire('../../modules/es7.object.get-own-property-descriptors'); module.exports = citationRequire('../../modules/_core').Object.getOwnPropertyDescriptors; },{"../../modules/_core":29,"../../modules/es7.object.get-own-property-descriptors":266}],6:[function(citationRequire,module,exports){ citationRequire('../../modules/es7.object.values'); module.exports = citationRequire('../../modules/_core').Object.values; },{"../../modules/_core":29,"../../modules/es7.object.values":267}],7:[function(citationRequire,module,exports){ 'use strict'; citationRequire('../../modules/es6.promise'); citationRequire('../../modules/es7.promise.finally'); module.exports = citationRequire('../../modules/_core').Promise['finally']; },{"../../modules/_core":29,"../../modules/es6.promise":205,"../../modules/es7.promise.finally":268}],8:[function(citationRequire,module,exports){ citationRequire('../../modules/es7.string.pad-end'); module.exports = citationRequire('../../modules/_core').String.padEnd; },{"../../modules/_core":29,"../../modules/es7.string.pad-end":269}],9:[function(citationRequire,module,exports){ citationRequire('../../modules/es7.string.pad-start'); module.exports = citationRequire('../../modules/_core').String.padStart; },{"../../modules/_core":29,"../../modules/es7.string.pad-start":270}],10:[function(citationRequire,module,exports){ citationRequire('../../modules/es7.symbol.async-iterator'); module.exports = citationRequire('../../modules/_wks-ext').f('asyncIterator'); },{"../../modules/_wks-ext":124,"../../modules/es7.symbol.async-iterator":271}],11:[function(citationRequire,module,exports){ module.exports = function (it) { if (typeof it != 'function') throw TypeError(it + ' is not a function!'); return it; }; },{}],12:[function(citationRequire,module,exports){ var cof = citationRequire('./_cof'); module.exports = function (it, msg) { if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg); return +it; }; },{"./_cof":25}],13:[function(citationRequire,module,exports){ // 22.1.3.31 Array.prototype[@@unscopables] var UNSCOPABLES = citationRequire('./_wks')('unscopables'); var ArrayProto = Array.prototype; if (ArrayProto[UNSCOPABLES] == undefined) citationRequire('./_hide')(ArrayProto, UNSCOPABLES, {}); module.exports = function (key) { ArrayProto[UNSCOPABLES][key] = true; }; },{"./_hide":47,"./_wks":125}],14:[function(citationRequire,module,exports){ module.exports = function (it, Constructor, name, forbiddenField) { if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { throw TypeError(name + ': incorrect invocation!'); } return it; }; },{}],15:[function(citationRequire,module,exports){ var isObject = citationRequire('./_is-object'); module.exports = function (it) { if (!isObject(it)) throw TypeError(it + ' is not an object!'); return it; }; },{"./_is-object":56}],16:[function(citationRequire,module,exports){ // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) 'use strict'; var toObject = citationRequire('./_to-object'); var toAbsoluteIndex = citationRequire('./_to-absolute-index'); var toLength = citationRequire('./_to-length'); module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { var O = toObject(this); var len = toLength(O.length); var to = toAbsoluteIndex(target, len); var from = toAbsoluteIndex(start, len); var end = arguments.length > 2 ? arguments[2] : undefined; var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); var inc = 1; if (from < to && to < from + count) { inc = -1; from += count - 1; to += count - 1; } while (count-- > 0) { if (from in O) O[to] = O[from]; else delete O[to]; to += inc; from += inc; } return O; }; },{"./_to-absolute-index":110,"./_to-length":114,"./_to-object":115}],17:[function(citationRequire,module,exports){ // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) 'use strict'; var toObject = citationRequire('./_to-object'); var toAbsoluteIndex = citationRequire('./_to-absolute-index'); var toLength = citationRequire('./_to-length'); module.exports = function fill(value /* , start = 0, end = @length */) { var O = toObject(this); var length = toLength(O.length); var aLen = arguments.length; var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); var end = aLen > 2 ? arguments[2] : undefined; var endPos = end === undefined ? length : toAbsoluteIndex(end, length); while (endPos > index) O[index++] = value; return O; }; },{"./_to-absolute-index":110,"./_to-length":114,"./_to-object":115}],18:[function(citationRequire,module,exports){ // false -> Array#indexOf // true -> Array#includes var toIObject = citationRequire('./_to-iobject'); var toLength = citationRequire('./_to-length'); var toAbsoluteIndex = citationRequire('./_to-absolute-index'); module.exports = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIObject($this); var length = toLength(O.length); var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare if (IS_INCLUDES && el != el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (;length > index; index++) if (IS_INCLUDES || index in O) { if (O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; },{"./_to-absolute-index":110,"./_to-iobject":113,"./_to-length":114}],19:[function(citationRequire,module,exports){ // 0 -> Array#forEach // 1 -> Array#map // 2 -> Array#filter // 3 -> Array#some // 4 -> Array#every // 5 -> Array#find // 6 -> Array#findIndex var ctx = citationRequire('./_ctx'); var IObject = citationRequire('./_iobject'); var toObject = citationRequire('./_to-object'); var toLength = citationRequire('./_to-length'); var asc = citationRequire('./_array-species-create'); module.exports = function (TYPE, $create) { var IS_MAP = TYPE == 1; var IS_FILTER = TYPE == 2; var IS_SOME = TYPE == 3; var IS_EVERY = TYPE == 4; var IS_FIND_INDEX = TYPE == 6; var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; var create = $create || asc; return function ($this, callbackfn, that) { var O = toObject($this); var self = IObject(O); var f = ctx(callbackfn, that, 3); var length = toLength(self.length); var index = 0; var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; var val, res; for (;length > index; index++) if (NO_HOLES || index in self) { val = self[index]; res = f(val, index, O); if (TYPE) { if (IS_MAP) result[index] = res; // map else if (res) switch (TYPE) { case 3: return true; // some case 5: return val; // find case 6: return index; // findIndex case 2: result.push(val); // filter } else if (IS_EVERY) return false; // every } } return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; }; }; },{"./_array-species-create":22,"./_ctx":31,"./_iobject":52,"./_to-length":114,"./_to-object":115}],20:[function(citationRequire,module,exports){ var aFunction = citationRequire('./_a-function'); var toObject = citationRequire('./_to-object'); var IObject = citationRequire('./_iobject'); var toLength = citationRequire('./_to-length'); module.exports = function (that, callbackfn, aLen, memo, isRight) { aFunction(callbackfn); var O = toObject(that); var self = IObject(O); var length = toLength(O.length); var index = isRight ? length - 1 : 0; var i = isRight ? -1 : 1; if (aLen < 2) for (;;) { if (index in self) { memo = self[index]; index += i; break; } index += i; if (isRight ? index < 0 : length <= index) { throw TypeError('Reduce of empty array with no initial value'); } } for (;isRight ? index >= 0 : length > index; index += i) if (index in self) { memo = callbackfn(memo, self[index], index, O); } return memo; }; },{"./_a-function":11,"./_iobject":52,"./_to-length":114,"./_to-object":115}],21:[function(citationRequire,module,exports){ var isObject = citationRequire('./_is-object'); var isArray = citationRequire('./_is-array'); var SPECIES = citationRequire('./_wks')('species'); module.exports = function (original) { var C; if (isArray(original)) { C = original.constructor; // cross-realm fallback if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; if (isObject(C)) { C = C[SPECIES]; if (C === null) C = undefined; } } return C === undefined ? Array : C; }; },{"./_is-array":54,"./_is-object":56,"./_wks":125}],22:[function(citationRequire,module,exports){ // 9.4.2.3 ArraySpeciesCreate(originalArray, length) var speciesConstructor = citationRequire('./_array-species-constructor'); module.exports = function (original, length) { return new (speciesConstructor(original))(length); }; },{"./_array-species-constructor":21}],23:[function(citationRequire,module,exports){ 'use strict'; var aFunction = citationRequire('./_a-function'); var isObject = citationRequire('./_is-object'); var invoke = citationRequire('./_invoke'); var arraySlice = [].slice; var factories = {}; var construct = function (F, len, args) { if (!(len in factories)) { for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']'; // eslint-disable-next-line no-new-func factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); } return factories[len](F, args); }; module.exports = Function.bind || function bind(that /* , ...args */) { var fn = aFunction(this); var partArgs = arraySlice.call(arguments, 1); var bound = function (/* args... */) { var args = partArgs.concat(arraySlice.call(arguments)); return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); }; if (isObject(fn.prototype)) bound.prototype = fn.prototype; return bound; }; },{"./_a-function":11,"./_invoke":51,"./_is-object":56}],24:[function(citationRequire,module,exports){ // getting tag from 19.1.3.6 Object.prototype.toString() var cof = citationRequire('./_cof'); var TAG = citationRequire('./_wks')('toStringTag'); // ES3 wrong here var ARG = cof(function () { return arguments; }()) == 'Arguments'; // fallback for IE11 Script Access Denied error var tryGet = function (it, key) { try { return it[key]; } catch (e) { /* empty */ } }; module.exports = function (it) { var O, T, B; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T // builtinTag case : ARG ? cof(O) // ES3 arguments fallback : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; }; },{"./_cof":25,"./_wks":125}],25:[function(citationRequire,module,exports){ var toString = {}.toString; module.exports = function (it) { return toString.call(it).slice(8, -1); }; },{}],26:[function(citationRequire,module,exports){ 'use strict'; var dP = citationRequire('./_object-dp').f; var create = citationRequire('./_object-create'); var redefineAll = citationRequire('./_redefine-all'); var ctx = citationRequire('./_ctx'); var anInstance = citationRequire('./_an-instance'); var forOf = citationRequire('./_for-of'); var $iterDefine = citationRequire('./_iter-define'); var step = citationRequire('./_iter-step'); var setSpecies = citationRequire('./_set-species'); var DESCRIPTORS = citationRequire('./_descriptors'); var fastKey = citationRequire('./_meta').fastKey; var validate = citationRequire('./_validate-collection'); var SIZE = DESCRIPTORS ? '_s' : 'size'; var getEntry = function (that, key) { // fast case var index = fastKey(key); var entry; if (index !== 'F') return that._i[index]; // frozen object case for (entry = that._f; entry; entry = entry.n) { if (entry.k == key) return entry; } }; module.exports = { getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { var C = wrapper(function (that, iterable) { anInstance(that, C, NAME, '_i'); that._t = NAME; // collection type that._i = create(null); // index that._f = undefined; // first entry that._l = undefined; // last entry that[SIZE] = 0; // size if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); }); redefineAll(C.prototype, { // 23.1.3.1 Map.prototype.clear() // 23.2.3.2 Set.prototype.clear() clear: function clear() { for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) { entry.r = true; if (entry.p) entry.p = entry.p.n = undefined; delete data[entry.i]; } that._f = that._l = undefined; that[SIZE] = 0; }, // 23.1.3.3 Map.prototype.delete(key) // 23.2.3.4 Set.prototype.delete(value) 'delete': function (key) { var that = validate(this, NAME); var entry = getEntry(that, key); if (entry) { var next = entry.n; var prev = entry.p; delete that._i[entry.i]; entry.r = true; if (prev) prev.n = next; if (next) next.p = prev; if (that._f == entry) that._f = next; if (that._l == entry) that._l = prev; that[SIZE]--; } return !!entry; }, // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) forEach: function forEach(callbackfn /* , that = undefined */) { validate(this, NAME); var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); var entry; while (entry = entry ? entry.n : this._f) { f(entry.v, entry.k, this); // revert to the last existing entry while (entry && entry.r) entry = entry.p; } }, // 23.1.3.7 Map.prototype.has(key) // 23.2.3.7 Set.prototype.has(value) has: function has(key) { return !!getEntry(validate(this, NAME), key); } }); if (DESCRIPTORS) dP(C.prototype, 'size', { get: function () { return validate(this, NAME)[SIZE]; } }); return C; }, def: function (that, key, value) { var entry = getEntry(that, key); var prev, index; // change existing entry if (entry) { entry.v = value; // create new entry } else { that._l = entry = { i: index = fastKey(key, true), // <- index k: key, // <- key v: value, // <- value p: prev = that._l, // <- previous entry n: undefined, // <- next entry r: false // <- removed }; if (!that._f) that._f = entry; if (prev) prev.n = entry; that[SIZE]++; // add to index if (index !== 'F') that._i[index] = entry; } return that; }, getEntry: getEntry, setStrong: function (C, NAME, IS_MAP) { // add .keys, .values, .entries, [@@iterator] // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 $iterDefine(C, NAME, function (iterated, kind) { this._t = validate(iterated, NAME); // target this._k = kind; // kind this._l = undefined; // previous }, function () { var that = this; var kind = that._k; var entry = that._l; // revert to the last existing entry while (entry && entry.r) entry = entry.p; // get next entry if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) { // or finish the iteration that._t = undefined; return step(1); } // return step by kind if (kind == 'keys') return step(0, entry.k); if (kind == 'values') return step(0, entry.v); return step(0, [entry.k, entry.v]); }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); // add [@@species], 23.1.2.2, 23.2.2.2 setSpecies(NAME); } }; },{"./_an-instance":14,"./_ctx":31,"./_descriptors":35,"./_for-of":44,"./_iter-define":60,"./_iter-step":62,"./_meta":69,"./_object-create":73,"./_object-dp":74,"./_redefine-all":92,"./_set-species":96,"./_validate-collection":122}],27:[function(citationRequire,module,exports){ 'use strict'; var redefineAll = citationRequire('./_redefine-all'); var getWeak = citationRequire('./_meta').getWeak; var anObject = citationRequire('./_an-object'); var isObject = citationRequire('./_is-object'); var anInstance = citationRequire('./_an-instance'); var forOf = citationRequire('./_for-of'); var createArrayMethod = citationRequire('./_array-methods'); var $has = citationRequire('./_has'); var validate = citationRequire('./_validate-collection'); var arrayFind = createArrayMethod(5); var arrayFindIndex = createArrayMethod(6); var id = 0; // fallback for uncaught frozen keys var uncaughtFrozenStore = function (that) { return that._l || (that._l = new UncaughtFrozenStore()); }; var UncaughtFrozenStore = function () { this.a = []; }; var findUncaughtFrozen = function (store, key) { return arrayFind(store.a, function (it) { return it[0] === key; }); }; UncaughtFrozenStore.prototype = { get: function (key) { var entry = findUncaughtFrozen(this, key); if (entry) return entry[1]; }, has: function (key) { return !!findUncaughtFrozen(this, key); }, set: function (key, value) { var entry = findUncaughtFrozen(this, key); if (entry) entry[1] = value; else this.a.push([key, value]); }, 'delete': function (key) { var index = arrayFindIndex(this.a, function (it) { return it[0] === key; }); if (~index) this.a.splice(index, 1); return !!~index; } }; module.exports = { getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { var C = wrapper(function (that, iterable) { anInstance(that, C, NAME, '_i'); that._t = NAME; // collection type that._i = id++; // collection id that._l = undefined; // leak store for uncaught frozen objects if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); }); redefineAll(C.prototype, { // 23.3.3.2 WeakMap.prototype.delete(key) // 23.4.3.3 WeakSet.prototype.delete(value) 'delete': function (key) { if (!isObject(key)) return false; var data = getWeak(key); if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key); return data && $has(data, this._i) && delete data[this._i]; }, // 23.3.3.4 WeakMap.prototype.has(key) // 23.4.3.4 WeakSet.prototype.has(value) has: function has(key) { if (!isObject(key)) return false; var data = getWeak(key); if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key); return data && $has(data, this._i); } }); return C; }, def: function (that, key, value) { var data = getWeak(anObject(key), true); if (data === true) uncaughtFrozenStore(that).set(key, value); else data[that._i] = value; return that; }, ufstore: uncaughtFrozenStore }; },{"./_an-instance":14,"./_an-object":15,"./_array-methods":19,"./_for-of":44,"./_has":46,"./_is-object":56,"./_meta":69,"./_redefine-all":92,"./_validate-collection":122}],28:[function(citationRequire,module,exports){ 'use strict'; var global = citationRequire('./_global'); var $export = citationRequire('./_export'); var redefine = citationRequire('./_redefine'); var redefineAll = citationRequire('./_redefine-all'); var meta = citationRequire('./_meta'); var forOf = citationRequire('./_for-of'); var anInstance = citationRequire('./_an-instance'); var isObject = citationRequire('./_is-object'); var fails = citationRequire('./_fails'); var $iterDetect = citationRequire('./_iter-detect'); var setToStringTag = citationRequire('./_set-to-string-tag'); var inheritIfcitationRequired = citationRequire('./_inherit-if-citationRequired'); module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { var Base = global[NAME]; var C = Base; var ADDER = IS_MAP ? 'set' : 'add'; var proto = C && C.prototype; var O = {}; var fixMethod = function (KEY) { var fn = proto[KEY]; redefine(proto, KEY, KEY == 'delete' ? function (a) { return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); } : KEY == 'has' ? function has(a) { return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); } : KEY == 'get' ? function get(a) { return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; } : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; } ); }; if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () { new C().entries().next(); }))) { // create collection constructor C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); redefineAll(C.prototype, methods); meta.NEED = true; } else { var instance = new C(); // early implementations not supports chaining var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); // most early implementations doesn't supports iterables, most modern - not close it correctly var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new // for early implementations -0 and +0 not the same var BUGGY_ZERO = !IS_WEAK && fails(function () { // V8 ~ Chromium 42- fails only with 5+ elements var $instance = new C(); var index = 5; while (index--) $instance[ADDER](index, index); return !$instance.has(-0); }); if (!ACCEPT_ITERABLES) { C = wrapper(function (target, iterable) { anInstance(target, C, NAME); var that = inheritIfcitationRequired(new Base(), target, C); if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); return that; }); C.prototype = proto; proto.constructor = C; } if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { fixMethod('delete'); fixMethod('has'); IS_MAP && fixMethod('get'); } if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); // weak collections should not contains .clear method if (IS_WEAK && proto.clear) delete proto.clear; } setToStringTag(C, NAME); O[NAME] = C; $export($export.G + $export.W + $export.F * (C != Base), O); if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); return C; }; },{"./_an-instance":14,"./_export":39,"./_fails":41,"./_for-of":44,"./_global":45,"./_inherit-if-citationRequired":50,"./_is-object":56,"./_iter-detect":61,"./_meta":69,"./_redefine":93,"./_redefine-all":92,"./_set-to-string-tag":97}],29:[function(citationRequire,module,exports){ var core = module.exports = { version: '2.5.7' }; if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef },{}],30:[function(citationRequire,module,exports){ 'use strict'; var $defineProperty = citationRequire('./_object-dp'); var createDesc = citationRequire('./_property-desc'); module.exports = function (object, index, value) { if (index in object) $defineProperty.f(object, index, createDesc(0, value)); else object[index] = value; }; },{"./_object-dp":74,"./_property-desc":91}],31:[function(citationRequire,module,exports){ // optional / simple context binding var aFunction = citationRequire('./_a-function'); module.exports = function (fn, that, length) { aFunction(fn); if (that === undefined) return fn; switch (length) { case 1: return function (a) { return fn.call(that, a); }; case 2: return function (a, b) { return fn.call(that, a, b); }; case 3: return function (a, b, c) { return fn.call(that, a, b, c); }; } return function (/* ...args */) { return fn.apply(that, arguments); }; }; },{"./_a-function":11}],32:[function(citationRequire,module,exports){ 'use strict'; // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() var fails = citationRequire('./_fails'); var getTime = Date.prototype.getTime; var $toISOString = Date.prototype.toISOString; var lz = function (num) { return num > 9 ? num : '0' + num; }; // PhantomJS / old WebKit has a broken implementations module.exports = (fails(function () { return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; }) || !fails(function () { $toISOString.call(new Date(NaN)); })) ? function toISOString() { if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value'); var d = this; var y = d.getUTCFullYear(); var m = d.getUTCMilliseconds(); var s = y < 0 ? '-' : y > 9999 ? '+' : ''; return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; } : $toISOString; },{"./_fails":41}],33:[function(citationRequire,module,exports){ 'use strict'; var anObject = citationRequire('./_an-object'); var toPrimitive = citationRequire('./_to-primitive'); var NUMBER = 'number'; module.exports = function (hint) { if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint'); return toPrimitive(anObject(this), hint != NUMBER); }; },{"./_an-object":15,"./_to-primitive":116}],34:[function(citationRequire,module,exports){ // 7.2.1 citationRequireObjectCoercible(argument) module.exports = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it); return it; }; },{}],35:[function(citationRequire,module,exports){ // Thank's IE8 for his funny defineProperty module.exports = !citationRequire('./_fails')(function () { return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; }); },{"./_fails":41}],36:[function(citationRequire,module,exports){ var isObject = citationRequire('./_is-object'); var document = citationRequire('./_global').document; // typeof document.createElement is 'object' in old IE var is = isObject(document) && isObject(document.createElement); module.exports = function (it) { return is ? document.createElement(it) : {}; }; },{"./_global":45,"./_is-object":56}],37:[function(citationRequire,module,exports){ // IE 8- don't enum bug keys module.exports = ( 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' ).split(','); },{}],38:[function(citationRequire,module,exports){ // all enumerable object keys, includes symbols var getKeys = citationRequire('./_object-keys'); var gOPS = citationRequire('./_object-gops'); var pIE = citationRequire('./_object-pie'); module.exports = function (it) { var result = getKeys(it); var getSymbols = gOPS.f; if (getSymbols) { var symbols = getSymbols(it); var isEnum = pIE.f; var i = 0; var key; while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); } return result; }; },{"./_object-gops":79,"./_object-keys":82,"./_object-pie":83}],39:[function(citationRequire,module,exports){ var global = citationRequire('./_global'); var core = citationRequire('./_core'); var hide = citationRequire('./_hide'); var redefine = citationRequire('./_redefine'); var ctx = citationRequire('./_ctx'); var PROTOTYPE = 'prototype'; var $export = function (type, name, source) { var IS_FORCED = type & $export.F; var IS_GLOBAL = type & $export.G; var IS_STATIC = type & $export.S; var IS_PROTO = type & $export.P; var IS_BIND = type & $export.B; var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); var key, own, out, exp; if (IS_GLOBAL) source = name; for (key in source) { // contains in native own = !IS_FORCED && target && target[key] !== undefined; // export native or passed out = (own ? target : source)[key]; // bind timers to global for call from export context exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; // extend global if (target) redefine(target, key, out, type & $export.U); // export if (exports[key] != out) hide(exports, key, exp); if (IS_PROTO && expProto[key] != out) expProto[key] = out; } }; global.core = core; // type bitmap $export.F = 1; // forced $export.G = 2; // global $export.S = 4; // static $export.P = 8; // proto $export.B = 16; // bind $export.W = 32; // wrap $export.U = 64; // safe $export.R = 128; // real proto method for `library` module.exports = $export; },{"./_core":29,"./_ctx":31,"./_global":45,"./_hide":47,"./_redefine":93}],40:[function(citationRequire,module,exports){ var MATCH = citationRequire('./_wks')('match'); module.exports = function (KEY) { var re = /./; try { '/./'[KEY](re); } catch (e) { try { re[MATCH] = false; return !'/./'[KEY](re); } catch (f) { /* empty */ } } return true; }; },{"./_wks":125}],41:[function(citationRequire,module,exports){ module.exports = function (exec) { try { return !!exec(); } catch (e) { return true; } }; },{}],42:[function(citationRequire,module,exports){ 'use strict'; var hide = citationRequire('./_hide'); var redefine = citationRequire('./_redefine'); var fails = citationRequire('./_fails'); var defined = citationRequire('./_defined'); var wks = citationRequire('./_wks'); module.exports = function (KEY, length, exec) { var SYMBOL = wks(KEY); var fns = exec(defined, SYMBOL, ''[KEY]); var strfn = fns[0]; var rxfn = fns[1]; if (fails(function () { var O = {}; O[SYMBOL] = function () { return 7; }; return ''[KEY](O) != 7; })) { redefine(String.prototype, KEY, strfn); hide(RegExp.prototype, SYMBOL, length == 2 // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) // 21.2.5.11 RegExp.prototype[@@split](string, limit) ? function (string, arg) { return rxfn.call(string, this, arg); } // 21.2.5.6 RegExp.prototype[@@match](string) // 21.2.5.9 RegExp.prototype[@@search](string) : function (string) { return rxfn.call(string, this); } ); } }; },{"./_defined":34,"./_fails":41,"./_hide":47,"./_redefine":93,"./_wks":125}],43:[function(citationRequire,module,exports){ 'use strict'; // 21.2.5.3 get RegExp.prototype.flags var anObject = citationRequire('./_an-object'); module.exports = function () { var that = anObject(this); var result = ''; if (that.global) result += 'g'; if (that.ignoreCase) result += 'i'; if (that.multiline) result += 'm'; if (that.unicode) result += 'u'; if (that.sticky) result += 'y'; return result; }; },{"./_an-object":15}],44:[function(citationRequire,module,exports){ var ctx = citationRequire('./_ctx'); var call = citationRequire('./_iter-call'); var isArrayIter = citationRequire('./_is-array-iter'); var anObject = citationRequire('./_an-object'); var toLength = citationRequire('./_to-length'); var getIterFn = citationRequire('./core.get-iterator-method'); var BREAK = {}; var RETURN = {}; var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable); var f = ctx(fn, that, entries ? 2 : 1); var index = 0; var length, step, iterator, result; if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); // fast case for arrays with default iterator if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); if (result === BREAK || result === RETURN) return result; } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { result = call(iterator, f, step.value, entries); if (result === BREAK || result === RETURN) return result; } }; exports.BREAK = BREAK; exports.RETURN = RETURN; },{"./_an-object":15,"./_ctx":31,"./_is-array-iter":53,"./_iter-call":58,"./_to-length":114,"./core.get-iterator-method":126}],45:[function(citationRequire,module,exports){ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self // eslint-disable-next-line no-new-func : Function('return this')(); if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef },{}],46:[function(citationRequire,module,exports){ var hasOwnProperty = {}.hasOwnProperty; module.exports = function (it, key) { return hasOwnProperty.call(it, key); }; },{}],47:[function(citationRequire,module,exports){ var dP = citationRequire('./_object-dp'); var createDesc = citationRequire('./_property-desc'); module.exports = citationRequire('./_descriptors') ? function (object, key, value) { return dP.f(object, key, createDesc(1, value)); } : function (object, key, value) { object[key] = value; return object; }; },{"./_descriptors":35,"./_object-dp":74,"./_property-desc":91}],48:[function(citationRequire,module,exports){ var document = citationRequire('./_global').document; module.exports = document && document.documentElement; },{"./_global":45}],49:[function(citationRequire,module,exports){ module.exports = !citationRequire('./_descriptors') && !citationRequire('./_fails')(function () { return Object.defineProperty(citationRequire('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7; }); },{"./_descriptors":35,"./_dom-create":36,"./_fails":41}],50:[function(citationRequire,module,exports){ var isObject = citationRequire('./_is-object'); var setPrototypeOf = citationRequire('./_set-proto').set; module.exports = function (that, target, C) { var S = target.constructor; var P; if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { setPrototypeOf(that, P); } return that; }; },{"./_is-object":56,"./_set-proto":95}],51:[function(citationRequire,module,exports){ // fast apply, http://jsperf.lnkit.com/fast-apply/5 module.exports = function (fn, args, that) { var un = that === undefined; switch (args.length) { case 0: return un ? fn() : fn.call(that); case 1: return un ? fn(args[0]) : fn.call(that, args[0]); case 2: return un ? fn(args[0], args[1]) : fn.call(that, args[0], args[1]); case 3: return un ? fn(args[0], args[1], args[2]) : fn.call(that, args[0], args[1], args[2]); case 4: return un ? fn(args[0], args[1], args[2], args[3]) : fn.call(that, args[0], args[1], args[2], args[3]); } return fn.apply(that, args); }; },{}],52:[function(citationRequire,module,exports){ // fallback for non-array-like ES3 and non-enumerable old V8 strings var cof = citationRequire('./_cof'); // eslint-disable-next-line no-prototype-builtins module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { return cof(it) == 'String' ? it.split('') : Object(it); }; },{"./_cof":25}],53:[function(citationRequire,module,exports){ // check on default Array iterator var Iterators = citationRequire('./_iterators'); var ITERATOR = citationRequire('./_wks')('iterator'); var ArrayProto = Array.prototype; module.exports = function (it) { return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); }; },{"./_iterators":63,"./_wks":125}],54:[function(citationRequire,module,exports){ // 7.2.2 IsArray(argument) var cof = citationRequire('./_cof'); module.exports = Array.isArray || function isArray(arg) { return cof(arg) == 'Array'; }; },{"./_cof":25}],55:[function(citationRequire,module,exports){ // 20.1.2.3 Number.isInteger(number) var isObject = citationRequire('./_is-object'); var floor = Math.floor; module.exports = function isInteger(it) { return !isObject(it) && isFinite(it) && floor(it) === it; }; },{"./_is-object":56}],56:[function(citationRequire,module,exports){ module.exports = function (it) { return typeof it === 'object' ? it !== null : typeof it === 'function'; }; },{}],57:[function(citationRequire,module,exports){ // 7.2.8 IsRegExp(argument) var isObject = citationRequire('./_is-object'); var cof = citationRequire('./_cof'); var MATCH = citationRequire('./_wks')('match'); module.exports = function (it) { var isRegExp; return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); }; },{"./_cof":25,"./_is-object":56,"./_wks":125}],58:[function(citationRequire,module,exports){ // call something on iterator step with safe closing on error var anObject = citationRequire('./_an-object'); module.exports = function (iterator, fn, value, entries) { try { return entries ? fn(anObject(value)[0], value[1]) : fn(value); // 7.4.6 IteratorClose(iterator, completion) } catch (e) { var ret = iterator['return']; if (ret !== undefined) anObject(ret.call(iterator)); throw e; } }; },{"./_an-object":15}],59:[function(citationRequire,module,exports){ 'use strict'; var create = citationRequire('./_object-create'); var descriptor = citationRequire('./_property-desc'); var setToStringTag = citationRequire('./_set-to-string-tag'); var IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() citationRequire('./_hide')(IteratorPrototype, citationRequire('./_wks')('iterator'), function () { return this; }); module.exports = function (Constructor, NAME, next) { Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); setToStringTag(Constructor, NAME + ' Iterator'); }; },{"./_hide":47,"./_object-create":73,"./_property-desc":91,"./_set-to-string-tag":97,"./_wks":125}],60:[function(citationRequire,module,exports){ 'use strict'; var LIBRARY = citationRequire('./_library'); var $export = citationRequire('./_export'); var redefine = citationRequire('./_redefine'); var hide = citationRequire('./_hide'); var Iterators = citationRequire('./_iterators'); var $iterCreate = citationRequire('./_iter-create'); var setToStringTag = citationRequire('./_set-to-string-tag'); var getPrototypeOf = citationRequire('./_object-gpo'); var ITERATOR = citationRequire('./_wks')('iterator'); var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` var FF_ITERATOR = '@@iterator'; var KEYS = 'keys'; var VALUES = 'values'; var returnThis = function () { return this; }; module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { $iterCreate(Constructor, NAME, next); var getMethod = function (kind) { if (!BUGGY && kind in proto) return proto[kind]; switch (kind) { case KEYS: return function keys() { return new Constructor(this, kind); }; case VALUES: return function values() { return new Constructor(this, kind); }; } return function entries() { return new Constructor(this, kind); }; }; var TAG = NAME + ' Iterator'; var DEF_VALUES = DEFAULT == VALUES; var VALUES_BUG = false; var proto = Base.prototype; var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; var $default = $native || getMethod(DEFAULT); var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; var methods, key, IteratorPrototype; // Fix native if ($anyNative) { IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { // Set @@toStringTag to native iterators setToStringTag(IteratorPrototype, TAG, true); // fix for some old engines if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis); } } // fix Array#{values, @@iterator}.name in V8 / FF if (DEF_VALUES && $native && $native.name !== VALUES) { VALUES_BUG = true; $default = function values() { return $native.call(this); }; } // Define iterator if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { hide(proto, ITERATOR, $default); } // Plug for library Iterators[NAME] = $default; Iterators[TAG] = returnThis; if (DEFAULT) { methods = { values: DEF_VALUES ? $default : getMethod(VALUES), keys: IS_SET ? $default : getMethod(KEYS), entries: $entries }; if (FORCED) for (key in methods) { if (!(key in proto)) redefine(proto, key, methods[key]); } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); } return methods; }; },{"./_export":39,"./_hide":47,"./_iter-create":59,"./_iterators":63,"./_library":64,"./_object-gpo":80,"./_redefine":93,"./_set-to-string-tag":97,"./_wks":125}],61:[function(citationRequire,module,exports){ var ITERATOR = citationRequire('./_wks')('iterator'); var SAFE_CLOSING = false; try { var riter = [7][ITERATOR](); riter['return'] = function () { SAFE_CLOSING = true; }; // eslint-disable-next-line no-throw-literal Array.from(riter, function () { throw 2; }); } catch (e) { /* empty */ } module.exports = function (exec, skipClosing) { if (!skipClosing && !SAFE_CLOSING) return false; var safe = false; try { var arr = [7]; var iter = arr[ITERATOR](); iter.next = function () { return { done: safe = true }; }; arr[ITERATOR] = function () { return iter; }; exec(arr); } catch (e) { /* empty */ } return safe; }; },{"./_wks":125}],62:[function(citationRequire,module,exports){ module.exports = function (done, value) { return { value: value, done: !!done }; }; },{}],63:[function(citationRequire,module,exports){ module.exports = {}; },{}],64:[function(citationRequire,module,exports){ module.exports = false; },{}],65:[function(citationRequire,module,exports){ // 20.2.2.14 Math.expm1(x) var $expm1 = Math.expm1; module.exports = (!$expm1 // Old FF bug || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 // Tor Browser bug || $expm1(-2e-17) != -2e-17 ) ? function expm1(x) { return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; } : $expm1; },{}],66:[function(citationRequire,module,exports){ // 20.2.2.16 Math.fround(x) var sign = citationRequire('./_math-sign'); var pow = Math.pow; var EPSILON = pow(2, -52); var EPSILON32 = pow(2, -23); var MAX32 = pow(2, 127) * (2 - EPSILON32); var MIN32 = pow(2, -126); var roundTiesToEven = function (n) { return n + 1 / EPSILON - 1 / EPSILON; }; module.exports = Math.fround || function fround(x) { var $abs = Math.abs(x); var $sign = sign(x); var a, result; if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; a = (1 + EPSILON32 / EPSILON) * $abs; result = a - (a - $abs); // eslint-disable-next-line no-self-compare if (result > MAX32 || result != result) return $sign * Infinity; return $sign * result; }; },{"./_math-sign":68}],67:[function(citationRequire,module,exports){ // 20.2.2.20 Math.log1p(x) module.exports = Math.log1p || function log1p(x) { return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); }; },{}],68:[function(citationRequire,module,exports){ // 20.2.2.28 Math.sign(x) module.exports = Math.sign || function sign(x) { // eslint-disable-next-line no-self-compare return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; }; },{}],69:[function(citationRequire,module,exports){ var META = citationRequire('./_uid')('meta'); var isObject = citationRequire('./_is-object'); var has = citationRequire('./_has'); var setDesc = citationRequire('./_object-dp').f; var id = 0; var isExtensible = Object.isExtensible || function () { return true; }; var FREEZE = !citationRequire('./_fails')(function () { return isExtensible(Object.preventExtensions({})); }); var setMeta = function (it) { setDesc(it, META, { value: { i: 'O' + ++id, // object ID w: {} // weak collections IDs } }); }; var fastKey = function (it, create) { // return primitive with prefix if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; if (!has(it, META)) { // can't set metadata to uncaught frozen object if (!isExtensible(it)) return 'F'; // not necessary to add metadata if (!create) return 'E'; // add missing metadata setMeta(it); // return object ID } return it[META].i; }; var getWeak = function (it, create) { if (!has(it, META)) { // can't set metadata to uncaught frozen object if (!isExtensible(it)) return true; // not necessary to add metadata if (!create) return false; // add missing metadata setMeta(it); // return hash weak collections IDs } return it[META].w; }; // add metadata on freeze-family methods calling var onFreeze = function (it) { if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); return it; }; var meta = module.exports = { KEY: META, NEED: false, fastKey: fastKey, getWeak: getWeak, onFreeze: onFreeze }; },{"./_fails":41,"./_has":46,"./_is-object":56,"./_object-dp":74,"./_uid":120}],70:[function(citationRequire,module,exports){ var global = citationRequire('./_global'); var macrotask = citationRequire('./_task').set; var Observer = global.MutationObserver || global.WebKitMutationObserver; var process = global.process; var Promise = global.Promise; var isNode = citationRequire('./_cof')(process) == 'process'; module.exports = function () { var head, last, notify; var flush = function () { var parent, fn; if (isNode && (parent = process.domain)) parent.exit(); while (head) { fn = head.fn; head = head.next; try { fn(); } catch (e) { if (head) notify(); else last = undefined; throw e; } } last = undefined; if (parent) parent.enter(); }; // Node.js if (isNode) { notify = function () { process.nextTick(flush); }; // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 } else if (Observer && !(global.navigator && global.navigator.standalone)) { var toggle = true; var node = document.createTextNode(''); new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new notify = function () { node.data = toggle = !toggle; }; // environments with maybe non-completely correct, but existent Promise } else if (Promise && Promise.resolve) { // Promise.resolve without an argument throws an error in LG WebOS 2 var promise = Promise.resolve(undefined); notify = function () { promise.then(flush); }; // for other environments - macrotask based on: // - setImmediate // - MessageChannel // - window.postMessag // - onreadystatechange // - setTimeout } else { notify = function () { // strange IE + webpack dev server bug - use .call(global) macrotask.call(global, flush); }; } return function (fn) { var task = { fn: fn, next: undefined }; if (last) last.next = task; if (!head) { head = task; notify(); } last = task; }; }; },{"./_cof":25,"./_global":45,"./_task":109}],71:[function(citationRequire,module,exports){ 'use strict'; // 25.4.1.5 NewPromiseCapability(C) var aFunction = citationRequire('./_a-function'); function PromiseCapability(C) { var resolve, reject; this.promise = new C(function ($$resolve, $$reject) { if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); resolve = $$resolve; reject = $$reject; }); this.resolve = aFunction(resolve); this.reject = aFunction(reject); } module.exports.f = function (C) { return new PromiseCapability(C); }; },{"./_a-function":11}],72:[function(citationRequire,module,exports){ 'use strict'; // 19.1.2.1 Object.assign(target, source, ...) var getKeys = citationRequire('./_object-keys'); var gOPS = citationRequire('./_object-gops'); var pIE = citationRequire('./_object-pie'); var toObject = citationRequire('./_to-object'); var IObject = citationRequire('./_iobject'); var $assign = Object.assign; // should work with symbols and should have deterministic property order (V8 bug) module.exports = !$assign || citationRequire('./_fails')(function () { var A = {}; var B = {}; // eslint-disable-next-line no-undef var S = Symbol(); var K = 'abcdefghijklmnopqrst'; A[S] = 7; K.split('').forEach(function (k) { B[k] = k; }); return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; }) ? function assign(target, source) { // eslint-disable-line no-unused-vars var T = toObject(target); var aLen = arguments.length; var index = 1; var getSymbols = gOPS.f; var isEnum = pIE.f; while (aLen > index) { var S = IObject(arguments[index++]); var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); var length = keys.length; var j = 0; var key; while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; } return T; } : $assign; },{"./_fails":41,"./_iobject":52,"./_object-gops":79,"./_object-keys":82,"./_object-pie":83,"./_to-object":115}],73:[function(citationRequire,module,exports){ // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) var anObject = citationRequire('./_an-object'); var dPs = citationRequire('./_object-dps'); var enumBugKeys = citationRequire('./_enum-bug-keys'); var IE_PROTO = citationRequire('./_shared-key')('IE_PROTO'); var Empty = function () { /* empty */ }; var PROTOTYPE = 'prototype'; // Create object with fake `null` prototype: use iframe Object with cleared prototype var createDict = function () { // Thrash, waste and sodomy: IE GC bug var iframe = citationRequire('./_dom-create')('iframe'); var i = enumBugKeys.length; var lt = '<'; var gt = '>'; var iframeDocument; iframe.style.display = 'none'; citationRequire('./_html').appendChild(iframe); iframe.src = 'javascript:'; // eslint-disable-line no-script-url // createDict = iframe.contentWindow.Object; // html.removeChild(iframe); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); iframeDocument.close(); createDict = iframeDocument.F; while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; return createDict(); }; module.exports = Object.create || function create(O, Properties) { var result; if (O !== null) { Empty[PROTOTYPE] = anObject(O); result = new Empty(); Empty[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; } else result = createDict(); return Properties === undefined ? result : dPs(result, Properties); }; },{"./_an-object":15,"./_dom-create":36,"./_enum-bug-keys":37,"./_html":48,"./_object-dps":75,"./_shared-key":98}],74:[function(citationRequire,module,exports){ var anObject = citationRequire('./_an-object'); var IE8_DOM_DEFINE = citationRequire('./_ie8-dom-define'); var toPrimitive = citationRequire('./_to-primitive'); var dP = Object.defineProperty; exports.f = citationRequire('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPrimitive(P, true); anObject(Attributes); if (IE8_DOM_DEFINE) try { return dP(O, P, Attributes); } catch (e) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; },{"./_an-object":15,"./_descriptors":35,"./_ie8-dom-define":49,"./_to-primitive":116}],75:[function(citationRequire,module,exports){ var dP = citationRequire('./_object-dp'); var anObject = citationRequire('./_an-object'); var getKeys = citationRequire('./_object-keys'); module.exports = citationRequire('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var keys = getKeys(Properties); var length = keys.length; var i = 0; var P; while (length > i) dP.f(O, P = keys[i++], Properties[P]); return O; }; },{"./_an-object":15,"./_descriptors":35,"./_object-dp":74,"./_object-keys":82}],76:[function(citationRequire,module,exports){ var pIE = citationRequire('./_object-pie'); var createDesc = citationRequire('./_property-desc'); var toIObject = citationRequire('./_to-iobject'); var toPrimitive = citationRequire('./_to-primitive'); var has = citationRequire('./_has'); var IE8_DOM_DEFINE = citationRequire('./_ie8-dom-define'); var gOPD = Object.getOwnPropertyDescriptor; exports.f = citationRequire('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) { O = toIObject(O); P = toPrimitive(P, true); if (IE8_DOM_DEFINE) try { return gOPD(O, P); } catch (e) { /* empty */ } if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); }; },{"./_descriptors":35,"./_has":46,"./_ie8-dom-define":49,"./_object-pie":83,"./_property-desc":91,"./_to-iobject":113,"./_to-primitive":116}],77:[function(citationRequire,module,exports){ // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window var toIObject = citationRequire('./_to-iobject'); var gOPN = citationRequire('./_object-gopn').f; var toString = {}.toString; var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; var getWindowNames = function (it) { try { return gOPN(it); } catch (e) { return windowNames.slice(); } }; module.exports.f = function getOwnPropertyNames(it) { return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); }; },{"./_object-gopn":78,"./_to-iobject":113}],78:[function(citationRequire,module,exports){ // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) var $keys = citationRequire('./_object-keys-internal'); var hiddenKeys = citationRequire('./_enum-bug-keys').concat('length', 'prototype'); exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return $keys(O, hiddenKeys); }; },{"./_enum-bug-keys":37,"./_object-keys-internal":81}],79:[function(citationRequire,module,exports){ exports.f = Object.getOwnPropertySymbols; },{}],80:[function(citationRequire,module,exports){ // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) var has = citationRequire('./_has'); var toObject = citationRequire('./_to-object'); var IE_PROTO = citationRequire('./_shared-key')('IE_PROTO'); var ObjectProto = Object.prototype; module.exports = Object.getPrototypeOf || function (O) { O = toObject(O); if (has(O, IE_PROTO)) return O[IE_PROTO]; if (typeof O.constructor == 'function' && O instanceof O.constructor) { return O.constructor.prototype; } return O instanceof Object ? ObjectProto : null; }; },{"./_has":46,"./_shared-key":98,"./_to-object":115}],81:[function(citationRequire,module,exports){ var has = citationRequire('./_has'); var toIObject = citationRequire('./_to-iobject'); var arrayIndexOf = citationRequire('./_array-includes')(false); var IE_PROTO = citationRequire('./_shared-key')('IE_PROTO'); module.exports = function (object, names) { var O = toIObject(object); var i = 0; var result = []; var key; for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); // Don't enum bug & hidden keys while (names.length > i) if (has(O, key = names[i++])) { ~arrayIndexOf(result, key) || result.push(key); } return result; }; },{"./_array-includes":18,"./_has":46,"./_shared-key":98,"./_to-iobject":113}],82:[function(citationRequire,module,exports){ // 19.1.2.14 / 15.2.3.14 Object.keys(O) var $keys = citationRequire('./_object-keys-internal'); var enumBugKeys = citationRequire('./_enum-bug-keys'); module.exports = Object.keys || function keys(O) { return $keys(O, enumBugKeys); }; },{"./_enum-bug-keys":37,"./_object-keys-internal":81}],83:[function(citationRequire,module,exports){ exports.f = {}.propertyIsEnumerable; },{}],84:[function(citationRequire,module,exports){ // most Object methods by ES6 should accept primitives var $export = citationRequire('./_export'); var core = citationRequire('./_core'); var fails = citationRequire('./_fails'); module.exports = function (KEY, exec) { var fn = (core.Object || {})[KEY] || Object[KEY]; var exp = {}; exp[KEY] = exec(fn); $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp); }; },{"./_core":29,"./_export":39,"./_fails":41}],85:[function(citationRequire,module,exports){ var getKeys = citationRequire('./_object-keys'); var toIObject = citationRequire('./_to-iobject'); var isEnum = citationRequire('./_object-pie').f; module.exports = function (isEntries) { return function (it) { var O = toIObject(it); var keys = getKeys(O); var length = keys.length; var i = 0; var result = []; var key; while (length > i) if (isEnum.call(O, key = keys[i++])) { result.push(isEntries ? [key, O[key]] : O[key]); } return result; }; }; },{"./_object-keys":82,"./_object-pie":83,"./_to-iobject":113}],86:[function(citationRequire,module,exports){ // all object keys, includes non-enumerable and symbols var gOPN = citationRequire('./_object-gopn'); var gOPS = citationRequire('./_object-gops'); var anObject = citationRequire('./_an-object'); var Reflect = citationRequire('./_global').Reflect; module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { var keys = gOPN.f(anObject(it)); var getSymbols = gOPS.f; return getSymbols ? keys.concat(getSymbols(it)) : keys; }; },{"./_an-object":15,"./_global":45,"./_object-gopn":78,"./_object-gops":79}],87:[function(citationRequire,module,exports){ var $parseFloat = citationRequire('./_global').parseFloat; var $trim = citationRequire('./_string-trim').trim; module.exports = 1 / $parseFloat(citationRequire('./_string-ws') + '-0') !== -Infinity ? function parseFloat(str) { var string = $trim(String(str), 3); var result = $parseFloat(string); return result === 0 && string.charAt(0) == '-' ? -0 : result; } : $parseFloat; },{"./_global":45,"./_string-trim":107,"./_string-ws":108}],88:[function(citationRequire,module,exports){ var $parseInt = citationRequire('./_global').parseInt; var $trim = citationRequire('./_string-trim').trim; var ws = citationRequire('./_string-ws'); var hex = /^[-+]?0[xX]/; module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) { var string = $trim(String(str), 3); return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); } : $parseInt; },{"./_global":45,"./_string-trim":107,"./_string-ws":108}],89:[function(citationRequire,module,exports){ module.exports = function (exec) { try { return { e: false, v: exec() }; } catch (e) { return { e: true, v: e }; } }; },{}],90:[function(citationRequire,module,exports){ var anObject = citationRequire('./_an-object'); var isObject = citationRequire('./_is-object'); var newPromiseCapability = citationRequire('./_new-promise-capability'); module.exports = function (C, x) { anObject(C); if (isObject(x) && x.constructor === C) return x; var promiseCapability = newPromiseCapability.f(C); var resolve = promiseCapability.resolve; resolve(x); return promiseCapability.promise; }; },{"./_an-object":15,"./_is-object":56,"./_new-promise-capability":71}],91:[function(citationRequire,module,exports){ module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; },{}],92:[function(citationRequire,module,exports){ var redefine = citationRequire('./_redefine'); module.exports = function (target, src, safe) { for (var key in src) redefine(target, key, src[key], safe); return target; }; },{"./_redefine":93}],93:[function(citationRequire,module,exports){ var global = citationRequire('./_global'); var hide = citationRequire('./_hide'); var has = citationRequire('./_has'); var SRC = citationRequire('./_uid')('src'); var TO_STRING = 'toString'; var $toString = Function[TO_STRING]; var TPL = ('' + $toString).split(TO_STRING); citationRequire('./_core').inspectSource = function (it) { return $toString.call(it); }; (module.exports = function (O, key, val, safe) { var isFunction = typeof val == 'function'; if (isFunction) has(val, 'name') || hide(val, 'name', key); if (O[key] === val) return; if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); if (O === global) { O[key] = val; } else if (!safe) { delete O[key]; hide(O, key, val); } else if (O[key]) { O[key] = val; } else { hide(O, key, val); } // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative })(Function.prototype, TO_STRING, function toString() { return typeof this == 'function' && this[SRC] || $toString.call(this); }); },{"./_core":29,"./_global":45,"./_has":46,"./_hide":47,"./_uid":120}],94:[function(citationRequire,module,exports){ // 7.2.9 SameValue(x, y) module.exports = Object.is || function is(x, y) { // eslint-disable-next-line no-self-compare return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; }; },{}],95:[function(citationRequire,module,exports){ // Works with __proto__ only. Old v8 can't work with null proto objects. /* eslint-disable no-proto */ var isObject = citationRequire('./_is-object'); var anObject = citationRequire('./_an-object'); var check = function (O, proto) { anObject(O); if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); }; module.exports = { set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line function (test, buggy, set) { try { set = citationRequire('./_ctx')(Function.call, citationRequire('./_object-gopd').f(Object.prototype, '__proto__').set, 2); set(test, []); buggy = !(test instanceof Array); } catch (e) { buggy = true; } return function setPrototypeOf(O, proto) { check(O, proto); if (buggy) O.__proto__ = proto; else set(O, proto); return O; }; }({}, false) : undefined), check: check }; },{"./_an-object":15,"./_ctx":31,"./_is-object":56,"./_object-gopd":76}],96:[function(citationRequire,module,exports){ 'use strict'; var global = citationRequire('./_global'); var dP = citationRequire('./_object-dp'); var DESCRIPTORS = citationRequire('./_descriptors'); var SPECIES = citationRequire('./_wks')('species'); module.exports = function (KEY) { var C = global[KEY]; if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { configurable: true, get: function () { return this; } }); }; },{"./_descriptors":35,"./_global":45,"./_object-dp":74,"./_wks":125}],97:[function(citationRequire,module,exports){ var def = citationRequire('./_object-dp').f; var has = citationRequire('./_has'); var TAG = citationRequire('./_wks')('toStringTag'); module.exports = function (it, tag, stat) { if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); }; },{"./_has":46,"./_object-dp":74,"./_wks":125}],98:[function(citationRequire,module,exports){ var shared = citationRequire('./_shared')('keys'); var uid = citationRequire('./_uid'); module.exports = function (key) { return shared[key] || (shared[key] = uid(key)); }; },{"./_shared":99,"./_uid":120}],99:[function(citationRequire,module,exports){ var core = citationRequire('./_core'); var global = citationRequire('./_global'); var SHARED = '__core-js_shared__'; var store = global[SHARED] || (global[SHARED] = {}); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ version: core.version, mode: citationRequire('./_library') ? 'pure' : 'global', copyright: '© 2018 Denis Pushkarev (zloirock.ru)' }); },{"./_core":29,"./_global":45,"./_library":64}],100:[function(citationRequire,module,exports){ // 7.3.20 SpeciesConstructor(O, defaultConstructor) var anObject = citationRequire('./_an-object'); var aFunction = citationRequire('./_a-function'); var SPECIES = citationRequire('./_wks')('species'); module.exports = function (O, D) { var C = anObject(O).constructor; var S; return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); }; },{"./_a-function":11,"./_an-object":15,"./_wks":125}],101:[function(citationRequire,module,exports){ 'use strict'; var fails = citationRequire('./_fails'); module.exports = function (method, arg) { return !!method && fails(function () { // eslint-disable-next-line no-useless-call arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null); }); }; },{"./_fails":41}],102:[function(citationRequire,module,exports){ var toInteger = citationRequire('./_to-integer'); var defined = citationRequire('./_defined'); // true -> String#at // false -> String#codePointAt module.exports = function (TO_STRING) { return function (that, pos) { var s = String(defined(that)); var i = toInteger(pos); var l = s.length; var a, b; if (i < 0 || i >= l) return TO_STRING ? '' : undefined; a = s.charCodeAt(i); return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; }; }; },{"./_defined":34,"./_to-integer":112}],103:[function(citationRequire,module,exports){ // helper for String#{startsWith, endsWith, includes} var isRegExp = citationRequire('./_is-regexp'); var defined = citationRequire('./_defined'); module.exports = function (that, searchString, NAME) { if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); return String(defined(that)); }; },{"./_defined":34,"./_is-regexp":57}],104:[function(citationRequire,module,exports){ var $export = citationRequire('./_export'); var fails = citationRequire('./_fails'); var defined = citationRequire('./_defined'); var quot = /"/g; // B.2.3.2.1 CreateHTML(string, tag, attribute, value) var createHTML = function (string, tag, attribute, value) { var S = String(defined(string)); var p1 = '<' + tag; if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; return p1 + '>' + S + '</' + tag + '>'; }; module.exports = function (NAME, exec) { var O = {}; O[NAME] = exec(createHTML); $export($export.P + $export.F * fails(function () { var test = ''[NAME]('"'); return test !== test.toLowerCase() || test.split('"').length > 3; }), 'String', O); }; },{"./_defined":34,"./_export":39,"./_fails":41}],105:[function(citationRequire,module,exports){ // https://github.com/tc39/proposal-string-pad-start-end var toLength = citationRequire('./_to-length'); var repeat = citationRequire('./_string-repeat'); var defined = citationRequire('./_defined'); module.exports = function (that, maxLength, fillString, left) { var S = String(defined(that)); var stringLength = S.length; var fillStr = fillString === undefined ? ' ' : String(fillString); var intMaxLength = toLength(maxLength); if (intMaxLength <= stringLength || fillStr == '') return S; var fillLen = intMaxLength - stringLength; var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); return left ? stringFiller + S : S + stringFiller; }; },{"./_defined":34,"./_string-repeat":106,"./_to-length":114}],106:[function(citationRequire,module,exports){ 'use strict'; var toInteger = citationRequire('./_to-integer'); var defined = citationRequire('./_defined'); module.exports = function repeat(count) { var str = String(defined(this)); var res = ''; var n = toInteger(count); if (n < 0 || n == Infinity) throw RangeError("Count can't be negative"); for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str; return res; }; },{"./_defined":34,"./_to-integer":112}],107:[function(citationRequire,module,exports){ var $export = citationRequire('./_export'); var defined = citationRequire('./_defined'); var fails = citationRequire('./_fails'); var spaces = citationRequire('./_string-ws'); var space = '[' + spaces + ']'; var non = '\u200b\u0085'; var ltrim = RegExp('^' + space + space + '*'); var rtrim = RegExp(space + space + '*$'); var exporter = function (KEY, exec, ALIAS) { var exp = {}; var FORCE = fails(function () { return !!spaces[KEY]() || non[KEY]() != non; }); var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; if (ALIAS) exp[ALIAS] = fn; $export($export.P + $export.F * FORCE, 'String', exp); }; // 1 -> String#trimLeft // 2 -> String#trimRight // 3 -> String#trim var trim = exporter.trim = function (string, TYPE) { string = String(defined(string)); if (TYPE & 1) string = string.replace(ltrim, ''); if (TYPE & 2) string = string.replace(rtrim, ''); return string; }; module.exports = exporter; },{"./_defined":34,"./_export":39,"./_fails":41,"./_string-ws":108}],108:[function(citationRequire,module,exports){ module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; },{}],109:[function(citationRequire,module,exports){ var ctx = citationRequire('./_ctx'); var invoke = citationRequire('./_invoke'); var html = citationRequire('./_html'); var cel = citationRequire('./_dom-create'); var global = citationRequire('./_global'); var process = global.process; var setTask = global.setImmediate; var clearTask = global.clearImmediate; var MessageChannel = global.MessageChannel; var Dispatch = global.Dispatch; var counter = 0; var queue = {}; var ONREADYSTATECHANGE = 'onreadystatechange'; var defer, channel, port; var run = function () { var id = +this; // eslint-disable-next-line no-prototype-builtins if (queue.hasOwnProperty(id)) { var fn = queue[id]; delete queue[id]; fn(); } }; var listener = function (event) { run.call(event.data); }; // Node.js 0.9+ & IE10+ has setImmediate, otherwise: if (!setTask || !clearTask) { setTask = function setImmediate(fn) { var args = []; var i = 1; while (arguments.length > i) args.push(arguments[i++]); queue[++counter] = function () { // eslint-disable-next-line no-new-func invoke(typeof fn == 'function' ? fn : Function(fn), args); }; defer(counter); return counter; }; clearTask = function clearImmediate(id) { delete queue[id]; }; // Node.js 0.8- if (citationRequire('./_cof')(process) == 'process') { defer = function (id) { process.nextTick(ctx(run, id, 1)); }; // Sphere (JS game engine) Dispatch API } else if (Dispatch && Dispatch.now) { defer = function (id) { Dispatch.now(ctx(run, id, 1)); }; // Browsers with MessageChannel, includes WebWorkers } else if (MessageChannel) { channel = new MessageChannel(); port = channel.port2; channel.port1.onmessage = listener; defer = ctx(port.postMessage, port, 1); // Browsers with postMessage, skip WebWorkers // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { defer = function (id) { global.postMessage(id + '', '*'); }; global.addEventListener('message', listener, false); // IE8- } else if (ONREADYSTATECHANGE in cel('script')) { defer = function (id) { html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { html.removeChild(this); run.call(id); }; }; // Rest old browsers } else { defer = function (id) { setTimeout(ctx(run, id, 1), 0); }; } } module.exports = { set: setTask, clear: clearTask }; },{"./_cof":25,"./_ctx":31,"./_dom-create":36,"./_global":45,"./_html":48,"./_invoke":51}],110:[function(citationRequire,module,exports){ var toInteger = citationRequire('./_to-integer'); var max = Math.max; var min = Math.min; module.exports = function (index, length) { index = toInteger(index); return index < 0 ? max(index + length, 0) : min(index, length); }; },{"./_to-integer":112}],111:[function(citationRequire,module,exports){ // https://tc39.github.io/ecma262/#sec-toindex var toInteger = citationRequire('./_to-integer'); var toLength = citationRequire('./_to-length'); module.exports = function (it) { if (it === undefined) return 0; var number = toInteger(it); var length = toLength(number); if (number !== length) throw RangeError('Wrong length!'); return length; }; },{"./_to-integer":112,"./_to-length":114}],112:[function(citationRequire,module,exports){ // 7.1.4 ToInteger var ceil = Math.ceil; var floor = Math.floor; module.exports = function (it) { return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); }; },{}],113:[function(citationRequire,module,exports){ // to indexed object, toObject with fallback for non-array-like ES3 strings var IObject = citationRequire('./_iobject'); var defined = citationRequire('./_defined'); module.exports = function (it) { return IObject(defined(it)); }; },{"./_defined":34,"./_iobject":52}],114:[function(citationRequire,module,exports){ // 7.1.15 ToLength var toInteger = citationRequire('./_to-integer'); var min = Math.min; module.exports = function (it) { return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 }; },{"./_to-integer":112}],115:[function(citationRequire,module,exports){ // 7.1.13 ToObject(argument) var defined = citationRequire('./_defined'); module.exports = function (it) { return Object(defined(it)); }; },{"./_defined":34}],116:[function(citationRequire,module,exports){ // 7.1.1 ToPrimitive(input [, PreferredType]) var isObject = citationRequire('./_is-object'); // instead of the ES6 spec version, we didn't implement @@toPrimitive case // and the second argument - flag - preferred type is a string module.exports = function (it, S) { if (!isObject(it)) return it; var fn, val; if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; throw TypeError("Can't convert object to primitive value"); }; },{"./_is-object":56}],117:[function(citationRequire,module,exports){ 'use strict'; if (citationRequire('./_descriptors')) { var LIBRARY = citationRequire('./_library'); var global = citationRequire('./_global'); var fails = citationRequire('./_fails'); var $export = citationRequire('./_export'); var $typed = citationRequire('./_typed'); var $buffer = citationRequire('./_typed-buffer'); var ctx = citationRequire('./_ctx'); var anInstance = citationRequire('./_an-instance'); var propertyDesc = citationRequire('./_property-desc'); var hide = citationRequire('./_hide'); var redefineAll = citationRequire('./_redefine-all'); var toInteger = citationRequire('./_to-integer'); var toLength = citationRequire('./_to-length'); var toIndex = citationRequire('./_to-index'); var toAbsoluteIndex = citationRequire('./_to-absolute-index'); var toPrimitive = citationRequire('./_to-primitive'); var has = citationRequire('./_has'); var classof = citationRequire('./_classof'); var isObject = citationRequire('./_is-object'); var toObject = citationRequire('./_to-object'); var isArrayIter = citationRequire('./_is-array-iter'); var create = citationRequire('./_object-create'); var getPrototypeOf = citationRequire('./_object-gpo'); var gOPN = citationRequire('./_object-gopn').f; var getIterFn = citationRequire('./core.get-iterator-method'); var uid = citationRequire('./_uid'); var wks = citationRequire('./_wks'); var createArrayMethod = citationRequire('./_array-methods'); var createArrayIncludes = citationRequire('./_array-includes'); var speciesConstructor = citationRequire('./_species-constructor'); var ArrayIterators = citationRequire('./es6.array.iterator'); var Iterators = citationRequire('./_iterators'); var $iterDetect = citationRequire('./_iter-detect'); var setSpecies = citationRequire('./_set-species'); var arrayFill = citationRequire('./_array-fill'); var arrayCopyWithin = citationRequire('./_array-copy-within'); var $DP = citationRequire('./_object-dp'); var $GOPD = citationRequire('./_object-gopd'); var dP = $DP.f; var gOPD = $GOPD.f; var RangeError = global.RangeError; var TypeError = global.TypeError; var Uint8Array = global.Uint8Array; var ARRAY_BUFFER = 'ArrayBuffer'; var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER; var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; var PROTOTYPE = 'prototype'; var ArrayProto = Array[PROTOTYPE]; var $ArrayBuffer = $buffer.ArrayBuffer; var $DataView = $buffer.DataView; var arrayForEach = createArrayMethod(0); var arrayFilter = createArrayMethod(2); var arraySome = createArrayMethod(3); var arrayEvery = createArrayMethod(4); var arrayFind = createArrayMethod(5); var arrayFindIndex = createArrayMethod(6); var arrayIncludes = createArrayIncludes(true); var arrayIndexOf = createArrayIncludes(false); var arrayValues = ArrayIterators.values; var arrayKeys = ArrayIterators.keys; var arrayEntries = ArrayIterators.entries; var arrayLastIndexOf = ArrayProto.lastIndexOf; var arrayReduce = ArrayProto.reduce; var arrayReduceRight = ArrayProto.reduceRight; var arrayJoin = ArrayProto.join; var arraySort = ArrayProto.sort; var arraySlice = ArrayProto.slice; var arrayToString = ArrayProto.toString; var arrayToLocaleString = ArrayProto.toLocaleString; var ITERATOR = wks('iterator'); var TAG = wks('toStringTag'); var TYPED_CONSTRUCTOR = uid('typed_constructor'); var DEF_CONSTRUCTOR = uid('def_constructor'); var ALL_CONSTRUCTORS = $typed.CONSTR; var TYPED_ARRAY = $typed.TYPED; var VIEW = $typed.VIEW; var WRONG_LENGTH = 'Wrong length!'; var $map = createArrayMethod(1, function (O, length) { return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); }); var LITTLE_ENDIAN = fails(function () { // eslint-disable-next-line no-undef return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; }); var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () { new Uint8Array(1).set({}); }); var toOffset = function (it, BYTES) { var offset = toInteger(it); if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!'); return offset; }; var validate = function (it) { if (isObject(it) && TYPED_ARRAY in it) return it; throw TypeError(it + ' is not a typed array!'); }; var allocate = function (C, length) { if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) { throw TypeError('It is not a typed array constructor!'); } return new C(length); }; var speciesFromList = function (O, list) { return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); }; var fromList = function (C, list) { var index = 0; var length = list.length; var result = allocate(C, length); while (length > index) result[index] = list[index++]; return result; }; var addGetter = function (it, key, internal) { dP(it, key, { get: function () { return this._d[internal]; } }); }; var $from = function from(source /* , mapfn, thisArg */) { var O = toObject(source); var aLen = arguments.length; var mapfn = aLen > 1 ? arguments[1] : undefined; var mapping = mapfn !== undefined; var iterFn = getIterFn(O); var i, length, values, result, step, iterator; if (iterFn != undefined && !isArrayIter(iterFn)) { for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) { values.push(step.value); } O = values; } if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2); for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) { result[i] = mapping ? mapfn(O[i], i) : O[i]; } return result; }; var $of = function of(/* ...items */) { var index = 0; var length = arguments.length; var result = allocate(this, length); while (length > index) result[index] = arguments[index++]; return result; }; // iOS Safari 6.x fails here var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); }); var $toLocaleString = function toLocaleString() { return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); }; var proto = { copyWithin: function copyWithin(target, start /* , end */) { return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); }, every: function every(callbackfn /* , thisArg */) { return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }, fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars return arrayFill.apply(validate(this), arguments); }, filter: function filter(callbackfn /* , thisArg */) { return speciesFromList(this, arrayFilter(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined)); }, find: function find(predicate /* , thisArg */) { return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); }, findIndex: function findIndex(predicate /* , thisArg */) { return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); }, forEach: function forEach(callbackfn /* , thisArg */) { arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }, indexOf: function indexOf(searchElement /* , fromIndex */) { return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); }, includes: function includes(searchElement /* , fromIndex */) { return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); }, join: function join(separator) { // eslint-disable-line no-unused-vars return arrayJoin.apply(validate(this), arguments); }, lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars return arrayLastIndexOf.apply(validate(this), arguments); }, map: function map(mapfn /* , thisArg */) { return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); }, reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars return arrayReduce.apply(validate(this), arguments); }, reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars return arrayReduceRight.apply(validate(this), arguments); }, reverse: function reverse() { var that = this; var length = validate(that).length; var middle = Math.floor(length / 2); var index = 0; var value; while (index < middle) { value = that[index]; that[index++] = that[--length]; that[length] = value; } return that; }, some: function some(callbackfn /* , thisArg */) { return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }, sort: function sort(comparefn) { return arraySort.call(validate(this), comparefn); }, subarray: function subarray(begin, end) { var O = validate(this); var length = O.length; var $begin = toAbsoluteIndex(begin, length); return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( O.buffer, O.byteOffset + $begin * O.BYTES_PER_ELEMENT, toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin) ); } }; var $slice = function slice(start, end) { return speciesFromList(this, arraySlice.call(validate(this), start, end)); }; var $set = function set(arrayLike /* , offset */) { validate(this); var offset = toOffset(arguments[1], 1); var length = this.length; var src = toObject(arrayLike); var len = toLength(src.length); var index = 0; if (len + offset > length) throw RangeError(WRONG_LENGTH); while (index < len) this[offset + index] = src[index++]; }; var $iterators = { entries: function entries() { return arrayEntries.call(validate(this)); }, keys: function keys() { return arrayKeys.call(validate(this)); }, values: function values() { return arrayValues.call(validate(this)); } }; var isTAIndex = function (target, key) { return isObject(target) && target[TYPED_ARRAY] && typeof key != 'symbol' && key in target && String(+key) == String(key); }; var $getDesc = function getOwnPropertyDescriptor(target, key) { return isTAIndex(target, key = toPrimitive(key, true)) ? propertyDesc(2, target[key]) : gOPD(target, key); }; var $setDesc = function defineProperty(target, key, desc) { if (isTAIndex(target, key = toPrimitive(key, true)) && isObject(desc) && has(desc, 'value') && !has(desc, 'get') && !has(desc, 'set') // TODO: add validation descriptor w/o calling accessors && !desc.configurable && (!has(desc, 'writable') || desc.writable) && (!has(desc, 'enumerable') || desc.enumerable) ) { target[key] = desc.value; return target; } return dP(target, key, desc); }; if (!ALL_CONSTRUCTORS) { $GOPD.f = $getDesc; $DP.f = $setDesc; } $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { getOwnPropertyDescriptor: $getDesc, defineProperty: $setDesc }); if (fails(function () { arrayToString.call({}); })) { arrayToString = arrayToLocaleString = function toString() { return arrayJoin.call(this); }; } var $TypedArrayPrototype$ = redefineAll({}, proto); redefineAll($TypedArrayPrototype$, $iterators); hide($TypedArrayPrototype$, ITERATOR, $iterators.values); redefineAll($TypedArrayPrototype$, { slice: $slice, set: $set, constructor: function () { /* noop */ }, toString: arrayToString, toLocaleString: $toLocaleString }); addGetter($TypedArrayPrototype$, 'buffer', 'b'); addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); addGetter($TypedArrayPrototype$, 'byteLength', 'l'); addGetter($TypedArrayPrototype$, 'length', 'e'); dP($TypedArrayPrototype$, TAG, { get: function () { return this[TYPED_ARRAY]; } }); // eslint-disable-next-line max-statements module.exports = function (KEY, BYTES, wrapper, CLAMPED) { CLAMPED = !!CLAMPED; var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'; var GETTER = 'get' + KEY; var SETTER = 'set' + KEY; var TypedArray = global[NAME]; var Base = TypedArray || {}; var TAC = TypedArray && getPrototypeOf(TypedArray); var FORCED = !TypedArray || !$typed.ABV; var O = {}; var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; var getter = function (that, index) { var data = that._d; return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); }; var setter = function (that, index, value) { var data = that._d; if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); }; var addElement = function (that, index) { dP(that, index, { get: function () { return getter(this, index); }, set: function (value) { return setter(this, index, value); }, enumerable: true }); }; if (FORCED) { TypedArray = wrapper(function (that, data, $offset, $length) { anInstance(that, TypedArray, NAME, '_d'); var index = 0; var offset = 0; var buffer, byteLength, length, klass; if (!isObject(data)) { length = toIndex(data); byteLength = length * BYTES; buffer = new $ArrayBuffer(byteLength); } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { buffer = data; offset = toOffset($offset, BYTES); var $len = data.byteLength; if ($length === undefined) { if ($len % BYTES) throw RangeError(WRONG_LENGTH); byteLength = $len - offset; if (byteLength < 0) throw RangeError(WRONG_LENGTH); } else { byteLength = toLength($length) * BYTES; if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH); } length = byteLength / BYTES; } else if (TYPED_ARRAY in data) { return fromList(TypedArray, data); } else { return $from.call(TypedArray, data); } hide(that, '_d', { b: buffer, o: offset, l: byteLength, e: length, v: new $DataView(buffer) }); while (index < length) addElement(that, index++); }); TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); hide(TypedArrayPrototype, 'constructor', TypedArray); } else if (!fails(function () { TypedArray(1); }) || !fails(function () { new TypedArray(-1); // eslint-disable-line no-new }) || !$iterDetect(function (iter) { new TypedArray(); // eslint-disable-line no-new new TypedArray(null); // eslint-disable-line no-new new TypedArray(1.5); // eslint-disable-line no-new new TypedArray(iter); // eslint-disable-line no-new }, true)) { TypedArray = wrapper(function (that, data, $offset, $length) { anInstance(that, TypedArray, NAME); var klass; // `ws` module bug, temporarily remove validation length for Uint8Array // https://github.com/websockets/ws/pull/645 if (!isObject(data)) return new Base(toIndex(data)); if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { return $length !== undefined ? new Base(data, toOffset($offset, BYTES), $length) : $offset !== undefined ? new Base(data, toOffset($offset, BYTES)) : new Base(data); } if (TYPED_ARRAY in data) return fromList(TypedArray, data); return $from.call(TypedArray, data); }); arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) { if (!(key in TypedArray)) hide(TypedArray, key, Base[key]); }); TypedArray[PROTOTYPE] = TypedArrayPrototype; if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray; } var $nativeIterator = TypedArrayPrototype[ITERATOR]; var CORRECT_ITER_NAME = !!$nativeIterator && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined); var $iterator = $iterators.values; hide(TypedArray, TYPED_CONSTRUCTOR, true); hide(TypedArrayPrototype, TYPED_ARRAY, NAME); hide(TypedArrayPrototype, VIEW, true); hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) { dP(TypedArrayPrototype, TAG, { get: function () { return NAME; } }); } O[NAME] = TypedArray; $export($export.G + $export.W + $export.F * (TypedArray != Base), O); $export($export.S, NAME, { BYTES_PER_ELEMENT: BYTES }); $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, { from: $from, of: $of }); if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); $export($export.P, NAME, proto); setSpecies(NAME); $export($export.P + $export.F * FORCED_SET, NAME, { set: $set }); $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString; $export($export.P + $export.F * fails(function () { new TypedArray(1).slice(); }), NAME, { slice: $slice }); $export($export.P + $export.F * (fails(function () { return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString(); }) || !fails(function () { TypedArrayPrototype.toLocaleString.call([1, 2]); })), NAME, { toLocaleString: $toLocaleString }); Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator); }; } else module.exports = function () { /* empty */ }; },{"./_an-instance":14,"./_array-copy-within":16,"./_array-fill":17,"./_array-includes":18,"./_array-methods":19,"./_classof":24,"./_ctx":31,"./_descriptors":35,"./_export":39,"./_fails":41,"./_global":45,"./_has":46,"./_hide":47,"./_is-array-iter":53,"./_is-object":56,"./_iter-detect":61,"./_iterators":63,"./_library":64,"./_object-create":73,"./_object-dp":74,"./_object-gopd":76,"./_object-gopn":78,"./_object-gpo":80,"./_property-desc":91,"./_redefine-all":92,"./_set-species":96,"./_species-constructor":100,"./_to-absolute-index":110,"./_to-index":111,"./_to-integer":112,"./_to-length":114,"./_to-object":115,"./_to-primitive":116,"./_typed":119,"./_typed-buffer":118,"./_uid":120,"./_wks":125,"./core.get-iterator-method":126,"./es6.array.iterator":137}],118:[function(citationRequire,module,exports){ 'use strict'; var global = citationRequire('./_global'); var DESCRIPTORS = citationRequire('./_descriptors'); var LIBRARY = citationRequire('./_library'); var $typed = citationRequire('./_typed'); var hide = citationRequire('./_hide'); var redefineAll = citationRequire('./_redefine-all'); var fails = citationRequire('./_fails'); var anInstance = citationRequire('./_an-instance'); var toInteger = citationRequire('./_to-integer'); var toLength = citationRequire('./_to-length'); var toIndex = citationRequire('./_to-index'); var gOPN = citationRequire('./_object-gopn').f; var dP = citationRequire('./_object-dp').f; var arrayFill = citationRequire('./_array-fill'); var setToStringTag = citationRequire('./_set-to-string-tag'); var ARRAY_BUFFER = 'ArrayBuffer'; var DATA_VIEW = 'DataView'; var PROTOTYPE = 'prototype'; var WRONG_LENGTH = 'Wrong length!'; var WRONG_INDEX = 'Wrong index!'; var $ArrayBuffer = global[ARRAY_BUFFER]; var $DataView = global[DATA_VIEW]; var Math = global.Math; var RangeError = global.RangeError; // eslint-disable-next-line no-shadow-restricted-names var Infinity = global.Infinity; var BaseBuffer = $ArrayBuffer; var abs = Math.abs; var pow = Math.pow; var floor = Math.floor; var log = Math.log; var LN2 = Math.LN2; var BUFFER = 'buffer'; var BYTE_LENGTH = 'byteLength'; var BYTE_OFFSET = 'byteOffset'; var $BUFFER = DESCRIPTORS ? '_b' : BUFFER; var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH; var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; // IEEE754 conversions based on https://github.com/feross/ieee754 function packIEEE754(value, mLen, nBytes) { var buffer = new Array(nBytes); var eLen = nBytes * 8 - mLen - 1; var eMax = (1 << eLen) - 1; var eBias = eMax >> 1; var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0; var i = 0; var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; var e, m, c; value = abs(value); // eslint-disable-next-line no-self-compare if (value != value || value === Infinity) { // eslint-disable-next-line no-self-compare m = value != value ? 1 : 0; e = eMax; } else { e = floor(log(value) / LN2); if (value * (c = pow(2, -e)) < 1) { e--; c *= 2; } if (e + eBias >= 1) { value += rt / c; } else { value += rt * pow(2, 1 - eBias); } if (value * c >= 2) { e++; c /= 2; } if (e + eBias >= eMax) { m = 0; e = eMax; } else if (e + eBias >= 1) { m = (value * c - 1) * pow(2, mLen); e = e + eBias; } else { m = value * pow(2, eBias - 1) * pow(2, mLen); e = 0; } } for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); e = e << mLen | m; eLen += mLen; for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); buffer[--i] |= s * 128; return buffer; } function unpackIEEE754(buffer, mLen, nBytes) { var eLen = nBytes * 8 - mLen - 1; var eMax = (1 << eLen) - 1; var eBias = eMax >> 1; var nBits = eLen - 7; var i = nBytes - 1; var s = buffer[i--]; var e = s & 127; var m; s >>= 7; for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); m = e & (1 << -nBits) - 1; e >>= -nBits; nBits += mLen; for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); if (e === 0) { e = 1 - eBias; } else if (e === eMax) { return m ? NaN : s ? -Infinity : Infinity; } else { m = m + pow(2, mLen); e = e - eBias; } return (s ? -1 : 1) * m * pow(2, e - mLen); } function unpackI32(bytes) { return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; } function packI8(it) { return [it & 0xff]; } function packI16(it) { return [it & 0xff, it >> 8 & 0xff]; } function packI32(it) { return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; } function packF64(it) { return packIEEE754(it, 52, 8); } function packF32(it) { return packIEEE754(it, 23, 4); } function addGetter(C, key, internal) { dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } }); } function get(view, bytes, index, isLittleEndian) { var numIndex = +index; var intIndex = toIndex(numIndex); if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); var store = view[$BUFFER]._b; var start = intIndex + view[$OFFSET]; var pack = store.slice(start, start + bytes); return isLittleEndian ? pack : pack.reverse(); } function set(view, bytes, index, conversion, value, isLittleEndian) { var numIndex = +index; var intIndex = toIndex(numIndex); if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); var store = view[$BUFFER]._b; var start = intIndex + view[$OFFSET]; var pack = conversion(+value); for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; } if (!$typed.ABV) { $ArrayBuffer = function ArrayBuffer(length) { anInstance(this, $ArrayBuffer, ARRAY_BUFFER); var byteLength = toIndex(length); this._b = arrayFill.call(new Array(byteLength), 0); this[$LENGTH] = byteLength; }; $DataView = function DataView(buffer, byteOffset, byteLength) { anInstance(this, $DataView, DATA_VIEW); anInstance(buffer, $ArrayBuffer, DATA_VIEW); var bufferLength = buffer[$LENGTH]; var offset = toInteger(byteOffset); if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!'); byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); this[$BUFFER] = buffer; this[$OFFSET] = offset; this[$LENGTH] = byteLength; }; if (DESCRIPTORS) { addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); addGetter($DataView, BUFFER, '_b'); addGetter($DataView, BYTE_LENGTH, '_l'); addGetter($DataView, BYTE_OFFSET, '_o'); } redefineAll($DataView[PROTOTYPE], { getInt8: function getInt8(byteOffset) { return get(this, 1, byteOffset)[0] << 24 >> 24; }, getUint8: function getUint8(byteOffset) { return get(this, 1, byteOffset)[0]; }, getInt16: function getInt16(byteOffset /* , littleEndian */) { var bytes = get(this, 2, byteOffset, arguments[1]); return (bytes[1] << 8 | bytes[0]) << 16 >> 16; }, getUint16: function getUint16(byteOffset /* , littleEndian */) { var bytes = get(this, 2, byteOffset, arguments[1]); return bytes[1] << 8 | bytes[0]; }, getInt32: function getInt32(byteOffset /* , littleEndian */) { return unpackI32(get(this, 4, byteOffset, arguments[1])); }, getUint32: function getUint32(byteOffset /* , littleEndian */) { return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; }, getFloat32: function getFloat32(byteOffset /* , littleEndian */) { return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); }, getFloat64: function getFloat64(byteOffset /* , littleEndian */) { return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); }, setInt8: function setInt8(byteOffset, value) { set(this, 1, byteOffset, packI8, value); }, setUint8: function setUint8(byteOffset, value) { set(this, 1, byteOffset, packI8, value); }, setInt16: function setInt16(byteOffset, value /* , littleEndian */) { set(this, 2, byteOffset, packI16, value, arguments[2]); }, setUint16: function setUint16(byteOffset, value /* , littleEndian */) { set(this, 2, byteOffset, packI16, value, arguments[2]); }, setInt32: function setInt32(byteOffset, value /* , littleEndian */) { set(this, 4, byteOffset, packI32, value, arguments[2]); }, setUint32: function setUint32(byteOffset, value /* , littleEndian */) { set(this, 4, byteOffset, packI32, value, arguments[2]); }, setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { set(this, 4, byteOffset, packF32, value, arguments[2]); }, setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { set(this, 8, byteOffset, packF64, value, arguments[2]); } }); } else { if (!fails(function () { $ArrayBuffer(1); }) || !fails(function () { new $ArrayBuffer(-1); // eslint-disable-line no-new }) || fails(function () { new $ArrayBuffer(); // eslint-disable-line no-new new $ArrayBuffer(1.5); // eslint-disable-line no-new new $ArrayBuffer(NaN); // eslint-disable-line no-new return $ArrayBuffer.name != ARRAY_BUFFER; })) { $ArrayBuffer = function ArrayBuffer(length) { anInstance(this, $ArrayBuffer); return new BaseBuffer(toIndex(length)); }; var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) { if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]); } if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer; } // iOS Safari 7.x bug var view = new $DataView(new $ArrayBuffer(2)); var $setInt8 = $DataView[PROTOTYPE].setInt8; view.setInt8(0, 2147483648); view.setInt8(1, 2147483649); if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], { setInt8: function setInt8(byteOffset, value) { $setInt8.call(this, byteOffset, value << 24 >> 24); }, setUint8: function setUint8(byteOffset, value) { $setInt8.call(this, byteOffset, value << 24 >> 24); } }, true); } setToStringTag($ArrayBuffer, ARRAY_BUFFER); setToStringTag($DataView, DATA_VIEW); hide($DataView[PROTOTYPE], $typed.VIEW, true); exports[ARRAY_BUFFER] = $ArrayBuffer; exports[DATA_VIEW] = $DataView; },{"./_an-instance":14,"./_array-fill":17,"./_descriptors":35,"./_fails":41,"./_global":45,"./_hide":47,"./_library":64,"./_object-dp":74,"./_object-gopn":78,"./_redefine-all":92,"./_set-to-string-tag":97,"./_to-index":111,"./_to-integer":112,"./_to-length":114,"./_typed":119}],119:[function(citationRequire,module,exports){ var global = citationRequire('./_global'); var hide = citationRequire('./_hide'); var uid = citationRequire('./_uid'); var TYPED = uid('typed_array'); var VIEW = uid('view'); var ABV = !!(global.ArrayBuffer && global.DataView); var CONSTR = ABV; var i = 0; var l = 9; var Typed; var TypedArrayConstructors = ( 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' ).split(','); while (i < l) { if (Typed = global[TypedArrayConstructors[i++]]) { hide(Typed.prototype, TYPED, true); hide(Typed.prototype, VIEW, true); } else CONSTR = false; } module.exports = { ABV: ABV, CONSTR: CONSTR, TYPED: TYPED, VIEW: VIEW }; },{"./_global":45,"./_hide":47,"./_uid":120}],120:[function(citationRequire,module,exports){ var id = 0; var px = Math.random(); module.exports = function (key) { return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); }; },{}],121:[function(citationRequire,module,exports){ var global = citationRequire('./_global'); var navigator = global.navigator; module.exports = navigator && navigator.userAgent || ''; },{"./_global":45}],122:[function(citationRequire,module,exports){ var isObject = citationRequire('./_is-object'); module.exports = function (it, TYPE) { if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' citationRequired!'); return it; }; },{"./_is-object":56}],123:[function(citationRequire,module,exports){ var global = citationRequire('./_global'); var core = citationRequire('./_core'); var LIBRARY = citationRequire('./_library'); var wksExt = citationRequire('./_wks-ext'); var defineProperty = citationRequire('./_object-dp').f; module.exports = function (name) { var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); }; },{"./_core":29,"./_global":45,"./_library":64,"./_object-dp":74,"./_wks-ext":124}],124:[function(citationRequire,module,exports){ exports.f = citationRequire('./_wks'); },{"./_wks":125}],125:[function(citationRequire,module,exports){ var store = citationRequire('./_shared')('wks'); var uid = citationRequire('./_uid'); var Symbol = citationRequire('./_global').Symbol; var USE_SYMBOL = typeof Symbol == 'function'; var $exports = module.exports = function (name) { return store[name] || (store[name] = USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); }; $exports.store = store; },{"./_global":45,"./_shared":99,"./_uid":120}],126:[function(citationRequire,module,exports){ var classof = citationRequire('./_classof'); var ITERATOR = citationRequire('./_wks')('iterator'); var Iterators = citationRequire('./_iterators'); module.exports = citationRequire('./_core').getIteratorMethod = function (it) { if (it != undefined) return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)]; }; },{"./_classof":24,"./_core":29,"./_iterators":63,"./_wks":125}],127:[function(citationRequire,module,exports){ // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) var $export = citationRequire('./_export'); $export($export.P, 'Array', { copyWithin: citationRequire('./_array-copy-within') }); citationRequire('./_add-to-unscopables')('copyWithin'); },{"./_add-to-unscopables":13,"./_array-copy-within":16,"./_export":39}],128:[function(citationRequire,module,exports){ 'use strict'; var $export = citationRequire('./_export'); var $every = citationRequire('./_array-methods')(4); $export($export.P + $export.F * !citationRequire('./_strict-method')([].every, true), 'Array', { // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) every: function every(callbackfn /* , thisArg */) { return $every(this, callbackfn, arguments[1]); } }); },{"./_array-methods":19,"./_export":39,"./_strict-method":101}],129:[function(citationRequire,module,exports){ // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) var $export = citationRequire('./_export'); $export($export.P, 'Array', { fill: citationRequire('./_array-fill') }); citationRequire('./_add-to-unscopables')('fill'); },{"./_add-to-unscopables":13,"./_array-fill":17,"./_export":39}],130:[function(citationRequire,module,exports){ 'use strict'; var $export = citationRequire('./_export'); var $filter = citationRequire('./_array-methods')(2); $export($export.P + $export.F * !citationRequire('./_strict-method')([].filter, true), 'Array', { // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) filter: function filter(callbackfn /* , thisArg */) { return $filter(this, callbackfn, arguments[1]); } }); },{"./_array-methods":19,"./_export":39,"./_strict-method":101}],131:[function(citationRequire,module,exports){ 'use strict'; // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) var $export = citationRequire('./_export'); var $find = citationRequire('./_array-methods')(6); var KEY = 'findIndex'; var forced = true; // Shouldn't skip holes if (KEY in []) Array(1)[KEY](function () { forced = false; }); $export($export.P + $export.F * forced, 'Array', { findIndex: function findIndex(callbackfn /* , that = undefined */) { return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); citationRequire('./_add-to-unscopables')(KEY); },{"./_add-to-unscopables":13,"./_array-methods":19,"./_export":39}],132:[function(citationRequire,module,exports){ 'use strict'; // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) var $export = citationRequire('./_export'); var $find = citationRequire('./_array-methods')(5); var KEY = 'find'; var forced = true; // Shouldn't skip holes if (KEY in []) Array(1)[KEY](function () { forced = false; }); $export($export.P + $export.F * forced, 'Array', { find: function find(callbackfn /* , that = undefined */) { return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); citationRequire('./_add-to-unscopables')(KEY); },{"./_add-to-unscopables":13,"./_array-methods":19,"./_export":39}],133:[function(citationRequire,module,exports){ 'use strict'; var $export = citationRequire('./_export'); var $forEach = citationRequire('./_array-methods')(0); var STRICT = citationRequire('./_strict-method')([].forEach, true); $export($export.P + $export.F * !STRICT, 'Array', { // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) forEach: function forEach(callbackfn /* , thisArg */) { return $forEach(this, callbackfn, arguments[1]); } }); },{"./_array-methods":19,"./_export":39,"./_strict-method":101}],134:[function(citationRequire,module,exports){ 'use strict'; var ctx = citationRequire('./_ctx'); var $export = citationRequire('./_export'); var toObject = citationRequire('./_to-object'); var call = citationRequire('./_iter-call'); var isArrayIter = citationRequire('./_is-array-iter'); var toLength = citationRequire('./_to-length'); var createProperty = citationRequire('./_create-property'); var getIterFn = citationRequire('./core.get-iterator-method'); $export($export.S + $export.F * !citationRequire('./_iter-detect')(function (iter) { Array.from(iter); }), 'Array', { // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { var O = toObject(arrayLike); var C = typeof this == 'function' ? this : Array; var aLen = arguments.length; var mapfn = aLen > 1 ? arguments[1] : undefined; var mapping = mapfn !== undefined; var index = 0; var iterFn = getIterFn(O); var length, result, step, iterator; if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); // if object isn't iterable or it's array with default iterator - use simple case if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) { for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); } } else { length = toLength(O.length); for (result = new C(length); length > index; index++) { createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); } } result.length = index; return result; } }); },{"./_create-property":30,"./_ctx":31,"./_export":39,"./_is-array-iter":53,"./_iter-call":58,"./_iter-detect":61,"./_to-length":114,"./_to-object":115,"./core.get-iterator-method":126}],135:[function(citationRequire,module,exports){ 'use strict'; var $export = citationRequire('./_export'); var $indexOf = citationRequire('./_array-includes')(false); var $native = [].indexOf; var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; $export($export.P + $export.F * (NEGATIVE_ZERO || !citationRequire('./_strict-method')($native)), 'Array', { // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { return NEGATIVE_ZERO // convert -0 to +0 ? $native.apply(this, arguments) || 0 : $indexOf(this, searchElement, arguments[1]); } }); },{"./_array-includes":18,"./_export":39,"./_strict-method":101}],136:[function(citationRequire,module,exports){ // 22.1.2.2 / 15.4.3.2 Array.isArray(arg) var $export = citationRequire('./_export'); $export($export.S, 'Array', { isArray: citationRequire('./_is-array') }); },{"./_export":39,"./_is-array":54}],137:[function(citationRequire,module,exports){ 'use strict'; var addToUnscopables = citationRequire('./_add-to-unscopables'); var step = citationRequire('./_iter-step'); var Iterators = citationRequire('./_iterators'); var toIObject = citationRequire('./_to-iobject'); // 22.1.3.4 Array.prototype.entries() // 22.1.3.13 Array.prototype.keys() // 22.1.3.29 Array.prototype.values() // 22.1.3.30 Array.prototype[@@iterator]() module.exports = citationRequire('./_iter-define')(Array, 'Array', function (iterated, kind) { this._t = toIObject(iterated); // target this._i = 0; // next index this._k = kind; // kind // 22.1.5.2.1 %ArrayIteratorPrototype%.next() }, function () { var O = this._t; var kind = this._k; var index = this._i++; if (!O || index >= O.length) { this._t = undefined; return step(1); } if (kind == 'keys') return step(0, index); if (kind == 'values') return step(0, O[index]); return step(0, [index, O[index]]); }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) Iterators.Arguments = Iterators.Array; addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); },{"./_add-to-unscopables":13,"./_iter-define":60,"./_iter-step":62,"./_iterators":63,"./_to-iobject":113}],138:[function(citationRequire,module,exports){ 'use strict'; // 22.1.3.13 Array.prototype.join(separator) var $export = citationRequire('./_export'); var toIObject = citationRequire('./_to-iobject'); var arrayJoin = [].join; // fallback for not array-like strings $export($export.P + $export.F * (citationRequire('./_iobject') != Object || !citationRequire('./_strict-method')(arrayJoin)), 'Array', { join: function join(separator) { return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); } }); },{"./_export":39,"./_iobject":52,"./_strict-method":101,"./_to-iobject":113}],139:[function(citationRequire,module,exports){ 'use strict'; var $export = citationRequire('./_export'); var toIObject = citationRequire('./_to-iobject'); var toInteger = citationRequire('./_to-integer'); var toLength = citationRequire('./_to-length'); var $native = [].lastIndexOf; var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; $export($export.P + $export.F * (NEGATIVE_ZERO || !citationRequire('./_strict-method')($native)), 'Array', { // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { // convert -0 to +0 if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0; var O = toIObject(this); var length = toLength(O.length); var index = length - 1; if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1])); if (index < 0) index = length + index; for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0; return -1; } }); },{"./_export":39,"./_strict-method":101,"./_to-integer":112,"./_to-iobject":113,"./_to-length":114}],140:[function(citationRequire,module,exports){ 'use strict'; var $export = citationRequire('./_export'); var $map = citationRequire('./_array-methods')(1); $export($export.P + $export.F * !citationRequire('./_strict-method')([].map, true), 'Array', { // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) map: function map(callbackfn /* , thisArg */) { return $map(this, callbackfn, arguments[1]); } }); },{"./_array-methods":19,"./_export":39,"./_strict-method":101}],141:[function(citationRequire,module,exports){ 'use strict'; var $export = citationRequire('./_export'); var createProperty = citationRequire('./_create-property'); // WebKit Array.of isn't generic $export($export.S + $export.F * citationRequire('./_fails')(function () { function F() { /* empty */ } return !(Array.of.call(F) instanceof F); }), 'Array', { // 22.1.2.3 Array.of( ...items) of: function of(/* ...args */) { var index = 0; var aLen = arguments.length; var result = new (typeof this == 'function' ? this : Array)(aLen); while (aLen > index) createProperty(result, index, arguments[index++]); result.length = aLen; return result; } }); },{"./_create-property":30,"./_export":39,"./_fails":41}],142:[function(citationRequire,module,exports){ 'use strict'; var $export = citationRequire('./_export'); var $reduce = citationRequire('./_array-reduce'); $export($export.P + $export.F * !citationRequire('./_strict-method')([].reduceRight, true), 'Array', { // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) reduceRight: function reduceRight(callbackfn /* , initialValue */) { return $reduce(this, callbackfn, arguments.length, arguments[1], true); } }); },{"./_array-reduce":20,"./_export":39,"./_strict-method":101}],143:[function(citationRequire,module,exports){ 'use strict'; var $export = citationRequire('./_export'); var $reduce = citationRequire('./_array-reduce'); $export($export.P + $export.F * !citationRequire('./_strict-method')([].reduce, true), 'Array', { // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) reduce: function reduce(callbackfn /* , initialValue */) { return $reduce(this, callbackfn, arguments.length, arguments[1], false); } }); },{"./_array-reduce":20,"./_export":39,"./_strict-method":101}],144:[function(citationRequire,module,exports){ 'use strict'; var $export = citationRequire('./_export'); var html = citationRequire('./_html'); var cof = citationRequire('./_cof'); var toAbsoluteIndex = citationRequire('./_to-absolute-index'); var toLength = citationRequire('./_to-length'); var arraySlice = [].slice; // fallback for not array-like ES3 strings and DOM objects $export($export.P + $export.F * citationRequire('./_fails')(function () { if (html) arraySlice.call(html); }), 'Array', { slice: function slice(begin, end) { var len = toLength(this.length); var klass = cof(this); end = end === undefined ? len : end; if (klass == 'Array') return arraySlice.call(this, begin, end); var start = toAbsoluteIndex(begin, len); var upTo = toAbsoluteIndex(end, len); var size = toLength(upTo - start); var cloned = new Array(size); var i = 0; for (; i < size; i++) cloned[i] = klass == 'String' ? this.charAt(start + i) : this[start + i]; return cloned; } }); },{"./_cof":25,"./_export":39,"./_fails":41,"./_html":48,"./_to-absolute-index":110,"./_to-length":114}],145:[function(citationRequire,module,exports){ 'use strict'; var $export = citationRequire('./_export'); var $some = citationRequire('./_array-methods')(3); $export($export.P + $export.F * !citationRequire('./_strict-method')([].some, true), 'Array', { // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) some: function some(callbackfn /* , thisArg */) { return $some(this, callbackfn, arguments[1]); } }); },{"./_array-methods":19,"./_export":39,"./_strict-method":101}],146:[function(citationRequire,module,exports){ 'use strict'; var $export = citationRequire('./_export'); var aFunction = citationRequire('./_a-function'); var toObject = citationRequire('./_to-object'); var fails = citationRequire('./_fails'); var $sort = [].sort; var test = [1, 2, 3]; $export($export.P + $export.F * (fails(function () { // IE8- test.sort(undefined); }) || !fails(function () { // V8 bug test.sort(null); // Old WebKit }) || !citationRequire('./_strict-method')($sort)), 'Array', { // 22.1.3.25 Array.prototype.sort(comparefn) sort: function sort(comparefn) { return comparefn === undefined ? $sort.call(toObject(this)) : $sort.call(toObject(this), aFunction(comparefn)); } }); },{"./_a-function":11,"./_export":39,"./_fails":41,"./_strict-method":101,"./_to-object":115}],147:[function(citationRequire,module,exports){ citationRequire('./_set-species')('Array'); },{"./_set-species":96}],148:[function(citationRequire,module,exports){ // 20.3.3.1 / 15.9.4.4 Date.now() var $export = citationRequire('./_export'); $export($export.S, 'Date', { now: function () { return new Date().getTime(); } }); },{"./_export":39}],149:[function(citationRequire,module,exports){ // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() var $export = citationRequire('./_export'); var toISOString = citationRequire('./_date-to-iso-string'); // PhantomJS / old WebKit has a broken implementations $export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', { toISOString: toISOString }); },{"./_date-to-iso-string":32,"./_export":39}],150:[function(citationRequire,module,exports){ 'use strict'; var $export = citationRequire('./_export'); var toObject = citationRequire('./_to-object'); var toPrimitive = citationRequire('./_to-primitive'); $export($export.P + $export.F * citationRequire('./_fails')(function () { return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; }), 'Date', { // eslint-disable-next-line no-unused-vars toJSON: function toJSON(key) { var O = toObject(this); var pv = toPrimitive(O); return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); } }); },{"./_export":39,"./_fails":41,"./_to-object":115,"./_to-primitive":116}],151:[function(citationRequire,module,exports){ var TO_PRIMITIVE = citationRequire('./_wks')('toPrimitive'); var proto = Date.prototype; if (!(TO_PRIMITIVE in proto)) citationRequire('./_hide')(proto, TO_PRIMITIVE, citationRequire('./_date-to-primitive')); },{"./_date-to-primitive":33,"./_hide":47,"./_wks":125}],152:[function(citationRequire,module,exports){ var DateProto = Date.prototype; var INVALID_DATE = 'Invalid Date'; var TO_STRING = 'toString'; var $toString = DateProto[TO_STRING]; var getTime = DateProto.getTime; if (new Date(NaN) + '' != INVALID_DATE) { citationRequire('./_redefine')(DateProto, TO_STRING, function toString() { var value = getTime.call(this); // eslint-disable-next-line no-self-compare return value === value ? $toString.call(this) : INVALID_DATE; }); } },{"./_redefine":93}],153:[function(citationRequire,module,exports){ // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) var $export = citationRequire('./_export'); $export($export.P, 'Function', { bind: citationRequire('./_bind') }); },{"./_bind":23,"./_export":39}],154:[function(citationRequire,module,exports){ 'use strict'; var isObject = citationRequire('./_is-object'); var getPrototypeOf = citationRequire('./_object-gpo'); var HAS_INSTANCE = citationRequire('./_wks')('hasInstance'); var FunctionProto = Function.prototype; // 19.2.3.6 Function.prototype[@@hasInstance](V) if (!(HAS_INSTANCE in FunctionProto)) citationRequire('./_object-dp').f(FunctionProto, HAS_INSTANCE, { value: function (O) { if (typeof this != 'function' || !isObject(O)) return false; if (!isObject(this.prototype)) return O instanceof this; // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: while (O = getPrototypeOf(O)) if (this.prototype === O) return true; return false; } }); },{"./_is-object":56,"./_object-dp":74,"./_object-gpo":80,"./_wks":125}],155:[function(citationRequire,module,exports){ var dP = citationRequire('./_object-dp').f; var FProto = Function.prototype; var nameRE = /^\s*function ([^ (]*)/; var NAME = 'name'; // 19.2.4.2 name NAME in FProto || citationRequire('./_descriptors') && dP(FProto, NAME, { configurable: true, get: function () { try { return ('' + this).match(nameRE)[1]; } catch (e) { return ''; } } }); },{"./_descriptors":35,"./_object-dp":74}],156:[function(citationRequire,module,exports){ 'use strict'; var strong = citationRequire('./_collection-strong'); var validate = citationRequire('./_validate-collection'); var MAP = 'Map'; // 23.1 Map Objects module.exports = citationRequire('./_collection')(MAP, function (get) { return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; }, { // 23.1.3.6 Map.prototype.get(key) get: function get(key) { var entry = strong.getEntry(validate(this, MAP), key); return entry && entry.v; }, // 23.1.3.9 Map.prototype.set(key, value) set: function set(key, value) { return strong.def(validate(this, MAP), key === 0 ? 0 : key, value); } }, strong, true); },{"./_collection":28,"./_collection-strong":26,"./_validate-collection":122}],157:[function(citationRequire,module,exports){ // 20.2.2.3 Math.acosh(x) var $export = citationRequire('./_export'); var log1p = citationRequire('./_math-log1p'); var sqrt = Math.sqrt; var $acosh = Math.acosh; $export($export.S + $export.F * !($acosh // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 && Math.floor($acosh(Number.MAX_VALUE)) == 710 // Tor Browser bug: Math.acosh(Infinity) -> NaN && $acosh(Infinity) == Infinity ), 'Math', { acosh: function acosh(x) { return (x = +x) < 1 ? NaN : x > 94906265.62425156 ? Math.log(x) + Math.LN2 : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); } }); },{"./_export":39,"./_math-log1p":67}],158:[function(citationRequire,module,exports){ // 20.2.2.5 Math.asinh(x) var $export = citationRequire('./_export'); var $asinh = Math.asinh; function asinh(x) { return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); } // Tor Browser bug: Math.asinh(0) -> -0 $export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh }); },{"./_export":39}],159:[function(citationRequire,module,exports){ // 20.2.2.7 Math.atanh(x) var $export = citationRequire('./_export'); var $atanh = Math.atanh; // Tor Browser bug: Math.atanh(-0) -> 0 $export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { atanh: function atanh(x) { return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; } }); },{"./_export":39}],160:[function(citationRequire,module,exports){ // 20.2.2.9 Math.cbrt(x) var $export = citationRequire('./_export'); var sign = citationRequire('./_math-sign'); $export($export.S, 'Math', { cbrt: function cbrt(x) { return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); } }); },{"./_export":39,"./_math-sign":68}],161:[function(citationRequire,module,exports){ // 20.2.2.11 Math.clz32(x) var $export = citationRequire('./_export'); $export($export.S, 'Math', { clz32: function clz32(x) { return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; } }); },{"./_export":39}],162:[function(citationRequire,module,exports){ // 20.2.2.12 Math.cosh(x) var $export = citationRequire('./_export'); var exp = Math.exp; $export($export.S, 'Math', { cosh: function cosh(x) { return (exp(x = +x) + exp(-x)) / 2; } }); },{"./_export":39}],163:[function(citationRequire,module,exports){ // 20.2.2.14 Math.expm1(x) var $export = citationRequire('./_export'); var $expm1 = citationRequire('./_math-expm1'); $export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 }); },{"./_export":39,"./_math-expm1":65}],164:[function(citationRequire,module,exports){ // 20.2.2.16 Math.fround(x) var $export = citationRequire('./_export'); $export($export.S, 'Math', { fround: citationRequire('./_math-fround') }); },{"./_export":39,"./_math-fround":66}],165:[function(citationRequire,module,exports){ // 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) var $export = citationRequire('./_export'); var abs = Math.abs; $export($export.S, 'Math', { hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars var sum = 0; var i = 0; var aLen = arguments.length; var larg = 0; var arg, div; while (i < aLen) { arg = abs(arguments[i++]); if (larg < arg) { div = larg / arg; sum = sum * div * div + 1; larg = arg; } else if (arg > 0) { div = arg / larg; sum += div * div; } else sum += arg; } return larg === Infinity ? Infinity : larg * Math.sqrt(sum); } }); },{"./_export":39}],166:[function(citationRequire,module,exports){ // 20.2.2.18 Math.imul(x, y) var $export = citationRequire('./_export'); var $imul = Math.imul; // some WebKit versions fails with big numbers, some has wrong arity $export($export.S + $export.F * citationRequire('./_fails')(function () { return $imul(0xffffffff, 5) != -5 || $imul.length != 2; }), 'Math', { imul: function imul(x, y) { var UINT16 = 0xffff; var xn = +x; var yn = +y; var xl = UINT16 & xn; var yl = UINT16 & yn; return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); } }); },{"./_export":39,"./_fails":41}],167:[function(citationRequire,module,exports){ // 20.2.2.21 Math.log10(x) var $export = citationRequire('./_export'); $export($export.S, 'Math', { log10: function log10(x) { return Math.log(x) * Math.LOG10E; } }); },{"./_export":39}],168:[function(citationRequire,module,exports){ // 20.2.2.20 Math.log1p(x) var $export = citationRequire('./_export'); $export($export.S, 'Math', { log1p: citationRequire('./_math-log1p') }); },{"./_export":39,"./_math-log1p":67}],169:[function(citationRequire,module,exports){ // 20.2.2.22 Math.log2(x) var $export = citationRequire('./_export'); $export($export.S, 'Math', { log2: function log2(x) { return Math.log(x) / Math.LN2; } }); },{"./_export":39}],170:[function(citationRequire,module,exports){ // 20.2.2.28 Math.sign(x) var $export = citationRequire('./_export'); $export($export.S, 'Math', { sign: citationRequire('./_math-sign') }); },{"./_export":39,"./_math-sign":68}],171:[function(citationRequire,module,exports){ // 20.2.2.30 Math.sinh(x) var $export = citationRequire('./_export'); var expm1 = citationRequire('./_math-expm1'); var exp = Math.exp; // V8 near Chromium 38 has a problem with very small numbers $export($export.S + $export.F * citationRequire('./_fails')(function () { return !Math.sinh(-2e-17) != -2e-17; }), 'Math', { sinh: function sinh(x) { return Math.abs(x = +x) < 1 ? (expm1(x) - expm1(-x)) / 2 : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); } }); },{"./_export":39,"./_fails":41,"./_math-expm1":65}],172:[function(citationRequire,module,exports){ // 20.2.2.33 Math.tanh(x) var $export = citationRequire('./_export'); var expm1 = citationRequire('./_math-expm1'); var exp = Math.exp; $export($export.S, 'Math', { tanh: function tanh(x) { var a = expm1(x = +x); var b = expm1(-x); return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); } }); },{"./_export":39,"./_math-expm1":65}],173:[function(citationRequire,module,exports){ // 20.2.2.34 Math.trunc(x) var $export = citationRequire('./_export'); $export($export.S, 'Math', { trunc: function trunc(it) { return (it > 0 ? Math.floor : Math.ceil)(it); } }); },{"./_export":39}],174:[function(citationRequire,module,exports){ 'use strict'; var global = citationRequire('./_global'); var has = citationRequire('./_has'); var cof = citationRequire('./_cof'); var inheritIfcitationRequired = citationRequire('./_inherit-if-citationRequired'); var toPrimitive = citationRequire('./_to-primitive'); var fails = citationRequire('./_fails'); var gOPN = citationRequire('./_object-gopn').f; var gOPD = citationRequire('./_object-gopd').f; var dP = citationRequire('./_object-dp').f; var $trim = citationRequire('./_string-trim').trim; var NUMBER = 'Number'; var $Number = global[NUMBER]; var Base = $Number; var proto = $Number.prototype; // Opera ~12 has broken Object#toString var BROKEN_COF = cof(citationRequire('./_object-create')(proto)) == NUMBER; var TRIM = 'trim' in String.prototype; // 7.1.3 ToNumber(argument) var toNumber = function (argument) { var it = toPrimitive(argument, false); if (typeof it == 'string' && it.length > 2) { it = TRIM ? it.trim() : $trim(it, 3); var first = it.charCodeAt(0); var third, radix, maxCode; if (first === 43 || first === 45) { third = it.charCodeAt(2); if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix } else if (first === 48) { switch (it.charCodeAt(1)) { case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i default: return +it; } for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) { code = digits.charCodeAt(i); // parseInt parses a string to a first unavailable symbol // but ToNumber should return NaN if a string contains unavailable symbols if (code < 48 || code > maxCode) return NaN; } return parseInt(digits, radix); } } return +it; }; if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) { $Number = function Number(value) { var it = arguments.length < 1 ? 0 : value; var that = this; return that instanceof $Number // check on 1..constructor(foo) case && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER) ? inheritIfcitationRequired(new Base(toNumber(it)), that, $Number) : toNumber(it); }; for (var keys = citationRequire('./_descriptors') ? gOPN(Base) : ( // ES3: 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + // ES6 (in case, if modules with ES6 Number statics citationRequired before): 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' ).split(','), j = 0, key; keys.length > j; j++) { if (has(Base, key = keys[j]) && !has($Number, key)) { dP($Number, key, gOPD(Base, key)); } } $Number.prototype = proto; proto.constructor = $Number; citationRequire('./_redefine')(global, NUMBER, $Number); } },{"./_cof":25,"./_descriptors":35,"./_fails":41,"./_global":45,"./_has":46,"./_inherit-if-citationRequired":50,"./_object-create":73,"./_object-dp":74,"./_object-gopd":76,"./_object-gopn":78,"./_redefine":93,"./_string-trim":107,"./_to-primitive":116}],175:[function(citationRequire,module,exports){ // 20.1.2.1 Number.EPSILON var $export = citationRequire('./_export'); $export($export.S, 'Number', { EPSILON: Math.pow(2, -52) }); },{"./_export":39}],176:[function(citationRequire,module,exports){ // 20.1.2.2 Number.isFinite(number) var $export = citationRequire('./_export'); var _isFinite = citationRequire('./_global').isFinite; $export($export.S, 'Number', { isFinite: function isFinite(it) { return typeof it == 'number' && _isFinite(it); } }); },{"./_export":39,"./_global":45}],177:[function(citationRequire,module,exports){ // 20.1.2.3 Number.isInteger(number) var $export = citationRequire('./_export'); $export($export.S, 'Number', { isInteger: citationRequire('./_is-integer') }); },{"./_export":39,"./_is-integer":55}],178:[function(citationRequire,module,exports){ // 20.1.2.4 Number.isNaN(number) var $export = citationRequire('./_export'); $export($export.S, 'Number', { isNaN: function isNaN(number) { // eslint-disable-next-line no-self-compare return number != number; } }); },{"./_export":39}],179:[function(citationRequire,module,exports){ // 20.1.2.5 Number.isSafeInteger(number) var $export = citationRequire('./_export'); var isInteger = citationRequire('./_is-integer'); var abs = Math.abs; $export($export.S, 'Number', { isSafeInteger: function isSafeInteger(number) { return isInteger(number) && abs(number) <= 0x1fffffffffffff; } }); },{"./_export":39,"./_is-integer":55}],180:[function(citationRequire,module,exports){ // 20.1.2.6 Number.MAX_SAFE_INTEGER var $export = citationRequire('./_export'); $export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); },{"./_export":39}],181:[function(citationRequire,module,exports){ // 20.1.2.10 Number.MIN_SAFE_INTEGER var $export = citationRequire('./_export'); $export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff }); },{"./_export":39}],182:[function(citationRequire,module,exports){ var $export = citationRequire('./_export'); var $parseFloat = citationRequire('./_parse-float'); // 20.1.2.12 Number.parseFloat(string) $export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat }); },{"./_export":39,"./_parse-float":87}],183:[function(citationRequire,module,exports){ var $export = citationRequire('./_export'); var $parseInt = citationRequire('./_parse-int'); // 20.1.2.13 Number.parseInt(string, radix) $export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt }); },{"./_export":39,"./_parse-int":88}],184:[function(citationRequire,module,exports){ 'use strict'; var $export = citationRequire('./_export'); var toInteger = citationRequire('./_to-integer'); var aNumberValue = citationRequire('./_a-number-value'); var repeat = citationRequire('./_string-repeat'); var $toFixed = 1.0.toFixed; var floor = Math.floor; var data = [0, 0, 0, 0, 0, 0]; var ERROR = 'Number.toFixed: incorrect invocation!'; var ZERO = '0'; var multiply = function (n, c) { var i = -1; var c2 = c; while (++i < 6) { c2 += n * data[i]; data[i] = c2 % 1e7; c2 = floor(c2 / 1e7); } }; var divide = function (n) { var i = 6; var c = 0; while (--i >= 0) { c += data[i]; data[i] = floor(c / n); c = (c % n) * 1e7; } }; var numToString = function () { var i = 6; var s = ''; while (--i >= 0) { if (s !== '' || i === 0 || data[i] !== 0) { var t = String(data[i]); s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; } } return s; }; var pow = function (x, n, acc) { return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); }; var log = function (x) { var n = 0; var x2 = x; while (x2 >= 4096) { n += 12; x2 /= 4096; } while (x2 >= 2) { n += 1; x2 /= 2; } return n; }; $export($export.P + $export.F * (!!$toFixed && ( 0.00008.toFixed(3) !== '0.000' || 0.9.toFixed(0) !== '1' || 1.255.toFixed(2) !== '1.25' || 1000000000000000128.0.toFixed(0) !== '1000000000000000128' ) || !citationRequire('./_fails')(function () { // V8 ~ Android 4.3- $toFixed.call({}); })), 'Number', { toFixed: function toFixed(fractionDigits) { var x = aNumberValue(this, ERROR); var f = toInteger(fractionDigits); var s = ''; var m = ZERO; var e, z, j, k; if (f < 0 || f > 20) throw RangeError(ERROR); // eslint-disable-next-line no-self-compare if (x != x) return 'NaN'; if (x <= -1e21 || x >= 1e21) return String(x); if (x < 0) { s = '-'; x = -x; } if (x > 1e-21) { e = log(x * pow(2, 69, 1)) - 69; z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); z *= 0x10000000000000; e = 52 - e; if (e > 0) { multiply(0, z); j = f; while (j >= 7) { multiply(1e7, 0); j -= 7; } multiply(pow(10, j, 1), 0); j = e - 1; while (j >= 23) { divide(1 << 23); j -= 23; } divide(1 << j); multiply(1, 1); divide(2); m = numToString(); } else { multiply(0, z); multiply(1 << -e, 0); m = numToString() + repeat.call(ZERO, f); } } if (f > 0) { k = m.length; m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); } else { m = s + m; } return m; } }); },{"./_a-number-value":12,"./_export":39,"./_fails":41,"./_string-repeat":106,"./_to-integer":112}],185:[function(citationRequire,module,exports){ 'use strict'; var $export = citationRequire('./_export'); var $fails = citationRequire('./_fails'); var aNumberValue = citationRequire('./_a-number-value'); var $toPrecision = 1.0.toPrecision; $export($export.P + $export.F * ($fails(function () { // IE7- return $toPrecision.call(1, undefined) !== '1'; }) || !$fails(function () { // V8 ~ Android 4.3- $toPrecision.call({}); })), 'Number', { toPrecision: function toPrecision(precision) { var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); } }); },{"./_a-number-value":12,"./_export":39,"./_fails":41}],186:[function(citationRequire,module,exports){ // 19.1.3.1 Object.assign(target, source) var $export = citationRequire('./_export'); $export($export.S + $export.F, 'Object', { assign: citationRequire('./_object-assign') }); },{"./_export":39,"./_object-assign":72}],187:[function(citationRequire,module,exports){ var $export = citationRequire('./_export'); // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) $export($export.S, 'Object', { create: citationRequire('./_object-create') }); },{"./_export":39,"./_object-create":73}],188:[function(citationRequire,module,exports){ var $export = citationRequire('./_export'); // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) $export($export.S + $export.F * !citationRequire('./_descriptors'), 'Object', { defineProperties: citationRequire('./_object-dps') }); },{"./_descriptors":35,"./_export":39,"./_object-dps":75}],189:[function(citationRequire,module,exports){ var $export = citationRequire('./_export'); // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) $export($export.S + $export.F * !citationRequire('./_descriptors'), 'Object', { defineProperty: citationRequire('./_object-dp').f }); },{"./_descriptors":35,"./_export":39,"./_object-dp":74}],190:[function(citationRequire,module,exports){ // 19.1.2.5 Object.freeze(O) var isObject = citationRequire('./_is-object'); var meta = citationRequire('./_meta').onFreeze; citationRequire('./_object-sap')('freeze', function ($freeze) { return function freeze(it) { return $freeze && isObject(it) ? $freeze(meta(it)) : it; }; }); },{"./_is-object":56,"./_meta":69,"./_object-sap":84}],191:[function(citationRequire,module,exports){ // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) var toIObject = citationRequire('./_to-iobject'); var $getOwnPropertyDescriptor = citationRequire('./_object-gopd').f; citationRequire('./_object-sap')('getOwnPropertyDescriptor', function () { return function getOwnPropertyDescriptor(it, key) { return $getOwnPropertyDescriptor(toIObject(it), key); }; }); },{"./_object-gopd":76,"./_object-sap":84,"./_to-iobject":113}],192:[function(citationRequire,module,exports){ // 19.1.2.7 Object.getOwnPropertyNames(O) citationRequire('./_object-sap')('getOwnPropertyNames', function () { return citationRequire('./_object-gopn-ext').f; }); },{"./_object-gopn-ext":77,"./_object-sap":84}],193:[function(citationRequire,module,exports){ // 19.1.2.9 Object.getPrototypeOf(O) var toObject = citationRequire('./_to-object'); var $getPrototypeOf = citationRequire('./_object-gpo'); citationRequire('./_object-sap')('getPrototypeOf', function () { return function getPrototypeOf(it) { return $getPrototypeOf(toObject(it)); }; }); },{"./_object-gpo":80,"./_object-sap":84,"./_to-object":115}],194:[function(citationRequire,module,exports){ // 19.1.2.11 Object.isExtensible(O) var isObject = citationRequire('./_is-object'); citationRequire('./_object-sap')('isExtensible', function ($isExtensible) { return function isExtensible(it) { return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; }; }); },{"./_is-object":56,"./_object-sap":84}],195:[function(citationRequire,module,exports){ // 19.1.2.12 Object.isFrozen(O) var isObject = citationRequire('./_is-object'); citationRequire('./_object-sap')('isFrozen', function ($isFrozen) { return function isFrozen(it) { return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; }; }); },{"./_is-object":56,"./_object-sap":84}],196:[function(citationRequire,module,exports){ // 19.1.2.13 Object.isSealed(O) var isObject = citationRequire('./_is-object'); citationRequire('./_object-sap')('isSealed', function ($isSealed) { return function isSealed(it) { return isObject(it) ? $isSealed ? $isSealed(it) : false : true; }; }); },{"./_is-object":56,"./_object-sap":84}],197:[function(citationRequire,module,exports){ // 19.1.3.10 Object.is(value1, value2) var $export = citationRequire('./_export'); $export($export.S, 'Object', { is: citationRequire('./_same-value') }); },{"./_export":39,"./_same-value":94}],198:[function(citationRequire,module,exports){ // 19.1.2.14 Object.keys(O) var toObject = citationRequire('./_to-object'); var $keys = citationRequire('./_object-keys'); citationRequire('./_object-sap')('keys', function () { return function keys(it) { return $keys(toObject(it)); }; }); },{"./_object-keys":82,"./_object-sap":84,"./_to-object":115}],199:[function(citationRequire,module,exports){ // 19.1.2.15 Object.preventExtensions(O) var isObject = citationRequire('./_is-object'); var meta = citationRequire('./_meta').onFreeze; citationRequire('./_object-sap')('preventExtensions', function ($preventExtensions) { return function preventExtensions(it) { return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; }; }); },{"./_is-object":56,"./_meta":69,"./_object-sap":84}],200:[function(citationRequire,module,exports){ // 19.1.2.17 Object.seal(O) var isObject = citationRequire('./_is-object'); var meta = citationRequire('./_meta').onFreeze; citationRequire('./_object-sap')('seal', function ($seal) { return function seal(it) { return $seal && isObject(it) ? $seal(meta(it)) : it; }; }); },{"./_is-object":56,"./_meta":69,"./_object-sap":84}],201:[function(citationRequire,module,exports){ // 19.1.3.19 Object.setPrototypeOf(O, proto) var $export = citationRequire('./_export'); $export($export.S, 'Object', { setPrototypeOf: citationRequire('./_set-proto').set }); },{"./_export":39,"./_set-proto":95}],202:[function(citationRequire,module,exports){ 'use strict'; // 19.1.3.6 Object.prototype.toString() var classof = citationRequire('./_classof'); var test = {}; test[citationRequire('./_wks')('toStringTag')] = 'z'; if (test + '' != '[object z]') { citationRequire('./_redefine')(Object.prototype, 'toString', function toString() { return '[object ' + classof(this) + ']'; }, true); } },{"./_classof":24,"./_redefine":93,"./_wks":125}],203:[function(citationRequire,module,exports){ var $export = citationRequire('./_export'); var $parseFloat = citationRequire('./_parse-float'); // 18.2.4 parseFloat(string) $export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat }); },{"./_export":39,"./_parse-float":87}],204:[function(citationRequire,module,exports){ var $export = citationRequire('./_export'); var $parseInt = citationRequire('./_parse-int'); // 18.2.5 parseInt(string, radix) $export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt }); },{"./_export":39,"./_parse-int":88}],205:[function(citationRequire,module,exports){ 'use strict'; var LIBRARY = citationRequire('./_library'); var global = citationRequire('./_global'); var ctx = citationRequire('./_ctx'); var classof = citationRequire('./_classof'); var $export = citationRequire('./_export'); var isObject = citationRequire('./_is-object'); var aFunction = citationRequire('./_a-function'); var anInstance = citationRequire('./_an-instance'); var forOf = citationRequire('./_for-of'); var speciesConstructor = citationRequire('./_species-constructor'); var task = citationRequire('./_task').set; var microtask = citationRequire('./_microtask')(); var newPromiseCapabilityModule = citationRequire('./_new-promise-capability'); var perform = citationRequire('./_perform'); var userAgent = citationRequire('./_user-agent'); var promiseResolve = citationRequire('./_promise-resolve'); var PROMISE = 'Promise'; var TypeError = global.TypeError; var process = global.process; var versions = process && process.versions; var v8 = versions && versions.v8 || ''; var $Promise = global[PROMISE]; var isNode = classof(process) == 'process'; var empty = function () { /* empty */ }; var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; var USE_NATIVE = !!function () { try { // correct subclassing with @@species support var promise = $Promise.resolve(1); var FakePromise = (promise.constructor = {})[citationRequire('./_wks')('species')] = function (exec) { exec(empty, empty); }; // unhandled rejections tracking support, NodeJS Promise without it fails @@species test return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 // we can't detect it synchronously, so just check versions && v8.indexOf('6.6') !== 0 && userAgent.indexOf('Chrome/66') === -1; } catch (e) { /* empty */ } }(); // helpers var isThenable = function (it) { var then; return isObject(it) && typeof (then = it.then) == 'function' ? then : false; }; var notify = function (promise, isReject) { if (promise._n) return; promise._n = true; var chain = promise._c; microtask(function () { var value = promise._v; var ok = promise._s == 1; var i = 0; var run = function (reaction) { var handler = ok ? reaction.ok : reaction.fail; var resolve = reaction.resolve; var reject = reaction.reject; var domain = reaction.domain; var result, then, exited; try { if (handler) { if (!ok) { if (promise._h == 2) onHandleUnhandled(promise); promise._h = 1; } if (handler === true) result = value; else { if (domain) domain.enter(); result = handler(value); // may throw if (domain) { domain.exit(); exited = true; } } if (result === reaction.promise) { reject(TypeError('Promise-chain cycle')); } else if (then = isThenable(result)) { then.call(result, resolve, reject); } else resolve(result); } else reject(value); } catch (e) { if (domain && !exited) domain.exit(); reject(e); } }; while (chain.length > i) run(chain[i++]); // variable length - can't use forEach promise._c = []; promise._n = false; if (isReject && !promise._h) onUnhandled(promise); }); }; var onUnhandled = function (promise) { task.call(global, function () { var value = promise._v; var unhandled = isUnhandled(promise); var result, handler, console; if (unhandled) { result = perform(function () { if (isNode) { process.emit('unhandledRejection', value, promise); } else if (handler = global.onunhandledrejection) { handler({ promise: promise, reason: value }); } else if ((console = global.console) && console.error) { console.error('Unhandled promise rejection', value); } }); // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should promise._h = isNode || isUnhandled(promise) ? 2 : 1; } promise._a = undefined; if (unhandled && result.e) throw result.v; }); }; var isUnhandled = function (promise) { return promise._h !== 1 && (promise._a || promise._c).length === 0; }; var onHandleUnhandled = function (promise) { task.call(global, function () { var handler; if (isNode) { process.emit('rejectionHandled', promise); } else if (handler = global.onrejectionhandled) { handler({ promise: promise, reason: promise._v }); } }); }; var $reject = function (value) { var promise = this; if (promise._d) return; promise._d = true; promise = promise._w || promise; // unwrap promise._v = value; promise._s = 2; if (!promise._a) promise._a = promise._c.slice(); notify(promise, true); }; var $resolve = function (value) { var promise = this; var then; if (promise._d) return; promise._d = true; promise = promise._w || promise; // unwrap try { if (promise === value) throw TypeError("Promise can't be resolved itself"); if (then = isThenable(value)) { microtask(function () { var wrapper = { _w: promise, _d: false }; // wrap try { then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); } catch (e) { $reject.call(wrapper, e); } }); } else { promise._v = value; promise._s = 1; notify(promise, false); } } catch (e) { $reject.call({ _w: promise, _d: false }, e); // wrap } }; // constructor polyfill if (!USE_NATIVE) { // 25.4.3.1 Promise(executor) $Promise = function Promise(executor) { anInstance(this, $Promise, PROMISE, '_h'); aFunction(executor); Internal.call(this); try { executor(ctx($resolve, this, 1), ctx($reject, this, 1)); } catch (err) { $reject.call(this, err); } }; // eslint-disable-next-line no-unused-vars Internal = function Promise(executor) { this._c = []; // <- awaiting reactions this._a = undefined; // <- checked in isUnhandled reactions this._s = 0; // <- state this._d = false; // <- done this._v = undefined; // <- value this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled this._n = false; // <- notify }; Internal.prototype = citationRequire('./_redefine-all')($Promise.prototype, { // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) then: function then(onFulfilled, onRejected) { var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; reaction.fail = typeof onRejected == 'function' && onRejected; reaction.domain = isNode ? process.domain : undefined; this._c.push(reaction); if (this._a) this._a.push(reaction); if (this._s) notify(this, false); return reaction.promise; }, // 25.4.5.1 Promise.prototype.catch(onRejected) 'catch': function (onRejected) { return this.then(undefined, onRejected); } }); OwnPromiseCapability = function () { var promise = new Internal(); this.promise = promise; this.resolve = ctx($resolve, promise, 1); this.reject = ctx($reject, promise, 1); }; newPromiseCapabilityModule.f = newPromiseCapability = function (C) { return C === $Promise || C === Wrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C); }; } $export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); citationRequire('./_set-to-string-tag')($Promise, PROMISE); citationRequire('./_set-species')(PROMISE); Wrapper = citationRequire('./_core')[PROMISE]; // statics $export($export.S + $export.F * !USE_NATIVE, PROMISE, { // 25.4.4.5 Promise.reject(r) reject: function reject(r) { var capability = newPromiseCapability(this); var $$reject = capability.reject; $$reject(r); return capability.promise; } }); $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { // 25.4.4.6 Promise.resolve(x) resolve: function resolve(x) { return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); } }); $export($export.S + $export.F * !(USE_NATIVE && citationRequire('./_iter-detect')(function (iter) { $Promise.all(iter)['catch'](empty); })), PROMISE, { // 25.4.4.1 Promise.all(iterable) all: function all(iterable) { var C = this; var capability = newPromiseCapability(C); var resolve = capability.resolve; var reject = capability.reject; var result = perform(function () { var values = []; var index = 0; var remaining = 1; forOf(iterable, false, function (promise) { var $index = index++; var alreadyCalled = false; values.push(undefined); remaining++; C.resolve(promise).then(function (value) { if (alreadyCalled) return; alreadyCalled = true; values[$index] = value; --remaining || resolve(values); }, reject); }); --remaining || resolve(values); }); if (result.e) reject(result.v); return capability.promise; }, // 25.4.4.4 Promise.race(iterable) race: function race(iterable) { var C = this; var capability = newPromiseCapability(C); var reject = capability.reject; var result = perform(function () { forOf(iterable, false, function (promise) { C.resolve(promise).then(capability.resolve, reject); }); }); if (result.e) reject(result.v); return capability.promise; } }); },{"./_a-function":11,"./_an-instance":14,"./_classof":24,"./_core":29,"./_ctx":31,"./_export":39,"./_for-of":44,"./_global":45,"./_is-object":56,"./_iter-detect":61,"./_library":64,"./_microtask":70,"./_new-promise-capability":71,"./_perform":89,"./_promise-resolve":90,"./_redefine-all":92,"./_set-species":96,"./_set-to-string-tag":97,"./_species-constructor":100,"./_task":109,"./_user-agent":121,"./_wks":125}],206:[function(citationRequire,module,exports){ // 26.1.1 Reflect.apply(target, thisArgument, argumentsList) var $export = citationRequire('./_export'); var aFunction = citationRequire('./_a-function'); var anObject = citationRequire('./_an-object'); var rApply = (citationRequire('./_global').Reflect || {}).apply; var fApply = Function.apply; // MS Edge argumentsList argument is optional $export($export.S + $export.F * !citationRequire('./_fails')(function () { rApply(function () { /* empty */ }); }), 'Reflect', { apply: function apply(target, thisArgument, argumentsList) { var T = aFunction(target); var L = anObject(argumentsList); return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); } }); },{"./_a-function":11,"./_an-object":15,"./_export":39,"./_fails":41,"./_global":45}],207:[function(citationRequire,module,exports){ // 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) var $export = citationRequire('./_export'); var create = citationRequire('./_object-create'); var aFunction = citationRequire('./_a-function'); var anObject = citationRequire('./_an-object'); var isObject = citationRequire('./_is-object'); var fails = citationRequire('./_fails'); var bind = citationRequire('./_bind'); var rConstruct = (citationRequire('./_global').Reflect || {}).construct; // MS Edge supports only 2 arguments and argumentsList argument is optional // FF Nightly sets third argument as `new.target`, but does not create `this` from it var NEW_TARGET_BUG = fails(function () { function F() { /* empty */ } return !(rConstruct(function () { /* empty */ }, [], F) instanceof F); }); var ARGS_BUG = !fails(function () { rConstruct(function () { /* empty */ }); }); $export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { construct: function construct(Target, args /* , newTarget */) { aFunction(Target); anObject(args); var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget); if (Target == newTarget) { // w/o altered newTarget, optimization for 0-4 arguments switch (args.length) { case 0: return new Target(); case 1: return new Target(args[0]); case 2: return new Target(args[0], args[1]); case 3: return new Target(args[0], args[1], args[2]); case 4: return new Target(args[0], args[1], args[2], args[3]); } // w/o altered newTarget, lot of arguments case var $args = [null]; $args.push.apply($args, args); return new (bind.apply(Target, $args))(); } // with altered newTarget, not support built-in constructors var proto = newTarget.prototype; var instance = create(isObject(proto) ? proto : Object.prototype); var result = Function.apply.call(Target, instance, args); return isObject(result) ? result : instance; } }); },{"./_a-function":11,"./_an-object":15,"./_bind":23,"./_export":39,"./_fails":41,"./_global":45,"./_is-object":56,"./_object-create":73}],208:[function(citationRequire,module,exports){ // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) var dP = citationRequire('./_object-dp'); var $export = citationRequire('./_export'); var anObject = citationRequire('./_an-object'); var toPrimitive = citationRequire('./_to-primitive'); // MS Edge has broken Reflect.defineProperty - throwing instead of returning false $export($export.S + $export.F * citationRequire('./_fails')(function () { // eslint-disable-next-line no-undef Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 }); }), 'Reflect', { defineProperty: function defineProperty(target, propertyKey, attributes) { anObject(target); propertyKey = toPrimitive(propertyKey, true); anObject(attributes); try { dP.f(target, propertyKey, attributes); return true; } catch (e) { return false; } } }); },{"./_an-object":15,"./_export":39,"./_fails":41,"./_object-dp":74,"./_to-primitive":116}],209:[function(citationRequire,module,exports){ // 26.1.4 Reflect.deleteProperty(target, propertyKey) var $export = citationRequire('./_export'); var gOPD = citationRequire('./_object-gopd').f; var anObject = citationRequire('./_an-object'); $export($export.S, 'Reflect', { deleteProperty: function deleteProperty(target, propertyKey) { var desc = gOPD(anObject(target), propertyKey); return desc && !desc.configurable ? false : delete target[propertyKey]; } }); },{"./_an-object":15,"./_export":39,"./_object-gopd":76}],210:[function(citationRequire,module,exports){ 'use strict'; // 26.1.5 Reflect.enumerate(target) var $export = citationRequire('./_export'); var anObject = citationRequire('./_an-object'); var Enumerate = function (iterated) { this._t = anObject(iterated); // target this._i = 0; // next index var keys = this._k = []; // keys var key; for (key in iterated) keys.push(key); }; citationRequire('./_iter-create')(Enumerate, 'Object', function () { var that = this; var keys = that._k; var key; do { if (that._i >= keys.length) return { value: undefined, done: true }; } while (!((key = keys[that._i++]) in that._t)); return { value: key, done: false }; }); $export($export.S, 'Reflect', { enumerate: function enumerate(target) { return new Enumerate(target); } }); },{"./_an-object":15,"./_export":39,"./_iter-create":59}],211:[function(citationRequire,module,exports){ // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) var gOPD = citationRequire('./_object-gopd'); var $export = citationRequire('./_export'); var anObject = citationRequire('./_an-object'); $export($export.S, 'Reflect', { getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { return gOPD.f(anObject(target), propertyKey); } }); },{"./_an-object":15,"./_export":39,"./_object-gopd":76}],212:[function(citationRequire,module,exports){ // 26.1.8 Reflect.getPrototypeOf(target) var $export = citationRequire('./_export'); var getProto = citationRequire('./_object-gpo'); var anObject = citationRequire('./_an-object'); $export($export.S, 'Reflect', { getPrototypeOf: function getPrototypeOf(target) { return getProto(anObject(target)); } }); },{"./_an-object":15,"./_export":39,"./_object-gpo":80}],213:[function(citationRequire,module,exports){ // 26.1.6 Reflect.get(target, propertyKey [, receiver]) var gOPD = citationRequire('./_object-gopd'); var getPrototypeOf = citationRequire('./_object-gpo'); var has = citationRequire('./_has'); var $export = citationRequire('./_export'); var isObject = citationRequire('./_is-object'); var anObject = citationRequire('./_an-object'); function get(target, propertyKey /* , receiver */) { var receiver = arguments.length < 3 ? target : arguments[2]; var desc, proto; if (anObject(target) === receiver) return target[propertyKey]; if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value') ? desc.value : desc.get !== undefined ? desc.get.call(receiver) : undefined; if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver); } $export($export.S, 'Reflect', { get: get }); },{"./_an-object":15,"./_export":39,"./_has":46,"./_is-object":56,"./_object-gopd":76,"./_object-gpo":80}],214:[function(citationRequire,module,exports){ // 26.1.9 Reflect.has(target, propertyKey) var $export = citationRequire('./_export'); $export($export.S, 'Reflect', { has: function has(target, propertyKey) { return propertyKey in target; } }); },{"./_export":39}],215:[function(citationRequire,module,exports){ // 26.1.10 Reflect.isExtensible(target) var $export = citationRequire('./_export'); var anObject = citationRequire('./_an-object'); var $isExtensible = Object.isExtensible; $export($export.S, 'Reflect', { isExtensible: function isExtensible(target) { anObject(target); return $isExtensible ? $isExtensible(target) : true; } }); },{"./_an-object":15,"./_export":39}],216:[function(citationRequire,module,exports){ // 26.1.11 Reflect.ownKeys(target) var $export = citationRequire('./_export'); $export($export.S, 'Reflect', { ownKeys: citationRequire('./_own-keys') }); },{"./_export":39,"./_own-keys":86}],217:[function(citationRequire,module,exports){ // 26.1.12 Reflect.preventExtensions(target) var $export = citationRequire('./_export'); var anObject = citationRequire('./_an-object'); var $preventExtensions = Object.preventExtensions; $export($export.S, 'Reflect', { preventExtensions: function preventExtensions(target) { anObject(target); try { if ($preventExtensions) $preventExtensions(target); return true; } catch (e) { return false; } } }); },{"./_an-object":15,"./_export":39}],218:[function(citationRequire,module,exports){ // 26.1.14 Reflect.setPrototypeOf(target, proto) var $export = citationRequire('./_export'); var setProto = citationRequire('./_set-proto'); if (setProto) $export($export.S, 'Reflect', { setPrototypeOf: function setPrototypeOf(target, proto) { setProto.check(target, proto); try { setProto.set(target, proto); return true; } catch (e) { return false; } } }); },{"./_export":39,"./_set-proto":95}],219:[function(citationRequire,module,exports){ // 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) var dP = citationRequire('./_object-dp'); var gOPD = citationRequire('./_object-gopd'); var getPrototypeOf = citationRequire('./_object-gpo'); var has = citationRequire('./_has'); var $export = citationRequire('./_export'); var createDesc = citationRequire('./_property-desc'); var anObject = citationRequire('./_an-object'); var isObject = citationRequire('./_is-object'); function set(target, propertyKey, V /* , receiver */) { var receiver = arguments.length < 4 ? target : arguments[3]; var ownDesc = gOPD.f(anObject(target), propertyKey); var existingDescriptor, proto; if (!ownDesc) { if (isObject(proto = getPrototypeOf(target))) { return set(proto, propertyKey, V, receiver); } ownDesc = createDesc(0); } if (has(ownDesc, 'value')) { if (ownDesc.writable === false || !isObject(receiver)) return false; if (existingDescriptor = gOPD.f(receiver, propertyKey)) { if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false; existingDescriptor.value = V; dP.f(receiver, propertyKey, existingDescriptor); } else dP.f(receiver, propertyKey, createDesc(0, V)); return true; } return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); } $export($export.S, 'Reflect', { set: set }); },{"./_an-object":15,"./_export":39,"./_has":46,"./_is-object":56,"./_object-dp":74,"./_object-gopd":76,"./_object-gpo":80,"./_property-desc":91}],220:[function(citationRequire,module,exports){ var global = citationRequire('./_global'); var inheritIfcitationRequired = citationRequire('./_inherit-if-citationRequired'); var dP = citationRequire('./_object-dp').f; var gOPN = citationRequire('./_object-gopn').f; var isRegExp = citationRequire('./_is-regexp'); var $flags = citationRequire('./_flags'); var $RegExp = global.RegExp; var Base = $RegExp; var proto = $RegExp.prototype; var re1 = /a/g; var re2 = /a/g; // "new" creates a new object, old webkit buggy here var CORRECT_NEW = new $RegExp(re1) !== re1; if (citationRequire('./_descriptors') && (!CORRECT_NEW || citationRequire('./_fails')(function () { re2[citationRequire('./_wks')('match')] = false; // RegExp constructor can alter flags and IsRegExp works correct with @@match return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i'; }))) { $RegExp = function RegExp(p, f) { var tiRE = this instanceof $RegExp; var piRE = isRegExp(p); var fiU = f === undefined; return !tiRE && piRE && p.constructor === $RegExp && fiU ? p : inheritIfcitationRequired(CORRECT_NEW ? new Base(piRE && !fiU ? p.source : p, f) : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f) , tiRE ? this : proto, $RegExp); }; var proxy = function (key) { key in $RegExp || dP($RegExp, key, { configurable: true, get: function () { return Base[key]; }, set: function (it) { Base[key] = it; } }); }; for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]); proto.constructor = $RegExp; $RegExp.prototype = proto; citationRequire('./_redefine')(global, 'RegExp', $RegExp); } citationRequire('./_set-species')('RegExp'); },{"./_descriptors":35,"./_fails":41,"./_flags":43,"./_global":45,"./_inherit-if-citationRequired":50,"./_is-regexp":57,"./_object-dp":74,"./_object-gopn":78,"./_redefine":93,"./_set-species":96,"./_wks":125}],221:[function(citationRequire,module,exports){ // 21.2.5.3 get RegExp.prototype.flags() if (citationRequire('./_descriptors') && /./g.flags != 'g') citationRequire('./_object-dp').f(RegExp.prototype, 'flags', { configurable: true, get: citationRequire('./_flags') }); },{"./_descriptors":35,"./_flags":43,"./_object-dp":74}],222:[function(citationRequire,module,exports){ // @@match logic citationRequire('./_fix-re-wks')('match', 1, function (defined, MATCH, $match) { // 21.1.3.11 String.prototype.match(regexp) return [function match(regexp) { 'use strict'; var O = defined(this); var fn = regexp == undefined ? undefined : regexp[MATCH]; return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); }, $match]; }); },{"./_fix-re-wks":42}],223:[function(citationRequire,module,exports){ // @@replace logic citationRequire('./_fix-re-wks')('replace', 2, function (defined, REPLACE, $replace) { // 21.1.3.14 String.prototype.replace(searchValue, replaceValue) return [function replace(searchValue, replaceValue) { 'use strict'; var O = defined(this); var fn = searchValue == undefined ? undefined : searchValue[REPLACE]; return fn !== undefined ? fn.call(searchValue, O, replaceValue) : $replace.call(String(O), searchValue, replaceValue); }, $replace]; }); },{"./_fix-re-wks":42}],224:[function(citationRequire,module,exports){ // @@search logic citationRequire('./_fix-re-wks')('search', 1, function (defined, SEARCH, $search) { // 21.1.3.15 String.prototype.search(regexp) return [function search(regexp) { 'use strict'; var O = defined(this); var fn = regexp == undefined ? undefined : regexp[SEARCH]; return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); }, $search]; }); },{"./_fix-re-wks":42}],225:[function(citationRequire,module,exports){ // @@split logic citationRequire('./_fix-re-wks')('split', 2, function (defined, SPLIT, $split) { 'use strict'; var isRegExp = citationRequire('./_is-regexp'); var _split = $split; var $push = [].push; var $SPLIT = 'split'; var LENGTH = 'length'; var LAST_INDEX = 'lastIndex'; if ( 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || '.'[$SPLIT](/()()/)[LENGTH] > 1 || ''[$SPLIT](/.?/)[LENGTH] ) { var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group // based on es5-shim implementation, need to rework it $split = function (separator, limit) { var string = String(this); if (separator === undefined && limit === 0) return []; // If `separator` is not a regex, use native split if (!isRegExp(separator)) return _split.call(string, separator, limit); var output = []; var flags = (separator.ignoreCase ? 'i' : '') + (separator.multiline ? 'm' : '') + (separator.unicode ? 'u' : '') + (separator.sticky ? 'y' : ''); var lastLastIndex = 0; var splitLimit = limit === undefined ? 4294967295 : limit >>> 0; // Make `global` and avoid `lastIndex` issues by working with a copy var separatorCopy = new RegExp(separator.source, flags + 'g'); var separator2, match, lastIndex, lastLength, i; // Doesn't need flags gy, but they don't hurt if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags); while (match = separatorCopy.exec(string)) { // `separatorCopy.lastIndex` is not reliable cross-browser lastIndex = match.index + match[0][LENGTH]; if (lastIndex > lastLastIndex) { output.push(string.slice(lastLastIndex, match.index)); // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG // eslint-disable-next-line no-loop-func if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () { for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined; }); if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1)); lastLength = match[0][LENGTH]; lastLastIndex = lastIndex; if (output[LENGTH] >= splitLimit) break; } if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop } if (lastLastIndex === string[LENGTH]) { if (lastLength || !separatorCopy.test('')) output.push(''); } else output.push(string.slice(lastLastIndex)); return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; }; // Chakra, V8 } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) { $split = function (separator, limit) { return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit); }; } // 21.1.3.17 String.prototype.split(separator, limit) return [function split(separator, limit) { var O = defined(this); var fn = separator == undefined ? undefined : separator[SPLIT]; return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit); }, $split]; }); },{"./_fix-re-wks":42,"./_is-regexp":57}],226:[function(citationRequire,module,exports){ 'use strict'; citationRequire('./es6.regexp.flags'); var anObject = citationRequire('./_an-object'); var $flags = citationRequire('./_flags'); var DESCRIPTORS = citationRequire('./_descriptors'); var TO_STRING = 'toString'; var $toString = /./[TO_STRING]; var define = function (fn) { citationRequire('./_redefine')(RegExp.prototype, TO_STRING, fn, true); }; // 21.2.5.14 RegExp.prototype.toString() if (citationRequire('./_fails')(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) { define(function toString() { var R = anObject(this); return '/'.concat(R.source, '/', 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined); }); // FF44- RegExp#toString has a wrong name } else if ($toString.name != TO_STRING) { define(function toString() { return $toString.call(this); }); } },{"./_an-object":15,"./_descriptors":35,"./_fails":41,"./_flags":43,"./_redefine":93,"./es6.regexp.flags":221}],227:[function(citationRequire,module,exports){ 'use strict'; var strong = citationRequire('./_collection-strong'); var validate = citationRequire('./_validate-collection'); var SET = 'Set'; // 23.2 Set Objects module.exports = citationRequire('./_collection')(SET, function (get) { return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; }, { // 23.2.3.1 Set.prototype.add(value) add: function add(value) { return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value); } }, strong); },{"./_collection":28,"./_collection-strong":26,"./_validate-collection":122}],228:[function(citationRequire,module,exports){ 'use strict'; // B.2.3.2 String.prototype.anchor(name) citationRequire('./_string-html')('anchor', function (createHTML) { return function anchor(name) { return createHTML(this, 'a', 'name', name); }; }); },{"./_string-html":104}],229:[function(citationRequire,module,exports){ 'use strict'; // B.2.3.3 String.prototype.big() citationRequire('./_string-html')('big', function (createHTML) { return function big() { return createHTML(this, 'big', '', ''); }; }); },{"./_string-html":104}],230:[function(citationRequire,module,exports){ 'use strict'; // B.2.3.4 String.prototype.blink() citationRequire('./_string-html')('blink', function (createHTML) { return function blink() { return createHTML(this, 'blink', '', ''); }; }); },{"./_string-html":104}],231:[function(citationRequire,module,exports){ 'use strict'; // B.2.3.5 String.prototype.bold() citationRequire('./_string-html')('bold', function (createHTML) { return function bold() { return createHTML(this, 'b', '', ''); }; }); },{"./_string-html":104}],232:[function(citationRequire,module,exports){ 'use strict'; var $export = citationRequire('./_export'); var $at = citationRequire('./_string-at')(false); $export($export.P, 'String', { // 21.1.3.3 String.prototype.codePointAt(pos) codePointAt: function codePointAt(pos) { return $at(this, pos); } }); },{"./_export":39,"./_string-at":102}],233:[function(citationRequire,module,exports){ // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) 'use strict'; var $export = citationRequire('./_export'); var toLength = citationRequire('./_to-length'); var context = citationRequire('./_string-context'); var ENDS_WITH = 'endsWith'; var $endsWith = ''[ENDS_WITH]; $export($export.P + $export.F * citationRequire('./_fails-is-regexp')(ENDS_WITH), 'String', { endsWith: function endsWith(searchString /* , endPosition = @length */) { var that = context(this, searchString, ENDS_WITH); var endPosition = arguments.length > 1 ? arguments[1] : undefined; var len = toLength(that.length); var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); var search = String(searchString); return $endsWith ? $endsWith.call(that, search, end) : that.slice(end - search.length, end) === search; } }); },{"./_export":39,"./_fails-is-regexp":40,"./_string-context":103,"./_to-length":114}],234:[function(citationRequire,module,exports){ 'use strict'; // B.2.3.6 String.prototype.fixed() citationRequire('./_string-html')('fixed', function (createHTML) { return function fixed() { return createHTML(this, 'tt', '', ''); }; }); },{"./_string-html":104}],235:[function(citationRequire,module,exports){ 'use strict'; // B.2.3.7 String.prototype.fontcolor(color) citationRequire('./_string-html')('fontcolor', function (createHTML) { return function fontcolor(color) { return createHTML(this, 'font', 'color', color); }; }); },{"./_string-html":104}],236:[function(citationRequire,module,exports){ 'use strict'; // B.2.3.8 String.prototype.fontsize(size) citationRequire('./_string-html')('fontsize', function (createHTML) { return function fontsize(size) { return createHTML(this, 'font', 'size', size); }; }); },{"./_string-html":104}],237:[function(citationRequire,module,exports){ var $export = citationRequire('./_export'); var toAbsoluteIndex = citationRequire('./_to-absolute-index'); var fromCharCode = String.fromCharCode; var $fromCodePoint = String.fromCodePoint; // length should be 1, old FF problem $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { // 21.1.2.2 String.fromCodePoint(...codePoints) fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars var res = []; var aLen = arguments.length; var i = 0; var code; while (aLen > i) { code = +arguments[i++]; if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); res.push(code < 0x10000 ? fromCharCode(code) : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) ); } return res.join(''); } }); },{"./_export":39,"./_to-absolute-index":110}],238:[function(citationRequire,module,exports){ // 21.1.3.7 String.prototype.includes(searchString, position = 0) 'use strict'; var $export = citationRequire('./_export'); var context = citationRequire('./_string-context'); var INCLUDES = 'includes'; $export($export.P + $export.F * citationRequire('./_fails-is-regexp')(INCLUDES), 'String', { includes: function includes(searchString /* , position = 0 */) { return !!~context(this, searchString, INCLUDES) .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); } }); },{"./_export":39,"./_fails-is-regexp":40,"./_string-context":103}],239:[function(citationRequire,module,exports){ 'use strict'; // B.2.3.9 String.prototype.italics() citationRequire('./_string-html')('italics', function (createHTML) { return function italics() { return createHTML(this, 'i', '', ''); }; }); },{"./_string-html":104}],240:[function(citationRequire,module,exports){ 'use strict'; var $at = citationRequire('./_string-at')(true); // 21.1.3.27 String.prototype[@@iterator]() citationRequire('./_iter-define')(String, 'String', function (iterated) { this._t = String(iterated); // target this._i = 0; // next index // 21.1.5.2.1 %StringIteratorPrototype%.next() }, function () { var O = this._t; var index = this._i; var point; if (index >= O.length) return { value: undefined, done: true }; point = $at(O, index); this._i += point.length; return { value: point, done: false }; }); },{"./_iter-define":60,"./_string-at":102}],241:[function(citationRequire,module,exports){ 'use strict'; // B.2.3.10 String.prototype.link(url) citationRequire('./_string-html')('link', function (createHTML) { return function link(url) { return createHTML(this, 'a', 'href', url); }; }); },{"./_string-html":104}],242:[function(citationRequire,module,exports){ var $export = citationRequire('./_export'); var toIObject = citationRequire('./_to-iobject'); var toLength = citationRequire('./_to-length'); $export($export.S, 'String', { // 21.1.2.4 String.raw(callSite, ...substitutions) raw: function raw(callSite) { var tpl = toIObject(callSite.raw); var len = toLength(tpl.length); var aLen = arguments.length; var res = []; var i = 0; while (len > i) { res.push(String(tpl[i++])); if (i < aLen) res.push(String(arguments[i])); } return res.join(''); } }); },{"./_export":39,"./_to-iobject":113,"./_to-length":114}],243:[function(citationRequire,module,exports){ var $export = citationRequire('./_export'); $export($export.P, 'String', { // 21.1.3.13 String.prototype.repeat(count) repeat: citationRequire('./_string-repeat') }); },{"./_export":39,"./_string-repeat":106}],244:[function(citationRequire,module,exports){ 'use strict'; // B.2.3.11 String.prototype.small() citationRequire('./_string-html')('small', function (createHTML) { return function small() { return createHTML(this, 'small', '', ''); }; }); },{"./_string-html":104}],245:[function(citationRequire,module,exports){ // 21.1.3.18 String.prototype.startsWith(searchString [, position ]) 'use strict'; var $export = citationRequire('./_export'); var toLength = citationRequire('./_to-length'); var context = citationRequire('./_string-context'); var STARTS_WITH = 'startsWith'; var $startsWith = ''[STARTS_WITH]; $export($export.P + $export.F * citationRequire('./_fails-is-regexp')(STARTS_WITH), 'String', { startsWith: function startsWith(searchString /* , position = 0 */) { var that = context(this, searchString, STARTS_WITH); var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); var search = String(searchString); return $startsWith ? $startsWith.call(that, search, index) : that.slice(index, index + search.length) === search; } }); },{"./_export":39,"./_fails-is-regexp":40,"./_string-context":103,"./_to-length":114}],246:[function(citationRequire,module,exports){ 'use strict'; // B.2.3.12 String.prototype.strike() citationRequire('./_string-html')('strike', function (createHTML) { return function strike() { return createHTML(this, 'strike', '', ''); }; }); },{"./_string-html":104}],247:[function(citationRequire,module,exports){ 'use strict'; // B.2.3.13 String.prototype.sub() citationRequire('./_string-html')('sub', function (createHTML) { return function sub() { return createHTML(this, 'sub', '', ''); }; }); },{"./_string-html":104}],248:[function(citationRequire,module,exports){ 'use strict'; // B.2.3.14 String.prototype.sup() citationRequire('./_string-html')('sup', function (createHTML) { return function sup() { return createHTML(this, 'sup', '', ''); }; }); },{"./_string-html":104}],249:[function(citationRequire,module,exports){ 'use strict'; // 21.1.3.25 String.prototype.trim() citationRequire('./_string-trim')('trim', function ($trim) { return function trim() { return $trim(this, 3); }; }); },{"./_string-trim":107}],250:[function(citationRequire,module,exports){ 'use strict'; // ECMAScript 6 symbols shim var global = citationRequire('./_global'); var has = citationRequire('./_has'); var DESCRIPTORS = citationRequire('./_descriptors'); var $export = citationRequire('./_export'); var redefine = citationRequire('./_redefine'); var META = citationRequire('./_meta').KEY; var $fails = citationRequire('./_fails'); var shared = citationRequire('./_shared'); var setToStringTag = citationRequire('./_set-to-string-tag'); var uid = citationRequire('./_uid'); var wks = citationRequire('./_wks'); var wksExt = citationRequire('./_wks-ext'); var wksDefine = citationRequire('./_wks-define'); var enumKeys = citationRequire('./_enum-keys'); var isArray = citationRequire('./_is-array'); var anObject = citationRequire('./_an-object'); var isObject = citationRequire('./_is-object'); var toIObject = citationRequire('./_to-iobject'); var toPrimitive = citationRequire('./_to-primitive'); var createDesc = citationRequire('./_property-desc'); var _create = citationRequire('./_object-create'); var gOPNExt = citationRequire('./_object-gopn-ext'); var $GOPD = citationRequire('./_object-gopd'); var $DP = citationRequire('./_object-dp'); var $keys = citationRequire('./_object-keys'); var gOPD = $GOPD.f; var dP = $DP.f; var gOPN = gOPNExt.f; var $Symbol = global.Symbol; var $JSON = global.JSON; var _stringify = $JSON && $JSON.stringify; var PROTOTYPE = 'prototype'; var HIDDEN = wks('_hidden'); var TO_PRIMITIVE = wks('toPrimitive'); var isEnum = {}.propertyIsEnumerable; var SymbolRegistry = shared('symbol-registry'); var AllSymbols = shared('symbols'); var OPSymbols = shared('op-symbols'); var ObjectProto = Object[PROTOTYPE]; var USE_NATIVE = typeof $Symbol == 'function'; var QObject = global.QObject; // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 var setSymbolDesc = DESCRIPTORS && $fails(function () { return _create(dP({}, 'a', { get: function () { return dP(this, 'a', { value: 7 }).a; } })).a != 7; }) ? function (it, key, D) { var protoDesc = gOPD(ObjectProto, key); if (protoDesc) delete ObjectProto[key]; dP(it, key, D); if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc); } : dP; var wrap = function (tag) { var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); sym._k = tag; return sym; }; var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) { return typeof it == 'symbol'; } : function (it) { return it instanceof $Symbol; }; var $defineProperty = function defineProperty(it, key, D) { if (it === ObjectProto) $defineProperty(OPSymbols, key, D); anObject(it); key = toPrimitive(key, true); anObject(D); if (has(AllSymbols, key)) { if (!D.enumerable) { if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {})); it[HIDDEN][key] = true; } else { if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; D = _create(D, { enumerable: createDesc(0, false) }); } return setSymbolDesc(it, key, D); } return dP(it, key, D); }; var $defineProperties = function defineProperties(it, P) { anObject(it); var keys = enumKeys(P = toIObject(P)); var i = 0; var l = keys.length; var key; while (l > i) $defineProperty(it, key = keys[i++], P[key]); return it; }; var $create = function create(it, P) { return P === undefined ? _create(it) : $defineProperties(_create(it), P); }; var $propertyIsEnumerable = function propertyIsEnumerable(key) { var E = isEnum.call(this, key = toPrimitive(key, true)); if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false; return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; }; var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { it = toIObject(it); key = toPrimitive(key, true); if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return; var D = gOPD(it, key); if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; return D; }; var $getOwnPropertyNames = function getOwnPropertyNames(it) { var names = gOPN(toIObject(it)); var result = []; var i = 0; var key; while (names.length > i) { if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); } return result; }; var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { var IS_OP = it === ObjectProto; var names = gOPN(IS_OP ? OPSymbols : toIObject(it)); var result = []; var i = 0; var key; while (names.length > i) { if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]); } return result; }; // 19.4.1.1 Symbol([description]) if (!USE_NATIVE) { $Symbol = function Symbol() { if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); var tag = uid(arguments.length > 0 ? arguments[0] : undefined); var $set = function (value) { if (this === ObjectProto) $set.call(OPSymbols, value); if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; setSymbolDesc(this, tag, createDesc(1, value)); }; if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set }); return wrap(tag); }; redefine($Symbol[PROTOTYPE], 'toString', function toString() { return this._k; }); $GOPD.f = $getOwnPropertyDescriptor; $DP.f = $defineProperty; citationRequire('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames; citationRequire('./_object-pie').f = $propertyIsEnumerable; citationRequire('./_object-gops').f = $getOwnPropertySymbols; if (DESCRIPTORS && !citationRequire('./_library')) { redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); } wksExt.f = function (name) { return wrap(wks(name)); }; } $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol }); for (var es6Symbols = ( // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' ).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]); for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]); $export($export.S + $export.F * !USE_NATIVE, 'Symbol', { // 19.4.2.1 Symbol.for(key) 'for': function (key) { return has(SymbolRegistry, key += '') ? SymbolRegistry[key] : SymbolRegistry[key] = $Symbol(key); }, // 19.4.2.5 Symbol.keyFor(sym) keyFor: function keyFor(sym) { if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; }, useSetter: function () { setter = true; }, useSimple: function () { setter = false; } }); $export($export.S + $export.F * !USE_NATIVE, 'Object', { // 19.1.2.2 Object.create(O [, Properties]) create: $create, // 19.1.2.4 Object.defineProperty(O, P, Attributes) defineProperty: $defineProperty, // 19.1.2.3 Object.defineProperties(O, Properties) defineProperties: $defineProperties, // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) getOwnPropertyDescriptor: $getOwnPropertyDescriptor, // 19.1.2.7 Object.getOwnPropertyNames(O) getOwnPropertyNames: $getOwnPropertyNames, // 19.1.2.8 Object.getOwnPropertySymbols(O) getOwnPropertySymbols: $getOwnPropertySymbols }); // 24.3.2 JSON.stringify(value [, replacer [, space]]) $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { var S = $Symbol(); // MS Edge converts symbol values to JSON as {} // WebKit converts symbol values to JSON as null // V8 throws on boxed symbols return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; })), 'JSON', { stringify: function stringify(it) { var args = [it]; var i = 1; var replacer, $replacer; while (arguments.length > i) args.push(arguments[i++]); $replacer = replacer = args[1]; if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined if (!isArray(replacer)) replacer = function (key, value) { if (typeof $replacer == 'function') value = $replacer.call(this, key, value); if (!isSymbol(value)) return value; }; args[1] = replacer; return _stringify.apply($JSON, args); } }); // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) $Symbol[PROTOTYPE][TO_PRIMITIVE] || citationRequire('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); // 19.4.3.5 Symbol.prototype[@@toStringTag] setToStringTag($Symbol, 'Symbol'); // 20.2.1.9 Math[@@toStringTag] setToStringTag(Math, 'Math', true); // 24.3.3 JSON[@@toStringTag] setToStringTag(global.JSON, 'JSON', true); },{"./_an-object":15,"./_descriptors":35,"./_enum-keys":38,"./_export":39,"./_fails":41,"./_global":45,"./_has":46,"./_hide":47,"./_is-array":54,"./_is-object":56,"./_library":64,"./_meta":69,"./_object-create":73,"./_object-dp":74,"./_object-gopd":76,"./_object-gopn":78,"./_object-gopn-ext":77,"./_object-gops":79,"./_object-keys":82,"./_object-pie":83,"./_property-desc":91,"./_redefine":93,"./_set-to-string-tag":97,"./_shared":99,"./_to-iobject":113,"./_to-primitive":116,"./_uid":120,"./_wks":125,"./_wks-define":123,"./_wks-ext":124}],251:[function(citationRequire,module,exports){ 'use strict'; var $export = citationRequire('./_export'); var $typed = citationRequire('./_typed'); var buffer = citationRequire('./_typed-buffer'); var anObject = citationRequire('./_an-object'); var toAbsoluteIndex = citationRequire('./_to-absolute-index'); var toLength = citationRequire('./_to-length'); var isObject = citationRequire('./_is-object'); var ArrayBuffer = citationRequire('./_global').ArrayBuffer; var speciesConstructor = citationRequire('./_species-constructor'); var $ArrayBuffer = buffer.ArrayBuffer; var $DataView = buffer.DataView; var $isView = $typed.ABV && ArrayBuffer.isView; var $slice = $ArrayBuffer.prototype.slice; var VIEW = $typed.VIEW; var ARRAY_BUFFER = 'ArrayBuffer'; $export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer }); $export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { // 24.1.3.1 ArrayBuffer.isView(arg) isView: function isView(it) { return $isView && $isView(it) || isObject(it) && VIEW in it; } }); $export($export.P + $export.U + $export.F * citationRequire('./_fails')(function () { return !new $ArrayBuffer(2).slice(1, undefined).byteLength; }), ARRAY_BUFFER, { // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) slice: function slice(start, end) { if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix var len = anObject(this).byteLength; var first = toAbsoluteIndex(start, len); var fin = toAbsoluteIndex(end === undefined ? len : end, len); var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first)); var viewS = new $DataView(this); var viewT = new $DataView(result); var index = 0; while (first < fin) { viewT.setUint8(index++, viewS.getUint8(first++)); } return result; } }); citationRequire('./_set-species')(ARRAY_BUFFER); },{"./_an-object":15,"./_export":39,"./_fails":41,"./_global":45,"./_is-object":56,"./_set-species":96,"./_species-constructor":100,"./_to-absolute-index":110,"./_to-length":114,"./_typed":119,"./_typed-buffer":118}],252:[function(citationRequire,module,exports){ var $export = citationRequire('./_export'); $export($export.G + $export.W + $export.F * !citationRequire('./_typed').ABV, { DataView: citationRequire('./_typed-buffer').DataView }); },{"./_export":39,"./_typed":119,"./_typed-buffer":118}],253:[function(citationRequire,module,exports){ citationRequire('./_typed-array')('Float32', 4, function (init) { return function Float32Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); },{"./_typed-array":117}],254:[function(citationRequire,module,exports){ citationRequire('./_typed-array')('Float64', 8, function (init) { return function Float64Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); },{"./_typed-array":117}],255:[function(citationRequire,module,exports){ citationRequire('./_typed-array')('Int16', 2, function (init) { return function Int16Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); },{"./_typed-array":117}],256:[function(citationRequire,module,exports){ citationRequire('./_typed-array')('Int32', 4, function (init) { return function Int32Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); },{"./_typed-array":117}],257:[function(citationRequire,module,exports){ citationRequire('./_typed-array')('Int8', 1, function (init) { return function Int8Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); },{"./_typed-array":117}],258:[function(citationRequire,module,exports){ citationRequire('./_typed-array')('Uint16', 2, function (init) { return function Uint16Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); },{"./_typed-array":117}],259:[function(citationRequire,module,exports){ citationRequire('./_typed-array')('Uint32', 4, function (init) { return function Uint32Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); },{"./_typed-array":117}],260:[function(citationRequire,module,exports){ citationRequire('./_typed-array')('Uint8', 1, function (init) { return function Uint8Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); },{"./_typed-array":117}],261:[function(citationRequire,module,exports){ citationRequire('./_typed-array')('Uint8', 1, function (init) { return function Uint8ClampedArray(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }, true); },{"./_typed-array":117}],262:[function(citationRequire,module,exports){ 'use strict'; var each = citationRequire('./_array-methods')(0); var redefine = citationRequire('./_redefine'); var meta = citationRequire('./_meta'); var assign = citationRequire('./_object-assign'); var weak = citationRequire('./_collection-weak'); var isObject = citationRequire('./_is-object'); var fails = citationRequire('./_fails'); var validate = citationRequire('./_validate-collection'); var WEAK_MAP = 'WeakMap'; var getWeak = meta.getWeak; var isExtensible = Object.isExtensible; var uncaughtFrozenStore = weak.ufstore; var tmp = {}; var InternalMap; var wrapper = function (get) { return function WeakMap() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; }; var methods = { // 23.3.3.3 WeakMap.prototype.get(key) get: function get(key) { if (isObject(key)) { var data = getWeak(key); if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key); return data ? data[this._i] : undefined; } }, // 23.3.3.5 WeakMap.prototype.set(key, value) set: function set(key, value) { return weak.def(validate(this, WEAK_MAP), key, value); } }; // 23.3 WeakMap Objects var $WeakMap = module.exports = citationRequire('./_collection')(WEAK_MAP, wrapper, methods, weak, true, true); // IE11 WeakMap frozen keys fix if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) { InternalMap = weak.getConstructor(wrapper, WEAK_MAP); assign(InternalMap.prototype, methods); meta.NEED = true; each(['delete', 'has', 'get', 'set'], function (key) { var proto = $WeakMap.prototype; var method = proto[key]; redefine(proto, key, function (a, b) { // store frozen objects on internal weakmap shim if (isObject(a) && !isExtensible(a)) { if (!this._f) this._f = new InternalMap(); var result = this._f[key](a, b); return key == 'set' ? this : result; // store all the rest on native weakmap } return method.call(this, a, b); }); }); } },{"./_array-methods":19,"./_collection":28,"./_collection-weak":27,"./_fails":41,"./_is-object":56,"./_meta":69,"./_object-assign":72,"./_redefine":93,"./_validate-collection":122}],263:[function(citationRequire,module,exports){ 'use strict'; var weak = citationRequire('./_collection-weak'); var validate = citationRequire('./_validate-collection'); var WEAK_SET = 'WeakSet'; // 23.4 WeakSet Objects citationRequire('./_collection')(WEAK_SET, function (get) { return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; }, { // 23.4.3.1 WeakSet.prototype.add(value) add: function add(value) { return weak.def(validate(this, WEAK_SET), value, true); } }, weak, false, true); },{"./_collection":28,"./_collection-weak":27,"./_validate-collection":122}],264:[function(citationRequire,module,exports){ 'use strict'; // https://github.com/tc39/Array.prototype.includes var $export = citationRequire('./_export'); var $includes = citationRequire('./_array-includes')(true); $export($export.P, 'Array', { includes: function includes(el /* , fromIndex = 0 */) { return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); } }); citationRequire('./_add-to-unscopables')('includes'); },{"./_add-to-unscopables":13,"./_array-includes":18,"./_export":39}],265:[function(citationRequire,module,exports){ // https://github.com/tc39/proposal-object-values-entries var $export = citationRequire('./_export'); var $entries = citationRequire('./_object-to-array')(true); $export($export.S, 'Object', { entries: function entries(it) { return $entries(it); } }); },{"./_export":39,"./_object-to-array":85}],266:[function(citationRequire,module,exports){ // https://github.com/tc39/proposal-object-getownpropertydescriptors var $export = citationRequire('./_export'); var ownKeys = citationRequire('./_own-keys'); var toIObject = citationRequire('./_to-iobject'); var gOPD = citationRequire('./_object-gopd'); var createProperty = citationRequire('./_create-property'); $export($export.S, 'Object', { getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { var O = toIObject(object); var getDesc = gOPD.f; var keys = ownKeys(O); var result = {}; var i = 0; var key, desc; while (keys.length > i) { desc = getDesc(O, key = keys[i++]); if (desc !== undefined) createProperty(result, key, desc); } return result; } }); },{"./_create-property":30,"./_export":39,"./_object-gopd":76,"./_own-keys":86,"./_to-iobject":113}],267:[function(citationRequire,module,exports){ // https://github.com/tc39/proposal-object-values-entries var $export = citationRequire('./_export'); var $values = citationRequire('./_object-to-array')(false); $export($export.S, 'Object', { values: function values(it) { return $values(it); } }); },{"./_export":39,"./_object-to-array":85}],268:[function(citationRequire,module,exports){ // https://github.com/tc39/proposal-promise-finally 'use strict'; var $export = citationRequire('./_export'); var core = citationRequire('./_core'); var global = citationRequire('./_global'); var speciesConstructor = citationRequire('./_species-constructor'); var promiseResolve = citationRequire('./_promise-resolve'); $export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { var C = speciesConstructor(this, core.Promise || global.Promise); var isFunction = typeof onFinally == 'function'; return this.then( isFunction ? function (x) { return promiseResolve(C, onFinally()).then(function () { return x; }); } : onFinally, isFunction ? function (e) { return promiseResolve(C, onFinally()).then(function () { throw e; }); } : onFinally ); } }); },{"./_core":29,"./_export":39,"./_global":45,"./_promise-resolve":90,"./_species-constructor":100}],269:[function(citationRequire,module,exports){ 'use strict'; // https://github.com/tc39/proposal-string-pad-start-end var $export = citationRequire('./_export'); var $pad = citationRequire('./_string-pad'); var userAgent = citationRequire('./_user-agent'); // https://github.com/zloirock/core-js/issues/280 $export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { padEnd: function padEnd(maxLength /* , fillString = ' ' */) { return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); } }); },{"./_export":39,"./_string-pad":105,"./_user-agent":121}],270:[function(citationRequire,module,exports){ 'use strict'; // https://github.com/tc39/proposal-string-pad-start-end var $export = citationRequire('./_export'); var $pad = citationRequire('./_string-pad'); var userAgent = citationRequire('./_user-agent'); // https://github.com/zloirock/core-js/issues/280 $export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { padStart: function padStart(maxLength /* , fillString = ' ' */) { return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); } }); },{"./_export":39,"./_string-pad":105,"./_user-agent":121}],271:[function(citationRequire,module,exports){ citationRequire('./_wks-define')('asyncIterator'); },{"./_wks-define":123}],272:[function(citationRequire,module,exports){ var $iterators = citationRequire('./es6.array.iterator'); var getKeys = citationRequire('./_object-keys'); var redefine = citationRequire('./_redefine'); var global = citationRequire('./_global'); var hide = citationRequire('./_hide'); var Iterators = citationRequire('./_iterators'); var wks = citationRequire('./_wks'); var ITERATOR = wks('iterator'); var TO_STRING_TAG = wks('toStringTag'); var ArrayValues = Iterators.Array; var DOMIterables = { CSSRuleList: true, // TODO: Not spec compliant, should be false. CSSStyleDeclaration: false, CSSValueList: false, ClientRectList: false, DOMRectList: false, DOMStringList: false, DOMTokenList: true, DataTransferItemList: false, FileList: false, HTMLAllCollection: false, HTMLCollection: false, HTMLFormElement: false, HTMLSelectElement: false, MediaList: true, // TODO: Not spec compliant, should be false. MimeTypeArray: false, NamedNodeMap: false, NodeList: true, PaintRequestList: false, Plugin: false, PluginArray: false, SVGLengthList: false, SVGNumberList: false, SVGPathSegList: false, SVGPointList: false, SVGStringList: false, SVGTransformList: false, SourceBufferList: false, StyleSheetList: true, // TODO: Not spec compliant, should be false. TextTrackCueList: false, TextTrackList: false, TouchList: false }; for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) { var NAME = collections[i]; var explicit = DOMIterables[NAME]; var Collection = global[NAME]; var proto = Collection && Collection.prototype; var key; if (proto) { if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues); if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); Iterators[NAME] = ArrayValues; if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true); } } },{"./_global":45,"./_hide":47,"./_iterators":63,"./_object-keys":82,"./_redefine":93,"./_wks":125,"./es6.array.iterator":137}],273:[function(citationRequire,module,exports){ var $export = citationRequire('./_export'); var $task = citationRequire('./_task'); $export($export.G + $export.B, { setImmediate: $task.set, clearImmediate: $task.clear }); },{"./_export":39,"./_task":109}],274:[function(citationRequire,module,exports){ // ie9- setTimeout & setInterval additional parameters fix var global = citationRequire('./_global'); var $export = citationRequire('./_export'); var userAgent = citationRequire('./_user-agent'); var slice = [].slice; var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check var wrap = function (set) { return function (fn, time /* , ...args */) { var boundArgs = arguments.length > 2; var args = boundArgs ? slice.call(arguments, 2) : false; return set(boundArgs ? function () { // eslint-disable-next-line no-new-func (typeof fn == 'function' ? fn : Function(fn)).apply(this, args); } : fn, time); }; }; $export($export.G + $export.B + $export.F * MSIE, { setTimeout: wrap(global.setTimeout), setInterval: wrap(global.setInterval) }); },{"./_export":39,"./_global":45,"./_user-agent":121}],275:[function(citationRequire,module,exports){ citationRequire('../modules/web.timers'); citationRequire('../modules/web.immediate'); citationRequire('../modules/web.dom.iterable'); module.exports = citationRequire('../modules/_core'); },{"../modules/_core":29,"../modules/web.dom.iterable":272,"../modules/web.immediate":273,"../modules/web.timers":274}],276:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "parse", { enumerable: true, get: function get() { return _input.default; } }); Object.defineProperty(exports, "format", { enumerable: true, get: function get() { return _output.default; } }); citationRequire("@babel/polyfill"); var _input = _interopcitationRequireDefault(citationRequire("./input")); var _output = _interopcitationRequireDefault(citationRequire("./output")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } },{"./input":277,"./output":278,"@babel/polyfill":1}],277:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var monthMap = { jan: 1, feb: 2, mar: 3, apr: 4, may: 5, jun: 6, jul: 7, aug: 8, sep: 9, oct: 10, nov: 11, dec: 12 }; var getMonth = function getMonth(monthName) { return monthMap[monthName.toLowerCase().slice(0, 3)]; }; var parseEpoch = function parseEpoch(date) { var epoch = new Date(date); if (typeof date === 'number' && !isNaN(epoch.valueOf())) { return [epoch.getFullYear(), epoch.getMonth() + 1, epoch.getDate()]; } else { return null; } }; var parseIso8601 = function parseIso8601(date) { var pattern = /^(\d{4}|[-+]\d{6,})-(\d{2})-(\d{2})/; if (typeof date !== 'string' || !pattern.test(date)) { return null; } var _date$match = date.match(pattern), _date$match2 = _slicedToArray(_date$match, 4), year = _date$match2[1], month = _date$match2[2], day = _date$match2[3]; if (!+month) { return [year]; } else if (!+day) { return [year, month]; } else { return [year, month, day]; } }; var parseRfc2822 = function parseRfc2822(date) { var pattern = /^(?:[a-z]{3},\s*)?(\d{1,2}) ([a-z]{3}) (\d{4,})/i; if (typeof date !== 'string' || !pattern.test(date)) { return null; } var _date$match3 = date.match(pattern), _date$match4 = _slicedToArray(_date$match3, 4), day = _date$match4[1], month = _date$match4[2], year = _date$match4[3]; month = getMonth(month); if (!month) { return null; } return [year, month, day]; }; var parseAmericanDay = function parseAmericanDay(date) { var pattern = /^(\d{1,2})\/(\d{1,2})\/(\d{2}(?:\d{2})?)/; if (typeof date !== 'string' || !pattern.test(date)) { return null; } var _date$match5 = date.match(pattern), _date$match6 = _slicedToArray(_date$match5, 4), month = _date$match6[1], day = _date$match6[2], year = _date$match6[3]; var check = new Date(year, month, day); if (check.getMonth() === parseInt(month)) { return [year, month, day]; } else { return null; } }; var parseDay = function parseDay(date) { var pattern = /^(\d{1,2})[ .\-/](\d{1,2}|[a-z]{3,10})[ .\-/](-?\d+)/i; var reversePattern = /^(-?\d+)[ .\-/](\d{1,2}|[a-z]{3,10})[ .\-/](\d{1,2})/i; var year; var month; var day; if (typeof date !== 'string') { return null; } else if (pattern.test(date)) { var _date$match7 = date.match(pattern); var _date$match8 = _slicedToArray(_date$match7, 4); day = _date$match8[1]; month = _date$match8[2]; year = _date$match8[3]; } else if (reversePattern.test(date)) { var _date$match9 = date.match(reversePattern); var _date$match10 = _slicedToArray(_date$match9, 4); year = _date$match10[1]; month = _date$match10[2]; day = _date$match10[3]; } else { return null; } if (getMonth(month)) { month = getMonth(month); } else if (isNaN(month)) { return null; } return [year, month, day]; }; var parseMonth = function parseMonth(date) { var pattern = /^([a-z]{3,10}|-?\d+)[^\w-]+([a-z]{3,10}|-?\d+)$/i; if (typeof date === 'string' && pattern.test(date)) { var values = date.match(pattern).slice(1, 3); var month; if (getMonth(values[1])) { month = getMonth(values.pop()); } else if (getMonth(values[0])) { month = getMonth(values.shift()); } else if (values.some(isNaN) || values.every(function (value) { return +value < 0; })) { return null; } else if (+values[0] < 0) { month = values.pop(); } else if (+values[0] > +values[1] && +values[1] > 0) { month = values.pop(); } else { month = values.shift(); } var year = values.pop(); return [year, month]; } else { return null; } }; var parseYear = function parseYear(date) { if (typeof date === 'string' && /^-?\d+$/.test(date)) { return [date]; } else { return null; } }; var parseDate = function parseDate(value) { var dateParts = parseEpoch(value) || parseIso8601(value) || parseRfc2822(value) || parseAmericanDay(value) || parseDay(value) || parseMonth(value) || parseYear(value); if (dateParts) { dateParts = dateParts.map(function (string) { return parseInt(string); }); return { 'date-parts': [dateParts] }; } else { return { raw: value }; } }; var _default = parseDate; exports.default = _default; },{}],278:[function(citationRequire,module,exports){ "use strict"; function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var getDate = function getDate(_ref) { var _ref$dateParts = _slicedToArray(_ref['date-parts'], 1), date = _ref$dateParts[0]; var delimiter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '-'; var dateParts = date.map(function (part) { return part.toString(); }); switch (dateParts.length) { case 3: dateParts[2] = dateParts[2].padStart(2, '0'); case 2: dateParts[1] = dateParts[1].padStart(2, '0'); case 1: dateParts[0] = dateParts[0].padStart(4, '0'); break; } return dateParts.join(delimiter); }; var _default = getDate; exports.default = _default; },{}],279:[function(citationRequire,module,exports){ arguments[4][276][0].apply(exports,arguments) },{"./input":280,"./output":281,"@babel/polyfill":1,"dup":276}],280:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.parse = exports.types = exports.scope = void 0; function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var punctutationMatcher = function punctutationMatcher(string) { return string.replace(/$|( )|(?!^)(?=[A-Z])/g, '\\.?$1'); }; var getListMatcher = function getListMatcher(list) { return "(?:".concat(list.join('|'), ")\\b"); }; var getSplittingRegex = function getSplittingRegex(matcher, flags) { return new RegExp("(?:^| )(".concat(matcher, "$)"), flags); }; var titles = ['mr', 'mrs', 'ms', 'miss', 'dr', 'herr', 'monsieur', 'hr', 'frau', 'a v m', 'admiraal', 'admiral', 'air cdre', 'air commodore', 'air marshal', 'air vice marshal', 'alderman', 'alhaji', 'ambassador', 'baron', 'barones', 'brig', 'brig gen', 'brig general', 'brigadier', 'brigadier general', 'brother', 'canon', 'capt', 'captain', 'cardinal', 'cdr', 'chief', 'cik', 'cmdr', 'coach', 'col', 'col dr', 'colonel', 'commandant', 'commander', 'commissioner', 'commodore', 'comte', 'comtessa', 'congressman', 'conseiller', 'consul', 'conte', 'contessa', 'corporal', 'councillor', 'count', 'countess', 'crown prince', 'crown princess', 'dame', 'datin', 'dato', 'datuk', 'datuk seri', 'deacon', 'deaconess', 'dean', 'dhr', 'dipl ing', 'doctor', 'dott', 'dott sa', 'dr', 'dr ing', 'dra', 'drs', 'embajador', 'embajadora', 'en', 'encik', 'eng', 'eur ing', 'exma sra', 'exmo sr', 'f o', 'father', 'first lieutient', 'first officer', 'flt lieut', 'flying officer', 'fr', 'frau', 'fraulein', 'fru', 'gen', 'generaal', 'general', 'governor', 'graaf', 'gravin', 'group captain', 'grp capt', 'h e dr', 'h h', 'h m', 'h r h', 'hajah', 'haji', 'hajim', 'her highness', 'her majesty', 'herr', 'high chief', 'his highness', 'his holiness', 'his majesty', 'hon', 'hr', 'hra', 'ing', 'ir', 'jonkheer', 'judge', 'justice', 'khun ying', 'kolonel', 'lady', 'lcda', 'lic', 'lieut', 'lieut cdr', 'lieut col', 'lieut gen', 'lord', 'm', 'm l', 'm r', 'madame', 'mademoiselle', 'maj gen', 'major', 'master', 'mevrouw', 'miss', 'mlle', 'mme', 'monsieur', 'monsignor', 'mr', 'mrs', 'ms', 'mstr', 'nti', 'pastor', 'president', 'prince', 'princess', 'princesse', 'prinses', 'prof', 'prof dr', 'prof sir', 'professor', 'puan', 'puan sri', 'rabbi', 'rear admiral', 'rev', 'rev canon', 'rev dr', 'rev mother', 'reverend', 'rva', 'senator', 'sergeant', 'sheikh', 'sheikha', 'sig', 'sig na', 'sig ra', 'sir', 'sister', 'sqn ldr', 'sr', 'sr d', 'sra', 'srta', 'sultan', 'tan sri', 'tan sri dato', 'tengku', 'teuku', 'than puying', 'the hon dr', 'the hon justice', 'the hon miss', 'the hon mr', 'the hon mrs', 'the hon ms', 'the hon sir', 'the very rev', 'toh puan', 'tun', 'vice admiral', 'viscount', 'viscountess', 'wg cdr']; var suffixes = ['I', 'II', 'III', 'IV', 'V', 'Senior', 'Junior', 'Jr', 'Sr', 'PhD', 'Ph\\.D', 'APR', 'RPh', 'PE', 'MD', 'MA', 'DMD', 'CME', 'BVM', 'CFRE', 'CLU', 'CPA', 'CSC', 'CSJ', 'DC', 'DD', 'DDS', 'DO', 'DVM', 'EdD', 'Esq', 'JD', 'LLD', 'OD', 'OSB', 'PC', 'Ret', 'RGS', 'RN', 'RNC', 'SHCJ', 'SJ', 'SNJM', 'SSMO', 'USA', 'USAF', 'USAFR', 'USAR', 'USCG', 'USMC', 'USMCR', 'USN', 'USNR']; var particles = ['Vere', 'Von', 'Van', 'De', 'Del', 'Della', 'Di', 'Da', 'Pietro', 'Vanden', 'Du', 'St.', 'St', 'La', 'Lo', 'Ter', 'O', 'O\'', 'Mac', 'Fitz']; var titleMatcher = getListMatcher(titles.map(punctutationMatcher)); var suffixMatcher = getListMatcher(suffixes.map(punctutationMatcher)); var particleMatcher = getListMatcher(particles); var titleSplitter = new RegExp("^((?:".concat(titleMatcher, " )*)(.*)$"), 'i'); var suffixSplitter = getSplittingRegex("(?:".concat(suffixMatcher, ", )*(?:").concat(suffixMatcher, ")"), 'i'); var particleSplitter = getSplittingRegex("".concat(/(?:[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A]|\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89])/.source, ".*")); var endSplitter = getSplittingRegex("(?:".concat(/(?:[a-z\xAA\xB5\xBA\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02B8\u02C0\u02C1\u02E0-\u02E4\u0345\u0371\u0373\u0377\u037A-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1DBF\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u2071\u207F\u2090-\u209C\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2170-\u217F\u2184\u24D0-\u24E9\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7D\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B-\uA69D\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7F8-\uA7FA\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A]|\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43])/.source, ".*|").concat(particleMatcher, ".*|\\S*)")); var parseName = function parseName() { var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; if (typeof name !== 'string') { name = name + ''; } var start = ''; var mid = ''; var end = ''; if (/[^.], /.test(name)) { var parts = name.split(', '); end = parts.shift(); var suffixMatch = RegExp(suffixMatcher).exec(parts.join(', ')); start = parts.splice(suffixMatch && suffixMatch.index !== 0 ? 0 : -1, 1)[0]; mid = parts.join(', '); } else { var _parts = name.split(suffixSplitter, 2); var main = _parts.shift().split(endSplitter, 2); start = main[0]; end = main[1]; mid = _parts.pop(); } var _start$match = start.match(titleSplitter), _start$match2 = _slicedToArray(_start$match, 3), droppingParticle = _start$match2[1], given = _start$match2[2]; var suffix = mid; var _end$split$reverse = end.split(particleSplitter, 2).reverse(), _end$split$reverse2 = _slicedToArray(_end$split$reverse, 2), family = _end$split$reverse2[0], nonDroppingParticle = _end$split$reverse2[1]; if (!given && family) { return family.includes(' ') ? { literal: family } : { family: family }; } else if (family) { var nameObject = { 'dropping-particle': droppingParticle, given: given, suffix: suffix, 'non-dropping-particle': nonDroppingParticle, family: family }; Object.keys(nameObject).forEach(function (key) { if (!nameObject[key]) { delete nameObject[key]; } }); return nameObject; } else { return { literal: name }; } }; exports.default = exports.parse = parseName; var scope = '@name'; exports.scope = scope; var types = '@name'; exports.types = types; },{}],281:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var startParts = ['dropping-particle', 'given']; var suffixParts = ['suffix']; var endParts = ['non-dropping-particle', 'family']; var getName = function getName(name) { var reversed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var get = function get(parts) { return parts.map(function (entry) { return name[entry] || ''; }).filter(Boolean).join(' '); }; if (name.literal) { return name.literal; } else if (reversed) { var suffixPart = get(suffixParts) ? ", ".concat(get(suffixParts)) : ''; var startPart = get(startParts) ? ", ".concat(get(startParts)) : ''; return get(endParts) + suffixPart + startPart; } else { return "".concat(get(startParts.concat(suffixParts, endParts))); } }; var _default = getName; exports.default = _default; },{}],282:[function(citationRequire,module,exports){ "use strict";function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}var CSL={PROCESSOR_VERSION:"1.1.210",CONDITION_LEVEL_TOP:1,CONDITION_LEVEL_BOTTOM:2,PLAIN_HYPHEN_REGEX:/(?:[^\\]-|\u2013)/,LOCATOR_LABELS_REGEXP:new RegExp("^((art|ch|subch|col|fig|l|n|no|op|p|pp|para|subpara|pt|r|sec|subsec|sv|sch|tit|vrs|vol)\\.)\\s+(.*)"),STATUTE_SUBDIV_GROUPED_REGEX:/((?:^| )(?:art|bk|ch|subch|col|fig|fol|l|n|no|op|p|pp|para|subpara|pt|r|sec|subsec|sv|sch|tit|vrs|vol)\. *)/g,STATUTE_SUBDIV_PLAIN_REGEX:/(?:(?:^| )(?:art|bk|ch|subch|col|fig|fol|l|n|no|op|p|pp|para|subpara|pt|r|sec|subsec|sv|sch|tit|vrs|vol)\. *)/,STATUTE_SUBDIV_PLAIN_REGEX_FRONT:/(?:^\s*[.,;]*\s*(?:art|bk|ch|subch|col|fig|fol|l|n|no|op|p|pp|para|subpara|pt|r|sec|subsec|sv|sch|tit|vrs|vol)\. *)/,STATUTE_SUBDIV_STRINGS:{"art.":"article","bk.":"book","ch.":"chapter","subch.":"subchapter","p.":"page","pp.":"page","para.":"paragraph","subpara.":"subparagraph","pt.":"part","r.":"rule","sec.":"section","subsec.":"subsection","sch.":"schedule","tit.":"title","col.":"column","fig.":"figure","fol.":"folio","l.":"line","n.":"note","no.":"issue","op.":"opus","sv.":"sub-verbo","vrs.":"verse","vol.":"volume"},STATUTE_SUBDIV_STRINGS_REVERSE:{"article":"art.","book":"bk.","chapter":"ch.","subchapter":"subch.","page":"p.","paragraph":"para.","subparagraph":"subpara.","part":"pt.","rule":"r.","section":"sec.","subsection":"subsec.","schedule":"sch.","title":"tit.","column":"col.","figure":"fig.","folio":"fol.","line":"l.","note":"n.","issue":"no.","opus":"op.","sub-verbo":"sv.","sub verbo":"sv.","verse":"vrs.","volume":"vol."},LOCATOR_LABELS_MAP:{"art":"article","bk":"book","ch":"chapter","subch":"subchapter","col":"column","fig":"figure","fol":"folio","l":"line","n":"note","no":"issue","op":"opus","p":"page","pp":"page","para":"paragraph","subpara":"subparagraph","pt":"part","r":"rule","sec":"section","subsec":"subsection","sv":"sub-verbo","sch":"schedule","tit":"title","vrs":"verse","vol":"volume"},MODULE_MACROS:{"juris-pretitle":true,"juris-title":true,"juris-pretitle-short":true,"juris-title-short":true,"juris-main":true,"juris-main-short":true,"juris-tail":true,"juris-tail-short":true,"juris-locator":true},MODULE_TYPES:{"legal_case":true,"legislation":true,"bill":true,"hearing":true,"gazette":true,"report":true,"regulation":true,"standard":true},NestedBraces:[["(","["],[")","]"]],checkNestedBrace:function checkNestedBrace(state){if(state.opt.xclass==="note"){this.depth=0;this.update=function(str){var str=str?str:'';var lst=str.split(/([\(\)])/);for(var i=1,ilen=lst.length;i<ilen;i+=2){if(lst[i]==='('){if(1===this.depth%2){lst[i]='[';}this.depth+=1;}else if(lst[i]===')'){if(0===this.depth%2){lst[i]=']';}this.depth-=1;}}var ret=lst.join("");return ret;};}else{this.update=function(str){return str;};};},MULTI_FIELDS:["event","publisher","publisher-place","event-place","title","container-title","collection-title","authority","genre","title-short","medium","country","jurisdiction","archive","archive-place"],LangPrefsMap:{"title":"titles","title-short":"titles","event":"titles","genre":"titles","medium":"titles","container-title":"journals","collection-title":"journals","archive":"journals","publisher":"publishers","authority":"publishers","publisher-place":"places","event-place":"places","archive-place":"places","jurisdiction":"places","number":"number","edition":"number","issue":"number","volume":"number"},AbbreviationSegments:function AbbreviationSegments(){this["container-title"]={};this["collection-title"]={};this["institution-entire"]={};this["institution-part"]={};this.nickname={};this.number={};this.title={};this.place={};this.hereinafter={};this.classic={};this["container-phrase"]={};this["title-phrase"]={};},FIELD_CATEGORY_REMAP:{"title":"title","container-title":"container-title","collection-title":"collection-title","country":"place","number":"number","place":"place","archive":"collection-title","title-short":"title","genre":"title","event":"title","medium":"title","archive-place":"place","publisher-place":"place","event-place":"place","jurisdiction":"place","language-name":"place","language-name-original":"place","call-number":"number","chapter-number":"number","collection-number":"number","edition":"number","page":"number","issue":"number","locator":"number","number-of-pages":"number","number-of-volumes":"number","volume":"number","citation-number":"number","publisher":"institution-part"},parseLocator:function parseLocator(item){if(this.opt.development_extensions.locator_date_and_revision){if(item.locator){item.locator=""+item.locator;var idx=item.locator.indexOf("|");if(idx>-1){var raw_locator=item.locator;item.locator=raw_locator.slice(0,idx);raw_locator=raw_locator.slice(idx+1);var m=raw_locator.match(/^([0-9]{4}-[0-9]{2}-[0-9]{2}).*/);if(m){item["locator-date"]=this.fun.dateparser.parseDateToObject(m[1]);raw_locator=raw_locator.slice(m[1].length);}item["locator-extra"]=raw_locator.replace(/^\s+/,"").replace(/\s+$/,"");}}}if(item.locator){item.locator=(""+item.locator).replace(/\s+$/,'');}return item;},normalizeLocaleStr:function normalizeLocaleStr(str){if(!str)return;var lst=str.split('-');lst[0]=lst[0].toLowerCase();if(lst[1]){lst[1]=lst[1].toUpperCase();}return lst.join("-");},isDatePart:function isDatePart(str,less,more){if(str.length>less&&str.length<more&&parseInt(str)){return true;}else{return false;}},isDateString:function isDateString(str){if(!str)return false;var strLst=str.split("-");if(strLst.length>0){if(!this.isDatePart(strLst[0],3,5)){return false;}}if(strLst.length>1){if(!this.isDatePart(strLst[1],0,3)){return false;}}if(strLst.length>2){if(!this.isDatePart(strLst[2],0,3)){return false;}}if(strLst.length>3){return false;}return true;},parseNoteFieldHacks:function parseNoteFieldHacks(Item,validFieldsForType,allowDateOverride){if("string"!==typeof Item.note)return;var elems=[];var lines=Item.note.split('\n');var lastline="";for(var i=0,ilen=lines.length;i<ilen;i++){var line=lines[i];var elems=[];var m=line.match(CSL.NOTE_FIELDS_REGEXP);if(m){var splt=line.split(CSL.NOTE_FIELDS_REGEXP);for(var j=0,jlen=splt.length-1;j<jlen;j++){elems.push(splt[j]);elems.push(m[j]);}elems.push(splt[splt.length-1]);for(var j=1,jlen=elems.length;j<jlen;j+=2){if(elems[j-1].trim()&&(i>0||j>1)&&!elems[j-1].match(CSL.NOTE_FIELD_REGEXP)){break;}else{elems[j]='\n'+elems[j].slice(2,-1).trim()+'\n';}}lines[i]=elems.join('');}}lines=lines.join('\n').split('\n');var offset=0;var names={};for(var i=0,ilen=lines.length;i<ilen;i++){var line=lines[i];var mm=line.match(CSL.NOTE_FIELD_REGEXP);if(!line.trim()){continue;}else if(!mm){if(i===0){continue;}else{offset=i;break;}}var key=mm[1];var val=mm[2].replace(/^\s+/,"").replace(/\s+$/,"");if(key==="type"){Item.type=val;lines[i]="";}else if(CSL.DATE_VARIABLES.indexOf(key)>-1){if(allowDateOverride){Item[key]={raw:val};if(!validFieldsForType||validFieldsForType[key]&&this.isDateString(val)){lines[i]="";}}}else if(!Item[key]){if(CSL.NAME_VARIABLES.indexOf(key)>-1){if(!names[key]){names[key]=[];}var lst=val.split(/\s*\|\|\s*/);if(lst.length===1){names[key].push({literal:lst[0]});}else if(lst.length===2){var name={family:lst[0],given:lst[1]};CSL.parseParticles(name);names[key].push(name);}}else{Item[key]=val;}if(!validFieldsForType||validFieldsForType[key]){lines[i]="";}}}for(var key in names){Item[key]=names[key];}if(validFieldsForType){if(lines[offset].trim()){lines[offset]='\n'+lines[offset];}for(var i=offset-1;i>-1;i--){if(!lines[i].trim()){lines=lines.slice(0,i).concat(lines.slice(i+1));}}}Item.note=lines.join("\n").trim();},GENDERS:["masculine","feminine"],ERROR_NO_RENDERED_FORM:1,PREVIEW:"Just for laughs.",ASSUME_ALL_ITEMS_REGISTERED:2,START:0,END:1,SINGLETON:2,SEEN:6,SUCCESSOR:3,SUCCESSOR_OF_SUCCESSOR:4,SUPPRESS:5,SINGULAR:0,PLURAL:1,LITERAL:true,BEFORE:1,AFTER:2,DESCENDING:1,ASCENDING:2,ONLY_FIRST:1,ALWAYS:2,ONLY_LAST:3,FINISH:1,POSITION_FIRST:0,POSITION_SUBSEQUENT:1,POSITION_IBID:2,POSITION_IBID_WITH_LOCATOR:3,MARK_TRAILING_NAMES:true,POSITION_TEST_VARS:["position","first-reference-note-number","near-note"],AREAS:["citation","citation_sort","bibliography","bibliography_sort"],CITE_FIELDS:["first-reference-note-number","locator","locator-extra"],MINIMAL_NAME_FIELDS:["literal","family"],SWAPPING_PUNCTUATION:[".","!","?",":",","],TERMINAL_PUNCTUATION:[":",".",";","!","?"," "],NONE:0,NUMERIC:1,POSITION:2,COLLAPSE_VALUES:["citation-number","year","year-suffix"],DATE_PARTS:["year","month","day"],DATE_PARTS_ALL:["year","month","day","season"],DATE_PARTS_INTERNAL:["year","month","day","year_end","month_end","day_end"],NAME_PARTS:["non-dropping-particle","family","given","dropping-particle","suffix","literal"],DECORABLE_NAME_PARTS:["given","family","suffix"],DISAMBIGUATE_OPTIONS:["disambiguate-add-names","disambiguate-add-givenname","disambiguate-add-year-suffix"],GIVENNAME_DISAMBIGUATION_RULES:["all-names","all-names-with-initials","primary-name","primary-name-with-initials","by-cite"],NAME_ATTRIBUTES:["and","delimiter-precedes-last","delimiter-precedes-et-al","initialize-with","initialize","name-as-sort-order","sort-separator","et-al-min","et-al-use-first","et-al-subsequent-min","et-al-subsequent-use-first","form","prefix","suffix","delimiter"],PARALLEL_MATCH_VARS:["container-title"],PARALLEL_TYPES:["bill","gazette","regulation","legislation","legal_case","treaty","article-magazine","article-journal"],PARALLEL_COLLAPSING_MID_VARSET:["volume","issue","container-title","section","collection-number"],LOOSE:0,STRICT:1,TOLERANT:2,PREFIX_PUNCTUATION:/[.;:]\s*$/,SUFFIX_PUNCTUATION:/^\s*[.;:,\(\)]/,NUMBER_REGEXP:/(?:^\d+|\d+$)/,NAME_INITIAL_REGEXP:/^([A-Z\u0e01-\u0e5b\u00c0-\u017f\u0400-\u042f\u0590-\u05d4\u05d6-\u05ff\u0600-\u06ff\u0370\u0372\u0376\u0386\u0388-\u03ab\u03e2\u03e4\u03e6\u03e8\u03ea\u03ec\u03ee\u03f4\u03f7\u03fd-\u03ff])([a-zA-Z\u0e01-\u0e5b\u00c0-\u017f\u0400-\u052f\u0600-\u06ff\u0370-\u03ff\u1f00-\u1fff]*|)/,ROMANESQUE_REGEXP:/[-0-9a-zA-Z\u0e01-\u0e5b\u00c0-\u017f\u0370-\u03ff\u0400-\u052f\u0590-\u05d4\u05d6-\u05ff\u1f00-\u1fff\u0600-\u06ff\u200c\u200d\u200e\u0218\u0219\u021a\u021b\u202a-\u202e]/,ROMANESQUE_NOT_REGEXP:/[^a-zA-Z\u0e01-\u0e5b\u00c0-\u017f\u0370-\u03ff\u0400-\u052f\u0590-\u05d4\u05d6-\u05ff\u1f00-\u1fff\u0600-\u06ff\u200c\u200d\u200e\u0218\u0219\u021a\u021b\u202a-\u202e]/g,STARTSWITH_ROMANESQUE_REGEXP:/^[&a-zA-Z\u0e01-\u0e5b\u00c0-\u017f\u0370-\u03ff\u0400-\u052f\u0590-\u05d4\u05d6-\u05ff\u1f00-\u1fff\u0600-\u06ff\u200c\u200d\u200e\u0218\u0219\u021a\u021b\u202a-\u202e]/,ENDSWITH_ROMANESQUE_REGEXP:/[.;:&a-zA-Z\u0e01-\u0e5b\u00c0-\u017f\u0370-\u03ff\u0400-\u052f\u0590-\u05d4\u05d6-\u05ff\u1f00-\u1fff\u0600-\u06ff\u200c\u200d\u200e\u0218\u0219\u021a\u021b\u202a-\u202e]$/,ALL_ROMANESQUE_REGEXP:/^[a-zA-Z\u0e01-\u0e5b\u00c0-\u017f\u0370-\u03ff\u0400-\u052f\u0590-\u05d4\u05d6-\u05ff\u1f00-\u1fff\u0600-\u06ff\u200c\u200d\u200e\u0218\u0219\u021a\u021b\u202a-\u202e]+$/,VIETNAMESE_SPECIALS:/[\u00c0-\u00c3\u00c8-\u00ca\u00cc\u00cd\u00d2-\u00d5\u00d9\u00da\u00dd\u00e0-\u00e3\u00e8-\u00ea\u00ec\u00ed\u00f2-\u00f5\u00f9\u00fa\u00fd\u0101\u0103\u0110\u0111\u0128\u0129\u0168\u0169\u01a0\u01a1\u01af\u01b0\u1ea0-\u1ef9]/,VIETNAMESE_NAMES:/^(?:(?:[.AaBbCcDdEeGgHhIiKkLlMmNnOoPpQqRrSsTtUuVvXxYy \u00c0-\u00c3\u00c8-\u00ca\u00cc\u00cd\u00d2-\u00d5\u00d9\u00da\u00dd\u00e0-\u00e3\u00e8-\u00ea\u00ec\u00ed\u00f2-\u00f5\u00f9\u00fa\u00fd\u0101\u0103\u0110\u0111\u0128\u0129\u0168\u0169\u01a0\u01a1\u01af\u01b0\u1ea0-\u1ef9]{2,6})(\s+|$))+$/,NOTE_FIELDS_REGEXP:/\{:(?:[\-_a-z]+|[A-Z]+):[^\}]+\}/g,NOTE_FIELD_REGEXP:/^([\-_a-z]+|[A-Z]+):\s*([^\}]+)$/,PARTICLE_GIVEN_REGEXP:/^([^ ]+(?:\u02bb |\u2019 | |\' ) *)(.+)$/,PARTICLE_FAMILY_REGEXP:/^([^ ]+(?:\-|\u02bb|\u2019| |\') *)(.+)$/,DISPLAY_CLASSES:["block","left-margin","right-inline","indent"],NAME_VARIABLES:["author","collection-editor","composer","container-author","director","editor","editorial-director","illustrator","interviewer","original-author","recipient","reviewed-author","translator"],NUMERIC_VARIABLES:["call-number","chapter-number","collection-number","edition","page","issue","locator","number","number-of-pages","number-of-volumes","volume","citation-number"],DATE_VARIABLES:["locator-date","issued","event-date","accessed","container","original-date","publication-date","original-date","available-date","submitted"],TITLE_FIELD_SPLITS:function TITLE_FIELD_SPLITS(seg){var keys=["title","short","main","sub"];var ret={};for(var i=0,ilen=keys.length;i<ilen;i++){ret[keys[i]]=seg+"title"+(keys[i]==="title"?"":"-"+keys[i]);}return ret;},TAG_USEALL:function TAG_USEALL(str){var ret,open,close,end;ret=[""];open=str.indexOf("<");close=str.indexOf(">");while(open>-1&&close>-1){if(open>close){end=open+1;}else{end=close+1;}if(open<close&&str.slice(open+1,close).indexOf("<")===-1){ret[ret.length-1]+=str.slice(0,open);ret.push(str.slice(open,close+1));ret.push("");str=str.slice(end);}else{ret[ret.length-1]+=str.slice(0,close+1);str=str.slice(end);}open=str.indexOf("<");close=str.indexOf(">");}ret[ret.length-1]+=str;return ret;},demoteNoiseWords:function demoteNoiseWords(state,fld,drop_or_demote){var SKIP_WORDS=state.locale[state.opt.lang].opts["leading-noise-words"];if(fld&&drop_or_demote){fld=fld.split(/\s+/);fld.reverse();var toEnd=[];for(var j=fld.length-1;j>-1;j+=-1){if(SKIP_WORDS.indexOf(fld[j].toLowerCase())>-1){toEnd.push(fld.pop());}else{break;}}fld.reverse();var start=fld.join(" ");var end=toEnd.join(" ");if("drop"===drop_or_demote||!end){fld=start;}else if("demote"===drop_or_demote){fld=[start,end].join(", ");}}return fld;},extractTitleAndSubtitle:function extractTitleAndSubtitle(Item){var segments=["","container-"];for(var i=0,ilen=segments.length;i<ilen;i++){var seg=segments[i];var title=CSL.TITLE_FIELD_SPLITS(seg);var langs=[false];if(Item.multi){for(var lang in Item.multi._keys[title.short]){langs.push(lang);}}for(var j=0,jlen=langs.length;j<ilen;j++){var lang=langs[j];var vals={};if(lang){if(Item.multi._keys[title.title]){vals[title.title]=Item.multi._keys[title.title][lang];}if(Item.multi._keys[title["short"]]){vals[title["short"]]=Item.multi._keys[title["short"]][lang];}}else{vals[title.title]=Item[title.title];vals[title["short"]]=Item[title["short"]];}vals[title.main]=vals[title.title];vals[title.sub]=false;if(vals[title.title]&&vals[title["short"]]){var shortTitle=vals[title["short"]];var offset=shortTitle.length;if(vals[title.title].slice(0,offset)===shortTitle&&vals[title.title].slice(offset).match(/^\s*:/)){vals[title.main]=vals[title.title].slice(0,offset).replace(/\s+$/,"");vals[title.sub]=vals[title.title].slice(offset).replace(/^\s*:\s*/,"");}}if(lang){for(var key in vals){if(!Item.multi._keys[key]){Item.multi._keys[key]={};}Item.multi._keys[key][lang]=vals[key];}}else{for(var key in vals){Item[key]=vals[key];}}}}},titlecaseSentenceOrNormal:function titlecaseSentenceOrNormal(state,Item,seg,lang,sentenceCase){var title=CSL.TITLE_FIELD_SPLITS(seg);var vals={};if(lang&&Item.multi){if(Item.multi._keys[title.title]){vals[title.title]=Item.multi._keys[title.title][lang];}if(Item.multi._keys[title.main]){vals[title.main]=Item.multi._keys[title.main][lang];}if(Item.multi._keys[title.sub]){vals[title.sub]=Item.multi._keys[title.sub][lang];}}else{vals[title.title]=Item[title.title];vals[title.main]=Item[title.main];vals[title.sub]=Item[title.sub];}if(vals[title.main]&&vals[title.sub]){var mainTitle=vals[title.main];var subTitle=vals[title.sub];if(sentenceCase){mainTitle=CSL.Output.Formatters.sentence(state,mainTitle);subTitle=CSL.Output.Formatters.sentence(state,subTitle);}else{subTitle=CSL.Output.Formatters["capitalize-first"](state,subTitle);}return[mainTitle,subTitle].join(vals[title.title].slice(mainTitle.length,-1*subTitle.length));}else{if(sentenceCase){return CSL.Output.Formatters.sentence(state,vals[title.title]);}else{return vals[title.title];}}},getSafeEscape:function getSafeEscape(state){if(["bibliography","citation"].indexOf(state.tmp.area)>-1){var callbacks=[];if(state.opt.development_extensions.thin_non_breaking_space_html_hack&&state.opt.mode==="html"){callbacks.push(function(txt){return txt.replace(/\u202f/g,'<span style="white-space:nowrap"> </span>');});}if(callbacks.length){return function(txt){for(var i=0,ilen=callbacks.length;i<ilen;i+=1){txt=callbacks[i](txt);}return CSL.Output.Formats[state.opt.mode].text_escape(txt);};}else{return CSL.Output.Formats[state.opt.mode].text_escape;}}else{return function(txt){return txt;};}},SKIP_WORDS:["about","above","across","afore","after","against","along","alongside","amid","amidst","among","amongst","anenst","apropos","apud","around","as","aside","astride","at","athwart","atop","barring","before","behind","below","beneath","beside","besides","between","beyond","but","by","circa","despite","down","during","except","for","forenenst","from","given","in","inside","into","lest","like","modulo","near","next","notwithstanding","of","off","on","onto","out","over","per","plus","pro","qua","sans","since","than","through"," thru","throughout","thruout","till","to","toward","towards","under","underneath","until","unto","up","upon","versus","vs.","v.","vs","v","via","vis-à -vis","with","within","without","according to","ahead of","apart from","as for","as of","as per","as regards","aside from","back to","because of","close to","due to","except for","far from","inside of","instead of","near to","next to","on to","out from","out of","outside of","prior to","pursuant to","rather than","regardless of","such as","that of","up to","where as","or","yet","so","for","and","nor","a","an","the","de","d'","von","van","c","et","ca"],FORMAT_KEY_SEQUENCE:["@strip-periods","@font-style","@font-variant","@font-weight","@text-decoration","@vertical-align","@quotes"],INSTITUTION_KEYS:["font-style","font-variant","font-weight","text-decoration","text-case"],SUFFIX_CHARS:"a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z",ROMAN_NUMERALS:[["","i","ii","iii","iv","v","vi","vii","viii","ix"],["","x","xx","xxx","xl","l","lx","lxx","lxxx","xc"],["","c","cc","ccc","cd","d","dc","dcc","dccc","cm"],["","m","mm","mmm","mmmm","mmmmm"]],LANGS:{"af-ZA":"Afrikaans","ar":"Arabic","bg-BG":"Bulgarian","ca-AD":"Catalan","cs-CZ":"Czech","da-DK":"Danish","de-AT":"Austrian","de-CH":"German (CH)","de-DE":"German (DE)","el-GR":"Greek","en-GB":"English (GB)","en-US":"English (US)","es-ES":"Spanish","et-EE":"Estonian","eu":"European","fa-IR":"Persian","fi-FI":"Finnish","fr-CA":"French (CA)","fr-FR":"French (FR)","he-IL":"Hebrew","hr-HR":"Croatian","hu-HU":"Hungarian","is-IS":"Icelandic","it-IT":"Italian","ja-JP":"Japanese","km-KH":"Khmer","ko-KR":"Korean","lt-LT":"Lithuanian","lv-LV":"Latvian","mn-MN":"Mongolian","nb-NO":"Norwegian (BokmÃ¥l)","nl-NL":"Dutch","nn-NO":"Norwegian (Nynorsk)","pl-PL":"Polish","pt-BR":"Portuguese (BR)","pt-PT":"Portuguese (PT)","ro-RO":"Romanian","ru-RU":"Russian","sk-SK":"Slovak","sl-SI":"Slovenian","sr-RS":"Serbian","sv-SE":"Swedish","th-TH":"Thai","tr-TR":"Turkish","uk-UA":"Ukranian","vi-VN":"Vietnamese","zh-CN":"Chinese (CN)","zh-TW":"Chinese (TW)"},LANG_BASES:{af:"af_ZA",ar:"ar",bg:"bg_BG",ca:"ca_AD",cs:"cs_CZ",da:"da_DK",de:"de_DE",el:"el_GR",en:"en_US",es:"es_ES",et:"et_EE",eu:"eu",fa:"fa_IR",fi:"fi_FI",fr:"fr_FR",he:"he_IL",hr:"hr-HR",hu:"hu_HU",is:"is_IS",it:"it_IT",ja:"ja_JP",km:"km_KH",ko:"ko_KR",lt:"lt_LT",lv:"lv-LV",mn:"mn_MN",nb:"nb_NO",nl:"nl_NL",nn:"nn-NO",pl:"pl_PL",pt:"pt_PT",ro:"ro_RO",ru:"ru_RU",sk:"sk_SK",sl:"sl_SI",sr:"sr_RS",sv:"sv_SE",th:"th_TH",tr:"tr_TR",uk:"uk_UA",vi:"vi_VN",zh:"zh_CN"},SUPERSCRIPTS:{"\xAA":"a","\xB2":"2","\xB3":"3","\xB9":"1","\xBA":"o","\u02B0":"h","\u02B1":"\u0266","\u02B2":"j","\u02B3":"r","\u02B4":"\u0279","\u02B5":"\u027B","\u02B6":"\u0281","\u02B7":"w","\u02B8":"y","\u02E0":"\u0263","\u02E1":"l","\u02E2":"s","\u02E3":"x","\u02E4":"\u0295","\u1D2C":"A","\u1D2D":"\xC6","\u1D2E":"B","\u1D30":"D","\u1D31":"E","\u1D32":"\u018E","\u1D33":"G","\u1D34":"H","\u1D35":"I","\u1D36":"J","\u1D37":"K","\u1D38":"L","\u1D39":"M","\u1D3A":"N","\u1D3C":"O","\u1D3D":"\u0222","\u1D3E":"P","\u1D3F":"R","\u1D40":"T","\u1D41":"U","\u1D42":"W","\u1D43":"a","\u1D44":"\u0250","\u1D45":"\u0251","\u1D46":"\u1D02","\u1D47":"b","\u1D48":"d","\u1D49":"e","\u1D4A":"\u0259","\u1D4B":"\u025B","\u1D4C":"\u025C","\u1D4D":"g","\u1D4F":"k","\u1D50":"m","\u1D51":"\u014B","\u1D52":"o","\u1D53":"\u0254","\u1D54":"\u1D16","\u1D55":"\u1D17","\u1D56":"p","\u1D57":"t","\u1D58":"u","\u1D59":"\u1D1D","\u1D5A":"\u026F","\u1D5B":"v","\u1D5C":"\u1D25","\u1D5D":"\u03B2","\u1D5E":"\u03B3","\u1D5F":"\u03B4","\u1D60":"\u03C6","\u1D61":"\u03C7","\u2070":"0","\u2071":"i","\u2074":"4","\u2075":"5","\u2076":"6","\u2077":"7","\u2078":"8","\u2079":"9","\u207A":"+","\u207B":"\u2212","\u207C":"=","\u207D":"(","\u207E":")","\u207F":"n","\u2120":"SM","\u2122":"TM","\u3192":"\u4E00","\u3193":"\u4E8C","\u3194":"\u4E09","\u3195":"\u56DB","\u3196":"\u4E0A","\u3197":"\u4E2D","\u3198":"\u4E0B","\u3199":"\u7532","\u319A":"\u4E59","\u319B":"\u4E19","\u319C":"\u4E01","\u319D":"\u5929","\u319E":"\u5730","\u319F":"\u4EBA","\u02C0":"\u0294","\u02C1":"\u0295","\u06E5":"\u0648","\u06E6":"\u064A"},SUPERSCRIPTS_REGEXP:new RegExp("[\xAA\xB2\xB3\xB9\xBA\u02B0\u02B1\u02B2\u02B3\u02B4\u02B5\u02B6\u02B7\u02B8\u02E0\u02E1\u02E2\u02E3\u02E4\u1D2C\u1D2D\u1D2E\u1D30\u1D31\u1D32\u1D33\u1D34\u1D35\u1D36\u1D37\u1D38\u1D39\u1D3A\u1D3C\u1D3D\u1D3E\u1D3F\u1D40\u1D41\u1D42\u1D43\u1D44\u1D45\u1D46\u1D47\u1D48\u1D49\u1D4A\u1D4B\u1D4C\u1D4D\u1D4F\u1D50\u1D51\u1D52\u1D53\u1D54\u1D55\u1D56\u1D57\u1D58\u1D59\u1D5A\u1D5B\u1D5C\u1D5D\u1D5E\u1D5F\u1D60\u1D61\u2070\u2071\u2074\u2075\u2076\u2077\u2078\u2079\u207A\u207B\u207C\u207D\u207E\u207F\u2120\u2122\u3192\u3193\u3194\u3195\u3196\u3197\u3198\u3199\u319A\u319B\u319C\u319D\u319E\u319F\u02C0\u02C1\u06E5\u06E6]","g"),UPDATE_GROUP_CONTEXT_CONDITION:function UPDATE_GROUP_CONTEXT_CONDITION(state,termtxt,valueTerm){if(state.tmp.group_context.tip.condition){if(state.tmp.group_context.tip.condition.test){var testres;if(state.tmp.group_context.tip.condition.test==="empty-label"){testres=!termtxt;}else if(state.tmp.group_context.tip.condition.test==="empty-label-no-decor"){testres=!termtxt||termtxt.indexOf("%s")>-1;}else if(state.tmp.group_context.tip.condition.test==="comma-safe"){var empty=!termtxt;var alpha=termtxt.slice(0,1).match(CSL.ALL_ROMANESQUE_REGEXP);var num=state.tmp.just_did_number;if(empty){testres=true;}else if(num){if(alpha&&!valueTerm){testres=true;}else{testres=false;}}else{if(alpha&&!valueTerm){testres=true;}else{testres=false;}}}if(testres){state.tmp.group_context.tip.force_suppress=false;}else{state.tmp.group_context.tip.force_suppress=true;}if(state.tmp.group_context.tip.condition.not){state.tmp.group_context.tip.force_suppress=!state.tmp.group_context.tip.force_suppress;}}}else{if(termtxt.slice(-1).match(/[0-9]/)){state.tmp.just_did_number=true;}else{state.tmp.just_did_number=false;}}},locale:{},locale_opts:{},locale_dates:{}};if(typeof citationRequire!=="undefined"&&typeof module!=='undefined'&&"exports"in module){var CSL_IS_NODEJS=true;exports.CSL=CSL;}CSL.TERMINAL_PUNCTUATION_REGEXP=new RegExp("^(["+CSL.TERMINAL_PUNCTUATION.slice(0,-1).join("")+"])(.*)");CSL.CLOSURES=new RegExp(".*[\\]\\)]");module.exports=CSL;if("undefined"===typeof console){CSL.debug=function(str){dump("CSL: "+str+"\n");};CSL.error=function(str){dump("CSL error: "+str+"\n");};}else{CSL.debug=function(str){console.log("CSL: "+str);};CSL.error=function(str){console.log("CSL error: "+str);};}module.exports=CSL;CSL.XmlJSON=function(dataObj){this.dataObj=dataObj;this.institution={name:"institution",attrs:{"institution-parts":"long","delimiter":", ","substitute-use-first":"1","use-last":"1"},children:[{name:"institution-part",attrs:{name:"long"},children:[]}]};};CSL.XmlJSON.prototype.clean=function(json){return json;};CSL.XmlJSON.prototype.getStyleId=function(myjson,styleName){var tagName='id';if(styleName){tagName='title';}var ret="";var children=myjson.children;for(var i=0,ilen=children.length;i<ilen;i++){if(children[i].name==='info'){var grandkids=children[i].children;for(var j=0,jlen=grandkids.length;j<jlen;j++){if(grandkids[j].name===tagName){ret=grandkids[j].children[0];}}}}return ret;};CSL.XmlJSON.prototype.children=function(myjson){if(myjson&&myjson.children.length){return myjson.children.slice();}else{return false;}};CSL.XmlJSON.prototype.nodename=function(myjson){return myjson?myjson.name:null;};CSL.XmlJSON.prototype.attributes=function(myjson){var ret={};for(var attrname in myjson.attrs){ret["@"+attrname]=myjson.attrs[attrname];}return ret;};CSL.XmlJSON.prototype.content=function(myjson){var ret="";if(!myjson||!myjson.children){return ret;}for(var i=0,ilen=myjson.children.length;i<ilen;i+=1){if("string"===typeof myjson.children[i]){ret+=myjson.children[i];}}return ret;};CSL.XmlJSON.prototype.namespace={};CSL.XmlJSON.prototype.numberofnodes=function(myjson){if(myjson&&"number"==typeof myjson.length){return myjson.length;}else{return 0;}};CSL.XmlJSON.prototype.getAttributeValue=function(myjson,name,namespace){var ret="";if(namespace){name=namespace+":"+name;}if(myjson){if(myjson.attrs){if(myjson.attrs[name]){ret=myjson.attrs[name];}else{ret="";}}}return ret;};CSL.XmlJSON.prototype.getNodeValue=function(myjson,name){var ret="";if(name){for(var i=0,ilen=myjson.children.length;i<ilen;i+=1){if(myjson.children[i].name===name){if(myjson.children[i].children.length){ret=myjson.children[i];}else{ret="";}}}}else if(myjson){ret=myjson;}if(ret&&ret.children&&ret.children.length==1&&"string"===typeof ret.children[0]){ret=ret.children[0];}return ret;};CSL.XmlJSON.prototype.setAttributeOnNodeIdentifiedByNameAttribute=function(myjson,nodename,partname,attrname,val){var pos,len,xml,nodes,node;if(attrname.slice(0,1)==='@'){attrname=attrname.slice(1);}for(var i=0,ilen=myjson.children.length;i<ilen;i+=1){if(myjson.children[i].name===nodename&&myjson.children[i].attrs.name===partname){myjson.children[i].attrs[attrname]=val;}}};CSL.XmlJSON.prototype.deleteNodeByNameAttribute=function(myjson,val){var i,ilen;for(i=0,ilen=myjson.children.length;i<ilen;i+=1){if(!myjson.children[i]||"string"===typeof myjson.children[i]){continue;}if(myjson.children[i].attrs.name==val){myjson.children=myjson.children.slice(0,i).concat(myjson.children.slice(i+1));}}};CSL.XmlJSON.prototype.deleteAttribute=function(myjson,attrname){var i,ilen;if("undefined"!==typeof myjson.attrs[attrname]){myjson.attrs.pop(attrname);}};CSL.XmlJSON.prototype.setAttribute=function(myjson,attr,val){myjson.attrs[attr]=val;return false;};CSL.XmlJSON.prototype.nodeCopy=function(myjson,clone){if(!clone){var clone={};}if("object"===_typeof(clone)&&"undefined"===typeof clone.length){for(var key in myjson){if("string"===typeof myjson[key]){clone[key]=myjson[key];}else if("object"===_typeof(myjson[key])){if("undefined"===typeof myjson[key].length){clone[key]=this.nodeCopy(myjson[key],{});}else{clone[key]=this.nodeCopy(myjson[key],[]);}}}}else{for(var i=0,ilen=myjson.length;i<ilen;i+=1){if("string"===typeof myjson[i]){clone[i]=myjson[i];}else{clone[i]=this.nodeCopy(myjson[i],{});}}}return clone;};CSL.XmlJSON.prototype.getNodesByName=function(myjson,name,nameattrval,ret){var nodes,node,pos,len;if(!ret){var ret=[];}if(!myjson||!myjson.children){return ret;}if(name===myjson.name){if(nameattrval){if(nameattrval===myjson.attrs.name){ret.push(myjson);}}else{ret.push(myjson);}}for(var i=0,ilen=myjson.children.length;i<ilen;i+=1){if("object"!==_typeof(myjson.children[i])){continue;}this.getNodesByName(myjson.children[i],name,nameattrval,ret);}return ret;};CSL.XmlJSON.prototype.nodeNameIs=function(myjson,name){if(typeof myjson==="undefined"){return false;}if(name==myjson.name){return true;}return false;};CSL.XmlJSON.prototype.makeXml=function(myjson){if("string"===typeof myjson){if(myjson.slice(0,1)==="<"){myjson=this.jsonStringWalker.walkToObject(myjson);}else{myjson=JSON.parse(myjson);}}return myjson;};CSL.XmlJSON.prototype.insertChildNodeAfter=function(parent,node,pos,datejson){for(var i=0,ilen=parent.children.length;i<ilen;i+=1){if(node===parent.children[i]){parent.children=parent.children.slice(0,i).concat([datejson]).concat(parent.children.slice(i+1));break;}}return parent;};CSL.XmlJSON.prototype.insertPublisherAndPlace=function(myjson){if(myjson.name==="group"){var useme=true;var mustHaves=["publisher","publisher-place"];for(var i=0,ilen=myjson.children.length;i<ilen;i+=1){var haveVarname=mustHaves.indexOf(myjson.children[i].attrs.variable);var isText=myjson.children[i].name==="text";if(isText&&haveVarname>-1&&!myjson.children[i].attrs.prefix&&!myjson.children[i].attrs.suffix){mustHaves=mustHaves.slice(0,haveVarname).concat(mustHaves.slice(haveVarname+1));}else{useme=false;break;}}if(useme&&!mustHaves.length){myjson.attrs["has-publisher-and-publisher-place"]=true;}}for(var i=0,ilen=myjson.children.length;i<ilen;i+=1){if("object"===_typeof(myjson.children[i])){this.insertPublisherAndPlace(myjson.children[i]);}}};CSL.XmlJSON.prototype.isChildOfSubstitute=function(parents){if(parents.length>0){var myparents=parents.slice();var parent=myparents.pop();if(parent==="substitute"){return true;}else{return this.isChildOfSubstitute(myparents);}}return false;};CSL.XmlJSON.prototype.addMissingNameNodes=function(myjson,parents){if(!parents){parents=[];}if(myjson.name==="names"){if(!this.isChildOfSubstitute(parents)){var addName=true;for(var i=0,ilen=myjson.children.length;i<ilen;i++){if(myjson.children[i].name==="name"){addName=false;break;}}if(addName){myjson.children=[{name:"name",attrs:{},children:[]}].concat(myjson.children);}}}parents.push(myjson.name);for(var i=0,ilen=myjson.children.length;i<ilen;i+=1){if("object"===_typeof(myjson.children[i])){this.addMissingNameNodes(myjson.children[i],parents);}}parents.pop();};CSL.XmlJSON.prototype.addInstitutionNodes=function(myjson){var names,thenames,institution,theinstitution,name,thename,xml,pos,len;if(myjson.name==="names"){var attributes={};var insertPos=-1;for(var i=0,ilen=myjson.children.length;i<ilen;i+=1){if(myjson.children[i].name=="name"){for(var key in myjson.children[i].attrs){attributes[key]=myjson.children[i].attrs[key];}attributes.delimiter=myjson.children[i].attrs.delimiter;attributes.and=myjson.children[i].attrs.and;insertPos=i;for(var k=0,klen=myjson.children[i].children.length;k<klen;k+=1){if(myjson.children[i].children[k].attrs.name!=='family'){continue;}for(var key in myjson.children[i].children[k].attrs){attributes[key]=myjson.children[i].children[k].attrs[key];}}}if(myjson.children[i].name=="institution"){insertPos=-1;break;}}if(insertPos>-1){var institution=this.nodeCopy(this.institution);for(var i=0,ilen=CSL.INSTITUTION_KEYS.length;i<ilen;i+=1){var attrname=CSL.INSTITUTION_KEYS[i];if("undefined"!==typeof attributes[attrname]){institution.children[0].attrs[attrname]=attributes[attrname];}if(attributes.delimiter){institution.attrs.delimiter=attributes.delimiter;}if(attributes.and){institution.attrs.and="text";}}myjson.children=myjson.children.slice(0,insertPos+1).concat([institution]).concat(myjson.children.slice(insertPos+1));}}for(var i=0,ilen=myjson.children.length;i<ilen;i+=1){if("string"===typeof myjson.children[i]){continue;}this.addInstitutionNodes(myjson.children[i]);}};CSL.XmlJSON.prototype.flagDateMacros=function(myjson){for(var i=0,ilen=myjson.children.length;i<ilen;i+=1){if(myjson.children[i].name==="macro"){if(this.inspectDateMacros(myjson.children[i])){myjson.children[i].attrs["macro-has-date"]="true";}}}};CSL.XmlJSON.prototype.inspectDateMacros=function(myjson){if(!myjson||!myjson.children){return false;}if(myjson.name==="date"){return true;}else{for(var i=0,ilen=myjson.children.length;i<ilen;i+=1){if(this.inspectDateMacros(myjson.children[i])){return true;}}}return false;};CSL.stripXmlProcessingInstruction=function(xml){if(!xml){return xml;}xml=xml.replace(/^<\?[^?]+\?>/,"");xml=xml.replace(/<!--[^>]+-->/g,"");xml=xml.replace(/^\s+/g,"");xml=xml.replace(/\s+$/g,"");return xml;};CSL.parseXml=function(str){var _pos=0;var _obj={children:[]};var _stack=[_obj.children];function _listifyString(str){str=str.split(/(?:\r\n|\n|\r)/).join(" ").replace(/>[ ]+</g,"><").replace(/<\!--.*?-->/g,"");var lst=str.split("><");var stylePos=null;for(var i=0,ilen=lst.length;i<ilen;i++){if(i>0){lst[i]="<"+lst[i];}if(i<lst.length-1){lst[i]=lst[i]+">";}if("number"!=typeof stylePos){if(lst[i].slice(0,7)==="<style "||lst[i].slice(0,8)=="<locale "){stylePos=i;}}}lst=lst.slice(stylePos);for(var i=lst.length-2;i>-1;i--){if(lst[i].slice(1).indexOf("<")===-1){var stub=lst[i].slice(0,5);if(lst[i].slice(-2)!=="/>"){if(stub==="<term"){if(lst[i+1].slice(0,6)==="</term"){lst[i]=lst[i]+lst[i+1];lst=lst.slice(0,i+1).concat(lst.slice(i+2));}}else if(["<sing","<mult"].indexOf(stub)>-1){if(lst[i].slice(-2)!=="/>"&&lst[i+1].slice(0,1)==="<"){lst[i]=lst[i]+lst[i+1];lst=lst.slice(0,i+1).concat(lst.slice(i+2));}}}}}return lst;}function _decodeHtmlEntities(str){return str.split("&").join("&").split(""").join("\"").split(">").join(">").split("<").join("<").replace(/&#([0-9]{1,6});/gi,function(match,numStr){var num=parseInt(numStr,10);return String.fromCharCode(num);}).replace(/&#x([a-f0-9]{1,6});/gi,function(match,numStr){var num=parseInt(numStr,16);return String.fromCharCode(num);});}function _getAttributes(elem){var m=elem.match(/([^\'\"= ]+)=(?:\"[^\"]*\"|\'[^\']*\')/g);if(m){for(var i=0,ilen=m.length;i<ilen;i++){m[i]=m[i].replace(/=.*/,"");}}return m;}function _getAttribute(elem,attr){var rex=RegExp('^.*[ ]+'+attr+'=(\"(?:[^\"]*)\"|\'(?:[^\']*)\').*$');var m=elem.match(rex);return m?m[1].slice(1,-1):null;}function _getTagName(elem){var rex=RegExp("^<([^ />]+)");var m=elem.match(rex);return m?m[1]:null;}function _castObjectFromOpeningTag(elem){var obj={};obj.name=_getTagName(elem);obj.attrs={};var attributes=_getAttributes(elem);if(attributes){for(var i=0,ilen=attributes.length;i<ilen;i++){var attr={name:attributes[i],value:_getAttribute(elem,attributes[i])};obj.attrs[attr.name]=_decodeHtmlEntities(attr.value);}}obj.children=[];return obj;}function _extractTextFromCompositeElement(elem){var m=elem.match(/^.*>([^<]*)<.*$/);return _decodeHtmlEntities(m[1]);}function _appendToChildren(obj){_stack.slice(-1)[0].push(obj);}function _extendStackWithNewChildren(obj){_stack.push(obj.children);}function processElement(elem){var obj;if(elem.slice(1).indexOf('<')>-1){var tag=elem.slice(0,elem.indexOf('>')+1);obj=_castObjectFromOpeningTag(tag);obj.children=[_extractTextFromCompositeElement(elem)];_appendToChildren(obj);}else if(elem.slice(-2)==='/>'){obj=_castObjectFromOpeningTag(elem);if(_getTagName(elem)==='term'){obj.children.push('');}_appendToChildren(obj);}else if(elem.slice(0,2)==='</'){_stack.pop();}else{obj=_castObjectFromOpeningTag(elem);_appendToChildren(obj);_extendStackWithNewChildren(obj);}}var lst=_listifyString(str);for(var i=0,ilen=lst.length;i<ilen;i++){var elem=lst[i];processElement(elem);}return _obj.children[0];};module.exports=CSL;CSL.XmlDOM=function(dataObj){this.dataObj=dataObj;if("undefined"==typeof DOMParser){DOMParser=function DOMParser(){};DOMParser.prototype.parseFromString=function(str,contentType){if("undefined"!=typeof ActiveXObject){var xmldata=new ActiveXObject('MSXML.DomDocument');xmldata.async=false;xmldata.loadXML(str);return xmldata;}else if("undefined"!=typeof XMLHttpRequest){var xmldata=new XMLHttpRequest();if(!contentType){contentType='text/xml';}xmldata.open('GET','data:'+contentType+';charset=utf-8,'+encodeURIComponent(str),false);if(xmldata.overrideMimeType){xmldata.overrideMimeType(contentType);}xmldata.send(null);return xmldata.responseXML;}else if("undefined"!=typeof marknote){var parser=new marknote.Parser();return parser.parse(str);}};this.hasAttributes=function(node){var ret;if(node.attributes&&node.attributes.length){ret=true;}else{ret=false;}return ret;};}else{this.hasAttributes=function(node){var ret;if(node.attributes&&node.attributes.length){ret=true;}else{ret=false;}return ret;};}this.importNode=function(doc,srcElement){var ret;if("undefined"==typeof doc.importNode){ret=this._importNode(doc,srcElement,true);}else{ret=doc.importNode(srcElement,true);}return ret;};this._importNode=function(doc,node,allChildren){switch(node.nodeType){case 1:var newNode=doc.createElement(node.nodeName);if(node.attributes&&node.attributes.length>0)for(var i=0,il=node.attributes.length;i<il;){newNode.setAttribute(node.attributes[i].nodeName,node.getAttribute(node.attributes[i++].nodeName));}if(allChildren&&node.childNodes&&node.childNodes.length>0)for(var i=0,il=node.childNodes.length;i<il;){newNode.appendChild(this._importNode(doc,node.childNodes[i++],allChildren));}return newNode;break;case 3:case 4:case 8:}};this.parser=new DOMParser();var str="<docco><institution institution-parts=\"long\" delimiter=\", \" substitute-use-first=\"1\" use-last=\"1\"><institution-part name=\"long\"/></institution></docco>";var inst_doc=this.parser.parseFromString(str,"text/xml");var inst_node=inst_doc.getElementsByTagName("institution");this.institution=inst_node.item(0);var inst_part_node=inst_doc.getElementsByTagName("institution-part");this.institutionpart=inst_part_node.item(0);this.ns="http://purl.org/net/xbiblio/csl";};CSL.XmlDOM.prototype.clean=function(xml){xml=xml.replace(/<\?[^?]+\?>/g,"");xml=xml.replace(/<![^>]+>/g,"");xml=xml.replace(/^\s+/,"");xml=xml.replace(/\s+$/,"");xml=xml.replace(/^\n*/,"");return xml;};CSL.XmlDOM.prototype.getStyleId=function(myxml,styleName){var text="";var tagName="id";if(styleName){tagName="title";}var node=myxml.getElementsByTagName(tagName);if(node&&node.length){node=node.item(0);}if(node){text=node.textContent;}if(!text){text=node.innerText;}if(!text){text=node.innerHTML;}return text;};CSL.XmlDOM.prototype.children=function(myxml){var children,pos,len,ret;if(myxml){ret=[];children=myxml.childNodes;for(pos=0,len=children.length;pos<len;pos+=1){if(children[pos].nodeName!="#text"){ret.push(children[pos]);}}return ret;}else{return[];}};CSL.XmlDOM.prototype.nodename=function(myxml){var ret=myxml.nodeName;return ret;};CSL.XmlDOM.prototype.attributes=function(myxml){var ret,attrs,attr,key,xml,pos,len;ret=new Object();if(myxml&&this.hasAttributes(myxml)){attrs=myxml.attributes;for(pos=0,len=attrs.length;pos<len;pos+=1){attr=attrs[pos];ret["@"+attr.name]=attr.value;}}return ret;};CSL.XmlDOM.prototype.content=function(myxml){var ret;if("undefined"!=typeof myxml.textContent){ret=myxml.textContent;}else if("undefined"!=typeof myxml.innerText){ret=myxml.innerText;}else{ret=myxml.txt;}return ret;};CSL.XmlDOM.prototype.namespace={"xml":"http://www.w3.org/XML/1998/namespace"};CSL.XmlDOM.prototype.numberofnodes=function(myxml){if(myxml){return myxml.length;}else{return 0;}};CSL.XmlDOM.prototype.getAttributeName=function(attr){var ret=attr.name;return ret;};CSL.XmlDOM.prototype.getAttributeValue=function(myxml,name,namespace){var ret="";if(namespace){name=namespace+":"+name;}if(myxml&&this.hasAttributes(myxml)&&myxml.getAttribute(name)){ret=myxml.getAttribute(name);}return ret;};CSL.XmlDOM.prototype.getNodeValue=function(myxml,name){var ret=null;if(name){var vals=myxml.getElementsByTagName(name);if(vals.length>0){if("undefined"!=typeof vals[0].textContent){ret=vals[0].textContent;}else if("undefined"!=typeof vals[0].innerText){ret=vals[0].innerText;}else{ret=vals[0].text;}}}if(ret===null&&myxml&&myxml.childNodes&&(myxml.childNodes.length==0||myxml.childNodes.length==1&&myxml.firstChild.nodeName=="#text")){if("undefined"!=typeof myxml.textContent){ret=myxml.textContent;}else if("undefined"!=typeof myxml.innerText){ret=myxml.innerText;}else{ret=myxml.text;}}if(ret===null){ret=myxml;}return ret;};CSL.XmlDOM.prototype.setAttributeOnNodeIdentifiedByNameAttribute=function(myxml,nodename,partname,attrname,val){var pos,len,xml,nodes,node;if(attrname.slice(0,1)==='@'){attrname=attrname.slice(1);}nodes=myxml.getElementsByTagName(nodename);for(pos=0,len=nodes.length;pos<len;pos+=1){node=nodes[pos];if(node.getAttribute("name")!=partname){continue;}node.setAttribute(attrname,val);}};CSL.XmlDOM.prototype.deleteNodeByNameAttribute=function(myxml,val){var pos,len,node,nodes;nodes=myxml.childNodes;for(pos=0,len=nodes.length;pos<len;pos+=1){node=nodes[pos];if(!node||node.nodeType==node.TEXT_NODE){continue;}if(this.hasAttributes(node)&&node.getAttribute("name")==val){myxml.removeChild(nodes[pos]);}}};CSL.XmlDOM.prototype.deleteAttribute=function(myxml,attr){myxml.removeAttribute(attr);};CSL.XmlDOM.prototype.setAttribute=function(myxml,attr,val){if(!myxml.ownerDocument){myxml=myxml.firstChild;}if(["function","unknown"].indexOf(_typeof(myxml.setAttribute))>-1){myxml.setAttribute(attr,val);}return false;};CSL.XmlDOM.prototype.nodeCopy=function(myxml){var cloned_node=myxml.cloneNode(true);return cloned_node;};CSL.XmlDOM.prototype.getNodesByName=function(myxml,name,nameattrval){var ret,nodes,node,pos,len;ret=[];nodes=myxml.getElementsByTagName(name);for(pos=0,len=nodes.length;pos<len;pos+=1){node=nodes.item(pos);if(nameattrval&&!(this.hasAttributes(node)&&node.getAttribute("name")==nameattrval)){continue;}ret.push(node);}return ret;};CSL.XmlDOM.prototype.nodeNameIs=function(myxml,name){if(name==myxml.nodeName){return true;}return false;};CSL.XmlDOM.prototype.makeXml=function(myxml){var ret,topnode;if(!myxml){myxml="<docco><bogus/></docco>";}myxml=myxml.replace(/\s*<\?[^>]*\?>\s*\n*/g,"");var nodetree=this.parser.parseFromString(myxml,"application/xml");return nodetree.firstChild;};CSL.XmlDOM.prototype.insertChildNodeAfter=function(parent,node,pos,datexml){var myxml,xml;myxml=this.importNode(node.ownerDocument,datexml);parent.replaceChild(myxml,node);return parent;};CSL.XmlDOM.prototype.insertPublisherAndPlace=function(myxml){var group=myxml.getElementsByTagName("group");for(var i=0,ilen=group.length;i<ilen;i+=1){var node=group.item(i);var skippers=[];for(var j=0,jlen=node.childNodes.length;j<jlen;j+=1){if(node.childNodes.item(j).nodeType!==1){skippers.push(j);}}if(node.childNodes.length-skippers.length===2){var twovars=[];for(var j=0,jlen=2;j<jlen;j+=1){if(skippers.indexOf(j)>-1){continue;}var child=node.childNodes.item(j);var subskippers=[];for(var k=0,klen=child.childNodes.length;k<klen;k+=1){if(child.childNodes.item(k).nodeType!==1){subskippers.push(k);}}if(child.childNodes.length-subskippers.length===0){twovars.push(child.getAttribute('variable'));if(child.getAttribute('suffix')||child.getAttribute('prefix')){twovars=[];break;}}}if(twovars.indexOf("publisher")>-1&&twovars.indexOf("publisher-place")>-1){node.setAttribute('has-publisher-and-publisher-place',true);}}}};CSL.XmlDOM.prototype.isChildOfSubstitute=function(node){if(node.parentNode){if(node.parentNode.tagName.toLowerCase()==="substitute"){return true;}else{return this.isChildOfSubstitute(node.parentNode);}}return false;};CSL.XmlDOM.prototype.addMissingNameNodes=function(myxml){var nameslist=myxml.getElementsByTagName("names");for(var i=0,ilen=nameslist.length;i<ilen;i+=1){var names=nameslist.item(i);var namelist=names.getElementsByTagName("name");if((!namelist||namelist.length===0)&&!this.isChildOfSubstitute(names)){var doc=names.ownerDocument;var name=doc.createElement("name");names.appendChild(name);}}};CSL.XmlDOM.prototype.addInstitutionNodes=function(myxml){var names,thenames,institution,theinstitution,name,thename,xml,pos,len;names=myxml.getElementsByTagName("names");for(pos=0,len=names.length;pos<len;pos+=1){thenames=names.item(pos);name=thenames.getElementsByTagName("name");if(name.length==0){continue;}institution=thenames.getElementsByTagName("institution");if(institution.length==0){theinstitution=this.importNode(myxml.ownerDocument,this.institution);theinstitutionpart=theinstitution.getElementsByTagName("institution-part").item(0);thename=name.item(0);thenames.insertBefore(theinstitution,thename.nextSibling);for(var j=0,jlen=CSL.INSTITUTION_KEYS.length;j<jlen;j+=1){var attrname=CSL.INSTITUTION_KEYS[j];var attrval=thename.getAttribute(attrname);if(attrval){theinstitutionpart.setAttribute(attrname,attrval);}}var nameparts=thename.getElementsByTagName("name-part");for(var j=0,jlen=nameparts.length;j<jlen;j+=1){if('family'===nameparts[j].getAttribute('name')){for(var k=0,klen=CSL.INSTITUTION_KEYS.length;k<klen;k+=1){var attrname=CSL.INSTITUTION_KEYS[k];var attrval=nameparts[j].getAttribute(attrname);if(attrval){theinstitutionpart.setAttribute(attrname,attrval);}}}}}}};CSL.XmlDOM.prototype.flagDateMacros=function(myxml){var pos,len,thenode,thedate;nodes=myxml.getElementsByTagName("macro");for(pos=0,len=nodes.length;pos<len;pos+=1){thenode=nodes.item(pos);thedate=thenode.getElementsByTagName("date");if(thedate.length){thenode.setAttribute('macro-has-date','true');}}};module.exports=CSL;if("undefined"!==typeof XML){try{}catch(e){throw"OOPS: "+e;}}module.exports=CSL;CSL.setupXml=function(xmlObject){var dataObj={};var parser=null;if("undefined"!==typeof xmlObject){if("string"===typeof xmlObject){xmlObject=xmlObject.replace("^\uFEFF","").replace(/^\s+/,"");if(xmlObject.slice(0,1)==="<"){dataObj=CSL.parseXml(xmlObject);}else{dataObj=JSON.parse(xmlObject);}parser=new CSL.XmlJSON(dataObj);}else if("undefined"!==typeof xmlObject.getAttribute){parser=new CSL.XmlDOM(xmlObject);}else if("undefined"!==typeof xmlObject.toXMLString){parser=new CSL.XmlE4X(xmlObject);}else{parser=new CSL.XmlJSON(xmlObject);}}else{CSL.error("unable to parse XML input");}if(!parser){throw"citeproc-js error: unable to parse CSL style or locale object";}return parser;};module.exports=CSL;CSL.getSortCompare=function(default_locale){if(CSL.stringCompare){return CSL.stringCompare;}var strcmp;var strcmp_opts={sensitivity:"base",ignorePunctuation:true,numeric:true};if(!default_locale){default_locale="en-US";}strcmp=function strcmp(a,b){return a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase(),default_locale,strcmp_opts);};var stripPunct=function stripPunct(str){return str.replace(/^[\[\]\'\"]*/g,"");};var getBracketPreSort=function getBracketPreSort(){if(!strcmp("[x","x")){return false;}else{return function(a,b){return strcmp(stripPunct(a),stripPunct(b));};}};var bracketPreSort=getBracketPreSort();var sortCompare=function sortCompare(a,b){if(bracketPreSort){return bracketPreSort(a,b);}else{return strcmp(a,b);}};return sortCompare;};module.exports=CSL;CSL.ambigConfigDiff=function(a,b){var ret,pos,len,ppos,llen;if(a.names.length!==b.names.length){return 1;}else{for(pos=0,len=a.names.length;pos<len;pos+=1){if(a.names[pos]!==b.names[pos]){return 1;}else{for(ppos=0,llen=a.givens[pos];ppos<llen;ppos+=1){if(a.givens[pos][ppos]!==b.givens[pos][ppos]){return 1;}}}}}if(a.disambiguate!=b.disambiguate){return 1;}if(a.year_suffix!==b.year_suffix){return 1;}return 0;};CSL.cloneAmbigConfig=function(config,oldconfig,tainters){var i,ilen,j,jlen,k,klen,param;var ret={};ret.names=[];ret.givens=[];ret.year_suffix=false;ret.disambiguate=false;for(i=0,ilen=config.names.length;i<ilen;i+=1){param=config.names[i];ret.names[i]=param;}for(i=0,ilen=config.givens.length;i<ilen;i+=1){param=[];for(j=0,jlen=config.givens[i].length;j<jlen;j+=1){param.push(config.givens[i][j]);}ret.givens.push(param);}if(oldconfig){ret.year_suffix=oldconfig.year_suffix;ret.disambiguate=oldconfig.disambiguate;}else{ret.year_suffix=config.year_suffix;ret.disambiguate=config.disambiguate;}return ret;};CSL.getAmbigConfig=function(){var config,ret;config=this.tmp.disambig_request;if(!config){config=this.tmp.disambig_settings;}var ret=CSL.cloneAmbigConfig(config);return ret;};CSL.getMaxVals=function(){return this.tmp.names_max.mystack.slice();};CSL.getMinVal=function(){return this.tmp["et-al-min"];};module.exports=CSL;CSL.tokenExec=function(token,Item,item){var next,maybenext,exec,debug;debug=false;next=token.next;maybenext=false;var record=function record(result){if(result){this.tmp.jump.replace("succeed");return token.succeed;}else{this.tmp.jump.replace("fail");return token.fail;}};if(token.test){next=record.call(this,token.test(Item,item));}for(var i=0,ilen=token.execs.length;i<ilen;i++){exec=token.execs[i];maybenext=exec.call(token,this,Item,item);if(maybenext){next=maybenext;}}return next;};CSL.expandMacro=function(macro_key_token,target){var mkey,start_token,key,end_token,navi,macro_nodes,newoutput,mergeoutput,end_of_macro,func;mkey=macro_key_token.postponed_macro;macro_key_token=new CSL.Token("group",CSL.START);var hasDate=false;var macroid=false;macro_nodes=this.cslXml.getNodesByName(this.cslXml.dataObj,'macro',mkey);if(macro_nodes.length){macroid=this.cslXml.getAttributeValue(macro_nodes[0],'cslid');hasDate=this.cslXml.getAttributeValue(macro_nodes[0],"macro-has-date");}if(hasDate){mkey=mkey+"@"+this.build.current_default_locale;func=function func(state,Item){if(state.tmp.extension){state.tmp["doing-macro-with-date"]=true;}};macro_key_token.execs.push(func);}if(this.build.macro_stack.indexOf(mkey)>-1){throw"CSL processor error: call to macro \""+mkey+"\" would cause an infinite loop";}else{this.build.macro_stack.push(mkey);}macro_key_token.cslid=macroid;if(CSL.MODULE_MACROS[mkey]){macro_key_token.juris=mkey;this.opt.update_mode=CSL.POSITION;}CSL.Node.group.build.call(macro_key_token,this,target,true);if(!this.cslXml.getNodeValue(macro_nodes)){throw"CSL style error: undefined macro \""+mkey+"\"";}var mytarget=CSL.getMacroTarget.call(this,mkey);if(mytarget){CSL.buildMacro.call(this,mytarget,macro_nodes);CSL.configureMacro.call(this,mytarget);}if(!this.build.extension){var func=function(macro_name){return function(state,Item,item){var next=0;while(next<state.macros[macro_name].length){next=CSL.tokenExec.call(state,state.macros[macro_name][next],Item,item);}};}(mkey);var text_node=new CSL.Token("text",CSL.SINGLETON);text_node.execs.push(func);target.push(text_node);}end_of_macro=new CSL.Token("group",CSL.END);if(hasDate){func=function func(state,Item){if(state.tmp.extension){state.tmp["doing-macro-with-date"]=false;}};end_of_macro.execs.push(func);}if(macro_key_token.juris){end_of_macro.juris=mkey;}CSL.Node.group.build.call(end_of_macro,this,target,true);this.build.macro_stack.pop();};CSL.getMacroTarget=function(mkey){var mytarget=false;if(this.build.extension){mytarget=this[this.build.root+this.build.extension].tokens;}else if(!this.macros[mkey]){mytarget=[];this.macros[mkey]=mytarget;}return mytarget;};CSL.buildMacro=function(mytarget,macro_nodes){var builder=CSL.makeBuilder(this,mytarget);var mynode;if("undefined"===typeof macro_nodes.length){mynode=macro_nodes;}else{mynode=macro_nodes[0];}builder(mynode);};CSL.configureMacro=function(mytarget){if(!this.build.extension){this.configureTokenList(mytarget);}};CSL.XmlToToken=function(state,tokentype,explicitTarget,var_stack){var name,txt,attrfuncs,attributes,decorations,token,key,target;name=state.cslXml.nodename(this);if(state.build.skip&&state.build.skip!==name){return;}if(!name){txt=state.cslXml.content(this);if(txt){state.build.text=txt;}return;}if(!CSL.Node[state.cslXml.nodename(this)]){throw"Undefined node name \""+name+"\".";}attrfuncs=[];attributes=state.cslXml.attributes(this);decorations=CSL.setDecorations.call(this,state,attributes);token=new CSL.Token(name,tokentype);if(tokentype!==CSL.END||name==="if"||name==="else-if"||name==="layout"){for(var key in attributes){if(attributes.hasOwnProperty(key)){if(tokentype===CSL.END&&key!=="@language"&&key!=="@locale"){continue;}if(attributes.hasOwnProperty(key)){if(CSL.Attributes[key]){try{CSL.Attributes[key].call(token,state,""+attributes[key]);}catch(e){CSL.error(e);throw"CSL processor error, "+key+" attribute: "+e;}}else{CSL.debug("warning: undefined attribute \""+key+"\" in style");}}}}token.decorations=decorations;if(CSL.DATE_VARIABLES.indexOf(attributes['@variable'])>-1){var_stack.push(token.variables);}}else if(tokentype===CSL.END&&attributes['@variable']){token.hasVariable=true;if(CSL.DATE_VARIABLES.indexOf(attributes['@variable'])>-1){token.variables=var_stack.pop();}}if(explicitTarget){target=explicitTarget;}else{target=state[state.build.area].tokens;}CSL.Node[name].build.call(token,state,target,true);};module.exports=CSL;CSL.DateParser=new function(){var epochPairs=[["\u660E\u6CBB",1867],["\u5927\u6B63",1911],["\u662D\u548C",1925],["\u5E73\u6210",1988]];var epochYearByName={};for(var i=0,ilen=epochPairs.length;i<ilen;i++){var key=epochPairs[i][0];var val=epochPairs[i][1];epochYearByName[key]=val;}var epochMatchStrings=[];for(var i=0,ilen=epochPairs.length;i<ilen;i++){var val=epochPairs[i][0];epochMatchStrings.push(val);}var epochMatchString=epochMatchStrings.join("|");var epochSplitter=new RegExp("(?:"+epochMatchString+")(?:[0-9]+)");var epochMatcher=new RegExp("(?:"+epochMatchString+")(?:[0-9]+)","g");var kanjiMonthDay=/(\u6708|\u5E74)/g;var kanjiYear=/\u65E5/g;var kanjiRange=/\u301c/g;var yearLast="(?:[?0-9]{1,2}%%NUMD%%){0,2}[?0-9]{4}(?![0-9])";var yearFirst="[?0-9]{4}(?:%%NUMD%%[?0-9]{1,2}){0,2}(?![0-9])";var numberVal="[?0-9]{1,3}";var rangeSeparator="[%%DATED%%]";var fuzzyChar="[?~]";var chars="[^\-\/\~\?0-9]+";var rexString="("+yearFirst+"|"+yearLast+"|"+numberVal+"|"+rangeSeparator+"|"+fuzzyChar+"|"+chars+")";var rexDash=new RegExp(rexString.replace(/%%NUMD%%/g,"-").replace(/%%DATED%%/g,"-"));var rexDashSlash=new RegExp(rexString.replace(/%%NUMD%%/g,"-").replace(/%%DATED%%/g,"\/"));var rexSlashDash=new RegExp(rexString.replace(/%%NUMD%%/g,"\/").replace(/%%DATED%%/g,"-"));var monthString="january february march april may june july august september october november december spring summer fall winter spring summer";this.monthStrings=monthString.split(" ");this.setOrderDayMonth=function(){this.monthGuess=1;this.dayGuess=0;};this.setOrderMonthDay=function(){this.monthGuess=0;this.dayGuess=1;};this.resetDateParserMonths=function(){this.monthSets=[];for(var i=0,ilen=this.monthStrings.length;i<ilen;i++){this.monthSets.push([this.monthStrings[i]]);}this.monthAbbrevs=[];for(var i=0,ilen=this.monthSets.length;i<ilen;i++){this.monthAbbrevs.push([]);for(var j=0,jlen=this.monthSets[i].length;j<jlen;j++){this.monthAbbrevs[i].push(this.monthSets[i][0].slice(0,3));}}this.monthRexes=[];for(var i=0,ilen=this.monthAbbrevs.length;i<ilen;i++){this.monthRexes.push(new RegExp("(?:"+this.monthAbbrevs[i].join("|")+")"));}};this.addDateParserMonths=function(lst){if("string"===typeof lst){lst=lst.split(/\s+/);}if(lst.length!==12&&lst.length!==16){CSL.debug("month [+season] list of "+lst.length+", expected 12 or 16. Ignoring.");return;}var otherMatch=[];var thisMatch=[];for(var i=0,ilen=lst.length;i<ilen;i++){var abbrevLength=null;var skip=false;var insert=3;var extendedSets={};for(var j=0,jlen=this.monthAbbrevs.length;j<jlen;j++){extendedSets[j]={};if(j===i){for(var k=0,klen=this.monthAbbrevs[i].length;k<klen;k++){if(this.monthAbbrevs[i][k]===lst[i].slice(0,this.monthAbbrevs[i][k].length)){skip=true;break;}}}else{for(var k=0,klen=this.monthAbbrevs[j].length;k<klen;k++){abbrevLength=this.monthAbbrevs[j][k].length;if(this.monthAbbrevs[j][k]===lst[i].slice(0,abbrevLength)){while(this.monthSets[j][k].slice(0,abbrevLength)===lst[i].slice(0,abbrevLength)){if(abbrevLength>lst[i].length||abbrevLength>this.monthSets[j][k].length){CSL.debug("unable to disambiguate month string in date parser: "+lst[i]);break;}else{abbrevLength+=1;}}insert=abbrevLength;extendedSets[j][k]=abbrevLength;}}}for(var jKey in extendedSets){for(kKey in extendedSets[jKey]){abbrevLength=extendedSets[jKey][kKey];jKey=parseInt(jKey,10);kKey=parseInt(kKey,10);this.monthAbbrevs[jKey][kKey]=this.monthSets[jKey][kKey].slice(0,abbrevLength);}}}if(!skip){this.monthSets[i].push(lst[i]);this.monthAbbrevs[i].push(lst[i].slice(0,insert));}}this.monthRexes=[];this.monthRexStrs=[];for(var i=0,ilen=this.monthAbbrevs.length;i<ilen;i++){this.monthRexes.push(new RegExp("^(?:"+this.monthAbbrevs[i].join("|")+")"));this.monthRexStrs.push("^(?:"+this.monthAbbrevs[i].join("|")+")");}if(this.monthAbbrevs.length===18){for(var i=12,ilen=14;i<ilen;i++){this.monthRexes[i+4]=new RegExp("^(?:"+this.monthAbbrevs[i].join("|")+")");this.monthRexStrs[i+4]="^(?:"+this.monthAbbrevs[i].join("|")+")";}}};this.convertDateObjectToArray=function(thedate){thedate["date-parts"]=[];thedate["date-parts"].push([]);var slicelen=0;var part;for(var i=0,ilen=3;i<ilen;i++){part=["year","month","day"][i];if(!thedate[part]){break;}slicelen+=1;thedate["date-parts"][0].push(thedate[part]);delete thedate[part];}thedate["date-parts"].push([]);for(var i=0,ilen=slicelen;i<ilen;i++){part=["year_end","month_end","day_end"][i];if(!thedate[part]){break;}thedate["date-parts"][1].push(thedate[part]);delete thedate[part];}if(thedate["date-parts"][0].length!==thedate["date-parts"][1].length){thedate["date-parts"].pop();}return thedate;};this.convertDateObjectToString=function(thedate){var ret=[];for(var i=0,ilen=3;i<ilen;i+=1){if(thedate[DATE_PARTS_ALL[i]]){ret.push(thedate[DATE_PARTS_ALL[i]]);}else{break;}}return ret.join("-");};this._parseNumericDate=function(ret,delim,suff,txt){if(!suff)suff="";var lst=txt.split(delim);for(var i=0,ilen=lst.length;i<ilen;i++){if(lst[i].length===4){ret["year"+suff]=lst[i].replace(/^0*/,"");if(!i){lst=lst.slice(1);}else{lst=lst.slice(0,i);}break;}}for(var i=0,ilen=lst.length;i<ilen;i++){lst[i]=parseInt(lst[i],10);}if(lst.length===1||lst.length===2&&!lst[1]){ret["month"+suff]=""+lst[0];}else if(lst.length===2){if(lst[this.monthGuess]>12){ret["month"+suff]=""+lst[this.dayGuess];ret["day"+suff]=""+lst[this.monthGuess];}else{ret["month"+suff]=""+lst[this.monthGuess];ret["day"+suff]=""+lst[this.dayGuess];}}};this.parseDateToObject=function(txt){var orig=txt;var slashPos=-1;var dashPos=-1;var yearIsNegative=false;var lst;if(txt){if(txt.slice(0,1)==="-"){yearIsNegative=true;txt=txt.slice(1);}if(txt.match(/^[0-9]{1,3}$/)){while(txt.length<4){txt="0"+txt;}}txt=""+txt;txt=txt.replace(/\s*[0-9]{2}:[0-9]{2}(?::[0-9]+)/,"");var m=txt.match(kanjiMonthDay);if(m){txt=txt.replace(/\s+/g,"");txt=txt.replace(kanjiYear,"");txt=txt.replace(kanjiMonthDay,"-");txt=txt.replace(kanjiRange,"/");txt=txt.replace(/\-\//g,"/");txt=txt.replace(/-$/g,"");var slst=txt.split(epochSplitter);lst=[];var mm=txt.match(epochMatcher);if(mm){var mmx=[];for(var i=0,ilen=mm.length;i<ilen;i++){mmx=mmx.concat(mm[i].match(/([^0-9]+)([0-9]+)/).slice(1));}for(var i=0,ilen=slst.length;i<ilen;i++){lst.push(slst[i]);if(i!==len-1){var mmpos=pos*2;lst.push(mmx[mmpos]);lst.push(mmx[mmpos+1]);}}}else{lst=slst;}for(var i=1,ilen=lst.length;i<ilen;i+=3){lst[i+1]=jiy[lst[i]]+parseInt(lst[i+1],10);lst[i]="";}txt=lst.join("");txt=txt.replace(/\s*-\s*$/,"").replace(/\s*-\s*\//,"/");txt=txt.replace(/\.\s*$/,"");txt=txt.replace(/\.(?! )/,"");slashPos=txt.indexOf("/");dashPos=txt.indexOf("-");}}txt=txt.replace(/([A-Za-z])\./g,"$1");var number="";var note="";var thedate={};var rangeDelim;var dateDelim;if(txt.slice(0,1)==="\""&&txt.slice(-1)==="\""){thedate.literal=txt.slice(1,-1);return thedate;}if(slashPos>-1&&dashPos>-1){var slashCount=txt.split("/");if(slashCount.length>3){rangeDelim="-";txt=txt.replace(/\_/g,"-");dateDelim="/";lst=txt.split(rexSlashDash);}else{rangeDelim="/";txt=txt.replace(/\_/g,"/");dateDelim="-";lst=txt.split(rexDashSlash);}}else{txt=txt.replace(/\//g,"-");txt=txt.replace(/\_/g,"-");rangeDelim="-";dateDelim="-";lst=txt.split(rexDash);}var ret=[];for(var i=0,ilen=lst.length;i<ilen;i++){var m=lst[i].match(/^\s*([\-\/]|[^\-\/\~\?0-9]+|[\-~?0-9]+)\s*$/);if(m){ret.push(m[1]);}}var delimPos=ret.indexOf(rangeDelim);var delims=[];var isRange=false;if(delimPos>-1){delims.push([0,delimPos]);delims.push([delimPos+1,ret.length]);isRange=true;}else{delims.push([0,ret.length]);}var suff="";for(var i=0,ilen=delims.length;i<ilen;i++){var delim=delims[i];var date=ret.slice(delim[0],delim[1]);outer:for(var j=0,jlen=date.length;j<jlen;j++){var element=date[j];if(element.indexOf(dateDelim)>-1){this._parseNumericDate(thedate,dateDelim,suff,element);continue;}if(element.match(/[0-9]{4}/)){thedate["year"+suff]=element.replace(/^0*/,"");continue;}for(var k=0,klen=this.monthRexes.length;k<klen;k++){if(element.toLocaleLowerCase().match(this.monthRexes[k])){thedate["month"+suff]=""+(parseInt(k,10)+1);continue outer;}}if(element.match(/^[0-9]+$/)){number=element;}if(element.toLocaleLowerCase().match(/^bc/)&&number){thedate["year"+suff]=""+number*-1;number="";continue;}if(element.toLocaleLowerCase().match(/^ad/)&&number){thedate["year"+suff]=""+number;number="";continue;}if(element==="~"||element==="?"||element==="c"||element.match(/^cir/)){thedate.circa=""+1;continue;}if(element.toLocaleLowerCase().match(/(?:mic|tri|hil|eas)/)&&!thedate["season"+suff]){note=element;continue;}}if(number){thedate["day"+suff]=number;number="";}if(note&&!thedate["season"+suff]){thedate["season"+suff]=note;note="";}suff="_end";}if(isRange){for(var j=0,jlen=CSL.DATE_PARTS_ALL.length;j<jlen;j++){var item=CSL.DATE_PARTS_ALL[j];if(thedate[item]&&!thedate[item+"_end"]){thedate[item+"_end"]=thedate[item];}else if(!thedate[item]&&thedate[item+"_end"]){thedate[item]=thedate[item+"_end"];}}}if(!thedate.year||thedate.year&&thedate.day&&!thedate.month){thedate={"literal":orig};}var parts=["year","month","day","year_end","month_end","day_end"];for(var i=0,ilen=parts.length;i<ilen;i++){var part=parts[i];if("string"===typeof thedate[part]&&thedate[part].match(/^[0-9]+$/)){thedate[part]=parseInt(thedate[part],10);}}if(yearIsNegative&&Object.keys(thedate).indexOf("year")>-1){thedate.year=thedate.year*-1;}return thedate;};this.parseDateToArray=function(txt){return this.convertDateObjectToArray(this.parseDateToObject(txt));};this.parseDateToString=function(txt){return this.convertDateObjectToString(this.parseDateToObject(txt));};this.parse=function(txt){return this.parseDateToObject(txt);};this.setOrderMonthDay();this.resetDateParserMonths();}();module.exports=CSL;CSL.Engine=function(sys,style,lang,forceLang){var attrs,langspec,localexml,locale;this.processor_version=CSL.PROCESSOR_VERSION;this.csl_version="1.0";this.sys=sys;if(sys.variableWrapper){CSL.VARIABLE_WRAPPER_PREPUNCT_REX=new RegExp('^(['+[" "].concat(CSL.SWAPPING_PUNCTUATION).join("")+']*)(.*)');}if(CSL.retrieveStyleModule){this.sys.retrieveStyleModule=CSL.retrieveStyleModule;}if(CSL.getAbbreviation){this.sys.getAbbreviation=CSL.getAbbreviation;}if(this.sys.stringCompare){CSL.stringCompare=this.sys.stringCompare;}this.sys.AbbreviationSegments=CSL.AbbreviationSegments;this.parallel=new CSL.Parallel(this);this.transform=new CSL.Transform(this);this.setParseNames=function(val){this.opt['parse-names']=val;};this.opt=new CSL.Engine.Opt();this.tmp=new CSL.Engine.Tmp();this.build=new CSL.Engine.Build();this.fun=new CSL.Engine.Fun(this);this.configure=new CSL.Engine.Configure();this.citation_sort=new CSL.Engine.CitationSort();this.bibliography_sort=new CSL.Engine.BibliographySort();this.citation=new CSL.Engine.Citation(this);this.bibliography=new CSL.Engine.Bibliography();this.output=new CSL.Output.Queue(this);this.dateput=new CSL.Output.Queue(this);this.cslXml=CSL.setupXml(style);if(this.opt.development_extensions.csl_reverse_lookup_support||this.sys.csl_reverse_lookup_support){this.build.cslNodeId=0;this.setCslNodeIds=function(myxml,nodename){var children=this.cslXml.children(myxml);this.cslXml.setAttribute(myxml,'cslid',this.build.cslNodeId);this.opt.nodenames.push(nodename);this.build.cslNodeId+=1;for(var i=0,ilen=this.cslXml.numberofnodes(children);i<ilen;i+=1){nodename=this.cslXml.nodename(children[i]);if(nodename){this.setCslNodeIds(children[i],nodename);}}};this.setCslNodeIds(this.cslXml.dataObj,"style");}this.cslXml.addMissingNameNodes(this.cslXml.dataObj);this.cslXml.addInstitutionNodes(this.cslXml.dataObj);this.cslXml.insertPublisherAndPlace(this.cslXml.dataObj);this.cslXml.flagDateMacros(this.cslXml.dataObj);attrs=this.cslXml.attributes(this.cslXml.dataObj);if("undefined"===typeof attrs["@sort-separator"]){this.cslXml.setAttribute(this.cslXml.dataObj,"sort-separator",", ");}this.opt["initialize-with-hyphen"]=true;this.setStyleAttributes();this.opt.xclass=this.cslXml.getAttributeValue(this.cslXml.dataObj,"class");this.opt["class"]=this.opt.xclass;this.opt.styleID=this.cslXml.getStyleId(this.cslXml.dataObj);this.opt.styleName=this.cslXml.getStyleId(this.cslXml.dataObj,true);if(this.opt.version.slice(0,4)==="1.1m"){this.opt.development_extensions.static_statute_locator=true;this.opt.development_extensions.handle_parallel_articles=true;this.opt.development_extensions.main_title_from_short_title=true;this.opt.development_extensions.rtl_support=true;this.opt.development_extensions.expect_and_symbol_form=true;this.opt.development_extensions.citationRequire_explicit_legal_case_title_short=true;this.opt.development_extensions.force_jurisdiction=true;}if(lang){lang=lang.replace("_","-");lang=CSL.normalizeLocaleStr(lang);}if(this.opt["default-locale"][0]){this.opt["default-locale"][0]=this.opt["default-locale"][0].replace("_","-");this.opt["default-locale"][0]=CSL.normalizeLocaleStr(this.opt["default-locale"][0]);}if(lang&&forceLang){this.opt["default-locale"]=[lang];}if(lang&&!forceLang&&this.opt["default-locale"][0]){lang=this.opt["default-locale"][0];}if(this.opt["default-locale"].length===0){if(!lang){lang="en-US";}this.opt["default-locale"].push("en-US");}if(!lang){lang=this.opt["default-locale"][0];}langspec=CSL.localeResolve(lang);this.opt.lang=langspec.best;this.opt["default-locale"][0]=langspec.best;this.locale={};if(!this.opt["default-locale-sort"]){this.opt["default-locale-sort"]=this.opt["default-locale"][0];}if('dale|'.localeCompare('daleb',this.opt["default-locale-sort"])>-1){this.opt.sort_sep="@";}else{this.opt.sort_sep="|";}this.localeConfigure(langspec);function makeRegExp(lst){var lst=lst.slice();var ret=new RegExp("(?:(?:[?!:]*\\s+|-|^)(?:"+lst.join("|")+")(?=[!?:]*\\s+|-|$))","g");return ret;}this.locale[this.opt.lang].opts["skip-words-regexp"]=makeRegExp(this.locale[this.opt.lang].opts["skip-words"]);this.output.adjust=new CSL.Output.Queue.adjust(this.getOpt('punctuation-in-quote'));this.registry=new CSL.Registry(this);this.macros={};this.build.area="citation";var area_nodes=this.cslXml.getNodesByName(this.cslXml.dataObj,this.build.area);this.buildTokenLists(area_nodes,this[this.build.area].tokens);this.build.area="bibliography";var area_nodes=this.cslXml.getNodesByName(this.cslXml.dataObj,this.build.area);this.buildTokenLists(area_nodes,this[this.build.area].tokens);this.juris={};this.configureTokenLists();this.disambiguate=new CSL.Disambiguation(this);this.splice_delimiter=false;this.fun.dateparser=CSL.DateParser;this.fun.flipflopper=new CSL.Util.FlipFlopper(this);this.setCloseQuotesArray();this.fun.ordinalizer.init(this);this.fun.long_ordinalizer.init(this);this.fun.page_mangler=CSL.Util.PageRangeMangler.getFunction(this,"page");this.fun.year_mangler=CSL.Util.PageRangeMangler.getFunction(this,"year");this.setOutputFormat("html");};CSL.Engine.prototype.setCloseQuotesArray=function(){var ret;ret=[];ret.push(this.getTerm("close-quote"));ret.push(this.getTerm("close-inner-quote"));ret.push('"');ret.push("'");this.opt.close_quotes_array=ret;};CSL.makeBuilder=function(me,target){var var_stack=[];function enterFunc(node){CSL.XmlToToken.call(node,me,CSL.START,target,var_stack);};function leaveFunc(node){CSL.XmlToToken.call(node,me,CSL.END,target,var_stack);};function singletonFunc(node){CSL.XmlToToken.call(node,me,CSL.SINGLETON,target,var_stack);};function buildStyle(node){var starttag,origparent;if(me.cslXml.numberofnodes(me.cslXml.children(node))){origparent=node;enterFunc(origparent);for(var i=0;i<me.cslXml.numberofnodes(me.cslXml.children(origparent));i+=1){node=me.cslXml.children(origparent)[i];if(me.cslXml.nodename(node)===null){continue;}if(me.cslXml.nodename(node)==="date"){CSL.Util.fixDateNode.call(me,origparent,i,node);node=me.cslXml.children(origparent)[i];}buildStyle(node,enterFunc,leaveFunc,singletonFunc);}leaveFunc(origparent);}else{singletonFunc(node);}}return buildStyle;};CSL.Engine.prototype.buildTokenLists=function(area_nodes,target){if(!this.cslXml.getNodeValue(area_nodes))return;var builder=CSL.makeBuilder(this,target);var mynode;if("undefined"===typeof area_nodes.length){mynode=area_nodes;}else{mynode=area_nodes[0];}builder(mynode);};CSL.Engine.prototype.setStyleAttributes=function(){var dummy,attr,key,attributes,attrname;var dummy={};dummy.name=this.cslXml.nodename(this.cslXml.dataObj);attributes=this.cslXml.attributes(this.cslXml.dataObj);for(attrname in attributes){if(attributes.hasOwnProperty(attrname)){CSL.Attributes[attrname].call(dummy,this,attributes[attrname]);}}};CSL.Engine.prototype.getTerm=function(term,form,plural,gender,mode,forceDefaultLocale){if(term&&term.match(/[A-Z]/)&&term===term.toUpperCase()){CSL.debug("Warning: term key is in uppercase form: "+term);term=term.toLowerCase();}var lang;if(forceDefaultLocale){lang=this.opt["default-locale"][0];}else{lang=this.opt.lang;}var ret=CSL.Engine.getField(CSL.LOOSE,this.locale[lang].terms,term,form,plural,gender);if(!ret&&term==="range-delimiter"){ret="\u2013";}if(typeof ret==="undefined"){if(mode===CSL.STRICT){throw"Error in getTerm: term \""+term+"\" does not exist.";}else if(mode===CSL.TOLERANT){ret="";}}if(ret){this.tmp.cite_renders_content=true;}return ret;};CSL.Engine.prototype.getDate=function(form,forceDefaultLocale){var lang;if(forceDefaultLocale){lang=this.opt["default-locale"];}else{lang=this.opt.lang;}if(this.locale[lang].dates[form]){return this.locale[lang].dates[form];}else{return false;}};CSL.Engine.prototype.getOpt=function(arg){if("undefined"!==typeof this.locale[this.opt.lang].opts[arg]){return this.locale[this.opt.lang].opts[arg];}else{return false;}};CSL.Engine.prototype.getVariable=function(Item,varname,form,plural){return CSL.Engine.getField(CSL.LOOSE,Item,varname,form,plural);};CSL.Engine.prototype.getDateNum=function(ItemField,partname){if("undefined"===typeof ItemField){return 0;}else{return ItemField[partname];}};CSL.Engine.getField=function(mode,hash,term,form,plural,gender){var ret,forms,f,pos,len,hashterm;ret="";if("undefined"===typeof hash[term]){if(mode===CSL.STRICT){throw"Error in getField: term \""+term+"\" does not exist.";}else{return undefined;}}if(gender&&hash[term][gender]){hashterm=hash[term][gender];}else{hashterm=hash[term];}forms=[];if(form==="symbol"){forms=["symbol","short"];}else if(form==="verb-short"){forms=["verb-short","verb"];}else if(form!=="long"){forms=[form];}forms=forms.concat(["long"]);len=forms.length;for(pos=0;pos<len;pos+=1){f=forms[pos];if("string"===typeof hashterm||"number"===typeof hashterm){ret=hashterm;}else if("undefined"!==typeof hashterm[f]){if("string"===typeof hashterm[f]||"number"===typeof hashterm[f]){ret=hashterm[f];}else{if("number"===typeof plural){ret=hashterm[f][plural];}else{ret=hashterm[f][0];}}break;}}return ret;};CSL.Engine.prototype.configureTokenLists=function(){var dateparts_master,area,pos,token,dateparts,part,ppos,pppos,len,llen,lllen;len=CSL.AREAS.length;for(pos=0;pos<len;pos+=1){area=CSL.AREAS[pos];var tokens=this[area].tokens;this.configureTokenList(tokens);}this.version=CSL.version;return this.state;};CSL.Engine.prototype.configureTokenList=function(tokens){var dateparts_master,area,pos,token,dateparts,part,ppos,pppos,len,llen,lllen;dateparts_master=["year","month","day"];llen=tokens.length-1;for(ppos=llen;ppos>-1;ppos+=-1){token=tokens[ppos];if("date"===token.name&&CSL.END===token.tokentype){dateparts=[];}if("date-part"===token.name&&token.strings.name){lllen=dateparts_master.length;for(pppos=0;pppos<lllen;pppos+=1){part=dateparts_master[pppos];if(part===token.strings.name){dateparts.push(token.strings.name);}}}if("date"===token.name&&CSL.START===token.tokentype){dateparts.reverse();token.dateparts=dateparts;}token.next=ppos+1;if(token.name&&CSL.Node[token.name].configure){CSL.Node[token.name].configure.call(token,this,ppos);}}};CSL.Engine.prototype.retrieveItems=function(ids){var ret,pos,len;ret=[];for(var i=0,ilen=ids.length;i<ilen;i+=1){ret.push(this.retrieveItem(""+ids[i]));}return ret;};CSL.ITERATION=0;CSL.Engine.prototype.retrieveItem=function(id){var Item,m,pos,len,mm,i;if(!this.tmp.loadedItemIDs[id]){this.tmp.loadedItemIDs[id]=true;}else{return this.registry.refhash[id];}if(this.opt.development_extensions.normalize_lang_keys_to_lowercase&&"boolean"===typeof this.opt.development_extensions.normalize_lang_keys_to_lowercase){for(var i=0,ilen=this.opt["default-locale"].length;i<ilen;i+=1){this.opt["default-locale"][i]=this.opt["default-locale"][i].toLowerCase();}for(var i=0,ilen=this.opt["locale-translit"].length;i<ilen;i+=1){this.opt["locale-translit"][i]=this.opt["locale-translit"][i].toLowerCase();}for(var i=0,ilen=this.opt["locale-translat"].length;i<ilen;i+=1){this.opt["locale-translat"][i]=this.opt["locale-translat"][i].toLowerCase();}this.opt.development_extensions.normalize_lang_keys_to_lowercase=100;}CSL.ITERATION+=1;Item=JSON.parse(JSON.stringify(this.sys.retrieveItem(""+id)));if(this.opt.development_extensions.normalize_lang_keys_to_lowercase){if(Item.multi){if(Item.multi._keys){for(var field in Item.multi._keys){for(var key in Item.multi._keys[field]){if(key!==key.toLowerCase()){Item.multi._keys[field][key.toLowerCase()]=Item.multi._keys[field][key];delete Item.multi._keys[field][key];}}}}if(Item.multi.main){for(var field in Item.multi.main){Item.multi.main[field]=Item.multi.main[field].toLowerCase();}}}for(var i=0,ilen=CSL.NAME_VARIABLES.length;i>ilen;i+=1){var ctype=CSL.NAME_VARIABLES[i];if(Item[ctype]&&Item[ctype].multi){for(var j=0,jlen=Item[ctype].length;j<jlen;j+=1){var creator=Item[ctype][j];if(creator.multi){if(creator.multi._key){for(var key in creator.multi._key){if(key!==key.toLowerCase()){creator.multi._key[key.toLowerCase()]=creator.multi._key[key];delete creator.multi._key[key];}}}if(creator.multi.main){creator.multi.main=creator.multi.main.toLowerCase();}}}}}}if(Item.language){var lst=Item.language.split("<");if(lst.length>0){Item["language-name"]=lst[0];}if(lst.length===2){Item["language-name-original"]=lst[1];}}if(Item.page){Item["page-first"]=Item.page;var num=""+Item.page;var m=num.split(/\s*(?:&|, |-|\u2013)\s*/);if(m[0].slice(-1)!=="\\"){Item["page-first"]=m[0];}}if(this.opt.development_extensions.field_hack&&Item.note){CSL.parseNoteFieldHacks(Item,false,this.opt.development_extensions.allow_field_hack_date_override);}for(var i=1,ilen=CSL.DATE_VARIABLES.length;i<ilen;i+=1){var dateobj=Item[CSL.DATE_VARIABLES[i]];if(dateobj){if(this.opt.development_extensions.raw_date_parsing){if(dateobj.raw){dateobj=this.fun.dateparser.parseDateToObject(dateobj.raw);}}Item[CSL.DATE_VARIABLES[i]]=this.dateParseArray(dateobj);}}if(this.opt.development_extensions.static_statute_locator){if(Item.type&&["bill","gazette","legislation","regulation","treaty"].indexOf(Item.type)>-1){var varname;var elements=["type","title","jurisdiction","genre","volume","container-title"];var legislation_id=[];for(i=0,ilen=elements.length;i<ilen;i+=1){varname=elements[i];if(Item[varname]){legislation_id.push(Item[varname]);}}elements=["original-date","issued"];for(i=0,elements.length;i<ilen;i+=1){varname=elements[i];if(Item[varname]&&Item[varname].year){var value=Item[varname].year;legislation_id.push(value);break;}}Item.legislation_id=legislation_id.join("::");}}if(this.opt.development_extensions.force_jurisdiction){if("string"===typeof Item.authority){Item.authority=[{literal:Item.authority,multi:{_key:{}}}];if(Item.multi&&Item.multi._keys&&Item.multi._keys.authority){Item.authority[0].multi._key={};for(var key in Item.multi._keys.authority){Item.authority[0].multi._key[key]={literal:Item.multi._keys.authority[key]};}}}}if(!Item["title-short"]){Item["title-short"]=Item.shortTitle;}if(this.opt.development_extensions.main_title_from_short_title){CSL.extractTitleAndSubtitle(Item);}var isLegalType=["bill","legal_case","legislation","gazette","regulation"].indexOf(Item.type)>-1;if(this.opt.development_extensions.force_jurisdiction&&isLegalType){if(!Item.jurisdiction){Item.jurisdiction="us";}}var normalizedKey;if(!isLegalType&&Item.title&&this.sys.getAbbreviation){var noHints=false;if(!Item.jurisdiction){noHints=true;}if(this.sys.normalizeAbbrevsKey){normalizedKey=this.sys.normalizeAbbrevsKey(Item.title);}else{normalizedKey=Item.title;}var jurisdiction=this.transform.loadAbbreviation(Item.jurisdiction,"title",normalizedKey,Item.type);if(this.transform.abbrevs[jurisdiction]["title"]){if(this.transform.abbrevs[jurisdiction]["title"][normalizedKey]){Item["title-short"]=this.transform.abbrevs[jurisdiction]["title"][normalizedKey];}}}if(!Item["container-title-short"]){Item["container-title-short"]=Item.journalAbbreviation;}if(Item["container-title"]&&this.sys.getAbbreviation){if(this.sys.normalizeAbbrevsKey){normalizedKey=this.sys.normalizeAbbrevsKey(Item["container-title"]);}else{normalizedKey=Item["container-title"];}var jurisdiction=this.transform.loadAbbreviation(Item.jurisdiction,"container-title",normalizedKey);if(this.transform.abbrevs[jurisdiction]["container-title"]){if(this.transform.abbrevs[jurisdiction]["container-title"][normalizedKey]){Item["container-title-short"]=this.transform.abbrevs[jurisdiction]["container-title"][normalizedKey];}}}if(Item["jurisdiction"]){Item["country"]=Item["jurisdiction"].split(":")[0];}this.registry.refhash[id]=Item;return Item;};CSL.Engine.prototype.setOpt=function(token,name,value){if(token.name==="style"||token.name==="cslstyle"){this.opt.inheritedAttributes[name]=value;this.citation.opt.inheritedAttributes[name]=value;this.bibliography.opt.inheritedAttributes[name]=value;}else if(["citation","bibliography"].indexOf(token.name)>-1){this[token.name].opt.inheritedAttributes[name]=value;}else{token.strings[name]=value;}};CSL.Engine.prototype.inheritOpt=function(token,attrname,parentname,defaultValue){if("undefined"!==typeof token.strings[attrname]){return token.strings[attrname];}else{var parentValue=this[this.tmp.root].opt.inheritedAttributes[parentname?parentname:attrname];if("undefined"!==typeof parentValue){return parentValue;}else{return defaultValue;}}};module.exports=CSL;CSL.Engine.prototype.remapSectionVariable=function(inputList){for(var i=0,ilen=inputList.length;i<ilen;i+=1){var Item=inputList[i][0];var item=inputList[i][1];if(["bill","gazette","legislation","regulation","treaty"].indexOf(Item.type)>-1){if(item.locator){item.locator=item.locator.trim();var m=item.locator.match(CSL.STATUTE_SUBDIV_PLAIN_REGEX_FRONT);if(!m){if(item.label){item.locator=CSL.STATUTE_SUBDIV_STRINGS_REVERSE[item.label]+" "+item.locator;}else{item.locator="p. "+item.locator;}}}var sectionMasterLabel=null;if(Item.section){Item.section=Item.section.trim();var m=Item.section.match(CSL.STATUTE_SUBDIV_PLAIN_REGEX_FRONT);if(!m){Item.section="sec. "+Item.section;sectionMasterLabel="sec.";}else{sectionMasterLabel=m[0].trim();}}if(Item.section){if(!item.locator){item.locator=Item.section;}else{var m=item.locator.match(/^([^ ]*)\s*(.*)/);var space=" ";if(m){if(m[1]==="p."&§ionMasterLabel!=="p."){item.locator=m[2];}if(["[","(",".",",",";",":","?"].indexOf(item.locator.slice(0,1))>-1){space="";}}else{space="";}item.locator=Item.section+space+item.locator;}}item.label="";}}};CSL.Engine.prototype.setNumberLabels=function(Item){if(Item.number&&["bill","gazette","legislation","regulation","treaty"].indexOf(Item.type)>-1&&this.opt.development_extensions.static_statute_locator&&!this.tmp.shadow_numbers["number"]){this.tmp.shadow_numbers["number"]={};this.tmp.shadow_numbers["number"].values=[];this.tmp.shadow_numbers["number"].plural=0;this.tmp.shadow_numbers["number"].numeric=false;this.tmp.shadow_numbers["number"].label=false;var value=""+Item.number;value=value.split("\\").join("");var firstword=value.split(/\s+/)[0];var firstlabel=CSL.STATUTE_SUBDIV_STRINGS[firstword];if(firstlabel){var m=value.match(CSL.STATUTE_SUBDIV_GROUPED_REGEX);var splt=value.split(CSL.STATUTE_SUBDIV_PLAIN_REGEX);if(splt.length>1){var lst=[];for(var j=1,jlen=splt.length;j<jlen;j+=1){var subdiv=m[j-1].replace(/^\s*/,"");lst.push(splt[j].replace(/\s*$/,"").replace(/^\s*/,""));}value=lst.join(" ");}else{value=splt[0];}this.tmp.shadow_numbers["number"].label=firstlabel;this.tmp.shadow_numbers["number"].values.push(["Blob",value,false]);this.tmp.shadow_numbers["number"].numeric=false;}else{this.tmp.shadow_numbers["number"].values.push(["Blob",value,false]);this.tmp.shadow_numbers["number"].numeric=true;}}};module.exports=CSL;CSL.substituteOne=function(template){return function(state,list){if(!list){return"";}else{return template.replace("%%STRING%%",list);}};};CSL.substituteTwo=function(template){return function(param){var template2=template.replace("%%PARAM%%",param);return function(state,list){if(!list){return"";}else{return template2.replace("%%STRING%%",list);}};};};CSL.Mode=function(mode){var decorations,params,param,func,val,args;decorations={};params=CSL.Output.Formats[mode];for(param in params){if(true){if("@"!==param.slice(0,1)){decorations[param]=params[param];continue;}func=false;val=params[param];args=param.split('/');if(typeof val==="string"&&val.indexOf("%%STRING%%")>-1){if(val.indexOf("%%PARAM%%")>-1){func=CSL.substituteTwo(val);}else{func=CSL.substituteOne(val);}}else if(typeof val==="boolean"&&!val){func=CSL.Output.Formatters.passthrough;}else if(typeof val==="function"){func=val;}else{throw"CSL.Compiler: Bad "+mode+" config entry for "+param+": "+val;}if(args.length===1){decorations[args[0]]=func;}else if(args.length===2){if(!decorations[args[0]]){decorations[args[0]]={};}decorations[args[0]][args[1]]=func;}}}return decorations;};CSL.setDecorations=function(state,attributes){var ret,key,pos;ret=[];for(pos in CSL.FORMAT_KEY_SEQUENCE){if(true){var key=CSL.FORMAT_KEY_SEQUENCE[pos];if(attributes[key]){ret.push([key,attributes[key]]);delete attributes[key];}}}return ret;};CSL.Doppeler=function(rexStr,stringMangler){var mx,lst,len,pos,m,buf1,buf2,idx,ret,myret;this.split=split;this.join=join;var matchRex=new RegExp("("+rexStr+")","g");var splitRex=new RegExp(rexStr,"g");function split(str){if(stringMangler){str=stringMangler(str);}var match=str.match(matchRex);if(!match){return{tags:[],strings:[str]};}var split=str.split(splitRex);for(var i=match.length-1;i>-1;i--){var tag=match[i];if(tag==="\'"&&split[i+1].length>0){split[i+1]=match[i]+split[i+1];match[i]="";}}return{tags:match,strings:split,origStrings:split.slice()};}function join(obj){var lst=obj.strings.slice(-1);for(var i=obj.tags.length-1;i>-1;i--){lst.push(obj.tags[i]);lst.push(obj.strings[i]);}lst.reverse();return lst.join("");}};CSL.Engine.prototype.normalDecorIsOrphan=function(blob,params){if(params[1]==="normal"){var use_param=false;var all_the_decor;if(this.tmp.area==="citation"){all_the_decor=[this.citation.opt.layout_decorations].concat(blob.alldecor);}else{all_the_decor=blob.alldecor;}for(var k=all_the_decor.length-1;k>-1;k+=-1){for(var n=all_the_decor[k].length-1;n>-1;n+=-1){if(all_the_decor[k][n][0]===params[0]){if(all_the_decor[k][n][1]!=="normal"){use_param=true;}}}}if(!use_param){return true;}}return false;};module.exports=CSL;CSL.Engine.prototype.getCitationLabel=function(Item){var label="";var params=this.getTrigraphParams();var config=params[0];var myname=this.getTerm("reference","short",0);if("undefined"===typeof myname){myname="reference";}myname=myname.replace(".","");myname=myname.slice(0,1).toUpperCase()+myname.slice(1);for(var i=0,ilen=CSL.NAME_VARIABLES.length;i<ilen;i+=1){var n=CSL.NAME_VARIABLES[i];if(Item[n]){var names=Item[n];if(names.length>params.length){config=params[params.length-1];}else{config=params[names.length-1];}for(var j=0,jlen=names.length;j<jlen;j+=1){if(j===config.authors.length){break;}var res=this.nameOutput.getName(names[j],"locale-translit",true);var name=res.name;if(name&&name.family){myname=name.family;myname=myname.replace(/^([ \'\u2019a-z]+\s+)/,"");}else if(name&&name.literal){myname=name.literal;}var m=myname.toLowerCase().match(/^(a\s+|the\s+|an\s+)/);if(m){myname=myname.slice(m[1].length);}myname=myname.replace(CSL.ROMANESQUE_NOT_REGEXP,"");if(!myname){break;}myname=myname.slice(0,config.authors[j]);if(myname.length>1){myname=myname.slice(0,1).toUpperCase()+myname.slice(1).toLowerCase();}else if(myname.length===1){myname=myname.toUpperCase();}label+=myname;}break;}}if(!label){if(Item.title){var skipWords=this.locale[this.opt.lang].opts["skip-words"];var lst=Item.title.split(/\s+/);for(var i=lst.length-1;i>-1;i--){if(skipWords.indexOf(lst[i])>-1){lst=lst.slice(0,i).concat(lst.slice(i+1));}}var str=lst.join('');str=str.slice(0,params[0].authors[0]);if(str.length>1){str=str.slice(0,1).toUpperCase()+str.slice(1).toLowerCase();}else if(str.length===1){str=str.toUpperCase();}label=str;}}var year="0000";if(Item.issued){if(Item.issued.year){year=""+Item.issued.year;}}year=year.slice(config.year*-1);label=label+year;return label;};CSL.Engine.prototype.getTrigraphParams=function(){var params=[];var ilst=this.opt.trigraph.split(":");if(!this.opt.trigraph||this.opt.trigraph.slice(0,1)!=="A"){throw"Bad trigraph definition: "+this.opt.trigraph;}for(var i=0,ilen=ilst.length;i<ilen;i+=1){var str=ilst[i];var config={authors:[],year:0};for(var j=0,jlen=str.length;j<jlen;j+=1){switch(str.slice(j,j+1)){case"A":config.authors.push(1);break;case"a":config.authors[config.authors.length-1]+=1;break;case"0":config.year+=1;break;default:throw"Invalid character in trigraph definition: "+this.opt.trigraph;}}params.push(config);}return params;};module.exports=CSL;CSL.Engine.prototype.setOutputFormat=function(mode){this.opt.mode=mode;this.fun.decorate=CSL.Mode(mode);if(!this.output[mode]){this.output[mode]={};this.output[mode].tmp={};}};CSL.Engine.prototype.getSortFunc=function(){return function(a,b){a=a.split("-");b=b.split("-");if(a.length<b.length){return 1;}else if(a.length>b.length){return-1;}else{a=a.slice(-1)[0];b=b.slice(-1)[0];if(a.length<b.length){return 1;}else if(a.length>b.length){return-1;}else{return 0;}}};};CSL.Engine.prototype.setLangTagsForCslSort=function(tags){var i,ilen;if(tags){this.opt['locale-sort']=[];for(i=0,ilen=tags.length;i<ilen;i+=1){this.opt['locale-sort'].push(tags[i]);}}this.opt['locale-sort'].sort(this.getSortFunc());};CSL.Engine.prototype.setLangTagsForCslTransliteration=function(tags){var i,ilen;this.opt['locale-translit']=[];if(tags){for(i=0,ilen=tags.length;i<ilen;i+=1){this.opt['locale-translit'].push(tags[i]);}}this.opt['locale-translit'].sort(this.getSortFunc());};CSL.Engine.prototype.setLangTagsForCslTranslation=function(tags){var i,ilen;this.opt['locale-translat']=[];if(tags){for(i=0,ilen=tags.length;i<ilen;i+=1){this.opt['locale-translat'].push(tags[i]);}}this.opt['locale-translat'].sort(this.getSortFunc());};CSL.Engine.prototype.setLangPrefsForCites=function(obj,conv){var opt=this.opt['cite-lang-prefs'];if(!conv){conv=function conv(key){return key.toLowerCase();};}var segments=['Persons','Institutions','Titles','Journals','Publishers','Places'];for(var i=0,ilen=segments.length;i<ilen;i+=1){var clientSegment=conv(segments[i]);var citeprocSegment=segments[i].toLowerCase();if(!obj[clientSegment]){continue;}var supplements=[];while(obj[clientSegment].length>1){supplements.push(obj[clientSegment].pop());}var sortval={orig:1,translit:2,translat:3};if(supplements.length===2&&sortval[supplements[0]]<sortval[supplements[1]]){supplements.reverse();}while(supplements.length){obj[clientSegment].push(supplements.pop());}var lst=opt[citeprocSegment];while(lst.length){lst.pop();}for(var j=0,jlen=obj[clientSegment].length;j<jlen;j+=1){lst.push(obj[clientSegment][j]);}}};CSL.Engine.prototype.setLangPrefsForCiteAffixes=function(affixList){if(affixList&&affixList.length===48){var affixes=this.opt.citeAffixes;var count=0;var settings=["persons","institutions","titles","journals","publishers","places"];var forms=["translit","orig","translit","translat"];var value;for(var i=0,ilen=settings.length;i<ilen;i+=1){for(var j=0,jlen=forms.length;j<jlen;j+=1){value="";if(count%8===4){if(!affixes[settings[i]]["locale-"+forms[j]].prefix&&!affixes[settings[i]]["locale-"+forms[j]].suffix){value=affixList[count]?affixList[count]:"";affixes[settings[i]]["locale-"+forms[j]].prefix=value;value=affixList[count]?affixList[count+1]:"";affixes[settings[i]]["locale-"+forms[j]].suffix=value;}}else{value=affixList[count]?affixList[count]:"";affixes[settings[i]]["locale-"+forms[j]].prefix=value;value=affixList[count]?affixList[count+1]:"";affixes[settings[i]]["locale-"+forms[j]].suffix=value;}count+=2;}}this.opt.citeAffixes=affixes;}};CSL.Engine.prototype.setAutoVietnameseNamesOption=function(arg){if(arg){this.opt["auto-vietnamese-names"]=true;}else{this.opt["auto-vietnamese-names"]=false;}};CSL.Engine.prototype.setAbbreviations=function(arg){if(this.sys.setAbbreviations){this.sys.setAbbreviations(arg);}};CSL.Engine.prototype.setSuppressTrailingPunctuation=function(arg){this.citation.opt.suppressTrailingPunctuation=!!arg;};module.exports=CSL;CSL.Output={};CSL.Output.Queue=function(state){this.levelname=["top"];this.state=state;this.queue=[];this.empty=new CSL.Token("empty");var tokenstore={};tokenstore.empty=this.empty;this.formats=new CSL.Stack(tokenstore);this.current=new CSL.Stack(this.queue);};CSL.Output.Queue.prototype.pop=function(){var drip=this.current.value();if(drip.length){return drip.pop();}else{return drip.blobs.pop();}};CSL.Output.Queue.prototype.getToken=function(name){var ret=this.formats.value()[name];return ret;};CSL.Output.Queue.prototype.mergeTokenStrings=function(base,modifier){var base_token,modifier_token,ret,key;base_token=this.formats.value()[base];modifier_token=this.formats.value()[modifier];ret=base_token;if(modifier_token){if(!base_token){base_token=new CSL.Token(base,CSL.SINGLETON);base_token.decorations=[];}ret=new CSL.Token(base,CSL.SINGLETON);var key="";for(var key in base_token.strings){if(base_token.strings.hasOwnProperty(key)){ret.strings[key]=base_token.strings[key];}}for(var key in modifier_token.strings){if(modifier_token.strings.hasOwnProperty(key)){ret.strings[key]=modifier_token.strings[key];}}ret.decorations=base_token.decorations.concat(modifier_token.decorations);}return ret;};CSL.Output.Queue.prototype.addToken=function(name,modifier,token){var newtok,attr;newtok=new CSL.Token("output");if("string"===typeof token){token=this.formats.value()[token];}if(token&&token.strings){for(attr in token.strings){if(token.strings.hasOwnProperty(attr)){newtok.strings[attr]=token.strings[attr];}}newtok.decorations=token.decorations;}if("string"===typeof modifier){newtok.strings.delimiter=modifier;}this.formats.value()[name]=newtok;};CSL.Output.Queue.prototype.pushFormats=function(tokenstore){if(!tokenstore){tokenstore={};}tokenstore.empty=this.empty;this.formats.push(tokenstore);};CSL.Output.Queue.prototype.popFormats=function(tokenstore){this.formats.pop();};CSL.Output.Queue.prototype.startTag=function(name,token){var tokenstore={};if(this.state.tmp["doing-macro-with-date"]&&this.state.tmp.extension){token=this.empty;name="empty";}tokenstore[name]=token;this.pushFormats(tokenstore);this.openLevel(name);};CSL.Output.Queue.prototype.endTag=function(name){this.closeLevel(name);this.popFormats();};CSL.Output.Queue.prototype.openLevel=function(token,ephemeral){var blob,curr,x,has_ephemeral;if("object"===_typeof(token)){blob=new CSL.Blob(undefined,token);}else if("undefined"===typeof token){blob=new CSL.Blob(undefined,this.formats.value().empty,"empty");}else{if(!this.formats.value()||!this.formats.value()[token]){throw"CSL processor error: call to nonexistent format token \""+token+"\"";}blob=new CSL.Blob(undefined,this.formats.value()[token],token);}curr=this.current.value();if(!this.state.tmp.just_looking&&this.checkNestedBrace){blob.strings.prefix=this.checkNestedBrace.update(blob.strings.prefix);}curr.push(blob);this.current.push(blob);};CSL.Output.Queue.prototype.closeLevel=function(name){if(name&&name!==this.current.value().levelname){CSL.error("Level mismatch error: wanted "+name+" but found "+this.current.value().levelname);}var blob=this.current.pop();if(!this.state.tmp.just_looking&&this.checkNestedBrace){blob.strings.suffix=this.checkNestedBrace.update(blob.strings.suffix);}};CSL.Output.Queue.prototype.append=function(str,tokname,notSerious,ignorePredecessor,noStripPeriods){var token,blob,curr;var useblob=true;if(notSerious){ignorePredecessor=true;}if(this.state.tmp["doing-macro-with-date"]&&!notSerious){if(tokname!=="macro-with-date"){return false;}if(tokname==="macro-with-date"){tokname="empty";}}if("undefined"===typeof str){return false;}if("number"===typeof str){str=""+str;}if(!notSerious&&this.state.tmp.element_trace&&this.state.tmp.element_trace.value()==="suppress-me"){return false;}blob=false;if(!tokname){token=this.formats.value().empty;}else if(tokname==="literal"){token=true;useblob=false;}else if("string"===typeof tokname){token=this.formats.value()[tokname];}else{token=tokname;}if(!token){throw"CSL processor error: unknown format token name: "+tokname;}if(token.strings&&"undefined"===typeof token.strings.delimiter){token.strings.delimiter="";}if("string"===typeof str&&str.length){str=str.replace(/ ([:;?!\u00bb])/g,"\u202F$1").replace(/\u00ab /g,"\xAB\u202F");this.last_char_rendered=str.slice(-1);str=str.replace(/\s+'/g," \'");if(!notSerious){str=str.replace(/^'/g," \'");}if(!ignorePredecessor){this.state.tmp.term_predecessor=true;this.state.tmp.in_cite_predecessor=true;}else if(notSerious){this.state.tmp.term_predecessor_name=true;}}blob=new CSL.Blob(str,token);curr=this.current.value();if("undefined"===typeof curr&&this.current.mystack.length===0){this.current.mystack.push([]);curr=this.current.value();}if("string"===typeof blob.blobs){if(!ignorePredecessor){this.state.tmp.term_predecessor=true;this.state.tmp.in_cite_predecessor=true;}else if(notSerious){this.state.tmp.term_predecessor_name=true;}}if(!notSerious){this.state.parallel.AppendBlobPointer(curr);}if("string"===typeof str){if("string"===typeof blob.blobs){if(blob.blobs.slice(0,1)!==" "){var blobPrefix="";var blobBlobs=blob.blobs;while(CSL.TERMINAL_PUNCTUATION.indexOf(blobBlobs.slice(0,1))>-1){blobPrefix=blobPrefix+blobBlobs.slice(0,1);blobBlobs=blobBlobs.slice(1);}if(blobBlobs&&blobPrefix){blob.strings.prefix=blob.strings.prefix+blobPrefix;blob.blobs=blobBlobs;}}}if(blob.strings["text-case"]){blob.blobs=CSL.Output.Formatters[blob.strings["text-case"]](this.state,str);}if(this.state.tmp.strip_periods&&!noStripPeriods){blob.blobs=blob.blobs.replace(/\.([^a-z]|$)/g,"$1");}for(var i=blob.decorations.length-1;i>-1;i+=-1){if(blob.decorations[i][0]==="@quotes"&&blob.decorations[i][1]!=="false"){blob.punctuation_in_quote=this.state.getOpt("punctuation-in-quote");}if(!blob.blobs.match(CSL.ROMANESQUE_REGEXP)){if(blob.decorations[i][0]==="@font-style"){blob.decorations=blob.decorations.slice(0,i).concat(blob.decorations.slice(i+1));}}}curr.push(blob);this.state.fun.flipflopper.processTags(blob);}else if(useblob){curr.push(blob);}else{curr.push(str);}return true;};CSL.Output.Queue.prototype.string=function(state,myblobs,blob){var i,ilen,j,jlen,b;var txt_esc=CSL.getSafeEscape(this.state);var blobs=myblobs.slice();var ret=[];if(blobs.length===0){return ret;}var blob_delimiter="";if(blob){blob_delimiter=blob.strings.delimiter;}else{state.tmp.count_offset_characters=false;state.tmp.offset_characters=0;}if(blob&&blob.new_locale){blob.old_locale=state.opt.lang;state.opt.lang=blob.new_locale;}var blobjr,use_suffix,use_prefix,params;for(var i=0,ilen=blobs.length;i<ilen;i+=1){blobjr=blobs[i];if(blobjr.strings.first_blob){state.tmp.count_offset_characters=blobjr.strings.first_blob;}if("string"===typeof blobjr.blobs){if("number"===typeof blobjr.num){ret.push(blobjr);}else if(blobjr.blobs){if(blobjr.particle){blobjr.blobs=blobjr.particle+blobjr.blobs;blobjr.particle="";}b=txt_esc(blobjr.blobs);var blen=b.length;if(!state.tmp.suppress_decorations){for(j=0,jlen=blobjr.decorations.length;j<jlen;j+=1){params=blobjr.decorations[j];if(params[0]==="@showid"){continue;}if(state.normalDecorIsOrphan(blobjr,params)){continue;}b=state.fun.decorate[params[0]][params[1]].call(blobjr,state,b,params[2]);}}if(b&&b.length){b=txt_esc(blobjr.strings.prefix)+b+txt_esc(blobjr.strings.suffix);if((state.opt.development_extensions.csl_reverse_lookup_support||state.sys.csl_reverse_lookup_support)&&!state.tmp.suppress_decorations){for(j=0,jlen=blobjr.decorations.length;j<jlen;j+=1){params=blobjr.decorations[j];if(params[0]==="@showid"){b=state.fun.decorate[params[0]][params[1]].call(blobjr,state,b,params[2]);}}}ret.push(b);if(state.tmp.count_offset_characters){state.tmp.offset_characters+=blen+blobjr.strings.suffix.length+blobjr.strings.prefix.length;}}}}else if(blobjr.blobs.length){var addtoret=state.output.string(state,blobjr.blobs,blobjr);if(blob){if("string"!==addtoret&&addtoret.length>1&&blobjr.strings.delimiter){var numberSeen=false;for(var j=0,jlen=addtoret.length;j<jlen;j++){if("string"!==typeof addtoret[j]){numberSeen=true;}else if(numberSeen){addtoret[j]=blobjr.strings.delimiter+addtoret[j];}}}}ret=ret.concat(addtoret);}if(blobjr.strings.first_blob&&state.registry.registry[blobjr.strings.first_blob]){state.registry.registry[blobjr.strings.first_blob].offset=state.tmp.offset_characters;state.tmp.count_offset_characters=false;}}for(i=0,ilen=ret.length-1;i<ilen;i+=1){if("number"===typeof ret[i].num&&"number"===typeof ret[i+1].num&&!ret[i+1].UGLY_DELIMITER_SUPPRESS_HACK){ret[i].strings.suffix=ret[i].strings.suffix+(blob_delimiter?blob_delimiter:"");ret[i+1].successor_prefix="";ret[i+1].UGLY_DELIMITER_SUPPRESS_HACK=true;}}var span_split=0;for(var i=0,ilen=ret.length;i<ilen;i+=1){if("string"===typeof ret[i]){span_split=parseInt(i,10)+1;if(i<ret.length-1&&"object"===_typeof(ret[i+1])){if(blob_delimiter&&!ret[i+1].UGLY_DELIMITER_SUPPRESS_HACK){ret[i]+=txt_esc(blob_delimiter);}ret[i+1].UGLY_DELIMITER_SUPPRESS_HACK=true;}}}if(blob&&(blob.decorations.length||blob.strings.suffix)){span_split=ret.length;}else if(blob&&blob.strings.prefix){for(var i=0,ilen=ret.length;i<ilen;i++){if("undefined"!==typeof ret[i].num){span_split=i;if(i===0){ret[i].strings.prefix=blob.strings.prefix+ret[i].strings.prefix;}break;}}}var blobs_start=state.output.renderBlobs(ret.slice(0,span_split),blob_delimiter,false,blob);if(blobs_start&&blob&&(blob.decorations.length||blob.strings.suffix||blob.strings.prefix)){if(!state.tmp.suppress_decorations){for(var i=0,ilen=blob.decorations.length;i<ilen;i+=1){params=blob.decorations[i];if(["@cite","@bibliography","@display","@showid"].indexOf(params[0])>-1){continue;}if(state.normalDecorIsOrphan(blobjr,params)){continue;}if("string"===typeof blobs_start){blobs_start=state.fun.decorate[params[0]][params[1]].call(blob,state,blobs_start,params[2]);}}}b=blobs_start;use_suffix=blob.strings.suffix;if(b&&b.length){use_prefix=blob.strings.prefix;b=txt_esc(use_prefix)+b+txt_esc(use_suffix);if(state.tmp.count_offset_characters){state.tmp.offset_characters+=use_prefix.length+use_suffix.length;}}blobs_start=b;if(!state.tmp.suppress_decorations){for(var i=0,ilen=blob.decorations.length;i<ilen;i+=1){params=blob.decorations[i];if(["@cite","@bibliography","@display","@showid"].indexOf(params[0])===-1){continue;}if("string"===typeof blobs_start){blobs_start=state.fun.decorate[params[0]][params[1]].call(blob,state,blobs_start,params[2]);}}}}var blobs_end=ret.slice(span_split,ret.length);if(!blobs_end.length&&blobs_start){ret=[blobs_start];}else if(blobs_end.length&&!blobs_start){ret=blobs_end;}else if(blobs_start&&blobs_end.length){ret=[blobs_start].concat(blobs_end);}if("undefined"===typeof blob){this.queue=[];this.current.mystack=[];this.current.mystack.push(this.queue);if(state.tmp.suppress_decorations){ret=state.output.renderBlobs(ret,undefined,false);}}else if("boolean"===typeof blob){ret=state.output.renderBlobs(ret,undefined,true);}if(blob&&blob.new_locale){state.opt.lang=blob.old_locale;}return ret;};CSL.Output.Queue.prototype.clearlevel=function(){var blob,pos,len;blob=this.current.value();len=blob.blobs.length;for(pos=0;pos<len;pos+=1){blob.blobs.pop();}};CSL.Output.Queue.prototype.renderBlobs=function(blobs,delim,in_cite,parent){var state,ret,ret_last_char,use_delim,i,blob,pos,len,ppos,llen,pppos,lllen,res,str,params,txt_esc;txt_esc=CSL.getSafeEscape(this.state);if(!delim){delim="";}state=this.state;ret="";ret_last_char=[];use_delim="";len=blobs.length;if(this.state.tmp.area==="citation"&&!this.state.tmp.just_looking&&len===1&&_typeof(blobs[0])==="object"&&parent){blobs[0].strings.prefix=parent.strings.prefix+blobs[0].strings.prefix;blobs[0].strings.suffix=blobs[0].strings.suffix+parent.strings.suffix;blobs[0].decorations=blobs[0].decorations.concat(parent.decorations);blobs[0].params=parent.params;return blobs[0];}var start=true;for(pos=0;pos<len;pos+=1){if(blobs[pos].checkNext){blobs[pos].checkNext(blobs[pos+1],start);start=false;}else if(blobs[pos+1]&&blobs[pos+1].splice_prefix){start=false;}else{start=true;}}var doit=true;for(pos=blobs.length-1;pos>0;pos+=-1){if(blobs[pos].checkLast){if(doit&&blobs[pos].checkLast(blobs[pos-1])){doit=false;}}else{doit=true;}}len=blobs.length;for(pos=0;pos<len;pos+=1){blob=blobs[pos];if(ret){use_delim=delim;}if("string"===typeof blob){ret+=txt_esc(use_delim);ret+=blob;if(state.tmp.count_offset_characters){state.tmp.offset_characters+=use_delim.length;}}else if(in_cite){if(ret){ret=[ret,blob];}else{ret=[blob];}}else if(blob.status!==CSL.SUPPRESS){if(blob.particle){str=blob.particle+blob.num;}else{str=blob.formatter.format(blob.num,blob.gender);}var strlen=str.replace(/<[^>]*>/g,"").length;this.append(str,"empty",true);var str_blob=this.pop();var count_offset_characters=state.tmp.count_offset_characters;str=this.string(state,[str_blob],false);state.tmp.count_offset_characters=count_offset_characters;if(blob.strings["text-case"]){str=CSL.Output.Formatters[blob.strings["text-case"]](this.state,str);}if(str&&this.state.tmp.strip_periods){str=str.replace(/\.([^a-z]|$)/g,"$1");}if(!state.tmp.suppress_decorations){llen=blob.decorations.length;for(ppos=0;ppos<llen;ppos+=1){params=blob.decorations[ppos];if(state.normalDecorIsOrphan(blob,params)){continue;}str=state.fun.decorate[params[0]][params[1]].call(blob,state,str,params[2]);}}str=txt_esc(blob.strings.prefix)+str+txt_esc(blob.strings.suffix);var addme="";if(blob.status===CSL.END){addme=txt_esc(blob.range_prefix);}else if(blob.status===CSL.SUCCESSOR){addme=txt_esc(blob.successor_prefix);}else if(blob.status===CSL.START){if(pos>0&&!blob.suppress_splice_prefix){addme=txt_esc(blob.splice_prefix);}else{addme="";}}else if(blob.status===CSL.SEEN){addme=txt_esc(blob.splice_prefix);}ret+=addme;ret+=str;if(state.tmp.count_offset_characters){state.tmp.offset_characters+=addme.length+blob.strings.prefix.length+strlen+blob.strings.suffix.length;}}}return ret;};CSL.Output.Queue.purgeEmptyBlobs=function(parent){if("object"!==_typeof(parent)||"object"!==_typeof(parent.blobs)||!parent.blobs.length){return;}for(var i=parent.blobs.length-1;i>-1;i--){CSL.Output.Queue.purgeEmptyBlobs(parent.blobs[i]);var child=parent.blobs[i];if(!child||!child.blobs||!child.blobs.length){var buf=[];while(parent.blobs.length-1>i){buf.push(parent.blobs.pop());}parent.blobs.pop();while(buf.length){parent.blobs.push(buf.pop());}}}};CSL.Output.Queue.adjust=function(punctInQuote){var NO_SWAP_IN={";":true,":":true};var NO_SWAP_OUT={".":true,"!":true,"?":true};this.upward=upward;this.leftward=leftward;this.downward=downward;this.fix=fix;var LtoR_MAP={"!":{".":"!","?":"!?",":":"!",",":"!,",";":"!;"},"?":{"!":"?!",".":"?",":":"?",",":"?,",";":"?;"},".":{"!":".!","?":".?",":":".:",",":".,",";":".;"},":":{"!":"!","?":"?",".":":",",":":,",";":":;"},",":{"!":",!","?":",?",":":",:",".":",.",";":",;"},";":{"!":"!","?":"?",":":";",",":";,",".":";"}};var SWAP_IN={};var SWAP_OUT={};var PUNCT={};var PUNCT_OR_SPACE={};for(var key in LtoR_MAP){PUNCT[key]=true;PUNCT_OR_SPACE[key]=true;if(!NO_SWAP_IN[key]){SWAP_IN[key]=true;}if(!NO_SWAP_OUT[key]){SWAP_OUT[key]=true;}}PUNCT_OR_SPACE[" "]=true;PUNCT_OR_SPACE[" "]=true;var RtoL_MAP={};for(var key in LtoR_MAP){for(var subkey in LtoR_MAP[key]){if(!RtoL_MAP[subkey]){RtoL_MAP[subkey]={};}RtoL_MAP[subkey][key]=LtoR_MAP[key][subkey];}}function blobIsNumber(blob){return"number"===typeof blob.num||blob.blobs&&blob.blobs.length===1&&"number"===typeof blob.blobs[0].num;};function blobEndsInNumber(blob){if("number"===typeof blob.num){return true;}if(!blob.blobs||"object"!==_typeof(blob.blobs))return false;if(blobEndsInNumber(blob.blobs[blob.blobs.length-1]))return true;}function blobHasDecorations(blob,includeQuotes){var ret=false;var decorlist=['@font-style','@font-variant','@font-weight','@text-decoration','@vertical-align'];if(includeQuotes){decorlist.push('@quotes');}if(blob.decorations){for(var i=0,ilen=blob.decorations.length;i<ilen;i++){if(decorlist.indexOf(blob.decorations[i][0])>-1){ret=true;break;}}}return ret;};function blobHasDescendantQuotes(blob){if(blob.decorations){for(var i=0,ilen=blob.decorations.length;i<ilen;i++){if(blob.decorations[i][0]==='@quotes'&&blob.decorations[i][1]!=="false"){return true;}}}if("object"!==_typeof(blob.blobs)){return false;};return blobHasDescendantQuotes(blob.blobs[blob.blobs.length-1]);}function blobHasDescendantMergingPunctuation(parentChar,blob){var childChar=blob.strings.suffix.slice(-1);if(!childChar&&"string"===typeof blob.blobs){childChar=blob.blobs.slice(-1);}var mergedChars=RtoL_MAP[parentChar][childChar];if(mergedChars&&mergedChars.length===1){return true;}if("object"!==_typeof(blob.blobs))return false;if(blobHasDescendantMergingPunctuation(parentChar,blob.blobs[blob.blobs.length-1]))return true;return false;}function matchLastChar(blob,chr){if(!PUNCT[chr]){return false;}if("string"===typeof blob.blobs){if(blob.blobs.slice(-1)===chr){return true;}else{return false;}}else{var child=blob.blobs[blob.blobs.length-1];if(child){var childChar=child.strings.suffix.slice(-1);if(!childChar){return matchLastChar(child,chr);}else if(child.strings.suffix.slice(-1)==chr){return true;}else{return false;}}else{return false;}}};function mergeChars(First,first,Second,second,merge_right){var FirstStrings="blobs"===first?First:First.strings;var SecondStrings="blobs"===second?Second:Second.strings;var firstChar=FirstStrings[first].slice(-1);var secondChar=SecondStrings[second].slice(0,1);function cullRight(){SecondStrings[second]=SecondStrings[second].slice(1);};function cullLeft(){FirstStrings[first]=FirstStrings[first].slice(0,-1);};function addRight(chr){SecondStrings[second]=chr+SecondStrings[second];}function addLeft(chr){FirstStrings[first]+=chr;}var cull=merge_right?cullLeft:cullRight;function matchOnRight(){return RtoL_MAP[secondChar];}function matchOnLeft(){return LtoR_MAP[firstChar];}var match=merge_right?matchOnLeft:matchOnRight;function mergeToRight(){var chr=LtoR_MAP[firstChar][secondChar];if("string"===typeof chr){cullLeft();cullRight();addRight(chr);}else{addRight(firstChar);cullLeft();}}function mergeToLeft(){var chr=RtoL_MAP[secondChar][firstChar];if("string"===typeof chr){cullLeft();cullRight();addLeft(chr);}else{addLeft(secondChar);cullRight();}}var merge=merge_right?mergeToRight:mergeToLeft;var isDuplicate=firstChar===secondChar;if(isDuplicate){cull();}else{if(match()){merge();}}};function upward(parent){if(parent.blobs&&"string"==typeof parent.blobs){if(PUNCT[parent.strings.suffix.slice(0,1)]&&parent.strings.suffix.slice(0,1)===parent.blobs.slice(-1)){parent.strings.suffix=parent.strings.suffix.slice(1);}return;}else if("object"!==_typeof(parent)||"object"!==_typeof(parent.blobs)||!parent.blobs.length){return;}var parentDecorations=blobHasDecorations(parent,true);for(var i=parent.blobs.length-1;i>-1;i--){var endFlag=i===parent.blobs.length-1;this.upward(parent.blobs[i]);var parentStrings=parent.strings;var childStrings=parent.blobs[i].strings;if(i===0){if(" "===parentStrings.prefix.slice(-1)&&" "===childStrings.prefix.slice(0,1)){childStrings.prefix=childStrings.prefix.slice(1);}var childChar=childStrings.prefix.slice(0,1);if(!parentDecorations&&PUNCT_OR_SPACE[childChar]&&!parentStrings.prefix){parentStrings.prefix+=childChar;childStrings.prefix=childStrings.prefix.slice(1);}}if(i===parent.blobs.length-1){var childChar=childStrings.suffix.slice(-1);if(!parentDecorations&&[" "].indexOf(childChar)>-1){if(parentStrings.suffix.slice(0,1)!==childChar){parentStrings.suffix=childChar+parentStrings.suffix;}childStrings.suffix=childStrings.suffix.slice(0,-1);}}if(parentStrings.delimiter&&i>0){if(PUNCT_OR_SPACE[parentStrings.delimiter.slice(-1)]&&parentStrings.delimiter.slice(-1)===childStrings.prefix.slice(0,1)){childStrings.prefix=childStrings.prefix.slice(1);}}}};function leftward(parent){if("object"!==_typeof(parent)||"object"!==_typeof(parent.blobs)||!parent.blobs.length){return;}for(var i=parent.blobs.length-1;i>-1;i--){this.leftward(parent.blobs[i]);if(i<parent.blobs.length-1&&!parent.strings.delimiter){var child=parent.blobs[i];var childChar=child.strings.suffix.slice(-1);var sibling=parent.blobs[i+1];var siblingChar=sibling.strings.prefix.slice(0,1);var hasDecorations=blobHasDecorations(child)||blobHasDecorations(sibling);var hasNumber="number"===typeof childChar||"number"===typeof siblingChar;if(!hasDecorations&&!hasNumber&&PUNCT[siblingChar]&&!hasNumber){var suffixAndPrefixMatch=siblingChar===child.strings.suffix.slice(-1);var suffixAndFieldMatch=!child.strings.suffix&&"string"===typeof child.blobs&&child.blobs.slice(-1)===siblingChar;if(!suffixAndPrefixMatch&&!suffixAndFieldMatch){mergeChars(child,'suffix',sibling,'prefix');}else{sibling.strings.prefix=sibling.strings.prefix.slice(1);}}}}};function downward(parent,top){if(parent.blobs&&"string"==typeof parent.blobs){if(PUNCT[parent.strings.suffix.slice(0,1)]&&parent.strings.suffix.slice(0,1)===parent.blobs.slice(-1)){parent.strings.suffix=parent.strings.suffix.slice(1);}return;}else if("object"!==_typeof(parent)||"object"!==_typeof(parent.blobs)||!parent.blobs.length){return;}var parentStrings=parent.strings;var someChildrenAreNumbers=false;for(var i=0,ilen=parent.blobs.length;i<ilen;i++){if(blobIsNumber(parent.blobs[i])){someChildrenAreNumbers=true;break;}}if(true||!someChildrenAreNumbers){if(parentStrings.delimiter&&PUNCT[parentStrings.delimiter.slice(0,1)]){var delimChar=parentStrings.delimiter.slice(0,1);for(var i=parent.blobs.length-2;i>-1;i--){var childStrings=parent.blobs[i].strings;if(childStrings.suffix.slice(-1)!==delimChar){childStrings.suffix+=delimChar;}}parentStrings.delimiter=parentStrings.delimiter.slice(1);}}var parentDecorations=blobHasDecorations(parent,true);var parentIsNumber=blobIsNumber(parent);for(var i=parent.blobs.length-1;i>-1;i--){var child=parent.blobs[i];var childStrings=parent.blobs[i].strings;var childDecorations=blobHasDecorations(child,true);var childIsNumber=blobIsNumber(child);if(i===parent.blobs.length-1){if(true||!someChildrenAreNumbers){var parentChar=parentStrings.suffix.slice(0,1);var allowMigration=false;if(PUNCT[parentChar]){allowMigration=blobHasDescendantMergingPunctuation(parentChar,child);if(!allowMigration&&punctInQuote){allowMigration=blobHasDescendantQuotes(child);}}if(allowMigration){if(PUNCT[parentChar]){if(!blobEndsInNumber(child)){if("string"===typeof child.blobs){mergeChars(child,'blobs',parent,'suffix');}else{mergeChars(child,'suffix',parent,'suffix');}if(parentStrings.suffix.slice(0,1)==="."){childStrings.suffix+=parentStrings.suffix.slice(0,1);parentStrings.suffix=parentStrings.suffix.slice(1);}}}}if(childStrings.suffix.slice(-1)===" "&&parentStrings.suffix.slice(0,1)===" "){parentStrings.suffix=parentStrings.suffix.slice(1);}if(PUNCT_OR_SPACE[childStrings.suffix.slice(0,1)]){if("string"===typeof child.blobs&&child.blobs.slice(-1)===childStrings.suffix.slice(0,1)){childStrings.suffix=childStrings.suffix.slice(1);}if(childStrings.suffix.slice(-1)===parentStrings.suffix.slice(0,1)){parentStrings.suffix=parentStrings.suffix.slice(0,-1);}}}if(matchLastChar(parent,parent.strings.suffix.slice(0,1))){parent.strings.suffix=parent.strings.suffix.slice(1);}}else if(parentStrings.delimiter){if(PUNCT_OR_SPACE[parentStrings.delimiter.slice(0,1)]&&parentStrings.delimiter.slice(0,1)===childStrings.suffix.slice(-1)){parent.blobs[i].strings.suffix=parent.blobs[i].strings.suffix.slice(0,-1);}}else{var siblingStrings=parent.blobs[i+1].strings;if(!blobIsNumber(child)&&!childDecorations&&PUNCT_OR_SPACE[childStrings.suffix.slice(-1)]&&childStrings.suffix.slice(-1)===siblingStrings.prefix.slice(0,1)){siblingStrings.prefix=siblingStrings.prefix.slice(1);}}if(!childIsNumber&&!childDecorations&&PUNCT[childStrings.suffix.slice(0,1)]&&"string"===typeof child.blobs){mergeChars(child,'blobs',child,'suffix');}this.downward(parent.blobs[i]);}};function swapToTheLeft(child){var childChar=child.strings.suffix.slice(0,1);if("string"===typeof child.blobs){while(SWAP_IN[childChar]){mergeChars(child,'blobs',child,'suffix');childChar=child.strings.suffix.slice(0,1);}}else{while(SWAP_IN[childChar]){mergeChars(child.blobs[child.blobs.length-1],'suffix',child,'suffix');childChar=child.strings.suffix.slice(0,1);}}}function swapToTheRight(child){if("string"===typeof child.blobs){var childChar=child.blobs.slice(-1);while(SWAP_OUT[childChar]){mergeChars(child,'blobs',child,'suffix',true);childChar=child.blobs.slice(-1);}}else{var childChar=child.blobs[child.blobs.length-1].strings.suffix.slice(-1);while(SWAP_OUT[childChar]){mergeChars(child.blobs[child.blobs.length-1],'suffix',child,'suffix',true);childChar=child.blobs[child.blobs.length-1].strings.suffix.slice(-1);}}}function fix(parent){if("object"!==_typeof(parent)||"object"!==_typeof(parent.blobs)||!parent.blobs.length){return;}var lastChar;for(var i=0,ilen=parent.blobs.length;i<ilen;i++){var child=parent.blobs[i];var quoteSwap=false;for(var j=0,jlen=child.decorations.length;j<jlen;j++){var decoration=child.decorations[j];if(decoration[0]==="@quotes"&&decoration[1]!=="false"){quoteSwap=true;}}if(quoteSwap){if(punctInQuote){swapToTheLeft(child);}else{swapToTheRight(child);}}lastChar=this.fix(parent.blobs[i]);if(child.blobs&&"string"===typeof child.blobs){lastChar=child.blobs.slice(-1);}}return lastChar;};};module.exports=CSL;CSL.Engine.Opt=function(){this.has_disambiguate=false;this.mode="html";this.dates={};this.jurisdictions_seen={};this.suppressedJurisdictions={};this.inheritedAttributes={};this["locale-sort"]=[];this["locale-translit"]=[];this["locale-translat"]=[];this.citeAffixes={persons:{"locale-orig":{prefix:"",suffix:""},"locale-translit":{prefix:"",suffix:""},"locale-translat":{prefix:"",suffix:""}},institutions:{"locale-orig":{prefix:"",suffix:""},"locale-translit":{prefix:"",suffix:""},"locale-translat":{prefix:"",suffix:""}},titles:{"locale-orig":{prefix:"",suffix:""},"locale-translit":{prefix:"",suffix:""},"locale-translat":{prefix:"",suffix:""}},journals:{"locale-orig":{prefix:"",suffix:""},"locale-translit":{prefix:"",suffix:""},"locale-translat":{prefix:"",suffix:""}},publishers:{"locale-orig":{prefix:"",suffix:""},"locale-translit":{prefix:"",suffix:""},"locale-translat":{prefix:"",suffix:""}},places:{"locale-orig":{prefix:"",suffix:""},"locale-translit":{prefix:"",suffix:""},"locale-translat":{prefix:"",suffix:""}}};this["default-locale"]=[];this.update_mode=CSL.NONE;this.bib_mode=CSL.NONE;this.sort_citations=false;this["et-al-min"]=0;this["et-al-use-first"]=1;this["et-al-use-last"]=false;this["et-al-subsequent-min"]=false;this["et-al-subsequent-use-first"]=false;this["demote-non-dropping-particle"]="display-and-sort";this["parse-names"]=true;this.citation_number_slug=false;this.trigraph="Aaaa00:AaAa00:AaAA00:AAAA00";this.nodenames=[];this.gender={};this['cite-lang-prefs']={persons:['orig'],institutions:['orig'],titles:['orig'],journals:['orig'],publishers:['orig'],places:['orig'],number:['orig']};this.has_layout_locale=false;this.development_extensions={};this.development_extensions.field_hack=true;this.development_extensions.allow_field_hack_date_override=true;this.development_extensions.locator_date_and_revision=true;this.development_extensions.locator_parsing_for_plurals=true;this.development_extensions.locator_label_parse=true;this.development_extensions.raw_date_parsing=true;this.development_extensions.clean_up_csl_flaws=true;this.development_extensions.flip_parentheses_to_braces=true;this.development_extensions.jurisdiction_subfield=true;this.development_extensions.static_statute_locator=false;this.development_extensions.csl_reverse_lookup_support=false;this.development_extensions.clobber_locator_if_no_statute_section=false;this.development_extensions.wrap_url_and_doi=false;this.development_extensions.allow_force_lowercase=false;this.development_extensions.handle_parallel_articles=false;this.development_extensions.thin_non_breaking_space_html_hack=false;this.development_extensions.apply_citation_wrapper=false;this.development_extensions.main_title_from_short_title=false;this.development_extensions.uppercase_subtitles=false;this.development_extensions.normalize_lang_keys_to_lowercase=false;this.development_extensions.strict_text_case_locales=false;this.development_extensions.rtl_support=false;this.development_extensions.expect_and_symbol_form=false;this.development_extensions.citationRequire_explicit_legal_case_title_short=false;this.development_extensions.spoof_institutional_affiliations=false;this.development_extensions.force_jurisdiction=false;this.development_extensions.parse_names=true;};CSL.Engine.Tmp=function(){this.names_max=new CSL.Stack();this.names_base=new CSL.Stack();this.givens_base=new CSL.Stack();this.value=[];this.namepart_decorations={};this.namepart_type=false;this.area="citation";this.root="citation";this.extension="";this.can_substitute=new CSL.Stack(0,CSL.LITERAL);this.element_rendered_ok=false;this.element_trace=new CSL.Stack("style");this.nameset_counter=0;this.group_context=new CSL.Stack({term_intended:false,variable_attempt:false,variable_success:false,output_tip:undefined,label_form:undefined,parallel_conditions:undefined,condition:false,force_suppress:false,done_vars:[]});this.term_predecessor=false;this.in_cite_predecessor=false;this.jump=new CSL.Stack(0,CSL.LITERAL);this.decorations=new CSL.Stack();this.tokenstore_stack=new CSL.Stack();this.last_suffix_used="";this.last_names_used=[];this.last_years_used=[];this.years_used=[];this.names_used=[];this.taintedItemIDs={};this.taintedCitationIDs={};this.initialize_with=new CSL.Stack();this.disambig_request=false;this["name-as-sort-order"]=false;this.suppress_decorations=false;this.disambig_settings=new CSL.AmbigConfig();this.bib_sort_keys=[];this.prefix=new CSL.Stack("",CSL.LITERAL);this.suffix=new CSL.Stack("",CSL.LITERAL);this.delimiter=new CSL.Stack("",CSL.LITERAL);this.cite_locales=[];this.cite_affixes={citation:false,bibliography:false,citation_sort:false,bibliography_sort:false};this.strip_periods=0;this.shadow_numbers={};this.authority_stop_last=0;this.loadedItemIDs={};};CSL.Engine.Fun=function(state){this.match=new CSL.Util.Match();this.suffixator=new CSL.Util.Suffixator(CSL.SUFFIX_CHARS);this.romanizer=new CSL.Util.Romanizer();this.ordinalizer=new CSL.Util.Ordinalizer(state);this.long_ordinalizer=new CSL.Util.LongOrdinalizer();};CSL.Engine.Build=function(){this["alternate-term"]=false;this.in_bibliography=false;this.in_style=false;this.skip=false;this.postponed_macro=false;this.layout_flag=false;this.name=false;this.form=false;this.term=false;this.macro={};this.macro_stack=[];this.text=false;this.lang=false;this.area="citation";this.root="citation";this.extension="";this.substitute_level=new CSL.Stack(0,CSL.LITERAL);this.names_level=0;this.render_nesting_level=0;this.render_seen=false;};CSL.Engine.Configure=function(){this.fail=[];this.succeed=[];};CSL.Engine.Citation=function(state){this.opt={inheritedAttributes:{}};this.tokens=[];this.srt=new CSL.Registry.Comparifier(state,"citation_sort");this.opt.collapse=[];this.opt["disambiguate-add-names"]=false;this.opt["disambiguate-add-givenname"]=false;this.opt["disambiguate-add-year-suffix"]=false;this.opt["givenname-disambiguation-rule"]="by-cite";this.opt["near-note-distance"]=5;this.opt.topdecor=[];this.opt.layout_decorations=[];this.opt.layout_prefix="";this.opt.layout_suffix="";this.opt.layout_delimiter="";this.opt.sort_locales=[];this.opt.max_number_of_names=0;this.root="citation";};CSL.Engine.Bibliography=function(){this.opt={inheritedAttributes:{}};this.tokens=[];this.opt.collapse=[];this.opt.topdecor=[];this.opt.layout_decorations=[];this.opt.layout_prefix="";this.opt.layout_suffix="";this.opt.layout_delimiter="";this.opt["line-spacing"]=1;this.opt["entry-spacing"]=1;this.opt.sort_locales=[];this.opt.max_number_of_names=0;this.root="bibliography";};CSL.Engine.BibliographySort=function(){this.tokens=[];this.opt={};this.opt.sort_directions=[];this.keys=[];this.opt.topdecor=[];this.root="bibliography";};CSL.Engine.CitationSort=function(){this.tokens=[];this.opt={};this.opt.sort_directions=[];this.keys=[];this.opt.topdecor=[];this.root="citation";};module.exports=CSL;CSL.Engine.prototype.previewCitationCluster=function(citation,citationsPre,citationsPost,newMode){var oldMode=this.opt.mode;this.setOutputFormat(newMode);var ret=this.processCitationCluster(citation,citationsPre,citationsPost,CSL.PREVIEW);this.setOutputFormat(oldMode);return ret[1];};CSL.Engine.prototype.appendCitationCluster=function(citation){var citationsPre=[];var len=this.registry.citationreg.citationByIndex.length;for(var pos=0;pos<len;pos+=1){var c=this.registry.citationreg.citationByIndex[pos];citationsPre.push([""+c.citationID,c.properties.noteIndex]);}return this.processCitationCluster(citation,citationsPre,[])[1];};CSL.Engine.prototype.processCitationCluster=function(citation,citationsPre,citationsPost,flag){var c,i,ilen,j,jlen,k,klen,n,nlen,key,Item,item,noteCitations,textCitations,m,citationsInNote;this.debug=false;this.tmp.loadedItemIDs={};this.tmp.citation_errors=[];var return_data={"bibchange":false};this.setCitationId(citation);var oldCitationList;var oldItemList;var oldAmbigs;if(flag===CSL.PREVIEW){oldCitationList=this.registry.citationreg.citationByIndex.slice();oldItemList=this.registry.reflist.slice();var newCitationList=citationsPre.concat([[""+citation.citationID,citation.properties.noteIndex]]).concat(citationsPost);var newItemIds={};var newItemIdsList=[];for(var i=0,ilen=newCitationList.length;i<ilen;i+=1){c=this.registry.citationreg.citationById[newCitationList[i][0]];for(j=0,jlen=c.citationItems.length;j<jlen;j+=1){newItemIds[c.citationItems[j].id]=true;newItemIdsList.push(""+c.citationItems[j].id);}}oldAmbigs={};for(var i=0,ilen=oldItemList.length;i<ilen;i+=1){if(!newItemIds[oldItemList[i].id]){var oldAkey=this.registry.registry[oldItemList[i].id].ambig;var ids=this.registry.ambigcites[oldAkey];if(ids){for(j=0,jlen=ids.length;j<jlen;j+=1){oldAmbigs[ids[j]]=CSL.cloneAmbigConfig(this.registry.registry[ids[j]].disambig);}}}}}this.tmp.taintedCitationIDs={};var sortedItems=[];var rerunAkeys={};for(var i=0,ilen=citation.citationItems.length;i<ilen;i+=1){item={};for(var key in citation.citationItems[i]){item[key]=citation.citationItems[i][key];}Item=this.retrieveItem(""+item.id);if(Item.id){this.transform.loadAbbreviation("default","hereinafter",Item.id);}item=CSL.parseLocator.call(this,item);if(this.opt.development_extensions.static_statute_locator){this.remapSectionVariable([[Item,item]]);}if(this.opt.development_extensions.locator_label_parse){if(item.locator&&["bill","gazette","legislation","regulation","treaty"].indexOf(Item.type)===-1&&(!item.label||item.label==='page')){var m=CSL.LOCATOR_LABELS_REGEXP.exec(item.locator);if(m){var tryLabel=CSL.LOCATOR_LABELS_MAP[m[2]];if(this.getTerm(tryLabel)){item.label=tryLabel;item.locator=m[3];}}}}var newitem=[Item,item];sortedItems.push(newitem);citation.citationItems[i].item=Item;}citation.sortedItems=sortedItems;var citationByIndex=[];for(var i=0,ilen=citationsPre.length;i<ilen;i+=1){c=citationsPre[i];try{this.registry.citationreg.citationById[c[0]].properties.noteIndex=c[1];}catch(e){var err="CSL error\n";err+=" "+e+"\n";err+=" citationID="+c[0]+"\n";err+=" noteIndex="+c[1]+"\n";err+=" atarray citationsPre index "+i+", from citation at document position "+citationsPre.length;throw err;}citationByIndex.push(this.registry.citationreg.citationById[c[0]]);}citationByIndex.push(citation);for(var i=0,ilen=citationsPost.length;i<ilen;i+=1){c=citationsPost[i];try{this.registry.citationreg.citationById[c[0]].properties.noteIndex=c[1];}catch(e){var err="CSL error\n";err+=" "+e+"\n";err+=" citationID="+c[0]+"\n";err+=" noteIndex="+c[1]+"\n";err+=" at array citationsPost index "+i+", from citation at document position "+citationsPre.length;throw err;}citationByIndex.push(this.registry.citationreg.citationById[c[0]]);}this.registry.citationreg.citationByIndex=citationByIndex;this.registry.citationreg.citationsByItemId={};if(this.opt.update_mode===CSL.POSITION){textCitations=[];noteCitations=[];citationsInNote={};}var update_items=[];for(var i=0,ilen=citationByIndex.length;i<ilen;i+=1){if(!citationByIndex[i].properties){citationByIndex[i].properties={};}citationByIndex[i].properties.index=i;for(j=0,jlen=citationByIndex[i].sortedItems.length;j<jlen;j+=1){item=citationByIndex[i].sortedItems[j];if(!this.registry.citationreg.citationsByItemId[item[1].id]){this.registry.citationreg.citationsByItemId[item[1].id]=[];update_items.push(""+item[1].id);}if(this.registry.citationreg.citationsByItemId[item[1].id].indexOf(citationByIndex[i])===-1){this.registry.citationreg.citationsByItemId[item[1].id].push(citationByIndex[i]);}}if(this.opt.update_mode===CSL.POSITION){if(citationByIndex[i].properties.noteIndex){noteCitations.push(citationByIndex[i]);}else{citationByIndex[i].properties.noteIndex=0;textCitations.push(citationByIndex[i]);}}}if(flag!==CSL.ASSUME_ALL_ITEMS_REGISTERED){this.updateItems(update_items,null,null,true);}if(!this.opt.citation_number_sort&&sortedItems&&sortedItems.length>1&&this.citation_sort.tokens.length>0){for(var i=0,ilen=sortedItems.length;i<ilen;i+=1){sortedItems[i][1].sortkeys=CSL.getSortKeys.call(this,sortedItems[i][0],"citation_sort");}if(this.opt.grouped_sort&&!citation.properties.unsorted){for(var i=0,ilen=sortedItems.length;i<ilen;i+=1){var sortkeys=sortedItems[i][1].sortkeys;this.tmp.authorstring_request=true;var mydisambig=this.registry.registry[sortedItems[i][0].id].disambig;this.tmp.authorstring_request=true;CSL.getAmbiguousCite.call(this,sortedItems[i][0],mydisambig);var authorstring=this.registry.authorstrings[sortedItems[i][0].id];this.tmp.authorstring_request=false;sortedItems[i][1].sortkeys=[authorstring].concat(sortkeys);}sortedItems.sort(this.citation.srt.compareCompositeKeys);var lastauthor=false;var thiskey=false;var thisauthor=false;for(var i=0,ilen=sortedItems.length;i<ilen;i+=1){if(sortedItems[i][1].sortkeys[0]!==lastauthor){thisauthor=sortedItems[i][1].sortkeys[0];thiskey=sortedItems[i][1].sortkeys[1];}sortedItems[i][1].sortkeys[0]=""+thiskey+i;lastauthor=thisauthor;}}if(!citation.properties.unsorted){sortedItems.sort(this.citation.srt.compareCompositeKeys);}}var citations;if(this.opt.update_mode===CSL.POSITION){for(var i=0;i<2;i+=1){citations=[textCitations,noteCitations][i];var first_ref={};var last_ref={};for(j=0,jlen=citations.length;j<jlen;j+=1){var onecitation=citations[j];if(!citations[j].properties.noteIndex){citations[j].properties.noteIndex=0;}citations[j].properties.noteIndex=parseInt(citations[j].properties.noteIndex,10);if(j>0&&citations[j-1].properties.noteIndex>citations[j].properties.noteIndex){citationsInNote={};first_ref={};last_ref={};}for(k=0,klen=onecitation.sortedItems.length;k<klen;k+=1){if(!this.registry.registry[onecitation.sortedItems[k][1].id].parallel){if(!citationsInNote[onecitation.properties.noteIndex]){citationsInNote[onecitation.properties.noteIndex]=1;}else{citationsInNote[onecitation.properties.noteIndex]+=1;}}}for(k=0,klen=citations[j].sortedItems.length;k<klen;k+=1){item=citations[j].sortedItems[k];var myid=item[0].id;var mylocator=item[1].locator;var mylabel=item[1].label;if(item[0].legislation_id){myid=item[0].legislation_id;}var incitationid;if(k>0){if(onecitation.sortedItems[k-1][0].legislation_id){incitationid=onecitation.sortedItems[k-1][0].legislation_id;}else{incitationid=onecitation.sortedItems[k-1][1].id;}}if(flag===CSL.PREVIEW){if(onecitation.citationID!=citation.citationID){if("undefined"===typeof first_ref[item[1].id]){first_ref[myid]=onecitation.properties.noteIndex;last_ref[myid]=onecitation.properties.noteIndex;}else{last_ref[myid]=onecitation.properties.noteIndex;}continue;}}var oldvalue={};oldvalue.position=item[1].position;oldvalue["first-reference-note-number"]=item[1]["first-reference-note-number"];oldvalue["near-note"]=item[1]["near-note"];item[1]["first-reference-note-number"]=0;item[1]["near-note"]=false;if(this.registry.citationreg.citationsByItemId[myid]){if(this.opt.xclass==='note'&&this.opt.has_disambiguate){var oldCount=this.registry.registry[myid]["citation-count"];var newCount=this.registry.citationreg.citationsByItemId[myid].length;this.registry.registry[myid]["citation-count"]=this.registry.citationreg.citationsByItemId[myid].length;if("number"===typeof oldCount){var oldCountCheck=oldCount<2;var newCountCheck=newCount<2;if(oldCountCheck!==newCountCheck){for(var l=0,llen=this.registry.citationreg.citationsByItemId[myid].length;l<llen;l++){rerunAkeys[this.registry.registry[myid].ambig]=true;this.tmp.taintedCitationIDs[this.registry.citationreg.citationsByItemId[myid][l].citationID]=true;}}}else{for(var l=0,llen=this.registry.citationreg.citationsByItemId[myid].length;l<llen;l++){rerunAkeys[this.registry.registry[myid].ambig]=true;this.tmp.taintedCitationIDs[this.registry.citationreg.citationsByItemId[myid][l].citationID]=true;}}}}var oldlastid;if("undefined"===typeof first_ref[myid]){first_ref[myid]=onecitation.properties.noteIndex;if(this.registry.registry[myid]){this.registry.registry[myid]['first-reference-note-number']=onecitation.properties.noteIndex;}last_ref[myid]=onecitation.properties.noteIndex;item[1].position=CSL.POSITION_FIRST;}else{var ibidme=false;var suprame=false;if(j>0){try{oldlastid=citations[j-1].sortedItems.slice(-1)[0][1].id;}catch(e){var err="CSL Error\n";err+=" "+e;err+=" in citation object "+citations[j-1].citationID+" at index "+(j-1);throw err;}if(citations[j-1].sortedItems[0].slice(-1)[0].legislation_id){oldlastid=citations[j-1].sortedItems[0].slice(-1)[0].legislation_id;}}if(j>0&&parseInt(k,10)===0&&citations[j-1].properties.noteIndex!==citations[j].properties.noteIndex){var items=citations[j-1].sortedItems;var useme=false;var oldid=citations[j-1].sortedItems[0][0].id;if(citations[j-1].sortedItems[0][0].legislation_id){oldid=citations[j-1].sortedItems[0][0].legislation_id;}if(oldid==myid&&citations[j-1].properties.noteIndex>=citations[j].properties.noteIndex-1||citations[j-1].sortedItems[0][1].id==this.registry.registry[item[1].id].parallel){if(citationsInNote[citations[j-1].properties.noteIndex]===1||citations[j-1].properties.noteIndex===0){useme=true;}}for(n=0,nlen=items.slice(1).length;n<nlen;n+=1){var itmp=items.slice(1)[n];if(!this.registry.registry[itmp[1].id].parallel||this.registry.registry[itmp[1].id].parallel==this.registry.registry[itmp[1].id]){useme=false;}}if(useme){ibidme=true;}else{suprame=true;}}else if(k>0&&incitationid==myid){ibidme=true;}else if(k===0&&citations[j-1].properties.noteIndex==citations[j].properties.noteIndex&&citations[j-1].sortedItems.length&&oldlastid==myid){ibidme=true;}else{suprame=true;}var prev,prev_locator,prev_label,curr_locator,curr_label;if(ibidme){if(k>0){prev=onecitation.sortedItems[k-1][1];}else{prev=citations[j-1].sortedItems[0][1];}if(prev.locator){if(prev.label){prev_label=prev.label;}else{prev_label="";}prev_locator=""+prev.locator+prev_label;}else{prev_locator=prev.locator;}if(mylocator){if(mylabel){curr_label=mylabel;}else{curr_label="";}curr_locator=""+mylocator+curr_label;}else{curr_locator=mylocator;}}if(ibidme&&prev_locator&&!curr_locator){ibidme=false;suprame=true;}if(ibidme){if(!prev_locator&&curr_locator){item[1].position=CSL.POSITION_IBID_WITH_LOCATOR;}else if(!prev_locator&&!curr_locator){item[1].position=CSL.POSITION_IBID;}else if(prev_locator&&curr_locator===prev_locator){item[1].position=CSL.POSITION_IBID;}else if(prev_locator&&curr_locator&&curr_locator!==prev_locator){item[1].position=CSL.POSITION_IBID_WITH_LOCATOR;}else{ibidme=false;suprame=true;}}if(suprame){item[1].position=CSL.POSITION_SUBSEQUENT;}if(suprame||ibidme){if(first_ref[myid]!=onecitation.properties.noteIndex){item[1]["first-reference-note-number"]=first_ref[myid];if(this.registry.registry[myid]){var oldFirst=this.registry.citationreg.citationsByItemId[myid][0].properties.noteIndex;var newFirst=onecitation.properties.noteIndex;this.registry.registry[myid]['first-reference-note-number']=newFirst<oldFirst?newFirst:oldFirst;}}}}if(onecitation.properties.noteIndex){var note_distance=parseInt(onecitation.properties.noteIndex,10)-parseInt(last_ref[myid],10);if(item[1].position!==CSL.POSITION_FIRST&¬e_distance<=this.citation.opt["near-note-distance"]){item[1]["near-note"]=true;}last_ref[myid]=onecitation.properties.noteIndex;}if(onecitation.citationID!=citation.citationID){for(n=0,nlen=CSL.POSITION_TEST_VARS.length;n<nlen;n+=1){var param=CSL.POSITION_TEST_VARS[n];if(item[1][param]!==oldvalue[param]){if(this.registry.registry[myid]){if(param==='first-reference-note-number'){rerunAkeys[this.registry.registry[myid].ambig]=true;this.tmp.taintedItemIDs[myid]=true;}}this.tmp.taintedCitationIDs[onecitation.citationID]=true;}}}if(this.sys.variableWrapper){item[1].index=onecitation.properties.index;item[1].noteIndex=onecitation.properties.noteIndex;}}}}}if(this.opt.citation_number_sort&&sortedItems&&sortedItems.length>1&&this.citation_sort.tokens.length>0){if(!citation.properties.unsorted){for(var i=0,ilen=sortedItems.length;i<ilen;i+=1){sortedItems[i][1].sortkeys=CSL.getSortKeys.call(this,sortedItems[i][0],"citation_sort");}sortedItems.sort(this.citation.srt.compareCompositeKeys);}}for(var key in this.tmp.taintedItemIDs){if(this.tmp.taintedItemIDs.hasOwnProperty(key)){citations=this.registry.citationreg.citationsByItemId[key];if(citations){for(var i=0,ilen=citations.length;i<ilen;i+=1){this.tmp.taintedCitationIDs[citations[i].citationID]=true;}}}}var ret=[];if(flag===CSL.PREVIEW){try{ret=this.process_CitationCluster.call(this,citation.sortedItems,citation.citationID);}catch(e){CSL.error("Error running CSL processor for preview: "+e);}this.registry.citationreg.citationByIndex=oldCitationList;this.registry.citationreg.citationById={};for(var i=0,ilen=oldCitationList.length;i<ilen;i+=1){this.registry.citationreg.citationById[oldCitationList[i].citationID]=oldCitationList[i];}var oldItemIds=[];for(var i=0,ilen=oldItemList.length;i<ilen;i+=1){oldItemIds.push(""+oldItemList[i].id);}this.updateItems(oldItemIds,null,null,true);for(var key in oldAmbigs){if(oldAmbigs.hasOwnProperty(key)){this.registry.registry[key].disambig=oldAmbigs[key];}}}else{for(var rerunAkey in rerunAkeys){this.disambiguate.run(rerunAkey,citation);}var obj;for(var key in this.tmp.taintedCitationIDs){if(key==citation.citationID){continue;}var mycitation=this.registry.citationreg.citationById[key];if(!mycitation.properties.unsorted){for(var i=0,ilen=mycitation.sortedItems.length;i<ilen;i+=1){mycitation.sortedItems[i][1].sortkeys=CSL.getSortKeys.call(this,mycitation.sortedItems[i][0],"citation_sort");}mycitation.sortedItems.sort(this.citation.srt.compareCompositeKeys);}this.tmp.citation_pos=mycitation.properties.index;this.tmp.citation_note_index=mycitation.properties.noteIndex;this.tmp.citation_id=""+mycitation.citationID;obj=[];obj.push(mycitation.properties.index);obj.push(this.process_CitationCluster.call(this,mycitation.sortedItems,mycitation.citationID));obj.push(mycitation.citationID);ret.push(obj);}this.tmp.taintedItemIDs={};this.tmp.taintedCitationIDs={};this.tmp.citation_pos=citation.properties.index;this.tmp.citation_note_index=citation.properties.noteIndex;this.tmp.citation_id=""+citation.citationID;obj=[];obj.push(citationsPre.length);obj.push(this.process_CitationCluster.call(this,sortedItems,citation.citationID));obj.push(citation.citationID);ret.push(obj);ret.sort(function(a,b){if(a[0]>b[0]){return 1;}else if(a[0]<b[0]){return-1;}else{return 0;}});}return_data.citation_errors=this.tmp.citation_errors.slice();return[return_data,ret];};CSL.Engine.prototype.process_CitationCluster=function(sortedItems,citationID){var str;this.parallel.StartCitation(sortedItems);str=CSL.getCitationCluster.call(this,sortedItems,citationID);return str;};CSL.Engine.prototype.makeCitationCluster=function(rawList){var inputList,newitem,str,pos,len,item,Item;inputList=[];len=rawList.length;for(pos=0;pos<len;pos+=1){item={};for(var key in rawList[pos]){item[key]=rawList[pos][key];}Item=this.retrieveItem(""+item.id);if(this.opt.development_extensions.locator_label_parse){if(item.locator&&["bill","gazette","legislation","regulation","treaty"].indexOf(Item.type)===-1&&(!item.label||item.label==='page')){var m=CSL.LOCATOR_LABELS_REGEXP.exec(item.locator);if(m){var tryLabel=CSL.LOCATOR_LABELS_MAP[m[2]];if(this.getTerm(tryLabel)){item.label=tryLabel;item.locator=m[3];}}}}if(item.locator){item.locator=(""+item.locator).replace(/\s+$/,'');}newitem=[Item,item];inputList.push(newitem);}if(this.opt.development_extensions.static_statute_locator){this.remapSectionVariable(inputList);}if(inputList&&inputList.length>1&&this.citation_sort.tokens.length>0){len=inputList.length;for(pos=0;pos<len;pos+=1){inputList[pos][1].sortkeys=CSL.getSortKeys.call(this,inputList[pos][0],"citation_sort");}inputList.sort(this.citation.srt.compareCompositeKeys);}this.tmp.citation_errors=[];this.parallel.StartCitation(inputList);str=CSL.getCitationCluster.call(this,inputList);return str;};CSL.getAmbiguousCite=function(Item,disambig,visualForm,item){var use_parallels,ret;var flags=this.tmp.group_context.tip;var oldTermSiblingLayer={term_intended:flags.term_intended,variable_attempt:flags.variable_attempt,variable_success:flags.variable_success,output_tip:flags.output_tip,label_form:flags.label_form,parallel_conditions:flags.parallel_conditions,condition:flags.condition,force_suppress:flags.force_suppress,done_vars:flags.done_vars.slice()};if(disambig){this.tmp.disambig_request=disambig;}else{this.tmp.disambig_request=false;}var itemSupp={position:1,"near-note":true};if(item){itemSupp.locator=item.locator;itemSupp.label=item.label;}if(this.registry.registry[Item.id]&&this.registry.citationreg.citationsByItemId&&this.registry.citationreg.citationsByItemId[Item.id]&&this.registry.citationreg.citationsByItemId[Item.id].length&&visualForm){if(this.citation.opt["givenname-disambiguation-rule"]==="by-cite"){itemSupp['first-reference-note-number']=this.registry.registry[Item.id]['first-reference-note-number'];}}this.tmp.area="citation";this.tmp.root="citation";this.parallel.use_parallels=this.parallel.use_parallels===true||this.parallel.use_parallels===null?null:false;this.tmp.suppress_decorations=true;this.tmp.just_looking=true;CSL.getCite.call(this,Item,itemSupp,null,false);for(var i=0,ilen=this.output.queue.length;i<ilen;i+=1){CSL.Output.Queue.purgeEmptyBlobs(this.output.queue[i]);}if(this.opt.development_extensions.clean_up_csl_flaws){for(var j=0,jlen=this.output.queue.length;j<jlen;j+=1){this.output.adjust.upward(this.output.queue[j]);this.output.adjust.leftward(this.output.queue[j]);this.output.adjust.downward(this.output.queue[j]);this.output.adjust.fix(this.output.queue[j]);}}var ret=this.output.string(this,this.output.queue);this.tmp.just_looking=false;this.tmp.suppress_decorations=false;this.parallel.use_parallels=this.parallel.use_parallels===null?true:false;this.tmp.group_context.replace(oldTermSiblingLayer);return ret;};CSL.getSpliceDelimiter=function(last_locator,last_collapsed,pos){if(undefined!==this.citation.opt["after-collapse-delimiter"]){if(last_locator){this.tmp.splice_delimiter=this.citation.opt["after-collapse-delimiter"];}else if(last_collapsed&&!this.tmp.have_collapsed){this.tmp.splice_delimiter=this.citation.opt["after-collapse-delimiter"];}else if(!last_collapsed&&!this.tmp.have_collapsed&&this.citation.opt.collapse!=="year-suffix"){this.tmp.splice_delimiter=this.citation.opt["after-collapse-delimiter"];}else{this.tmp.splice_delimiter=this.citation.opt.layout_delimiter;}}else if(this.tmp.use_cite_group_delimiter){this.tmp.splice_delimiter=this.citation.opt.cite_group_delimiter;}else{if(this.tmp.have_collapsed&&this.opt.xclass==="in-text"&&this.opt.update_mode!==CSL.NUMERIC){this.tmp.splice_delimiter=", ";}else if(this.tmp.cite_locales[pos-1]){var alt_affixes=this.tmp.cite_affixes[this.tmp.area][this.tmp.cite_locales[pos-1]];if(alt_affixes&&alt_affixes.delimiter){this.tmp.splice_delimiter=alt_affixes.delimiter;}}else if(!this.tmp.splice_delimiter){this.tmp.splice_delimiter="";}}return this.tmp.splice_delimiter;};CSL.getCitationCluster=function(inputList,citationID){var result,objects,myparams,len,pos,item,last_collapsed,params,empties,composite,compie,myblobs,Item,llen,ppos,obj,preceding_item,txt_esc,error_object;inputList=inputList?inputList:[];this.tmp.last_primary_names_string=false;txt_esc=CSL.getSafeEscape(this);this.tmp.area="citation";this.tmp.root="citation";result="";objects=[];this.tmp.last_suffix_used="";this.tmp.last_names_used=[];this.tmp.last_years_used=[];this.tmp.backref_index=[];this.tmp.cite_locales=[];this.output.checkNestedBrace=new CSL.checkNestedBrace(this);var use_layout_prefix=this.output.checkNestedBrace.update(this.citation.opt.layout_prefix);var suppressTrailingPunctuation=false;if(this.opt.xclass==="note"&&this.citation.opt.suppressTrailingPunctuation){suppressTrailingPunctuation=true;}if(citationID){if(this.registry.citationreg.citationById[citationID].properties["suppress-trailing-punctuation"]){suppressTrailingPunctuation=true;}}if(this.opt.xclass==="note"){var parasets=[];var lastTitle=false;var lastPosition=false;var lastID=false;var lst=[];for(var i=0,ilen=inputList.length;i<ilen;i+=1){var type=inputList[i][0].type;var title=inputList[i][0].title;var position=inputList[i][1].position;var id=inputList[i][0].id;if(title&&type==="legal_case"&&id!==lastID&&position){if(title!==lastTitle||parasets.length===0){lst=[];parasets.push(lst);}lst.push(inputList[i][1]);}lastTitle=title;lastPosition=position;lastID=id;}for(i=0,ilen=parasets.length;i<ilen;i+=1){lst=parasets[i];if(lst.length<2){continue;}var locatorInLastPosition=lst.slice(-1)[0].locator;if(locatorInLastPosition){for(var j=0,jlen=lst.length-1;j<jlen;j+=1){if(lst[j].locator){locatorInLastPosition=false;}}}if(locatorInLastPosition){lst[0].locator=locatorInLastPosition;delete lst.slice(-1)[0].locator;lst[0].label=lst.slice(-1)[0].label;if(lst.slice(-1)[0].label){delete lst.slice(-1)[0].label;}}}}myparams=[];len=inputList.length;for(pos=0;pos<len;pos+=1){Item=inputList[pos][0];item=inputList[pos][1];item=CSL.parseLocator.call(this,item);last_collapsed=this.tmp.have_collapsed;var last_locator=false;if(pos>0&&inputList[pos-1][1]){last_locator=!!inputList[pos-1][1].locator;}params={};this.tmp.shadow_numbers={};if(!this.tmp.just_looking&&this.opt.hasPlaceholderTerm){var output=this.output;this.output=new CSL.Output.Queue(this);this.output.adjust=new CSL.Output.Queue.adjust();CSL.getAmbiguousCite.call(this,Item,null,false,item);this.output=output;}this.tmp.in_cite_predecessor=false;if(pos>0){CSL.getCite.call(this,Item,item,""+inputList[pos-1][0].id,true);}else{this.tmp.term_predecessor=false;CSL.getCite.call(this,Item,item,null,true);}if(!this.tmp.cite_renders_content){error_object={citationID:""+this.tmp.citation_id,index:this.tmp.citation_pos,noteIndex:this.tmp.citation_note_index,itemID:""+Item.id,citationItems_pos:pos,error_code:CSL.ERROR_NO_RENDERED_FORM};this.tmp.citation_errors.push(error_object);}if(pos===inputList.length-1){this.parallel.ComposeSet();}params.splice_delimiter=CSL.getSpliceDelimiter.call(this,last_locator,last_collapsed,pos);if(item&&item["author-only"]){this.tmp.suppress_decorations=true;}if(pos>0){preceding_item=inputList[pos-1][1];var precedingEndsInPeriodOrComma=preceding_item.suffix&&[".",","].indexOf(preceding_item.suffix.slice(-1))>-1;var currentStartsWithPeriodOrComma=!preceding_item.suffix&&item.prefix&&[".",","].indexOf(item.prefix.slice(0,1))>-1;if(precedingEndsInPeriodOrComma||currentStartsWithPeriodOrComma){var spaceidx=params.splice_delimiter.indexOf(" ");if(spaceidx>-1&&!currentStartsWithPeriodOrComma){params.splice_delimiter=params.splice_delimiter.slice(spaceidx);}else{params.splice_delimiter="";}}}params.suppress_decorations=this.tmp.suppress_decorations;params.have_collapsed=this.tmp.have_collapsed;myparams.push(params);}this.tmp.has_purged_parallel=false;this.parallel.PruneOutputQueue(this);empties=0;myblobs=this.output.queue.slice();var fakeblob={strings:{suffix:this.citation.opt.layout_suffix,delimiter:this.citation.opt.layout_delimiter}};var suffix=this.citation.opt.layout_suffix;var last_locale=this.tmp.cite_locales[this.tmp.cite_locales.length-1];if(last_locale&&this.tmp.cite_affixes[this.tmp.area][last_locale]&&this.tmp.cite_affixes[this.tmp.area][last_locale].suffix){suffix=this.tmp.cite_affixes[this.tmp.area][last_locale].suffix;}if(CSL.TERMINAL_PUNCTUATION.slice(0,-1).indexOf(suffix.slice(0,1))>-1){suffix=suffix.slice(0,1);}var delimiter=this.citation.opt.layout_delimiter;if(!delimiter){delimiter="";}if(CSL.TERMINAL_PUNCTUATION.slice(0,-1).indexOf(delimiter.slice(0,1))>-1){delimiter=delimiter.slice(0,1);}suffix=this.output.checkNestedBrace.update(suffix);for(var i=0,ilen=this.output.queue.length;i<ilen;i+=1){CSL.Output.Queue.purgeEmptyBlobs(this.output.queue[i]);}if(!this.tmp.suppress_decorations&&this.output.queue.length){if(!(this.opt.development_extensions.apply_citation_wrapper&&this.sys.wrapCitationEntry&&!this.tmp.just_looking&&this.tmp.area==="citation")){if(!suppressTrailingPunctuation){this.output.queue[this.output.queue.length-1].strings.suffix=suffix;}this.output.queue[0].strings.prefix=use_layout_prefix;}}if(this.opt.development_extensions.clean_up_csl_flaws){for(var j=0,jlen=this.output.queue.length;j<jlen;j+=1){this.output.adjust.upward(this.output.queue[j]);this.output.adjust.leftward(this.output.queue[j]);this.output.adjust.downward(this.output.queue[j]);this.tmp.last_chr=this.output.adjust.fix(this.output.queue[j]);}}for(pos=0,len=myblobs.length;pos<len;pos+=1){var buffer=[];this.output.queue=[myblobs[pos]];this.tmp.suppress_decorations=myparams[pos].suppress_decorations;this.tmp.splice_delimiter=myparams[pos].splice_delimiter;if(myblobs[pos].parallel_delimiter){this.tmp.splice_delimiter=myblobs[pos].parallel_delimiter;}this.tmp.have_collapsed=myparams[pos].have_collapsed;composite=this.output.string(this,this.output.queue);this.tmp.suppress_decorations=false;if("string"===typeof composite){this.tmp.suppress_decorations=false;return composite;}if("object"===_typeof(composite)&&composite.length===0&&!item["suppress-author"]){if(this.tmp.has_purged_parallel){composite.push("");}else{var errStr="[CSL STYLE ERROR: reference with no printed form.]";var preStr=pos===0?txt_esc(this.citation.opt.layout_prefix):"";var sufStr=pos===myblobs.length-1?txt_esc(this.citation.opt.layout_suffix):"";composite.push(preStr+errStr+sufStr);}}if(buffer.length&&"string"===typeof composite[0]){composite.reverse();var tmpstr=composite.pop();if(tmpstr&&tmpstr.slice(0,1)===","){buffer.push(tmpstr);}else if("string"==typeof buffer.slice(-1)[0]&&buffer.slice(-1)[0].slice(-1)===","){buffer.push(" "+tmpstr);}else if(tmpstr){buffer.push(txt_esc(this.tmp.splice_delimiter)+tmpstr);}}else{composite.reverse();compie=composite.pop();if("undefined"!==typeof compie){if(buffer.length&&"string"===typeof buffer[buffer.length-1]){buffer[buffer.length-1]+=compie.successor_prefix;}buffer.push(compie);}}llen=composite.length;for(ppos=0;ppos<llen;ppos+=1){obj=composite[ppos];if("string"===typeof obj){buffer.push(txt_esc(this.tmp.splice_delimiter)+obj);continue;}compie=composite.pop();if("undefined"!==typeof compie){buffer.push(compie);}}if(buffer.length===0&&!inputList[pos][1]["suppress-author"]){empties+=1;}if(buffer.length>1&&typeof buffer[0]!=="string"){buffer=[this.output.renderBlobs(buffer)];}if(buffer.length){if("string"===typeof buffer[0]){if(pos>0){buffer[0]=txt_esc(this.tmp.splice_delimiter)+buffer[0];}}else{if(pos>0){buffer[0].splice_prefix=this.tmp.splice_delimiter;}else{buffer[0].splice_prefix="";}}}objects=objects.concat(buffer);}result+=this.output.renderBlobs(objects);if(result){if(!this.tmp.suppress_decorations){len=this.citation.opt.layout_decorations.length;for(pos=0;pos<len;pos+=1){params=this.citation.opt.layout_decorations[pos];if(params[1]==="normal"){continue;}if(!item||!item["author-only"]){result=this.fun.decorate[params[0]][params[1]](this,result);}}}}this.tmp.suppress_decorations=false;return result;};CSL.getCite=function(Item,item,prevItemID,blockShadowNumberReset){var next,error_object;this.tmp.cite_renders_content=false;this.parallel.StartCite(Item,item,prevItemID);CSL.citeStart.call(this,Item,item,blockShadowNumberReset);next=0;this.tmp.name_node={};this.nameOutput=new CSL.NameOutput(this,Item,item);while(next<this[this.tmp.area].tokens.length){next=CSL.tokenExec.call(this,this[this.tmp.area].tokens[next],Item,item);}CSL.citeEnd.call(this,Item,item);this.parallel.CloseCite(this);if(!this.tmp.cite_renders_content&&!this.tmp.just_looking){if(this.tmp.area==="bibliography"){error_object={index:this.tmp.bibliography_pos,itemID:""+Item.id,error_code:CSL.ERROR_NO_RENDERED_FORM};this.tmp.bibliography_errors.push(error_object);}}return""+Item.id;};CSL.citeStart=function(Item,item,blockShadowNumberReset){if(!blockShadowNumberReset){this.tmp.shadow_numbers={};}this.tmp.disambiguate_count=0;this.tmp.disambiguate_maxMax=0;this.tmp.same_author_as_previous_cite=false;if(!this.tmp.suppress_decorations){this.tmp.subsequent_author_substitute_ok=true;}else{this.tmp.subsequent_author_substitute_ok=false;}this.tmp.lastchr="";if(this.tmp.area==="citation"&&this.citation.opt.collapse&&this.citation.opt.collapse.length){this.tmp.have_collapsed=true;}else{this.tmp.have_collapsed=false;}this.tmp.render_seen=false;if(this.tmp.disambig_request&&!this.tmp.disambig_override){this.tmp.disambig_settings=this.tmp.disambig_request;}else if(this.registry.registry[Item.id]&&!this.tmp.disambig_override){this.tmp.disambig_request=this.registry.registry[Item.id].disambig;this.tmp.disambig_settings=this.registry.registry[Item.id].disambig;}else{this.tmp.disambig_settings=new CSL.AmbigConfig();}if(this.tmp.area!=='citation'){if(!this.registry.registry[Item.id]){this.tmp.disambig_restore=new CSL.AmbigConfig();}else{this.tmp.disambig_restore=CSL.cloneAmbigConfig(this.registry.registry[Item.id].disambig);if(this.tmp.area==='bibliography'&&this.tmp.disambig_settings&&this.tmp.disambig_override){if(this.opt["disambiguate-add-names"]){this.tmp.disambig_settings.names=this.registry.registry[Item.id].disambig.names.slice();if(this.tmp.disambig_request){this.tmp.disambig_request.names=this.registry.registry[Item.id].disambig.names.slice();}}if(this.opt["disambiguate-add-givenname"]){this.tmp.disambig_request=this.tmp.disambig_settings;this.tmp.disambig_settings.givens=this.registry.registry[Item.id].disambig.givens.slice();this.tmp.disambig_request.givens=this.registry.registry[Item.id].disambig.givens.slice();for(var i=0,ilen=this.tmp.disambig_settings.givens.length;i<ilen;i+=1){this.tmp.disambig_settings.givens[i]=this.registry.registry[Item.id].disambig.givens[i].slice();}for(var i=0,ilen=this.tmp.disambig_request.givens.length;i<ilen;i+=1){this.tmp.disambig_request.givens[i]=this.registry.registry[Item.id].disambig.givens[i].slice();}}}}}this.tmp.names_used=[];this.tmp.nameset_counter=0;this.tmp.years_used=[];this.tmp.names_max.clear();this.tmp.splice_delimiter=this[this.tmp.area].opt.layout_delimiter;this.bibliography_sort.keys=[];this.citation_sort.keys=[];this.tmp.has_done_year_suffix=false;this.tmp.last_cite_locale=false;if(!this.tmp.just_looking&&item&&!item.position&&this.registry.registry[Item.id]){this.tmp.disambig_restore=CSL.cloneAmbigConfig(this.registry.registry[Item.id].disambig);}this.tmp.first_name_string=false;this.tmp.authority_stop_last=0;};CSL.citeEnd=function(Item,item){if(this.tmp.disambig_restore&&this.registry.registry[Item.id]){this.registry.registry[Item.id].disambig.names=this.tmp.disambig_restore.names.slice();this.registry.registry[Item.id].disambig.givens=this.tmp.disambig_restore.givens.slice();for(var i=0,ilen=this.registry.registry[Item.id].disambig.givens.length;i<ilen;i+=1){this.registry.registry[Item.id].disambig.givens[i]=this.tmp.disambig_restore.givens[i].slice();}}this.tmp.disambig_restore=false;if(item&&item.suffix){this.tmp.last_suffix_used=item.suffix;}else{this.tmp.last_suffix_used="";}this.tmp.last_years_used=this.tmp.years_used.slice();this.tmp.last_names_used=this.tmp.names_used.slice();this.tmp.cut_var=false;this.tmp.disambig_request=false;this.tmp.cite_locales.push(this.tmp.last_cite_locale);if(this.tmp.issued_date&&this.tmp.renders_collection_number){var buf=[];for(var i=this.tmp.issued_date.list.length-1;i>this.tmp.issued_date.pos;i+=-1){buf.push(this.tmp.issued_date.list.pop());}this.tmp.issued_date.list.pop();for(i=buf.length-1;i>-1;i+=-1){this.tmp.issued_date.list.push(buf.pop());}if(this.parallel.use_parallels){this.parallel.cite["issued"]=false;}}this.tmp.issued_date=false;this.tmp.renders_collection_number=false;};module.exports=CSL;CSL.Engine.prototype.makeBibliography=function(bibsection){var debug,ret,params,maxoffset,item,len,pos,tok,tokk,tokkk,entry_ids,entry_strings,bibliography_errors;debug=false;if(!this.bibliography.tokens.length){return false;}if("string"===typeof bibsection){this.opt.citation_number_slug=bibsection;bibsection=false;}ret=CSL.getBibliographyEntries.call(this,bibsection);entry_ids=ret[0];entry_strings=ret[1];var done=ret[2];params={"maxoffset":0,"entryspacing":this.bibliography.opt["entry-spacing"],"linespacing":this.bibliography.opt["line-spacing"],"second-field-align":false,"entry_ids":entry_ids,"bibliography_errors":this.tmp.bibliography_errors.slice(),"done":done};if(this.bibliography.opt["second-field-align"]){params["second-field-align"]=this.bibliography.opt["second-field-align"];}maxoffset=0;len=this.registry.reflist.length;for(pos=0;pos<len;pos+=1){item=this.registry.reflist[pos];if(item.offset>params.maxoffset){params.maxoffset=item.offset;}}if(this.bibliography.opt.hangingindent){params.hangingindent=this.bibliography.opt.hangingindent;}params.bibstart=this.fun.decorate.bibstart;params.bibend=this.fun.decorate.bibend;this.opt.citation_number_slug=false;return[params,entry_strings];};CSL.getBibliographyEntries=function(bibsection){var ret,input,include,anymatch,allmatch,bib_entry,res,len,pos,item,llen,ppos,spec,lllen,pppos,bib_layout,topblobs,all_item_ids,entry_item_ids,debug,collapse_parallel,i,ilen,siblings,skips,sortedItems,eyetem,chr,entry_item_data,j,jlen,newIDs,originalIDs;ret=[];entry_item_data=[];this.tmp.area="bibliography";this.tmp.root="bibliography";this.tmp.last_rendered_name=false;this.tmp.bibliography_errors=[];this.tmp.bibliography_pos=0;if(bibsection&&bibsection.page_start&&bibsection.page_length){input=this.registry.getSortedIds();}else{input=this.retrieveItems(this.registry.getSortedIds());}this.tmp.disambig_override=true;function eval_string(a,b){if(a===b){return true;}return false;}function eval_list(a,lst){lllen=lst.length;for(pppos=0;pppos<lllen;pppos+=1){if(eval_string(a,lst[pppos])){return true;}}return false;}function eval_spec(a,b){if((a==="none"||!a)&&!b){return true;}if("string"===typeof b){return eval_string(a,b);}else if(!b){return false;}else{return eval_list(a,b);}}skips={};var page_item_count;if(bibsection&&bibsection.page_start&&bibsection.page_length){page_item_count=0;if(bibsection.page_start!==true){for(var i=0,ilen=input.length;i<ilen;i+=1){skips[input[i]]=true;if(bibsection.page_start==input[i]){break;}}}}var processed_item_ids=[];for(var i=0,ilen=input.length;i<ilen;i+=1){if(bibsection&&bibsection.page_start&&bibsection.page_length){if(skips[input[i]]){continue;}item=this.retrieveItem(input[i]);if(page_item_count===bibsection.page_length){break;}}else{item=input[i];if(skips[item.id]){continue;}}if(bibsection){include=true;if(bibsection.include){include=false;for(j=0,jlen=bibsection.include.length;j<jlen;j+=1){spec=bibsection.include[j];if(eval_spec(spec.value,item[spec.field])){include=true;break;}}}else if(bibsection.exclude){anymatch=false;for(j=0,jlen=bibsection.exclude.length;j<jlen;j+=1){spec=bibsection.exclude[j];if(eval_spec(spec.value,item[spec.field])){anymatch=true;break;}}if(anymatch){include=false;}}else if(bibsection.select){include=false;allmatch=true;for(j=0,jlen=bibsection.select.length;j<jlen;j+=1){spec=bibsection.select[j];if(!eval_spec(spec.value,item[spec.field])){allmatch=false;}}if(allmatch){include=true;}}if(bibsection.quash){allmatch=true;for(j=0,jlen=bibsection.quash.length;j<jlen;j+=1){spec=bibsection.quash[j];if(!eval_spec(spec.value,item[spec.field])){allmatch=false;}}if(allmatch){include=false;}}if(!include){continue;}}bib_entry=new CSL.Token("group",CSL.START);bib_entry.decorations=[["@bibliography","entry"]].concat(this.bibliography.opt.layout_decorations);this.output.startTag("bib_entry",bib_entry);if(item.system_id&&this.sys.embedBibliographyEntry){this.output.current.value().item_id=item.system_id;}else{this.output.current.value().system_id=item.id;}sortedItems=[[{id:""+item.id},item]];entry_item_ids=[];if(this.registry.registry[item.id].master&&!(bibsection&&bibsection.page_start&&bibsection.page_length)){collapse_parallel=true;this.parallel.StartCitation(sortedItems);this.output.queue[0].strings.delimiter=", ";this.tmp.term_predecessor=false;entry_item_ids.push(""+CSL.getCite.call(this,item));skips[item.id]=true;siblings=this.registry.registry[item.id].siblings;for(j=0,jlen=siblings.length;j<jlen;j+=1){var k=this.registry.registry[item.id].siblings[j];eyetem=this.retrieveItem(k);entry_item_ids.push(""+CSL.getCite.call(this,eyetem));skips[eyetem.id]=true;}this.parallel.ComposeSet();this.parallel.PruneOutputQueue();}else if(!this.registry.registry[item.id].siblings){this.parallel.StartCitation(sortedItems);this.tmp.term_predecessor=false;entry_item_ids.push(""+CSL.getCite.call(this,item));if(bibsection&&bibsection.page_start&&bibsection.page_length){page_item_count+=1;}}entry_item_data.push("");this.tmp.bibliography_pos+=1;processed_item_ids.push(entry_item_ids);this.output.endTag("bib_entry");if(this.output.queue[0].blobs.length&&this.output.queue[0].blobs[0].blobs.length){if(collapse_parallel||!this.output.queue[0].blobs[0].blobs[0].strings){topblobs=this.output.queue[0].blobs;collapse_parallel=false;}else{topblobs=this.output.queue[0].blobs[0].blobs;}topblobs[0].strings.prefix=this.bibliography.opt.layout_prefix+topblobs[0].strings.prefix;}for(var j=0,jlen=this.output.queue.length;j<jlen;j+=1){CSL.Output.Queue.purgeEmptyBlobs(this.output.queue[j]);}for(var j=0,jlen=this.output.queue.length;j<jlen;j+=1){this.output.adjust.upward(this.output.queue[j]);this.output.adjust.leftward(this.output.queue[j]);this.output.adjust.downward(this.output.queue[j],true);this.output.adjust.fix(this.output.queue[j]);}var res=this.output.string(this,this.output.queue)[0];if(!res&&this.opt.update_mode===CSL.NUMERIC){var err=ret.length+1+". [CSL STYLE ERROR: reference with no printed form.]";res=CSL.Output.Formats[this.opt.mode]["@bibliography/entry"](this,err);}if(res){ret.push(res);}}var done=false;if(bibsection&&bibsection.page_start&&bibsection.page_length){var last_expected_id=input.slice(-1)[0];var last_seen_id=processed_item_ids.slice(-1)[0];if(!last_expected_id||!last_seen_id||last_expected_id==last_seen_id){done=true;}}this.tmp.disambig_override=false;return[processed_item_ids,ret,done];};module.exports=CSL;CSL.Engine.prototype.setCitationId=function(citation,force){var ret,id,direction;ret=false;if(!citation.citationID||force){id=Math.floor(Math.random()*100000000000000);while(true){direction=0;if(!this.registry.citationreg.citationById[id]){citation.citationID="a"+id.toString(32);break;}else if(!direction&&id<50000000000000){direction=1;}else{direction=-1;}if(direction===1){id+=1;}else{id+=-1;}}ret=""+id;}this.registry.citationreg.citationById[citation.citationID]=citation;return ret;};module.exports=CSL;CSL.Engine.prototype.rebuildProcessorState=function(citations,mode,uncitedItemIDs){if(!citations){citations=[];}if(!mode){mode='html';}var doneIDs={};var itemIDs=[];for(var i=0,ilen=citations.length;i<ilen;i+=1){for(var j=0,jlen=citations[i].citationItems.length;j<jlen;j+=1){var itemID=""+citations[i].citationItems[j].id;if(!doneIDs[itemID]){itemIDs.push(itemID);}doneIDs[itemID]=true;}}this.updateItems(itemIDs);var pre=[];var post=[];var ret=[];var oldMode=this.opt.mode;this.setOutputFormat(mode);for(var i=0,ilen=citations.length;i<ilen;i+=1){var res=this.processCitationCluster(citations[i],pre,post,CSL.ASSUME_ALL_ITEMS_REGISTERED);pre.push([citations[i].citationID,citations[i].properties.noteIndex]);for(var j=0,jlen=res[1].length;j<jlen;j+=1){var index=res[1][j][0];ret[index]=[pre[index][0],pre[index][1],res[1][j][1]];}}this.updateUncitedItems(uncitedItemIDs);this.setOutputFormat(oldMode);return ret;};CSL.Engine.prototype.restoreProcessorState=function(citations){var i,ilen,j,jlen,item,Item,newitem,citationList,itemList,sortedItems;citationList=[];itemList=[];if(!citations){citations=[];}var indexNumbers=[];var citationIds={};for(i=0,ilen=citations.length;i<ilen;i+=1){if(citationIds[citations[i].citationID]){this.setCitationId(citations[i],true);}citationIds[citations[i].citationID]=true;indexNumbers.push(citations[i].properties.index);}var oldCitations=citations.slice();oldCitations.sort(function(a,b){if(a.properties.index<b.properties.index){return-1;}else if(a.properties.index>b.properties.index){return 1;}else{return 0;}});for(i=0,ilen=oldCitations.length;i<ilen;i+=1){oldCitations[i].properties.index=i;}for(i=0,ilen=oldCitations.length;i<ilen;i+=1){sortedItems=[];for(j=0,jlen=oldCitations[i].citationItems.length;j<jlen;j+=1){item=oldCitations[i].citationItems[j];if("undefined"===typeof item.sortkeys){item.sortkeys=[];}Item=this.retrieveItem(""+item.id);newitem=[Item,item];sortedItems.push(newitem);oldCitations[i].citationItems[j].item=Item;itemList.push(""+item.id);}if(!oldCitations[i].properties.unsorted){sortedItems.sort(this.citation.srt.compareCompositeKeys);}oldCitations[i].sortedItems=sortedItems;this.registry.citationreg.citationById[oldCitations[i].citationID]=oldCitations[i];}this.updateItems(itemList);for(i=0,ilen=citations.length;i<ilen;i+=1){citationList.push([""+citations[i].citationID,citations[i].properties.noteIndex]);}var ret=[];if(citations&&citations.length){ret=this.processCitationCluster(citations[0],[],citationList.slice(1));}else{this.registry=new CSL.Registry(this);this.tmp=new CSL.Engine.Tmp();this.disambiguate=new CSL.Disambiguation(this);}return ret;};CSL.Engine.prototype.updateItems=function(idList,nosort,rerun_ambigs,implicitUpdate){var debug=false;var oldArea=this.tmp.area;var oldRoot=this.tmp.root;var oldExtension=this.tmp.extension;if(this.bibliography_sort.tokens.length===0){nosort=true;}this.tmp.area="citation";this.tmp.root="citation";this.tmp.extension="";if(!implicitUpdate){this.tmp.loadedItemIDs={};}this.registry.init(idList);if(rerun_ambigs){for(var ambig in this.registry.ambigcites){this.registry.ambigsTouched[ambig]=true;}}this.registry.dodeletes(this.registry.myhash);this.registry.doinserts(this.registry.mylist);this.registry.dorefreshes();this.registry.rebuildlist(nosort);this.registry.setsortkeys();this.registry.setdisambigs();this.registry.sorttokens(nosort);this.registry.renumber();this.tmp.extension=oldExtension;this.tmp.area=oldArea;this.tmp.root=oldRoot;return this.registry.getSortedIds();};CSL.Engine.prototype.updateUncitedItems=function(idList,nosort){var idHash;var debug=false;var oldArea=this.tmp.area;var oldRoot=this.tmp.root;var oldExtension=this.tmp.extension;if(this.bibliography_sort.tokens.length===0){nosort=true;}this.tmp.area="citation";this.tmp.root="citation";this.tmp.extension="";this.tmp.loadedItemIDs={};if(!idList){idList=[];}if("object"==_typeof(idList)){if("undefined"==typeof idList.length){idHash=idList;idList=[];for(var key in idHash){idList.push(key);}}else if("number"==typeof idList.length){idHash={};for(var i=0,ilen=idList.length;i<ilen;i+=1){idHash[idList[i]]=true;}}}this.registry.init(idList,true);this.registry.dopurge(idHash);this.registry.doinserts(this.registry.mylist);this.registry.dorefreshes();this.registry.rebuildlist(nosort);this.registry.setsortkeys();this.registry.setdisambigs();this.registry.sorttokens(nosort);this.registry.renumber();this.tmp.extension=oldExtension;this.tmp.area=oldArea;this.tmp.root=oldRoot;return this.registry.getSortedIds();};module.exports=CSL;CSL.localeResolve=function(langstr,defaultLocale){var ret,langlst;if(!defaultLocale){defaultLocale="en-US";}if(!langstr){langstr=defaultLocale;}ret={};langlst=langstr.split(/[\-_]/);ret.base=CSL.LANG_BASES[langlst[0]];if("undefined"===typeof ret.base){return{base:defaultLocale,best:langstr,bare:langlst[0]};}if(langlst.length===1){ret.generic=true;}if(langlst.length===1||langlst[1]==="x"){ret.best=ret.base.replace("_","-");}else{ret.best=langlst.slice(0,2).join("-");}ret.base=ret.base.replace("_","-");ret.bare=langlst[0];return ret;};CSL.Engine.prototype.localeConfigure=function(langspec,beShy){var localexml;if(beShy&&this.locale[langspec.best]){return;}if(langspec.best==="en-US"){localexml=CSL.setupXml(this.sys.retrieveLocale("en-US"));this.localeSet(localexml,"en-US",langspec.best);}else if(langspec.best!=="en-US"){if(langspec.base!==langspec.best){localexml=CSL.setupXml(this.sys.retrieveLocale(langspec.base));this.localeSet(localexml,langspec.base,langspec.best);}localexml=CSL.setupXml(this.sys.retrieveLocale(langspec.best));this.localeSet(localexml,langspec.best,langspec.best);}this.localeSet(this.cslXml,"",langspec.best);this.localeSet(this.cslXml,langspec.bare,langspec.best);if(langspec.base!==langspec.best){this.localeSet(this.cslXml,langspec.base,langspec.best);}this.localeSet(this.cslXml,langspec.best,langspec.best);if("undefined"===typeof this.locale[langspec.best].terms["page-range-delimiter"]){if(["fr","pt"].indexOf(langspec.best.slice(0,2).toLowerCase())>-1){this.locale[langspec.best].terms["page-range-delimiter"]="-";}else{this.locale[langspec.best].terms["page-range-delimiter"]="\u2013";}}if("undefined"===typeof this.locale[langspec.best].terms["year-range-delimiter"]){this.locale[langspec.best].terms["year-range-delimiter"]="\u2013";}if("undefined"===typeof this.locale[langspec.best].terms["citation-range-delimiter"]){this.locale[langspec.best].terms["citation-range-delimiter"]="\u2013";}if(this.opt.development_extensions.normalize_lang_keys_to_lowercase){var localeLists=["default-locale","locale-sort","locale-translit","locale-translat"];for(var i=0,ilen=localeLists.length;i<ilen;i+=1){for(var j=0,jlen=this.opt[localeLists[i]].length;j<jlen;j+=1){this.opt[localeLists[i]][j]=this.opt[localeLists[i]][j].toLowerCase();}}this.opt.lang=this.opt.lang.toLowerCase();}};CSL.Engine.prototype.localeSet=function(myxml,lang_in,lang_out){var blob,locale,nodes,attributes,pos,ppos,term,form,termname,styleopts,attr,date,attrname,len,genderform,target,i,ilen;lang_in=lang_in.replace("_","-");lang_out=lang_out.replace("_","-");if(this.opt.development_extensions.normalize_lang_keys_to_lowercase){lang_in=lang_in.toLowerCase();lang_out=lang_out.toLowerCase();}if(!this.locale[lang_out]){this.locale[lang_out]={};this.locale[lang_out].terms={};this.locale[lang_out].opts={};this.locale[lang_out].opts["skip-words"]=CSL.SKIP_WORDS;if(!this.locale[lang_out].opts["leading-noise-words"]){this.locale[lang_out].opts["leading-noise-words"]=[];}this.locale[lang_out].dates={};this.locale[lang_out].ord={'1.0.1':false,keys:{}};this.locale[lang_out]["noun-genders"]={};}locale=myxml.makeXml();if(myxml.nodeNameIs(myxml.dataObj,'locale')){locale=myxml.dataObj;}else{nodes=myxml.getNodesByName(myxml.dataObj,"locale");for(pos=0,len=myxml.numberofnodes(nodes);pos<len;pos+=1){blob=nodes[pos];if(myxml.getAttributeValue(blob,'lang','xml')===lang_in){locale=blob;break;}}}nodes=myxml.getNodesByName(locale,'type');for(i=0,ilen=myxml.numberofnodes(nodes);i<ilen;i+=1){var typenode=nodes[i];var type=myxml.getAttributeValue(typenode,'name');var gender=myxml.getAttributeValue(typenode,'gender');this.opt.gender[type]=gender;}var hasCslOrdinals101=myxml.getNodesByName(locale,'term','ordinal').length;if(hasCslOrdinals101){for(var key in this.locale[lang_out].ord.keys){delete this.locale[lang_out].terms[key];}this.locale[lang_out].ord={"1.0.1":false,keys:{}};}nodes=myxml.getNodesByName(locale,'term');var ordinals101={"last-digit":{},"last-two-digits":{},"whole-number":{}};var ordinals101_toggle=false;var genderized_terms={};for(pos=0,len=myxml.numberofnodes(nodes);pos<len;pos+=1){term=nodes[pos];termname=myxml.getAttributeValue(term,'name');if(termname==="sub verbo"){termname="sub-verbo";}if(termname.slice(0,7)==="ordinal"){var termstring=myxml.getNodeValue(term);if(termname==="ordinal"){ordinals101_toggle=true;}else{var match=myxml.getAttributeValue(term,'match');var termstub=termname.slice(8);var genderform=myxml.getAttributeValue(term,'gender-form');if(!genderform){genderform="neuter";}if(!match){match="last-two-digits";if(termstub.slice(0,1)==="0"){match="last-digit";}}if(termstub.slice(0,1)==="0"){termstub=termstub.slice(1);}if(!ordinals101[match][termstub]){ordinals101[match][termstub]={};}ordinals101[match][termstub][genderform]=termname;}this.locale[lang_out].ord.keys[termname]=true;}if("undefined"===typeof this.locale[lang_out].terms[termname]){this.locale[lang_out].terms[termname]={};}form="long";genderform=false;if(myxml.getAttributeValue(term,'form')){form=myxml.getAttributeValue(term,'form');}if(myxml.getAttributeValue(term,'gender-form')){genderform=myxml.getAttributeValue(term,'gender-form');}if(myxml.getAttributeValue(term,'gender')){this.locale[lang_out]["noun-genders"][termname]=myxml.getAttributeValue(term,'gender');}if(genderform){this.locale[lang_out].terms[termname][genderform]={};this.locale[lang_out].terms[termname][genderform][form]=[];target=this.locale[lang_out].terms[termname][genderform];genderized_terms[termname]=true;}else{this.locale[lang_out].terms[termname][form]=[];target=this.locale[lang_out].terms[termname];}if(myxml.numberofnodes(myxml.getNodesByName(term,'multiple'))){target[form][0]=myxml.getNodeValue(term,'single');if(target[form][0].indexOf("%s")>-1){this.opt.hasPlaceholderTerm=true;}target[form][1]=myxml.getNodeValue(term,'multiple');if(target[form][1].indexOf("%s")>-1){this.opt.hasPlaceholderTerm=true;}}else{target[form]=myxml.getNodeValue(term);if(target[form].indexOf("%s")>-1){this.opt.hasPlaceholderTerm=true;}}}if(ordinals101_toggle){for(var ikey in genderized_terms){var gender_segments={};var form_segments=0;for(var jkey in this.locale[lang_out].terms[ikey]){if(["masculine","feminine"].indexOf(jkey)>-1){gender_segments[jkey]=this.locale[lang_out].terms[ikey][jkey];}else{form_segments+=1;}}if(!form_segments){if(gender_segments.feminine){for(var jkey in gender_segments.feminine){this.locale[lang_out].terms[ikey][jkey]=gender_segments.feminine[jkey];}}else if(gender_segments.masculine){for(var jkey in gender_segments.masculine){this.locale[lang_out].terms[ikey][jkey]=gender_segments.masculine[jkey];}}}}this.locale[lang_out].ord['1.0.1']=ordinals101;}for(termname in this.locale[lang_out].terms){for(i=0,ilen=2;i<ilen;i+=1){genderform=CSL.GENDERS[i];if(this.locale[lang_out].terms[termname][genderform]){for(form in this.locale[lang_out].terms[termname]){if(!this.locale[lang_out].terms[termname][genderform][form]){this.locale[lang_out].terms[termname][genderform][form]=this.locale[lang_out].terms[termname][form];}}}}}nodes=myxml.getNodesByName(locale,'style-options');for(pos=0,len=myxml.numberofnodes(nodes);pos<len;pos+=1){if(true){styleopts=nodes[pos];attributes=myxml.attributes(styleopts);for(attrname in attributes){if(attributes.hasOwnProperty(attrname)){if(attrname==="@punctuation-in-quote"||attrname==="@limit-day-ordinals-to-day-1"){if(attributes[attrname]==="true"){this.locale[lang_out].opts[attrname.slice(1)]=true;}else{this.locale[lang_out].opts[attrname.slice(1)]=false;}}else if(attrname==="@jurisdiction-preference"){var jurisdiction_preference=attributes[attrname].split(/\s*,\s*/);this.locale[lang_out].opts[attrname.slice(1)]=jurisdiction_preference;}else if(attrname==="@skip-words"){var skip_words=attributes[attrname].split(/\s*,\s*/);this.locale[lang_out].opts[attrname.slice(1)]=skip_words;}else if(attrname==="@leading-noise-words"){var val=attributes[attrname].split(/\s*,\s*/);this.locale[lang_out].opts["leading-noise-words"]=val;}else if(attrname==="@name-as-sort-order"){this.locale[lang_out].opts["name-as-sort-order"]={};var lst=attributes[attrname].split(/\s+/);for(var i=0,ilen=lst.length;i<ilen;i+=1){this.locale[lang_out].opts["name-as-sort-order"][lst[i]]=true;}}else if(attrname==="@name-as-reverse-order"){this.locale[lang_out].opts["name-as-reverse-order"]={};var lst=attributes[attrname].split(/\s+/);for(var i=0,ilen=lst.length;i<ilen;i+=1){this.locale[lang_out].opts["name-as-reverse-order"][lst[i]]=true;}}else if(attrname==="@name-never-short"){this.locale[lang_out].opts["name-never-short"]={};var lst=attributes[attrname].split(/\s+/);for(var i=0,ilen=lst.length;i<ilen;i+=1){this.locale[lang_out].opts["name-never-short"][lst[i]]=true;}}}}}}nodes=myxml.getNodesByName(locale,'date');for(pos=0,len=myxml.numberofnodes(nodes);pos<len;pos+=1){if(true){var date=nodes[pos];this.locale[lang_out].dates[myxml.getAttributeValue(date,"form")]=date;}}};module.exports=CSL;CSL.getLocaleNames=function(myxml,preferredLocale){var stylexml=CSL.setupXml(myxml);function extendLocaleList(localeList,locale){var forms=["base","best"];if(locale){normalizedLocale=CSL.localeResolve(locale);for(var i=0,ilen=forms.length;i<ilen;i++){if(normalizedLocale[forms[i]]&&localeList.indexOf(normalizedLocale[forms[i]])===-1){localeList.push(normalizedLocale[forms[i]]);}}}}function sniffLocaleOnOneNodeName(nodeName){var nodes=stylexml.getNodesByName(stylexml.dataObj,nodeName);for(var i=0,ilen=nodes.length;i<ilen;i++){var nodeLocales=stylexml.getAttributeValue(nodes[i],"locale");if(nodeLocales){nodeLocales=nodeLocales.split(/ +/);for(var j=0,jlen=nodeLocales.length;j<jlen;j++){this.extendLocaleList(localeIDs,nodeLocales[j]);}}}}var localeIDs=["en-US"];extendLocaleList(localeIDs,preferredLocale);var styleNode=stylexml.getNodesByName(stylexml.dataObj,"style")[0];var defaultLocale=stylexml.getAttributeValue(styleNode,"default-locale");extendLocaleList(localeIDs,defaultLocale);var nodeNames=["layout","if","else-if","condition"];for(var i=0,ilen=nodeNames.length;i<ilen;i++){sniffLocaleOnOneNodeName(stylexml,localeIDs,nodeNames[i]);}return localeIDs;};module.exports=CSL;CSL.Node={};CSL.Node.bibliography={build:function build(state,target){if(this.tokentype===CSL.START){state.build.area="bibliography";state.build.root="bibliography";state.build.extension="";var func=function func(state,Item){state.tmp.area="bibliography";state.tmp.root="bibliography";state.tmp.extension="";};this.execs.push(func);}target.push(this);}};module.exports=CSL;CSL.Node.choose={build:function build(state,target){var func;if(this.tokentype===CSL.START){func=function func(state,Item){state.tmp.jump.push(undefined,CSL.LITERAL);};}if(this.tokentype===CSL.END){func=function func(state,Item){state.tmp.jump.pop();};}this.execs.push(func);target.push(this);},configure:function configure(state,pos){if(this.tokentype===CSL.END){state.configure.fail.push(pos);state.configure.succeed.push(pos);}else{state.configure.fail.pop();state.configure.succeed.pop();}}};module.exports=CSL;CSL.Node.citation={build:function build(state,target){if(this.tokentype===CSL.START){state.build.area="citation";state.build.root="citation";state.build.extension="";var func=function func(state,Item){state.tmp.area="citation";state.tmp.root="citation";state.tmp.extension="";};this.execs.push(func);}if(this.tokentype===CSL.END){state.opt.grouped_sort=state.opt.xclass==="in-text"&&state.citation.opt.collapse&&state.citation.opt.collapse.length||state.citation.opt.cite_group_delimiter&&state.citation.opt.cite_group_delimiter.length&&state.opt.update_mode!==CSL.POSITION&&state.opt.update_mode!==CSL.NUMERIC;if(state.opt.grouped_sort&&state.citation_sort.opt.sort_directions.length){var firstkey=state.citation_sort.opt.sort_directions[0].slice();state.citation_sort.opt.sort_directions=[firstkey].concat(state.citation_sort.opt.sort_directions);}state.citation.srt=new CSL.Registry.Comparifier(state,"citation_sort");}target.push(this);}};module.exports=CSL;CSL.Node["#comment"]={build:function build(state,target){}};module.exports=CSL;CSL.Node.date={build:function build(state,target){var func,date_obj,tok,len,pos,part,dpx,parts,mypos,start,end;if(this.tokentype===CSL.START||this.tokentype===CSL.SINGLETON){state.build.date_parts=[];state.build.date_variables=this.variables;if(!state.build.extension){CSL.Util.substituteStart.call(this,state,target);}if(state.build.extension){func=CSL.dateMacroAsSortKey;}else{func=function func(state,Item,item){var key,dp;state.tmp.element_rendered_ok=false;state.tmp.donesies=[];state.tmp.dateparts=[];dp=[];if(this.variables.length&&!(state.tmp.just_looking&&this.variables[0]==="accessed")){date_obj=Item[this.variables[0]];if("undefined"===typeof date_obj){date_obj={"date-parts":[[0]]};if(state.opt.development_extensions.locator_date_and_revision){if(item&&this.variables[0]==="locator-date"&&item["locator-date"]){date_obj=item["locator-date"];}}}state.tmp.date_object=date_obj;len=this.dateparts.length;for(pos=0;pos<len;pos+=1){part=this.dateparts[pos];if("undefined"!==typeof state.tmp.date_object[part+"_end"]){dp.push(part);}else if(part==="month"&&"undefined"!==typeof state.tmp.date_object.season_end){dp.push(part);}}dpx=[];parts=["year","month","day"];len=parts.length;for(pos=0;pos<len;pos+=1){if(dp.indexOf(parts[pos])>-1){dpx.push(parts[pos]);}}dp=dpx.slice();mypos=2;len=dp.length;for(pos=0;pos<len;pos+=1){part=dp[pos];start=state.tmp.date_object[part];end=state.tmp.date_object[part+"_end"];if(start!==end){mypos=pos;break;}}state.tmp.date_collapse_at=dp.slice(mypos);}else{state.tmp.date_object=false;}};}this.execs.push(func);func=function func(state,Item){if(!Item[this.variables[0]])return;state.parallel.StartVariable(this.variables[0]);state.output.startTag("date",this);if(this.variables[0]==="issued"&&Item.type==="legal_case"&&!state.tmp.extension&&""+Item["collection-number"]===""+state.tmp.date_object.year&&this.dateparts.length===1&&this.dateparts[0]==="year"){for(var key in state.tmp.date_object){if(state.tmp.date_object.hasOwnProperty(key)){if(key.slice(0,4)==="year"){state.tmp.issued_date={};var lst=state.output.current.mystack.slice(-2)[0].blobs;state.tmp.issued_date.list=lst;state.tmp.issued_date.pos=lst.length-1;}}}}};this.execs.push(func);}if(!state.build.extension&&(this.tokentype===CSL.END||this.tokentype===CSL.SINGLETON)){func=function func(state,Item){if(!Item[this.variables[0]])return;state.output.endTag();state.parallel.CloseVariable(this.variables[0]);};this.execs.push(func);}target.push(this);if(this.tokentype===CSL.END||this.tokentype===CSL.SINGLETON){if(!state.build.extension){CSL.Util.substituteEnd.call(this,state,target);}}}};module.exports=CSL;CSL.Node["date-part"]={build:function build(state,target){var func,pos,len,decor,first_date,value,value_end,real,have_collapsed,invoked,precondition,known_year,bc,ad,bc_end,ad_end,ready,curr,dcurr,number,num,formatter,item,i,ilen;if(!this.strings.form){this.strings.form="long";}state.build.date_parts.push(this.strings.name);var date_variable=state.build.date_variables[0];func=function func(state,Item){if(!state.tmp.date_object){return;}first_date=true;value="";value_end="";state.tmp.donesies.push(this.strings.name);if(state.tmp.date_object.literal&&"year"===this.strings.name){state.parallel.AppendToVariable(state.tmp.date_object.literal);state.output.append(state.tmp.date_object.literal,this);}if(state.tmp.date_object){value=state.tmp.date_object[this.strings.name];value_end=state.tmp.date_object[this.strings.name+"_end"];}if("year"===this.strings.name&&value===0&&!state.tmp.suppress_decorations){value=false;}real=!state.tmp.suppress_decorations;have_collapsed=state.tmp.have_collapsed;invoked=state[state.tmp.area].opt.collapse==="year-suffix"||state[state.tmp.area].opt.collapse==="year-suffix-ranged";precondition=state.opt["disambiguate-add-year-suffix"];if(real&&precondition&&invoked){state.tmp.years_used.push(value);known_year=state.tmp.last_years_used.length>=state.tmp.years_used.length;if(known_year&&have_collapsed){if(state.tmp.last_years_used[state.tmp.years_used.length-1]===value){value=false;}}}if("undefined"!==typeof value){bc=false;ad=false;bc_end=false;ad_end=false;if("year"===this.strings.name){if(parseInt(value,10)<500&&parseInt(value,10)>0){ad=state.getTerm("ad");}if(parseInt(value,10)<0){bc=state.getTerm("bc");value=parseInt(value,10)*-1;}if(value_end){if(parseInt(value_end,10)<500&&parseInt(value_end,10)>0){ad_end=state.getTerm("ad");}if(parseInt(value_end,10)<0){bc_end=state.getTerm("bc");value_end=parseInt(value_end,10)*-1;}}}state.parallel.AppendToVariable(value);var monthnameid=""+state.tmp.date_object.month;while(monthnameid.length<2){monthnameid="0"+monthnameid;}monthnameid="month-"+monthnameid;var gender=state.locale[state.opt.lang]["noun-genders"][monthnameid];if(this.strings.form){var myform=this.strings.form;if(this.strings.name==="day"){if(myform==="ordinal"&&state.locale[state.opt.lang].opts["limit-day-ordinals-to-day-1"]&&""+value!=="1"){myform="numeric";}}value=CSL.Util.Dates[this.strings.name][myform](state,value,gender,this.default_locale);if("month"===this.strings.name){if(state.tmp.strip_periods){value=value.replace(/\./g,"");}else{for(var i=0,ilen=this.decorations.length;i<ilen;i+=1){if("@strip-periods"===this.decorations[i][0]&&"true"===this.decorations[i][1]){value=value.replace(/\./g,"");break;}}}}if(value_end){value_end=CSL.Util.Dates[this.strings.name][myform](state,value_end,gender,"accessed"===date_variable,"_end");if(state.tmp.strip_periods){value_end=value_end.replace(/\./g,"");}else{for(var i=0,ilen=this.decorations.length;i<ilen;i+=1){if("@strip-periods"===this.decorations[i][0]&&"true"===this.decorations[i][1]){value_end=value_end.replace(/\./g,"");break;}}}}}state.output.openLevel("empty");if(state.tmp.date_collapse_at.length){ready=true;len=state.tmp.date_collapse_at.length;for(pos=0;pos<len;pos+=1){item=state.tmp.date_collapse_at[pos];if(state.tmp.donesies.indexOf(item)===-1){ready=false;break;}}if(ready){if(""+value_end!=="0"){if(state.dateput.queue.length===0){first_date=true;}if(state.opt["year-range-format"]&&state.opt["year-range-format"]!=="expanded"&&!state.tmp.date_object.day&&!state.tmp.date_object.month&&!state.tmp.date_object.season&&this.strings.name==="year"&&value&&value_end){value_end=state.fun.year_mangler(value+"-"+value_end,true);var range_delimiter=state.getTerm("year-range-delimiter");value_end=value_end.slice(value_end.indexOf(range_delimiter)+1);}state.dateput.append(value_end,this);if(first_date){state.dateput.current.value()[0].strings.prefix="";}}state.output.append(value,this);curr=state.output.current.value();curr.blobs[curr.blobs.length-1].strings.suffix="";state.output.append(state.getTerm("year-range-delimiter"),"empty");dcurr=state.dateput.current.value();curr.blobs=curr.blobs.concat(dcurr);state.dateput.string(state,state.dateput.queue);state.tmp.date_collapse_at=[];}else{state.output.append(value,this);if(state.tmp.date_collapse_at.indexOf(this.strings.name)>-1){if(""+value_end!=="0"){if(state.dateput.queue.length===0){first_date=true;}state.dateput.openLevel("empty");state.dateput.append(value_end,this);if(first_date){state.dateput.current.value().blobs[0].strings.prefix="";}if(bc){state.dateput.append(bc);}if(ad){state.dateput.append(ad);}state.dateput.closeLevel();}}}}else{state.output.append(value,this);}if(bc){state.output.append(bc);}if(ad){state.output.append(ad);}state.output.closeLevel();}else if("month"===this.strings.name){if(state.tmp.date_object.season){value=""+state.tmp.date_object.season;if(value&&value.match(/^[1-4]$/)){state.tmp.group_context.tip.variable_success=true;state.output.append(state.getTerm("season-0"+value),this);}else if(value){state.output.append(value,this);}}}state.tmp.value=[];if(Item[date_variable]&&(value||state.tmp.have_collapsed)&&!state.opt.has_year_suffix&&"year"===this.strings.name&&!state.tmp.just_looking){if(state.registry.registry[Item.id]&&state.registry.registry[Item.id].disambig.year_suffix!==false&&!state.tmp.has_done_year_suffix){state.tmp.has_done_year_suffix=true;num=parseInt(state.registry.registry[Item.id].disambig.year_suffix,10);number=new CSL.NumericBlob(false,num,this,Item.id);this.successor_prefix=state[state.build.area].opt.layout_delimiter;this.splice_prefix=state[state.build.area].opt.layout_delimiter;formatter=new CSL.Util.Suffixator(CSL.SUFFIX_CHARS);number.setFormatter(formatter);if(state[state.tmp.area].opt.collapse==="year-suffix-ranged"){number.range_prefix=state.getTerm("citation-range-delimiter");}if(state[state.tmp.area].opt.cite_group_delimiter){number.successor_prefix=state[state.tmp.area].opt.cite_group_delimiter;}else if(state[state.tmp.area].opt["year-suffix-delimiter"]){number.successor_prefix=state[state.tmp.area].opt["year-suffix-delimiter"];}else{number.successor_prefix=state[state.tmp.area].opt.layout_delimiter;}number.UGLY_DELIMITER_SUPPRESS_HACK=true;state.output.append(number,"literal");}}};this.execs.push(func);target.push(this);}};module.exports=CSL;CSL.Node["else-if"]={build:function build(state,target){CSL.Conditions.TopNode.call(this,state,target);target.push(this);},configure:function configure(state,pos){CSL.Conditions.Configure.call(this,state,pos);}};module.exports=CSL;CSL.Node["else"]={build:function build(state,target){target.push(this);},configure:function configure(state,pos){if(this.tokentype===CSL.START){state.configure.fail[state.configure.fail.length-1]=pos;}}};module.exports=CSL;CSL.Node["et-al"]={build:function build(state,target){if(state.build.area==="citation"||state.build.area==="bibliography"){var func=function func(state,Item,item){state.tmp.etal_node=this;if("string"===typeof this.strings.term){state.tmp.etal_term=this.strings.term;}};this.execs.push(func);}target.push(this);}};module.exports=CSL;CSL.Node.group={build:function build(state,target,realGroup){var func,execs,done_vars;this.realGroup=realGroup;if(this.tokentype===CSL.START){CSL.Util.substituteStart.call(this,state,target);if(state.build.substitute_level.value()){state.build.substitute_level.replace(state.build.substitute_level.value()+1);}if(!this.juris){target.push(this);}func=function func(state,Item){state.output.startTag("group",this);if(this.strings.label_form_override){if(!state.tmp.group_context.tip.label_form){state.tmp.group_context.tip.label_form=this.strings.label_form_override;}}if(this.strings.label_capitalize_if_first_override){if(!state.tmp.group_context.tip.label_capitalize_if_first){state.tmp.group_context.tip.label_capitalize_if_first=this.strings.label_capitalize_if_first_override;}}if(this.realGroup){var condition=false;var force_suppress=false;if(state.tmp.group_context.mystack.length){state.output.current.value().parent=state.tmp.group_context.tip.output_tip;}var label_form=state.tmp.group_context.tip.label_form;if(!label_form){label_form=this.strings.label_form_override;}var label_capitalize_if_first=state.tmp.group_context.tip.label_capitalize_if_first;if(!label_capitalize_if_first){label_capitalize_if_first=this.strings.label_capitalize_if_first;}if(state.tmp.group_context.tip.condition){condition=state.tmp.group_context.tip.condition;force_suppress=state.tmp.group_context.tip.force_suppress;}else if(this.strings.reject){condition={test:this.strings.reject,not:true};force_suppress=true;done_vars=[];}else if(this.strings.citationRequire){condition={test:this.strings.citationRequire,not:false};done_vars=[];}state.tmp.group_context.push({old_term_predecessor:state.tmp.term_predecessor,term_intended:false,variable_attempt:false,variable_success:false,variable_success_parent:state.tmp.group_context.tip.variable_success,output_tip:state.output.current.tip,label_form:label_form,label_capitalize_if_first:label_capitalize_if_first,parallel_conditions:this.strings.set_parallel_condition,condition:condition,force_suppress:force_suppress,done_vars:state.tmp.group_context.tip.done_vars.slice()});}};execs=[];execs.push(func);this.execs=execs.concat(this.execs);if(this.strings["has-publisher-and-publisher-place"]){state.build["publisher-special"]=true;func=function func(state,Item){if(this.strings["subgroup-delimiter"]&&Item.publisher&&Item["publisher-place"]){var publisher_lst=Item.publisher.split(/;\s*/);var publisher_place_lst=Item["publisher-place"].split(/;\s*/);if(publisher_lst.length>1&&publisher_lst.length===publisher_place_lst.length){state.publisherOutput=new CSL.PublisherOutput(state,this);state.publisherOutput["publisher-list"]=publisher_lst;state.publisherOutput["publisher-place-list"]=publisher_place_lst;}}};this.execs.push(func);}if(this.juris){for(var x=0,xlen=target.length;x<xlen;x++){var token=target[x];}var choose_start=new CSL.Token("choose",CSL.START);CSL.Node.choose.build.call(choose_start,state,target);var if_start=new CSL.Token("if",CSL.START);func=function(macroName){return function(Item){if(!state.sys.retrieveStyleModule||!CSL.MODULE_MACROS[macroName]||!Item.jurisdiction)return false;var jurisdictionList=state.getJurisdictionList(Item.jurisdiction);if(!state.opt.jurisdictions_seen[jurisdictionList[0]]){var res=state.retrieveAllStyleModules(jurisdictionList);for(var jurisdiction in res){var macroCount=0;state.juris[jurisdiction]={};var myXml=CSL.setupXml(res[jurisdiction]);var myNodes=myXml.getNodesByName(myXml.dataObj,"law-module");for(var i=0,ilen=myNodes.length;i<ilen;i++){var myTypes=myXml.getAttributeValue(myNodes[i],"types");if(myTypes){state.juris[jurisdiction].types={};myTypes=myTypes.split(/\s+/);for(var j=0,jlen=myTypes.length;j<jlen;j++){state.juris[jurisdiction].types[myTypes[j]]=true;}}}if(!state.juris[jurisdiction].types){state.juris[jurisdiction].types=CSL.MODULE_TYPES;}var myNodes=myXml.getNodesByName(myXml.dataObj,"macro");for(var i=0,ilen=myNodes.length;i<ilen;i++){var myName=myXml.getAttributeValue(myNodes[i],"name");if(!CSL.MODULE_MACROS[myName]){CSL.debug("CSL: skipping non-modular macro name \""+myName+"\" in module context");continue;};macroCount++;state.juris[jurisdiction][myName]=[];state.buildTokenLists(myNodes[i],state.juris[jurisdiction][myName]);state.configureTokenList(state.juris[jurisdiction][myName]);}}}for(var i=0,ilen=jurisdictionList.length;i<ilen;i++){var jurisdiction=jurisdictionList[i];if(state.juris[jurisdiction]&&state.juris[jurisdiction].types[Item.type]){Item["best-jurisdiction"]=jurisdiction;return true;}}return false;};}(this.juris);if_start.tests.push(func);if_start.test=state.fun.match.any(if_start,state,if_start.tests);target.push(if_start);var text_node=new CSL.Token("text",CSL.SINGLETON);func=function func(state,Item,item){var next=0;if(state.juris[Item["best-jurisdiction"]][this.juris]){while(next<state.juris[Item["best-jurisdiction"]][this.juris].length){next=CSL.tokenExec.call(state,state.juris[Item["best-jurisdiction"]][this.juris][next],Item,item);}}};text_node.juris=this.juris;text_node.execs.push(func);target.push(text_node);var if_end=new CSL.Token("if",CSL.END);CSL.Node["if"].build.call(if_end,state,target);var else_start=new CSL.Token("else",CSL.START);CSL.Node["else"].build.call(else_start,state,target);}}if(this.tokentype===CSL.END){if(state.build["publisher-special"]){state.build["publisher-special"]=false;if("string"===typeof state[state.build.root].opt["name-delimiter"]){func=function func(state,Item){if(state.publisherOutput){state.publisherOutput.render();state.publisherOutput=false;}};this.execs.push(func);}}func=function func(state,Item){state.output.endTag();if(this.realGroup){var flags=state.tmp.group_context.pop();if(state.tmp.group_context.tip.condition){state.tmp.group_context.tip.force_suppress=flags.force_suppress;}if(!flags.force_suppress&&(flags.variable_success||flags.term_intended&&!flags.variable_attempt)){if(!this.isJurisLocatorLabel){state.tmp.group_context.tip.variable_success=true;}var blobs=state.output.current.value().blobs;var pos=state.output.current.value().blobs.length-1;if(!state.tmp.just_looking&&"undefined"!==typeof flags.parallel_conditions){var parallel_condition_object={blobs:blobs,conditions:flags.parallel_conditions,id:Item.id,pos:pos};state.parallel.parallel_conditional_blobs_list.push(parallel_condition_object);}}else{state.tmp.term_predecessor=flags.old_term_predecessor;state.tmp.group_context.tip.variable_attempt=flags.variable_attempt;if(flags.force_suppress&&!state.tmp.group_context.tip.condition){state.tmp.group_context.tip.variable_attempt=true;state.tmp.group_context.tip.variable_success=flags.variable_success_parent;for(var i=0,ilen=flags.done_vars.length;i<ilen;i++){if(state.tmp.done_vars.indexOf(flags.done_vars[i])>-1){state.tmp.done_vars=state.tmp.done_vars.slice(0,i).concat(state.tmp.done_vars.slice(i+1));}}}if(state.output.current.value().blobs){state.output.current.value().blobs.pop();}}}};this.execs.push(func);if(this.juris){var else_end=new CSL.Token("else",CSL.END);CSL.Node["else"].build.call(else_end,state,target);var choose_end=new CSL.Token("choose",CSL.END);CSL.Node.choose.build.call(choose_end,state,target);}}if(this.tokentype===CSL.END){if(!this.juris){target.push(this);}if(state.build.substitute_level.value()){state.build.substitute_level.replace(state.build.substitute_level.value()-1);}CSL.Util.substituteEnd.call(this,state,target);}}};module.exports=CSL;CSL.Node["if"]={build:function build(state,target){CSL.Conditions.TopNode.call(this,state,target);target.push(this);},configure:function configure(state,pos){CSL.Conditions.Configure.call(this,state,pos);}};module.exports=CSL;CSL.Node["conditions"]={build:function build(state,target){if(this.tokentype===CSL.START){state.tmp.conditions.addMatch(this.match);}if(this.tokentype===CSL.END){state.tmp.conditions.matchCombine();}}};module.exports=CSL;CSL.Node["condition"]={build:function build(state,target){if(this.tokentype===CSL.SINGLETON){var test=state.fun.match[this.match](this,state,this.tests);state.tmp.conditions.addTest(test);}}};module.exports=CSL;CSL.Conditions={};CSL.Conditions.TopNode=function(state,target){var func;if(this.tokentype===CSL.START||this.tokentype===CSL.SINGLETON){if(this.locale){state.opt.lang=this.locale;}if(!this.tests||!this.tests.length){state.tmp.conditions=new CSL.Conditions.Engine(state,this);}else{this.test=state.fun.match[this.match](this,state,this.tests);}}if(this.tokentype===CSL.END||this.tokentype===CSL.SINGLETON){func=function func(state,Item){if(this.locale_default){state.output.current.value().old_locale=this.locale_default;state.output.closeLevel("empty");state.opt.lang=this.locale_default;}var next=this[state.tmp.jump.value()];return next;};this.execs.push(func);if(this.locale_default){state.opt.lang=this.locale_default;}}};CSL.Conditions.Configure=function(state,pos){if(this.tokentype===CSL.START){this.fail=state.configure.fail.slice(-1)[0];this.succeed=this.next;state.configure.fail[state.configure.fail.length-1]=pos;}else if(this.tokentype===CSL.SINGLETON){this.fail=this.next;this.succeed=state.configure.succeed.slice(-1)[0];state.configure.fail[state.configure.fail.length-1]=pos;}else{this.succeed=state.configure.succeed.slice(-1)[0];this.fail=this.next;}};CSL.Conditions.Engine=function(state,token){this.token=token;this.state=state;};CSL.Conditions.Engine.prototype.addTest=function(test){this.token.tests.push(test);};CSL.Conditions.Engine.prototype.addMatch=function(match){this.token.match=match;};CSL.Conditions.Engine.prototype.matchCombine=function(){this.token.test=this.state.fun.match[this.token.match](this.token,this.state,this.token.tests);};module.exports=CSL;CSL.Node.info={build:function build(state,target){if(this.tokentype===CSL.START){state.build.skip="info";}else{state.build.skip=false;}}};module.exports=CSL;CSL.Node.institution={build:function build(state,target){if([CSL.SINGLETON,CSL.START].indexOf(this.tokentype)>-1){var func=function func(state,Item){if("string"===typeof this.strings.delimiter){state.tmp.institution_delimiter=this.strings.delimiter;}else{state.tmp.institution_delimiter=state.tmp.name_delimiter;}var myand,and_default_prefix,and_suffix;if("text"===state.inheritOpt(this,"and")){this.and_term=state.getTerm("and","long",0);}else if("symbol"===state.inheritOpt(this,"and")){if(state.opt.development_extensions.expect_and_symbol_form){this.and_term=state.getTerm("and","symbol",0);}else{this.and_term="&";}}else if("none"===state.inheritOpt(this,"and")){this.and_term=state.tmp.institution_delimiter;}if("undefined"===typeof this.and_term&&state.tmp.and_term){this.and_term=state.getTerm("and","long",0);}if(CSL.STARTSWITH_ROMANESQUE_REGEXP.test(this.and_term)){this.and_prefix_single=" ";this.and_prefix_multiple=", ";if("string"===typeof state.tmp.institution_delimiter){this.and_prefix_multiple=state.tmp.institution_delimiter;}this.and_suffix=" ";}else{this.and_prefix_single="";this.and_prefix_multiple="";this.and_suffix="";}if(state.inheritOpt(this,"delimiter-precedes-last")==="always"){this.and_prefix_single=state.tmp.institution_delimiter;}else if(state.inheritOpt(this,"delimiter-precedes-last")==="never"){if(this.and_prefix_multiple){this.and_prefix_multiple=" ";}}this.and={};if("undefined"!==typeof this.and_term){state.output.append(this.and_term,"empty",true);this.and.single=state.output.pop();this.and.single.strings.prefix=this.and_prefix_single;this.and.single.strings.suffix=this.and_suffix;state.output.append(this.and_term,"empty",true);this.and.multiple=state.output.pop();this.and.multiple.strings.prefix=this.and_prefix_multiple;this.and.multiple.strings.suffix=this.and_suffix;}else if("undefined"!==this.strings.delimiter){this.and.single=new CSL.Blob(state.tmp.institution_delimiter);this.and.single.strings.prefix="";this.and.single.strings.suffix="";this.and.multiple=new CSL.Blob(state.tmp.institution_delimiter);this.and.multiple.strings.prefix="";this.and.multiple.strings.suffix="";}state.nameOutput.institution=this;};this.execs.push(func);}target.push(this);},configure:function configure(state,pos){if([CSL.SINGLETON,CSL.START].indexOf(this.tokentype)>-1){state.build.has_institution=true;}}};module.exports=CSL;CSL.Node["institution-part"]={build:function build(state,target){var func;if("long"===this.strings.name){if(this.strings["if-short"]){func=function func(state,Item){state.nameOutput.institutionpart["long-with-short"]=this;};}else{func=function func(state,Item){state.nameOutput.institutionpart["long"]=this;};}}else if("short"===this.strings.name){func=function func(state,Item){state.nameOutput.institutionpart["short"]=this;};}this.execs.push(func);target.push(this);}};module.exports=CSL;CSL.Node.key={build:function build(state,target){target=state[state.build.root+"_sort"].tokens;var func,i,ilen;var debug=false;var start_key=new CSL.Token("key",CSL.START);state.tmp.root=state.build.root;start_key.strings["et-al-min"]=state.inheritOpt(this,"et-al-min");start_key.strings["et-al-use-first"]=state.inheritOpt(this,"et-al-use-first");start_key.strings["et-al-use-last"]=state.inheritOpt(this,"et-al-use-last");func=function func(state,Item){state.tmp.done_vars=[];};start_key.execs.push(func);state.opt.citation_number_sort_direction=this.strings.sort_direction;func=function func(state,Item){state.output.openLevel("empty");};start_key.execs.push(func);var sort_direction=[];if(this.strings.sort_direction===CSL.DESCENDING){sort_direction.push(1);sort_direction.push(-1);}else{sort_direction.push(-1);sort_direction.push(1);}state[state.build.area].opt.sort_directions.push(sort_direction);if(CSL.DATE_VARIABLES.indexOf(this.variables[0])>-1){state.build.date_key=true;}func=function func(state,Item){state.tmp.sort_key_flag=true;if(state.inheritOpt(this,"et-al-min")){state.tmp["et-al-min"]=state.inheritOpt(this,"et-al-min");}if(state.inheritOpt(this,"et-al-use-first")){state.tmp["et-al-use-first"]=state.inheritOpt(this,"et-al-use-first");}if("boolean"===typeof state.inheritOpt(this,"et-al-use-last")){state.tmp["et-al-use-last"]=state.inheritOpt(this,"et-al-use-last");}};start_key.execs.push(func);target.push(start_key);if(this.variables.length){var variable=this.variables[0];if(variable==="citation-number"){if(state.build.area==="citation"&&state.build.extension==="_sort"){state.opt.citation_number_sort=false;}if(state.build.root==="bibliography"&&state.build.extension==="_sort"){state.opt.citation_number_sort_used=false;}}if(CSL.NAME_VARIABLES.indexOf(variable)>-1){var names_start_token=new CSL.Token("names",CSL.START);names_start_token.tokentype=CSL.START;names_start_token.variables=this.variables;CSL.Node.names.build.call(names_start_token,state,target);var name_token=new CSL.Token("name",CSL.SINGLETON);name_token.tokentype=CSL.SINGLETON;name_token.strings["name-as-sort-order"]="all";name_token.strings["sort-separator"]=" ";name_token.strings["et-al-use-last"]=state.inheritOpt(this,"et-al-use-last");name_token.strings["et-al-min"]=state.inheritOpt(this,"et-al-min");name_token.strings["et-al-use-first"]=state.inheritOpt(this,"et-al-use-first");CSL.Node.name.build.call(name_token,state,target);var institution_token=new CSL.Token("institution",CSL.SINGLETON);institution_token.tokentype=CSL.SINGLETON;CSL.Node.institution.build.call(institution_token,state,target);var names_end_token=new CSL.Token("names",CSL.END);names_end_token.tokentype=CSL.END;CSL.Node.names.build.call(names_end_token,state,target);}else{var single_text=new CSL.Token("text",CSL.SINGLETON);single_text.dateparts=this.dateparts;if(CSL.NUMERIC_VARIABLES.indexOf(variable)>-1){func=function func(state,Item){var num,m;num=false;if("citation-number"===variable){num=state.registry.registry[Item.id].seq.toString();}else{num=Item[variable];}if(num){num=CSL.Util.padding(num);}state.output.append(num,this);};}else if(variable==="citation-label"){func=function func(state,Item){var trigraph=state.getCitationLabel(Item);state.output.append(trigraph,this);};}else if(CSL.DATE_VARIABLES.indexOf(variable)>-1){func=CSL.dateAsSortKey;single_text.variables=this.variables;}else if("title"===variable){var abbrevfam="title";var abbrfall=false;var altvar=false;var transfall=true;func=state.transform.getOutputFunction(this.variables,abbrevfam,abbrfall,altvar,transfall);}else{func=function func(state,Item){var varval=Item[variable];state.output.append(varval,"empty");};}single_text.execs.push(func);target.push(single_text);}}else{var token=new CSL.Token("text",CSL.SINGLETON);token.postponed_macro=this.postponed_macro;CSL.expandMacro.call(state,token,target);}var end_key=new CSL.Token("key",CSL.END);func=function func(state,Item){var keystring=state.output.string(state,state.output.queue);if(state.sys.normalizeUnicode){keystring=state.sys.normalizeUnicode(keystring);}keystring=keystring?keystring.split(" ").join(state.opt.sort_sep)+state.opt.sort_sep:"";if(""===keystring){keystring=undefined;}if("string"!==typeof keystring||state.tmp.empty_date){keystring=undefined;state.tmp.empty_date=false;}state[state[state.tmp.area].root+"_sort"].keys.push(keystring);state.tmp.value=[];};end_key.execs.push(func);if(state.build.date_key){if(state.build.area==="citation"&&state.build.extension==="_sort"){state[state.build.area].opt.sort_directions.push([-1,1]);func=function func(state,Item){var year_suffix=state.registry.registry[Item.id].disambig.year_suffix;if(!year_suffix){year_suffix=0;}var key=CSL.Util.padding(""+year_suffix);state[state.tmp.area].keys.push(key);};end_key.execs.push(func);}state.build.date_key=false;}func=function func(state,Item){state.tmp["et-al-min"]=undefined;state.tmp["et-al-use-first"]=undefined;state.tmp["et-al-use-last"]=undefined;state.tmp.sort_key_flag=false;};end_key.execs.push(func);target.push(end_key);}};module.exports=CSL;CSL.Node.label={build:function build(state,target){var debug=false;if(this.strings.term){var plural=false;if(!this.strings.form){}var func=function func(state,Item,item){var termtxt=CSL.evaluateLabel(this,state,Item,item);if(item&&this.strings.term==="locator"){state.parallel.StartVariable("label");state.parallel.AppendToVariable(item.label);item.section_form_override=this.strings.form;}if(termtxt){state.tmp.group_context.tip.term_intended=true;}CSL.UPDATE_GROUP_CONTEXT_CONDITION(state,termtxt);if(termtxt.indexOf("%s")===-1){if(this.strings.capitalize_if_first){if(!state.tmp.term_predecessor&&!(state.opt["class"]==="in-text"&&state.tmp.area==="citation")){termtxt=CSL.Output.Formatters["capitalize-first"](state,termtxt);}}state.output.append(termtxt,this);}if(item&&this.strings.term==="locator"){state.parallel.CloseVariable();}};this.execs.push(func);}else{var namevars=state.build.names_variables.slice(-1)[0];if(!state.build.name_label){state.build.name_label={};}for(var i=0,ilen=namevars.length;i<ilen;i+=1){if(!state.build.name_label[namevars[i]]){state.build.name_label[namevars[i]]={};}}if(!state.build.name_flag){for(var i=0,ilen=namevars.length;i<ilen;i+=1){state.build.name_label[namevars[i]].before=this;}}else{for(var i=0,ilen=namevars.length;i<ilen;i+=1){state.build.name_label[namevars[i]].after=this;}}}target.push(this);}};module.exports=CSL;CSL.Node.layout={build:function build(state,target){var func,prefix_token,suffix_token,tok;function setSuffix(){if(state.build.area==="bibliography"){suffix_token=new CSL.Token("text",CSL.SINGLETON);func=function func(state,Item,item){var last_locale=state.tmp.cite_locales[state.tmp.cite_locales.length-1];var suffix;if(state.tmp.cite_affixes[state.tmp.area][state.tmp.last_cite_locale]){suffix=state.tmp.cite_affixes[state.tmp.area][state.tmp.last_cite_locale].suffix;}else{suffix=state.bibliography.opt.layout_suffix;}var topblob=state.output.current.value();if(state.opt.using_display){topblob.blobs[topblob.blobs.length-1].strings.suffix=suffix;}else{topblob.strings.suffix=suffix;}if(state.bibliography.opt["second-field-align"]){state.output.endTag("bib_other");}};suffix_token.execs.push(func);target.push(suffix_token);}}if(this.tokentype===CSL.START){if(this.locale_raw){state.build.current_default_locale=this.locale_raw;}else{state.build.current_default_locale=state.opt["default-locale"];}func=function func(state,Item,item){if(state.opt.development_extensions.apply_citation_wrapper&&state.sys.wrapCitationEntry&&!state.tmp.just_looking&&Item.system_id&&state.tmp.area==="citation"){cite_entry=new CSL.Token("group",CSL.START);cite_entry.decorations=[["@cite","entry"]];state.output.startTag("cite_entry",cite_entry);state.output.current.value().item_id=Item.system_id;if(item){state.output.current.value().locator_txt=item.locator_txt;state.output.current.value().suffix_txt=item.suffix_txt;}}};this.execs.push(func);}if(this.tokentype===CSL.START&&!state.tmp.cite_affixes[state.build.area]){func=function func(state,Item){state.tmp.done_vars=[];if(state.opt.suppressedJurisdictions[Item["country"]]&&Item["country"]&&["treaty","patent"].indexOf(Item.type)===-1){state.tmp.done_vars.push("country");}if(!state.tmp.just_looking&&state.registry.registry[Item.id]&&state.registry.registry[Item.id].parallel){state.tmp.done_vars.push("first-reference-note-number");}state.tmp.rendered_name=false;};this.execs.push(func);func=function func(state,Item){state.tmp.sort_key_flag=false;};this.execs.push(func);func=function func(state,Item){state.tmp.nameset_counter=0;};this.execs.push(func);func=function func(state,Item){var tok=new CSL.Token();if(state.opt.development_extensions.rtl_support){if(["ar","he","fa","ur","yi","ps","syr"].indexOf(Item.language)>-1){tok=new CSL.Token();tok.strings.prefix="\u202B";tok.strings.suffix="\u202C";}}state.output.openLevel(tok);};this.execs.push(func);target.push(this);if(state.opt.development_extensions.rtl_support&&false){this.strings.prefix=this.strings.prefix.replace(/\((.|$)/g,"(\u200E$1");this.strings.suffix=this.strings.suffix.replace(/\)(.|$)/g,")\u200E$1");}if(state.build.area==="citation"){prefix_token=new CSL.Token("text",CSL.SINGLETON);func=function func(state,Item,item){var sp;if(item&&item.prefix){sp="";var test_prefix=item.prefix.replace(/<[^>]+>/g,"").replace(/["'\u201d\u2019\u00bb\u202f\u00a0 ]+$/g,"");var test_char=test_prefix.slice(-1);if(test_prefix.match(CSL.ENDSWITH_ROMANESQUE_REGEXP)){sp=" ";}else if(CSL.TERMINAL_PUNCTUATION.slice(0,-1).indexOf(test_char)>-1){sp=" ";}else if(test_char.match(/[\)\],0-9]/)){sp=" ";}var ignorePredecessor=false;if(CSL.TERMINAL_PUNCTUATION.slice(0,-1).indexOf(test_char)>-1&&item.prefix.trim().indexOf(" ")>-1){state.tmp.term_predecessor=false;ignorePredecessor=true;}var prefix=(item.prefix+sp).replace(/\s+/g," ");if(!state.tmp.just_looking){prefix=state.output.checkNestedBrace.update(prefix);}state.output.append(prefix,this,false,ignorePredecessor);}};prefix_token.execs.push(func);target.push(prefix_token);}}var my_tok;if(this.locale_raw){my_tok=new CSL.Token("dummy",CSL.START);my_tok.locale=this.locale_raw;my_tok.strings.delimiter=this.strings.delimiter;my_tok.strings.suffix=this.strings.suffix;if(!state.tmp.cite_affixes[state.build.area]){state.tmp.cite_affixes[state.build.area]={};}}if(this.tokentype===CSL.START){state.build.layout_flag=true;if(!this.locale_raw){state[state.tmp.area].opt.topdecor=[this.decorations];state[state.tmp.area+"_sort"].opt.topdecor=[this.decorations];state[state.build.area].opt.layout_prefix=this.strings.prefix;state[state.build.area].opt.layout_suffix=this.strings.suffix;state[state.build.area].opt.layout_delimiter=this.strings.delimiter;state[state.build.area].opt.layout_decorations=this.decorations;if(state.tmp.cite_affixes[state.build.area]){tok=new CSL.Token("else",CSL.START);CSL.Node["else"].build.call(tok,state,target);}}if(this.locale_raw){if(!state.build.layout_locale_flag){var choose_tok=new CSL.Token("choose",CSL.START);CSL.Node.choose.build.call(choose_tok,state,target);my_tok.name="if";CSL.Attributes["@locale-internal"].call(my_tok,state,this.locale_raw);CSL.Node["if"].build.call(my_tok,state,target);}else{my_tok.name="else-if";CSL.Attributes["@locale-internal"].call(my_tok,state,this.locale_raw);CSL.Node["else-if"].build.call(my_tok,state,target);}state.tmp.cite_affixes[state.build.area][my_tok.locale]={};state.tmp.cite_affixes[state.build.area][my_tok.locale].delimiter=this.strings.delimiter;state.tmp.cite_affixes[state.build.area][my_tok.locale].suffix=this.strings.suffix;}}if(this.tokentype===CSL.END){if(this.locale_raw){setSuffix();if(!state.build.layout_locale_flag){my_tok.name="if";my_tok.tokentype=CSL.END;CSL.Attributes["@locale-internal"].call(my_tok,state,this.locale_raw);CSL.Node["if"].build.call(my_tok,state,target);state.build.layout_locale_flag=true;}else{my_tok.name="else-if";my_tok.tokentype=CSL.END;CSL.Attributes["@locale-internal"].call(my_tok,state,this.locale_raw);CSL.Node["else-if"].build.call(my_tok,state,target);}}if(!this.locale_raw){setSuffix();if(state.tmp.cite_affixes[state.build.area]){if(state.build.layout_locale_flag){tok=new CSL.Token("else",CSL.END);CSL.Node["else"].build.call(tok,state,target);tok=new CSL.Token("choose",CSL.END);CSL.Node.choose.build.call(tok,state,target);}}state.build_layout_locale_flag=true;if(state.build.area==="citation"){suffix_token=new CSL.Token("text",CSL.SINGLETON);func=function func(state,Item,item){var sp;if(item&&item.suffix){sp="";if(item.suffix.match(CSL.STARTSWITH_ROMANESQUE_REGEXP)||['[','('].indexOf(item.suffix.slice(0,1))>-1){sp=" ";}var suffix=item.suffix;if(!state.tmp.just_looking){suffix=state.output.checkNestedBrace.update(suffix);}state.output.append(sp+suffix,this);}};suffix_token.execs.push(func);target.push(suffix_token);}func=function func(state,Item){state.output.closeLevel();};this.execs.push(func);func=function func(state,Item){if(state.opt.development_extensions.apply_citation_wrapper&&state.sys.wrapCitationEntry&&!state.tmp.just_looking&&Item.system_id&&state.tmp.area==="citation"){state.output.endTag();}};this.execs.push(func);target.push(this);state.build.layout_flag=false;state.build.layout_locale_flag=false;}}}};module.exports=CSL;CSL.Node.macro={build:function build(state,target){}};module.exports=CSL;CSL.NameOutput=function(state,Item,item,variables){this.debug=false;this.state=state;this.Item=Item;this.item=item;this.nameset_base=0;this.etal_spec={};this._first_creator_variable=false;this._please_chop=false;};CSL.NameOutput.prototype.init=function(names){if(this.state.tmp.term_predecessor){this.state.tmp.subsequent_author_substitute_ok=false;}if(this.nameset_offset){this.nameset_base=this.nameset_base+this.nameset_offset;}this.nameset_offset=0;this.names=names;this.variables=names.variables;this.state.tmp.value=[];this.state.tmp.rendered_name=[];this.state.tmp.label_blob=false;this.state.tmp.etal_node=false;this.state.tmp.etal_term=false;for(var i=0,ilen=this.variables.length;i<ilen;i+=1){if(this.Item[this.variables[i]]&&this.Item[this.variables[i]].length){this.state.tmp.value=this.state.tmp.value.concat(this.Item[this.variables[i]]);}}this["et-al"]=undefined;this["with"]=undefined;this.name=undefined;this.institutionpart={};this.state.tmp.group_context.tip.variable_attempt=true;this.labelVariable=this.variables[0];if(!this.state.tmp.value.length){return;}};CSL.NameOutput.prototype.reinit=function(names,labelVariable){this.labelVariable=labelVariable;if(this.state.tmp.can_substitute.value()){this.nameset_offset=0;this.variables=names.variables;var oldval=this.state.tmp.value.slice();this.state.tmp.value=[];for(var i=0,ilen=this.variables.length;i<ilen;i+=1){if(this.Item[this.variables[i]]&&this.Item[this.variables[i]].length){this.state.tmp.value=this.state.tmp.value.concat(this.Item[this.variables[i]]);}}if(this.state.tmp.value.length){this.state.tmp.can_substitute.replace(false,CSL.LITERAL);}this.state.tmp.value=oldval;}};CSL.NameOutput.prototype.outputNames=function(){var i,ilen;var variables=this.variables;if(this.institution.and){if(!this.institution.and.single.blobs||!this.institution.and.single.blobs.length){this.institution.and.single.blobs=this.name.and.single.blobs;}if(!this.institution.and.multiple.blobs||!this.institution.and.multiple.blobs.length){this.institution.and.multiple.blobs=this.name.and.multiple.blobs;}}this.variable_offset={};if(this.family){this.family_decor=CSL.Util.cloneToken(this.family);this.family_decor.strings.prefix="";this.family_decor.strings.suffix="";for(i=0,ilen=this.family.execs.length;i<ilen;i+=1){this.family.execs[i].call(this.family_decor,this.state,this.Item);}}else{this.family_decor=false;}if(this.given){this.given_decor=CSL.Util.cloneToken(this.given);this.given_decor.strings.prefix="";this.given_decor.strings.suffix="";for(i=0,ilen=this.given.execs.length;i<ilen;i+=1){this.given.execs[i].call(this.given_decor,this.state,this.Item);}}else{this.given_decor=false;}this.getEtAlConfig();this.divideAndTransliterateNames();this.truncatePersonalNameLists();this.disambigNames();this.constrainNames();if(this.name.strings.form==="count"){if(this.state.tmp.extension||this.names_count!=0){this.state.output.append(this.names_count,"empty");this.state.tmp.group_context.tip.variable_success=true;}return;}this.setEtAlParameters();this.setCommonTerm();this.state.tmp.name_node={};this.state.tmp.name_node.children=[];this.renderAllNames();var blob_list=[];for(i=0,ilen=variables.length;i<ilen;i+=1){var v=variables[i];var institution_sets=[];var institutions=false;var varblob=null;if(!this.state.opt.development_extensions.spoof_institutional_affiliations){varblob=this._join([this.freeters[v]],"");}else{for(var j=0,jlen=this.institutions[v].length;j<jlen;j+=1){institution_sets.push(this.joinPersonsAndInstitutions([this.persons[v][j],this.institutions[v][j]]));}if(this.institutions[v].length){var pos=this.nameset_base+this.variable_offset[v];if(this.freeters[v].length){pos+=1;}institutions=this.joinInstitutionSets(institution_sets,pos);}var varblob=this.joinFreetersAndInstitutionSets([this.freeters[v],institutions]);}if(varblob){if(!this.state.tmp.extension){varblob=this._applyLabels(varblob,v);}blob_list.push(varblob);}if(this.common_term){break;}}this.state.output.openLevel("empty");this.state.output.current.value().strings.delimiter=this.state.inheritOpt(this.names,"delimiter","names-delimiter");for(i=0,ilen=blob_list.length;i<ilen;i+=1){this.state.output.append(blob_list[i],"literal",true);}this.state.output.closeLevel("empty");var blob=this.state.output.pop();var namesToken=CSL.Util.cloneToken(this.names);this.state.output.append(blob,namesToken);if(this.state.tmp.term_predecessor_name){this.state.tmp.term_predecessor=true;}this.state.tmp.name_node.top=this.state.output.current.value();if(variables[0]!=="authority"){var name_node_string=[];var nameobjs=this.Item[variables[0]];if(nameobjs){for(var i=0,ilen=nameobjs.length;i<ilen;i+=1){var substring=CSL.Util.Names.getRawName(nameobjs[i]);if(substring){name_node_string.push(substring);}}}name_node_string=name_node_string.join(", ");if(name_node_string){this.state.tmp.name_node.string=name_node_string;}}if(this.state.tmp.name_node.string&&!this.state.tmp.first_name_string){this.state.tmp.first_name_string=this.state.tmp.name_node.string;}if("classic"===this.Item.type){var author_title=[];if(this.state.tmp.first_name_string){author_title.push(this.state.tmp.first_name_string);}if(this.Item.title){author_title.push(this.Item.title);}author_title=author_title.join(", ");if(author_title&&this.state.sys.getAbbreviation){this.state.transform.loadAbbreviation("default","classic",author_title);if(this.state.transform.abbrevs["default"].classic[author_title]){this.state.tmp.done_vars.push("title");this.state.output.append(this.state.transform.abbrevs["default"].classic[author_title],"empty",true);blob=this.state.output.pop();this.state.tmp.name_node.top.blobs.pop();this.state.tmp.name_node.top.blobs.push(blob);}}}this._collapseAuthor();this.variables=[];};CSL.NameOutput.prototype._applyLabels=function(blob,v){var txt;if(!this.label||!this.label[this.labelVariable]){return blob;}var plural=0;var num=this.freeters_count[v]+this.institutions_count[v];if(num>1){plural=1;}else{for(var i=0,ilen=this.persons[v].length;i<ilen;i+=1){num+=this.persons_count[v][i];}if(num>1){plural=1;}}if(this.label[this.labelVariable].before){if("number"===typeof this.label[this.labelVariable].before.strings.plural){plural=this.label[this.labelVariable].before.strings.plural;}txt=this._buildLabel(v,plural,"before",this.labelVariable);this.state.output.openLevel("empty");this.state.output.append(txt,this.label[this.labelVariable].before,true);this.state.output.append(blob,"literal",true);this.state.output.closeLevel("empty");blob=this.state.output.pop();}else if(this.label[this.labelVariable].after){if("number"===typeof this.label[this.labelVariable].after.strings.plural){plural=this.label[this.labelVariable].after.strings.plural;}txt=this._buildLabel(v,plural,"after",this.labelVariable);this.state.output.openLevel("empty");this.state.output.append(blob,"literal",true);this.state.output.append(txt,this.label[this.labelVariable].after,true);this.state.tmp.label_blob=this.state.output.pop();this.state.output.append(this.state.tmp.label_blob,"literal",true);this.state.output.closeLevel("empty");blob=this.state.output.pop();}return blob;};CSL.NameOutput.prototype._buildLabel=function(term,plural,position,v){if(this.common_term){term=this.common_term;}var ret=false;var node=this.label[v][position];if(node){ret=CSL.castLabel(this.state,node,term,plural,CSL.TOLERANT);}return ret;};CSL.NameOutput.prototype._collapseAuthor=function(){var myqueue,mystr,oldchars;if(this.nameset_base===0&&this.Item[this.variables[0]]&&!this._first_creator_variable){this._first_creator_variable=this.variables[0];}if(this.item&&this.item["suppress-author"]&&this._first_creator_variable==this.variables[0]||this.state[this.state.tmp.area].opt.collapse&&this.state[this.state.tmp.area].opt.collapse.length||this.state[this.state.tmp.area].opt.cite_group_delimiter&&this.state[this.state.tmp.area].opt.cite_group_delimiter.length){if(this.state.tmp.authorstring_request){mystr="";myqueue=this.state.tmp.name_node.top.blobs.slice(-1)[0].blobs;oldchars=this.state.tmp.offset_characters;if(myqueue){mystr=this.state.output.string(this.state,myqueue,false);}this.state.tmp.offset_characters=oldchars;this.state.registry.authorstrings[this.Item.id]=mystr;}else if(!this.state.tmp.just_looking&&!this.state.tmp.suppress_decorations&&(this.item["suppress-author"]||this.state[this.state.tmp.area].opt.collapse&&this.state[this.state.tmp.area].opt.collapse.length||this.state[this.state.tmp.area].opt.cite_group_delimiter&&this.state[this.state.tmp.area].opt.cite_group_delimiter)){mystr="";myqueue=this.state.tmp.name_node.top.blobs.slice(-1)[0].blobs;oldchars=this.state.tmp.offset_characters;if(myqueue){mystr=this.state.output.string(this.state,myqueue,false);}if(mystr===this.state.tmp.last_primary_names_string){if(this.item["suppress-author"]||this.state[this.state.tmp.area].opt.collapse&&this.state[this.state.tmp.area].opt.collapse.length){this.state.tmp.name_node.top.blobs.pop();this.state.tmp.name_node.children=[];this.state.tmp.offset_characters=oldchars;}if(this.state[this.state.tmp.area].opt.cite_group_delimiter&&this.state[this.state.tmp.area].opt.cite_group_delimiter){this.state.tmp.use_cite_group_delimiter=true;}}else{this.state.tmp.last_primary_names_string=mystr;if(this.variables.indexOf(this._first_creator_variable)>-1&&this.item&&this.item["suppress-author"]&&this.Item.type!=="legal_case"){this.state.tmp.name_node.top.blobs.pop();this.state.tmp.name_node.children=[];this.state.tmp.offset_characters=oldchars;this.state.tmp.term_predecessor=false;}this.state.tmp.have_collapsed=false;if(this.state[this.state.tmp.area].opt.cite_group_delimiter&&this.state[this.state.tmp.area].opt.cite_group_delimiter){this.state.tmp.use_cite_group_delimiter=false;}}}}};module.exports=CSL;CSL.NameOutput.prototype.isPerson=function(value){if(value.literal||!value.given&&value.family&&value.isInstitution){return false;}else{return true;}};module.exports=CSL;CSL.NameOutput.prototype.truncatePersonalNameLists=function(){var v,i,ilen,j,jlen,chopvar,values;this.freeters_count={};this.persons_count={};this.institutions_count={};for(v in this.freeters){if(this.freeters.hasOwnProperty(v)){this.freeters_count[v]=this.freeters[v].length;this.freeters[v]=this._truncateNameList(this.freeters,v);}}for(v in this.persons){if(this.persons.hasOwnProperty(v)){this.institutions_count[v]=this.institutions[v].length;this._truncateNameList(this.institutions,v);this.persons[v]=this.persons[v].slice(0,this.institutions[v].length);this.persons_count[v]=[];for(j=0,jlen=this.persons[v].length;j<jlen;j+=1){this.persons_count[v][j]=this.persons[v][j].length;this.persons[v][j]=this._truncateNameList(this.persons,v,j);}}}if(this.etal_min===1&&this.etal_use_first===1&&!(this.state.tmp.extension||this.state.tmp.just_looking)){chopvar=v;}else{chopvar=false;}if(chopvar||this._please_chop){for(i=0,ilen=this.variables.length;i<ilen;i+=1){v=this.variables[i];if(this.freeters[v].length){if(this._please_chop===v){this.freeters[v]=this.freeters[v].slice(1);this.freeters_count[v]+=-1;this._please_chop=false;}else if(chopvar&&!this._please_chop){this.freeters[v]=this.freeters[v].slice(0,1);this.freeters_count[v]=1;this.institutions[v]=[];this.persons[v]=[];this._please_chop=chopvar;}}for(var j=0,jlen=this.persons[v].length;j<jlen;j++){if(this.persons[v][j].length){if(this._please_chop===v){this.persons[v][j]=this.persons[v][j].slice(1);this.persons_count[v][j]+=-1;this._please_chop=false;break;}else if(chopvar&&!this._please_chop){this.freeters[v]=this.persons[v][j].slice(0,1);this.freeters_count[v]=1;this.institutions[v]=[];this.persons[v]=[];values=[];this._please_chop=chopvar;break;}}}if(this.institutions[v].length){if(this._please_chop===v){this.institutions[v]=this.institutions[v].slice(1);this.institutions_count[v]+=-1;this._please_chop=false;}else if(chopvar&&!this._please_chop){this.institutions[v]=this.institutions[v].slice(0,1);this.institutions_count[v]=1;values=[];this._please_chop=chopvar;}}}}for(i=0,ilen=this.variables.length;i<ilen;i+=1){if(this.institutions[v].length){this.nameset_offset+=1;}for(var j=0,jlen=this.persons[v].length;j<jlen;j++){if(this.persons[v][j].length){this.nameset_offset+=1;}}}};CSL.NameOutput.prototype._truncateNameList=function(container,variable,index){var lst;if("undefined"===typeof index){lst=container[variable];}else{lst=container[variable][index];}if(this.state[this.state[this.state.tmp.area].root].opt.max_number_of_names&&lst.length>50&&lst.length>this.state[this.state[this.state.tmp.area].root].opt.max_number_of_names+2){var limit=this.state[this.state[this.state.tmp.area].root].opt.max_number_of_names;lst=lst.slice(0,limit+1).concat(lst.slice(-1));}return lst;};module.exports=CSL;CSL.NameOutput.prototype.divideAndTransliterateNames=function(){var i,ilen,j,jlen;var Item=this.Item;var variables=this.variables;this.varnames=variables.slice();this.freeters={};this.persons={};this.institutions={};for(i=0,ilen=variables.length;i<ilen;i+=1){var v=variables[i];this.variable_offset[v]=this.nameset_offset;var values=this._normalizeVariableValue(Item,v);if(this.name.strings["suppress-min"]&&values.length>=this.name.strings["suppress-min"]){values=[];}if(this.name.strings["suppress-max"]&&values.length<=this.name.strings["suppress-max"]){values=[];}this._getFreeters(v,values);this._getPersonsAndInstitutions(v,values);if(this.state.opt.development_extensions.spoof_institutional_affiliations){if(this.name.strings["suppress-min"]===0){this.freeters[v]=[];for(j=0,jlen=this.persons[v].length;j<jlen;j+=1){this.persons[v][j]=[];}}else if(this.institution.strings["suppress-min"]===0){this.institutions[v]=[];this.freeters[v]=this.freeters[v].concat(this.persons[v]);for(j=0,jlen=this.persons[v].length;j<jlen;j+=1){for(var k=0,klen=this.persons[v][j].length;k<klen;k+=1){this.freeters[v].push(this.persons[v][j][k]);}}this.persons[v]=[];}}}};CSL.NameOutput.prototype._normalizeVariableValue=function(Item,variable){var names,name,i,ilen;if("string"===typeof Item[variable]||"number"===typeof Item[variable]){CSL.debug("name variable \""+variable+"\" is string or number, not array. Attempting to fix.");names=[{literal:Item[variable]+""}];}else if(!Item[variable]){names=[];}else if("number"!==typeof Item[variable].length){CSL.debug("name variable \""+variable+"\" is object, not array. Attempting to fix.");Item[variable]=[Item[variable]];names=Item[variable].slice();}else{names=Item[variable].slice();}return names;};CSL.NameOutput.prototype._getFreeters=function(v,values){this.freeters[v]=[];if(this.state.opt.development_extensions.spoof_institutional_affiliations){for(var i=values.length-1;i>-1;i--){if(this.isPerson(values[i])){var value=this._checkNickname(values.pop());if(value){this.freeters[v].push(value);}}else{break;}}}else{for(var i=values.length-1;i>-1;i--){var value=values.pop();if(this.isPerson(value)){var value=this._checkNickname(value);}this.freeters[v].push(value);}}this.freeters[v].reverse();if(this.freeters[v].length){this.nameset_offset+=1;}};CSL.NameOutput.prototype._getPersonsAndInstitutions=function(v,values){this.persons[v]=[];this.institutions[v]=[];if(!this.state.opt.development_extensions.spoof_institutional_affiliations)return;var persons=[];var has_affiliates=false;var first=true;for(var i=values.length-1;i>-1;i+=-1){if(this.isPerson(values[i])){var value=this._checkNickname(values[i]);if(value){persons.push(value);}}else{has_affiliates=true;this.institutions[v].push(values[i]);if(!first){persons.reverse();this.persons[v].push(persons);persons=[];}first=false;}}if(has_affiliates){persons.reverse();this.persons[v].push(persons);this.persons[v].reverse();this.institutions[v].reverse();}};CSL.NameOutput.prototype._clearValues=function(values){for(var i=values.length-1;i>-1;i+=-1){values.pop();}};CSL.NameOutput.prototype._checkNickname=function(name){if(["interview","personal_communication"].indexOf(this.Item.type)>-1){var author="";author=CSL.Util.Names.getRawName(name);if(author&&this.state.sys.getAbbreviation&&!(this.item&&this.item["suppress-author"])){var normalizedKey=author;if(this.state.sys.normalizeAbbrevsKey){normalizedKey=this.state.sys.normalizeAbbrevsKey("author",author);}this.state.transform.loadAbbreviation("default","nickname",normalizedKey);var myLocalName=this.state.transform.abbrevs["default"].nickname[normalizedKey];if(myLocalName){if(myLocalName==="!here>>>"){name=false;}else{name={family:myLocalName,given:''};}}}}return name;};module.exports=CSL;CSL.NameOutput.prototype.joinPersons=function(blobs,pos,j,tokenname){var ret;if(!tokenname){tokenname="name";}if("undefined"===typeof j){if(this.etal_spec[pos].freeters===1){ret=this._joinEtAl(blobs,tokenname);}else if(this.etal_spec[pos].freeters===2){ret=this._joinEllipsis(blobs,tokenname);}else if(!this.state.tmp.sort_key_flag){ret=this._joinAnd(blobs,tokenname);}else{ret=this._join(blobs," ");}}else{if(this.etal_spec[pos].persons[j]===1){ret=this._joinEtAl(blobs,tokenname);}else if(this.etal_spec[pos].persons[j]===2){ret=this._joinEllipsis(blobs,tokenname);}else if(!this.state.tmp.sort_key_flag){ret=this._joinAnd(blobs,tokenname);}else{ret=this._join(blobs," ");}}return ret;};CSL.NameOutput.prototype.joinInstitutionSets=function(blobs,pos){var ret;if(this.etal_spec[pos].institutions===1){ret=this._joinEtAl(blobs,"institution");}else if(this.etal_spec[pos].institutions===2){ret=this._joinEllipsis(blobs,"institution");}else{ret=this._joinAnd(blobs,"institution");}return ret;};CSL.NameOutput.prototype.joinPersonsAndInstitutions=function(blobs){return this._join(blobs,this.state.tmp.name_delimiter);};CSL.NameOutput.prototype.joinFreetersAndInstitutionSets=function(blobs){var ret=this._join(blobs,"[never here]",this["with"].single,this["with"].multiple);return ret;};CSL.NameOutput.prototype._joinEtAl=function(blobs,tokenname){var blob=this._join(blobs,this.state.tmp.name_delimiter);this.state.output.openLevel(this._getToken(tokenname));this.state.output.current.value().strings.delimiter="";this.state.output.append(blob,"literal",true);if(blobs.length>1){this.state.output.append(this["et-al"].multiple,"literal",true);}else if(blobs.length===1){this.state.output.append(this["et-al"].single,"literal",true);}this.state.output.closeLevel();return this.state.output.pop();};CSL.NameOutput.prototype._joinEllipsis=function(blobs,tokenname){return this._join(blobs,this.state.tmp.name_delimiter,this.name.ellipsis.single,this.name.ellipsis.multiple,tokenname);};CSL.NameOutput.prototype._joinAnd=function(blobs,tokenname){return this._join(blobs,this.state.inheritOpt(this[tokenname],"delimiter",tokenname+"-delimiter",", "),this[tokenname].and.single,this[tokenname].and.multiple,tokenname);};CSL.NameOutput.prototype._join=function(blobs,delimiter,single,multiple,tokenname){var i,ilen;if(!blobs){return false;}for(i=blobs.length-1;i>-1;i+=-1){if(!blobs[i]||blobs[i].length===0||!blobs[i].blobs.length){blobs=blobs.slice(0,i).concat(blobs.slice(i+1));}}if(!blobs.length){return false;}else if(single&&blobs.length===2){if(single){single=new CSL.Blob(single.blobs,single);}blobs=[blobs[0],single,blobs[1]];}else{var delimiter_offset;if(multiple){delimiter_offset=2;}else{delimiter_offset=1;}for(i=0,ilen=blobs.length-delimiter_offset;i<ilen;i+=1){blobs[i].strings.suffix+=delimiter;}if(blobs.length>1){var blob=blobs.pop();if(multiple){multiple=new CSL.Blob(multiple.blobs,multiple);blobs.push(multiple);}else{if(single){single=new CSL.Blob(single.blobs,single);}blobs.push(single);}blobs.push(blob);}}this.state.output.openLevel();if(single&&multiple){this.state.output.current.value().strings.delimiter="";}for(i=0,ilen=blobs.length;i<ilen;i+=1){this.state.output.append(blobs[i],false,true);}this.state.output.closeLevel();return this.state.output.pop();};CSL.NameOutput.prototype._getToken=function(tokenname){var token=this[tokenname];if(tokenname==="institution"){var newtoken=new CSL.Token();return newtoken;}return token;};module.exports=CSL;CSL.NameOutput.prototype.setCommonTerm=function(){var variables=this.variables;var varnames=variables.slice();varnames.sort();this.common_term=varnames.join("");if(!this.common_term){return false;}var has_term=false;if(this.label&&this.label[this.variables[0]]){if(this.label[this.variables[0]].before){has_term=this.state.getTerm(this.common_term,this.label[this.variables[0]].before.strings.form,0);}else if(this.label[this.variables[0]].after){has_term=this.state.getTerm(this.common_term,this.label[this.variables[0]].after.strings.form,0);}}if(!this.state.locale[this.state.opt.lang].terms[this.common_term]||!has_term||this.variables.length<2){this.common_term=false;return;}var freeters_offset=0;for(var i=0,ilen=this.variables.length-1;i<ilen;i+=1){var v=this.variables[i];var vv=this.variables[i+1];if(this.freeters[v].length||this.freeters[vv].length){if(this.etal_spec[v].freeters!==this.etal_spec[vv].freeters||!this._compareNamesets(this.freeters[v],this.freeters[vv])){this.common_term=false;return;}freeters_offset+=1;}if(this.persons[v].length!==this.persons[vv].length){this.common_term=false;return;}for(var j=0,jlen=this.persons[v].length;j<jlen;j+=1){if(this.etal_spec[v].persons[j]!==this.etal_spec[vv].persons[j]||!this._compareNamesets(this.persons[v][j],this.persons[vv][j])){this.common_term=false;return;}}}};CSL.NameOutput.prototype._compareNamesets=function(base_nameset,nameset){if(base_nameset.length!==nameset.length){return false;}for(var i=0,ilen=nameset.length;i<ilen;i+=1){var name=nameset[i];for(var j=0,jlen=CSL.NAME_PARTS.length;j<jlen;j+=1){var part=CSL.NAME_PARTS[j];if(!base_nameset[i]||base_nameset[i][part]!=nameset[i][part]){return false;}}}return true;};module.exports=CSL;CSL.NameOutput.prototype.constrainNames=function(){this.names_count=0;var pos;for(var i=0,ilen=this.variables.length;i<ilen;i+=1){var v=this.variables[i];pos=this.nameset_base+i;if(this.freeters[v].length){this.state.tmp.names_max.push(this.freeters[v].length,"literal");this._imposeNameConstraints(this.freeters,this.freeters_count,v,pos);this.names_count+=this.freeters[v].length;}if(this.institutions[v].length){this.state.tmp.names_max.push(this.institutions[v].length,"literal");this._imposeNameConstraints(this.institutions,this.institutions_count,v,pos);this.persons[v]=this.persons[v].slice(0,this.institutions[v].length);this.names_count+=this.institutions[v].length;}for(var j=0,jlen=this.persons[v].length;j<jlen;j+=1){if(this.persons[v][j].length){this.state.tmp.names_max.push(this.persons[v][j].length,"literal");this._imposeNameConstraints(this.persons[v],this.persons_count[v],j,pos);this.names_count+=this.persons[v][j].length;}}}};CSL.NameOutput.prototype._imposeNameConstraints=function(lst,count,key,pos){var display_names=lst[key];var discretionary_names_length=this.state.tmp["et-al-min"];if(this.state.tmp.suppress_decorations){if(this.state.tmp.disambig_request&&this.state.tmp.disambig_request.names[pos]){discretionary_names_length=this.state.tmp.disambig_request.names[pos];}else if(count[key]>=this.etal_min){discretionary_names_length=this.etal_use_first;}}else{if(this.state.tmp.disambig_request&&this.state.tmp.disambig_request.names[pos]>this.etal_use_first){if(count[key]<this.etal_min){discretionary_names_length=count[key];}else{discretionary_names_length=this.state.tmp.disambig_request.names[pos];}}else if(count[key]>=this.etal_min){discretionary_names_length=this.etal_use_first;}if(this.etal_use_last&&discretionary_names_length>this.etal_min-2){discretionary_names_length=this.etal_min-2;}}var sane=this.etal_min>=this.etal_use_first;var overlength=count[key]>discretionary_names_length;if(discretionary_names_length>count[key]){discretionary_names_length=display_names.length;}if(sane&&overlength){if(this.etal_use_last){lst[key]=display_names.slice(0,discretionary_names_length).concat(display_names.slice(-1));}else{lst[key]=display_names.slice(0,discretionary_names_length);}}this.state.tmp.disambig_settings.names[pos]=lst[key].length;this.state.disambiguate.padBase(this.state.tmp.disambig_settings);};module.exports=CSL;CSL.NameOutput.prototype.disambigNames=function(){var pos;for(var i=0,ilen=this.variables.length;i<ilen;i+=1){var v=this.variables[i];pos=this.nameset_base+i;if(this.freeters[v].length){this._runDisambigNames(this.freeters[v],pos);}if(this.institutions[v].length){if("undefined"===typeof this.state.tmp.disambig_settings.givens[pos]){this.state.tmp.disambig_settings.givens[pos]=[];}for(var j=0,jlen=this.institutions[v].length;j<jlen;j+=1){if("undefined"===typeof this.state.tmp.disambig_settings.givens[pos][j]){this.state.tmp.disambig_settings.givens[pos].push(2);}}}for(var j=0,jlen=this.persons[v].length;j<jlen;j+=1){if(this.persons[v][j].length){this._runDisambigNames(this.persons[v][j],pos);}}}};CSL.NameOutput.prototype._runDisambigNames=function(lst,pos){var chk,myform,myinitials,param,i,ilen,paramx;for(i=0,ilen=lst.length;i<ilen;i+=1){if(!lst[i].given&&!lst[i].family){continue;}myinitials=this.state.inheritOpt(this.name,"initialize-with");this.state.registry.namereg.addname(""+this.Item.id,lst[i],i);chk=this.state.tmp.disambig_settings.givens[pos];if("undefined"===typeof chk){for(var j=0,jlen=pos+1;j<jlen;j+=1){if(!this.state.tmp.disambig_settings.givens[j]){this.state.tmp.disambig_settings.givens[j]=[];}}}chk=this.state.tmp.disambig_settings.givens[pos][i];if("undefined"===typeof chk){myform=this.state.inheritOpt(this.name,"form","name-form","long");param=this.state.registry.namereg.evalname(""+this.Item.id,lst[i],i,0,myform,myinitials);this.state.tmp.disambig_settings.givens[pos].push(param);}myform=this.state.inheritOpt(this.name,"form","name-form","long");paramx=this.state.registry.namereg.evalname(""+this.Item.id,lst[i],i,0,myform,myinitials);if(this.state.tmp.disambig_request){var val=this.state.tmp.disambig_settings.givens[pos][i];if(val===1&&this.state.citation.opt["givenname-disambiguation-rule"]==="by-cite"&&("undefined"===typeof this.state.inheritOpt(this.name,"initialize-with")||"undefined"===typeof lst[i].given)){val=2;}param=val;if(this.state.opt["disambiguate-add-givenname"]&&lst[i].given){param=this.state.registry.namereg.evalname(""+this.Item.id,lst[i],i,param,this.state.inheritOpt(this.name,"form","name-form","long"),this.state.inheritOpt(this.name,"initialize-with"));}}else{param=paramx;}if(!this.state.tmp.just_looking&&this.item&&this.item.position===CSL.POSITION_FIRST){if(paramx>param){param=paramx;}}if(!this.state.tmp.sort_key_flag){this.state.tmp.disambig_settings.givens[pos][i]=param;if("string"===typeof myinitials&&("undefined"===typeof this.name.strings["initialize"]||true===this.name.strings["initialize"])){this.state.tmp.disambig_settings.use_initials=true;}}}};module.exports=CSL;CSL.NameOutput.prototype.getEtAlConfig=function(){var item=this.item;this["et-al"]={};this.state.output.append(this.etal_term,this.etal_style,true);this["et-al"].single=this.state.output.pop();this["et-al"].single.strings.suffix=this.etal_suffix;this["et-al"].single.strings.prefix=this.etal_prefix_single;this.state.output.append(this.etal_term,this.etal_style,true);this["et-al"].multiple=this.state.output.pop();this["et-al"].multiple.strings.suffix=this.etal_suffix;this["et-al"].multiple.strings.prefix=this.etal_prefix_multiple;if("undefined"===typeof item){item={};}if(item.position){if(this.state.inheritOpt(this.name,"et-al-subsequent-min")){this.etal_min=this.state.inheritOpt(this.name,"et-al-subsequent-min");}else{this.etal_min=this.state.inheritOpt(this.name,"et-al-min");}if(this.state.inheritOpt(this.name,"et-al-subsequent-use-first")){this.etal_use_first=this.state.inheritOpt(this.name,"et-al-subsequent-use-first");}else{this.etal_use_first=this.state.inheritOpt(this.name,"et-al-use-first");}}else{if(this.state.tmp["et-al-min"]){this.etal_min=this.state.tmp["et-al-min"];}else{this.etal_min=this.state.inheritOpt(this.name,"et-al-min");}if(this.state.tmp["et-al-use-first"]){this.etal_use_first=this.state.tmp["et-al-use-first"];}else{this.etal_use_first=this.state.inheritOpt(this.name,"et-al-use-first");}if("boolean"===typeof this.state.tmp["et-al-use-last"]){this.etal_use_last=this.state.tmp["et-al-use-last"];}else{this.etal_use_last=this.state.inheritOpt(this.name,"et-al-use-last");}}if(!this.state.tmp["et-al-min"]){this.state.tmp["et-al-min"]=this.etal_min;}};module.exports=CSL;CSL.NameOutput.prototype.setEtAlParameters=function(){var i,ilen,j,jlen;for(i=0,ilen=this.variables.length;i<ilen;i+=1){var v=this.variables[i];if("undefined"===typeof this.etal_spec[v]){this.etal_spec[v]={freeters:0,institutions:0,persons:[]};}this.etal_spec[this.nameset_base+i]=this.etal_spec[v];if(this.freeters[v].length){this._setEtAlParameter("freeters",v);}for(j=0,jlen=this.persons[v].length;j<jlen;j+=1){if("undefined"===typeof this.etal_spec[v][j]){this.etal_spec[v].persons[j]=0;}this._setEtAlParameter("persons",v,j);}if(this.institutions[v].length){this._setEtAlParameter("institutions",v);}}};CSL.NameOutput.prototype._setEtAlParameter=function(type,v,j){var lst,count;if(type==="persons"){lst=this.persons[v][j];count=this.persons_count[v][j];}else{lst=this[type][v];count=this[type+"_count"][v];}if(lst.length<count&&!this.state.tmp.sort_key_flag){if(this.etal_use_last){if(type==="persons"){this.etal_spec[v].persons[j]=2;}else{this.etal_spec[v][type]=2;}}else{if(type==="persons"){this.etal_spec[v].persons[j]=1;}else{this.etal_spec[v][type]=1;}}}else{if(type==="persons"){this.etal_spec[v].persons[j]=0;}else{this.etal_spec[v][type]=0;}}};module.exports=CSL;CSL.NameOutput.prototype.renderAllNames=function(){var pos;for(var i=0,ilen=this.variables.length;i<ilen;i+=1){var v=this.variables[i];if(this.freeters[v].length||this.institutions[v].length){if(!this.state.tmp.group_context.tip.condition){this.state.tmp.just_did_number=false;}}pos=this.nameset_base+i;if(this.freeters[v].length){this.freeters[v]=this._renderNames(v,this.freeters[v],pos);}for(var j=0,jlen=this.institutions[v].length;j<jlen;j+=1){this.persons[v][j]=this._renderNames(v,this.persons[v][j],pos,j);}}this.renderInstitutionNames();};CSL.NameOutput.prototype.renderInstitutionNames=function(){for(var i=0,ilen=this.variables.length;i<ilen;i+=1){var v=this.variables[i];for(var j=0,jlen=this.institutions[v].length;j<jlen;j+=1){var institution,institution_short,institution_long,short_style,long_style;var name=this.institutions[v][j];var j,ret,optLangTag,jlen,key,localesets;if(this.state.tmp.extension){localesets=["sort"];}else if(name.isInstitution||name.literal){localesets=this.state.opt['cite-lang-prefs'].institutions;}else{localesets=this.state.opt['cite-lang-prefs'].persons;}var slot={primary:'locale-orig',secondary:false,tertiary:false};if(localesets){var slotnames=["primary","secondary","tertiary"];for(var k=0,klen=slotnames.length;k<klen;k+=1){if(localesets.length-1<k){break;}if(localesets[k]){slot[slotnames[k]]='locale-'+localesets[k];}}}else{slot.primary='locale-translat';}if(this.state.tmp.area!=="bibliography"&&!(this.state.tmp.area==="citation"&&this.state.opt.xclass==="note"&&this.item&&!this.item.position)){slot.secondary=false;slot.tertiary=false;}var res;this.setRenderedName(name);var institution=this._renderInstitutionName(v,name,slot,j);this.institutions[v][j]=institution;}}};CSL.NameOutput.prototype._renderInstitutionName=function(v,name,slot,j){var secondary,tertiary,long_style,short_style,institution,institution_short,institution_long;var res=this.getName(name,slot.primary,true);var primary=res.name;var usedOrig=res.usedOrig;if(primary){primary=this.fixupInstitution(primary,v,j);}secondary=false;if(slot.secondary){res=this.getName(name,slot.secondary,false,usedOrig);var secondary=res.name;usedOrig=res.usedOrig;if(secondary){secondary=this.fixupInstitution(secondary,v,j);}}tertiary=false;if(slot.tertiary){res=this.getName(name,slot.tertiary,false,usedOrig);tertiary=res.name;if(tertiary){tertiary=this.fixupInstitution(tertiary,v,j);}}var n={l:{pri:false,sec:false,ter:false},s:{pri:false,sec:false,ter:false}};if(primary){n.l.pri=primary["long"];n.s.pri=primary["short"].length?primary["short"]:primary["long"];}if(secondary){n.l.sec=secondary["long"];n.s.sec=secondary["short"].length?secondary["short"]:secondary["long"];}if(tertiary){n.l.ter=tertiary["long"];n.s.ter=tertiary["short"].length?tertiary["short"]:tertiary["long"];}switch(this.institution.strings["institution-parts"]){case"short":if(primary["short"].length){short_style=this._getShortStyle();institution=[this._composeOneInstitutionPart([n.s.pri,n.s.sec,n.s.ter],slot,short_style,v)];}else{long_style=this._getLongStyle(primary,v,j);institution=[this._composeOneInstitutionPart([n.l.pri,n.l.sec,n.l.ter],slot,long_style,v)];}break;case"short-long":long_style=this._getLongStyle(primary,v,j);short_style=this._getShortStyle();institution_short=this._renderOneInstitutionPart(primary["short"],short_style);institution_long=this._composeOneInstitutionPart([n.l.pri,n.l.sec,n.l.ter],slot,long_style,v);institution=[institution_short,institution_long];break;case"long-short":long_style=this._getLongStyle(primary,v,j);short_style=this._getShortStyle();institution_short=this._renderOneInstitutionPart(primary["short"],short_style);institution_long=this._composeOneInstitutionPart([n.l.pri,n.l.sec,n.l.ter],slot,long_style,v);institution=[institution_long,institution_short];break;default:long_style=this._getLongStyle(primary,v,j);institution=[this._composeOneInstitutionPart([n.l.pri,n.l.sec,n.l.ter],slot,long_style,v)];break;}var blob=this._join(institution," ");this.state.tmp.name_node.children.push(blob);return blob;};CSL.NameOutput.prototype._composeOneInstitutionPart=function(names,slot,style,v){var primary=false,secondary=false,tertiary=false,primary_tok,secondary_tok,tertiary_tok;if(names[0]){primary_tok=CSL.Util.cloneToken(style);if(this.state.opt.citeAffixes[slot.primary]){if("<i>"===this.state.opt.citeAffixes.institutions[slot.primary].prefix){var hasItalic=false;for(var i=0,ilen=primary_tok.decorations.length;i<ilen;i+=1){if(style.decorations[i][0]==="@font-style"&&primary_tok.decorations[i][1]==="italic"){hasItalic=true;}}if(!hasItalic){primary_tok.decorations.push(["@font-style","italic"]);}}}primary=this._renderOneInstitutionPart(names[0],primary_tok);}if(names[1]){secondary=this._renderOneInstitutionPart(names[1],style);}if(names[2]){tertiary=this._renderOneInstitutionPart(names[2],style);}var institutionblob;if(secondary||tertiary){this.state.output.openLevel("empty");this.state.output.append(primary);secondary_tok=CSL.Util.cloneToken(style);if(slot.secondary){secondary_tok.strings.prefix=this.state.opt.citeAffixes.institutions[slot.secondary].prefix;secondary_tok.strings.suffix=this.state.opt.citeAffixes.institutions[slot.secondary].suffix;if(!secondary_tok.strings.prefix){secondary_tok.strings.prefix=" ";}}var secondary_outer=new CSL.Token();secondary_outer.decorations.push(["@font-style","normal"]);secondary_outer.decorations.push(["@font-weight","normal"]);this.state.output.openLevel(secondary_outer);this.state.output.append(secondary,secondary_tok);this.state.output.closeLevel();tertiary_tok=CSL.Util.cloneToken(style);if(slot.tertiary){tertiary_tok.strings.prefix=this.state.opt.citeAffixes.institutions[slot.tertiary].prefix;tertiary_tok.strings.suffix=this.state.opt.citeAffixes.institutions[slot.tertiary].suffix;if(!tertiary_tok.strings.prefix){tertiary_tok.strings.prefix=" ";}}var tertiary_outer=new CSL.Token();tertiary_outer.decorations.push(["@font-style","normal"]);tertiary_outer.decorations.push(["@font-weight","normal"]);this.state.output.openLevel(tertiary_outer);this.state.output.append(tertiary,tertiary_tok);this.state.output.closeLevel();this.state.output.closeLevel();institutionblob=this.state.output.pop();}else{institutionblob=primary;}return institutionblob;};CSL.NameOutput.prototype._renderOneInstitutionPart=function(blobs,style){for(var i=0,ilen=blobs.length;i<ilen;i+=1){if(blobs[i]){var str=blobs[i];if(this.state.tmp.strip_periods){str=str.replace(/\./g,"");}else{for(var j=0,jlen=style.decorations.length;j<jlen;j+=1){if("@strip-periods"===style.decorations[j][0]&&"true"===style.decorations[j][1]){str=str.replace(/\./g,"");break;}}}this.state.tmp.group_context.tip.variable_success=true;this.state.tmp.can_substitute.replace(false,CSL.LITERAL);if(str==="!here>>>"){blobs[i]=false;}else{this.state.output.append(str,style,true);blobs[i]=this.state.output.pop();}}}if("undefined"===typeof this.institution.strings["part-separator"]){this.institution.strings["part-separator"]=this.state.tmp.name_delimiter;}return this._join(blobs,this.institution.strings["part-separator"]);};CSL.NameOutput.prototype._renderNames=function(v,values,pos,j){var ret=false;if(values.length){var names=[];for(var i=0,ilen=values.length;i<ilen;i+=1){var name=values[i];var ret,optLangTag,jlen,key,localesets;if(this.state.tmp.extension){localesets=["sort"];}else if(name.isInstitution||name.literal){localesets=this.state.opt['cite-lang-prefs'].institutions;}else{localesets=this.state.opt['cite-lang-prefs'].persons;}var slot={primary:'locale-orig',secondary:false,tertiary:false};if(localesets){var slotnames=["primary","secondary","tertiary"];for(var k=0,klen=slotnames.length;k<klen;k+=1){if(localesets.length-1<k){break;}slot[slotnames[k]]='locale-'+localesets[k];}}else{slot.primary='locale-translat';}if(this.state.tmp.sort_key_flag||this.state.tmp.area!=="bibliography"&&!(this.state.tmp.area==="citation"&&this.state.opt.xclass==="note"&&this.item&&!this.item.position)){slot.secondary=false;slot.tertiary=false;}this.setRenderedName(name);if(!name.literal&&!name.isInstitution){var nameBlob=this._renderPersonalName(v,name,slot,pos,i,j);var nameToken=CSL.Util.cloneToken(this.name);this.state.output.append(nameBlob,nameToken,true);names.push(this.state.output.pop());}else{names.push(this._renderInstitutionName(v,name,slot,j));}}ret=this.joinPersons(names,pos,j);}return ret;};CSL.NameOutput.prototype._renderPersonalName=function(v,name,slot,pos,i,j){var res=this.getName(name,slot.primary,true);var primary=this._renderOnePersonalName(res.name,pos,i,j);var secondary=false;if(slot.secondary){res=this.getName(name,slot.secondary,false,res.usedOrig);if(res.name){secondary=this._renderOnePersonalName(res.name,pos,i,j);}}var tertiary=false;if(slot.tertiary){res=this.getName(name,slot.tertiary,false,res.usedOrig);if(res.name){tertiary=this._renderOnePersonalName(res.name,pos,i,j);}}var personblob;if(secondary||tertiary){this.state.output.openLevel("empty");this.state.output.append(primary);var secondary_tok=new CSL.Token();if(slot.secondary){secondary_tok.strings.prefix=this.state.opt.citeAffixes.persons[slot.secondary].prefix;secondary_tok.strings.suffix=this.state.opt.citeAffixes.persons[slot.secondary].suffix;if(!secondary_tok.strings.prefix){secondary_tok.strings.prefix=" ";}}this.state.output.append(secondary,secondary_tok);var tertiary_tok=new CSL.Token();if(slot.tertiary){tertiary_tok.strings.prefix=this.state.opt.citeAffixes.persons[slot.tertiary].prefix;tertiary_tok.strings.suffix=this.state.opt.citeAffixes.persons[slot.tertiary].suffix;if(!tertiary_tok.strings.prefix){tertiary_tok.strings.prefix=" ";}}this.state.output.append(tertiary,tertiary_tok);this.state.output.closeLevel();personblob=this.state.output.pop();}else{personblob=primary;}return personblob;};CSL.NameOutput.prototype._isRomanesque=function(name){var ret=2;if(!name.family.replace(/\"/g,'').match(CSL.ROMANESQUE_REGEXP)){ret=0;}if(!ret&&name.given&&name.given.match(CSL.STARTSWITH_ROMANESQUE_REGEXP)){ret=1;}var top_locale;if(ret==2){if(name.multi&&name.multi.main){top_locale=name.multi.main.slice(0,2);}else if(this.Item.language){top_locale=this.Item.language.slice(0,2);}if(["ja","zh"].indexOf(top_locale)>-1){ret=1;}}return ret;};CSL.NameOutput.prototype._renderOnePersonalName=function(value,pos,i,j){var name=value;var dropping_particle=this._droppingParticle(name,pos,j);var family=this._familyName(name);var non_dropping_particle=this._nonDroppingParticle(name);var given=this._givenName(name,pos,i);var suffix=this._nameSuffix(name);if(given===false){dropping_particle=false;suffix=false;}var sort_sep=this.state.inheritOpt(this.name,"sort-separator");if(!sort_sep){sort_sep="";}var suffix_sep;if(name["comma-suffix"]){suffix_sep=", ";}else{suffix_sep=" ";}var romanesque=this._isRomanesque(name);function hasJoiningPunctuation(blob){if(!blob){return false;}else if("string"===typeof blob.blobs){if(["\u2019","\'","-"," "].indexOf(blob.blobs.slice(-1))>-1){return true;}else{return false;}}else{return hasJoiningPunctuation(blob.blobs[blob.blobs.length-1]);}}var has_hyphenated_non_dropping_particle=hasJoiningPunctuation(non_dropping_particle);var blob,merged,first,second;if(romanesque===0){blob=this._join([non_dropping_particle,family,given],"");}else if(romanesque===1||name["static-ordering"]){blob=this._join([non_dropping_particle,family,given]," ");}else if(name["reverse-ordering"]){blob=this._join([given,non_dropping_particle,family]," ");}else if(this.state.tmp.sort_key_flag){if(this.state.opt["demote-non-dropping-particle"]==="never"){first=this._join([non_dropping_particle,family,dropping_particle]," ");merged=this._join([first,given],this.state.opt.sort_sep);blob=this._join([merged,suffix]," ");}else{second=this._join([given,dropping_particle,non_dropping_particle]," ");merged=this._join([family,second],this.state.opt.sort_sep);blob=this._join([merged,suffix]," ");}}else if(this.state.inheritOpt(this.name,"name-as-sort-order")==="all"||this.state.inheritOpt(this.name,"name-as-sort-order")==="first"&&i===0&&(j===0||"undefined"===typeof j)){if(["Lord","Lady"].indexOf(name.given)>-1){sort_sep=", ";}if(["always","display-and-sort"].indexOf(this.state.opt["demote-non-dropping-particle"])>-1){second=this._join([given,dropping_particle],name["comma-dropping-particle"]+" ");second=this._join([second,non_dropping_particle]," ");if(second&&this.given){second.strings.prefix=this.given.strings.prefix;second.strings.suffix=this.given.strings.suffix;}if(family&&this.family){family.strings.prefix=this.family.strings.prefix;family.strings.suffix=this.family.strings.suffix;}merged=this._join([family,second],sort_sep);blob=this._join([merged,suffix],sort_sep);}else{if(has_hyphenated_non_dropping_particle){first=this._join([non_dropping_particle,family],"");}else{first=this._join([non_dropping_particle,family]," ");}if(first&&this.family){first.strings.prefix=this.family.strings.prefix;first.strings.suffix=this.family.strings.suffix;}second=this._join([given,dropping_particle],name["comma-dropping-particle"]+" ");if(second&&this.given){second.strings.prefix=this.given.strings.prefix;second.strings.suffix=this.given.strings.suffix;}merged=this._join([first,second],sort_sep);blob=this._join([merged,suffix],sort_sep);}}else{if(name["dropping-particle"]&&name.family&&!name["non-dropping-particle"]){if(["'","\u02BC","\u2019","-"].indexOf(name["dropping-particle"].slice(-1))>-1){family=this._join([dropping_particle,family],"");dropping_particle=false;}}if(!this.state.tmp.term_predecessor){}var space=" ";if(this.state.inheritOpt(this.name,"initialize-with")&&this.state.inheritOpt(this.name,"initialize-with").match(/[\u00a0\ufeff]/)&&["fr","ru","cs"].indexOf(this.state.opt["default-locale"][0].slice(0,2))>-1){space="\xA0";}if(has_hyphenated_non_dropping_particle){second=this._join([non_dropping_particle,family],"");second=this._join([dropping_particle,second],space);}else{second=this._join([dropping_particle,non_dropping_particle,family],space);}second=this._join([second,suffix],suffix_sep);if(second&&this.family){second.strings.prefix=this.family.strings.prefix;second.strings.suffix=this.family.strings.suffix;}if(given&&this.given){given.strings.prefix=this.given.strings.prefix;given.strings.suffix=this.given.strings.suffix;}if(second.strings.prefix){name["comma-dropping-particle"]="";}blob=this._join([given,second],name["comma-dropping-particle"]+space);}this.state.tmp.group_context.tip.variable_success=true;this.state.tmp.can_substitute.replace(false,CSL.LITERAL);this.state.tmp.term_predecessor=true;this.state.tmp.name_node.children.push(blob);return blob;};CSL.NameOutput.prototype._normalizeNameInput=function(value){var name={literal:value.literal,family:value.family,isInstitution:value.isInstitution,given:value.given,suffix:value.suffix,"comma-suffix":value["comma-suffix"],"non-dropping-particle":value["non-dropping-particle"],"dropping-particle":value["dropping-particle"],"static-ordering":value["static-ordering"],"static-particles":value["static-particles"],"reverse-ordering":value["reverse-ordering"],"full-form-always":value["full-form-always"],"parse-names":value["parse-names"],"comma-dropping-particle":"",block_initialize:value.block_initialize,multi:value.multi};this._parseName(name);return name;};CSL.NameOutput.prototype._stripPeriods=function(tokname,str){var decor_tok=this[tokname+"_decor"];if(str){if(this.state.tmp.strip_periods){str=str.replace(/\./g,"");}else if(decor_tok){for(var i=0,ilen=decor_tok.decorations.length;i<ilen;i+=1){if("@strip-periods"===decor_tok.decorations[i][0]&&"true"===decor_tok.decorations[i][1]){str=str.replace(/\./g,"");break;}}}}return str;};CSL.NameOutput.prototype._nonDroppingParticle=function(name){var ndp=name["non-dropping-particle"];if(ndp&&this.state.tmp.sort_key_flag){ndp=ndp.replace(/[\'\u2019]/,"");}var str=this._stripPeriods("family",ndp);if(this.state.output.append(str,this.family_decor,true)){return this.state.output.pop();}return false;};CSL.NameOutput.prototype._droppingParticle=function(name,pos,j){var dp=name["dropping-particle"];if(dp&&this.state.tmp.sort_key_flag){dp=dp.replace(/[\'\u2019]/,"");}var str=this._stripPeriods("given",dp);if(name["dropping-particle"]&&name["dropping-particle"].match(/^et.?al[^a-z]$/)){if(this.state.inheritOpt(this.name,"et-al-use-last")){if("undefined"===typeof j){this.etal_spec[pos].freeters=2;}else{this.etal_spec[pos].persons=2;}}else{if("undefined"===typeof j){this.etal_spec[pos].freeters=1;}else{this.etal_spec[pos].persons=1;}}name["comma-dropping-particle"]="";}else if(this.state.output.append(str,this.given_decor,true)){return this.state.output.pop();}return false;};CSL.NameOutput.prototype._familyName=function(name){var str=this._stripPeriods("family",name.family);if(this.state.output.append(str,this.family_decor,true)){return this.state.output.pop();}return false;};CSL.NameOutput.prototype._givenName=function(name,pos,i){var ret;var formIsShort=this.state.inheritOpt(this.name,"form","name-form","long")!=="long";var initializeIsTurnedOn=!(this.state.inheritOpt(this.name,"initialize")===false);var hasInitializeWith="string"===typeof this.state.inheritOpt(this.name,"initialize-with")&&!name.block_initialize;var inBibliography=this.state.tmp.area.slice(0,12)==="bibliography";var defaultLevel;var useLevel;if(name["full-form-always"]){useLevel=2;}else{if(formIsShort){defaultLevel=0;}else if(hasInitializeWith){defaultLevel=1;}else{defaultLevel=2;}var requestedLevel=this.state.tmp.disambig_settings.givens[pos][i];if(requestedLevel>defaultLevel){useLevel=requestedLevel;}else{useLevel=defaultLevel;}}var gdropt=this.state.citation.opt["givenname-disambiguation-rule"];if(gdropt&&gdropt.slice(-14)==="-with-initials"){hasInitializeWith=true;}if(name.family&&useLevel===1){if(hasInitializeWith){var initialize_with=this.state.inheritOpt(this.name,"initialize-with",false,"");name.given=CSL.Util.Names.initializeWith(this.state,name.given,initialize_with,!initializeIsTurnedOn);}else{name.given=CSL.Util.Names.unInitialize(this.state,name.given);}}else if(useLevel===0){return false;}else if(useLevel===2){name.given=CSL.Util.Names.unInitialize(this.state,name.given);}var str=this._stripPeriods("given",name.given);var rendered=this.state.output.append(str,this.given_decor,true);if(rendered){ret=this.state.output.pop();return ret;}return false;};CSL.NameOutput.prototype._nameSuffix=function(name){var str=name.suffix,ret;if("string"===typeof this.state.inheritOpt(this.name,"initialize-with")){str=CSL.Util.Names.initializeWith(this.state,name.suffix,this.state.inheritOpt(this.name,"initialize-with"),true);}str=this._stripPeriods("family",str);var toSuffix='';if(str&&str.slice(-1)==='.'){str=str.slice(0,-1);toSuffix='.';}var rendered=this.state.output.append(str,"empty",true);if(rendered){ret=this.state.output.pop();ret.strings.suffix=toSuffix+ret.strings.suffix;return ret;}return false;};CSL.NameOutput.prototype._getLongStyle=function(name,v,i){var long_style,short_style;if(name["short"].length){if(this.institutionpart["long-with-short"]){long_style=this.institutionpart["long-with-short"];}else{long_style=this.institutionpart["long"];}}else{long_style=this.institutionpart["long"];}if(!long_style){long_style=new CSL.Token();}return long_style;};CSL.NameOutput.prototype._getShortStyle=function(){var short_style;if(this.institutionpart["short"]){short_style=this.institutionpart["short"];}else{short_style=new CSL.Token();}return short_style;};CSL.NameOutput.prototype._parseName=function(name){var m,idx;if(!name["parse-names"]&&"undefined"!==typeof name["parse-names"]){return name;}if(name.family&&!name.given&&name.isInstitution){name.literal=name.family;name.family=undefined;name.isInstitution=undefined;}var noparse;if(name.family&&name.family.slice(0,1)==='"'&&name.family.slice(-1)==='"'||!name["parse-names"]&&"undefined"!==typeof name["parse-names"]){name.family=name.family.slice(1,-1);noparse=true;name["parse-names"]=0;}else{noparse=false;}if(this.state.opt.development_extensions.parse_names){if(!name["non-dropping-particle"]&&name.family&&!noparse&&name.given){if(!name["static-particles"]){CSL.parseParticles(name,true);}}}};CSL.NameOutput.prototype.getName=function(name,slotLocaleset,fallback,stopOrig){if(stopOrig&&slotLocaleset==='locale-orig'){return{name:false,usedOrig:stopOrig};}if(!name.family){name.family="";}if(!name.given){name.given="";}var name_params={};name_params["static-ordering"]=this.getStaticOrder(name);var foundTag=true;var langTag;if(slotLocaleset!=='locale-orig'){foundTag=false;if(name.multi){var langTags=this.state.opt[slotLocaleset];for(var i=0,ilen=langTags.length;i<ilen;i+=1){langTag=langTags[i];if(name.multi._key[langTag]){foundTag=true;var isInstitution=name.isInstitution;name=name.multi._key[langTag];name.isInstitution=isInstitution;name_params=this.getNameParams(langTag);name_params.transliterated=true;break;}}}}if(!foundTag){langTag=false;if(name.multi&&name.multi.main){langTag=name.multi.main;}else if(this.Item.language){langTag=this.Item.language;}if(langTag){name_params=this.getNameParams(langTag);}}if(!fallback&&!foundTag){return{name:false,usedOrig:stopOrig};}if(!name.family){name.family="";}if(!name.given){name.given="";}name={family:name.family,given:name.given,"non-dropping-particle":name["non-dropping-particle"],"dropping-particle":name["dropping-particle"],suffix:name.suffix,"static-ordering":name_params["static-ordering"],"static-particles":name["static-particles"],"reverse-ordering":name_params["reverse-ordering"],"full-form-always":name_params["full-form-always"],"parse-names":name["parse-names"],"comma-suffix":name["comma-suffix"],"comma-dropping-particle":name["comma-dropping-particle"],transliterated:name_params.transliterated,block_initialize:name_params["block-initialize"],literal:name.literal,isInstitution:name.isInstitution,multi:name.multi};if(!name.literal&&!name.given&&name.family&&name.isInstitution){name.literal=name.family;}if(name.literal){delete name.family;delete name.given;}name=this._normalizeNameInput(name);var usedOrig;if(stopOrig){usedOrig=stopOrig;}else{usedOrig=!foundTag;}return{name:name,usedOrig:usedOrig};};CSL.NameOutput.prototype.getNameParams=function(langTag){var ret={};var langspec=CSL.localeResolve(this.Item.language,this.state.opt["default-locale"][0]);var try_locale=this.state.locale[langspec.best]?langspec.best:this.state.opt["default-locale"][0];var name_as_sort_order=this.state.locale[try_locale].opts["name-as-sort-order"];var name_as_reverse_order=this.state.locale[try_locale].opts["name-as-reverse-order"];var name_never_short=this.state.locale[try_locale].opts["name-never-short"];var field_lang_bare=langTag.split("-")[0];if(name_as_sort_order&&name_as_sort_order[field_lang_bare]){ret["static-ordering"]=true;ret["reverse-ordering"]=false;}if(name_as_reverse_order&&name_as_reverse_order[field_lang_bare]){ret["reverse-ordering"]=true;ret["static-ordering"]=false;}if(name_never_short&&name_never_short[field_lang_bare]){ret["full-form-always"]=true;}if(ret["static-ordering"]){ret["block-initialize"]=true;}return ret;};CSL.NameOutput.prototype.setRenderedName=function(name){if(this.state.tmp.area==="bibliography"){var strname="";for(var j=0,jlen=CSL.NAME_PARTS.length;j<jlen;j+=1){if(name[CSL.NAME_PARTS[j]]){strname+=name[CSL.NAME_PARTS[j]];}}this.state.tmp.rendered_name.push(strname);}};CSL.NameOutput.prototype.fixupInstitution=function(name,varname,listpos){if(this.state.sys.getHumanForm&&"legal_case"===this.Item.type&&"authority"===varname){name.literal=this.state.sys.getHumanForm(this.Item.jurisdiction,name.literal,true);}name=this._splitInstitution(name,varname,listpos);if(this.institution.strings["reverse-order"]){name["long"].reverse();}var long_form=name["long"];var short_form=name["long"].slice();var use_short_form=false;if(this.state.sys.getAbbreviation){var jurisdiction=this.Item.jurisdiction;for(var j=0,jlen=long_form.length;j<jlen;j+=1){var normalizedKey=long_form[j];if(this.state.sys.normalizeAbbrevsKey){normalizedKey=this.state.sys.normalizeAbbrevsKey(varname,long_form[j]);}jurisdiction=this.state.transform.loadAbbreviation(jurisdiction,"institution-part",normalizedKey);if(this.state.transform.abbrevs[jurisdiction]["institution-part"][normalizedKey]){short_form[j]=this.state.transform.abbrevs[jurisdiction]["institution-part"][normalizedKey];use_short_form=true;}}}if(use_short_form){name["short"]=short_form;}else{name["short"]=[];}return name;};CSL.NameOutput.prototype.getStaticOrder=function(name,refresh){var static_ordering_val=false;if(!refresh&&name["static-ordering"]){static_ordering_val=true;}else if(this._isRomanesque(name)===0){static_ordering_val=true;}else if((!name.multi||!name.multi.main)&&this.Item.language&&['vi','hu'].indexOf(this.Item.language)>-1){static_ordering_val=true;}else if(name.multi&&name.multi.main&&['vi','hu'].indexOf(name.multi.main.slice(0,2))>-1){static_ordering_val=true;}else{if(this.state.opt['auto-vietnamese-names']&&CSL.VIETNAMESE_NAMES.exec(name.family+" "+name.given)&&CSL.VIETNAMESE_SPECIALS.exec(name.family+name.given)){static_ordering_val=true;}}return static_ordering_val;};CSL.NameOutput.prototype._splitInstitution=function(value,v,i){var ret={};if(!value.literal&&value.family){value.literal=value.family;delete value.family;}var splitInstitution=value.literal.replace(/\s*\|\s*/g,"|");splitInstitution=splitInstitution.split("|");if(this.institution.strings.form==="short"&&this.state.sys.getAbbreviation){var jurisdiction=this.Item.jurisdiction;for(var j=splitInstitution.length;j>0;j+=-1){var str=splitInstitution.slice(0,j).join("|");var normalizedKey=str;if(this.state.sys.normalizeAbbrevsKey){normalizedKey=this.state.sys.normalizeAbbrevsKey(v,str);}jurisdiction=this.state.transform.loadAbbreviation(jurisdiction,"institution-entire",normalizedKey);if(this.state.transform.abbrevs[jurisdiction]["institution-entire"][normalizedKey]){var splitLst=this.state.transform.abbrevs[jurisdiction]["institution-entire"][normalizedKey];splitLst=this.state.transform.quashCheck(splitLst);var splitSplitLst=splitLst.split(/>>[0-9]{4}>>/);var m=splitLst.match(/>>([0-9]{4})>>/);splitLst=splitSplitLst.pop();if(splitSplitLst.length>0&&this.Item["original-date"]&&this.Item["original-date"].year){for(var k=m.length-1;k>0;k+=-1){if(parseInt(this.Item["original-date"].year,10)>=parseInt(m[k],10)){break;}splitLst=splitSplitLst.pop();}}splitLst=splitLst.replace(/\s*\|\s*/g,"|");splitInstitution=[splitLst];break;}}}splitInstitution.reverse();ret["long"]=this._trimInstitution(splitInstitution,v,i);return ret;};CSL.NameOutput.prototype._trimInstitution=function(subunits,v,i){var use_first=false;var append_last=false;var s=subunits.slice();var stop_last=false;if(this.institution){if("undefined"!==typeof this.institution.strings["use-first"]){use_first=this.institution.strings["use-first"];}if("undefined"!==typeof this.institution.strings["stop-last"]){stop_last=this.institution.strings["stop-last"];}else if("authority"===v&&this.state.tmp.authority_stop_last){stop_last=this.state.tmp.authority_stop_last;}if(stop_last){s=s.slice(0,stop_last);subunits=subunits.slice(0,stop_last);}if("undefined"!==typeof this.institution.strings["use-last"]){append_last=this.institution.strings["use-last"];}if("authority"===v){if(stop_last){this.state.tmp.authority_stop_last=stop_last;}if(append_last){this.state.tmp.authority_stop_last+=append_last*-1;}}}if(false===use_first){if(this.persons[v].length===0){use_first=this.institution.strings["substitute-use-first"];}if(!use_first){use_first=0;}}if(false===append_last){if(!use_first){append_last=subunits.length;}else{append_last=0;}}if(use_first>subunits.length-append_last){use_first=subunits.length-append_last;}subunits=subunits.slice(0,use_first);s=s.slice(use_first);if(append_last){if(append_last>s.length){append_last=s.length;}if(append_last){subunits=subunits.concat(s.slice(s.length-append_last));}}return subunits;};module.exports=CSL;CSL.PublisherOutput=function(state,group_tok){this.state=state;this.group_tok=group_tok;this.varlist=[];};CSL.PublisherOutput.prototype.render=function(){this.clearVars();this.composeAndBlob();this.composeElements();this.composePublishers();this.joinPublishers();};CSL.PublisherOutput.prototype.composeAndBlob=function(){this.and_blob={};var and_term=false;if(this.group_tok.strings.and==="text"){and_term=this.state.getTerm("and");}else if(this.group_tok.strings.and==="symbol"){and_term="&";}var tok=new CSL.Token();tok.strings.suffix=" ";tok.strings.prefix=" ";this.state.output.append(and_term,tok,true);var no_delim=this.state.output.pop();tok.strings.prefix=this.group_tok.strings["subgroup-delimiter"];this.state.output.append(and_term,tok,true);var with_delim=this.state.output.pop();this.and_blob.single=false;this.and_blob.multiple=false;if(and_term){if(this.group_tok.strings["subgroup-delimiter-precedes-last"]==="always"){this.and_blob.single=with_delim;}else if(this.group_tok.strings["subgroup-delimiter-precedes-last"]==="never"){this.and_blob.single=no_delim;this.and_blob.multiple=no_delim;}else{this.and_blob.single=no_delim;this.and_blob.multiple=with_delim;}}};CSL.PublisherOutput.prototype.composeElements=function(){for(var i=0,ilen=2;i<ilen;i+=1){var varname=["publisher","publisher-place"][i];for(var j=0,jlen=this["publisher-list"].length;j<jlen;j+=1){var str=this[varname+"-list"][j];var tok=this[varname+"-token"];this.state.output.append(str,tok,true);this[varname+"-list"][j]=this.state.output.pop();}}};CSL.PublisherOutput.prototype.composePublishers=function(){var blobs;for(var i=0,ilen=this["publisher-list"].length;i<ilen;i+=1){var ordered_list=[];blobs=[this[this.varlist[0]+"-list"][i],this[this.varlist[1]+"-list"][i]];this["publisher-list"][i]=this._join(blobs,this.group_tok.strings.delimiter);}};CSL.PublisherOutput.prototype.joinPublishers=function(){var blobs=this["publisher-list"];var delim=this.name_delimiter;var publishers=this._join(blobs,this.group_tok.strings["subgroup-delimiter"],this.and_blob.single,this.and_blob.multiple,this.group_tok);this.state.output.append(publishers,"literal");};CSL.PublisherOutput.prototype._join=CSL.NameOutput.prototype._join;CSL.PublisherOutput.prototype._getToken=CSL.NameOutput.prototype._getToken;CSL.PublisherOutput.prototype.clearVars=function(){this.state.tmp["publisher-list"]=false;this.state.tmp["publisher-place-list"]=false;this.state.tmp["publisher-group-token"]=false;this.state.tmp["publisher-token"]=false;this.state.tmp["publisher-place-token"]=false;};module.exports=CSL;CSL.evaluateLabel=function(node,state,Item,item){var myterm;if("locator"===node.strings.term){if(item&&item.label){if(item.label==="sub verbo"){myterm="sub-verbo";}else{myterm=item.label;}}if(!myterm){myterm="page";}}else{myterm=node.strings.term;}var plural=node.strings.plural;if("number"!==typeof plural){var theItem=node.strings.term==="locator"?item:Item;state.processNumber(false,theItem,node.strings.term,Item.type);plural=state.tmp.shadow_numbers[node.strings.term].plural;if(!state.tmp.shadow_numbers[node.strings.term].labelForm&&!state.tmp.shadow_numbers[node.strings.term].labelDecorations){state.tmp.shadow_numbers[node.strings.term].labelForm=node.strings.form;state.tmp.shadow_numbers[node.strings.term].labelCapitalizeIfFirst=node.strings.capitalize_if_first;state.tmp.shadow_numbers[node.strings.term].labelDecorations=node.decorations.slice();}if(["locator","number","page"].indexOf(node.strings.term)>-1&&state.tmp.shadow_numbers[node.strings.term].label){myterm=state.tmp.shadow_numbers[node.strings.term].label;}if(node.decorations&&(state.opt.development_extensions.csl_reverse_lookup_support||state.sys.csl_reverse_lookup_support)){node.decorations.reverse();node.decorations.push(["@showid","true",node.cslid]);node.decorations.reverse();}}return CSL.castLabel(state,node,myterm,plural,CSL.TOLERANT);};CSL.castLabel=function(state,node,term,plural,mode){var label_form=node.strings.form;var label_capitalize_if_first=node.strings.capitalize_if_first;if(state.tmp.group_context.tip.label_form&&label_form!=="static"){label_form=state.tmp.group_context.tip.label_form;}if(state.tmp.group_context.tip.label_capitalize_if_first){label_capitalize_if_first=state.tmp.group_context.tip.label_capitalize_if_first;}var ret=state.getTerm(term,label_form,plural,false,mode,node.default_locale);if(label_capitalize_if_first){ret=CSL.Output.Formatters["capitalize-first"](state,ret);}if(state.tmp.strip_periods){ret=ret.replace(/\./g,"");}else{for(var i=0,ilen=node.decorations.length;i<ilen;i+=1){if("@strip-periods"===node.decorations[i][0]&&"true"===node.decorations[i][1]){ret=ret.replace(/\./g,"");break;}}}return ret;};module.exports=CSL;CSL.Node.name={build:function build(state,target){var func,pos,len,attrname;if([CSL.SINGLETON,CSL.START].indexOf(this.tokentype)>-1){var oldTmpRoot;if("undefined"===typeof state.tmp.root){oldTmpRoot=undefined;state.tmp.root="citation";}else{oldTmpRoot=state.tmp.root;}if(state.inheritOpt(this,"et-al-subsequent-min")&&state.inheritOpt(this,"et-al-subsequent-min")!==state.inheritOpt(this,"et-al-min")){state.opt.update_mode=CSL.POSITION;}if(state.inheritOpt(this,"et-al-subsequent-use-first")&&state.inheritOpt(this,"et-al-subsequent-use-first")!==state.inheritOpt(this,"et-al-use-first")){state.opt.update_mode=CSL.POSITION;}state.tmp.root=oldTmpRoot;func=function func(state,Item){state.tmp.etal_term="et-al";state.tmp.name_delimiter=state.inheritOpt(this,"delimiter","name-delimiter",", ");state.tmp["delimiter-precedes-et-al"]=state.inheritOpt(this,"delimiter-precedes-et-al");if("text"===state.inheritOpt(this,"and")){this.and_term=state.getTerm("and","long",0);}else if("symbol"===state.inheritOpt(this,"and")){if(state.opt.development_extensions.expect_and_symbol_form){this.and_term=state.getTerm("and","symbol",0);}else{this.and_term="&";}}state.tmp.and_term=this.and_term;if(CSL.STARTSWITH_ROMANESQUE_REGEXP.test(this.and_term)){this.and_prefix_single=" ";this.and_prefix_multiple=", ";if("string"===typeof state.tmp.name_delimiter){this.and_prefix_multiple=state.tmp.name_delimiter;}this.and_suffix=" ";}else{this.and_prefix_single="";this.and_prefix_multiple="";this.and_suffix="";}if(state.inheritOpt(this,"delimiter-precedes-last")==="always"){this.and_prefix_single=state.tmp.name_delimiter;}else if(state.inheritOpt(this,"delimiter-precedes-last")==="never"){if(this.and_prefix_multiple){this.and_prefix_multiple=" ";}}else if(state.inheritOpt(this,"delimiter-precedes-last")==="after-inverted-name"){if(this.and_prefix_single){this.and_prefix_single=state.tmp.name_delimiter;}if(this.and_prefix_multiple){this.and_prefix_multiple=" ";}}this.and={};if(state.inheritOpt(this,"and")){state.output.append(this.and_term,"empty",true);this.and.single=state.output.pop();this.and.single.strings.prefix=this.and_prefix_single;this.and.single.strings.suffix=this.and_suffix;state.output.append(this.and_term,"empty",true);this.and.multiple=state.output.pop();this.and.multiple.strings.prefix=this.and_prefix_multiple;this.and.multiple.strings.suffix=this.and_suffix;}else if(state.tmp.name_delimiter){this.and.single=new CSL.Blob(state.tmp.name_delimiter);this.and.single.strings.prefix="";this.and.single.strings.suffix="";this.and.multiple=new CSL.Blob(state.tmp.name_delimiter);this.and.multiple.strings.prefix="";this.and.multiple.strings.suffix="";}this.ellipsis={};if(state.inheritOpt(this,"et-al-use-last")){this.ellipsis_term="\u2026";this.ellipsis_prefix_single=" ";this.ellipsis_prefix_multiple=state.inheritOpt(this,"delimiter","name-delimiter",", ");this.ellipsis_suffix=" ";this.ellipsis.single=new CSL.Blob(this.ellipsis_term);this.ellipsis.single.strings.prefix=this.ellipsis_prefix_single;this.ellipsis.single.strings.suffix=this.ellipsis_suffix;this.ellipsis.multiple=new CSL.Blob(this.ellipsis_term);this.ellipsis.multiple.strings.prefix=this.ellipsis_prefix_multiple;this.ellipsis.multiple.strings.suffix=this.ellipsis_suffix;}if("undefined"===typeof state.tmp["et-al-min"]){state.tmp["et-al-min"]=state.inheritOpt(this,"et-al-min");}if("undefined"===typeof state.tmp["et-al-use-first"]){state.tmp["et-al-use-first"]=state.inheritOpt(this,"et-al-use-first");}if("undefined"===typeof state.tmp["et-al-use-last"]){state.tmp["et-al-use-last"]=state.inheritOpt(this,"et-al-use-last");}state.nameOutput.name=this;};state.build.name_flag=true;this.execs.push(func);}target.push(this);}};module.exports=CSL;CSL.Node["name-part"]={build:function build(state,target){state.build[this.strings.name]=this;}};module.exports=CSL;CSL.Node.names={build:function build(state,target){var func,len,pos,attrname;var debug=false;if(this.tokentype===CSL.START||this.tokentype===CSL.SINGLETON){CSL.Util.substituteStart.call(this,state,target);state.build.substitute_level.push(1);}if(this.tokentype===CSL.SINGLETON){state.build.names_variables.push(this.variables);func=function func(state,Item,item){var labelVariable=state.nameOutput.labelVariable;state.nameOutput.reinit(this,labelVariable);};this.execs.push(func);}if(this.tokentype===CSL.START){state.build.names_flag=true;state.build.names_level+=1;if(state.build.names_level===1){state.build.names_variables=[];state.build.name_label={};}state.build.names_variables.push(this.variables);func=function func(state,Item,item){state.tmp.can_substitute.push(true);state.parallel.StartVariable("names",this.variables[0]);state.nameOutput.init(this);};this.execs.push(func);}if(this.tokentype===CSL.END){for(var i=0,ilen=3;i<ilen;i+=1){var key=["family","given","et-al"][i];this[key]=state.build[key];if(state.build.names_level===1){state.build[key]=undefined;}}this.label=state.build.name_label;if(state.build.names_level===1){state.build.name_label={};}state.build.names_level+=-1;state.build.names_variables.pop();func=function func(state,Item,item){if(state.tmp.etal_node){this.etal_style=state.tmp.etal_node;}else{this.etal_style="empty";}this.etal_term=state.getTerm(state.tmp.etal_term,"long",0);if(CSL.STARTSWITH_ROMANESQUE_REGEXP.test(this.etal_term)){this.etal_prefix_single=" ";this.etal_prefix_multiple=state.tmp.name_delimiter;if(state.tmp["delimiter-precedes-et-al"]==="always"){this.etal_prefix_single=state.tmp.name_delimiter;}else if(state.tmp["delimiter-precedes-et-al"]==="never"){this.etal_prefix_multiple=" ";}else if(state.tmp["delimiter-precedes-et-al"]==="after-inverted-name"){this.etal_prefix_single=state.tmp.name_delimiter;this.etal_prefix_multiple=" ";}this.etal_suffix="";}else{this.etal_prefix_single="";this.etal_prefix_multiple="";this.etal_suffix="";}for(var i=0,ilen=3;i<ilen;i+=1){var key=["family","given"][i];state.nameOutput[key]=this[key];}state.nameOutput["with"]=this["with"];var mywith="with";var with_default_prefix="";var with_suffix="";if(CSL.STARTSWITH_ROMANESQUE_REGEXP.test(mywith)){with_default_prefix=" ";with_suffix=" ";}var thewith={};thewith.single=new CSL.Blob(mywith);thewith.single.strings.suffix=with_suffix;thewith.multiple=new CSL.Blob(mywith);thewith.multiple.strings.suffix=with_suffix;if(state.inheritOpt(state.nameOutput.name,"delimiter-precedes-last")==="always"){thewith.single.strings.prefix=state.inheritOpt(this,"delimiter","names-delimiter");thewith.multiple.strings.prefix=state.inheritOpt(this,"delimiter","names-delimiter");}else if(state.inheritOpt(state.nameOutput.name,"delimiter-precedes-last")==="contextual"){thewith.single.strings.prefix=with_default_prefix;thewith.multiple.strings.prefix=state.inheritOpt(this,"delimiter","names-delimiter");}else if(state.inheritOpt(state.nameOutput.name,"delimiter-precedes-last")==="after-inverted-name"){thewith.single.strings.prefix=state.inheritOpt(this,"delimiter","names-delimiter");thewith.multiple.strings.prefix=with_default_prefix;}else{thewith.single.strings.prefix=with_default_prefix;thewith.multiple.strings.prefix=with_default_prefix;}state.nameOutput["with"]=thewith;state.nameOutput.label=this.label;state.nameOutput.etal_style=this.etal_style;state.nameOutput.etal_term=this.etal_term;state.nameOutput.etal_prefix_single=this.etal_prefix_single;state.nameOutput.etal_prefix_multiple=this.etal_prefix_multiple;state.nameOutput.etal_suffix=this.etal_suffix;state.nameOutput.outputNames();state.tmp["et-al-use-first"]=undefined;state.tmp["et-al-min"]=undefined;state.tmp["et-al-use-last"]=undefined;};this.execs.push(func);func=function func(state,Item){if(!state.tmp.can_substitute.pop()){state.tmp.can_substitute.replace(false,CSL.LITERAL);}state.parallel.CloseVariable("names");if(state.tmp.can_substitute.mystack.length===1){state.tmp.can_block_substitute=false;}};this.execs.push(func);state.build.name_flag=false;}target.push(this);if(this.tokentype===CSL.END||this.tokentype===CSL.SINGLETON){state.build.substitute_level.pop();CSL.Util.substituteEnd.call(this,state,target);}}};module.exports=CSL;CSL.Node.number={build:function build(state,target){var func;CSL.Util.substituteStart.call(this,state,target);if(this.strings.form==="roman"){this.formatter=state.fun.romanizer;}else if(this.strings.form==="ordinal"){this.formatter=state.fun.ordinalizer;}else if(this.strings.form==="long-ordinal"){this.formatter=state.fun.long_ordinalizer;}if("undefined"===typeof this.successor_prefix){this.successor_prefix=state[state.build.area].opt.layout_delimiter;}if("undefined"===typeof this.splice_prefix){this.splice_prefix=state[state.build.area].opt.layout_delimiter;}func=function func(state,Item,item){var i,ilen,newlst,lst;if(this.variables.length===0){return;}if("undefined"===typeof item){var item={};}var varname,num,number,m,j,jlen;varname=this.variables[0];if(varname==="locator"&&state.tmp.just_looking){return;}state.parallel.StartVariable(this.variables[0]);if(this.variables[0]==="locator"){state.parallel.AppendToVariable(Item.section);}else{state.parallel.AppendToVariable(Item[this.variables[0]]);}var rex=new RegExp("(?:&|, | and |"+state.getTerm("page-range-delimiter")+")");if(varname==='collection-number'&&Item.type==='legal_case'){state.tmp.renders_collection_number=true;}var value=Item[this.variables[0]];var node=this;if(state.tmp.group_context.tip.force_suppress){return false;}if(varname==="locator"){state.processNumber(node,item,varname,Item.type);}else{if(!state.tmp.group_context.tip.condition&&Item[varname]){state.tmp.just_did_number=true;}state.processNumber(node,Item,varname,Item.type);}CSL.Util.outputNumericField(state,varname,Item.id);state.parallel.CloseVariable("number");if(["locator","locator-extra"].indexOf(this.variables_real[0])>-1&&!state.tmp.just_looking){state.tmp.done_vars.push(this.variables_real[0]);state.tmp.group_context.tip.done_vars.push(this.variables_real[0]);}};this.execs.push(func);target.push(this);CSL.Util.substituteEnd.call(this,state,target);}};module.exports=CSL;CSL.Node.sort={build:function build(state,target){target=state[state.build.root+"_sort"].tokens;if(this.tokentype===CSL.START){if(state.build.area==="citation"){state.parallel.use_parallels=false;state.opt.sort_citations=true;}state.build.area=state.build.root+"_sort";state.build.extension="_sort";var func=function func(state,Item){if(state.opt.has_layout_locale){var langspec=CSL.localeResolve(Item.language,state.opt["default-locale"][0]);var sort_locales=state[state.tmp.area.slice(0,-5)].opt.sort_locales;var langForItem;for(var i=0,ilen=sort_locales.length;i<ilen;i+=1){langForItem=sort_locales[i][langspec.bare];if(!langForItem){langForItem=sort_locales[i][langspec.best];}if(langForItem){break;}}if(!langForItem){langForItem=state.opt["default-locale"][0];}state.tmp.lang_sort_hold=state.opt.lang;state.opt.lang=langForItem;}};this.execs.push(func);}if(this.tokentype===CSL.END){state.build.area=state.build.root;state.build.extension="";var func=function func(state,Item){if(state.opt.has_layout_locale){state.opt.lang=state.tmp.lang_sort_hold;delete state.tmp.lang_sort_hold;}};this.execs.push(func);}target.push(this);}};module.exports=CSL;CSL.Node.substitute={build:function build(state,target){var func;if(this.tokentype===CSL.START){func=function func(state,Item){state.tmp.can_block_substitute=true;if(state.tmp.value.length){state.tmp.can_substitute.replace(false,CSL.LITERAL);}};this.execs.push(func);}target.push(this);}};module.exports=CSL;CSL.Node.text={build:function build(state,target){var variable,func,form,plural,id,num,number,formatter,firstoutput,specialdelimiter,label,myname,names,name,year,suffix,term,dp,len,pos,n,m,value,flag;if(this.postponed_macro){var group_start=CSL.Util.cloneToken(this);group_start.name="group";group_start.tokentype=CSL.START;CSL.Node.group.build.call(group_start,state,target);CSL.expandMacro.call(state,this,target);var group_end=CSL.Util.cloneToken(this);group_end.name="group";group_end.tokentype=CSL.END;if(this.postponed_macro==='juris-locator-label'){group_end.isJurisLocatorLabel=true;}CSL.Node.group.build.call(group_end,state,target);}else{CSL.Util.substituteStart.call(this,state,target);if(!this.variables_real){this.variables_real=[];}if(!this.variables){this.variables=[];}form="long";plural=0;if(this.strings.form){form=this.strings.form;}if(this.strings.plural){plural=this.strings.plural;}if("citation-number"===this.variables_real[0]||"year-suffix"===this.variables_real[0]||"citation-label"===this.variables_real[0]){if(this.variables_real[0]==="citation-number"){if(state.build.root==="citation"){state.opt.update_mode=CSL.NUMERIC;}if(state.build.root==="bibliography"){state.opt.bib_mode=CSL.NUMERIC;}if(state.build.area==="bibliography_sort"){state.opt.citation_number_sort_used=true;}if("citation-number"===state[state.tmp.area].opt.collapse){this.range_prefix=state.getTerm("citation-range-delimiter");}this.successor_prefix=state[state.build.area].opt.layout_delimiter;this.splice_prefix=state[state.build.area].opt.layout_delimiter;func=function func(state,Item,item){id=""+Item.id;if(!state.tmp.just_looking){if(item&&item["author-only"]){state.tmp.element_trace.replace("do-not-suppress-me");var reference_term=state.getTerm("reference","long","singular");if("undefined"===typeof reference_term){reference_term="reference";}term=CSL.Output.Formatters["capitalize-first"](state,reference_term);state.output.append(term+" ");state.tmp.last_element_trace=true;}if(item&&item["suppress-author"]){if(state.tmp.last_element_trace){state.tmp.element_trace.replace("suppress-me");}state.tmp.last_element_trace=false;}num=state.registry.registry[id].seq;if(state.opt.citation_number_slug){state.output.append(state.opt.citation_number_slug,this);}else{number=new CSL.NumericBlob(false,num,this,Item.id);if(state.tmp.in_cite_predecessor){if(!state.tmp.just_looking){}number.suppress_splice_prefix=true;}state.output.append(number,"literal");}}};this.execs.push(func);}else if(this.variables_real[0]==="year-suffix"){state.opt.has_year_suffix=true;if(state[state.tmp.area].opt.collapse==="year-suffix-ranged"){this.range_prefix=state.getTerm("citation-range-delimiter");}this.successor_prefix=state[state.build.area].opt.layout_delimiter;if(state[state.tmp.area].opt["year-suffix-delimiter"]){this.successor_prefix=state[state.build.area].opt["year-suffix-delimiter"];}func=function func(state,Item){if(state.registry.registry[Item.id]&&state.registry.registry[Item.id].disambig.year_suffix!==false&&!state.tmp.just_looking){num=parseInt(state.registry.registry[Item.id].disambig.year_suffix,10);if(state[state.tmp.area].opt.cite_group_delimiter){this.successor_prefix=state[state.tmp.area].opt.cite_group_delimiter;}number=new CSL.NumericBlob(false,num,this,Item.id);formatter=new CSL.Util.Suffixator(CSL.SUFFIX_CHARS);number.setFormatter(formatter);state.output.append(number,"literal");firstoutput=false;for(var i=0,ilen=state.tmp.group_context.mystack.length;i<ilen;i++){var flags=state.tmp.group_context.mystack[i];if(!flags.variable_success&&(flags.variable_attempt||!flags.variable_attempt&&!flags.term_intended)){firstoutput=true;break;}}specialdelimiter=state[state.tmp.area].opt["year-suffix-delimiter"];if(firstoutput&&specialdelimiter&&!state.tmp.sort_key_flag){state.tmp.splice_delimiter=state[state.tmp.area].opt["year-suffix-delimiter"];}}};this.execs.push(func);}else if(this.variables_real[0]==="citation-label"){state.opt.has_year_suffix=true;func=function func(state,Item){label=Item["citation-label"];if(!label){label=state.getCitationLabel(Item);}if(!state.tmp.just_looking){suffix="";if(state.registry.registry[Item.id]&&state.registry.registry[Item.id].disambig.year_suffix!==false){num=parseInt(state.registry.registry[Item.id].disambig.year_suffix,10);suffix=state.fun.suffixator.format(num);}label+=suffix;}state.output.append(label,this);};this.execs.push(func);}}else{if(this.strings.term){func=function func(state,Item,item){var gender=state.opt.gender[Item.type];var term=this.strings.term;term=state.getTerm(term,form,plural,gender,CSL.TOLERANT,this.default_locale);var myterm;if(term!==""){state.tmp.group_context.tip.term_intended=true;}CSL.UPDATE_GROUP_CONTEXT_CONDITION(state,term);if(!state.tmp.term_predecessor&&!(state.opt["class"]==="in-text"&&state.tmp.area==="citation")){myterm=CSL.Output.Formatters["capitalize-first"](state,term);}else{myterm=term;}if(state.tmp.strip_periods){myterm=myterm.replace(/\./g,"");}else{for(var i=0,ilen=this.decorations.length;i<ilen;i+=1){if("@strip-periods"===this.decorations[i][0]&&"true"===this.decorations[i][1]){myterm=myterm.replace(/\./g,"");break;}}}state.output.append(myterm,this);};this.execs.push(func);state.build.term=false;state.build.form=false;state.build.plural=false;}else if(this.variables_real.length){func=function func(state,Item,item){if(this.variables_real[0]!=="locator"){state.tmp.have_collapsed=false;}var parallel_variable=this.variables[0];if(parallel_variable==="title"&&(form==="short"||Item["title-short"])){parallel_variable="title-short";}state.parallel.StartVariable(parallel_variable);state.parallel.AppendToVariable(Item[parallel_variable],parallel_variable);if(!state.tmp.group_context.tip.condition&&Item[this.variables[0]]){state.tmp.just_did_number=false;}};this.execs.push(func);if(CSL.MULTI_FIELDS.indexOf(this.variables_real[0])>-1||["language-name","language-name-original"].indexOf(this.variables_real[0])>-1){var abbrevfam=this.variables[0];var abbrfall=false;var altvar=false;var transfall=false;if(form==="short"||["country","jurisdiction"].indexOf(this.variables_real[0])>-1){if(this.variables_real[0]==="container-title"){altvar="journalAbbreviation";}else if(this.variables_real[0]==="title"){altvar="title-short";}}else{abbrevfam=false;}if(state.build.extension){transfall=true;}else{transfall=true;abbrfall=true;}func=state.transform.getOutputFunction(this.variables,abbrevfam,abbrfall,altvar,transfall);}else{if(CSL.CITE_FIELDS.indexOf(this.variables_real[0])>-1){func=function func(state,Item,item){if(item&&item[this.variables[0]]){state.processNumber(this,item,this.variables[0],Item.type);CSL.Util.outputNumericField(state,this.variables[0],Item.id);if(["locator","locator-extra"].indexOf(this.variables_real[0])>-1&&!state.tmp.just_looking){state.tmp.done_vars.push(this.variables_real[0]);}}};}else if(["page","page-first","chapter-number","collection-number","edition","issue","number","number-of-pages","number-of-volumes","volume"].indexOf(this.variables_real[0])>-1){func=function func(state,Item){state.processNumber(this,Item,this.variables[0],Item.type);CSL.Util.outputNumericField(state,this.variables[0],Item.id);};}else if(["URL","DOI"].indexOf(this.variables_real[0])>-1){func=function func(state,Item){var value;if(this.variables[0]){value=state.getVariable(Item,this.variables[0],form);if(value){if(state.opt.development_extensions.wrap_url_and_doi){if(!this.decorations.length||this.decorations[0][0]!=="@"+this.variables[0]){if(this.variables_real[0]==="DOI"&&this.strings.prefix==="https://doi.org/"){var clonetoken=CSL.Util.cloneToken(this);var groupblob=new CSL.Blob(null,null,"url-wrapper");groupblob.decorations.push(["@DOI","true"]);value=value.replace(/^https?:\/\/doi\.org\//,"");var prefix;if(value.match(/^https?:\/\//)){prefix="";}else{prefix="https://doi.org/";}var prefixblob=new CSL.Blob(prefix);var valueblob=new CSL.Blob(value);clonetoken.strings.prefix="";groupblob.push(prefixblob);groupblob.push(valueblob);state.output.append(groupblob,clonetoken,false,false,true);}else{this.decorations=[["@"+this.variables[0],"true"]].concat(this.decorations);state.output.append(value,this,false,false,true);}}else{state.output.append(value,this,false,false,true);}}else{if(this.decorations.length){for(var i=this.decorations.length-1;i>-1;i--){if(this.decorations[i][0]==="@"+this.variables[0]){this.decorations=this.decorations.slice(0,i).concat(this.decorations.slice(i+1));}}}state.output.append(value,this,false,false,true);}}}};}else if(this.variables_real[0]==="section"){func=function func(state,Item){var value;value=state.getVariable(Item,this.variables[0],form);if(value){state.output.append(value,this);}};}else if(this.variables_real[0]==="hereinafter"){func=function func(state,Item){var value=state.transform.abbrevs["default"]["hereinafter"][Item.id];if(value){state.output.append(value,this);state.tmp.group_context.tip.variable_success=true;}};}else{func=function func(state,Item){var value;if(this.variables[0]){value=state.getVariable(Item,this.variables[0],form);if(value){value=""+value;value=value.split("\\").join("");state.output.append(value,this);}}};}}this.execs.push(func);func=function func(state,Item){state.parallel.CloseVariable("text");};this.execs.push(func);}else if(this.strings.value){func=function func(state,Item){state.tmp.group_context.tip.term_intended=true;CSL.UPDATE_GROUP_CONTEXT_CONDITION(state,this.strings.value,true);state.output.append(this.strings.value,this);};this.execs.push(func);}}target.push(this);CSL.Util.substituteEnd.call(this,state,target);}}};module.exports=CSL;CSL.Attributes={};CSL.Attributes["@genre"]=function(state,arg){arg=arg.replace("-"," ");var func=function func(Item,item){var ret;if(arg===Item.genre){return true;}return false;};this.tests.push(func);};CSL.Attributes["@disambiguate"]=function(state,arg){if(arg==="true"){state.opt.has_disambiguate=true;var func=function func(Item,item){if(state.tmp.area==="bibliography"){if(state.tmp.disambiguate_count<state.registry.registry[Item.id].disambig.disambiguate){state.tmp.disambiguate_count+=1;return true;}}else{state.tmp.disambiguate_maxMax+=1;if(state.tmp.disambig_settings.disambiguate&&state.tmp.disambiguate_count<state.tmp.disambig_settings.disambiguate){state.tmp.disambiguate_count+=1;return true;}}return false;};this.tests.push(func);}else if(arg==="check-ambiguity-and-backreference"){var func=function func(Item,item){if(state.registry.registry[Item.id].disambig.disambiguate&&state.registry.registry[Item.id]["citation-count"]>1){return true;}return false;};this.tests.push(func);}};CSL.Attributes["@is-numeric"]=function(state,arg,joiner){var variables=arg.split(/\s+/);var maketest=function maketest(variable){return function(Item,item){var myitem=Item;if(["locator","locator-extra"].indexOf(variable)>-1){myitem=item;}if("undefined"===typeof myitem){return false;}if(CSL.NUMERIC_VARIABLES.indexOf(variable)>-1){if(!state.tmp.shadow_numbers[variable]){state.processNumber(false,myitem,variable,Item.type);}if(myitem[variable]&&state.tmp.shadow_numbers[variable].numeric){return true;}}else if(["title","locator-extra","version"].indexOf(variable)>-1){if(myitem[variable]){if(myitem[variable].slice(-1)===""+parseInt(myitem[variable].slice(-1),10)){return true;}}}return false;};};for(var i=0;i<variables.length;i+=1){this.tests.push(maketest(variables[i]));}};CSL.Attributes["@is-uncertain-date"]=function(state,arg){var variables=arg.split(/\s+/);var maketest=function maketest(myvariable){return function(Item,item){if(Item[myvariable]&&Item[myvariable].circa){return true;}else{return false;}};};for(var i=0,ilen=variables.length;i<ilen;i+=1){this.tests.push(maketest(variables[i]));};};CSL.Attributes["@locator"]=function(state,arg){var trylabels=arg.replace("sub verbo","sub-verbo");trylabels=trylabels.split(/\s+/);var maketest=function maketest(trylabel){return function(Item,item){var label;state.processNumber(false,item,"locator");label=state.tmp.shadow_numbers.locator.label;if(trylabel===label){return true;}else{return false;}};};for(var i=0,ilen=trylabels.length;i<ilen;i+=1){this.tests.push(maketest(trylabels[i]));}};CSL.Attributes["@position"]=function(state,arg){var tryposition;state.opt.update_mode=CSL.POSITION;state.parallel.use_parallels=null;var trypositions=arg.split(/\s+/);var maketest=function maketest(tryposition){return function(Item,item){if(state.tmp.area==="bibliography"){return false;}if(item&&"undefined"===typeof item.position){item.position=0;}if(item&&typeof item.position==="number"){if(item.position===0&&tryposition===0){return true;}else if(tryposition>0&&item.position>=tryposition){return true;}}else if(tryposition===0){return true;}return false;};};for(var i=0,ilen=trypositions.length;i<ilen;i+=1){var tryposition=trypositions[i];if(tryposition==="first"){tryposition=CSL.POSITION_FIRST;}else if(tryposition==="subsequent"){tryposition=CSL.POSITION_SUBSEQUENT;}else if(tryposition==="ibid"){tryposition=CSL.POSITION_IBID;}else if(tryposition==="ibid-with-locator"){tryposition=CSL.POSITION_IBID_WITH_LOCATOR;}if("near-note"===tryposition){this.tests.push(function(Item,item){if(item&&item.position>=CSL.POSITION_SUBSEQUENT&&item["near-note"]){return true;}return false;});}else if("far-note"===tryposition){this.tests.push(function(Item,item){if(item&&item.position==CSL.POSITION_SUBSEQUENT&&!item["near-note"]){return true;}return false;});}else{this.tests.push(maketest(tryposition));}}};CSL.Attributes["@type"]=function(state,arg){var types=arg.split(/\s+/);var maketest=function maketest(mytype){return function(Item,item){var ret=Item.type===mytype;if(ret){return true;}else{return false;}};};var tests=[];for(var i=0,ilen=types.length;i<ilen;i+=1){tests.push(maketest(types[i]));}this.tests.push(state.fun.match.any(this,state,tests));};CSL.Attributes["@variable"]=function(state,arg){var func;this.variables=arg.split(/\s+/);this.variables_real=this.variables.slice();if("label"===this.name&&this.variables[0]){this.strings.term=this.variables[0];}else if(["names","date","text","number"].indexOf(this.name)>-1){func=function func(state,Item,item){for(var i=this.variables.length-1;i>-1;i+=-1){this.variables.pop();}for(var i=0,ilen=this.variables_real.length;i<ilen;i++){if(state.tmp.done_vars.indexOf(this.variables_real[i])===-1&&!(item&&Item.type==="legal_case"&&item["suppress-author"]&&this.variables_real[i]==="title")){this.variables.push(this.variables_real[i]);}if(state.tmp.can_block_substitute){state.tmp.done_vars.push(this.variables_real[i]);}}};this.execs.push(func);func=function func(state,Item,item){var mydate;var output=false;for(var i=0,ilen=this.variables.length;i<ilen;i++){var variable=this.variables[i];if(["authority","committee"].indexOf(variable)>-1&&"string"===typeof Item[variable]&&"names"===this.name){var creatorParents=[];var isValid=true;var rawNames=Item[variable].split(/\s*;\s*/);var rawMultiNames={};if(Item.multi&&Item.multi._keys[variable]){for(var langTag in Item.multi._keys[variable]){rawMultiNames[langTag]=Item.multi._keys[variable][langTag].split(/\s*;\s*/);if(rawMultiNames[langTag].length!==rawNames.length){isValid=false;break;}}}if(!isValid){rawNames=[Item[variable]];rawMultiNames=Item.multi._keys[variable];}for(var j=0,jlen=rawNames.length;j<jlen;j++){var creatorParent={literal:rawNames[j],multi:{_key:{}}};for(var langTag in rawMultiNames){var creatorChild={literal:rawMultiNames[langTag][j]};creatorParent.multi._key[langTag]=creatorChild;}rawNames[j]=creatorParent;}Item[variable]=rawNames;}if(this.strings.form==="short"&&!Item[variable]){if(variable==="title"){variable="title-short";}else if(variable==="container-title"){variable="journalAbbreviation";}}if(variable==="year-suffix"){output=true;break;}else if(CSL.DATE_VARIABLES.indexOf(variable)>-1){if(state.opt.development_extensions.locator_date_and_revision&&"locator-date"===variable){output=true;break;}if(Item[variable]){for(var key in Item[variable]){if(this.dateparts.indexOf(key)===-1&&"literal"!==key){continue;}if(Item[variable][key]){output=true;break;}}if(output){break;}}}else if("locator"===variable){if(item&&item.locator){output=true;}break;}else if("locator-extra"===variable){if(item&&item["locator-extra"]){output=true;}break;}else if(["citation-number","citation-label"].indexOf(variable)>-1){output=true;break;}else if("first-reference-note-number"===variable){if(item&&item["first-reference-note-number"]){output=true;}break;}else if("hereinafter"===variable){if(state.transform.abbrevs["default"].hereinafter[Item.id]&&state.sys.getAbbreviation&&Item.id){output=true;}break;}else if("object"===_typeof(Item[variable])){if(Item[variable].length){}break;}else if("string"===typeof Item[variable]&&Item[variable]){output=true;break;}else if("number"===typeof Item[variable]){output=true;break;}if(output){break;}}if(output){for(var i=0,ilen=this.variables_real.length;i<ilen;i++){var variable=this.variables_real[i];if(variable!=="citation-number"||state.tmp.area!=="bibliography"){state.tmp.cite_renders_content=true;}state.tmp.group_context.tip.variable_success=true;if(state.tmp.can_substitute.value()&&state.tmp.area==="bibliography"&&"string"===typeof Item[variable]){state.tmp.name_node.top=state.output.current.value();state.tmp.rendered_name.push(Item[variable]);}}state.tmp.can_substitute.replace(false,CSL.LITERAL);}else{state.tmp.group_context.tip.variable_attempt=true;}};this.execs.push(func);}else if(["if","else-if","condition"].indexOf(this.name)>-1){var maketest=function maketest(variable){return function(Item,item){var myitem=Item;if(item&&["locator","locator-extra","first-reference-note-number","locator-date"].indexOf(variable)>-1){myitem=item;}if(variable==="hereinafter"&&state.sys.getAbbreviation&&myitem.id){if(state.transform.abbrevs["default"].hereinafter[myitem.id]){return true;}}else if(myitem[variable]){if("number"===typeof myitem[variable]||"string"===typeof myitem[variable]){return true;}else if("object"===_typeof(myitem[variable])){for(var key in myitem[variable]){if(myitem[variable][key]){return true;}}}}return false;};};for(var i=0,ilen=this.variables.length;i<ilen;i+=1){this.tests.push(maketest(this.variables[i]));}}};CSL.Attributes["@page"]=function(state,arg){var trylabels=arg.replace("sub verbo","sub-verbo");trylabels=trylabels.split(/\s+/);var maketest=function maketest(trylabel){return function(Item,item){var label;state.processNumber(false,Item,"page",Item.type);if(!state.tmp.shadow_numbers.page.label){label="page";}else if(state.tmp.shadow_numbers.page.label==="sub verbo"){label="sub-verbo";}else{label=state.tmp.shadow_numbers.page.label;}if(trylabel===label){return true;}else{return false;}};};for(var i=0,ilen=trylabels.length;i<ilen;i+=1){this.tests.push(maketest(trylabels[i]));}};CSL.Attributes["@number"]=function(state,arg){var trylabels=arg.replace("sub verbo","sub-verbo");trylabels=trylabels.split(/\s+/);var maketest=function maketest(trylabel){return function(Item,item){var label;state.processNumber(false,Item,"number",Item.type);if(!state.tmp.shadow_numbers.number.label){label="number";}else if(state.tmp.shadow_numbers.number.label==="sub verbo"){label="sub-verbo";}else{label=state.tmp.shadow_numbers.number.label;}if(trylabel===label){return true;}else{return false;}};};for(var i=0,ilen=trylabels.length;i<ilen;i+=1){this.tests.push(maketest(trylabels[i]));}};CSL.Attributes["@jurisdiction"]=function(state,arg){var tryjurisdictions=arg.split(/\s+/);for(var i=0,ilen=tryjurisdictions.length;i<ilen;i+=1){tryjurisdictions[i]=tryjurisdictions[i].split(":");}var maketests=function maketests(tryjurisdiction){return function(Item,item){if(!Item.jurisdiction){return false;}var jurisdictions=Item.jurisdiction.split(":");for(var i=0,ilen=jurisdictions.length;i<ilen;i+=1){jurisdictions[i]=jurisdictions[i].split(":");}for(i=tryjurisdiction.length;i>0;i+=-1){var tryjurisdictionStr=tryjurisdiction.slice(0,i).join(":");var jurisdiction=jurisdictions.slice(0,i).join(":");if(tryjurisdictionStr!==jurisdiction){return false;}}return true;};};for(var i=0,ilen=tryjurisdictions.length;i<ilen;i+=1){var tryjurisdictionSlice=tryjurisdictions[i].slice();this.tests.push(maketests(tryjurisdictionSlice));}};CSL.Attributes["@context"]=function(state,arg){var func=function func(Item,item){var area=state.tmp.area.slice(0,arg.length);if(area===arg){return true;}return false;};this.tests.push(func);};CSL.Attributes["@has-year-only"]=function(state,arg){var trydates=arg.split(/\s+/);var maketest=function maketest(trydate){return function(Item,item){var date=Item[trydate];if(!date||date.month||date.season){return false;}else{return true;}};};for(var i=0,ilen=trydates.length;i<ilen;i+=1){this.tests.push(maketest(trydates[i]));}};CSL.Attributes["@has-to-month-or-season"]=function(state,arg){var trydates=arg.split(/\s+/);var maketest=function maketest(trydate){return function(Item,item){var date=Item[trydate];if(!date||!date.month&&!date.season||date.day){return false;}else{return true;}};};for(var i=0,ilen=trydates.length;i<ilen;i+=1){this.tests.push(maketest(trydates[i]));}};CSL.Attributes["@has-day"]=function(state,arg){var trydates=arg.split(/\s+/);var maketest=function maketest(trydate){return function(Item,item){var date=Item[trydate];if(!date||!date.day){return false;}else{return true;}};};for(var i=0,ilen=trydates.length;i<ilen;i+=1){this.tests.push(maketest(trydates[i]));};};CSL.Attributes["@subjurisdictions"]=function(state,arg){var trysubjurisdictions=parseInt(arg,10);var func=function func(Item,item){var subjurisdictions=0;if(Item.jurisdiction){subjurisdictions=Item.jurisdiction.split(":").length;}if(subjurisdictions){subjurisdictions+=-1;}if(subjurisdictions>=trysubjurisdictions){return true;}return false;};this.tests.push(func);};CSL.Attributes["@is-plural"]=function(state,arg){var func=function func(Item,item){var nameList=Item[arg];if(nameList&&nameList.length){var persons=0;var institutions=0;var last_is_person=false;for(var i=0,ilen=nameList.length;i<ilen;i+=1){if(state.opt.development_extensions.spoof_institutional_affiliations&&(nameList[i].literal||nameList[i].isInstitution&&nameList[i].family&&!nameList[i].given)){institutions+=1;last_is_person=false;}else{persons+=1;last_is_person=true;}}if(persons>1){return true;}else if(institutions>1){return true;}else if(institutions&&last_is_person){return true;}}return false;};this.tests.push(func);};CSL.Attributes["@locale"]=function(state,arg){var func,ret,len,pos,variable,myitem,langspec,lang,lst,i,ilen,fallback;var locale_default=state.opt["default-locale"][0];if(this.name==="layout"){this.locale_raw=arg;if(this.tokentype===CSL.START){var locales=arg.split(/\s+/);var sort_locale={};var localeMaster=CSL.localeResolve(locales[0],locale_default);if(localeMaster.generic){sort_locale[localeMaster.generic]=localeMaster.best;}else{sort_locale[localeMaster.best]=localeMaster.best;}for(var i=1,ilen=locales.length;i<ilen;i+=1){var localeServant=CSL.localeResolve(locales[i],locale_default);if(localeServant.generic){sort_locale[localeServant.generic]=localeMaster.best;}else{sort_locale[localeServant.best]=localeMaster.best;}}state[state.build.area].opt.sort_locales.push(sort_locale);}state.opt.has_layout_locale=true;}else{lst=arg.split(/\s+/);var locale_bares=[];for(i=0,ilen=lst.length;i<ilen;i+=1){lang=lst[i];langspec=CSL.localeResolve(lang,locale_default);if(lst[i].length===2){locale_bares.push(langspec.bare);}state.localeConfigure(langspec,true);lst[i]=langspec;}var locale_list=lst.slice();var maketest=function maketest(locale_list,locale_default,locale_bares){return function(Item,item){var key,res;ret=[];res=false;var langspec=false;var lang;if(!Item.language){lang=locale_default;}else{lang=Item.language;}langspec=CSL.localeResolve(lang,locale_default);for(i=0,ilen=locale_list.length;i<ilen;i+=1){if(langspec.best===locale_list[i].best){res=true;break;}}if(!res&&locale_bares.indexOf(langspec.bare)>-1){res=true;}return res;};};this.tests.push(maketest(locale_list,locale_default,locale_bares));}};CSL.Attributes["@authority-residue"]=function(state,arg){var maketest=function maketest(){var succeed=arg==="true"?true:false;return function(Item,item){if(!Item.authority||!Item.authority[0]||!Item.authority[0].family)return!succeed;var varLen=Item.authority[0].family.split("|").length;var stopLast=state.tmp.authority_stop_last;if(varLen+stopLast>0){return succeed;}else{return!succeed;}};};this.tests.push(maketest());};CSL.Attributes["@locale-internal"]=function(state,arg){var func,ret,len,pos,variable,myitem,langspec,lang,lst,i,ilen,fallback;lst=arg.split(/\s+/);this.locale_bares=[];for(i=0,ilen=lst.length;i<ilen;i+=1){lang=lst[i];langspec=CSL.localeResolve(lang,state.opt["default-locale"][0]);if(lst[i].length===2){this.locale_bares.push(langspec.bare);}state.localeConfigure(langspec);lst[i]=langspec;}this.locale_default=state.opt["default-locale"][0];this.locale=lst[0].best;this.locale_list=lst.slice();var maketest=function maketest(me){return function(Item,item){var key,res;ret=[];res=false;var langspec=false;if(Item.language){lang=Item.language;langspec=CSL.localeResolve(lang,state.opt["default-locale"][0]);if(langspec.best===state.opt["default-locale"][0]){langspec=false;}}if(langspec){for(i=0,ilen=me.locale_list.length;i<ilen;i+=1){if(langspec.best===me.locale_list[i].best){state.opt.lang=me.locale;state.tmp.last_cite_locale=me.locale;state.output.openLevel("empty");state.output.current.value().new_locale=me.locale;res=true;break;}}if(!res&&me.locale_bares.indexOf(langspec.bare)>-1){state.opt.lang=me.locale;state.tmp.last_cite_locale=me.locale;state.output.openLevel("empty");state.output.current.value().new_locale=me.locale;res=true;}}return res;};};var me=this;this.tests.push(maketest(me));};CSL.Attributes["@is-parallel"]=function(state,arg){var values=arg.split(" ");for(var i=0,ilen=values.length;i<ilen;i+=1){if(values[i]==="true"){values[i]=true;}else if(values[i]==="false"){values[i]=false;}}this.strings.set_parallel_condition=values;};CSL.Attributes["@jurisdiction-depth"]=function(state,arg){this.strings.jurisdiction_depth=parseInt(arg,10);};CSL.Attributes["@citationRequire"]=function(state,arg){this.strings.citationRequire=arg;};CSL.Attributes["@reject"]=function(state,arg){this.strings.reject=arg;};CSL.Attributes["@gender"]=function(state,arg){this.gender=arg;};CSL.Attributes["@cslid"]=function(state,arg){this.cslid=parseInt(arg,10);};CSL.Attributes["@capitalize-if-first"]=function(state,arg){this.strings.capitalize_if_first_override=arg;};CSL.Attributes["@label-capitalize-if-first"]=function(state,arg){this.strings.label_capitalize_if_first_override=arg;};CSL.Attributes["@label-form"]=function(state,arg){this.strings.label_form_override=arg;};CSL.Attributes["@part-separator"]=function(state,arg){this.strings["part-separator"]=arg;};CSL.Attributes["@leading-noise-words"]=function(state,arg){this["leading-noise-words"]=arg;};CSL.Attributes["@name-never-short"]=function(state,arg){this["name-never-short"]=arg;};CSL.Attributes["@class"]=function(state,arg){state.opt["class"]=arg;};CSL.Attributes["@version"]=function(state,arg){state.opt.version=arg;};CSL.Attributes["@value"]=function(state,arg){this.strings.value=arg;};CSL.Attributes["@name"]=function(state,arg){this.strings.name=arg;};CSL.Attributes["@form"]=function(state,arg){this.strings.form=arg;};CSL.Attributes["@date-parts"]=function(state,arg){this.strings["date-parts"]=arg;};CSL.Attributes["@range-delimiter"]=function(state,arg){this.strings["range-delimiter"]=arg;};CSL.Attributes["@macro"]=function(state,arg){this.postponed_macro=arg;};CSL.Attributes["@term"]=function(state,arg){if(arg==="sub verbo"){this.strings.term="sub-verbo";}else{this.strings.term=arg;}};CSL.Attributes["@xmlns"]=function(state,arg){};CSL.Attributes["@lang"]=function(state,arg){if(arg){state.build.lang=arg;}};CSL.Attributes["@lingo"]=function(state,arg){};CSL.Attributes["@macro-has-date"]=function(state,arg){this["macro-has-date"]=true;};CSL.Attributes["@suffix"]=function(state,arg){this.strings.suffix=arg;};CSL.Attributes["@prefix"]=function(state,arg){this.strings.prefix=arg;};CSL.Attributes["@delimiter"]=function(state,arg){this.strings.delimiter=arg;};CSL.Attributes["@match"]=function(state,arg){this.match=arg;};CSL.Attributes["@names-min"]=function(state,arg){var val=parseInt(arg,10);if(state[state.build.area].opt.max_number_of_names<val){state[state.build.area].opt.max_number_of_names=val;}this.strings["et-al-min"]=val;};CSL.Attributes["@names-use-first"]=function(state,arg){this.strings["et-al-use-first"]=parseInt(arg,10);};CSL.Attributes["@names-use-last"]=function(state,arg){if(arg==="true"){this.strings["et-al-use-last"]=true;}else{this.strings["et-al-use-last"]=false;}};CSL.Attributes["@sort"]=function(state,arg){if(arg==="descending"){this.strings.sort_direction=CSL.DESCENDING;}};CSL.Attributes["@plural"]=function(state,arg){if("always"===arg||"true"===arg){this.strings.plural=1;}else if("never"===arg||"false"===arg){this.strings.plural=0;}else if("contextual"===arg){this.strings.plural=false;}};CSL.Attributes["@has-publisher-and-publisher-place"]=function(state,arg){this.strings["has-publisher-and-publisher-place"]=true;};CSL.Attributes["@publisher-delimiter-precedes-last"]=function(state,arg){this.strings["publisher-delimiter-precedes-last"]=arg;};CSL.Attributes["@publisher-delimiter"]=function(state,arg){this.strings["publisher-delimiter"]=arg;};CSL.Attributes["@publisher-and"]=function(state,arg){this.strings["publisher-and"]=arg;};CSL.Attributes["@newdate"]=function(state,arg){};CSL.Attributes["@givenname-disambiguation-rule"]=function(state,arg){if(CSL.GIVENNAME_DISAMBIGUATION_RULES.indexOf(arg)>-1){state.citation.opt["givenname-disambiguation-rule"]=arg;}};CSL.Attributes["@collapse"]=function(state,arg){if(arg){state[this.name].opt.collapse=arg;}};CSL.Attributes["@cite-group-delimiter"]=function(state,arg){if(arg){state[state.tmp.area].opt.cite_group_delimiter=arg;}};CSL.Attributes["@names-delimiter"]=function(state,arg){state.setOpt(this,"names-delimiter",arg);};CSL.Attributes["@name-form"]=function(state,arg){state.setOpt(this,"name-form",arg);};CSL.Attributes["@subgroup-delimiter"]=function(state,arg){this.strings["subgroup-delimiter"]=arg;};CSL.Attributes["@subgroup-delimiter-precedes-last"]=function(state,arg){this.strings["subgroup-delimiter-precedes-last"]=arg;};CSL.Attributes["@name-delimiter"]=function(state,arg){state.setOpt(this,"name-delimiter",arg);};CSL.Attributes["@et-al-min"]=function(state,arg){var val=parseInt(arg,10);if(state[state.build.area].opt.max_number_of_names<val){state[state.build.area].opt.max_number_of_names=val;}state.setOpt(this,"et-al-min",val);};CSL.Attributes["@et-al-use-first"]=function(state,arg){state.setOpt(this,"et-al-use-first",parseInt(arg,10));};CSL.Attributes["@et-al-use-last"]=function(state,arg){if(arg==="true"){state.setOpt(this,"et-al-use-last",true);}else{state.setOpt(this,"et-al-use-last",false);}};CSL.Attributes["@et-al-subsequent-min"]=function(state,arg){var val=parseInt(arg,10);if(state[state.build.area].opt.max_number_of_names<val){state[state.build.area].opt.max_number_of_names=val;}state.setOpt(this,"et-al-subsequent-min",val);};CSL.Attributes["@et-al-subsequent-use-first"]=function(state,arg){state.setOpt(this,"et-al-subsequent-use-first",parseInt(arg,10));};CSL.Attributes["@suppress-min"]=function(state,arg){this.strings["suppress-min"]=parseInt(arg,10);};CSL.Attributes["@suppress-max"]=function(state,arg){this.strings["suppress-max"]=parseInt(arg,10);};CSL.Attributes["@and"]=function(state,arg){state.setOpt(this,"and",arg);};CSL.Attributes["@delimiter-precedes-last"]=function(state,arg){state.setOpt(this,"delimiter-precedes-last",arg);};CSL.Attributes["@delimiter-precedes-et-al"]=function(state,arg){state.setOpt(this,"delimiter-precedes-et-al",arg);};CSL.Attributes["@initialize-with"]=function(state,arg){state.setOpt(this,"initialize-with",arg);};CSL.Attributes["@initialize"]=function(state,arg){if(arg==="false"){state.setOpt(this,"initialize",false);}};CSL.Attributes["@name-as-reverse-order"]=function(state,arg){this["name-as-reverse-order"]=arg;};CSL.Attributes["@name-as-sort-order"]=function(state,arg){if(this.name==="style-options"){this["name-as-sort-order"]=arg;}else{state.setOpt(this,"name-as-sort-order",arg);}};CSL.Attributes["@sort-separator"]=function(state,arg){state.setOpt(this,"sort-separator",arg);};CSL.Attributes["@year-suffix-delimiter"]=function(state,arg){state[this.name].opt["year-suffix-delimiter"]=arg;};CSL.Attributes["@after-collapse-delimiter"]=function(state,arg){state[this.name].opt["after-collapse-delimiter"]=arg;};CSL.Attributes["@subsequent-author-substitute"]=function(state,arg){state[this.name].opt["subsequent-author-substitute"]=arg;};CSL.Attributes["@subsequent-author-substitute-rule"]=function(state,arg){state[this.name].opt["subsequent-author-substitute-rule"]=arg;};CSL.Attributes["@disambiguate-add-names"]=function(state,arg){if(arg==="true"){state.opt["disambiguate-add-names"]=true;}};CSL.Attributes["@disambiguate-add-givenname"]=function(state,arg){if(arg==="true"){state.opt["disambiguate-add-givenname"]=true;}};CSL.Attributes["@disambiguate-add-year-suffix"]=function(state,arg){if(arg==="true"&&state.opt.xclass!=="numeric"){state.opt["disambiguate-add-year-suffix"]=true;}};CSL.Attributes["@second-field-align"]=function(state,arg){if(arg==="flush"||arg==="margin"){state[this.name].opt["second-field-align"]=arg;}};CSL.Attributes["@hanging-indent"]=function(state,arg){if(arg==="true"){state[this.name].opt.hangingindent=2;}};CSL.Attributes["@line-spacing"]=function(state,arg){if(arg&&arg.match(/^[.0-9]+$/)){state[this.name].opt["line-spacing"]=parseFloat(arg,10);}};CSL.Attributes["@entry-spacing"]=function(state,arg){if(arg&&arg.match(/^[.0-9]+$/)){state[this.name].opt["entry-spacing"]=parseFloat(arg,10);}};CSL.Attributes["@near-note-distance"]=function(state,arg){state[this.name].opt["near-note-distance"]=parseInt(arg,10);};CSL.Attributes["@text-case"]=function(state,arg){var func=function func(state,Item){if(arg==="normal"){this.text_case_normal=true;}else{this.strings["text-case"]=arg;if(arg==="title"){var m=false;var default_locale=state.opt["default-locale"][0].slice(0,2);if(Item.jurisdiction){this.strings["text-case"]="passthrough";}}}};this.execs.push(func);};CSL.Attributes["@page-range-format"]=function(state,arg){state.opt["page-range-format"]=arg;};CSL.Attributes["@year-range-format"]=function(state,arg){state.opt["year-range-format"]=arg;};CSL.Attributes["@default-locale"]=function(state,arg){if(this.name==='style'){var lst,len,pos,m,ret;var m=arg.match(/-x-(sort|translit|translat)-/g);if(m){for(pos=0,len=m.length;pos<len;pos+=1){m[pos]=m[pos].replace(/^-x-/,"").replace(/-$/,"");}}lst=arg.split(/-x-(?:sort|translit|translat)-/);ret=[lst[0]];for(pos=1,len=lst.length;pos<len;pos+=1){ret.push(m[pos-1]);ret.push(lst[pos]);}lst=ret.slice();len=lst.length;for(pos=1;pos<len;pos+=2){state.opt["locale-"+lst[pos]].push(lst[pos+1].replace(/^\s*/g,"").replace(/\s*$/g,""));}if(lst.length){state.opt["default-locale"]=lst.slice(0,1);}else{state.opt["default-locale"]=["en"];}}else if(arg==="true"){this.default_locale=true;}};CSL.Attributes["@default-locale-sort"]=function(state,arg){var lst,len,pos,m,ret;state.opt["default-locale-sort"]=arg;};CSL.Attributes["@demote-non-dropping-particle"]=function(state,arg){state.opt["demote-non-dropping-particle"]=arg;};CSL.Attributes["@initialize-with-hyphen"]=function(state,arg){if(arg==="false"){state.opt["initialize-with-hyphen"]=false;}};CSL.Attributes["@institution-parts"]=function(state,arg){this.strings["institution-parts"]=arg;};CSL.Attributes["@if-short"]=function(state,arg){if(arg==="true"){this.strings["if-short"]=true;}};CSL.Attributes["@substitute-use-first"]=function(state,arg){this.strings["substitute-use-first"]=parseInt(arg,10);};CSL.Attributes["@use-first"]=function(state,arg){this.strings["use-first"]=parseInt(arg,10);};CSL.Attributes["@stop-last"]=function(state,arg){this.strings["stop-last"]=parseInt(arg,10)*-1;};CSL.Attributes["@use-last"]=function(state,arg){this.strings["use-last"]=parseInt(arg,10);};CSL.Attributes["@reverse-order"]=function(state,arg){if("true"===arg){this.strings["reverse-order"]=true;}};CSL.Attributes["@display"]=function(state,arg){if(state.bibliography.tokens.length===2){state.opt.using_display=true;}this.strings.cls=arg;};module.exports=CSL;CSL.Stack=function(val,literal){this.mystack=[];if(literal||val){this.mystack.push(val);}this.tip=this.mystack[0];};CSL.Stack.prototype.push=function(val,literal){if(literal||val){this.mystack.push(val);}else{this.mystack.push("");}this.tip=this.mystack[this.mystack.length-1];};CSL.Stack.prototype.clear=function(){this.mystack=[];this.tip={};};CSL.Stack.prototype.replace=function(val,literal){if(this.mystack.length===0){throw"Internal CSL processor error: attempt to replace nonexistent stack item with "+val;}if(literal||val){this.mystack[this.mystack.length-1]=val;}else{this.mystack[this.mystack.length-1]="";}this.tip=this.mystack[this.mystack.length-1];};CSL.Stack.prototype.pop=function(){var ret=this.mystack.pop();if(this.mystack.length){this.tip=this.mystack[this.mystack.length-1];}else{this.tip={};}return ret;};CSL.Stack.prototype.value=function(){return this.mystack.slice(-1)[0];};CSL.Stack.prototype.length=function(){return this.mystack.length;};module.exports=CSL;CSL.Parallel=function(state){this.state=state;this.sets=new CSL.Stack([]);this.try_cite=true;this.use_parallels=false;this.midVars=["section","volume","container-title","collection-number","issue","page-first","page","number"];this.ignoreVarsLawGeneral=["first-reference-note-number","locator","label","page-first","page","genre"];this.ignoreVarsLawProceduralHistory=["issued","first-reference-note-number","locator","label","page-first","page","genre","jurisdiction"];this.ignoreVarsOrders=["first-reference-note-number"];this.ignoreVarsOther=["first-reference-note-number","locator","label","section","page-first","page"];};CSL.Parallel.prototype.isMid=function(variable){return this.midVars.indexOf(variable)>-1;};CSL.Parallel.prototype.StartCitation=function(sortedItems,out){this.parallel_conditional_blobs_list=[];if(this.use_parallels){this.sortedItems=sortedItems;this.sortedItemsPos=-1;this.sets.clear();this.sets.push([]);this.in_series=true;this.delim_counter=0;this.delim_pointers=[];if(out){this.out=out;}else{this.out=this.state.output.queue;}this.master_was_neutral_cite=true;}};CSL.Parallel.prototype.StartCite=function(Item,item,prevItemID){var position,len,pos,x,curr,master,last_id,prev_locator,curr_locator,is_master,parallel;if(this.use_parallels){if(this.sets.value().length&&this.sets.value()[0].itemId==Item.id){this.ComposeSet();}this.sortedItemsPos+=1;if(item){position=item.position;}this.try_cite=true;var has_citationRequired_var=false;for(var i=0,ilen=CSL.PARALLEL_MATCH_VARS.length;i<ilen;i+=1){if(Item[CSL.PARALLEL_MATCH_VARS[i]]){has_citationRequired_var=true;break;}}var basics_ok=true;var last_cite=this.sets.value().slice(-1)[0];if(last_cite&&last_cite.Item){var lastJuris=last_cite.Item.jurisdiction?last_cite.Item.jurisdiction.split(":")[0]:"";var thisJuris=Item.jurisdiction?Item.jurisdiction.split(":")[0]:"";if(last_cite.Item.title!==Item.title){basics_ok=false;}else if(lastJuris!==thisJuris){basics_ok=false;}else if(last_cite.Item.type!==Item.type){basics_ok=false;}else if(["article-journal","article-magazine"].indexOf(Item.type)>-1){if(!this.state.opt.development_extensions.handle_parallel_articles||last_cite.Item["container-title"]!==Item["container-title"]){basics_ok=false;}}}if(!basics_ok||!has_citationRequired_var||CSL.PARALLEL_TYPES.indexOf(Item.type)===-1){this.try_cite=true;if(this.in_series){this.in_series=false;}}this.cite={};this.cite.front=[];this.cite.mid=[];this.cite.back=[];this.cite.front_collapse={};this.cite.back_forceme=[];this.cite.position=position;this.cite.Item=Item;this.cite.itemId=""+Item.id;this.cite.prevItemID=""+prevItemID;this.target="front";if(["treaty"].indexOf(Item.type)>-1){this.ignoreVars=this.ignoreVarsOrders;}else if(["article-journal","article-magazine"].indexOf(Item.type)>-1){this.ignoreVars=this.ignoreVarsOther;}else if(item&&item.prefix){this.ignoreVars=this.ignoreVarsLawProceduralHistory;this.cite.useProceduralHistory=true;var prev=this.sets.value()[this.sets.value().length-1];if(prev&&prev.back){for(var i=prev.back.length-1;i>-1;i+=-1){if(prev.back[i]&&prev[prev.back[i]]){delete prev[prev.back[i]];}}}}else{this.ignoreVars=this.ignoreVarsLawGeneral;}if(this.sortedItems&&this.sortedItemsPos>0&&this.sortedItemsPos<this.sortedItems.length){curr=this.sortedItems[this.sortedItemsPos][1];last_id=""+this.sortedItems[this.sortedItemsPos-1][1].id;master=this.state.registry.registry[last_id].parallel;prev_locator=false;if(master==curr.id){len=this.sortedItemsPos-1;for(pos=len;pos>-1;pos+=-1){if(this.sortedItems[pos][1].id==Item.id){prev_locator=this.sortedItems[pos][1].locator;break;}}curr_locator=this.sortedItems[this.sortedItemsPos][1].locator;if(!prev_locator&&curr_locator){curr.position=CSL.POSITION_IBID_WITH_LOCATOR;}else if(curr_locator===prev_locator){curr.position=CSL.POSITION_IBID;}else{curr.position=CSL.POSITION_IBID_WITH_LOCATOR;}}}else if(this.state.registry.registry[Item.id]){this.state.registry.registry[Item.id].parallel=false;}else{this.try_cite=false;this.force_collapse=false;return;}this.force_collapse=false;if(this.state.registry.registry[Item.id].parallel){this.force_collapse=true;}}};CSL.Parallel.prototype.StartVariable=function(variable,real_variable){if(this.use_parallels&&(this.try_cite||this.force_collapse)){if(variable==="names"){this.variable=variable+":"+this.target;}else{this.variable=variable;}if(this.ignoreVars.indexOf(variable)>-1){return;}if(variable==="container-title"&&this.sets.value().length===0){this.master_was_neutral_cite=false;}this.data={};this.data.value="";this.data.blobs=[];var is_mid=this.isMid(variable);if(real_variable==="authority"&&this.variable==="names:front"&&this.sets.value().length){var prev=this.sets.value()[this.sets.value().length-1].Item;var thisAuthority=false;if(this.cite.Item.authority&&this.cite.Item.authority.length){thisAuthority=this.cite.Item.authority[0].literal;}var thatAuthority=false;if(prev.authority&&prev.authority.length){thatAuthority=prev.authority[0].literal;}if(thisAuthority!==thatAuthority){this.try_cite=true;this.in_series=false;}}else if(this.target==="front"&&is_mid){this.target="mid";}else if(this.target==="mid"&&!is_mid&&this.cite.Item.title&&variable!=="names"){this.target="back";}else if(this.target==="back"&&is_mid){this.try_cite=true;this.in_series=false;}if(variable==="number"){this.cite.front.push(this.variable);}else if(CSL.PARALLEL_COLLAPSING_MID_VARSET.indexOf(variable)>-1){if(["article-journal","article-magazine"].indexOf(this.cite.Item.type)>-1){this.cite.mid.push(this.variable);}else{this.cite.front.push(this.variable);}}else{this.cite[this.target].push(this.variable);}}};CSL.Parallel.prototype.AppendBlobPointer=function(blob){if(this.use_parallels){if(this.ignoreVars.indexOf(this.variable)>-1){return;}if(this.use_parallels&&(this.force_collapse||this.try_cite)){if(["article-journal","article-magazine"].indexOf(this.cite.Item.type)>-1){if(["volume","page","page-first","issue"].indexOf(this.variable)>-1){return;}if("container-title"===this.variable&&this.cite.mid.length>1){return;}}if(this.variable&&(this.try_cite||this.force_collapse)&&blob&&blob.blobs){if(!(this.cite.useProceduralHistory&&this.target==="back")){this.data.blobs.push([blob,blob.blobs.length]);}}}}};CSL.Parallel.prototype.AppendToVariable=function(str,varname){if(this.use_parallels){if(this.ignoreVars.indexOf(this.variable)>-1){return;}if(this.try_cite||this.force_collapse){if(this.target!=="back"||true){this.data.value+="::"+str;}else{var prev=this.sets.value()[this.sets.value().length-1];if(prev){if(prev[this.variable]){if(prev[this.variable].value){this.data.value+="::"+str;}}}}}}};CSL.Parallel.prototype.CloseVariable=function(){if(this.use_parallels){if(this.ignoreVars.indexOf(this.variable)>-1){return;}if(this.try_cite||this.force_collapse){this.cite[this.variable]=this.data;if(this.sets.value().length>0){var prev=this.sets.value()[this.sets.value().length-1];if(this.target==="front"&&this.variable==="issued"){if(this.data.value&&this.master_was_neutral_cite){this.target="mid";}}if(this.target==="front"){if((prev[this.variable]||this.data.value)&&(!prev[this.variable]||this.data.value!==prev[this.variable].value)){if("issued"!==this.variable){this.in_series=false;}}}else if(this.target==="mid"){if(CSL.PARALLEL_COLLAPSING_MID_VARSET.indexOf(this.variable)>-1){if(prev[this.variable]){if(prev[this.variable].value===this.data.value){this.cite.front_collapse[this.variable]=true;}else{this.cite.front_collapse[this.variable]=false;}}else{this.cite.front_collapse[this.variable]=false;}}}else if(this.target==="back"){if(prev[this.variable]){if(this.data.value!==prev[this.variable].value&&this.sets.value().slice(-1)[0].back_forceme.indexOf(this.variable)===-1){this.in_series=false;}}}}}this.variable=false;}};CSL.Parallel.prototype.CloseCite=function(){var x,pos,len,has_issued,use_journal_info,volume_pos,container_title_pos,section_pos;if(this.use_parallels&&(this.force_collapse||this.try_cite)){use_journal_info=false;if(!this.cite.front_collapse["container-title"]){use_journal_info=true;}if(this.cite.front_collapse.volume===false){use_journal_info=true;}if(this.cite.front_collapse["collection-number"]===false){use_journal_info=true;}if(this.cite.front_collapse.section===false){use_journal_info=true;}if(use_journal_info){this.cite.use_journal_info=true;section_pos=this.cite.front.indexOf("section");if(section_pos>-1){this.cite.front=this.cite.front.slice(0,section_pos).concat(this.cite.front.slice(section_pos+1));}volume_pos=this.cite.front.indexOf("volume");if(volume_pos>-1){this.cite.front=this.cite.front.slice(0,volume_pos).concat(this.cite.front.slice(volume_pos+1));}container_title_pos=this.cite.front.indexOf("container-title");if(container_title_pos>-1){this.cite.front=this.cite.front.slice(0,container_title_pos).concat(this.cite.front.slice(container_title_pos+1));}var collection_number_pos=this.cite.front.indexOf("collection-number");if(collection_number_pos>-1){this.cite.front=this.cite.front.slice(0,collection_number_pos).concat(this.cite.front.slice(collection_number_pos+1));}}if(!this.in_series&&!this.force_collapse){this.ComposeSet(true);}if(this.sets.value().length===0){var has_date=false;for(pos=0,len=this.cite.back.length;pos<len;pos+=1){x=this.cite.back[pos];if(x==="issued"&&this.cite["issued"]&&this.cite["issued"].value){has_date=true;break;}}if(!has_date){this.cite.back_forceme.push("issued");}}else{var idx=this.cite.front.indexOf("issued");if(idx===-1||this.master_was_neutral_cite){this.cite.back_forceme=this.sets.value().slice(-1)[0].back_forceme;}if(idx>-1){var prev=this.sets.value()[this.sets.value().length-1];if(!prev["issued"]){this.cite.front=this.cite.front.slice(0,idx).concat(this.cite.front.slice(idx+1));}}if(this.master_was_neutral_cite&&this.cite.mid.indexOf("names:mid")>-1){this.cite.front.push("names:mid");}}this.sets.value().push(this.cite);}};CSL.Parallel.prototype.ComposeSet=function(next_output_in_progress){var cite,pos,master,len;if(this.use_parallels&&(this.force_collapse||this.try_cite)){var lengthCheck=this.sets.value().length;if(this.sets.value().length===1){if(!this.in_series){this.sets.value().pop();this.delim_counter+=1;}}else{len=this.sets.value().length;for(pos=0;pos<len;pos+=1){cite=this.sets.value()[pos];if(pos===0){this.delim_counter+=1;}else{if(!cite.Item.title&&cite.use_journal_info){this.delim_pointers.push(false);}else{this.delim_pointers.push(this.delim_counter);}this.delim_counter+=1;}if(CSL.POSITION_FIRST===cite.position){if(pos===0){this.state.registry.registry[cite.itemId].master=true;this.state.registry.registry[cite.itemId].siblings=[];this.state.registry.registry[cite.itemId].parallel=false;}else{if(cite.prevItemID){if(!this.state.registry.registry[cite.prevItemID].parallel){this.state.registry.registry[cite.itemId].parallel=cite.prevItemID;}else{this.state.registry.registry[cite.itemId].parallel=this.state.registry.registry[cite.prevItemID].parallel;}this.state.registry.registry[cite.itemId].siblings=this.state.registry.registry[cite.prevItemID].siblings;if(!this.state.registry.registry[cite.itemId].siblings){this.state.registry.registry[cite.itemId].siblings=[];CSL.debug("WARNING: adding missing siblings array to registry object");}this.state.registry.registry[cite.itemId].siblings.push(cite.itemId);}}}}this.sets.push([]);}if(lengthCheck<2){this.purgeGroupsIfParallel(false);}else{this.purgeGroupsIfParallel(true);}this.in_series=true;}};CSL.Parallel.prototype.PruneOutputQueue=function(){var len,pos,series,ppos,llen,cite;if(this.use_parallels){len=this.sets.mystack.length;for(pos=0;pos<len;pos+=1){series=this.sets.mystack[pos];if(series.length>1){llen=series.length;for(ppos=0;ppos<llen;ppos+=1){cite=series[ppos];if(ppos===0){this.purgeVariableBlobs(cite,cite.back);}else if(ppos===series.length-1){this.purgeVariableBlobs(cite,cite.front.concat(cite.back_forceme));}else{this.purgeVariableBlobs(cite,cite.front.concat(cite.back));}}}}}};CSL.Parallel.prototype.purgeVariableBlobs=function(cite,varnames){var len,pos,varname,b,llen,ppos,out;if(this.use_parallels){out=this.state.output.current.value();if("undefined"===typeof out.length){out=out.blobs;}for(pos=0,len=this.delim_pointers.length;pos<len;pos+=1){ppos=this.delim_pointers[pos];if(ppos!==false){out[ppos].parallel_delimiter=", ";}}len=varnames.length-1;for(pos=len;pos>-1;pos+=-1){varname=varnames[pos];if(cite[varname]){llen=cite[varname].blobs.length-1;for(ppos=llen;ppos>-1;ppos+=-1){b=cite[varname].blobs[ppos];b[0].blobs=b[0].blobs.slice(0,b[1]).concat(b[0].blobs.slice(b[1]+1));this.state.tmp.has_purged_parallel=true;if(b[0]&&b[0].strings&&"string"==typeof b[0].strings.oops&&b[0].parent&&b[0].parent){b[0].parent.parent.strings.delimiter=b[0].strings.oops;}}}}}};CSL.Parallel.prototype.purgeGroupsIfParallel=function(original_condition){for(var i=this.parallel_conditional_blobs_list.length-1;i>-1;i+=-1){var obj=this.parallel_conditional_blobs_list[i];var purgeme=true;for(var j=0,jlen=obj.conditions.length;j<jlen;j+=1){if(!(!obj.conditions[j]===!!original_condition||"master"===obj.conditions[j]&&!this.state.registry.registry[obj.id].master||"servant"===obj.conditions[j]&&!this.state.registry.registry[obj.id].parallel)){var purgeme=false;break;}}if(purgeme){var buffer=[];while(obj.blobs.length>obj.pos){buffer.push(obj.blobs.pop());}if(buffer.length){buffer.pop();}while(buffer.length){obj.blobs.push(buffer.pop());}}this.parallel_conditional_blobs_list.pop();}};module.exports=CSL;CSL.Util={};CSL.Util.Match=function(){this.any=function(token,state,tests){return function(Item,item){for(var i=0,ilen=tests.length;i<ilen;i+=1){var result=tests[i](Item,item);if(result){return true;}}return false;};};this.none=function(token,state,tests){return function(Item,item){for(var i=0,ilen=tests.length;i<ilen;i+=1){var result=tests[i](Item,item);if(result){return false;}}return true;};};this.all=function(token,state,tests){return function(Item,item){for(var i=0,ilen=tests.length;i<ilen;i+=1){var result=tests[i](Item,item);if(!result){return false;}}return true;};};this[undefined]=this.all;this.nand=function(token,state,tests){return function(Item,item){for(var i=0,ilen=tests.length;i<ilen;i+=1){var result=tests[i](Item,item);if(!result){return true;}}return false;};};};module.exports=CSL;CSL.Transform=function(state){var debug=false,abbreviations,token,fieldname,abbrev_family,opt;this.abbrevs={};this.abbrevs["default"]=new state.sys.AbbreviationSegments();this.getTextSubField=getTextSubField;function getCountryOrJurisdiction(variable,normalizedKey,quashCountry){var value="";if(state.sys.getHumanForm){if(variable==="country"){value=state.sys.getHumanForm(normalizedKey.toLowerCase(),false,true);value=value.split("|")[0];}else if(variable==="jurisdiction"){value=state.sys.getHumanForm(normalizedKey.toLowerCase(),false,true);if(!quashCountry){value=value.split("|").slice(1).join(", ");}else{value="";}}}return value;}function abbreviate(state,tok,Item,altvar,basevalue,family_var,use_field,form){var value="";var myabbrev_family=CSL.FIELD_CATEGORY_REMAP[family_var];var preferredJurisdiction;if(!myabbrev_family){return basevalue;}var variable=family_var;var normalizedKey=basevalue;if(state.sys.normalizeAbbrevsKey){normalizedKey=state.sys.normalizeAbbrevsKey(family_var,basevalue);}var quashCountry=false;if(variable==="jurisdiction"&&normalizedKey){quashCountry=normalizedKey.indexOf(":")===-1;}if(state.sys.getAbbreviation){if(["jurisdiction","country","language-name","language-name-original"].indexOf(variable)>-1){preferredJurisdiction="default";}else if(Item.jurisdiction){preferredJurisdiction=Item.jurisdiction;}else{preferredJurisdiction="default";}var jurisdiction=state.transform.loadAbbreviation(preferredJurisdiction,myabbrev_family,normalizedKey,Item.type);if(state.transform.abbrevs[jurisdiction][myabbrev_family]&&normalizedKey){var abbrev=state.transform.abbrevs[jurisdiction][myabbrev_family][normalizedKey];if(tok.strings.form==="short"&&abbrev){if(quashCountry){value="";}else{value=abbrev;}}else{value=getCountryOrJurisdiction(variable,normalizedKey,quashCountry);}}}if(!value&&(!state.opt.development_extensions.citationRequire_explicit_legal_case_title_short||Item.type!=='legal_case')&&altvar&&Item[altvar]&&use_field){value=Item[altvar];}if(!value&&!state.sys.getAbbreviation&&state.sys.getHumanForm){value=getCountryOrJurisdiction(variable,normalizedKey,quashCountry);}if(!value&&!quashCountry&&(!state.sys.getHumanForm||variable!=="jurisdiction")){value=basevalue;}return value;}function getFieldLocale(Item,field){var ret=state.opt["default-locale"][0].slice(0,2);var localeRex;if(state.opt.development_extensions.strict_text_case_locales){localeRex=new RegExp("^([a-zA-Z]{2})(?:$|-.*| .*)");}else{localeRex=new RegExp("^([a-zA-Z]{2})(?:$|-.*|.*)");}if(Item.language){var m=(""+Item.language).match(localeRex);if(m){ret=m[1];}else{ret="tlh";}}if(Item.multi&&Item.multi&&Item.multi.main&&Item.multi.main[field]){ret=Item.multi.main[field];}if(!state.opt.development_extensions.strict_text_case_locales||state.opt.development_extensions.normalize_lang_keys_to_lowercase){ret=ret.toLowerCase();}return ret;};function getTextSubField(Item,field,locale_type,use_default,stopOrig){var m,lst,opt,o,oo,pos,key,ret,len,myret,opts;var usedOrig=stopOrig;var usingOrig=false;if(!Item[field]){return{name:"",usedOrig:stopOrig,token:CSL.Util.cloneToken(this)};}ret={name:"",usedOrig:stopOrig,locale:getFieldLocale(Item,field)};opts=state.opt[locale_type];var hasVal=false;var jurisdictionName=false;if(locale_type==='locale-orig'){if(stopOrig){ret={name:"",usedOrig:stopOrig};}else{ret={name:Item[field],usedOrig:false,locale:getFieldLocale(Item,field)};}hasVal=true;usingOrig=true;}else if(use_default&&("undefined"===typeof opts||opts.length===0)){var ret={name:Item[field],usedOrig:true,locale:getFieldLocale(Item,field)};hasVal=true;usingOrig=true;}if(!hasVal){for(var i=0,ilen=opts.length;i<ilen;i+=1){opt=opts[i];o=opt.split(/[\-_]/)[0];if(opt&&Item.multi&&Item.multi._keys[field]&&Item.multi._keys[field][opt]){ret.name=Item.multi._keys[field][opt];ret.locale=opt;break;}else if(o&&Item.multi&&Item.multi._keys[field]&&Item.multi._keys[field][o]){ret.name=Item.multi._keys[field][o];ret.locale=o;break;}}if(!ret.name&&use_default){ret={name:Item[field],usedOrig:true,locale:getFieldLocale(Item,field)};usingOrig=true;}}ret.token=CSL.Util.cloneToken(this);if(["title","container-title"].indexOf(field)>-1){if(!usedOrig&&(!ret.token.strings["text-case"]||ret.token.strings["text-case"]==="sentence"||ret.token.strings["text-case"]==="normal")){var locale=usingOrig?false:ret.locale;var seg=field.slice(0,-5);var sentenceCase=ret.token.strings["text-case"]==="sentence"?true:false;ret.name=CSL.titlecaseSentenceOrNormal(state,Item,seg,locale,sentenceCase);delete ret.token.strings["text-case"];}}return ret;}function loadAbbreviation(jurisdiction,category,orig,itemType){var pos,len;if(!jurisdiction){jurisdiction="default";}if(!orig){if(!state.transform.abbrevs[jurisdiction]){state.transform.abbrevs[jurisdiction]=new state.sys.AbbreviationSegments();}if(!state.transform.abbrevs[jurisdiction][category]){state.transform.abbrevs[jurisdiction][category]={};}return jurisdiction;}if(state.sys.getAbbreviation){jurisdiction=state.sys.getAbbreviation(state.opt.styleID,state.transform.abbrevs,jurisdiction,category,orig,itemType,true);if(!jurisdiction){jurisdiction="default";}}return jurisdiction;}this.loadAbbreviation=loadAbbreviation;function publisherCheck(tok,Item,primary,family_var){var varname=tok.variables[0];if(state.publisherOutput&&primary){if(["publisher","publisher-place"].indexOf(varname)===-1){return false;}else{state.publisherOutput[varname+"-token"]=tok;state.publisherOutput.varlist.push(varname);var lst=primary.split(/;\s*/);if(lst.length===state.publisherOutput[varname+"-list"].length){state.publisherOutput[varname+"-list"]=lst;}for(var i=0,ilen=lst.length;i<ilen;i+=1){lst[i]=abbreviate(state,tok,Item,false,lst[i],family_var,true);}state.tmp[varname+"-token"]=tok;return true;}}return false;}function getOutputFunction(variables,family_var,abbreviation_fallback,alternative_varname,transform_fallback){var localesets;var langPrefs=CSL.LangPrefsMap[variables[0]];if(!langPrefs){localesets=false;}else{localesets=state.opt['cite-lang-prefs'][langPrefs];}return function(state,Item,item,usedOrig){var primary,primary_locale,secondary,secondary_locale,tertiary,tertiary_locale,primary_tok,group_tok,key;if(!variables[0]||!Item[variables[0]]&&!Item[alternative_varname]){return null;}var slot={primary:false,secondary:false,tertiary:false};if(state.tmp.area.slice(-5)==="_sort"){slot.primary='locale-sort';}else{if(localesets){var slotnames=["primary","secondary","tertiary"];for(var i=0,ilen=slotnames.length;i<ilen;i+=1){if(localesets.length-1<i){break;}if(localesets[i]){slot[slotnames[i]]='locale-'+localesets[i];}}}else{slot.primary='locale-orig';}}if(variables[0]==="title-short"||state.tmp.area!=="bibliography"&&!(state.tmp.area==="citation"&&state.opt.xclass==="note"&&item&&!item.position)){slot.secondary=false;slot.tertiary=false;}if(state.tmp["publisher-list"]){if(variables[0]==="publisher"){state.tmp["publisher-token"]=this;}else if(variables[0]==="publisher-place"){state.tmp["publisher-place-token"]=this;}return null;}var res=getTextSubField.call(this,Item,variables[0],slot.primary,true);primary=res.name;primary_locale=res.locale;var primary_tok=res.token;var primaryUsedOrig=res.usedOrig;if(publisherCheck(this,Item,primary,family_var)){return null;}secondary=false;tertiary=false;var secondary_tok;var tertiary_tok;if(slot.secondary){res=getTextSubField.call(this,Item,variables[0],slot.secondary,false,res.usedOrig);secondary=res.name;secondary_locale=res.locale;secondary_tok=res.token;}if(slot.tertiary){res=getTextSubField.call(this,Item,variables[0],slot.tertiary,false,res.usedOrig);tertiary=res.name;tertiary_locale=res.locale;tertiary_tok=res.token;}if(family_var){primary=abbreviate(state,primary_tok,Item,alternative_varname,primary,family_var,true);if(primary){primary=quashCheck(primary);}if(secondary){secondary=abbreviate(state,secondary_tok,Item,false,secondary,family_var,true);}if(tertiary){tertiary=abbreviate(state,tertiary_tok,Item,false,tertiary,family_var,true);}}var primaryPrefix;if(slot.primary==="locale-translit"){primaryPrefix=state.opt.citeAffixes[langPrefs][slot.primary].prefix;}if(primaryPrefix==="<i>"&&variables[0]==='title'&&!primaryUsedOrig){var hasItalic=false;for(var i=0,ilen=primary_tok.decorations.length;i<ilen;i+=1){if(primary_tok.decorations[i][0]==="@font-style"&&primary_tok.decorations[i][1]==="italic"){hasItalic=true;}}if(!hasItalic){primary_tok.decorations.push(["@font-style","italic"]);}}if(primary_locale!=="en"&&primary_tok.strings["text-case"]==="title"){primary_tok.strings["text-case"]="passthrough";}if("title"===variables[0]){primary=CSL.demoteNoiseWords(state,primary,this["leading-noise-words"]);}if(secondary||tertiary){state.output.openLevel("empty");primary_tok.strings.suffix=primary_tok.strings.suffix.replace(/[ .,]+$/,"");state.output.append(primary,primary_tok);if(secondary){secondary_tok.strings.prefix=state.opt.citeAffixes[langPrefs][slot.secondary].prefix;secondary_tok.strings.suffix=state.opt.citeAffixes[langPrefs][slot.secondary].suffix;if(!secondary_tok.strings.prefix){secondary_tok.strings.prefix=" ";}for(var i=secondary_tok.decorations.length-1;i>-1;i+=-1){if(['@quotes/true','@font-style/italic','@font-style/oblique','@font-weight/bold'].indexOf(secondary_tok.decorations[i].join('/'))>-1){secondary_tok.decorations=secondary_tok.decorations.slice(0,i).concat(secondary_tok.decorations.slice(i+1));}}if(secondary_locale!=="en"&&secondary_tok.strings["text-case"]==="title"){secondary_tok.strings["text-case"]="passthrough";}var secondary_outer=new CSL.Token();secondary_outer.decorations.push(["@font-style","normal"]);secondary_outer.decorations.push(["@font-weight","normal"]);state.output.openLevel(secondary_outer);state.output.append(secondary,secondary_tok);state.output.closeLevel();var blob_obj=state.output.current.value();var blobs_pos=state.output.current.value().blobs.length-1;if(state.parallel.use_parallels){state.parallel.cite.front.push(variables[0]+":secondary");state.parallel.cite[variables[0]+":secondary"]={blobs:[[blob_obj,blobs_pos]]};}}if(tertiary){tertiary_tok.strings.prefix=state.opt.citeAffixes[langPrefs][slot.tertiary].prefix;tertiary_tok.strings.suffix=state.opt.citeAffixes[langPrefs][slot.tertiary].suffix;if(!tertiary_tok.strings.prefix){tertiary_tok.strings.prefix=" ";}for(var i=tertiary_tok.decorations.length-1;i>-1;i+=-1){if(['@quotes/true','@font-style/italic','@font-style/oblique','@font-weight/bold'].indexOf(tertiary_tok.decorations[i].join('/'))>-1){tertiary_tok.decorations=tertiary_tok.decorations.slice(0,i).concat(tertiary_tok.decorations.slice(i+1));}}if(tertiary_locale!=="en"&&tertiary_tok.strings["text-case"]==="title"){tertiary_tok.strings["text-case"]="passthrough";}var tertiary_outer=new CSL.Token();tertiary_outer.decorations.push(["@font-style","normal"]);tertiary_outer.decorations.push(["@font-weight","normal"]);state.output.openLevel(tertiary_outer);state.output.append(tertiary,tertiary_tok);state.output.closeLevel();var blob_obj=state.output.current.value();var blobs_pos=state.output.current.value().blobs.length-1;if(state.parallel.use_parallels){state.parallel.cite.front.push(variables[0]+":tertiary");state.parallel.cite[variables[0]+":tertiary"]={blobs:[[blob_obj,blobs_pos]]};}}state.output.closeLevel();}else{state.output.append(primary,primary_tok);}return null;};}this.getOutputFunction=getOutputFunction;function quashCheck(value){var m=value.match(/^!([-,_a-z]+)>>>/);if(m){var fields=m[1].split(",");value=value.slice(m[0].length);for(var i=0,ilen=fields.length;i<ilen;i+=1){if(state.tmp.done_vars.indexOf(fields[i])===-1){state.tmp.done_vars.push(fields[i]);}}}return value;}this.quashCheck=quashCheck;};module.exports=CSL;CSL.Token=function(name,tokentype){this.name=name;this.strings={};this.strings.delimiter=undefined;this.strings.prefix="";this.strings.suffix="";this.decorations=[];this.variables=[];this.execs=[];this.tokentype=tokentype;this.evaluator=false;this.tests=[];this.rawtests=[];this.succeed=false;this.fail=false;this.next=false;};CSL.Util.cloneToken=function(token){var newtok,key,pos,len;if("string"===typeof token){return token;}newtok=new CSL.Token(token.name,token.tokentype);for(var key in token.strings){if(token.strings.hasOwnProperty(key)){newtok.strings[key]=token.strings[key];}}if(token.decorations){newtok.decorations=[];for(pos=0,len=token.decorations.length;pos<len;pos+=1){newtok.decorations.push(token.decorations[pos].slice());}}if(token.variables){newtok.variables=token.variables.slice();}if(token.execs){newtok.execs=token.execs.slice();newtok.tests=token.tests.slice();newtok.rawtests=token.tests.slice();}return newtok;};module.exports=CSL;CSL.AmbigConfig=function(){this.maxvals=[];this.minval=1;this.names=[];this.givens=[];this.year_suffix=false;this.disambiguate=0;};module.exports=CSL;CSL.Blob=function(str,token,levelname){var len,pos,key;this.levelname=levelname;if(token){this.strings={"prefix":"","suffix":""};for(var key in token.strings){if(token.strings.hasOwnProperty(key)){this.strings[key]=token.strings[key];}}this.decorations=[];if(token.decorations===undefined){len=0;}else{len=token.decorations.length;}for(pos=0;pos<len;pos+=1){this.decorations.push(token.decorations[pos].slice());}}else{this.strings={};this.strings.prefix="";this.strings.suffix="";this.strings.delimiter="";this.decorations=[];}if("string"===typeof str){this.blobs=str;}else if(str){this.blobs=[str];}else{this.blobs=[];}this.alldecor=[this.decorations];};CSL.Blob.prototype.push=function(blob){if("string"===typeof this.blobs){throw"Attempt to push blob onto string object";}else if(false!==blob){blob.alldecor=blob.alldecor.concat(this.alldecor);this.blobs.push(blob);}};module.exports=CSL;CSL.NumericBlob=function(particle,num,mother_token,id){this.id=id;this.alldecor=[];this.num=num;this.particle=particle;this.blobs=num.toString();this.status=CSL.START;this.strings={};if(mother_token){this.gender=mother_token.gender;this.decorations=mother_token.decorations;this.strings.prefix=mother_token.strings.prefix;this.strings.suffix=mother_token.strings.suffix;this.strings["text-case"]=mother_token.strings["text-case"];this.successor_prefix=mother_token.successor_prefix;this.range_prefix=mother_token.range_prefix;this.splice_prefix=mother_token.splice_prefix;this.formatter=mother_token.formatter;if(!this.formatter){this.formatter=new CSL.Output.DefaultFormatter();}if(this.formatter){this.type=this.formatter.format(1);}}else{this.decorations=[];this.strings.prefix="";this.strings.suffix="";this.successor_prefix="";this.range_prefix="";this.splice_prefix="";this.formatter=new CSL.Output.DefaultFormatter();}};CSL.NumericBlob.prototype.setFormatter=function(formatter){this.formatter=formatter;this.type=this.formatter.format(1);};CSL.Output.DefaultFormatter=function(){};CSL.Output.DefaultFormatter.prototype.format=function(num){return num.toString();};CSL.NumericBlob.prototype.checkNext=function(next,start){if(start){this.status=CSL.START;if("object"===_typeof(next)){if(next.num===this.num+1){next.status=CSL.SUCCESSOR;}else{next.status=CSL.SEEN;}}}else if(!next||!next.num||this.type!==next.type||next.num!==this.num+1){if(this.status===CSL.SUCCESSOR_OF_SUCCESSOR){this.status=CSL.END;}if("object"===_typeof(next)){next.status=CSL.SEEN;}}else{if(this.status===CSL.START||this.status===CSL.SEEN){next.status=CSL.SUCCESSOR;}else if(this.status===CSL.SUCCESSOR||this.status===CSL.SUCCESSOR_OF_SUCCESSOR){if(this.range_prefix){next.status=CSL.SUCCESSOR_OF_SUCCESSOR;this.status=CSL.SUPPRESS;}else{next.status=CSL.SUCCESSOR;}}}};CSL.NumericBlob.prototype.checkLast=function(last){if(this.status===CSL.SEEN||last.num!==this.num-1&&this.status===CSL.SUCCESSOR){this.status=CSL.SUCCESSOR;return true;}return false;};module.exports=CSL;CSL.Util.fixDateNode=function(parent,pos,node){var form,variable,datexml,subnode,partname,attr,val,prefix,suffix,children,key,subchildren,kkey,display,cslid;var lingo=this.cslXml.getAttributeValue(node,"lingo");var default_locale=this.cslXml.getAttributeValue(node,"default-locale");this.build.date_key=true;form=this.cslXml.getAttributeValue(node,"form");var lingo;if(default_locale){lingo=this.opt["default-locale"][0];}else{lingo=this.cslXml.getAttributeValue(node,"lingo");}if(!this.getDate(form,default_locale)){return parent;}var dateparts=this.cslXml.getAttributeValue(node,"date-parts");variable=this.cslXml.getAttributeValue(node,"variable");prefix=this.cslXml.getAttributeValue(node,"prefix");suffix=this.cslXml.getAttributeValue(node,"suffix");display=this.cslXml.getAttributeValue(node,"display");cslid=this.cslXml.getAttributeValue(node,"cslid");datexml=this.cslXml.nodeCopy(this.getDate(form,default_locale));this.cslXml.setAttribute(datexml,'lingo',this.opt.lang);this.cslXml.setAttribute(datexml,'form',form);this.cslXml.setAttribute(datexml,'date-parts',dateparts);this.cslXml.setAttribute(datexml,"cslid",cslid);this.cslXml.setAttribute(datexml,'variable',variable);this.cslXml.setAttribute(datexml,'default-locale',default_locale);if(prefix){this.cslXml.setAttribute(datexml,"prefix",prefix);}if(suffix){this.cslXml.setAttribute(datexml,"suffix",suffix);}if(display){this.cslXml.setAttribute(datexml,"display",display);}children=this.cslXml.children(datexml);for(var key in children){subnode=children[key];if("date-part"===this.cslXml.nodename(subnode)){partname=this.cslXml.getAttributeValue(subnode,"name");if(default_locale){this.cslXml.setAttributeOnNodeIdentifiedByNameAttribute(datexml,"date-part",partname,"@default-locale","true");}}}children=this.cslXml.children(node);for(var key in children){subnode=children[key];if("date-part"===this.cslXml.nodename(subnode)){partname=this.cslXml.getAttributeValue(subnode,"name");subchildren=this.cslXml.attributes(subnode);for(attr in subchildren){if("@name"===attr){continue;}if(lingo&&lingo!==this.opt.lang){if(["@suffix","@prefix","@form"].indexOf(attr)>-1){continue;}}val=subchildren[attr];this.cslXml.setAttributeOnNodeIdentifiedByNameAttribute(datexml,"date-part",partname,attr,val);}}}if("year"===this.cslXml.getAttributeValue(node,"date-parts")){this.cslXml.deleteNodeByNameAttribute(datexml,'month');this.cslXml.deleteNodeByNameAttribute(datexml,'day');}else if("year-month"===this.cslXml.getAttributeValue(node,"date-parts")){this.cslXml.deleteNodeByNameAttribute(datexml,'day');}else if("month-day"===this.cslXml.getAttributeValue(node,"date-parts")){var childNodes=this.cslXml.children(datexml);for(var i=1,ilen=this.cslXml.numberofnodes(childNodes);i<ilen;i++){if(this.cslXml.getAttributeValue(childNodes[i],'name')==="year"){this.cslXml.setAttribute(childNodes[i-1],"suffix","");break;}}this.cslXml.deleteNodeByNameAttribute(datexml,'year');}return this.cslXml.insertChildNodeAfter(parent,node,pos,datexml);};module.exports=CSL;CSL.dateMacroAsSortKey=function(state,Item){CSL.dateAsSortKey.call(this,state,Item,true);};CSL.dateAsSortKey=function(state,Item,isMacro){var dp,elem,value,e,yr,prefix,i,ilen,num;var variable=this.variables[0];var macroFlag="empty";if(isMacro&&state.tmp.extension){macroFlag="macro-with-date";}dp=Item[variable];if("undefined"===typeof dp){dp={"date-parts":[[0]]};if(!dp.year){state.tmp.empty_date=true;}}if("undefined"===typeof this.dateparts){this.dateparts=["year","month","day"];}if(dp.raw){dp=state.fun.dateparser.parseDateToArray(dp.raw);}else if(dp["date-parts"]){dp=state.dateParseArray(dp);}if("undefined"===typeof dp){dp={};}for(i=0,ilen=CSL.DATE_PARTS_INTERNAL.length;i<ilen;i+=1){elem=CSL.DATE_PARTS_INTERNAL[i];value=0;e=elem;if(e.slice(-4)==="_end"){e=e.slice(0,-4);}if(dp[elem]&&this.dateparts.indexOf(e)>-1){value=dp[elem];}if(elem.slice(0,4)==="year"){yr=CSL.Util.Dates[e].numeric(state,value);var prefix="Y";if(yr[0]==="-"){prefix="X";yr=yr.slice(1);yr=9999-parseInt(yr,10);}state.output.append(CSL.Util.Dates[elem.slice(0,4)].numeric(state,prefix+yr),macroFlag);}else{value=CSL.Util.Dates[e]["numeric-leading-zeros"](state,value);if(!value){value="00";}state.output.append(value,macroFlag);}}};CSL.Engine.prototype.dateParseArray=function(date_obj){var ret,field,dpos,ppos,dp,exts,llen,pos,len,pppos,lllen;ret={};for(field in date_obj){if(field==="date-parts"){dp=date_obj["date-parts"];if(dp.length>1){if(dp[0].length!==dp[1].length){CSL.error("CSL data error: element mismatch in date range input.");}}exts=["","_end"];for(var i=0,ilen=dp.length;i<ilen;i+=1){for(var j=0,jlen=CSL.DATE_PARTS.length;j<jlen;j+=1){if(isNaN(parseInt(dp[i][j],10))){ret[CSL.DATE_PARTS[j]+exts[i]]=undefined;}else{ret[CSL.DATE_PARTS[j]+exts[i]]=parseInt(dp[i][j],10);}}}}else if(date_obj.hasOwnProperty(field)){if(field==="literal"&&"object"===_typeof(date_obj.literal)&&"string"===typeof date_obj.literal.part){CSL.debug("Warning: fixing up weird literal date value");ret.literal=date_obj.literal.part;}else{ret[field]=date_obj[field];}}}return ret;};module.exports=CSL;CSL.Util.Names={};CSL.Util.Names.compareNamesets=CSL.NameOutput.prototype._compareNamesets;CSL.Util.Names.unInitialize=function(state,name){var i,ilen,namelist,punctlist,ret;if(!name){return"";}namelist=name.split(/(?:\-|\s+)/);punctlist=name.match(/(\-|\s+)/g);ret="";for(i=0,ilen=namelist.length;i<ilen;i+=1){ret+=namelist[i];if(i<ilen-1){ret+=punctlist[i];}}return ret;};CSL.Util.Names.initializeWith=function(state,name,terminator,normalizeOnly){var i,ilen,j,jlen,n,m,mm,str,lst,ret;if(!name){return"";}if(!terminator){terminator="";}if(["Lord","Lady"].indexOf(name)>-1||!name.match(CSL.STARTSWITH_ROMANESQUE_REGEXP)&&!terminator.match("%s")){return name;}var namelist=name;if(state.opt["initialize-with-hyphen"]===false){namelist=namelist.replace(/\-/g," ");}namelist=namelist.replace(/\s*\-\s*/g,"-").replace(/\s+/g," ");namelist=namelist.replace(/-([a-z])/g,"\u2013$1");mm=namelist.match(/[\-\s]+/g);lst=namelist.split(/[\-\s]+/);if(lst.length===0){namelist=mm;}else{namelist=[lst[0]];for(i=1,ilen=lst.length;i<ilen;i+=1){namelist.push(mm[i-1]);namelist.push(lst[i]);}}lst=namelist;for(i=lst.length-1;i>-1;i+=-1){if(lst[i]&&lst[i].slice(0,-1).indexOf(".")>-1){var lstend=lst.slice(i+1);var lstmid=lst[i].slice(0,-1).split(".");lst=lst.slice(0,i);for(j=0,jlen=lstmid.length;j<jlen;j+=1){lst.push(lstmid[j]+".");if(j<lstmid.length-1){lst.push(" ");}}lst=lst.concat(lstend);}}if(normalizeOnly){ret=CSL.Util.Names.doNormalize(state,lst,terminator);}else{ret=CSL.Util.Names.doInitialize(state,lst,terminator);}ret=ret.replace(/\u2013([a-z])/g,"-$1");return ret;};CSL.Util.Names.doNormalize=function(state,namelist,terminator,mode){var i,ilen;terminator=terminator?terminator:"";var isAbbrev=[];for(i=0,ilen=namelist.length;i<ilen;i+=1){if(namelist[i].length>1&&namelist[i].slice(-1)==="."){namelist[i]=namelist[i].slice(0,-1);isAbbrev.push(true);}else if(namelist[i].length===1&&namelist[i].toUpperCase()===namelist[i]){isAbbrev.push(true);}else{isAbbrev.push(false);}}var ret=[];for(i=0,ilen=namelist.length;i<ilen;i+=2){if(isAbbrev[i]){if(i<namelist.length-2){namelist[i+1]="";var onlySpace=terminator.match(/^[\u0009\u000a\u000b\u000c\u000d\u0020\u00a0]+$/);if(onlySpace||(!terminator||terminator.slice(-1)&&!terminator.slice(-1).match(/[\u0009\u000a\u000b\u000c\u000d\u0020\u00a0]/))&&namelist[i].length&&namelist[i].match(CSL.ALL_ROMANESQUE_REGEXP)&&(namelist[i].length>1||namelist[i+2].length>1)){namelist[i+1]=" ";}if(namelist[i+2].length>1){namelist[i]=namelist[i]+terminator.replace(/\ufeff$/,"");}else{namelist[i]=namelist[i]+terminator;}}if(i===namelist.length-1){namelist[i]=namelist[i]+terminator;}}}return namelist.join("").replace(/[\u0009\u000a\u000b\u000c\u000d\u0020\ufeff\u00a0]+$/,"").replace(/\s*\-\s*/g,"-").replace(/[\u0009\u000a\u000b\u000c\u000d\u0020]+/g," ");};CSL.Util.Names.doInitialize=function(state,namelist,terminator,mode){var i,ilen,m,j,jlen,lst,n;for(i=0,ilen=namelist.length;i<ilen;i+=2){n=namelist[i];if(!n){continue;}m=n.match(CSL.NAME_INITIAL_REGEXP);if(!m&&!n.match(CSL.STARTSWITH_ROMANESQUE_REGEXP)&&n.length>1&&terminator.match("%s")){m=n.match(/(.)(.*)/);}if(m&&m[1]===m[1].toUpperCase()){var extra="";if(m[2]){var s="";lst=m[2].split("");for(j=0,jlen=lst.length;j<jlen;j+=1){var c=lst[j];if(c===c.toUpperCase()){s+=c;}else{break;}}if(s.length<m[2].length){extra=s.toLocaleLowerCase();}}namelist[i]=m[1].toLocaleUpperCase()+extra;if(i<ilen-1){if(terminator.match("%s")){namelist[i]=terminator.replace("%s",namelist[i]);}else{if(namelist[i+1].indexOf("-")>-1){namelist[i+1]=terminator+namelist[i+1];}else{namelist[i+1]=terminator;}}}else{if(terminator.match("%s")){namelist[i]=terminator.replace("%s",namelist[i]);}else{namelist.push(terminator);}}}else if(n.match(CSL.ROMANESQUE_REGEXP)){namelist[i]=" "+n;}}var ret=namelist.join("");ret=ret.replace(/[\u0009\u000a\u000b\u000c\u000d\u0020\ufeff\u00a0]+$/,"").replace(/\s*\-\s*/g,"-").replace(/[\u0009\u000a\u000b\u000c\u000d\u0020]+/g," ");return ret;};CSL.Util.Names.getRawName=function(name){var ret=[];if(name.given){ret.push(name.given);}if(name.family){ret.push(name.family);}return ret.join(" ");};module.exports=CSL;CSL.Util.Dates={};CSL.Util.Dates.year={};CSL.Util.Dates.year["long"]=function(state,num){if(!num){if("boolean"===typeof num){num="";}else{num=0;}}return num.toString();};CSL.Util.Dates.year.imperial=function(state,num,end,makeShort){var year="";if(!num){if("boolean"===typeof num){num="";}else{num=0;}}end=end?"_end":"";var month=state.tmp.date_object["month"+end];month=month?""+month:"1";while(month.length<2){month="0"+month;}var day=state.tmp.date_object["day"+end];day=day?""+day:"1";while(day.length<2){day="0"+day;}var date=parseInt(num+month+day,10);var label;var offset;if(date>=18680908&&date<19120730){label="\u660E\u6CBB";offset=1867;}else if(date>=19120730&&date<19261225){label="\u5927\u6B63";offset=1911;}else if(date>=19261225&&date<19890108){label="\u662D\u548C";offset=1925;}else if(date>=19890108){label="\u5E73\u6210";offset=1988;}if(label&&offset){var normalizedKey=label;if(state.sys.normalizeAbbrevsKey){normalizedKey=state.sys.normalizeAbbrevsKey("number",label);}if(!state.transform.abbrevs['default']['number'][normalizedKey]){state.transform.loadAbbreviation('default',"number",normalizedKey);}if(state.transform.abbrevs['default']['number'][normalizedKey]){label=state.transform.abbrevs['default']['number'][normalizedKey];};year=label+(num-offset);}return year;};CSL.Util.Dates.year["short"]=function(state,num){num=num.toString();if(num&&num.length===4){return num.substr(2);}};CSL.Util.Dates.year.numeric=function(state,num){var m,pre;num=""+num;var m=num.match(/([0-9]*)$/);if(m){pre=num.slice(0,m[1].length*-1);num=m[1];}else{pre=num;num="";}while(num.length<4){num="0"+num;}return pre+num;};CSL.Util.Dates.normalizeMonth=function(num,useSeason){var ret;if(!num){num=0;}num=""+num;if(!num.match(/^[0-9]+$/)){num=0;}num=parseInt(num,10);if(useSeason){var res={stub:"month-",num:num};if(res.num<1||res.num>20){res.num=0;}else if(res.num>16){res.stub="season-";res.num=res.num-16;}else if(res.num>12){res.stub="season-";res.num=res.num-12;}ret=res;}else{if(num<1||num>12){num=0;}ret=num;}return ret;};CSL.Util.Dates.month={};CSL.Util.Dates.month.numeric=function(state,num){var num=CSL.Util.Dates.normalizeMonth(num);if(!num){num="";}return num;};CSL.Util.Dates.month["numeric-leading-zeros"]=function(state,num){var num=CSL.Util.Dates.normalizeMonth(num);if(!num){num="";}else{num=""+num;while(num.length<2){num="0"+num;}}return num;};CSL.Util.Dates.month["long"]=function(state,num,gender,forceDefaultLocale){var res=CSL.Util.Dates.normalizeMonth(num,true);var num=res.num;if(!num){num="";}else{num=""+num;while(num.length<2){num="0"+num;}num=state.getTerm(res.stub+num,"long",0,0,false,forceDefaultLocale);}return num;};CSL.Util.Dates.month["short"]=function(state,num,gender,forceDefaultLocale){var res=CSL.Util.Dates.normalizeMonth(num,true);var num=res.num;if(!num){num="";}else{num=""+num;while(num.length<2){num="0"+num;}num=state.getTerm(res.stub+num,"short",0,0,false,forceDefaultLocale);}return num;};CSL.Util.Dates.day={};CSL.Util.Dates.day.numeric=function(state,num){return num.toString();};CSL.Util.Dates.day["long"]=CSL.Util.Dates.day.numeric;CSL.Util.Dates.day["numeric-leading-zeros"]=function(state,num){if(!num){num=0;}num=num.toString();while(num.length<2){num="0"+num;}return num.toString();};CSL.Util.Dates.day.ordinal=function(state,num,gender){return state.fun.ordinalizer.format(num,gender);};module.exports=CSL;CSL.Util.Sort={};CSL.Util.Sort.strip_prepositions=function(str){var m;if("string"===typeof str){m=str.toLocaleLowerCase();m=str.match(/^((a|an|the)\s+)/);}if(m){str=str.substr(m[1].length);}return str;};module.exports=CSL;CSL.Util.substituteStart=function(state,target){var element_trace,display,bib_first,func,choose_start,if_start,nodetypes;func=function func(state,Item){for(var i=0,ilen=this.decorations.length;i<ilen;i+=1){if("@strip-periods"===this.decorations[i][0]&&"true"===this.decorations[i][1]){state.tmp.strip_periods+=1;break;}}};this.execs.push(func);if(this.decorations&&(state.opt.development_extensions.csl_reverse_lookup_support||state.sys.csl_reverse_lookup_support)){this.decorations.reverse();this.decorations.push(["@showid","true",this.cslid]);this.decorations.reverse();}nodetypes=["number","date","names"];if("text"===this.name&&!this.postponed_macro||nodetypes.indexOf(this.name)>-1){element_trace=function element_trace(state,Item,item){if(state.tmp.element_trace.value()==="author"||"names"===this.name){if(item&&item["author-only"]){state.tmp.element_trace.push("do-not-suppress-me");}else if(item&&item["suppress-author"]){}}else{if(item&&item["author-only"]){state.tmp.element_trace.push("suppress-me");}else if(item&&item["suppress-author"]){state.tmp.element_trace.push("do-not-suppress-me");}}};this.execs.push(element_trace);}display=this.strings.cls;this.strings.cls=false;if(state.build.render_nesting_level===0){if(state.build.area==="bibliography"&&state.bibliography.opt["second-field-align"]){bib_first=new CSL.Token("group",CSL.START);bib_first.decorations=[["@display","left-margin"]];func=function func(state,Item){if(!state.tmp.render_seen){bib_first.strings.first_blob=Item.id;state.output.startTag("bib_first",bib_first);}};bib_first.execs.push(func);target.push(bib_first);}else if(CSL.DISPLAY_CLASSES.indexOf(display)>-1){bib_first=new CSL.Token("group",CSL.START);bib_first.decorations=[["@display",display]];func=function func(state,Item){bib_first.strings.first_blob=Item.id;state.output.startTag("bib_first",bib_first);};bib_first.execs.push(func);target.push(bib_first);}state.build.cls=display;}state.build.render_nesting_level+=1;if(state.build.substitute_level.value()===1){choose_start=new CSL.Token("choose",CSL.START);CSL.Node.choose.build.call(choose_start,state,target);if_start=new CSL.Token("if",CSL.START);func=function func(Item,item){if(state.tmp.can_substitute.value()){return true;}return false;};if_start.tests.push(func);if_start.test=state.fun.match.any(this,state,if_start.tests);target.push(if_start);}if(state.sys.variableWrapper&&this.variables_real&&this.variables_real.length){func=function func(state,Item,item){if(!state.tmp.just_looking&&!state.tmp.suppress_decorations){var variable_entry=new CSL.Token("text",CSL.START);variable_entry.decorations=[["@showid","true"]];state.output.startTag("variable_entry",variable_entry);var position=null;if(item){position=item.position;}if(!position)position=0;var positionMap=["first","subsequent","ibid","ibid-with-locator"];var noteNumber=0;if(item&&item.noteIndex){noteNumber=item.noteIndex;}var firstReferenceNoteNumber=0;if(item&&item['first-reference-note-number']){firstReferenceNoteNumber=item['first-reference-note-number'];}var citationNumber=0;if(item&&item['citation-number']){citationNumber=item['citation-number'];}var index=0;if(item&&item.index){index=item.index;}var params={itemData:Item,variableNames:this.variables,context:state.tmp.area,xclass:state.opt.xclass,position:positionMap[position],"note-number":noteNumber,"first-reference-note-number":firstReferenceNoteNumber,"citation-number":citationNumber,"index":index,"mode":state.opt.mode};state.output.current.value().params=params;}};this.execs.push(func);}};CSL.Util.substituteEnd=function(state,target){var func,bib_first_end,bib_other,if_end,choose_end,toplevel,hasval,author_substitute,str;if(state.sys.variableWrapper&&(this.hasVariable||this.variables_real&&this.variables_real.length)){func=function func(state,Item){if(!state.tmp.just_looking&&!state.tmp.suppress_decorations){state.output.endTag("variable_entry");}};this.execs.push(func);}func=function func(state,Item){for(var i=0,ilen=this.decorations.length;i<ilen;i+=1){if("@strip-periods"===this.decorations[i][0]&&"true"===this.decorations[i][1]){state.tmp.strip_periods+=-1;break;}}};this.execs.push(func);state.build.render_nesting_level+=-1;if(state.build.render_nesting_level===0){if(state.build.cls){func=function func(state,Item){state.output.endTag("bib_first");};this.execs.push(func);state.build.cls=false;}else if(state.build.area==="bibliography"&&state.bibliography.opt["second-field-align"]){bib_first_end=new CSL.Token("group",CSL.END);func=function func(state,Item){if(!state.tmp.render_seen){state.output.endTag("bib_first");}};bib_first_end.execs.push(func);target.push(bib_first_end);bib_other=new CSL.Token("group",CSL.START);bib_other.decorations=[["@display","right-inline"]];func=function func(state,Item){if(!state.tmp.render_seen){state.tmp.render_seen=true;state.output.startTag("bib_other",bib_other);}};bib_other.execs.push(func);target.push(bib_other);}}if(state.build.substitute_level.value()===1){if_end=new CSL.Token("if",CSL.END);target.push(if_end);choose_end=new CSL.Token("choose",CSL.END);CSL.Node.choose.build.call(choose_end,state,target);}if("names"===this.name||"text"===this.name&&this.variables_real!=="title"){author_substitute=new CSL.Token("text",CSL.SINGLETON);func=function func(state,Item){if(state.tmp.area!=="bibliography")return;if("string"!==typeof state.bibliography.opt["subsequent-author-substitute"])return;if(this.variables_real&&!Item[this.variables_real])return;if(state.tmp.substituted_variable!==this.variables_real){return;}var subrule=state.bibliography.opt["subsequent-author-substitute-rule"];var i,ilen;var printing=!state.tmp.suppress_decorations;if(printing&&state.tmp.subsequent_author_substitute_ok){if(state.tmp.rendered_name){if("partial-each"===subrule||"partial-first"===subrule){var dosub=true;var rendered_name=[];for(i=0,ilen=state.tmp.name_node.children.length;i<ilen;i+=1){var name=state.tmp.rendered_name[i];if(dosub&&state.tmp.last_rendered_name&&state.tmp.last_rendered_name.length>i-1&&name&&!name.localeCompare(state.tmp.last_rendered_name[i])){str=new CSL.Blob(state[state.tmp.area].opt["subsequent-author-substitute"]);state.tmp.name_node.children[i].blobs=[str];if("partial-first"===subrule){dosub=false;}}else{dosub=false;}rendered_name.push(name);}state.tmp.last_rendered_name=rendered_name;}else if("complete-each"===subrule){var rendered_name=state.tmp.rendered_name.join(",");if(rendered_name){if(state.tmp.last_rendered_name&&!rendered_name.localeCompare(state.tmp.last_rendered_name)){for(i=0,ilen=state.tmp.name_node.children.length;i<ilen;i+=1){str=new CSL.Blob(state[state.tmp.area].opt["subsequent-author-substitute"]);state.tmp.name_node.children[i].blobs=[str];}}state.tmp.last_rendered_name=rendered_name;}}else{var rendered_name=state.tmp.rendered_name.join(",");if(rendered_name){if(state.tmp.last_rendered_name&&!rendered_name.localeCompare(state.tmp.last_rendered_name)){str=new CSL.Blob(state[state.tmp.area].opt["subsequent-author-substitute"]);if(state.tmp.label_blob){state.tmp.name_node.top.blobs=[str,state.tmp.label_blob];}else if(state.tmp.name_node.top.blobs.length){state.tmp.name_node.top.blobs[0].blobs=[str];}else{state.tmp.name_node.top.blobs=[str];}state.tmp.substituted_variable=this.variables_real;}state.tmp.last_rendered_name=rendered_name;}}state.tmp.subsequent_author_substitute_ok=false;}}};this.execs.push(func);}if("text"===this.name&&!this.postponed_macro||["number","date","names"].indexOf(this.name)>-1){func=function func(state,Item){state.tmp.element_trace.pop();};this.execs.push(func);}};module.exports=CSL;CSL.Util.padding=function(num){var m=num.match(/\s*(-{0,1}[0-9]+)/);if(m){num=parseInt(m[1],10);if(num<0){num=99999999999999999999+num;}num=""+num;while(num.length<20){num="0"+num;}}return num;};CSL.Util.LongOrdinalizer=function(){};CSL.Util.LongOrdinalizer.prototype.init=function(state){this.state=state;};CSL.Util.LongOrdinalizer.prototype.format=function(num,gender){if(num<10){num="0"+num;}var ret=CSL.Engine.getField(CSL.LOOSE,this.state.locale[this.state.opt.lang].terms,"long-ordinal-"+num,"long",0,gender);if(!ret){ret=this.state.fun.ordinalizer.format(num,gender);}this.state.tmp.cite_renders_content=true;return ret;};CSL.Util.Ordinalizer=function(state){this.state=state;this.suffixes={};};CSL.Util.Ordinalizer.prototype.init=function(){if(!this.suffixes[this.state.opt.lang]){this.suffixes[this.state.opt.lang]={};for(var i=0,ilen=3;i<ilen;i+=1){var gender=[undefined,"masculine","feminine"][i];this.suffixes[this.state.opt.lang][gender]=[];for(var j=1;j<5;j+=1){var ordinal=this.state.getTerm("ordinal-0"+j,"long",false,gender);if("undefined"===typeof ordinal){delete this.suffixes[this.state.opt.lang][gender];break;}this.suffixes[this.state.opt.lang][gender].push(ordinal);}}}};CSL.Util.Ordinalizer.prototype.format=function(num,gender){var str;num=parseInt(num,10);str=""+num;var suffix="";var trygenders=[];if(gender){trygenders.push(gender);}trygenders.push("neuter");if(this.state.locale[this.state.opt.lang].ord["1.0.1"]){suffix=this.state.getTerm("ordinal",false,0,gender);var trygender;for(var i=0,ilen=trygenders.length;i<ilen;i+=1){trygender=trygenders[i];var ordinfo=this.state.locale[this.state.opt.lang].ord["1.0.1"];if(ordinfo["whole-number"][str]&&ordinfo["whole-number"][str][trygender]){suffix=this.state.getTerm(this.state.locale[this.state.opt.lang].ord["1.0.1"]["whole-number"][str][trygender],false,0,gender);}else if(ordinfo["last-two-digits"][str.slice(str.length-2)]&&ordinfo["last-two-digits"][str.slice(str.length-2)][trygender]){suffix=this.state.getTerm(this.state.locale[this.state.opt.lang].ord["1.0.1"]["last-two-digits"][str.slice(str.length-2)][trygender],false,0,gender);}else if(ordinfo["last-digit"][str.slice(str.length-1)]&&ordinfo["last-digit"][str.slice(str.length-1)][trygender]){suffix=this.state.getTerm(this.state.locale[this.state.opt.lang].ord["1.0.1"]["last-digit"][str.slice(str.length-1)][trygender],false,0,gender);}if(suffix){break;}}}else{if(!gender){gender=undefined;}this.state.fun.ordinalizer.init();if(num/10%10===1||num>10&&num<20){suffix=this.suffixes[this.state.opt.lang][gender][3];}else if(num%10===1&&num%100!==11){suffix=this.suffixes[this.state.opt.lang][gender][0];}else if(num%10===2&&num%100!==12){suffix=this.suffixes[this.state.opt.lang][gender][1];}else if(num%10===3&&num%100!==13){suffix=this.suffixes[this.state.opt.lang][gender][2];}else{suffix=this.suffixes[this.state.opt.lang][gender][3];}}str=str+=suffix;return str;};CSL.Util.Romanizer=function(){};CSL.Util.Romanizer.prototype.format=function(num){var ret,pos,n,numstr,len;ret="";if(num<6000){numstr=num.toString().split("");numstr.reverse();pos=0;n=0;len=numstr.length;for(pos=0;pos<len;pos+=1){n=parseInt(numstr[pos],10);ret=CSL.ROMAN_NUMERALS[pos][n]+ret;}}return ret;};CSL.Util.Suffixator=function(slist){if(!slist){slist=CSL.SUFFIX_CHARS;}this.slist=slist.split(",");};CSL.Util.Suffixator.prototype.format=function(N){var X;N+=1;var key="";do{X=N%26===0?26:N%26;var key=this.slist[X-1]+key;N=(N-X)/26;}while(N!==0);return key;};CSL.Engine.prototype.processNumber=function(node,ItemObject,variable,type){var val,m,i,ilen,j,jlen;var debug=false;var me=this;function normalizeFieldValue(str,defaultLabel){str=str.trim();var m=str.match(/^([^ ]+)/);if(m&&!CSL.STATUTE_SUBDIV_STRINGS[m[1]]){var embeddedLabel=null;if(variable==="locator"){if(ItemObject.label){embeddedLabel=CSL.STATUTE_SUBDIV_STRINGS_REVERSE[ItemObject.label];}else{embeddedLabel="p.";}}else{embeddedLabel=CSL.STATUTE_SUBDIV_STRINGS_REVERSE[variable];}if(embeddedLabel){str=embeddedLabel+" "+str;}}return str;}function composeNumberInfo(origLabel,label,val,joiningSuffix){joiningSuffix=joiningSuffix?joiningSuffix:"";var info={};if(!label&&!CSL.STATUTE_SUBDIV_STRINGS_REVERSE[variable]){label="var:"+variable;}if(label){var m=label.match(/(\s*)([^\s]+)(\s*)/);info.label=m[2];info.origLabel=origLabel;info.labelSuffix=m[3]?m[3]:"";info.plural=0;info.labelVisibility=false;}var m=val.match(/^([0-9]*[a-zA-Z]+0*)?([0-9]+(?:[a-zA-Z]*|[-,a-zA-Z]+))$/);if(m){info.particle=m[1]?m[1]:"";info.value=m[2];}else{info.particle="";info.value=val;}info.joiningSuffix=joiningSuffix.replace(/\s*-\s*/,"-");return info;};function fixupSubsections(elems){for(var i=elems.length-2;i>-1;i-=2){if(elems[i]==="-"&&elems[i-1].match(/^(?:(?:[a-z]|[a-z][a-z]|[a-z][a-z][a-z]|[a-z][a-z][a-z][a-z])\. *)*[0-9]+[,a-zA-Z]+$/)&&elems[i+1].match(/^[,a-zA-Z]+$/)){elems[i-1]=elems.slice(i-1,i+2).join("");elems=elems.slice(0,i).concat(elems.slice(i+2));}}return elems;}function parseString(str,defaultLabel){defaultLabel=defaultLabel?defaultLabel:"";str=normalizeFieldValue(str,defaultLabel);var elems=[];var m=str.match(/(;\s+|,\s+|\s*\\*[\-\u2013]+\s*|\s*&\s*)/g);if(m){var lst=str.split(/(?:;\s+|,\s+|\s*\\*[\-\u2013]+\s*|\s*&\s*)/);for(var i=0,ilen=lst.length-1;i<ilen;i++){elems.push(lst[i]);elems.push(m[i]);}elems.push(lst[lst.length-1]);elems=fixupSubsections(elems);}else{var elems=[str];}var values=[];var label=defaultLabel;var origLabel="";for(var i=0,ilen=elems.length;i<ilen;i+=2){var m=elems[i].match(/((?:^| )(?:[a-z]|[a-z][a-z]|[a-z][a-z][a-z]|[a-z][a-z][a-z][a-z])(?:\.| ) *)/g);if(m){var lst=elems[i].split(/(?:(?:^| )(?:[a-z]|[a-z][a-z]|[a-z][a-z][a-z]|[a-z][a-z][a-z][a-z])(?:\.| ) *)/);for(var j=lst.length-1;j>0;j--){if(lst[j-1]&&(!lst[j].match(/^[0-9]+([-;,:a-zA-Z]*)$/)||!lst[j-1].match(/^[0-9]+([-;,:a-zA-Z]*)$/))){lst[j-1]=lst[j-1]+m[j-1]+lst[j];lst=lst.slice(0,j).concat(lst.slice(j+1));m=m.slice(0,j-1).concat(m.slice(j));}}if(m.length>0){var slug=m[0].trim();var notAlabel=!CSL.STATUTE_SUBDIV_STRINGS[slug]||!me.getTerm(CSL.STATUTE_SUBDIV_STRINGS[slug])||["locator","number"].indexOf(variable)===-1&&CSL.STATUTE_SUBDIV_STRINGS[slug]!==variable;if(notAlabel){if(i===0){m=m.slice(1);lst[0]=lst[0]+" "+slug+" "+lst[1];lst=lst.slice(0,1).concat(lst.slice(2));}}else{origLabel=slug;}}for(var j=0,jlen=lst.length;j<jlen;j++){if(lst[j]||j===lst.length-1){var filteredOrigLabel;label=m[j-1]?m[j-1]:label;if(origLabel===label.trim()){filteredOrigLabel="";}else{filteredOrigLabel=origLabel;}str=lst[j]?lst[j].trim():"";if(j===lst.length-1){values.push(composeNumberInfo(filteredOrigLabel,label,str,elems[i+1]));}else{values.push(composeNumberInfo(filteredOrigLabel,label,str));}}}}else{var filteredOrigLabel;if(origLabel===label.trim()){filteredOrigLabel="";}else{filteredOrigLabel=origLabel;}values.push(composeNumberInfo(filteredOrigLabel,label,elems[i],elems[i+1]));}}return values;}function setSpaces(values){for(var i=0,ilen=values.length-1;i<ilen;i++){if(!values[i].joiningSuffix&&values[i+1].label){values[i].joiningSuffix=" ";}}}function fixNumericAndCount(values,i,currentLabelInfo){var master=values[currentLabelInfo.pos];var val=values[i].value;var isEscapedHyphen=master.joiningSuffix==="\\-";if(val.particle&&val.particle!==master.particle){currentLabelInfo.collapsible=false;}var mVal=val.match(/^[0-9]+([-,:a-zA-Z]*)$/);var mCurrentLabel=master.value.match(/^[0-9]+([-,:a-zA-Z]*)$/);if(!val||!mVal||!mCurrentLabel||isEscapedHyphen){currentLabelInfo.collapsible=false;if(!val||!mCurrentLabel){currentLabelInfo.numeric=false;}if(isEscapedHyphen){currentLabelInfo.count--;}}if(mVal&&mVal[1]||mCurrentLabel&&mCurrentLabel[1]){currentLabelInfo.collapsible=false;}if(undefined===values[i].collapsible){for(var j=i,jlen=i+currentLabelInfo.count;j<jlen;j++){if(isNaN(parseInt(values[j].value))&&!values[j].value.match(/^[ivxlcmIVXLCM]+$/)){values[j].collapsible=false;}else{values[j].collapsible=true;}}currentLabelInfo.collapsible=values[i].collapsible;}var isCollapsible=currentLabelInfo.collapsible;for(var j=currentLabelInfo.pos,jlen=currentLabelInfo.pos+currentLabelInfo.count;j<jlen;j++){if(currentLabelInfo.count>1&&isCollapsible){values[j].plural=1;}values[j].numeric=currentLabelInfo.numeric;values[j].collapsible=currentLabelInfo.collapsible;}}function fixLabelVisibility(values,groupStartPos,currentLabelInfo){if(currentLabelInfo.label.slice(0,4)!=="var:"){if(currentLabelInfo.pos===0){if(variable==="locator"||variable==="number"){if(!me.getTerm(CSL.STATUTE_SUBDIV_STRINGS[currentLabelInfo.label])){values[currentLabelInfo.pos].labelVisibility=true;}}if(["locator","number"].indexOf(variable)===-1){if(CSL.STATUTE_SUBDIV_STRINGS[currentLabelInfo.label]!==variable){values[0].labelVisibility=true;}}}else{values[currentLabelInfo.pos].labelVisibility=true;}}}function setPluralsAndNumerics(values){if(values.length===0)return;var groupStartPos=0;var groupCount=1;for(var i=1,ilen=values.length;i<ilen;i++){var lastVal=values[i-1];var thisVal=values[i];if(lastVal.label===thisVal.label&&lastVal.particle===lastVal.particle){groupCount++;}else{var currentLabelInfo=JSON.parse(JSON.stringify(values[groupStartPos]));currentLabelInfo.pos=groupStartPos;currentLabelInfo.count=groupCount;currentLabelInfo.numeric=true;fixNumericAndCount(values,groupStartPos,currentLabelInfo);if(i===0||lastVal.label!==thisVal.label){fixLabelVisibility(values,groupStartPos,currentLabelInfo);}groupStartPos=i;groupCount=1;}}var currentLabelInfo=JSON.parse(JSON.stringify(values[groupStartPos]));currentLabelInfo.pos=groupStartPos;currentLabelInfo.count=groupCount;currentLabelInfo.numeric=true;fixNumericAndCount(values,groupStartPos,currentLabelInfo);fixLabelVisibility(values,groupStartPos,currentLabelInfo);if(values.length&&values[0].numeric&&variable.slice(0,10)==="number-of-"){if(parseInt(ItemObject[variable],10)>1){values[0].plural=1;}}}function setStyling(values){var masterNode=CSL.Util.cloneToken(node);var masterStyling=new CSL.Token();if(!me.tmp.just_looking){for(var j=masterNode.decorations.length-1;j>-1;j--){if(masterNode.decorations[j][0]==="@quotes"){masterStyling.decorations=masterStyling.decorations.concat(masterNode.decorations.slice(j,j+1));masterNode.decorations=masterNode.decorations.slice(0,j).concat(masterNode.decorations.slice(j+1));}}masterStyling.strings.prefix=masterNode.strings.prefix;masterNode.strings.prefix="";masterStyling.strings.suffix=masterNode.strings.suffix;masterNode.strings.suffix="";}var masterLabel=values.length?values[0].label:null;if(values.length){for(var i=0,ilen=values.length;i<ilen;i++){var val=values[i];var newnode=CSL.Util.cloneToken(masterNode);newnode.gender=node.gender;if(masterLabel===val.label){newnode.formatter=node.formatter;}if(val.numeric){newnode.successor_prefix=val.successor_prefix;}newnode.strings.suffix=newnode.strings.suffix+stripHyphenBackslash(val.joiningSuffix);val.styling=newnode;}if(!me.tmp.just_looking){if(values[0].value.slice(0,1)==="\""&&values[values.length-1].value.slice(-1)==="\""){values[0].value=values[0].value.slice(1);values[values.length-1].value=values[values.length-1].value.slice(0,-1);masterStyling.decorations.push(["@quotes",true]);}}}return masterStyling;}function stripHyphenBackslash(joiningSuffix){return joiningSuffix.replace("\\-","-");}function fixupRangeDelimiter(variable,val,rangeDelimiter,isNumeric){var isPage=checkPage(variable,val);var hasTerm=checkTerm(variable,val);if(hasTerm&&rangeDelimiter==="-"){if(isNumeric){if(isPage||["locator","issue","volume","edition","number"].indexOf(variable)>-1){rangeDelimiter=me.getTerm("page-range-delimiter");if(!rangeDelimiter){rangeDelimiter="\u2013";}}if(variable==="collection-number"){rangeDelimiter=me.getTerm("year-range-delimiter");if(!rangeDelimiter){rangeDelimiter="\u2013";}}}}return rangeDelimiter;}function checkPage(variable,val){return variable==="page"||variable==="locator"&&(["p."].indexOf(val.label)>-1||["p."].indexOf(val.origLabel)>-1);}function checkTerm(variable,val){var ret=true;if(variable==="locator"){var label;if(val.origLabel){label=val.origLabel;}else{label=val.label;}ret=!!me.getTerm(CSL.STATUTE_SUBDIV_STRINGS[label]);}return ret;}function manglePageNumbers(values,i,currentInfo){if(i<1)return;if(currentInfo.count!==2){return;}if(values[i-1].particle!==values[i].particle){return;}if(values[i-1].joiningSuffix!=="-"){currentInfo.count=1;return;}if(!me.opt["page-range-format"]&&parseInt(values[i-1].value,10)>parseInt(values[i].value,10)){values[i-1].joiningSuffix=fixupRangeDelimiter(variable,values[i],values[i-1].joiningSuffix,true);return;}var val=values[i];var isPage=checkPage(variable,val);var str;if(isPage&&!isNaN(parseInt(values[i-1].value))&&!isNaN(parseInt(values[i].value))){str=values[i-1].particle+values[i-1].value+" - "+values[i].particle+values[i].value;str=me.fun.page_mangler(str);}else{if((""+values[i-1].value).match(/^([0-9]+|[ivxlcmIVXLCM]+)$/)&&(""+values[i].value).match(/^([0-9]+|[ivxlcmIVXLCM]+)$/)){values[i-1].joiningSuffix=me.getTerm("page-range-delimiter");}str=values[i-1].value+stripHyphenBackslash(values[i-1].joiningSuffix)+values[i].value;}var m=str.match(/^((?:[0-9]*[a-zA-Z]+0*))?([0-9]+)(\s*[^0-9]+\s*)([-,a-zA-Z]?0*)([0-9]+)$/);if(m){var rangeDelimiter=m[3];rangeDelimiter=fixupRangeDelimiter(variable,val,rangeDelimiter,values[i].numeric);values[i-1].particle=m[1];values[i-1].value=m[2];values[i-1].joiningSuffix=rangeDelimiter;values[i].particle=m[4];values[i].value=m[5];}currentInfo.count=0;}function fixRanges(values){if(!node)return;if(["page","page-first","chapter-number","collection-number","edition","issue","number","number-of-pages","number-of-volumes","volume","locator"].indexOf(variable)===-1)return;var currentInfo={count:0,label:null,lastHadRangeDelimiter:false};for(var i=0,ilen=values.length;i<ilen;i++){var val=values[i];if(!val.collapsible){currentInfo.count=0;currentInfo.label=null;var isNumeric=val.numeric;val.joiningSuffix=fixupRangeDelimiter(variable,val,val.joiningSuffix,isNumeric);}else if(currentInfo.label===val.label&&val.joiningSuffix==="-"){currentInfo.count=1;}else if(currentInfo.label===val.label&&val.joiningSuffix!=="-"){currentInfo.count++;if(currentInfo.count===2){manglePageNumbers(values,i,currentInfo);}}else if(currentInfo.label!==val.label){currentInfo.label=val.label;currentInfo.count=1;}else{currentInfo.count=1;currentInfo.label=val.label;}}if(currentInfo.count===2){manglePageNumbers(values,values.length-1,currentInfo);}}function setVariableParams(shadow_numbers,variable,values){var obj=shadow_numbers[variable];if(values.length){obj.numeric=values[0].numeric;obj.collapsible=values[0].collapsible;obj.plural=values[0].plural;obj.label=CSL.STATUTE_SUBDIV_STRINGS[values[0].label];if(variable==="number"&&obj.label==="issue"&&me.getTerm("number")){obj.label="number";}}}if(node&&this.tmp.shadow_numbers[variable]&&this.tmp.shadow_numbers[variable].values.length){var values=this.tmp.shadow_numbers[variable].values;fixRanges(values);this.tmp.shadow_numbers[variable].masterStyling=setStyling(values);return;}if(!this.tmp.shadow_numbers[variable]){this.tmp.shadow_numbers[variable]={values:[]};}if(!ItemObject){return;}var languageRole=CSL.LangPrefsMap[variable];if(languageRole){var localeType=this.opt["cite-lang-prefs"][languageRole][0];val=this.transform.getTextSubField(ItemObject,variable,"locale-"+localeType,true);val=val.name;}else{val=ItemObject[variable];}if(val&&this.sys.getAbbreviation){var jurisdiction=this.transform.loadAbbreviation(ItemObject.jurisdiction,"number",val);if(this.transform.abbrevs[jurisdiction].number){if(this.transform.abbrevs[jurisdiction].number[val]){val=this.transform.abbrevs[jurisdiction].number[val];}else{if("undefined"!==typeof this.transform.abbrevs[jurisdiction].number[val]){delete this.transform.abbrevs[jurisdiction].number[val];}}}}if("undefined"!==typeof val&&("string"===typeof val||"number"===typeof val)){if("number"===typeof val){val=""+val;}var defaultLabel=CSL.STATUTE_SUBDIV_STRINGS_REVERSE[variable];if(!this.tmp.shadow_numbers.values){var values=parseString(val,defaultLabel);setSpaces(values);setPluralsAndNumerics(values);this.tmp.shadow_numbers[variable].values=values;}if(node){fixRanges(values);this.tmp.shadow_numbers[variable].masterStyling=setStyling(values);}setVariableParams(this.tmp.shadow_numbers,variable,values);}};CSL.Util.outputNumericField=function(state,varname,itemID){state.output.openLevel(state.tmp.shadow_numbers[varname].masterStyling);var nums=state.tmp.shadow_numbers[varname].values;var masterLabel=nums.length?nums[0].label:null;var labelForm=state.tmp.shadow_numbers[varname].labelForm;var embeddedLabelForm;if(labelForm){embeddedLabelForm=labelForm;}else{embeddedLabelForm="short";}var labelCapitalizeIfFirst=state.tmp.shadow_numbers[varname].labelCapitalizeIfFirst;var labelDecorations=state.tmp.shadow_numbers[varname].labelDecorations;var lastLabelName=null;for(var i=0,ilen=nums.length;i<ilen;i++){var num=nums[i];var label="";var labelName;if(num.label){if('var:'===num.label.slice(0,4)){labelName=num.label.slice(4);}else{labelName=CSL.STATUTE_SUBDIV_STRINGS[num.label];}if(labelName){if(num.label===masterLabel){label=state.getTerm(labelName,labelForm,num.plural);}else{label=state.getTerm(labelName,embeddedLabelForm,num.plural);}if(labelCapitalizeIfFirst){label=CSL.Output.Formatters["capitalize-first"](state,label);}}}var labelPlaceholderPos=-1;if(label){labelPlaceholderPos=label.indexOf("%s");}var numStyling=CSL.Util.cloneToken(num.styling);numStyling.formatter=num.styling.formatter;numStyling.type=num.styling.type;numStyling.num=num.styling.num;numStyling.gender=num.styling.gender;if(labelPlaceholderPos>0&&labelPlaceholderPos<label.length-2){numStyling.strings.prefix+=label.slice(0,labelPlaceholderPos);numStyling.strings.suffix=label.slice(labelPlaceholderPos+2)+numStyling.strings.suffix;}else if(num.labelVisibility){if(!label){label=num.label;labelName=num.label;}if(labelPlaceholderPos>0){var prefixLabelStyling=new CSL.Token();prefixLabelStyling.decorations=labelDecorations;state.output.append(label.slice(0,labelPlaceholderPos),prefixLabelStyling);}else if(labelPlaceholderPos===label.length-2||labelPlaceholderPos===-1){state.output.append(label+num.labelSuffix,"empty");}}if(num.collapsible){var blob;if(num.value.match(/^[1-9][0-9]*$/)){blob=new CSL.NumericBlob(num.particle,parseInt(num.value,10),numStyling,itemID);}else{blob=new CSL.NumericBlob(num.particle,num.value,numStyling,itemID);}if("undefined"===typeof blob.gender){blob.gender=state.locale[state.opt.lang]["noun-genders"][varname];}state.output.append(blob,"literal");}else{state.output.append(num.particle+num.value,numStyling);}if(labelPlaceholderPos===0&&labelPlaceholderPos<label.length-2){if(lastLabelName===null){lastLabelName=labelName;}if(labelName!==lastLabelName||i===nums.length-1){var suffixLabelStyling=new CSL.Token();suffixLabelStyling.decorations=labelDecorations;state.output.append(label.slice(labelPlaceholderPos+2),suffixLabelStyling);}}lastLabelName=labelName;state.tmp.term_predecessor=true;}state.output.closeLevel();};module.exports=CSL;CSL.Util.PageRangeMangler={};CSL.Util.PageRangeMangler.getFunction=function(state,rangeType){var rangerex,pos,len,stringify,listify,expand,minimize,minimize_internal,chicago,lst,m,b,e,ret,begin,end,ret_func,ppos,llen;var range_delimiter=state.getTerm(rangeType+"-range-delimiter");rangerex=/([0-9]*[a-zA-Z]+0*)?([0-9]+)\s*(?:\u2013|-)\s*([0-9]*[a-zA-Z]+0*)?([0-9]+)/;stringify=function stringify(lst){len=lst.length;for(pos=1;pos<len;pos+=2){if("object"===_typeof(lst[pos])){lst[pos]=lst[pos].join("");}}var ret=lst.join("");ret=ret.replace(/([^\\])\-/g,"$1"+state.getTerm(rangeType+"-range-delimiter"));return ret;};listify=function listify(str){var m,lst,ret;var hyphens="\\s+\\-\\s+";var this_range_delimiter=range_delimiter==="-"?"":range_delimiter;var delimRex=new RegExp("([^\\\\])[-"+this_range_delimiter+"\\u2013]","g");str=str.replace(delimRex,"$1 - ").replace(/\s+-\s+/g," - ");var rexm=new RegExp("((?:[0-9]*[a-zA-Z]+0*)?[0-9]+"+hyphens+"(?:[0-9]*[a-zA-Z]+0*)?[0-9]+)","g");var rexlst=new RegExp("(?:[0-9]*[a-zA-Z]+0*)?[0-9]+"+hyphens+"(?:[0-9]*[a-zA-Z]+0*)?[0-9]+");m=str.match(rexm);lst=str.split(rexlst);if(lst.length===0){ret=m;}else{ret=[lst[0]];for(pos=1,len=lst.length;pos<len;pos+=1){ret.push(m[pos-1].replace(/\s*\-\s*/g,"-"));ret.push(lst[pos]);}}return ret;};expand=function expand(str){str=""+str;lst=listify(str);len=lst.length;for(pos=1;pos<len;pos+=2){m=lst[pos].match(rangerex);if(m){if(!m[3]||m[1]===m[3]){if(m[4].length<m[2].length){m[4]=m[2].slice(0,m[2].length-m[4].length)+m[4];}if(parseInt(m[2],10)<parseInt(m[4],10)){m[3]=range_delimiter+(m[1]?m[1]:"");lst[pos]=m.slice(1);}}}if("string"===typeof lst[pos]){lst[pos]=lst[pos].replace(/\-/g,range_delimiter);}}return lst;};minimize=function minimize(lst,minchars,isyear){len=lst.length;for(var i=1,ilen=lst.length;i<ilen;i+=2){lst[i][3]=minimize_internal(lst[i][1],lst[i][3],minchars,isyear);if(lst[i][2].slice(1)===lst[i][0]){lst[i][2]=range_delimiter;}}return stringify(lst);};minimize_internal=function minimize_internal(begin,end,minchars,isyear){if(!minchars){minchars=0;}b=(""+begin).split("");e=(""+end).split("");ret=e.slice();ret.reverse();if(b.length===e.length){for(var i=0,ilen=b.length;i<ilen;i+=1){if(b[i]===e[i]&&ret.length>minchars){ret.pop();}else{if(minchars&&isyear&&ret.length===3){var front=b.slice(0,i);front.reverse();ret=ret.concat(front);}break;}}}ret.reverse();return ret.join("");};chicago=function chicago(lst){len=lst.length;for(pos=1;pos<len;pos+=2){if("object"===_typeof(lst[pos])){m=lst[pos];begin=parseInt(m[1],10);end=parseInt(m[3],10);if(begin>100&&begin%100&&parseInt(begin/100,10)===parseInt(end/100,10)){m[3]=""+end%100;}else if(begin>=10000){m[3]=""+end%1000;}}if(m[2].slice(1)===m[0]){m[2]=range_delimiter;}}return stringify(lst);};var sniff=function sniff(str,func,minchars,isyear){var ret;str=""+str;var lst=expand(str);var ret=func(lst,minchars,isyear);return ret;};if(!state.opt[rangeType+"-range-format"]){ret_func=function ret_func(str){return sniff(str,stringify);};}else if(state.opt[rangeType+"-range-format"]==="expanded"){ret_func=function ret_func(str){return sniff(str,stringify);};}else if(state.opt[rangeType+"-range-format"]==="minimal"){ret_func=function ret_func(str){return sniff(str,minimize);};}else if(state.opt[rangeType+"-range-format"]==="minimal-two"){ret_func=function ret_func(str,isyear){return sniff(str,minimize,2,isyear);};}else if(state.opt[rangeType+"-range-format"]==="chicago"){ret_func=function ret_func(str){return sniff(str,chicago);};}return ret_func;};module.exports=CSL;CSL.Util.FlipFlopper=function(state){this.processTags=processTags;var _nestingState=[];var _nestingData={"<span class=\"nocase\">":{type:"nocase",opener:"<span class=\"nocase\">",closer:"</span>",attr:null,outer:null,flipflop:null},"<span class=\"nodecor\">":{type:"nodecor",opener:"<span class=\"nodecor\">",closer:"</span>",attr:"@class",outer:"nodecor",flipflop:{"nodecor":"nodecor"}},"<span style=\"font-variant:small-caps;\">":{type:"tag",opener:"<span style=\"font-variant:small-caps;\">",closer:"</span>",attr:"@font-variant",outer:"small-caps",flipflop:{"small-caps":"normal","normal":"small-caps"}},"<sc>":{type:"tag",opener:"<sc>",closer:"</sc>",attr:"@font-variant",outer:"small-caps",flipflop:{"small-caps":"normal","normal":"small-caps"}},"<i>":{type:"tag",opener:"<i>",closer:"</i>",attr:"@font-style",outer:"italic",flipflop:{"italic":"normal","normal":"italic"}},"<b>":{type:"tag",opener:"<b>",closer:"</b>",attr:"@font-weight",outer:"bold",flipflop:{"bold":"normal","normal":"bold"}},"<sup>":{type:"tag",opener:"<sup>",closer:"</sup>",attr:"@vertical-align",outer:"sup",flipflop:{"sub":"sup","sup":"sup"}},"<sub>":{type:"tag",opener:"<sub>",closer:"</sub>",attr:"@vertical-align",outer:"sub",flipflop:{"sup":"sub","sub":"sub"}}," \"":{type:"quote",opener:" \"",closer:"\"",attr:"@quotes",outer:"true",flipflop:{"true":"inner","inner":"true","false":"true"}}," \'":{type:"quote",opener:" \'",closer:"\'",attr:"@quotes",outer:"inner",flipflop:{"true":"inner","inner":"true","false":"true"}}};_nestingData["(\""]=_nestingData[" \""];_nestingData["(\'"]=_nestingData[" \'"];var localeOpenQuote=state.getTerm("open-quote");var localeCloseQuote=state.getTerm("close-quote");var localeOpenInnerQuote=state.getTerm("open-inner-quote");var localeCloseInnerQuote=state.getTerm("close-inner-quote");if(localeOpenQuote&&localeCloseQuote&&[" \""," \'","\"","\'"].indexOf(localeOpenQuote)===-1){_nestingData[localeOpenQuote]=JSON.parse(JSON.stringify(_nestingData[" \""]));_nestingData[localeOpenQuote].opener=localeOpenQuote;_nestingData[localeOpenQuote].closer=localeCloseQuote;}if(localeOpenInnerQuote&&localeCloseInnerQuote&&[" \""," \'","\"","\'"].indexOf(localeOpenInnerQuote)===-1){_nestingData[localeOpenInnerQuote]=JSON.parse(JSON.stringify(_nestingData[" \'"]));_nestingData[localeOpenInnerQuote].opener=localeOpenInnerQuote;_nestingData[localeOpenInnerQuote].closer=localeCloseInnerQuote;}var _nestingQuoteReverse=function(){var ret={};var keys=Object.keys(_nestingData);for(var i=0,l=keys.length;i<l;i++){var key=keys[i];if(_nestingData[key].type==="quote"){ret[_nestingData[key].closer]=_nestingData[key];}}return ret;}();var _nestingDataAttr=function(){var ret={};var keys=Object.keys(_nestingData);for(var i=0,l=keys.length;i<l;i++){var key=keys[i];if(_nestingData[key].type==="nocase")continue;var attr=_nestingData[key].attr;var outer=_nestingData[key].outer;var inner=_nestingData[key].flipflop[_nestingData[key].outer];ret[attr+"/"+outer]=_nestingData[key];ret[attr+"/"+inner]=_nestingData[key];}return ret;}();function _setOuterQuoteForm(quot){var flip={" \'":" \""," \"":" \'","(\"":"(\'","(\'":"(\""};_nestingData[quot].outer="true";_nestingData[flip[quot]].outer="inner";}function _getNestingOpenerParams(opener){var openers=[];var closer;var keys=Object.keys(_nestingData);for(var i=0,l=keys.length;i<l;i++){var key=keys[i];if(_nestingData[opener].type!=="quote"||!_nestingData[opener]){openers.push(key);}}var ret=_nestingData[opener];ret.opener=new RegExp("^(?:"+openers.map(function(str){return str.replace("(","\\(");}).join("|")+")");return ret;}var _nestingParams=function(){var ret={};var keys=Object.keys(_nestingData);for(var i=0,l=keys.length;i<l;i++){var key=keys[i];ret[key]=_getNestingOpenerParams(key);}return ret;}();var _tagRex=function(){var openers=[];var closers=[];var vals={};for(var opener in _nestingParams){openers.push(opener);vals[_nestingParams[opener].closer]=true;}var keys=Object.keys(vals);for(var i=0,l=keys.length;i<l;i++){var closer=keys[i];closers.push(closer);}var all=openers.concat(closers).map(function(str){return str.replace("(","\\(");}).join("|");return{matchAll:new RegExp("((?:"+all+"))","g"),splitAll:new RegExp("(?:"+all+")","g"),open:new RegExp("(^(?:"+openers.map(function(str){return str.replace("(","\\(");}).join("|")+")$)"),close:new RegExp("(^(?:"+closers.join("|")+")$)")};}();function _nestingFix(tag,pos){return _pushNestingState(tag,pos);}function _pushNestingState(tag,pos){if(tag.match(_tagRex.open)){return _tryOpen(tag,pos);}else{return _tryClose(tag,pos);}}function _tryOpen(tag,pos){var params=_nestingState[_nestingState.length-1];if(!params||tag.match(params.opener)){_nestingState.push({type:_nestingParams[tag].type,opener:_nestingParams[tag].opener,closer:_nestingParams[tag].closer,pos:pos});return false;}else{_nestingState.pop();_nestingState.push({type:_nestingParams[tag].type,opener:_nestingParams[tag].opener,closer:_nestingParams[tag].closer,pos:pos});return{fixtag:params.pos};}}function _tryClose(tag,pos){var params=_nestingState[_nestingState.length-1];if(params&&tag===params.closer){_nestingState.pop();if(params.type==="nocase"){return{nocase:{open:params.pos,close:pos}};}else{return false;}}else{if(params){return{fixtag:params.pos};}else{return{fixtag:pos};}}}function _doppelString(str){var forcedSpaces=[];str=str.replace(/(<span)\s+(style=\"font-variant:)\s*(small-caps);?\"[^>]*(>)/g,"$1 $2$3;\"$4");str=str.replace(/(<span)\s+(class=\"no(?:case|decor)\")[^>]*(>)/g,"$1 $2$3");var match=str.match(_tagRex.matchAll);if(!match){return{tags:[],strings:[str],forcedSpaces:[]};}var split=str.split(_tagRex.splitAll);for(var i=0,ilen=match.length-1;i<ilen;i++){if(_nestingData[match[i]]){if(split[i+1]===""&&["\"","'"].indexOf(match[i+1])>-1){match[i+1]=" "+match[i+1];forcedSpaces.push(true);}else{forcedSpaces.push(false);}}}return{tags:match,strings:split,forcedSpaces:forcedSpaces};}function _undoppelString(obj){var lst=obj.strings.slice(-1);for(var i=obj.tags.length-1;i>-1;i+=-1){lst.push(obj.tags[i]);lst.push(obj.strings[i]);}lst.reverse();return lst.join("|");}var _TagReg=function _TagReg(blob){this.set=set;this.pair=pair;this.pop=pop;var _stack=[];function set(tag){var attr=_nestingData[tag].attr;var decor=null;for(var i=_stack.length-1;i>-1;i--){var _decor=_stack[i];if(_decor[0]===attr){decor=_decor;break;}}if(!decor){var allTheDecor=[state[state.tmp.area].opt.layout_decorations].concat(blob.alldecor);outer:for(var i=allTheDecor.length-1;i>-1;i--){var decorset=allTheDecor[i];if(!decorset)continue;for(var j=decorset.length-1;j>-1;j--){var _decor=decorset[j];if(_decor[0]===attr){decor=_decor;break outer;}}}}if(!decor){decor=[attr,_nestingData[tag].outer];}else{decor=[attr,_nestingData[tag].flipflop[decor[1]]];}_stack.push(decor);}function pair(){return _stack[_stack.length-1];}function pop(){_stack.pop();}};function _apostropheForce(tag,str){if(tag==="\'"){if(str&&str.match(/^[^\,\.\?\:\;\ ]/)){return true;}}else if(tag===" \'"&&str&&str.match(/^[\ ]/)){return true;}return false;}function _undoppelToQueue(blob,doppel,leadingSpace){var TOP=blob;var firstString=true;var tagReg=new _TagReg(blob);blob.blobs=[];function Stack(blob){this.stack=[blob];this.latest=blob;this.addStyling=function(str,decor,forcedSpace){if(firstString){if(str.slice(0,1)===" "){str=str.slice(1);}if(str.slice(0,1)===" "){str=str.slice(1);}firstString=false;}this.latest=this.stack[this.stack.length-1];if(decor){if("string"===typeof this.latest.blobs){var child=new CSL.Blob();child.blobs=this.latest.blobs;child.alldecor=this.latest.alldecor.slice();this.latest.blobs=[child];}var tok=new CSL.Token();var newblob=new CSL.Blob(null,tok);newblob.alldecor=this.latest.alldecor.slice();if(decor[0]==="@class"&&decor[1]==="nodecor"){var newdecorset=[];var seen={};var allTheDecor=[state[state.tmp.area].opt.layout_decorations].concat(newblob.alldecor);for(var i=allTheDecor.length-1;i>-1;i--){var _decorset=allTheDecor[i];if(!_decorset)continue;for(var j=_decorset.length-1;j>-1;j--){var _olddecor=_decorset[j];if(["@font-weight","@font-style","@font-variant"].indexOf(_olddecor[0])>-1&&!seen[_olddecor[0]]){if(decor[1]!=="normal"){newblob.decorations.push([_olddecor[0],"normal"]);newdecorset.push([_olddecor[0],"normal"]);}seen[_olddecor[0]]=true;}}}newblob.alldecor.push(newdecorset);}else{newblob.decorations.push(decor);newblob.alldecor.push([decor]);}this.latest.blobs.push(newblob);this.stack.push(newblob);this.latest=newblob;if(str){var tok=new CSL.Token();var newblob=new CSL.Blob(null,tok);newblob.blobs=str;newblob.alldecor=this.latest.alldecor.slice();this.latest.blobs.push(newblob);}}else{if(str){var child=new CSL.Blob();child.blobs=str;child.alldecor=this.latest.alldecor.slice();this.latest.blobs.push(child);}}};this.popStyling=function(){this.stack.pop();};};var stack=new Stack(blob);if(doppel.strings.length){var str=doppel.strings[0];if(leadingSpace){str=" "+str;}stack.addStyling(str);}for(var i=0,ilen=doppel.tags.length;i<ilen;i++){var tag=doppel.tags[i];var str=doppel.strings[i+1];if(tag.match(_tagRex.open)){tagReg.set(tag);stack.addStyling(str,tagReg.pair());}else{tagReg.pop();stack.popStyling();stack.addStyling(str);}}}function processTags(blob){var str=blob.blobs;var leadingSpace=false;if(str.slice(0,1)===" "&&!str.match(/^\s+[\'\"]/)){leadingSpace=true;}var rex=new RegExp("("+CSL.ROMANESQUE_REGEXP.source+")\u2019("+CSL.ROMANESQUE_REGEXP.source+")","g");var str=" "+str.replace(rex,"$1\'$2");var doppel=_doppelString(str);if(doppel.tags.length===0)return;var quoteFormSeen=false;for(var i=0,ilen=doppel.tags.length;i<ilen;i++){var tag=doppel.tags[i];var str=doppel.strings[i+1];if(_apostropheForce(tag,str)){if(tag===" \'"){doppel.strings[i+1]=" \u2019"+doppel.strings[i+1];}else{doppel.strings[i+1]="\u2019"+doppel.strings[i+1];}doppel.tags[i]="";}else{var tagInfo;while(true){tagInfo=_nestingFix(tag,i);if(tagInfo){if(Object.keys(tagInfo).indexOf("fixtag")>-1){if(tag.match(_tagRex.close)&&tag==="\'"){doppel.strings[i+1]="\u2019"+doppel.strings[i+1];doppel.tags[i]="";}else{var failedTag=doppel.tags[tagInfo.fixtag];if(doppel.forcedSpaces[tagInfo.fixtag-1]){failedTag=failedTag.slice(1);}doppel.strings[tagInfo.fixtag+1]=failedTag+doppel.strings[tagInfo.fixtag+1];doppel.tags[tagInfo.fixtag]="";}if(_nestingState.length>0){_nestingState.pop();}else{break;}}else if(tagInfo.nocase){doppel.tags[tagInfo.nocase.open]="";doppel.tags[tagInfo.nocase.close]="";break;}else{break;}}else{break;}}if(tagInfo&&(tagInfo.fixtag||tagInfo.fixtag===0)){doppel.strings[i+1]=doppel.tags[i]+doppel.strings[i+1];doppel.tags[i]="";}}}for(var i=_nestingState.length-1;i>-1;i--){var tagPos=_nestingState[i].pos;var tag=doppel.tags[tagPos];if(tag===" \'"||tag==="\'"){doppel.strings[tagPos+1]=" \u2019"+doppel.strings[tagPos+1];}else{doppel.strings[tagPos+1]=doppel.tags[tagPos]+doppel.strings[tagPos+1];}doppel.tags[tagPos]="";_nestingState.pop();}for(var i=doppel.tags.length-1;i>-1;i--){if(!doppel.tags[i]){doppel.tags=doppel.tags.slice(0,i).concat(doppel.tags.slice(i+1));doppel.strings[i]=doppel.strings[i]+doppel.strings[i+1];doppel.strings=doppel.strings.slice(0,i+1).concat(doppel.strings.slice(i+2));}}for(var i=0,ilen=doppel.tags.length;i<ilen;i++){var tag=doppel.tags[i];var forcedSpace=doppel.forcedSpaces[i-1];if([" \""," \'","(\"","(\'"].indexOf(tag)>-1){if(!quoteFormSeen){_setOuterQuoteForm(tag);quoteFormSeen=true;}if(!forcedSpace){doppel.strings[i]+=tag.slice(0,1);}}}_undoppelToQueue(blob,doppel,leadingSpace);}};module.exports=CSL;CSL.Output.Formatters=new function(){this.passthrough=passthrough;this.lowercase=lowercase;this.uppercase=uppercase;this.sentence=sentence;this.title=title;this["capitalize-first"]=capitalizeFirst;this["capitalize-all"]=capitalizeAll;var rexStr="(?:\u2018|\u2019|\u201C|\u201D| \"| '|\"|'|[-\u2013\u2014/.,;?!:]|\\[|\\]|\\(|\\)|<span style=\"font-variant: small-caps;\">|<span class=\"no(?:case|decor)\">|</span>|</?(?:i|sc|b|sub|sup)>)";var tagDoppel=new CSL.Doppeler(rexStr,function(str){return str.replace(/(<span)\s+(class=\"no(?:case|decor)\")[^>]*(>)/g,"$1 $2$3").replace(/(<span)\s+(style=\"font-variant:)\s*(small-caps);?(\")[^>]*(>)/g,"$1 $2 $3;$4$5");});var wordDoppel=new CSL.Doppeler("(?:[ \xA0\u2000-\u200B\u205F\u3000]+)");var _tagParams={"<span style=\"font-variant: small-caps;\">":"</span>","<span class=\"nocase\">":"</span>","<span class=\"nodecor\">":"</span>"};function _capitalise(word,force){var m=word.match(/(^\s*)((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))(.*)/);if(m&&!(m[2].match(/^[\u0370-\u03FF]$/)&&!m[3])){return m[1]+m[2].toUpperCase()+m[3];}return word;}function _textcaseEngine(config,string){if(!string){return"";}config.doppel=tagDoppel.split(string);var quoteParams={" \"":{opener:" \'",closer:"\""}," \'":{opener:" \"",closer:"\'"},"\u2018":{opener:"\u2018",closer:"\u2019"},"\u201C":{opener:"\u201C",closer:"\u201D"}};function quoteFix(tag,positions){var m=tag.match(/(^(?:\u2018|\u2019|\u201C|\u201D|\"|\')|(?: \"| \')$)/);if(m){return pushQuoteState(m[1],positions);}}function pushQuoteState(tag,pos){var isOpener=["\u201C","\u2018"," \""," \'"].indexOf(tag)>-1?true:false;if(isOpener){return tryOpen(tag,pos);}else{return tryClose(tag,pos);}}function tryOpen(tag,pos){if(config.quoteState.length===0||tag===config.quoteState[config.quoteState.length-1].opener){config.quoteState.push({opener:quoteParams[tag].opener,closer:quoteParams[tag].closer,pos:pos});return false;}else{var prevPos=config.quoteState[config.quoteState.length-1].pos;config.quoteState.pop();config.quoteState.push({opener:quoteParams[tag].opener,closer:quoteParams[tag].closer,positions:pos});return prevPos;}}function tryClose(tag,pos){if(config.quoteState.length>0&&tag===config.quoteState[config.quoteState.length-1].closer){config.quoteState.pop();}else{return pos;}}if(config.doppel.strings.length&&config.doppel.strings[0].trim()){config.doppel.strings[0]=config.capitaliseWords(config.doppel.strings[0],0,config.doppel.tags[0]);}for(var i=0,ilen=config.doppel.tags.length;i<ilen;i++){var tag=config.doppel.tags[i];var str=config.doppel.strings[i+1];if(config.tagState!==null){if(_tagParams[tag]){config.tagState.push(_tagParams[tag]);}else if(config.tagState.length&&tag===config.tagState[config.tagState.length-1]){config.tagState.pop();}}if(config.afterPunct!==null){if(tag.match(/[\!\?\:]$/)){config.afterPunct=true;}}if(config.tagState.length===0){config.doppel.strings[i+1]=config.capitaliseWords(str,i+1,config.doppel,config.doppel.tags[i+1]);}else if(config.doppel.strings[i+1].trim()){config.lastWordPos=null;}if(config.quoteState!==null){var quotePos=quoteFix(tag,i);if(quotePos||quotePos===0){var origChar=config.doppel.origStrings[quotePos+1].slice(0,1);config.doppel.strings[quotePos+1]=origChar+config.doppel.strings[quotePos+1].slice(1);config.lastWordPos=null;}}if(config.isFirst){if(str.trim()){config.isFirst=false;}}if(config.afterPunct){if(str.trim()){config.afterPunct=false;}}}if(config.quoteState){for(var i=0,ilen=config.quoteState.length;i<ilen;i++){var quotePos=config.quoteState[i].pos;if(typeof quotePos!=='undefined'){var origChar=config.doppel.origStrings[quotePos+1].slice(0,1);config.doppel.strings[quotePos+1]=origChar+config.doppel.strings[quotePos+1].slice(1);}}}if(config.lastWordPos){var lastWords=wordDoppel.split(config.doppel.strings[config.lastWordPos.strings]);var lastWord=_capitalise(lastWords.strings[config.lastWordPos.words]);lastWords.strings[config.lastWordPos.words]=lastWord;config.doppel.strings[config.lastWordPos.strings]=wordDoppel.join(lastWords);}return tagDoppel.join(config.doppel);}function passthrough(state,str){return str;}function lowercase(state,string){var config={quoteState:null,capitaliseWords:function capitaliseWords(str){var words=str.split(" ");for(var i=0,ilen=words.length;i<ilen;i++){var word=words[i];if(word){words[i]=word.toLowerCase();}}return words.join(" ");},skipWordsRex:null,tagState:[],afterPunct:null,isFirst:null};return _textcaseEngine(config,string);}function uppercase(state,string){var config={quoteState:null,capitaliseWords:function capitaliseWords(str){var words=str.split(" ");for(var i=0,ilen=words.length;i<ilen;i++){var word=words[i];if(word){words[i]=word.toUpperCase();}}return words.join(" ");},skipWordsRex:null,tagState:[],afterPunct:null,isFirst:null};return _textcaseEngine(config,string);}function sentence(state,string){var config={quoteState:[],capitaliseWords:function capitaliseWords(str){var words=str.split(" ");for(var i=0,ilen=words.length;i<ilen;i++){var word=words[i];if(word){if(config.isFirst){words[i]=_capitalise(word);config.isFirst=false;}else{words[i]=word.toLowerCase();}}}return words.join(" ");},skipWordsRex:null,tagState:[],afterPunct:null,isFirst:true};return _textcaseEngine(config,string);}function title(state,string){var config={quoteState:[],capitaliseWords:function capitaliseWords(str,i,followingTag){if(str.trim()){var words=str.split(/[ \u00A0]+/);var wordle=wordDoppel.split(str);var words=wordle.strings;for(var j=0,jlen=words.length;j<jlen;j++){var word=words[j];if(!word)continue;if(word.length>1&&!word.toLowerCase().match(config.skipWordsRex)){words[j]=_capitalise(words[j]);}else if(j===words.length-1&&followingTag==="-"){words[j]=_capitalise(words[j]);}else if(config.isFirst){words[j]=_capitalise(words[j]);}else if(config.afterPunct){words[j]=_capitalise(words[j]);}config.afterPunct=false;config.isFirst=false;config.lastWordPos={strings:i,words:j};}str=wordDoppel.join(wordle);}return str;},skipWordsRex:state.locale[state.opt.lang].opts["skip-words-regexp"],tagState:[],afterPunct:false,isFirst:true};return _textcaseEngine(config,string);}function capitalizeFirst(state,string){var config={quoteState:[],capitaliseWords:function capitaliseWords(str){var words=str.split(" ");for(var i=0,ilen=words.length;i<ilen;i++){var word=words[i];if(word){if(config.isFirst){words[i]=_capitalise(word);config.isFirst=false;break;}}}return words.join(" ");},skipWordsRex:null,tagState:[],afterPunct:null,isFirst:true};return _textcaseEngine(config,string);}function capitalizeAll(state,string){var config={quoteState:[],capitaliseWords:function capitaliseWords(str){var words=str.split(" ");for(var i=0,ilen=words.length;i<ilen;i++){var word=words[i];if(word){words[i]=_capitalise(word);}}return words.join(" ");},skipWordsRex:null,tagState:[],afterPunct:null,isFirst:null};return _textcaseEngine(config,string);}}();module.exports=CSL;CSL.Output.Formats=function(){};CSL.Output.Formats.prototype.html={"text_escape":function text_escape(text){if(!text){text="";}return text.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\s\s/g,"\xA0 ").replace(CSL.SUPERSCRIPTS_REGEXP,function(aChar){return"<sup>"+CSL.SUPERSCRIPTS[aChar]+"</sup>";});},"bibstart":"<div class=\"csl-bib-body\">\n","bibend":"</div>","@font-style/italic":"<i>%%STRING%%</i>","@font-style/oblique":"<em>%%STRING%%</em>","@font-style/normal":"<span style=\"font-style:normal;\">%%STRING%%</span>","@font-variant/small-caps":"<span style=\"font-variant:small-caps;\">%%STRING%%</span>","@passthrough/true":CSL.Output.Formatters.passthrough,"@font-variant/normal":"<span style=\"font-variant:normal;\">%%STRING%%</span>","@font-weight/bold":"<b>%%STRING%%</b>","@font-weight/normal":"<span style=\"font-weight:normal;\">%%STRING%%</span>","@font-weight/light":false,"@text-decoration/none":"<span style=\"text-decoration:none;\">%%STRING%%</span>","@text-decoration/underline":"<span style=\"text-decoration:underline;\">%%STRING%%</span>","@vertical-align/sup":"<sup>%%STRING%%</sup>","@vertical-align/sub":"<sub>%%STRING%%</sub>","@vertical-align/baseline":"<span style=\"baseline\">%%STRING%%</span>","@strip-periods/true":CSL.Output.Formatters.passthrough,"@strip-periods/false":CSL.Output.Formatters.passthrough,"@quotes/true":function quotesTrue(state,str){if("undefined"===typeof str){return state.getTerm("open-quote");}return state.getTerm("open-quote")+str+state.getTerm("close-quote");},"@quotes/inner":function quotesInner(state,str){if("undefined"===typeof str){return"\u2019";}return state.getTerm("open-inner-quote")+str+state.getTerm("close-inner-quote");},"@quotes/false":false,"@cite/entry":function citeEntry(state,str){return state.sys.wrapCitationEntry(str,this.item_id,this.locator_txt,this.suffix_txt);},"@bibliography/entry":function bibliographyEntry(state,str){var insert="";if(state.sys.embedBibliographyEntry){insert=state.sys.embedBibliographyEntry(this.item_id)+"\n";}return" <div class=\"csl-entry\">"+str+"</div>\n"+insert;},"@display/block":function displayBlock(state,str){return"\n\n <div class=\"csl-block\">"+str+"</div>\n";},"@display/left-margin":function displayLeftMargin(state,str){return"\n <div class=\"csl-left-margin\">"+str+"</div>";},"@display/right-inline":function displayRightInline(state,str){return"<div class=\"csl-right-inline\">"+str+"</div>\n ";},"@display/indent":function displayIndent(state,str){return"<div class=\"csl-indent\">"+str+"</div>\n ";},"@showid/true":function showidTrue(state,str,cslid){if(!state.tmp.just_looking&&!state.tmp.suppress_decorations){if(cslid){return"<span class=\""+state.opt.nodenames[cslid]+"\" cslid=\""+cslid+"\">"+str+"</span>";}else if(this.params&&"string"===typeof str){var prePunct="";if(str){var m=str.match(CSL.VARIABLE_WRAPPER_PREPUNCT_REX);prePunct=m[1];str=m[2];}var postPunct="";if(str&&CSL.SWAPPING_PUNCTUATION.indexOf(str.slice(-1))>-1){postPunct=str.slice(-1);str=str.slice(0,-1);}return state.sys.variableWrapper(this.params,prePunct,str,postPunct);}else{return str;}}else{return str;}},"@URL/true":function URLTrue(state,str){return"<a href=\""+str+"\">"+str+"</a>";},"@DOI/true":function DOITrue(state,str){var doiurl=str;if(!str.match(/^https?:\/\//)){doiurl="https://doi.org/"+str;}return"<a href=\""+doiurl+"\">"+str+"</a>";}};CSL.Output.Formats.prototype.text={"text_escape":function text_escape(text){if(!text){text="";}return text;},"bibstart":"","bibend":"","@font-style/italic":false,"@font-style/oblique":false,"@font-style/normal":false,"@font-variant/small-caps":false,"@passthrough/true":CSL.Output.Formatters.passthrough,"@font-variant/normal":false,"@font-weight/bold":false,"@font-weight/normal":false,"@font-weight/light":false,"@text-decoration/none":false,"@text-decoration/underline":false,"@vertical-align/baseline":false,"@vertical-align/sup":false,"@vertical-align/sub":false,"@strip-periods/true":CSL.Output.Formatters.passthrough,"@strip-periods/false":CSL.Output.Formatters.passthrough,"@quotes/true":function quotesTrue(state,str){if("undefined"===typeof str){return state.getTerm("open-quote");}return state.getTerm("open-quote")+str+state.getTerm("close-quote");},"@quotes/inner":function quotesInner(state,str){if("undefined"===typeof str){return"\u2019";}return state.getTerm("open-inner-quote")+str+state.getTerm("close-inner-quote");},"@quotes/false":false,"@cite/entry":function citeEntry(state,str){return state.sys.wrapCitationEntry(str,this.item_id,this.locator_txt,this.suffix_txt);},"@bibliography/entry":function bibliographyEntry(state,str){return str+"\n";},"@display/block":function displayBlock(state,str){return"\n"+str;},"@display/left-margin":function displayLeftMargin(state,str){return str;},"@display/right-inline":function displayRightInline(state,str){return str;},"@display/indent":function displayIndent(state,str){return"\n "+str;},"@showid/true":function showidTrue(state,str,cslid){return str;},"@URL/true":function URLTrue(state,str){return str;},"@DOI/true":function DOITrue(state,str){return str;}};CSL.Output.Formats.prototype.rtf={"text_escape":function text_escape(text){if(!text){text="";}return text.replace(/([\\{}])/g,"\\$1").replace(CSL.SUPERSCRIPTS_REGEXP,function(aChar){return"\\super "+CSL.SUPERSCRIPTS[aChar]+"\\nosupersub{}";}).replace(/[\u007F-\uFFFF]/g,function(aChar){return"\\uc0\\u"+aChar.charCodeAt(0).toString()+"{}";}).split("\t").join("\\tab{}");},"@passthrough/true":CSL.Output.Formatters.passthrough,"@font-style/italic":"{\\i{}%%STRING%%}","@font-style/normal":"{\\i0{}%%STRING%%}","@font-style/oblique":"{\\i{}%%STRING%%}","@font-variant/small-caps":"{\\scaps %%STRING%%}","@font-variant/normal":"{\\scaps0{}%%STRING%%}","@font-weight/bold":"{\\b{}%%STRING%%}","@font-weight/normal":"{\\b0{}%%STRING%%}","@font-weight/light":false,"@text-decoration/none":false,"@text-decoration/underline":"{\\ul{}%%STRING%%}","@vertical-align/baseline":false,"@vertical-align/sup":"\\super %%STRING%%\\nosupersub{}","@vertical-align/sub":"\\sub %%STRING%%\\nosupersub{}","@strip-periods/true":CSL.Output.Formatters.passthrough,"@strip-periods/false":CSL.Output.Formatters.passthrough,"@quotes/true":function quotesTrue(state,str){if("undefined"===typeof str){return CSL.Output.Formats.rtf.text_escape(state.getTerm("open-quote"));}return CSL.Output.Formats.rtf.text_escape(state.getTerm("open-quote"))+str+CSL.Output.Formats.rtf.text_escape(state.getTerm("close-quote"));},"@quotes/inner":function quotesInner(state,str){if("undefined"===typeof str){return CSL.Output.Formats.rtf.text_escape("\u2019");}return CSL.Output.Formats.rtf.text_escape(state.getTerm("open-inner-quote"))+str+CSL.Output.Formats.rtf.text_escape(state.getTerm("close-inner-quote"));},"@quotes/false":false,"bibstart":"{\\rtf ","bibend":"}","@display/block":"\\line{}%%STRING%%\\line\r\n","@cite/entry":function citeEntry(state,str){return state.sys.wrapCitationEntry(str,this.item_id,this.locator_txt,this.suffix_txt);},"@bibliography/entry":function bibliographyEntry(state,str){return str;},"@display/left-margin":function displayLeftMargin(state,str){return str+"\\tab ";},"@display/right-inline":function displayRightInline(state,str){return str+"\r\n";},"@display/indent":function displayIndent(state,str){return"\n\\tab "+str+"\\line\r\n";},"@showid/true":function showidTrue(state,str,cslid){if(!state.tmp.just_looking&&!state.tmp.suppress_decorations){var prePunct="";if(str){var m=str.match(CSL.VARIABLE_WRAPPER_PREPUNCT_REX);prePunct=m[1];str=m[2];}var postPunct="";if(str&&CSL.SWAPPING_PUNCTUATION.indexOf(str.slice(-1))>-1){postPunct=str.slice(-1);str=str.slice(0,-1);}return state.sys.variableWrapper(this.params,prePunct,str,postPunct);}else{return str;}},"@URL/true":function URLTrue(state,str){return str;},"@DOI/true":function DOITrue(state,str){return str;}};CSL.Output.Formats=new CSL.Output.Formats();module.exports=CSL;CSL.Registry=function(state){var pos,len,ret,i,ilen;this.debug=false;this.state=state;this.registry={};this.reflist=[];this.refhash={};this.namereg=new CSL.Registry.NameReg(state);this.citationreg=new CSL.Registry.CitationReg(state);this.authorstrings={};this.mylist=[];this.myhash={};this.deletes=[];this.inserts=[];this.uncited={};this.refreshes={};this.akeys={};this.oldseq={};this.return_data={};this.ambigcites={};this.ambigresets={};this.sorter=new CSL.Registry.Comparifier(state,"bibliography_sort");this.getSortedIds=function(){var ret=[];for(var i=0,ilen=this.reflist.length;i<ilen;i+=1){ret.push(""+this.reflist[i].id);}return ret;};this.getSortedRegistryItems=function(){var ret=[];for(var i=0,ilen=this.reflist.length;i<ilen;i+=1){ret.push(this.reflist[i]);}return ret;};};CSL.Registry.prototype.init=function(itemIDs,uncited_flag){var i,ilen;this.oldseq={};if(uncited_flag){this.uncited={};for(var i=0,ilen=itemIDs.length;i<ilen;i+=1){if(!this.myhash[itemIDs[i]]){this.mylist.push(""+itemIDs[i]);}this.uncited[itemIDs[i]]=true;this.myhash[itemIDs[i]]=true;}}else{for(var key in this.uncited){itemIDs.push(key);}var myhash={};for(i=itemIDs.length-1;i>-1;i+=-1){if(myhash[itemIDs[i]]){itemIDs=itemIDs.slice(0,i).concat(itemIDs.slice(i+1));}else{myhash[itemIDs[i]]=true;}}this.mylist=itemIDs;this.myhash=myhash;}this.refreshes={};this.touched={};this.ambigsTouched={};this.ambigresets={};};CSL.Registry.prototype.dopurge=function(myhash){for(var i=this.mylist.length-1;i>-1;i+=-1){if(this.citationreg.citationsByItemId){if(!this.citationreg.citationsByItemId[this.mylist[i]]&&!myhash[this.mylist[i]]){delete this.myhash[this.mylist[i]];this.mylist=this.mylist.slice(0,i).concat(this.mylist.slice(i+1));}}}this.dodeletes(this.myhash);};CSL.Registry.prototype.dodeletes=function(myhash){var otheritems,key,ambig,pos,len,items,kkey,mypos,id;if("string"===typeof myhash){var key=myhash;myhash={};myhash[key]=true;}for(var key in this.registry){if(!myhash[key]){if(this.uncited[key]){continue;}otheritems=this.namereg.delitems(key);for(kkey in otheritems){this.refreshes[kkey]=true;}ambig=this.registry[key].ambig;mypos=this.ambigcites[ambig].indexOf(key);if(mypos>-1){items=this.ambigcites[ambig].slice();this.ambigcites[ambig]=items.slice(0,mypos).concat(items.slice(mypos+1,items.length));this.ambigresets[ambig]=this.ambigcites[ambig].length;}len=this.ambigcites[ambig].length;for(pos=0;pos<len;pos+=1){id=""+this.ambigcites[ambig][pos];this.refreshes[id]=true;}if(this.registry[key].siblings){if(this.registry[key].siblings.length==1){var loneSiblingID=this.registry[key].siblings[0];this.registry[loneSiblingID].master=true;this.registry[loneSiblingID].siblings.pop();this.registry[loneSiblingID].parallel=false;}else if(this.registry[key].siblings.length>1){var removeIDs=[key];if(this.registry[key].master){var newmasterID=this.registry[key].siblings[0];var newmaster=this.registry[newmasterID];newmaster.master=true;newmaster.parallel=false;removeIDs.push(newmasterID);for(var k=0,klen=this.registry[key].siblings.length;k<klen;k+=1){this.registry[this.registry[key].siblings[k]].parallel=newmasterID;}}var buffer=[];for(var k=this.registry[key].siblings.length-1;k>-1;k+=-1){var siblingID=this.registry[key].siblings.pop();if(removeIDs.indexOf(siblingID)===-1){buffer.push(siblingID);}}for(var k=buffer.length-1;k>-1;k+=-1){this.registry[key].siblings.push(buffer[k]);}}}for(var i=this.reflist.length-1;i>-1;i--){if(this.reflist[i].id===key){this.reflist=this.reflist.slice(0,i).concat(this.reflist.slice(i+1));}}delete this.registry[key];delete this.refhash[key];this.return_data.bibchange=true;}}};CSL.Registry.prototype.doinserts=function(mylist){var len,pos,item,Item,akey,newitem,abase,j,jlen,k,klen,i,ilen;if("string"===typeof mylist){mylist=[mylist];}for(var i=0,ilen=mylist.length;i<ilen;i+=1){item=mylist[i];if(!this.registry[item]){Item=this.state.retrieveItem(item);akey=CSL.getAmbiguousCite.call(this.state,Item);this.ambigsTouched[akey]=true;if(!Item.legislation_id){this.akeys[akey]=true;}newitem={"id":""+item,"seq":0,"offset":0,"sortkeys":false,"ambig":false,"rendered":false,"disambig":false,"ref":Item,"newItem":true};this.registry[item]=newitem;if(this.citationreg.citationsByItemId&&this.citationreg.citationsByItemId[item]){this.registry[item]["first-reference-note-number"]=this.citationreg.citationsByItemId[item][0].properties.noteIndex;}abase=CSL.getAmbigConfig.call(this.state);this.registerAmbigToken(akey,item,abase);this.touched[item]=true;this.return_data.bibchange=true;}}};CSL.Registry.prototype.rebuildlist=function(nosort){var count,len,pos,item,Item;if(!nosort){this.reflist_inserts=[];len=this.mylist.length;for(pos=0;pos<len;pos+=1){item=this.mylist[pos];Item=this.registry[item];if(Item.newItem){this.reflist_inserts.push(Item);}this.oldseq[item]=this.registry[item].seq;this.registry[item].seq=pos+1;}}else{this.reflist=[];len=this.mylist.length;for(pos=0;pos<len;pos+=1){item=this.mylist[pos];Item=this.registry[item];this.reflist.push(Item);this.oldseq[item]=this.registry[item].seq;this.registry[item].seq=pos+1;}}};CSL.Registry.prototype.dorefreshes=function(){var key,regtoken,Item,old_akey,akey,abase;for(var key in this.refreshes){regtoken=this.registry[key];if(!regtoken){continue;}regtoken.sortkeys=undefined;Item=this.state.retrieveItem(key);var akey=regtoken.ambig;if("undefined"===typeof akey){this.state.tmp.disambig_settings=false;akey=CSL.getAmbiguousCite.call(this.state,Item);abase=CSL.getAmbigConfig.call(this.state);this.registerAmbigToken(akey,key,abase);}for(var akkey in this.ambigresets){if(this.ambigresets[akkey]===1){var loneKey=this.ambigcites[akey][0];var Item=this.state.retrieveItem(loneKey);this.registry[loneKey].disambig=new CSL.AmbigConfig();this.state.tmp.disambig_settings=false;var akey=CSL.getAmbiguousCite.call(this.state,Item);var abase=CSL.getAmbigConfig.call(this.state);this.registerAmbigToken(akey,loneKey,abase);}}this.state.tmp.taintedItemIDs[key]=true;this.ambigsTouched[akey]=true;if(!Item.legislation_id){this.akeys[akey]=true;}this.touched[key]=true;}};CSL.Registry.prototype.setdisambigs=function(){var akey,key,pos,len,id;for(akey in this.ambigsTouched){this.state.disambiguate.run(akey);}this.ambigsTouched={};this.akeys={};};CSL.Registry.prototype.renumber=function(){var len,pos,item;len=this.reflist.length;for(pos=0;pos<len;pos+=1){item=this.reflist[pos];item.seq=pos+1;if(this.state.opt.update_mode===CSL.NUMERIC&&item.seq!=this.oldseq[item.id]){this.state.tmp.taintedItemIDs[item.id]=true;}if(this.state.opt.bib_mode===CSL.NUMERIC&&item.seq!=this.oldseq[item.id]){this.return_data.bibchange=true;}}if(this.state.opt.citation_number_sort_direction===CSL.DESCENDING&&this.state.opt.citation_number_sort_used){this.reflist.reverse();}};CSL.Registry.prototype.setsortkeys=function(){var key;for(var i=0,ilen=this.mylist.length;i<ilen;i+=1){var key=this.mylist[i];if(this.touched[key]||this.state.tmp.taintedItemIDs[key]||!this.registry[key].sortkeys){this.registry[key].sortkeys=CSL.getSortKeys.call(this.state,this.state.retrieveItem(key),"bibliography_sort");}}};CSL.Registry.prototype._insertItem=function(element,array){array.splice(this._locationOf(element,array)+1,0,element);return array;};CSL.Registry.prototype._locationOf=function(element,array,start,end){if(array.length===0)return-1;start=start||0;end=end||array.length;var pivot=start+end>>1;var c=this.sorter.compareKeys(element,array[pivot]);if(end-start<=1)return c==-1?pivot-1:pivot;switch(c){case-1:return this._locationOf(element,array,start,pivot);case 0:return pivot;case 1:return this._locationOf(element,array,pivot,end);};};CSL.Registry.prototype.sorttokens=function(nosort){var len,item,Item,pos;if(!nosort){this.reflist_inserts=[];len=this.mylist.length;for(pos=0;pos<len;pos+=1){item=this.mylist[pos];Item=this.registry[item];if(Item.newItem){this.reflist_inserts.push(Item);}}for(var key in this.state.tmp.taintedItemIDs){if(this.registry[key]&&!this.registry[key].newItem){for(var i=this.reflist.length-1;i>-1;i--){if(this.reflist[i].id===key){this.reflist_inserts.push(this.reflist[i]);this.reflist=this.reflist.slice(0,i).concat(this.reflist.slice(i+1));}}}}for(var i=0,ilen=this.reflist_inserts.length;i<ilen;i++){var Item=this.reflist_inserts[i];delete Item.newItem;this.reflist=this._insertItem(Item,this.reflist);}for(pos=0;pos<len;pos+=1){item=this.mylist[pos];Item=this.registry[item];this.registry[item].seq=pos+1;}}};CSL.Registry.Comparifier=function(state,keyset){var sort_directions,len,pos,compareKeys;var sortCompare=CSL.getSortCompare(state.opt["default-locale-sort"]);sort_directions=state[keyset].opt.sort_directions;this.compareKeys=function(a,b){len=a.sortkeys?a.sortkeys.length:0;for(pos=0;pos<len;pos+=1){var cmp=0;if(a.sortkeys[pos]===b.sortkeys[pos]){cmp=0;}else if("undefined"===typeof a.sortkeys[pos]){cmp=sort_directions[pos][1];}else if("undefined"===typeof b.sortkeys[pos]){cmp=sort_directions[pos][0];}else{cmp=sortCompare(a.sortkeys[pos],b.sortkeys[pos]);}if(0<cmp){return sort_directions[pos][1];}else if(0>cmp){return sort_directions[pos][0];}}if(a.seq>b.seq){return 1;}else if(a.seq<b.seq){return-1;}return 0;};compareKeys=this.compareKeys;this.compareCompositeKeys=function(a,b){return compareKeys(a[1],b[1]);};};CSL.Registry.prototype.compareRegistryTokens=function(a,b){if(a.seq>b.seq){return 1;}else if(a.seq<b.seq){return-1;}return 0;};CSL.Registry.prototype.registerAmbigToken=function(akey,id,ambig_config){if(this.registry[id]&&this.registry[id].disambig&&this.registry[id].disambig.names){for(var i=0,ilen=ambig_config.names.length;i<ilen;i+=1){var new_names_params=ambig_config.names[i];var old_names_params=this.registry[id].disambig.names[i];if(new_names_params!==old_names_params){this.state.tmp.taintedItemIDs[id]=true;}else if(ambig_config.givens[i]){for(var j=0,jlen=ambig_config.givens[i].length;j<jlen;j+=1){var new_gnames_params=ambig_config.givens[i][j];var old_gnames_params=this.registry[id].disambig.givens[i][j];if(new_gnames_params!==old_gnames_params){this.state.tmp.taintedItemIDs[id]=true;}}}}}if(!this.ambigcites[akey]){this.ambigcites[akey]=[];}if(this.ambigcites[akey].indexOf(""+id)===-1){this.ambigcites[akey].push(""+id);}this.registry[id].ambig=akey;var dome=false;this.registry[id].disambig=CSL.cloneAmbigConfig(ambig_config);};CSL.getSortKeys=function(Item,key_type){var area,root,extension,strip_prepositions,use_parallels,len,pos;area=this.tmp.area;root=this.tmp.root;extension=this.tmp.extension;strip_prepositions=CSL.Util.Sort.strip_prepositions;this.tmp.area=key_type;this.tmp.root=key_type.indexOf("_")>-1?key_type.slice(0,-5):key_type;this.tmp.extension="_sort";this.tmp.disambig_override=true;this.tmp.disambig_request=false;this.parallel.use_parallels=this.parallel.use_parallels===true||this.parallel.use_parallels===null?null:false;this.tmp.suppress_decorations=true;CSL.getCite.call(this,Item);this.tmp.suppress_decorations=false;this.parallel.use_parallels=this.parallel.use_parallels===null?true:false;this.tmp.disambig_override=false;len=this[key_type].keys.length;for(pos=0;pos<len;pos+=1){this[key_type].keys[pos]=strip_prepositions(this[key_type].keys[pos]);}this.tmp.area=area;this.tmp.root=root;this.tmp.extension=extension;return this[key_type].keys;};module.exports=CSL;CSL.Registry.NameReg=function(state){var pkey,ikey,skey,floor,ceiling,dagopt,gdropt,ret,pos,items,strip_periods,set_keys,evalname,delitems,addname,key,myitems,i,ilen;this.state=state;this.namereg={};this.nameind={};this.nameindpkeys={};this.itemkeyreg={};strip_periods=function strip_periods(str){if(!str){str="";}return str.replace(/\./g," ").replace(/\s+/g," ").replace(/\s+$/,"");};set_keys=function set_keys(state,itemid,nameobj){pkey=strip_periods(nameobj.family);skey=strip_periods(nameobj.given);var m=skey.match(/[,\!]* ([^,]+)$/);if(m&&m[1]===m[1].toLowerCase()){skey=skey.replace(/[,\!]* [^,]+$/,"");}ikey=CSL.Util.Names.initializeWith(state,skey,"%s");if(state.citation.opt["givenname-disambiguation-rule"]==="by-cite"){pkey=""+itemid+pkey;}};evalname=function evalname(item_id,nameobj,namenum,request_base,form,initials){var pos,len,items,param;if(state.tmp.area.slice(0,12)==="bibliography"&&!form){if("string"===typeof initials){return 1;}else{return 2;}}var res=state.nameOutput.getName(nameobj,"locale-translit",true);nameobj=res.name;set_keys(this.state,""+item_id,nameobj);param=2;dagopt=state.opt["disambiguate-add-givenname"];gdropt=state.citation.opt["givenname-disambiguation-rule"];var gdropt_orig=gdropt;if(gdropt==="by-cite"){gdropt="all-names";}if("short"===form){param=0;}else if("string"===typeof initials){param=1;}if("undefined"===typeof this.namereg[pkey]||"undefined"===typeof this.namereg[pkey].ikey[ikey]){return param;}if(gdropt_orig==="by-cite"&¶m<=request_base){return request_base;}if(!dagopt){return param;}if("string"===typeof gdropt&&gdropt.slice(0,12)==="primary-name"&&namenum>0){return param;}if(!gdropt||gdropt==="all-names"||gdropt==="primary-name"){if(this.namereg[pkey].count>1){param=1;}if(this.namereg[pkey].ikey&&this.namereg[pkey].ikey[ikey].count>1||this.namereg[pkey].count>1&&"string"!==typeof initials){param=2;}}else if(gdropt==="all-names-with-initials"||gdropt==="primary-name-with-initials"){if(this.namereg[pkey].count>1){param=1;}else{param=0;}}if(!state.registry.registry[item_id]){if(form=="short"){return 0;}else if("string"==typeof initials){return 1;}}else{return param;}};delitems=function delitems(ids){var item,pos,len,posA,posB,id,fullkey,llen,ppos,otherid;if("string"===typeof ids||"number"===typeof ids){ids=[""+ids];}var ret={};len=ids.length;for(pos=0;pos<len;pos+=1){id=""+ids[pos];if(!this.nameind[id]){continue;}for(fullkey in this.nameind[id]){if(this.nameind[id].hasOwnProperty(fullkey)){var key=fullkey.split("::");pkey=key[0];ikey=key[1];skey=key[2];if("undefined"===typeof this.namereg[pkey]){continue;}items=this.namereg[pkey].items;if(skey&&this.namereg[pkey].ikey[ikey]&&this.namereg[pkey].ikey[ikey].skey[skey]){myitems=this.namereg[pkey].ikey[ikey].skey[skey].items;posB=myitems.indexOf(""+id);if(posB>-1){this.namereg[pkey].ikey[ikey].skey[skey].items=myitems.slice(0,posB).concat(myitems.slice([posB+1]));}if(this.namereg[pkey].ikey[ikey].skey[skey].items.length===0){delete this.namereg[pkey].ikey[ikey].skey[skey];this.namereg[pkey].ikey[ikey].count+=-1;if(this.namereg[pkey].ikey[ikey].count<2){for(var i=0,ilen=this.namereg[pkey].ikey[ikey].items.length;i<ilen;i+=1){state.tmp.taintedItemIDs[this.namereg[pkey].ikey[ikey].items[i]]=true;}}}}if(ikey&&this.namereg[pkey].ikey[ikey]){posB=this.namereg[pkey].ikey[ikey].items.indexOf(""+id);if(posB>-1){items=this.namereg[pkey].ikey[ikey].items.slice();this.namereg[pkey].ikey[ikey].items=items.slice(0,posB).concat(items.slice([posB+1]));}if(this.namereg[pkey].ikey[ikey].items.length===0){delete this.namereg[pkey].ikey[ikey];this.namereg[pkey].count+=-1;if(this.namereg[pkey].count<2){for(var i=0,ilen=this.namereg[pkey].items.length;i<ilen;i+=1){state.tmp.taintedItemIDs[this.namereg[pkey].items[i]]=true;}}}}if(pkey){posB=this.namereg[pkey].items.indexOf(""+id);if(posB>-1){items=this.namereg[pkey].items.slice();this.namereg[pkey].items=items.slice(0,posB).concat(items.slice([posB+1],items.length));}if(this.namereg[pkey].items.length<2){delete this.namereg[pkey];}}delete this.nameind[id][fullkey];}}delete this.nameind[id];delete this.nameindpkeys[id];}return ret;};addname=function addname(item_id,nameobj,pos){var i,ilen;var res=state.nameOutput.getName(nameobj,"locale-translit",true);nameobj=res.name;if(state.citation.opt["givenname-disambiguation-rule"]&&state.citation.opt["givenname-disambiguation-rule"].slice(0,8)==="primary-"&&pos!==0){return;}set_keys(this.state,""+item_id,nameobj);if(pkey){if("undefined"===typeof this.namereg[pkey]){this.namereg[pkey]={};this.namereg[pkey].count=0;this.namereg[pkey].ikey={};this.namereg[pkey].items=[item_id];}else if(this.namereg[pkey].items.indexOf(item_id)===-1){this.namereg[pkey].items.push(item_id);}}if(pkey&&ikey){if("undefined"===typeof this.namereg[pkey].ikey[ikey]){this.namereg[pkey].ikey[ikey]={};this.namereg[pkey].ikey[ikey].count=0;this.namereg[pkey].ikey[ikey].skey={};this.namereg[pkey].ikey[ikey].items=[item_id];this.namereg[pkey].count+=1;if(this.namereg[pkey].count===2){for(var i=0,ilen=this.namereg[pkey].items.length;i<ilen;i+=1){state.tmp.taintedItemIDs[this.namereg[pkey].items[i]]=true;}}}else if(this.namereg[pkey].ikey[ikey].items.indexOf(item_id)===-1){this.namereg[pkey].ikey[ikey].items.push(item_id);}}if(pkey&&ikey&&skey){if("undefined"===typeof this.namereg[pkey].ikey[ikey].skey[skey]){this.namereg[pkey].ikey[ikey].skey[skey]={};this.namereg[pkey].ikey[ikey].skey[skey].items=[item_id];this.namereg[pkey].ikey[ikey].count+=1;if(this.namereg[pkey].ikey[ikey].count===2){for(var i=0,ilen=this.namereg[pkey].ikey[ikey].items.length;i<ilen;i+=1){state.tmp.taintedItemIDs[this.namereg[pkey].ikey[ikey].items[i]]=true;}}}else if(this.namereg[pkey].ikey[ikey].skey[skey].items.indexOf(item_id)===-1){this.namereg[pkey].ikey[ikey].skey[skey].items.push(item_id);}}if("undefined"===typeof this.nameind[item_id]){this.nameind[item_id]={};this.nameindpkeys[item_id]={};}if(pkey){this.nameind[item_id][pkey+"::"+ikey+"::"+skey]=true;this.nameindpkeys[item_id][pkey]=this.namereg[pkey];}};this.addname=addname;this.delitems=delitems;this.evalname=evalname;};module.exports=CSL;CSL.Registry.CitationReg=function(state){this.citationById={};this.citationByIndex=[];};module.exports=CSL;CSL.Disambiguation=function(state){this.state=state;this.sys=this.state.sys;this.registry=state.registry.registry;this.ambigcites=state.registry.ambigcites;this.configModes();this.debug=false;};CSL.Disambiguation.prototype.run=function(akey){if(!this.modes.length){return;}this.akey=akey;if(this.initVars(akey)){this.runDisambig();}};CSL.Disambiguation.prototype.runDisambig=function(){var pos,len,ppos,llen,pppos,lllen,ismax;this.initGivens=true;while(this.lists.length){this.gnameset=0;this.gname=0;this.clashes=[1,0];while(this.lists[0][1].length){this.listpos=0;if(!this.base){this.base=this.lists[0][0];}var names_used=[];ismax=this.incrementDisambig();this.scanItems(this.lists[0]);this.evalScan(ismax);}this.lists=this.lists.slice(1);}};CSL.Disambiguation.prototype.scanItems=function(list){var pos,len,Item,otherItem,ItemCite,ignore,base;this.Item=list[1][0];this.ItemCite=CSL.getAmbiguousCite.call(this.state,this.Item,this.base,true);this.scanlist=list[1];this.partners=[];this.partners.push(this.Item);this.nonpartners=[];var clashes=0;for(var pos=1,len=list[1].length;pos<len;pos+=1){otherItem=list[1][pos];var otherItemCite=CSL.getAmbiguousCite.call(this.state,otherItem,this.base,true);if(this.ItemCite===otherItemCite){clashes+=1;this.partners.push(otherItem);}else{this.nonpartners.push(otherItem);}}this.clashes[0]=this.clashes[1];this.clashes[1]=clashes;};CSL.Disambiguation.prototype.evalScan=function(maxed){this[this.modes[this.modeindex]](maxed);if(maxed){if(this.modeindex<this.modes.length-1){this.modeindex+=1;}else{this.lists[this.listpos+1]=[this.base,[]];}}};CSL.Disambiguation.prototype.disNames=function(ismax){var pos,len,mybase,i,ilen;if(this.clashes[1]===0&&this.nonpartners.length===1){this.captureStepToBase();this.state.registry.registerAmbigToken(this.akey,""+this.nonpartners[0].id,this.betterbase);this.state.registry.registerAmbigToken(this.akey,""+this.partners[0].id,this.betterbase);this.lists[this.listpos]=[this.betterbase,[]];}else if(this.clashes[1]===0){this.captureStepToBase();this.state.registry.registerAmbigToken(this.akey,""+this.partners[0].id,this.betterbase);this.lists[this.listpos]=[this.betterbase,this.nonpartners];if(this.nonpartners.length){this.initGivens=true;}}else if(this.nonpartners.length===1){this.captureStepToBase();this.state.registry.registerAmbigToken(this.akey,""+this.nonpartners[0].id,this.betterbase);this.lists[this.listpos]=[this.betterbase,this.partners];}else if(this.clashes[1]<this.clashes[0]){this.captureStepToBase();this.lists[this.listpos]=[this.betterbase,this.partners];this.lists.push([this.betterbase,this.nonpartners]);}else{if(ismax){this.lists[this.listpos]=[this.betterbase,this.nonpartners];this.lists.push([this.betterbase,this.partners]);if(this.modeindex===this.modes.length-1){for(var i=0,ilen=this.partners.length;i<ilen;i+=1){this.state.registry.registerAmbigToken(this.akey,""+this.partners[i].id,this.betterbase);}this.lists[this.listpos]=[this.betterbase,[]];}}}};CSL.Disambiguation.prototype.disExtraText=function(){var pos,len,mybase;var done=false;if(this.clashes[1]===0&&this.nonpartners.length<2){done=true;}if(!done&&(!this.base.disambiguate||this.state.tmp.disambiguate_count!==this.state.tmp.disambiguate_maxMax)){this.modeindex=0;this.base.disambiguate=this.state.tmp.disambiguate_count;this.betterbase.disambiguate=this.state.tmp.disambiguate_count;if(!this.base.disambiguate){this.initGivens=true;this.base.disambiguate=1;for(var i=0,ilen=this.lists[this.listpos][1].length;i<ilen;i+=1){this.state.tmp.taintedItemIDs[this.lists[this.listpos][1][i].id]=true;}}else{this.disNames();}}else if(done||this.state.tmp.disambiguate_count===this.state.tmp.disambiguate_maxMax){if(done||this.modeindex===this.modes.length-1){var base=this.lists[this.listpos][0];for(var i=0,ilen=this.lists[this.listpos][1].length;i<ilen;i+=1){this.state.tmp.taintedItemIDs[this.lists[this.listpos][1][i].id]=true;this.state.registry.registerAmbigToken(this.akey,""+this.lists[this.listpos][1][i].id,base);}this.lists[this.listpos]=[this.betterbase,[]];}else{this.modeindex=this.modes.length-1;var base=this.lists[this.listpos][0];base.disambiguate=true;for(var i=0,ilen=this.lists[this.listpos][1].length;i<ilen;i+=1){this.state.tmp.taintedItemIDs[this.lists[this.listpos][1][i].id]=true;this.state.registry.registerAmbigToken(this.akey,""+this.lists[this.listpos][1][i].id,base);}}}};CSL.Disambiguation.prototype.disYears=function(){var pos,len,tokens,token,item;tokens=[];var base=this.lists[this.listpos][0];if(this.clashes[1]){for(var i=0,ilen=this.state.registry.mylist.length;i<ilen;i+=1){var origid=this.state.registry.mylist[i];for(var j=0,jlen=this.lists[this.listpos][1].length;j<jlen;j+=1){var token=this.lists[this.listpos][1][j];if(token.id==origid){tokens.push(this.registry[token.id]);break;}}}}tokens.sort(this.state.registry.sorter.compareKeys);for(var pos=0,len=tokens.length;pos<len;pos+=1){base.year_suffix=""+pos;var oldBase=this.state.registry.registry[tokens[pos].id].disambig;this.state.registry.registerAmbigToken(this.akey,""+tokens[pos].id,base);if(CSL.ambigConfigDiff(oldBase,base)){this.state.tmp.taintedItemIDs[tokens[pos].id]=true;}}this.lists[this.listpos]=[this.betterbase,[]];};CSL.Disambiguation.prototype.incrementDisambig=function(){var val;if(this.initGivens){this.initGivens=false;return false;}var maxed=false;var increment_names=true;var increment_givens=true;if("disNames"===this.modes[this.modeindex]){increment_names=false;if("number"!==typeof this.givensMax){increment_names=true;}var increment_namesets=false;if("number"!==typeof this.namesMax){increment_namesets=true;}if("number"===typeof this.givensMax){if(this.base.givens.length&&this.base.givens[this.gnameset][this.gname]<this.givensMax){this.base.givens[this.gnameset][this.gname]+=1;}else{increment_names=true;}}if("number"===typeof this.namesMax&&increment_names){if(this.state.opt["disambiguate-add-names"]){increment_namesets=false;if(this.gname<this.namesMax){this.base.names[this.gnameset]+=1;this.gname+=1;}else{increment_namesets=true;}}else{increment_namesets=true;}}if("number"===typeof this.namesetsMax&&increment_namesets){if(this.gnameset<this.namesetsMax){this.gnameset+=1;this.base.names[this.gnameset]=1;this.gname=0;}else{var increment_mode=true;}}if(("number"!==typeof this.namesetsMax||this.namesetsMax===-1||this.gnameset===this.namesetsMax)&&(!this.state.opt["disambiguate-add-names"]||"number"!==typeof this.namesMax||this.gname===this.namesMax)&&("number"!=typeof this.givensMax||"undefined"===typeof this.base.givens[this.gnameset]||"undefined"===typeof this.base.givens[this.gnameset][this.gname]||this.base.givens[this.gnameset][this.gname]===this.givensMax)){maxed=true;}}else if("disExtraText"===this.modes[this.modeindex]){this.base.disambiguate+=1;this.betterbase.disambiguate+=1;}return maxed;};CSL.Disambiguation.prototype.initVars=function(akey){var i,ilen,myIds,myItemBundles,myItems;this.lists=[];this.base=false;this.betterbase=false;this.akey=akey;this.maxNamesByItemId={};myItemBundles=[];myIds=this.ambigcites[akey];if(!myIds||!myIds.length){return false;}var Item=false;var myItem=this.state.retrieveItem(""+myIds[0]);this.getCiteData(myItem);this.base=CSL.getAmbigConfig.call(this.state);if(myIds&&myIds.length>1){myItemBundles.push([this.maxNamesByItemId[myItem.id],myItem]);for(var i=1,ilen=myIds.length;i<ilen;i+=1){myItem=this.state.retrieveItem(""+myIds[i]);this.getCiteData(myItem,this.base);myItemBundles.push([this.maxNamesByItemId[myItem.id],myItem]);}myItemBundles.sort(function(a,b){if(a[0]>b[0]){return 1;}else if(a[0]<b[0]){return-1;}else{if(a[1].id>b[1].id){return 1;}else if(a[1].id<b[1].id){return-1;}else{return 0;}}});myItems=[];for(var i=0,ilen=myItemBundles.length;i<ilen;i+=1){myItems.push(myItemBundles[i][1]);}this.lists.push([this.base,myItems]);this.Item=this.lists[0][1][0];}else{this.Item=this.state.retrieveItem(""+myIds[0]);}this.modeindex=0;if(this.state.citation.opt["disambiguate-add-names"]||true){this.namesMax=this.maxNamesByItemId[this.Item.id][0];}else{var namesMax=this.base.names[0];for(var i=1,ilen=this.base.names.length;i<ilen;i+=1){namesMax=Math.max(namesMax,this.base.names.names[i]);}}this.padBase(this.base);this.padBase(this.betterbase);this.base.year_suffix=false;this.base.disambiguate=false;this.betterbase.year_suffix=false;this.betterbase.disambiguate=false;if(this.state.citation.opt["givenname-disambiguation-rule"]==="by-cite"&&this.state.opt["disambiguate-add-givenname"]){this.givensMax=2;}return true;};CSL.Disambiguation.prototype.padBase=function(base){for(var i=0,ilen=base.names.length;i<ilen;i+=1){if(!base.givens[i]){base.givens[i]=[];}for(var j=0,jlen=base.names[i];j<jlen;j+=1){if(!base.givens[i][j]){base.givens[i][j]=0;}}}};CSL.Disambiguation.prototype.configModes=function(){var dagopt,gdropt;this.modes=[];dagopt=this.state.opt["disambiguate-add-givenname"];gdropt=this.state.citation.opt["givenname-disambiguation-rule"];if(this.state.opt['disambiguate-add-names']||dagopt&&gdropt==="by-cite"){this.modes.push("disNames");}if(this.state.opt.has_disambiguate){this.modes.push("disExtraText");}if(this.state.opt["disambiguate-add-year-suffix"]){this.modes.push("disYears");}};CSL.Disambiguation.prototype.getCiteData=function(Item,base){if(!this.maxNamesByItemId[Item.id]){CSL.getAmbiguousCite.call(this.state,Item,base);base=CSL.getAmbigConfig.call(this.state);this.maxNamesByItemId[Item.id]=CSL.getMaxVals.call(this.state);this.state.registry.registry[Item.id].disambig.givens=this.state.tmp.disambig_settings.givens.slice();for(var i=0,ilen=this.state.registry.registry[Item.id].disambig.givens.length;i<ilen;i+=1){this.state.registry.registry[Item.id].disambig.givens[i]=this.state.tmp.disambig_settings.givens[i].slice();}this.namesetsMax=this.state.registry.registry[Item.id].disambig.names.length-1;if(!this.base){this.base=base;this.betterbase=CSL.cloneAmbigConfig(base);}if(base.names.length<this.base.names.length){this.base=base;}var update=false;for(var i=0,ilen=base.names.length;i<ilen;i+=1){if(base.names[i]>this.base.names[i]){this.base.givens[i]=base.givens[i].slice();this.base.names[i]=base.names[i];this.betterbase.names=this.base.names.slice();this.betterbase.givens=this.base.givens.slice();this.padBase(this.base);this.padBase(this.betterbase);}}this.betterbase.givens=this.base.givens.slice();for(var j=0,jlen=this.base.givens.length;j<jlen;j+=1){this.betterbase.givens[j]=this.base.givens[j].slice();}}};CSL.Disambiguation.prototype.captureStepToBase=function(){if(this.state.citation.opt["givenname-disambiguation-rule"]==="by-cite"&&this.base.givens&&this.base.givens.length){if("undefined"!==typeof this.base.givens[this.gnameset][this.gname]){this.betterbase.givens[this.gnameset][this.gname]=this.base.givens[this.gnameset][this.gname];}}this.betterbase.names[this.gnameset]=this.base.names[this.gnameset];};module.exports=CSL;CSL.Engine.prototype.getJurisdictionList=function(jurisdiction){var jurisdictionList=[];var jurisdictionElems=jurisdiction.split(":");for(var j=jurisdictionElems.length;j>0;j--){jurisdictionList.push(jurisdictionElems.slice(0,j).join(":"));}if(jurisdictionList.indexOf("us")===-1){jurisdictionList.push("us");}return jurisdictionList;};CSL.Engine.prototype.retrieveAllStyleModules=function(jurisdictionList){var ret={};var preferences=this.locale[this.opt.lang].opts["jurisdiction-preference"];preferences=preferences?preferences:[];preferences=[""].concat(preferences);for(var i=preferences.length-1;i>-1;i--){var preference=preferences[i];for(var j=0,jlen=jurisdictionList.length;j<jlen;j++){var jurisdiction=jurisdictionList[j];if(this.opt.jurisdictions_seen[jurisdiction])continue;var res=this.sys.retrieveStyleModule(jurisdiction,preference);if(!res&&!preference||res){this.opt.jurisdictions_seen[jurisdiction]=true;}if(!res)continue;ret[jurisdiction]=res;}}return ret;};module.exports=CSL;CSL.ParticleList=function(){var always_dropping_1=[[[0,1],null]];var always_dropping_2=[[[0,2],null]];var always_dropping_3=[[[0,3],null]];var always_non_dropping_1=[[null,[0,1]]];var always_non_dropping_2=[[null,[0,2]]];var always_non_dropping_3=[[null,[0,3]]];var either_1=[[null,[0,1]],[[0,1],null]];var either_2=[[null,[0,2]],[[0,2],null]];var either_1_dropping_best=[[[0,1],null],[null,[0,1]]];var either_2_dropping_best=[[[0,2],null],[null,[0,2]]];var either_3_dropping_best=[[[0,3],null],[null,[0,3]]];var non_dropping_2_alt_dropping_1_non_dropping_1=[[null,[0,2]],[[0,1],[1,2]]];var PARTICLES=[["'s",always_non_dropping_1],["'s-",always_non_dropping_1],["'t",always_non_dropping_1],["a",always_non_dropping_1],["aan 't",always_non_dropping_2],["aan de",always_non_dropping_2],["aan den",always_non_dropping_2],["aan der",always_non_dropping_2],["aan het",always_non_dropping_2],["aan t",always_non_dropping_2],["aan",always_non_dropping_1],["ad-",either_1],["adh-",either_1],["af",either_1],["al",either_1],["al-",either_1],["am de",always_non_dropping_2],["am",always_non_dropping_1],["an-",either_1],["ar-",either_1],["as-",either_1],["ash-",either_1],["at-",either_1],["ath-",either_1],["auf dem",either_2_dropping_best],["auf den",either_2_dropping_best],["auf der",either_2_dropping_best],["auf ter",always_non_dropping_2],["auf",either_1_dropping_best],["aus 'm",either_2_dropping_best],["aus dem",either_2_dropping_best],["aus den",either_2_dropping_best],["aus der",either_2_dropping_best],["aus m",either_2_dropping_best],["aus",either_1_dropping_best],["aus'm",either_2_dropping_best],["az-",either_1],["aÅ¡-",either_1],["aá¸-",either_1],["aá¸-",either_1],["aá¹£-",either_1],["aá¹-",either_1],["aṯ-",either_1],["aẓ-",either_1],["ben",always_non_dropping_1],["bij 't",always_non_dropping_2],["bij de",always_non_dropping_2],["bij den",always_non_dropping_2],["bij het",always_non_dropping_2],["bij t",always_non_dropping_2],["bij",always_non_dropping_1],["bin",always_non_dropping_1],["boven d",always_non_dropping_2],["boven d'",always_non_dropping_2],["d",always_non_dropping_1],["d'",either_1],["da",either_1],["dal",always_non_dropping_1],["dal'",always_non_dropping_1],["dall'",always_non_dropping_1],["dalla",always_non_dropping_1],["das",either_1],["de die le",always_non_dropping_3],["de die",always_non_dropping_2],["de l",always_non_dropping_2],["de l'",always_non_dropping_2],["de la",non_dropping_2_alt_dropping_1_non_dropping_1],["de las",non_dropping_2_alt_dropping_1_non_dropping_1],["de le",always_non_dropping_2],["de li",either_2],["de van der",always_non_dropping_3],["de",either_1],["de'",either_1],["deca",always_non_dropping_1],["degli",either_1],["dei",either_1],["del",either_1],["dela",always_dropping_1],["dell'",either_1],["della",either_1],["delle",either_1],["dello",either_1],["den",either_1],["der",either_1],["des",either_1],["di",either_1],["die le",always_non_dropping_2],["do",always_non_dropping_1],["don",always_non_dropping_1],["dos",either_1],["du",either_1],["ed-",either_1],["edh-",either_1],["el",either_1],["el-",either_1],["en-",either_1],["er-",either_1],["es-",either_1],["esh-",either_1],["et-",either_1],["eth-",either_1],["ez-",either_1],["eÅ¡-",either_1],["eá¸-",either_1],["eá¸-",either_1],["eá¹£-",either_1],["eá¹-",either_1],["eṯ-",either_1],["eẓ-",either_1],["het",always_non_dropping_1],["i",always_non_dropping_1],["il",always_dropping_1],["im",always_non_dropping_1],["in 't",always_non_dropping_2],["in de",always_non_dropping_2],["in den",always_non_dropping_2],["in der",either_2],["in het",always_non_dropping_2],["in t",always_non_dropping_2],["in",always_non_dropping_1],["l",always_non_dropping_1],["l'",always_non_dropping_1],["la",always_non_dropping_1],["las",always_non_dropping_1],["le",always_non_dropping_1],["les",either_1],["lo",either_1],["los",always_non_dropping_1],["lou",always_non_dropping_1],["of",always_non_dropping_1],["onder 't",always_non_dropping_2],["onder de",always_non_dropping_2],["onder den",always_non_dropping_2],["onder het",always_non_dropping_2],["onder t",always_non_dropping_2],["onder",always_non_dropping_1],["op 't",always_non_dropping_2],["op de",either_2],["op den",always_non_dropping_2],["op der",always_non_dropping_2],["op gen",always_non_dropping_2],["op het",always_non_dropping_2],["op t",always_non_dropping_2],["op ten",always_non_dropping_2],["op",always_non_dropping_1],["over 't",always_non_dropping_2],["over de",always_non_dropping_2],["over den",always_non_dropping_2],["over het",always_non_dropping_2],["over t",always_non_dropping_2],["over",always_non_dropping_1],["s",always_non_dropping_1],["s'",always_non_dropping_1],["sen",always_dropping_1],["t",always_non_dropping_1],["te",always_non_dropping_1],["ten",always_non_dropping_1],["ter",always_non_dropping_1],["tho",always_non_dropping_1],["thoe",always_non_dropping_1],["thor",always_non_dropping_1],["to",always_non_dropping_1],["toe",always_non_dropping_1],["tot",always_non_dropping_1],["uijt 't",always_non_dropping_2],["uijt de",always_non_dropping_2],["uijt den",always_non_dropping_2],["uijt te de",always_non_dropping_3],["uijt ten",always_non_dropping_2],["uijt",always_non_dropping_1],["uit 't",always_non_dropping_2],["uit de",always_non_dropping_2],["uit den",always_non_dropping_2],["uit het",always_non_dropping_2],["uit t",always_non_dropping_2],["uit te de",always_non_dropping_3],["uit ten",always_non_dropping_2],["uit",always_non_dropping_1],["unter",always_non_dropping_1],["v",always_non_dropping_1],["v.",always_non_dropping_1],["v.d.",always_non_dropping_1],["van 't",always_non_dropping_2],["van de l",always_non_dropping_3],["van de l'",always_non_dropping_3],["van de",always_non_dropping_2],["van de",always_non_dropping_2],["van den",always_non_dropping_2],["van der",always_non_dropping_2],["van gen",always_non_dropping_2],["van het",always_non_dropping_2],["van la",always_non_dropping_2],["van t",always_non_dropping_2],["van ter",always_non_dropping_2],["van van de",always_non_dropping_3],["van",either_1],["vander",always_non_dropping_1],["vd",always_non_dropping_1],["ver",always_non_dropping_1],["vom und zum",always_dropping_3],["vom",either_1],["von 't",always_non_dropping_2],["von dem",either_2_dropping_best],["von den",either_2_dropping_best],["von der",either_2_dropping_best],["von t",always_non_dropping_2],["von und zu",either_3_dropping_best],["von zu",either_2_dropping_best],["von",either_1_dropping_best],["voor 't",always_non_dropping_2],["voor de",always_non_dropping_2],["voor den",always_non_dropping_2],["voor in 't",always_non_dropping_3],["voor in t",always_non_dropping_3],["voor",always_non_dropping_1],["vor der",either_2_dropping_best],["vor",either_1_dropping_best],["z",always_dropping_1],["ze",always_dropping_1],["zu",either_1_dropping_best],["zum",either_1],["zur",either_1]];return PARTICLES;}();CSL.parseParticles=function(){function splitParticles(nameValue,firstNameFlag,caseOverride){var origNameValue=nameValue;nameValue=caseOverride?nameValue.toLowerCase():nameValue;var particleList=[];var apostrophe;var rex;var hasParticle;if(firstNameFlag){nameValue=nameValue.split("").reverse().join("");rex=CSL.PARTICLE_GIVEN_REGEXP;}else{rex=CSL.PARTICLE_FAMILY_REGEXP;}var m=nameValue.match(rex);while(m){var m1=firstNameFlag?m[1].split("").reverse().join(""):m[1];var firstChar=m?m1:false;var firstChar=firstChar?m1.replace(/^[-\'\u02bb\u2019\s]*(.).*$/,"$1"):false;hasParticle=firstChar?firstChar.toUpperCase()!==firstChar:false;if(!hasParticle)break;if(firstNameFlag){particleList.push(origNameValue.slice(m1.length*-1));origNameValue=origNameValue.slice(0,m1.length*-1);}else{particleList.push(origNameValue.slice(0,m1.length));origNameValue=origNameValue.slice(m1.length);}nameValue=m[2];m=nameValue.match(rex);}if(firstNameFlag){nameValue=nameValue.split("").reverse().join("");particleList.reverse();for(var i=1,ilen=particleList.length;i<ilen;i++){if(particleList[i].slice(0,1)==" "){particleList[i-1]+=" ";}}for(var i=0,ilen=particleList.length;i<ilen;i++){if(particleList[i].slice(0,1)==" "){particleList[i]=particleList[i].slice(1);}}nameValue=origNameValue.slice(0,nameValue.length);}else{nameValue=origNameValue.slice(nameValue.length*-1);}return[hasParticle,nameValue,particleList];}function trimLast(str){var lastChar=str.slice(-1);str=str.trim();if(lastChar===" "&&["\'","\u2019"].indexOf(str.slice(-1))>-1){str+=" ";}return str;}function parseSuffix(nameObj){if(!nameObj.suffix&&nameObj.given){var m=nameObj.given.match(/(\s*,!*\s*)/);if(m){var idx=nameObj.given.indexOf(m[1]);var possible_suffix=nameObj.given.slice(idx+m[1].length);var possible_comma=nameObj.given.slice(idx,idx+m[1].length).replace(/\s*/g,"");if(possible_suffix.replace(/\./g,"")==='et al'&&!nameObj["dropping-particle"]){nameObj["dropping-particle"]=possible_suffix;nameObj["comma-dropping-particle"]=",";}else{if(possible_comma.length===2){nameObj["comma-suffix"]=true;}nameObj.suffix=possible_suffix;}nameObj.given=nameObj.given.slice(0,idx);}}}return function(nameObj){var res=splitParticles(nameObj.family);var hasLastParticle=res[0];var lastNameValue=res[1];var lastParticleList=res[2];nameObj.family=lastNameValue;var nonDroppingParticle=trimLast(lastParticleList.join(""));if(nonDroppingParticle){nameObj['non-dropping-particle']=nonDroppingParticle;}parseSuffix(nameObj);var res=splitParticles(nameObj.given,true);var hasFirstParticle=res[0];var firstNameValue=res[1];var firstParticleList=res[2];nameObj.given=firstNameValue;var droppingParticle=firstParticleList.join("").trim();if(droppingParticle){nameObj['dropping-particle']=droppingParticle;}};}();module.exports=CSL; },{}],283:[function(citationRequire,module,exports){ "use strict"; function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var Response = function () { function Response(statusCode, headers, body, url) { if (typeof statusCode !== 'number') { throw new TypeError('statusCode must be a number but was ' + _typeof(statusCode)); } if (headers === null) { throw new TypeError('headers cannot be null'); } if (_typeof(headers) !== 'object') { throw new TypeError('headers must be an object but was ' + _typeof(headers)); } this.statusCode = statusCode; var headersToLowerCase = {}; for (var key in headers) { headersToLowerCase[key.toLowerCase()] = headers[key]; } this.headers = headersToLowerCase; this.body = body; this.url = url; } Response.prototype.isError = function () { return this.statusCode === 0 || this.statusCode >= 400; }; Response.prototype.getBody = function (encoding) { if (this.statusCode === 0) { var err = new Error('This request to ' + this.url + ' resulted in a status code of 0. This usually indicates some kind of network error in a browser (e.g. CORS not being set up or the DNS failing to resolve):\n' + this.body.toString()); err.statusCode = this.statusCode; err.headers = this.headers; err.body = this.body; err.url = this.url; throw err; } if (this.statusCode >= 300) { var err = new Error('Server responded to ' + this.url + ' with status code ' + this.statusCode + ':\n' + this.body.toString()); err.statusCode = this.statusCode; err.headers = this.headers; err.body = this.body; err.url = this.url; throw err; } if (!encoding || typeof this.body === 'string') { return this.body; } return this.body.toString(encoding); }; return Response; }(); module.exports = Response; },{}],284:[function(citationRequire,module,exports){ "use strict"; citationRequire('whatwg-fetch'); module.exports = self.fetch.bind(self); },{"whatwg-fetch":285}],285:[function(citationRequire,module,exports){ "use strict"; (function (self) { 'use strict'; if (self.fetch) { return; } var support = { searchParams: 'URLSearchParams' in self, iterable: 'Symbol' in self && 'iterator' in Symbol, blob: 'FileReader' in self && 'Blob' in self && function () { try { new Blob(); return true; } catch (e) { return false; } }(), formData: 'FormData' in self, arrayBuffer: 'ArrayBuffer' in self }; if (support.arrayBuffer) { var viewClasses = ['[object Int8Array]', '[object Uint8Array]', '[object Uint8ClampedArray]', '[object Int16Array]', '[object Uint16Array]', '[object Int32Array]', '[object Uint32Array]', '[object Float32Array]', '[object Float64Array]']; var isDataView = function isDataView(obj) { return obj && DataView.prototype.isPrototypeOf(obj); }; var isArrayBufferView = ArrayBuffer.isView || function (obj) { return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1; }; } function normalizeName(name) { if (typeof name !== 'string') { name = String(name); } if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) { throw new TypeError('Invalid character in header field name'); } return name.toLowerCase(); } function normalizeValue(value) { if (typeof value !== 'string') { value = String(value); } return value; } function iteratorFor(items) { var iterator = { next: function next() { var value = items.shift(); return { done: value === undefined, value: value }; } }; if (support.iterable) { iterator[Symbol.iterator] = function () { return iterator; }; } return iterator; } function Headers(headers) { this.map = {}; if (headers instanceof Headers) { headers.forEach(function (value, name) { this.append(name, value); }, this); } else if (Array.isArray(headers)) { headers.forEach(function (header) { this.append(header[0], header[1]); }, this); } else if (headers) { Object.getOwnPropertyNames(headers).forEach(function (name) { this.append(name, headers[name]); }, this); } } Headers.prototype.append = function (name, value) { name = normalizeName(name); value = normalizeValue(value); var oldValue = this.map[name]; this.map[name] = oldValue ? oldValue + ',' + value : value; }; Headers.prototype['delete'] = function (name) { delete this.map[normalizeName(name)]; }; Headers.prototype.get = function (name) { name = normalizeName(name); return this.has(name) ? this.map[name] : null; }; Headers.prototype.has = function (name) { return this.map.hasOwnProperty(normalizeName(name)); }; Headers.prototype.set = function (name, value) { this.map[normalizeName(name)] = normalizeValue(value); }; Headers.prototype.forEach = function (callback, thisArg) { for (var name in this.map) { if (this.map.hasOwnProperty(name)) { callback.call(thisArg, this.map[name], name, this); } } }; Headers.prototype.keys = function () { var items = []; this.forEach(function (value, name) { items.push(name); }); return iteratorFor(items); }; Headers.prototype.values = function () { var items = []; this.forEach(function (value) { items.push(value); }); return iteratorFor(items); }; Headers.prototype.entries = function () { var items = []; this.forEach(function (value, name) { items.push([name, value]); }); return iteratorFor(items); }; if (support.iterable) { Headers.prototype[Symbol.iterator] = Headers.prototype.entries; } function consumed(body) { if (body.bodyUsed) { return Promise.reject(new TypeError('Already read')); } body.bodyUsed = true; } function fileReaderReady(reader) { return new Promise(function (resolve, reject) { reader.onload = function () { resolve(reader.result); }; reader.onerror = function () { reject(reader.error); }; }); } function readBlobAsArrayBuffer(blob) { var reader = new FileReader(); var promise = fileReaderReady(reader); reader.readAsArrayBuffer(blob); return promise; } function readBlobAsText(blob) { var reader = new FileReader(); var promise = fileReaderReady(reader); reader.readAsText(blob); return promise; } function readArrayBufferAsText(buf) { var view = new Uint8Array(buf); var chars = new Array(view.length); for (var i = 0; i < view.length; i++) { chars[i] = String.fromCharCode(view[i]); } return chars.join(''); } function bufferClone(buf) { if (buf.slice) { return buf.slice(0); } else { var view = new Uint8Array(buf.byteLength); view.set(new Uint8Array(buf)); return view.buffer; } } function Body() { this.bodyUsed = false; this._initBody = function (body) { this._bodyInit = body; if (!body) { this._bodyText = ''; } else if (typeof body === 'string') { this._bodyText = body; } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { this._bodyBlob = body; } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { this._bodyFormData = body; } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { this._bodyText = body.toString(); } else if (support.arrayBuffer && support.blob && isDataView(body)) { this._bodyArrayBuffer = bufferClone(body.buffer); this._bodyInit = new Blob([this._bodyArrayBuffer]); } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) { this._bodyArrayBuffer = bufferClone(body); } else { throw new Error('unsupported BodyInit type'); } if (!this.headers.get('content-type')) { if (typeof body === 'string') { this.headers.set('content-type', 'text/plain;charset=UTF-8'); } else if (this._bodyBlob && this._bodyBlob.type) { this.headers.set('content-type', this._bodyBlob.type); } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); } } }; if (support.blob) { this.blob = function () { var rejected = consumed(this); if (rejected) { return rejected; } if (this._bodyBlob) { return Promise.resolve(this._bodyBlob); } else if (this._bodyArrayBuffer) { return Promise.resolve(new Blob([this._bodyArrayBuffer])); } else if (this._bodyFormData) { throw new Error('could not read FormData body as blob'); } else { return Promise.resolve(new Blob([this._bodyText])); } }; this.arrayBuffer = function () { if (this._bodyArrayBuffer) { return consumed(this) || Promise.resolve(this._bodyArrayBuffer); } else { return this.blob().then(readBlobAsArrayBuffer); } }; } this.text = function () { var rejected = consumed(this); if (rejected) { return rejected; } if (this._bodyBlob) { return readBlobAsText(this._bodyBlob); } else if (this._bodyArrayBuffer) { return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)); } else if (this._bodyFormData) { throw new Error('could not read FormData body as text'); } else { return Promise.resolve(this._bodyText); } }; if (support.formData) { this.formData = function () { return this.text().then(decode); }; } this.json = function () { return this.text().then(JSON.parse); }; return this; } var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']; function normalizeMethod(method) { var upcased = method.toUpperCase(); return methods.indexOf(upcased) > -1 ? upcased : method; } function Request(input, options) { options = options || {}; var body = options.body; if (input instanceof Request) { if (input.bodyUsed) { throw new TypeError('Already read'); } this.url = input.url; this.credentials = input.credentials; if (!options.headers) { this.headers = new Headers(input.headers); } this.method = input.method; this.mode = input.mode; if (!body && input._bodyInit != null) { body = input._bodyInit; input.bodyUsed = true; } } else { this.url = String(input); } this.credentials = options.credentials || this.credentials || 'omit'; if (options.headers || !this.headers) { this.headers = new Headers(options.headers); } this.method = normalizeMethod(options.method || this.method || 'GET'); this.mode = options.mode || this.mode || null; this.referrer = null; if ((this.method === 'GET' || this.method === 'HEAD') && body) { throw new TypeError('Body not allowed for GET or HEAD requests'); } this._initBody(body); } Request.prototype.clone = function () { return new Request(this, { body: this._bodyInit }); }; function decode(body) { var form = new FormData(); body.trim().split('&').forEach(function (bytes) { if (bytes) { var split = bytes.split('='); var name = split.shift().replace(/\+/g, ' '); var value = split.join('=').replace(/\+/g, ' '); form.append(decodeURIComponent(name), decodeURIComponent(value)); } }); return form; } function parseHeaders(rawHeaders) { var headers = new Headers(); rawHeaders.split(/\r?\n/).forEach(function (line) { var parts = line.split(':'); var key = parts.shift().trim(); if (key) { var value = parts.join(':').trim(); headers.append(key, value); } }); return headers; } Body.call(Request.prototype); function Response(bodyInit, options) { if (!options) { options = {}; } this.type = 'default'; this.status = 'status' in options ? options.status : 200; this.ok = this.status >= 200 && this.status < 300; this.statusText = 'statusText' in options ? options.statusText : 'OK'; this.headers = new Headers(options.headers); this.url = options.url || ''; this._initBody(bodyInit); } Body.call(Response.prototype); Response.prototype.clone = function () { return new Response(this._bodyInit, { status: this.status, statusText: this.statusText, headers: new Headers(this.headers), url: this.url }); }; Response.error = function () { var response = new Response(null, { status: 0, statusText: '' }); response.type = 'error'; return response; }; var redirectStatuses = [301, 302, 303, 307, 308]; Response.redirect = function (url, status) { if (redirectStatuses.indexOf(status) === -1) { throw new RangeError('Invalid status code'); } return new Response(null, { status: status, headers: { location: url } }); }; self.Headers = Headers; self.Request = Request; self.Response = Response; self.fetch = function (input, init) { return new Promise(function (resolve, reject) { var request = new Request(input, init); var xhr = new XMLHttpRequest(); xhr.onload = function () { var options = { status: xhr.status, statusText: xhr.statusText, headers: parseHeaders(xhr.getAllResponseHeaders() || '') }; options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL'); var body = 'response' in xhr ? xhr.response : xhr.responseText; resolve(new Response(body, options)); }; xhr.onerror = function () { reject(new TypeError('Network request failed')); }; xhr.ontimeout = function () { reject(new TypeError('Network request failed')); }; xhr.open(request.method, request.url, true); if (request.credentials === 'include') { xhr.withCredentials = true; } if ('responseType' in xhr && support.blob) { xhr.responseType = 'blob'; } request.headers.forEach(function (value, name) { xhr.setRequestHeader(name, value); }); xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit); }); }; self.fetch.polyfill = true; })(typeof self !== 'undefined' ? self : void 0); },{}],286:[function(citationRequire,module,exports){ "use strict"; var process = module.exports = {}; var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout() { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } })(); function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { return setTimeout(fun, 0); } if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { return cachedSetTimeout(fun, 0); } catch (e) { try { return cachedSetTimeout.call(null, fun, 0); } catch (e) { return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { return clearTimeout(marker); } if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { return cachedClearTimeout(marker); } catch (e) { try { return cachedClearTimeout.call(null, marker); } catch (e) { return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while (len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return []; }; process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/'; }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function () { return 0; }; },{}],287:[function(citationRequire,module,exports){ 'use strict'; function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } module.exports = function (qs, sep, eq, options) { sep = sep || '&'; eq = eq || '='; var obj = {}; if (typeof qs !== 'string' || qs.length === 0) { return obj; } var regexp = /\+/g; qs = qs.split(sep); var maxKeys = 1000; if (options && typeof options.maxKeys === 'number') { maxKeys = options.maxKeys; } var len = qs.length; if (maxKeys > 0 && len > maxKeys) { len = maxKeys; } for (var i = 0; i < len; ++i) { var x = qs[i].replace(regexp, '%20'), idx = x.indexOf(eq), kstr, vstr, k, v; if (idx >= 0) { kstr = x.substr(0, idx); vstr = x.substr(idx + 1); } else { kstr = x; vstr = ''; } k = decodeURIComponent(kstr); v = decodeURIComponent(vstr); if (!hasOwnProperty(obj, k)) { obj[k] = v; } else if (isArray(obj[k])) { obj[k].push(v); } else { obj[k] = [obj[k], v]; } } return obj; }; var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; },{}],288:[function(citationRequire,module,exports){ 'use strict'; function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var stringifyPrimitive = function stringifyPrimitive(v) { switch (_typeof(v)) { case 'string': return v; case 'boolean': return v ? 'true' : 'false'; case 'number': return isFinite(v) ? v : ''; default: return ''; } }; module.exports = function (obj, sep, eq, name) { sep = sep || '&'; eq = eq || '='; if (obj === null) { obj = undefined; } if (_typeof(obj) === 'object') { return map(objectKeys(obj), function (k) { var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; if (isArray(obj[k])) { return map(obj[k], function (v) { return ks + encodeURIComponent(stringifyPrimitive(v)); }).join(sep); } else { return ks + encodeURIComponent(stringifyPrimitive(obj[k])); } }).join(sep); } if (!name) return ''; return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj)); }; var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; function map(xs, f) { if (xs.map) return xs.map(f); var res = []; for (var i = 0; i < xs.length; i++) { res.push(f(xs[i], i)); } return res; } var objectKeys = Object.keys || function (obj) { var res = []; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); } return res; }; },{}],289:[function(citationRequire,module,exports){ 'use strict'; exports.decode = exports.parse = citationRequire('./decode'); exports.encode = exports.stringify = citationRequire('./encode'); },{"./decode":287,"./encode":288}],290:[function(citationRequire,module,exports){ "use strict"; function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } !function (global) { "use strict"; var Op = Object.prototype; var hasOwn = Op.hasOwnProperty; var undefined; var $Symbol = typeof Symbol === "function" ? Symbol : {}; var iteratorSymbol = $Symbol.iterator || "@@iterator"; var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; var inModule = (typeof module === "undefined" ? "undefined" : _typeof(module)) === "object"; var runtime = global.regeneratorRuntime; if (runtime) { if (inModule) { module.exports = runtime; } return; } runtime = global.regeneratorRuntime = inModule ? module.exports : {}; function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; var generator = Object.create(protoGenerator.prototype); var context = new Context(tryLocsList || []); generator._invoke = makeInvokeMethod(innerFn, self, context); return generator; } runtime.wrap = wrap; function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } var GenStateSuspendedStart = "suspendedStart"; var GenStateSuspendedYield = "suspendedYield"; var GenStateExecuting = "executing"; var GenStateCompleted = "completed"; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; IteratorPrototype[iteratorSymbol] = function () { return this; }; var getProto = Object.getPrototypeOf; var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { IteratorPrototype = NativeIteratorPrototype; } var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; GeneratorFunctionPrototype.constructor = GeneratorFunction; GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction"; function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { prototype[method] = function (arg) { return this._invoke(method, arg); }; }); } runtime.isGeneratorFunction = function (genFun) { var ctor = typeof genFun === "function" && genFun.constructor; return ctor ? ctor === GeneratorFunction || (ctor.displayName || ctor.name) === "GeneratorFunction" : false; }; runtime.mark = function (genFun) { if (Object.setPrototypeOf) { Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); } else { genFun.__proto__ = GeneratorFunctionPrototype; if (!(toStringTagSymbol in genFun)) { genFun[toStringTagSymbol] = "GeneratorFunction"; } } genFun.prototype = Object.create(Gp); return genFun; }; runtime.awrap = function (arg) { return { __await: arg }; }; function AsyncIterator(generator) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (record.type === "throw") { reject(record.arg); } else { var result = record.arg; var value = result.value; if (value && _typeof(value) === "object" && hasOwn.call(value, "__await")) { return Promise.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }); } return Promise.resolve(value).then(function (unwrapped) { result.value = unwrapped; resolve(result); }, reject); } } var previousPromise; function enqueue(method, arg) { function callInvokeWithMethodAndArg() { return new Promise(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } this._invoke = enqueue; } defineIteratorMethods(AsyncIterator.prototype); AsyncIterator.prototype[asyncIteratorSymbol] = function () { return this; }; runtime.AsyncIterator = AsyncIterator; runtime.async = function (innerFn, outerFn, self, tryLocsList) { var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList)); return runtime.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }; function makeInvokeMethod(innerFn, self, context) { var state = GenStateSuspendedStart; return function invoke(method, arg) { if (state === GenStateExecuting) { throw new Error("Generator is already running"); } if (state === GenStateCompleted) { if (method === "throw") { throw arg; } return doneResult(); } context.method = method; context.arg = arg; while (true) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (context.method === "next") { context.sent = context._sent = context.arg; } else if (context.method === "throw") { if (state === GenStateSuspendedStart) { state = GenStateCompleted; throw context.arg; } context.dispatchException(context.arg); } else if (context.method === "return") { context.abrupt("return", context.arg); } state = GenStateExecuting; var record = tryCatch(innerFn, self, context); if (record.type === "normal") { state = context.done ? GenStateCompleted : GenStateSuspendedYield; if (record.arg === ContinueSentinel) { continue; } return { value: record.arg, done: context.done }; } else if (record.type === "throw") { state = GenStateCompleted; context.method = "throw"; context.arg = record.arg; } } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (method === undefined) { context.delegate = null; if (context.method === "throw") { if (delegate.iterator.return) { context.method = "return"; context.arg = undefined; maybeInvokeDelegate(delegate, context); if (context.method === "throw") { return ContinueSentinel; } } context.method = "throw"; context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (record.type === "throw") { context.method = "throw"; context.arg = record.arg; context.delegate = null; return ContinueSentinel; } var info = record.arg; if (!info) { context.method = "throw"; context.arg = new TypeError("iterator result is not an object"); context.delegate = null; return ContinueSentinel; } if (info.done) { context[delegate.resultName] = info.value; context.next = delegate.nextLoc; if (context.method !== "return") { context.method = "next"; context.arg = undefined; } } else { return info; } context.delegate = null; return ContinueSentinel; } defineIteratorMethods(Gp); Gp[toStringTagSymbol] = "Generator"; Gp[iteratorSymbol] = function () { return this; }; Gp.toString = function () { return "[object Generator]"; }; function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; if (1 in locs) { entry.catchLoc = locs[1]; } if (2 in locs) { entry.finallyLoc = locs[2]; entry.afterLoc = locs[3]; } this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal"; delete record.arg; entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }]; tryLocsList.forEach(pushTryEntry, this); this.reset(true); } runtime.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } keys.reverse(); return function next() { while (keys.length) { var key = keys.pop(); if (key in object) { next.value = key; next.done = false; return next; } } next.done = true; return next; }; }; function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) { return iteratorMethod.call(iterable); } if (typeof iterable.next === "function") { return iterable; } if (!isNaN(iterable.length)) { var i = -1, next = function next() { while (++i < iterable.length) { if (hasOwn.call(iterable, i)) { next.value = iterable[i]; next.done = false; return next; } } next.value = undefined; next.done = true; return next; }; return next.next = next; } } return { next: doneResult }; } runtime.values = values; function doneResult() { return { value: undefined, done: true }; } Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { this.prev = 0; this.next = 0; this.sent = this._sent = undefined; this.done = false; this.delegate = null; this.method = "next"; this.arg = undefined; this.tryEntries.forEach(resetTryEntry); if (!skipTempReset) { for (var name in this) { if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { this[name] = undefined; } } } }, stop: function stop() { this.done = true; var rootEntry = this.tryEntries[0]; var rootRecord = rootEntry.completion; if (rootRecord.type === "throw") { throw rootRecord.arg; } return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) { throw exception; } var context = this; function handle(loc, caught) { record.type = "throw"; record.arg = exception; context.next = loc; if (caught) { context.method = "next"; context.arg = undefined; } return !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; var record = entry.completion; if (entry.tryLoc === "root") { return handle("end"); } if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"); var hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } else if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else if (hasCatch) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } } else if (hasFinally) { if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else { throw new Error("try statement without catch or finally"); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { finallyEntry = null; } var record = finallyEntry ? finallyEntry.completion : {}; record.type = type; record.arg = arg; if (finallyEntry) { this.method = "next"; this.next = finallyEntry.finallyLoc; return ContinueSentinel; } return this.complete(record); }, complete: function complete(record, afterLoc) { if (record.type === "throw") { throw record.arg; } if (record.type === "break" || record.type === "continue") { this.next = record.arg; } else if (record.type === "return") { this.rval = this.arg = record.arg; this.method = "return"; this.next = "end"; } else if (record.type === "normal" && afterLoc) { this.next = afterLoc; } return ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) { this.complete(entry.completion, entry.afterLoc); resetTryEntry(entry); return ContinueSentinel; } } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (record.type === "throw") { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }; if (this.method === "next") { this.arg = undefined; } return ContinueSentinel; } }; }(function () { return this; }() || Function("return this")()); },{}],291:[function(citationRequire,module,exports){ "use strict"; function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } exports.__esModule = true; var handle_qs_js_1 = citationRequire("then-request/lib/handle-qs.js"); var GenericResponse = citationRequire("http-response-object"); var fd = FormData; exports.FormData = fd; function doRequest(method, url, options) { var xhr = new XMLHttpRequest(); if (typeof method !== 'string') { throw new TypeError('The method must be a string.'); } if (url && _typeof(url) === 'object') { url = url.href; } if (typeof url !== 'string') { throw new TypeError('The URL/path must be a string.'); } if (options === null || options === undefined) { options = {}; } if (_typeof(options) !== 'object') { throw new TypeError('Options must be an object (or null).'); } method = method.toUpperCase(); options.headers = options.headers || {}; var match; var crossDomain = !!((match = /^([\w-]+:)?\/\/([^\/]+)/.exec(url)) && match[2] != location.host); if (!crossDomain) options.headers['X-Requested-With'] = 'XMLHttpRequest'; if (options.qs) { url = handle_qs_js_1["default"](url, options.qs); } if (options.json) { options.body = JSON.stringify(options.json); options.headers['content-type'] = 'application/json'; } if (options.form) { options.body = options.form; } xhr.open(method, url, false); for (var name in options.headers) { xhr.setRequestHeader(name.toLowerCase(), '' + options.headers[name]); } xhr.send(options.body ? options.body : null); var headers = {}; xhr.getAllResponseHeaders().split('\r\n').forEach(function (header) { var h = header.split(':'); if (h.length > 1) { headers[h[0].toLowerCase()] = h.slice(1).join(':').trim(); } }); return new GenericResponse(xhr.status, headers, xhr.responseText, url); } exports["default"] = doRequest; module.exports = doRequest; module.exports["default"] = doRequest; module.exports.FormData = fd; },{"http-response-object":283,"then-request/lib/handle-qs.js":292}],292:[function(citationRequire,module,exports){ "use strict"; exports.__esModule = true; var qs_1 = citationRequire("qs"); function handleQs(url, query) { var _a = url.split('?'), start = _a[0], part2 = _a[1]; var qs = (part2 || '').split('#')[0]; var end = part2 && part2.split('#').length > 1 ? '#' + part2.split('#')[1] : ''; var baseQs = qs_1.parse(qs); for (var i in query) { baseQs[i] = query[i]; } qs = qs_1.stringify(baseQs); if (qs !== '') { qs = '?' + qs; } return start + qs + end; } exports["default"] = handleQs; },{"qs":294}],293:[function(citationRequire,module,exports){ 'use strict'; var replace = String.prototype.replace; var percentTwenties = /%20/g; module.exports = { 'default': 'RFC3986', formatters: { RFC1738: function RFC1738(value) { return replace.call(value, percentTwenties, '+'); }, RFC3986: function RFC3986(value) { return value; } }, RFC1738: 'RFC1738', RFC3986: 'RFC3986' }; },{}],294:[function(citationRequire,module,exports){ 'use strict'; var stringify = citationRequire('./stringify'); var parse = citationRequire('./parse'); var formats = citationRequire('./formats'); module.exports = { formats: formats, parse: parse, stringify: stringify }; },{"./formats":293,"./parse":295,"./stringify":296}],295:[function(citationRequire,module,exports){ 'use strict'; var utils = citationRequire('./utils'); var has = Object.prototype.hasOwnProperty; var defaults = { allowDots: false, allowPrototypes: false, arrayLimit: 20, decoder: utils.decode, delimiter: '&', depth: 5, parameterLimit: 1000, plainObjects: false, strictNullHandling: false }; var parseValues = function parseQueryStringValues(str, options) { var obj = {}; var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; var parts = cleanStr.split(options.delimiter, limit); for (var i = 0; i < parts.length; ++i) { var part = parts[i]; var bracketEqualsPos = part.indexOf(']='); var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; var key, val; if (pos === -1) { key = options.decoder(part, defaults.decoder); val = options.strictNullHandling ? null : ''; } else { key = options.decoder(part.slice(0, pos), defaults.decoder); val = options.decoder(part.slice(pos + 1), defaults.decoder); } if (has.call(obj, key)) { obj[key] = [].concat(obj[key]).concat(val); } else { obj[key] = val; } } return obj; }; var parseObject = function parseObject(chain, val, options) { var leaf = val; for (var i = chain.length - 1; i >= 0; --i) { var obj; var root = chain[i]; if (root === '[]') { obj = []; obj = obj.concat(leaf); } else { obj = options.plainObjects ? Object.create(null) : {}; var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; var index = parseInt(cleanRoot, 10); if (!isNaN(index) && root !== cleanRoot && String(index) === cleanRoot && index >= 0 && options.parseArrays && index <= options.arrayLimit) { obj = []; obj[index] = leaf; } else { obj[cleanRoot] = leaf; } } leaf = obj; } return leaf; }; var parseKeys = function parseQueryStringKeys(givenKey, val, options) { if (!givenKey) { return; } var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; var brackets = /(\[[^[\]]*])/; var child = /(\[[^[\]]*])/g; var segment = brackets.exec(key); var parent = segment ? key.slice(0, segment.index) : key; var keys = []; if (parent) { if (!options.plainObjects && has.call(Object.prototype, parent)) { if (!options.allowPrototypes) { return; } } keys.push(parent); } var i = 0; while ((segment = child.exec(key)) !== null && i < options.depth) { i += 1; if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { if (!options.allowPrototypes) { return; } } keys.push(segment[1]); } if (segment) { keys.push('[' + key.slice(segment.index) + ']'); } return parseObject(keys, val, options); }; module.exports = function (str, opts) { var options = opts ? utils.assign({}, opts) : {}; if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') { throw new TypeError('Decoder has to be a function.'); } options.ignoreQueryPrefix = options.ignoreQueryPrefix === true; options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter; options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth; options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit; options.parseArrays = options.parseArrays !== false; options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder; options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots; options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects; options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes; options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit; options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; if (str === '' || str === null || typeof str === 'undefined') { return options.plainObjects ? Object.create(null) : {}; } var tempObj = typeof str === 'string' ? parseValues(str, options) : str; var obj = options.plainObjects ? Object.create(null) : {}; var keys = Object.keys(tempObj); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; var newObj = parseKeys(key, tempObj[key], options); obj = utils.merge(obj, newObj, options); } return utils.compact(obj); }; },{"./utils":297}],296:[function(citationRequire,module,exports){ 'use strict'; function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var utils = citationRequire('./utils'); var formats = citationRequire('./formats'); var arrayPrefixGenerators = { brackets: function brackets(prefix) { return prefix + '[]'; }, indices: function indices(prefix, key) { return prefix + '[' + key + ']'; }, repeat: function repeat(prefix) { return prefix; } }; var toISO = Date.prototype.toISOString; var defaults = { delimiter: '&', encode: true, encoder: utils.encode, encodeValuesOnly: false, serializeDate: function serializeDate(date) { return toISO.call(date); }, skipNulls: false, strictNullHandling: false }; var stringify = function stringify(object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly) { var obj = object; if (typeof filter === 'function') { obj = filter(prefix, obj); } else if (obj instanceof Date) { obj = serializeDate(obj); } else if (obj === null) { if (strictNullHandling) { return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix; } obj = ''; } if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) { if (encoder) { var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder); return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))]; } return [formatter(prefix) + '=' + formatter(String(obj))]; } var values = []; if (typeof obj === 'undefined') { return values; } var objKeys; if (Array.isArray(filter)) { objKeys = filter; } else { var keys = Object.keys(obj); objKeys = sort ? keys.sort(sort) : keys; } for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; if (skipNulls && obj[key] === null) { continue; } if (Array.isArray(obj)) { values = values.concat(stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly)); } else { values = values.concat(stringify(obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly)); } } return values; }; module.exports = function (object, opts) { var obj = object; var options = opts ? utils.assign({}, opts) : {}; if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { throw new TypeError('Encoder has to be a function.'); } var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter; var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls; var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode; var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder; var sort = typeof options.sort === 'function' ? options.sort : null; var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots; var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate; var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly; if (typeof options.format === 'undefined') { options.format = formats['default']; } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) { throw new TypeError('Unknown format option provided.'); } var formatter = formats.formatters[options.format]; var objKeys; var filter; if (typeof options.filter === 'function') { filter = options.filter; obj = filter('', obj); } else if (Array.isArray(options.filter)) { filter = options.filter; objKeys = filter; } var keys = []; if (_typeof(obj) !== 'object' || obj === null) { return ''; } var arrayFormat; if (options.arrayFormat in arrayPrefixGenerators) { arrayFormat = options.arrayFormat; } else if ('indices' in options) { arrayFormat = options.indices ? 'indices' : 'repeat'; } else { arrayFormat = 'indices'; } var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; if (!objKeys) { objKeys = Object.keys(obj); } if (sort) { objKeys.sort(sort); } for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; if (skipNulls && obj[key] === null) { continue; } keys = keys.concat(stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode ? encoder : null, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly)); } var joined = keys.join(delimiter); var prefix = options.addQueryPrefix === true ? '?' : ''; return joined.length > 0 ? prefix + joined : ''; }; },{"./formats":293,"./utils":297}],297:[function(citationRequire,module,exports){ 'use strict'; function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var has = Object.prototype.hasOwnProperty; var hexTable = function () { var array = []; for (var i = 0; i < 256; ++i) { array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); } return array; }(); var compactQueue = function compactQueue(queue) { var obj; while (queue.length) { var item = queue.pop(); obj = item.obj[item.prop]; if (Array.isArray(obj)) { var compacted = []; for (var j = 0; j < obj.length; ++j) { if (typeof obj[j] !== 'undefined') { compacted.push(obj[j]); } } item.obj[item.prop] = compacted; } } return obj; }; exports.arrayToObject = function arrayToObject(source, options) { var obj = options && options.plainObjects ? Object.create(null) : {}; for (var i = 0; i < source.length; ++i) { if (typeof source[i] !== 'undefined') { obj[i] = source[i]; } } return obj; }; exports.merge = function merge(target, source, options) { if (!source) { return target; } if (_typeof(source) !== 'object') { if (Array.isArray(target)) { target.push(source); } else if (_typeof(target) === 'object') { if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) { target[source] = true; } } else { return [target, source]; } return target; } if (_typeof(target) !== 'object') { return [target].concat(source); } var mergeTarget = target; if (Array.isArray(target) && !Array.isArray(source)) { mergeTarget = exports.arrayToObject(target, options); } if (Array.isArray(target) && Array.isArray(source)) { source.forEach(function (item, i) { if (has.call(target, i)) { if (target[i] && _typeof(target[i]) === 'object') { target[i] = exports.merge(target[i], item, options); } else { target.push(item); } } else { target[i] = item; } }); return target; } return Object.keys(source).reduce(function (acc, key) { var value = source[key]; if (has.call(acc, key)) { acc[key] = exports.merge(acc[key], value, options); } else { acc[key] = value; } return acc; }, mergeTarget); }; exports.assign = function assignSingleSource(target, source) { return Object.keys(source).reduce(function (acc, key) { acc[key] = source[key]; return acc; }, target); }; exports.decode = function (str) { try { return decodeURIComponent(str.replace(/\+/g, ' ')); } catch (e) { return str; } }; exports.encode = function encode(str) { if (str.length === 0) { return str; } var string = typeof str === 'string' ? str : String(str); var out = ''; for (var i = 0; i < string.length; ++i) { var c = string.charCodeAt(i); if (c === 0x2D || c === 0x2E || c === 0x5F || c === 0x7E || c >= 0x30 && c <= 0x39 || c >= 0x41 && c <= 0x5A || c >= 0x61 && c <= 0x7A) { out += string.charAt(i); continue; } if (c < 0x80) { out = out + hexTable[c]; continue; } if (c < 0x800) { out = out + (hexTable[0xC0 | c >> 6] + hexTable[0x80 | c & 0x3F]); continue; } if (c < 0xD800 || c >= 0xE000) { out = out + (hexTable[0xE0 | c >> 12] + hexTable[0x80 | c >> 6 & 0x3F] + hexTable[0x80 | c & 0x3F]); continue; } i += 1; c = 0x10000 + ((c & 0x3FF) << 10 | string.charCodeAt(i) & 0x3FF); out += hexTable[0xF0 | c >> 18] + hexTable[0x80 | c >> 12 & 0x3F] + hexTable[0x80 | c >> 6 & 0x3F] + hexTable[0x80 | c & 0x3F]; } return out; }; exports.compact = function compact(value) { var queue = [{ obj: { o: value }, prop: 'o' }]; var refs = []; for (var i = 0; i < queue.length; ++i) { var item = queue[i]; var obj = item.obj[item.prop]; var keys = Object.keys(obj); for (var j = 0; j < keys.length; ++j) { var key = keys[j]; var val = obj[key]; if (_typeof(val) === 'object' && val !== null && refs.indexOf(val) === -1) { queue.push({ obj: obj, prop: key }); refs.push(val); } } } return compactQueue(queue); }; exports.isRegExp = function isRegExp(obj) { return Object.prototype.toString.call(obj) === '[object RegExp]'; }; exports.isBuffer = function isBuffer(obj) { if (obj === null || typeof obj === 'undefined') { return false; } return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); }; },{}],298:[function(citationRequire,module,exports){ "use strict"; function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var toDateObject = citationRequire('./wikidata_time_to_date_object'); var helpers = {}; helpers.isNumericId = function (id) { return /^[0-9]+$/.test(id); }; helpers.isEntityId = function (id) { return /^(Q|P)[0-9]+$/.test(id); }; helpers.isItemId = function (id) { return /^Q[0-9]+$/.test(id); }; helpers.isPropertyId = function (id) { return /^P[0-9]+$/.test(id); }; helpers.isGuid = function (guid) { return /^(Q|P|L)\d+\$[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(guid); }; helpers.getNumericId = function (id) { if (!helpers.isEntityId(id)) throw new Error("invalid wikidata id: ".concat(id)); return id.replace(/Q|P/, ''); }; helpers.wikidataTimeToDateObject = toDateObject; var bestEffort = function bestEffort(fn) { return function (value) { try { return fn(value); } catch (err) { value = value.time || value; return value.replace('-00-00', '-01-01'); } }; }; var toEpochTime = function toEpochTime(wikidataTime) { return toDateObject(wikidataTime).getTime(); }; var toISOString = function toISOString(wikidataTime) { return toDateObject(wikidataTime).toISOString(); }; var toSimpleDay = function toSimpleDay(wikidataTime) { if (_typeof(wikidataTime) === 'object') { var _wikidataTime = wikidataTime, time = _wikidataTime.time, precision = _wikidataTime.precision; if (precision === 9) wikidataTime = time.replace('-01-01T', '-00-00T');else if (precision === 10) wikidataTime = time.replace('-01T', '-00T');else wikidataTime = time; } return wikidataTime.split('T')[0].replace(/^\+/, '').replace(/^(-?)0+/, '$1').replace(/-00$/, '').replace(/-00$/, ''); }; helpers.wikidataTimeToEpochTime = bestEffort(toEpochTime); helpers.wikidataTimeToISOString = bestEffort(toISOString); helpers.wikidataTimeToSimpleDay = bestEffort(toSimpleDay); helpers.getImageUrl = function (filename, width) { var url = "https://commons.wikimedia.org/wiki/Special:FilePath/".concat(filename); if (typeof width === 'number') url += "?width=".concat(width); return url; }; module.exports = helpers; },{"./wikidata_time_to_date_object":308}],299:[function(citationRequire,module,exports){ "use strict"; var _citationRequire = citationRequire('./helpers'), wikidataTimeToISOString = _citationRequire.wikidataTimeToISOString, wikidataTimeToEpochTime = _citationRequire.wikidataTimeToEpochTime, wikidataTimeToSimpleDay = _citationRequire.wikidataTimeToSimpleDay; var simple = function simple(datavalue) { return datavalue.value; }; var monolingualtext = function monolingualtext(datavalue, options) { return options.keepRichValues ? datavalue.value : datavalue.value.text; }; var entity = function entity(datavalue, options) { return prefixedId(datavalue, options.entityPrefix); }; var entityLetter = { item: 'Q', lexeme: 'L', property: 'P' }; var prefixedId = function prefixedId(datavalue, prefix) { var value = datavalue.value; var id = value.id || entityLetter[value['entity-type']] + value['numeric-id']; return typeof prefix === 'string' ? "".concat(prefix, ":").concat(id) : id; }; var quantity = function quantity(datavalue, options) { var value = datavalue.value; var amount = parseFloat(value.amount); if (options.keepRichValues) { var _amount = parseFloat(value.amount); var unit = value.unit.replace('http://www.wikidata.org/entity/', ''); var upperBound = parseFloat(value.upperBound); var lowerBound = parseFloat(value.lowerBound); return { amount: _amount, unit: unit, upperBound: upperBound, lowerBound: lowerBound }; } else { return amount; } }; var coordinate = function coordinate(datavalue) { return [datavalue.value.latitude, datavalue.value.longitude]; }; var time = function time(datavalue, options) { return getTimeConverter(options.timeConverter)(datavalue.value); }; var getTimeConverter = function getTimeConverter() { var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'iso'; return timeConverters[key]; }; var timeConverters = { iso: wikidataTimeToISOString, epoch: wikidataTimeToEpochTime, 'simple-day': wikidataTimeToSimpleDay, none: function none(wikidataTime) { return wikidataTime.time || wikidataTime; } }; var parsers = { string: simple, commonsMedia: simple, url: simple, 'external-id': simple, math: simple, monolingualtext: monolingualtext, 'wikibase-item': entity, 'wikibase-lexeme': entity, 'wikibase-property': entity, time: time, quantity: quantity, 'globe-coordinate': coordinate, 'geo-shape': simple, 'tabular-data': simple }; module.exports = { parsers: parsers, parse: function parse(datatype, datavalue, options, claimId) { if (!datatype) { console.error('invalid claim', claimId); return null; } try { return parsers[datatype](datavalue, options); } catch (err) { if (err.message === 'parsers[datatype] is not a function') { err.message = "".concat(datatype, " claim parser isn't implemented\n Claim id: ").concat(claimId, "\n Please report to https://github.com/maxlath/wikidata-sdk/issues"); } throw err; } } }; },{"./helpers":298}],300:[function(citationRequire,module,exports){ "use strict"; var simplifyEntity = citationRequire('./simplify_entity'); module.exports = { wd: { entities: function entities(res) { res = res.body || res; var _res = res, entities = _res.entities; Object.keys(entities).forEach(function (entityId) { entities[entityId] = simplifyEntity(entities[entityId]); }); return entities; } } }; },{"./simplify_entity":302}],301:[function(citationRequire,module,exports){ "use strict"; function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var _citationRequire = citationRequire('./parse_claim'), parseClaim = _citationRequire.parse; var _citationRequire2 = citationRequire('../utils/utils'), uniq = _citationRequire2.uniq; var simplifyClaims = function simplifyClaims(claims) { for (var _len = arguments.length, options = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { options[_key - 1] = arguments[_key]; } var _parseOptions = parseOptions(options), propertyPrefix = _parseOptions.propertyPrefix; var simpleClaims = {}; for (var id in claims) { var propClaims = claims[id]; if (propertyPrefix) { id = propertyPrefix + ':' + id; } simpleClaims[id] = simplifyPropertyClaims.apply(void 0, [propClaims].concat(options)); } return simpleClaims; }; var simplifyPropertyClaims = function simplifyPropertyClaims(propClaims) { for (var _len2 = arguments.length, options = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { options[_key2 - 1] = arguments[_key2]; } if (propClaims == null || propClaims.length === 0) return []; var _parseOptions2 = parseOptions(options), keepNonTruthy = _parseOptions2.keepNonTruthy, areSubSnaks = _parseOptions2.areSubSnaks; if (!(keepNonTruthy || areSubSnaks)) { propClaims = truthyPropertyClaims(propClaims); } propClaims = propClaims.map(function (claim) { return simplifyClaim.apply(void 0, [claim].concat(options)); }).filter(nonNull); if (propClaims[0] && _typeof(propClaims[0]) !== 'object') { return uniq(propClaims); } else { return propClaims; } }; var aggregatePerRank = function aggregatePerRank(aggregate, claim) { var rank = claim.rank; aggregate[rank] || (aggregate[rank] = []); aggregate[rank].push(claim); return aggregate; }; var truthyPropertyClaims = function truthyPropertyClaims(propClaims) { var aggregate = propClaims.reduce(aggregatePerRank, {}); return aggregate.preferred || aggregate.normal || []; }; var truthyClaims = function truthyClaims(claims) { var truthClaimsOnly = {}; Object.keys(claims).forEach(function (property) { truthClaimsOnly[property] = truthyPropertyClaims(claims[property]); }); return truthClaimsOnly; }; var nonNull = function nonNull(obj) { return obj != null; }; var simplifyClaim = function simplifyClaim(claim) { for (var _len3 = arguments.length, options = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { options[_key3 - 1] = arguments[_key3]; } options = parseOptions(options); var _options = options, keepQualifiers = _options.keepQualifiers, keepReferences = _options.keepReferences, keepIds = _options.keepIds, keepHashes = _options.keepHashes, keepTypes = _options.keepTypes; var mainsnak = claim.mainsnak; var datatype, datavalue, isQualifierSnak, isReferenceSnak; if (mainsnak) { datatype = mainsnak.datatype; datavalue = mainsnak.datavalue; if (!datavalue) return null; } else { if (!(claim && claim.datavalue)) return null; datavalue = claim.datavalue; datatype = claim.datatype; if (claim.hash) isQualifierSnak = true;else isReferenceSnak = true; } var value = parseClaim(datatype, datavalue, options, claim.id); if (isQualifierSnak) { if (!(keepHashes || keepTypes)) return value; var _richValue = { value: value }; if (keepHashes) _richValue.hash = claim.hash; if (keepTypes) _richValue.type = datatype; return _richValue; } if (isReferenceSnak) { if (!keepTypes) return value; return { type: datatype, value: value }; } if (!(keepQualifiers || keepReferences || keepIds || keepTypes)) return value; var richValue = { value: value }; if (keepTypes) { richValue.type = datatype; } var subSnaksOptions = getSubSnakOptions(options); subSnaksOptions.keepHashes = keepHashes; if (keepQualifiers) { richValue.qualifiers = simplifyClaims(claim.qualifiers, subSnaksOptions); } if (keepReferences) { claim.references = claim.references || []; richValue.references = claim.references.map(function (refRecord) { var snaks = simplifyClaims(refRecord.snaks, subSnaksOptions); if (keepHashes) return { snaks: snaks, hash: refRecord.hash };else return snaks; }); } if (keepIds) richValue.id = claim.id; return richValue; }; var parseOptions = function parseOptions(options) { if (options == null) return {}; if (options[0] && _typeof(options[0]) === 'object') return options[0]; var _options2 = _slicedToArray(options, 3), entityPrefix = _options2[0], propertyPrefix = _options2[1], keepQualifiers = _options2[2]; return { entityPrefix: entityPrefix, propertyPrefix: propertyPrefix, keepQualifiers: keepQualifiers }; }; var simplifyQualifiers = function simplifyQualifiers(claims, options) { return simplifyClaims(claims, getSubSnakOptions(options)); }; var simplifyPropertyQualifiers = function simplifyPropertyQualifiers(propClaims, options) { return simplifyPropertyClaims(propClaims, getSubSnakOptions(options)); }; var getSubSnakOptions = function getSubSnakOptions(options) { return Object.assign({}, options, { areSubSnaks: true }); }; module.exports = { simplifyClaims: simplifyClaims, simplifyPropertyClaims: simplifyPropertyClaims, simplifyClaim: simplifyClaim, truthyClaims: truthyClaims, truthyPropertyClaims: truthyPropertyClaims, simplifyQualifiers: simplifyQualifiers, simplifyPropertyQualifiers: simplifyPropertyQualifiers, simplifyQualifier: simplifyClaim }; },{"../utils/utils":319,"./parse_claim":299}],302:[function(citationRequire,module,exports){ "use strict"; var _citationRequire = citationRequire('./simplify_claims'), simplifyClaims = _citationRequire.simplifyClaims; var simplify = citationRequire('./simplify_text_attributes'); var simplifySitelinks = citationRequire('./simplify_sitelinks'); var simplifyEntity = function simplifyEntity(entity, options) { var simplified = { id: entity.id, type: entity.type, modified: entity.modified }; simplifyIfDefined(entity, simplified, 'labels'); simplifyIfDefined(entity, simplified, 'descriptions'); simplifyIfDefined(entity, simplified, 'aliases'); if (entity.claims != null) { simplified.claims = simplifyClaims(entity.claims, options); } if (entity.sitelinks != null) { simplified.sitelinks = simplifySitelinks(entity.sitelinks, options); } return simplified; }; var simplifyIfDefined = function simplifyIfDefined(entity, simplified, attribute) { if (entity[attribute] != null) { simplified[attribute] = simplify[attribute](entity[attribute]); } }; var simplifyEntities = function simplifyEntities(entities) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var entityPrefix = options.entityPrefix; return Object.keys(entities).reduce(function (obj, key) { var entity = entities[key]; if (entityPrefix) key = "".concat(entityPrefix, ":").concat(key); obj[key] = simplifyEntity(entity, options); return obj; }, {}); }; module.exports = { simplifyEntity: simplifyEntity, simplifyEntities: simplifyEntities }; },{"./simplify_claims":301,"./simplify_sitelinks":303,"./simplify_text_attributes":305}],303:[function(citationRequire,module,exports){ "use strict"; var _citationRequire = citationRequire('./sitelinks_helpers'), getSitelinkUrl = _citationRequire.getSitelinkUrl; module.exports = function (sitelinks) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var addUrl = options.addUrl; return Object.keys(sitelinks).reduce(aggregateValues(sitelinks, addUrl), {}); }; var aggregateValues = function aggregateValues(sitelinks, addUrl) { return function (index, key) { var title = sitelinks[key].title; if (addUrl) { index[key] = { title: title, url: getSitelinkUrl(key, title) }; } else { index[key] = title; } return index; }; }; },{"./sitelinks_helpers":306}],304:[function(citationRequire,module,exports){ "use strict"; module.exports = function (input) { if (typeof input === 'string') input = JSON.parse(input); var vars = input.head.vars; var results = input.results.bindings; if (vars.length === 1) { var varName = vars[0]; return results.map(function (result) { return parseValue(result[varName]); }).filter(function (result) { return result != null; }); } var _identifyVars = identifyVars(vars), richVars = _identifyVars.richVars, standaloneVars = _identifyVars.standaloneVars; return results.map(getSimplifiedResult(richVars, standaloneVars)); }; var parseValue = function parseValue(valueObj) { if (!valueObj) return; var datatype = valueObj.datatype; datatype = datatype && datatype.replace('http://www.w3.org/2001/XMLSchema#', ''); var parser = parsers[valueObj.type] || getDatatypesParsers(datatype); return parser(valueObj); }; var parsers = { uri: function uri(valueObj) { return parseUri(valueObj.value); }, bnode: function bnode() { return null; } }; var numberParser = function numberParser(valueObj) { return parseFloat(valueObj.value); }; var getDatatypesParsers = function getDatatypesParsers(datatype) { datatype = datatype && datatype.replace('http://www.w3.org/2001/XMLSchema#', ''); return datatypesParsers[datatype] || passValue; }; var datatypesParsers = { decimal: numberParser, integer: numberParser, float: numberParser, double: numberParser, boolean: function boolean(valueObj) { return valueObj.value === 'true'; } }; var passValue = function passValue(valueObj) { return valueObj.value; }; var parseUri = function parseUri(uri) { if (uri.startsWith('http://www.wikidata.org/entity/statement/')) { return convertStatementUriToGuid(uri); } return uri.replace('http://www.wikidata.org/entity/', '').replace('http://www.wikidata.org/prop/direct/', ''); }; var convertStatementUriToGuid = function convertStatementUriToGuid(uri) { uri = uri.replace('http://www.wikidata.org/entity/statement/', ''); var parts = uri.split('-'); return parts[0] + '$' + parts.slice(1).join('-'); }; var identifyVars = function identifyVars(vars) { var data = { richVars: [], standaloneVars: [] }; return vars.reduce(spreadVars(vars), data); }; var spreadVars = function spreadVars(vars) { return function (data, varName) { if (vars.some(isAssociatedVar(varName))) { data.richVars.push(varName); return data; } if (!associatedVarPattern.test(varName)) { data.standaloneVars.push(varName); return data; } var associatedVar = varName.replace(associatedVarPattern, '$1').replace(/Alt$/, ''); if (!vars.includes(associatedVar)) { data.standaloneVars.push(varName); } return data; }; }; var associatedVarPattern = /^(\w+)(Label|Description|AltLabel)$/; var isAssociatedVar = function isAssociatedVar(varNameA) { return function (varNameB) { if ("".concat(varNameA, "Label") === varNameB) return true; if ("".concat(varNameA, "Description") === varNameB) return true; if ("".concat(varNameA, "AltLabel") === varNameB) return true; return false; }; }; var getSimplifiedResult = function getSimplifiedResult(richVars, standaloneVars) { return function (result) { var simplifiedResult = {}; var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = richVars[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var varName = _step.value; var value = parseValue(result[varName]); if (value != null) { simplifiedResult[varName] = { value: value }; addAssociatedValue(result, varName, 'label', simplifiedResult[varName]); addAssociatedValue(result, varName, 'description', simplifiedResult[varName]); addAssociatedValue(result, varName, 'aliases', simplifiedResult[varName]); } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { for (var _iterator2 = standaloneVars[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { var _varName = _step2.value; simplifiedResult[_varName] = parseValue(result[_varName]); } } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return != null) { _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } return simplifiedResult; }; }; var addAssociatedValue = function addAssociatedValue(result, varName, associatedVarName, varData) { var fullAssociatedVarName = varName + varNameSuffixMap[associatedVarName]; var fullAssociatedVarData = result[fullAssociatedVarName]; if (fullAssociatedVarData != null) { varData[associatedVarName] = fullAssociatedVarData.value; } }; var varNameSuffixMap = { label: 'Label', description: 'Description', aliases: 'AltLabel' }; },{}],305:[function(citationRequire,module,exports){ "use strict"; var simplifyTextAttributes = function simplifyTextAttributes(multivalue) { return function (data) { return Object.keys(data).reduce(aggregateValues(data, multivalue), {}); }; }; var aggregateValues = function aggregateValues(data, multivalue) { return function (index, lang) { var obj = data[lang]; index[lang] = multivalue ? obj.map(getValue) : obj.value; return index; }; }; var getValue = function getValue(obj) { return obj.value; }; var singleValue = simplifyTextAttributes(false); module.exports = { labels: singleValue, descriptions: singleValue, aliases: simplifyTextAttributes(true) }; },{}],306:[function(citationRequire,module,exports){ "use strict"; function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var _citationRequire = citationRequire('../utils/utils'), fixedEncodeURIComponent = _citationRequire.fixedEncodeURIComponent, replaceSpaceByUnderscores = _citationRequire.replaceSpaceByUnderscores, isPlainObject = _citationRequire.isPlainObject; var _citationRequire2 = citationRequire('./helpers'), isPropertyId = _citationRequire2.isPropertyId; var wikidataBase = 'https://www.wikidata.org/wiki/'; var languages = citationRequire('./sitelinks_languages'); var getSitelinkUrl = function getSitelinkUrl(site, title) { if (isPlainObject(site)) { title = site.title; site = site.site; } if (!site) throw new Error('missing a site'); if (!title) throw new Error('missing a title'); if (site === 'commons') return "https://commons.wikimedia.org/wiki/".concat(title); if (site === 'wikidata') { if (isPropertyId(title)) return "".concat(wikidataBase, "Property:").concat(title); return "".concat(wikidataBase).concat(title); } var _getSitelinkData = getSitelinkData(site), lang = _getSitelinkData.lang, project = _getSitelinkData.project; title = fixedEncodeURIComponent(replaceSpaceByUnderscores(title)); return "https://".concat(lang, ".").concat(project, ".org/wiki/").concat(title); }; var getSitelinkData = function getSitelinkData(site) { if (site === 'commons') return { lang: 'en', project: 'commons' }; if (site === 'wikidata') return { lang: 'en', project: 'wikidata' }; var _site$split = site.split('wik'), _site$split2 = _slicedToArray(_site$split, 3), lang = _site$split2[0], projectSuffix = _site$split2[1], rest = _site$split2[2]; if (rest != null) throw new Error("invalid sitelink: ".concat(site)); if (languages.indexOf(lang) === -1) { throw new Error("sitelink lang not found: ".concat(lang)); } var project = projectsBySuffix[projectSuffix]; if (!project) throw new Error("sitelink project not found: ".concat(project)); return { lang: lang, project: project }; }; var isSitelinkKey = function isSitelinkKey(site) { try { getSitelinkData(site); return true; } catch (err) { return false; } }; var projectsBySuffix = { i: 'wikipedia', isource: 'wikisource', iquote: 'wikiquote', tionary: 'wiktionary', ibooks: 'wikibooks', iversity: 'wikiversity', ivoyage: 'wikivoyage', inews: 'wikinews' }; module.exports = { getSitelinkUrl: getSitelinkUrl, getSitelinkData: getSitelinkData, isSitelinkKey: isSitelinkKey }; },{"../utils/utils":319,"./helpers":298,"./sitelinks_languages":307}],307:[function(citationRequire,module,exports){ "use strict"; module.exports = ['aa', 'ab', 'ace', 'ady', 'af', 'ak', 'als', 'am', 'an', 'ang', 'ar', 'arc', 'arz', 'as', 'ast', 'atj', 'av', 'ay', 'az', 'azb', 'ba', 'bar', 'bat_smg', 'bcl', 'be', 'be_x_old', 'bg', 'bh', 'bi', 'bjn', 'bm', 'bn', 'bo', 'bpy', 'br', 'bs', 'bug', 'bxr', 'ca', 'cbk_zam', 'cdo', 'ce', 'ceb', 'ch', 'cho', 'chr', 'chy', 'ckb', 'co', 'commons', 'cr', 'crh', 'cs', 'csb', 'cu', 'cv', 'cy', 'da', 'de', 'din', 'diq', 'dsb', 'dty', 'dv', 'dz', 'ee', 'el', 'eml', 'en', 'eo', 'es', 'et', 'eu', 'ext', 'fa', 'ff', 'fi', 'fiu_vro', 'fj', 'fo', 'fr', 'frp', 'frr', 'fur', 'fy', 'ga', 'gag', 'gan', 'gd', 'gl', 'glk', 'gn', 'gom', 'got', 'gu', 'gv', 'ha', 'hak', 'haw', 'he', 'hi', 'hif', 'ho', 'hr', 'hsb', 'ht', 'hu', 'hy', 'hz', 'ia', 'id', 'ie', 'ig', 'ii', 'ik', 'ilo', 'io', 'is', 'it', 'iu', 'ja', 'jam', 'jbo', 'jv', 'ka', 'kaa', 'kab', 'kbd', 'kbp', 'kg', 'ki', 'kj', 'kk', 'kl', 'km', 'kn', 'ko', 'koi', 'kr', 'krc', 'ks', 'ksh', 'ku', 'kv', 'kw', 'ky', 'la', 'lad', 'lb', 'lbe', 'lez', 'lg', 'li', 'lij', 'lmo', 'ln', 'lo', 'lrc', 'lt', 'ltg', 'lv', 'mai', 'map_bms', 'mdf', 'mediawiki', 'meta', 'mg', 'mh', 'mhr', 'mi', 'min', 'mk', 'ml', 'mn', 'mo', 'mr', 'mrj', 'ms', 'mt', 'mus', 'mwl', 'my', 'myv', 'mzn', 'na', 'nah', 'nap', 'nds', 'nds_nl', 'ne', 'new', 'ng', 'nl', 'nn', 'no', 'nov', 'nrm', 'nso', 'nv', 'ny', 'oc', 'olo', 'om', 'or', 'os', 'pa', 'pag', 'pam', 'pap', 'pcd', 'pdc', 'pfl', 'pi', 'pih', 'pl', 'pms', 'pnb', 'pnt', 'ps', 'pt', 'qu', 'rm', 'rmy', 'rn', 'ro', 'roa_rup', 'roa_tara', 'ru', 'rue', 'rw', 'sa', 'sah', 'sc', 'scn', 'sco', 'sd', 'se', 'sg', 'sh', 'si', 'simple', 'sk', 'sl', 'sm', 'sn', 'so', 'species', 'sq', 'sr', 'srn', 'ss', 'st', 'stq', 'su', 'sv', 'sw', 'szl', 'ta', 'tcy', 'te', 'tet', 'tg', 'th', 'ti', 'tk', 'tl', 'tn', 'to', 'tpi', 'tr', 'ts', 'tt', 'tum', 'tw', 'ty', 'tyv', 'udm', 'ug', 'uk', 'ur', 'uz', 've', 'vec', 'vep', 'vi', 'vls', 'vo', 'wa', 'war', 'wo', 'wuu', 'xal', 'xh', 'xmf', 'yi', 'yo', 'za', 'zea', 'zh', 'zh_classical', 'zh_min_nan', 'zh_yue', 'zu']; },{}],308:[function(citationRequire,module,exports){ "use strict"; function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } module.exports = function (wikidataTime) { if (_typeof(wikidataTime) === 'object') { wikidataTime = wikidataTime.time; } var sign = wikidataTime[0]; var rest = wikidataTime.slice(1); var date = fullDateData(sign, rest); if (date.toString() === 'Invalid Date') { return parseInvalideDate(sign, rest); } else { return date; } }; var fullDateData = function fullDateData(sign, rest) { return sign === '-' ? negativeDate(rest) : positiveDate(rest); }; var positiveDate = function positiveDate(rest) { return new Date(rest); }; var negativeDate = function negativeDate(rest) { var year = rest.split('-')[0]; var date; if (year.length === 4) { date = "-00".concat(rest); } else if (year.length === 5) { date = "-0".concat(rest); } else { date = "-".concat(rest); } return new Date(date); }; var parseInvalideDate = function parseInvalideDate(sign, rest) { var year = rest.split('T')[0].split('-')[0]; return fullDateData(sign, year); }; },{}],309:[function(citationRequire,module,exports){ "use strict"; var wdk = module.exports = {}; wdk.searchEntities = citationRequire('./queries/search_entities'); wdk.getEntities = citationRequire('./queries/get_entities'); wdk.getManyEntities = citationRequire('./queries/get_many_entities'); wdk.sparqlQuery = citationRequire('./queries/sparql_query'); wdk.getReverseClaims = citationRequire('./queries/get_reverse_claims'); wdk.getRevisions = citationRequire('./queries/get_revisions'); wdk.getEntitiesFromSitelinks = citationRequire('./queries/get_entities_from_sitelinks'); wdk.getWikidataIdsFromSitelinks = wdk.getEntitiesFromSitelinks; wdk.parse = citationRequire('./helpers/parse_responses'); var claimsSimplifiers = citationRequire('./helpers/simplify_claims'); var simplifySparqlResults = citationRequire('./helpers/simplify_sparql_results'); wdk.simplify = citationRequire('../lib/helpers/simplify_text_attributes'); var _citationRequire = citationRequire('../lib/helpers/simplify_entity'), simplifyEntity = _citationRequire.simplifyEntity, simplifyEntities = _citationRequire.simplifyEntities; wdk.simplify.entity = simplifyEntity; wdk.simplify.entities = simplifyEntities; wdk.simplify.claim = claimsSimplifiers.simplifyClaim; wdk.simplify.propertyClaims = claimsSimplifiers.simplifyPropertyClaims; wdk.simplify.claims = claimsSimplifiers.simplifyClaims; wdk.simplify.qualifier = claimsSimplifiers.simplifyQualifiers; wdk.simplify.propertyQualifiers = claimsSimplifiers.simplifyPropertyQualifiers; wdk.simplify.qualifiers = claimsSimplifiers.simplifyQualifier; wdk.simplify.sitelinks = citationRequire('../lib/helpers/simplify_sitelinks'); wdk.simplify.sparqlResults = simplifySparqlResults; wdk.simplifySparqlResults = citationRequire('./helpers/simplify_sparql_results'); Object.assign(wdk, claimsSimplifiers); wdk.getWikidataIdsFromWikipediaTitles = wdk.getWikidataIdsFromSitelinks; var helpers = citationRequire('../lib/helpers/helpers'); var sitelinksHelpers = citationRequire('../lib/helpers/sitelinks_helpers'); Object.assign(wdk, helpers, sitelinksHelpers); },{"../lib/helpers/helpers":298,"../lib/helpers/simplify_entity":302,"../lib/helpers/simplify_sitelinks":303,"../lib/helpers/simplify_text_attributes":305,"../lib/helpers/sitelinks_helpers":306,"./helpers/parse_responses":300,"./helpers/simplify_claims":301,"./helpers/simplify_sparql_results":304,"./queries/get_entities":310,"./queries/get_entities_from_sitelinks":311,"./queries/get_many_entities":312,"./queries/get_reverse_claims":313,"./queries/get_revisions":314,"./queries/search_entities":315,"./queries/sparql_query":316}],310:[function(citationRequire,module,exports){ "use strict"; var buildUrl = citationRequire('../utils/build_url'); var _citationRequire = citationRequire('../utils/utils'), isPlainObject = _citationRequire.isPlainObject, forceArray = _citationRequire.forceArray, shortLang = _citationRequire.shortLang; module.exports = function (ids, languages, props, format) { if (isPlainObject(ids)) { var _ids = ids; ids = _ids.ids; languages = _ids.languages; props = _ids.props; format = _ids.format; } format = format || 'json'; if (!(ids && ids.length > 0)) throw new Error('no id provided'); ids = forceArray(ids); if (ids.length > 50) { console.warn("getEntities accepts 50 ids max to match Wikidata API limitations:\n this request won't get all the desired entities.\n You can use getManyEntities instead to generate several request urls\n to work around this limitation"); } var query = { action: 'wbgetentities', ids: ids.join('|'), format: format }; if (languages) { languages = forceArray(languages).map(shortLang); query.languages = languages.join('|'); } if (props && props.length > 0) query.props = forceArray(props).join('|'); return buildUrl(query); }; },{"../utils/build_url":317,"../utils/utils":319}],311:[function(citationRequire,module,exports){ "use strict"; var buildUrl = citationRequire('../utils/build_url'); var _citationRequire = citationRequire('../utils/utils'), isPlainObject = _citationRequire.isPlainObject, forceArray = _citationRequire.forceArray, shortLang = _citationRequire.shortLang; module.exports = function (titles, sites, languages, props, format) { if (isPlainObject(titles)) { var params = titles; titles = params.titles; sites = params.sites; languages = params.languages; props = params.props; format = params.format; } format = format || 'json'; if (!(titles && titles.length > 0)) throw new Error('no title provided'); if (!(sites && sites.length > 0)) sites = ['enwiki']; titles = forceArray(titles); sites = forceArray(sites).map(parseSite); props = forceArray(props); var query = { action: 'wbgetentities', titles: titles.join('|'), sites: sites.join('|'), format: format }; if (sites.length === 1 && titles.length === 1) { query.normalize = true; } if (languages) { languages = forceArray(languages).map(shortLang); query.languages = languages.join('|'); } if (props && props.length > 0) query.props = props.join('|'); return buildUrl(query); }; var parseSite = function parseSite(site) { return site.length === 2 ? "".concat(site, "wiki") : site; }; },{"../utils/build_url":317,"../utils/utils":319}],312:[function(citationRequire,module,exports){ "use strict"; var getEntities = citationRequire('./get_entities'); var _citationRequire = citationRequire('../utils/utils'), isPlainObject = _citationRequire.isPlainObject; module.exports = function (ids, languages, props, format) { if (isPlainObject(ids)) { var _ids = ids; ids = _ids.ids; languages = _ids.languages; props = _ids.props; format = _ids.format; } if (!(ids instanceof Array)) throw new Error('getManyEntities expects an array of ids'); return getIdsGroups(ids).map(function (idsGroup) { return getEntities(idsGroup, languages, props, format); }); }; var getIdsGroups = function getIdsGroups(ids) { var groups = []; while (ids.length > 0) { var group = ids.slice(0, 50); ids = ids.slice(50); groups.push(group); } return groups; }; },{"../utils/utils":319,"./get_entities":310}],313:[function(citationRequire,module,exports){ "use strict"; var helpers = citationRequire('../helpers/helpers'); var sparqlQuery = citationRequire('./sparql_query'); var itemsOnly = 'FILTER NOT EXISTS { ?subject rdf:type wikibase:Property . } '; module.exports = function (property, value) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var limit = options.limit, caseInsensitive = options.caseInsensitive, keepProperties = options.keepProperties; limit = limit || 1000; var valueFn = caseInsensitive ? caseInsensitiveValueQuery : directValueQuery; var filter = keepProperties ? '' : itemsOnly; if (property instanceof Array) { property = property.map(prefixifyProperty).join('|'); } else { property = prefixifyProperty(property); } var valueBlock = getValueBlock(value, valueFn, property, filter); var sparql = "SELECT DISTINCT ?subject WHERE { ".concat(valueBlock, " } LIMIT ").concat(limit); return sparqlQuery(sparql); }; function getValueBlock(value, valueFn, property, filter) { if (!(value instanceof Array)) { return valueFn(property, getValueString(value), filter); } var valuesBlocks = value.map(getValueString).map(function (valStr) { return valueFn(property, valStr, filter); }); return '{ ' + valuesBlocks.join('} UNION {') + ' }'; } function getValueString(value) { if (helpers.isItemId(value)) { value = "wd:".concat(value); } else if (typeof value === 'string') { value = "'".concat(value, "'"); } return value; } function directValueQuery(property, value, filter, limit) { return "?subject ".concat(property, " ").concat(value, " .\n ").concat(filter); } function caseInsensitiveValueQuery(property, value, filter, limit) { return "?subject ".concat(property, " ?value .\n FILTER (lcase(?value) = ").concat(value.toLowerCase(), ")\n ").concat(filter); } var prefixifyProperty = function prefixifyProperty(property) { return 'wdt:' + property; }; },{"../helpers/helpers":298,"./sparql_query":316}],314:[function(citationRequire,module,exports){ "use strict"; var buildUrl = citationRequire('../utils/build_url'); var _citationRequire = citationRequire('../utils/utils'), forceArray = _citationRequire.forceArray; module.exports = function (ids) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; ids = forceArray(ids); var uniqueId = ids.length === 1; var query = { action: 'query', prop: 'revisions' }; query.titles = ids.join('|'); query.format = options.format || 'json'; if (uniqueId) query.rvlimit = options.limit || 'max'; if (uniqueId && options.start) query.rvstart = getEpochSeconds(options.start); if (uniqueId && options.end) query.rvend = getEpochSeconds(options.end); return buildUrl(query); }; var getEpochSeconds = function getEpochSeconds(date) { if (typeof date === 'number' && date < earliestPointInMs) return date; return Math.trunc(new Date(date).getTime() / 1000); }; var earliestPointInMs = new Date('2000-01-01').getTime(); },{"../utils/build_url":317,"../utils/utils":319}],315:[function(citationRequire,module,exports){ "use strict"; var buildUrl = citationRequire('../utils/build_url'); var _citationRequire = citationRequire('../utils/utils'), isPlainObject = _citationRequire.isPlainObject; module.exports = function (search, language, limit, format, uselang) { if (isPlainObject(search)) { var params = search; search = params.search; language = params.language; limit = params.limit; format = params.format; uselang = params.uselang; } if (!(search && search.length > 0)) throw new Error("search can't be empty"); language = language || 'en'; uselang = uselang || language; limit = limit || '20'; format = format || 'json'; return buildUrl({ action: 'wbsearchentities', search: search, language: language, limit: limit, format: format, uselang: uselang }); }; },{"../utils/build_url":317,"../utils/utils":319}],316:[function(citationRequire,module,exports){ "use strict"; var _citationRequire = citationRequire('../utils/utils'), fixedEncodeURIComponent = _citationRequire.fixedEncodeURIComponent; module.exports = function (sparql) { var query = fixedEncodeURIComponent(sparql); return "https://query.wikidata.org/sparql?format=json&query=".concat(query); }; },{"../utils/utils":319}],317:[function(citationRequire,module,exports){ "use strict"; var wikidataApiRoot = 'https://www.wikidata.org/w/api.php'; var isBrowser = typeof location !== 'undefined' && typeof document !== 'undefined'; var qs = isBrowser ? citationRequire('./querystring_lite') : citationRequire('querystring'); module.exports = function (queryObj) { if (isBrowser) queryObj.origin = '*'; return wikidataApiRoot + '?' + qs.stringify(queryObj); }; },{"./querystring_lite":318,"querystring":289}],318:[function(citationRequire,module,exports){ "use strict"; module.exports = { stringify: function stringify(queryObj) { var qstring = ''; for (var key in queryObj) { var value = queryObj[key]; if (value) qstring += "&".concat(key, "=").concat(value); } qstring = qstring.slice(1); if (encodeURI) return encodeURI(qstring); return qstring; } }; },{}],319:[function(citationRequire,module,exports){ "use strict"; function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } module.exports = { shortLang: function shortLang(language) { return language.toLowerCase().split(/[^a-z]/)[0]; }, forceArray: function forceArray(array) { if (typeof array === 'string') array = [array]; return array || []; }, isPlainObject: function isPlainObject(obj) { if (!obj || _typeof(obj) !== 'object' || obj instanceof Array) return false; return true; }, fixedEncodeURIComponent: function fixedEncodeURIComponent(str) { return encodeURIComponent(str).replace(/[!'()*]/g, encodeCharacter); }, replaceSpaceByUnderscores: function replaceSpaceByUnderscores(str) { return str.replace(/\s/g, '_'); }, uniq: function uniq(array) { return Array.from(new Set(array)); } }; var encodeCharacter = function encodeCharacter(char) { return '%' + char.charCodeAt(0).toString(16); }; },{}],320:[function(citationRequire,module,exports){ module.exports={ "name": "citation-js", "version": "0.4.0-10", "description": "Citation.js converts formats like BibTeX, Wikidata JSON and ContentMine JSON to CSL-JSON to convert to other formats like APA, Vancouver and back to BibTeX.", "main": "lib/index.js", "jsdelivr": "build/citation.min.js", "unpkg": "build/citation.min.js", "directories": { "doc": "docs/", "test": "test/", "lib": "src/" }, "homepage": "https://citation.js.org/", "repository": { "type": "git", "url": "git+https://github.com/larsgw/citation.js.git" }, "keywords": [ "citation", "bibtex", "wikidata", "contentmine", "quickscrape", "csl", "citeproc" ], "files": [ "/lib", "/bin", "/build/citation.js", "/build/citation.min.js" ], "dependencies": { "@babel/polyfill": "^7.0.0", "@citation-js/date": "^0.4.1", "@citation-js/name": "^0.4.1", "citeproc": "^2.1.210", "commander": "^2.17.1", "isomorphic-fetch": "^2.2.1", "sync-request": "^5.0.0", "wikidata-sdk": "^5.15.4" }, "devDependencies": { "@babel/cli": "^7.0.0", "@babel/core": "^7.0.0", "@babel/plugin-proposal-class-properties": "^7.0.0", "@babel/plugin-proposal-object-rest-spread": "^7.0.0", "@babel/preset-env": "^7.0.0", "@babel/register": "^7.0.0", "babel-eslint": "^9.0.0", "babel-plugin-istanbul": "^5.0.1", "babelify": "github:larsgw/babelify#patch-1", "browserify": "^16.2.2", "cross-env": "^5.2.0", "disc": "^1.3.2", "eslint-plugin-vuln-regex-detector": "^1.0.4", "expect.js": "^0.3.1", "glob": "^7.1.3", "jsdoc": "^3.5.5", "markdown-toc": "^1.2.0", "minami": "^1.2.3", "mocha": "^5.2.0", "mock-citationRequire": "^3.0.2", "npm-run-all": "^4.1.3", "nyc": "^13.0.1", "standard": "^11.0.1", "uglify-js": "^3.4.8" }, "nyc": { "citationRequire": [ "@babel/register" ], "sourceMap": false, "instrument": false }, "standard": { "parser": "babel-eslint", "globals": [ "logger" ] }, "browser": { "./test/citation.js": "./test/citation-browser.js" }, "scripts": { "--1--": "lint", "lint:src": "standard \"src/**/*.js\"", "lint:test": "standard \"test/**/*.js\"", "lint:tools": "standard \"tools/**/*.js\"", "lint:bin": "standard \"bin/**/*.js\"", "lint": "npm-run-all lint:*", "--2--": "test", "test": "cross-env TEST_MOCHA=true mocha --check-leaks -r @babel/register -R dot test/*.spec.js", "test:live": "cross-env TEST_MOCK_HTTP=false npm test", "test:regex": "eslint --parser babel-eslint --plugin vuln-regex-detector --rule 'vuln-regex-detector/no-vuln-regex: 2' \"src/**/*.js\"", "test:update:wikidata": "node tools/api/wikidata.js", "test:update:doi": "node tools/api/doi.js", "test:update": "npm-run-all test:update:*", "--3--": "coverage", "coverage:test": "cross-env NODE_ENV=test nyc npm test", "coverage:report": "nyc report --reporter=lcov > coverage.lcov", "--4--": "compile", "compile": "babel src -d lib --copy-files", "--5--": "distributions", "dist:debug": "node tools/build-debug.js", "dist:regular-main": "node tools/build.js", "dist:regular-test": "node tools/build-test.js", "dist:minify-main": "uglifyjs --config-file .uglify.json build/citation.js -o build/citation.min.js", "dist:minify-test": "uglifyjs --config-file .uglify.json build/test.citation.js -o build/test.citation.min.js", "dist:regular": "npm-run-all dist:regular-*", "dist:minify": "npm-run-all dist:minify-*", "dist:main": "npm-run-all dist:*-main", "dist:test": "npm-run-all dist:*-test", "dist": "npm-run-all dist:*-*", "--6--": "generate", "generate:files": "npm run dist", "generate:docs": "markdown-toc -i README.md && jsdoc -c .jsdoc.json", "generate:disc": "node tools/disc.js", "generate": "npm-run-all generate:*", "--7--": "hooks", "preversion": "npm run lint && npm run test", "prepublishOnly": "npm run compile && npm run dist:main" }, "author": "Lars Willighagen (https://larsgw.github.io)", "license": "MIT", "bin": "bin/cmd.js", "man": "bin/man/citation-js.1", "bugs": { "url": "https://github.com/larsgw/citation.js/issues" }, "engines": { "node": ">=6.0.0" } } },{}],321:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _parse = citationRequire("../parse/"); var _index = _interopcitationRequireDefault(citationRequire("./index")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } var asyncCite = function () { var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(data, options) { return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.t0 = _index.default; _context.next = 3; return data; case 3: _context.t1 = _context.sent; _context.t2 = options; return _context.abrupt("return", new _context.t0(_context.t1, _context.t2)); case 6: case "end": return _context.stop(); } } }, _callee, this); })); return function asyncCite(_x, _x2) { return _ref.apply(this, arguments); }; }(); var async = function async(data, options, callback) { var promise = (0, _parse.chainAsync)(data); if (typeof options === 'function' && !callback) { callback = options; options = undefined; } if (typeof callback === 'function') { promise.then(function (data) { return callback(new _index.default(data, options)); }); return undefined; } else { return asyncCite(promise, options); } }; var _default = async; exports.default = _default; },{"../parse/":359,"./index":323}],322:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.get = exports.getIds = exports.format = void 0; var _static = citationRequire("./static"); var _registrar = citationRequire("../get/registrar"); var _parse = citationRequire("../parse/"); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var getIds = function getIds() { return this.data.map(function (entry) { return entry.id; }); }; exports.getIds = getIds; var format = function format(_format) { for (var _len = arguments.length, options = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { options[_key - 1] = arguments[_key]; } return _registrar.format.apply(void 0, [_format, (0, _parse.csl)(this.data)].concat(options)); }; exports.format = format; var get = function get() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; try { (0, _static.validateOutputOptions)(options); } catch (_ref) { var message = _ref.message; logger.error('[get]', message); } var parsedOptions = Object.assign({}, this.defaultOptions, this._options.output, options); var type = parsedOptions.type, style = parsedOptions.style; var _style$split = style.split('-'), _style$split2 = _slicedToArray(_style$split, 2), styleType = _style$split2[0], styleFormat = _style$split2[1]; var newStyle = styleType === 'citation' ? 'bibliography' : styleType === 'csl' ? 'data' : styleType; var newType = type === 'string' ? 'text' : type === 'json' ? 'object' : type; var formatOptions; switch (newStyle) { case 'bibliography': var lang = parsedOptions.lang, append = parsedOptions.append, prepend = parsedOptions.prepend; formatOptions = { template: styleFormat, lang: lang, format: newType, append: append, prepend: prepend }; break; case 'data': case 'bibtex': case 'bibtxt': formatOptions = { type: newType }; break; default: logger.error('[get]', 'Invalid options'); break; } var result = this.format(newStyle, formatOptions); var format = parsedOptions.format; if (format === 'real' && newType === 'html' && typeof document !== 'undefined' && typeof document.createElement === 'function') { var tmp = document.createElement('div'); tmp.innerHTML = result; return tmp.firstChild; } else if (format === 'string' && _typeof(result) === 'object') { return JSON.stringify(result); } else { return result; } }; exports.get = get; },{"../get/registrar":355,"../parse/":359,"./static":328}],323:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var log = _interopcitationRequireWildcard(citationRequire("./log")); var options = _interopcitationRequireWildcard(citationRequire("./options")); var set = _interopcitationRequireWildcard(citationRequire("./set")); var sort = _interopcitationRequireWildcard(citationRequire("./sort")); var get = _interopcitationRequireWildcard(citationRequire("./get")); function _interopcitationRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } function Cite(data) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; if (!(this instanceof Cite)) { return new Cite(data, options); } this._options = options || {}; this.log = []; this.data = []; this.set(data, options); this.options(options); this.save(); return this; } Object.assign(Cite.prototype, log, options, set, sort, get); Cite.prototype[Symbol.iterator] = regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: return _context.delegateYield(this.data, "t0", 1); case 1: case "end": return _context.stop(); } } }, _callee, this); }); var _default = Cite; exports.default = _default; },{"./get":322,"./log":324,"./options":325,"./set":326,"./sort":327}],324:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.save = exports.undo = exports.retrieveLastVersion = exports.retrieveVersion = exports.currentVersion = void 0; var _index = _interopcitationRequireDefault(citationRequire("./index")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var currentVersion = function currentVersion() { return this.log.length; }; exports.currentVersion = currentVersion; var retrieveVersion = function retrieveVersion() { var versnum = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; if (versnum <= 0 || versnum > this.currentVersion()) { return null; } else { var _this$log = _slicedToArray(this.log[versnum - 1], 2), data = _this$log[0], options = _this$log[1]; var image = new _index.default(JSON.parse(data), JSON.parse(options)); image.log = this.log.slice(0, versnum); return image; } }; exports.retrieveVersion = retrieveVersion; var undo = function undo() { var number = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; return this.retrieveVersion(this.currentVersion() - number); }; exports.undo = undo; var retrieveLastVersion = function retrieveLastVersion() { return this.retrieveVersion(this.currentVersion()); }; exports.retrieveLastVersion = retrieveLastVersion; var save = function save() { this.log.push([JSON.stringify(this.data), JSON.stringify(this._options)]); return this; }; exports.save = save; },{"./index":323}],325:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.defaultOptions = exports.options = void 0; var _validate = citationRequire("./validate"); var defaultOptions = { format: 'real', type: 'json', style: 'csl', lang: 'en-US' }; exports.defaultOptions = defaultOptions; var options = function options(_options, log) { if (log) { this.save(); } try { (0, _validate.validateOutputOptions)(_options); Object.assign(this._options, _options); } catch (_ref) { var message = _ref.message; logger.warn('[options]', message); } return this; }; exports.options = options; },{"./validate":329}],326:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.reset = exports.setAsync = exports.set = exports.addAsync = exports.add = void 0; var _parse = citationRequire("../parse/"); var _fetchId = _interopcitationRequireDefault(citationRequire("../util/fetchId")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } var add = function add(data) { var _this$data, _this = this; var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var log = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; if (options === true || log === true) { this.save(); } (_this$data = this.data).push.apply(_this$data, _toConsumableArray((0, _parse.chain)(data, options))); this.data.filter(function (entry) { return !entry.hasOwnProperty('id'); }).forEach(function (entry) { entry.id = (0, _fetchId.default)(_this.getIds(), 'temp_id_'); }); return this; }; exports.add = add; var addAsync = function () { var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(data) { var _this$data2, _this2 = this; var options, log, _args = arguments; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; log = _args.length > 2 && _args[2] !== undefined ? _args[2] : false; if (options === true || log === true) { this.save(); } _context.t0 = (_this$data2 = this.data).push; _context.t1 = _this$data2; _context.t2 = _toConsumableArray; _context.next = 8; return (0, _parse.chainAsync)(data, options); case 8: _context.t3 = _context.sent; _context.t4 = (0, _context.t2)(_context.t3); _context.t0.apply.call(_context.t0, _context.t1, _context.t4); this.data.filter(function (entry) { return !entry.hasOwnProperty('id'); }).forEach(function (entry) { entry.id = (0, _fetchId.default)(_this2.getIds(), 'temp_id_'); }); return _context.abrupt("return", this); case 13: case "end": return _context.stop(); } } }, _callee, this); })); return function addAsync(_x) { return _ref.apply(this, arguments); }; }(); exports.addAsync = addAsync; var set = function set(data) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var log = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; if (options === true || log === true) { this.save(); } this.data = []; return typeof options !== 'boolean' ? this.add(data, options) : this.add(data); }; exports.set = set; var setAsync = function () { var _ref2 = _asyncToGenerator(regeneratorRuntime.mark(function _callee2(data) { var options, log, _args2 = arguments; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: options = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {}; log = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : false; if (options === true || log === true) { this.save(); } this.data = []; return _context2.abrupt("return", typeof options !== 'boolean' ? this.addAsync(data, options) : this.addAsync(data)); case 5: case "end": return _context2.stop(); } } }, _callee2, this); })); return function setAsync(_x2) { return _ref2.apply(this, arguments); }; }(); exports.setAsync = setAsync; var reset = function reset(log) { if (log) { this.save(); } this.data = []; this._options = {}; return this; }; exports.reset = reset; },{"../parse/":359,"../util/fetchId":403}],327:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.sort = void 0; var _label = citationRequire("../get/modules/label"); var _name = _interopcitationRequireDefault(citationRequire("../get/name")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } var getComparisonValue = function getComparisonValue(obj, prop) { var label = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : prop === 'label'; var value = label ? (0, _label.getLabel)(obj) : obj[prop]; switch (prop) { case 'author': case 'editor': return value.map(function (name) { return name.literal || name.family || (0, _name.default)(name); }); case 'accessed': case 'issued': return value['date-parts'][0]; case 'page': return value.split('-').map(function (num) { return parseInt(num); }); case 'edition': case 'issue': case 'volume': value = parseInt(value); return !isNaN(value) ? value : -Infinity; default: return value || -Infinity; } }; var compareProp = function compareProp(a, b, prop) { var flip = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : /^!/.test(prop); prop = prop.replace(/^!/, ''); var valueA = getComparisonValue(a, prop); var valueB = getComparisonValue(b, prop); return valueA === valueB ? 0 : flip !== valueA > valueB ? 1 : -1; }; var getSortCallback = function getSortCallback() { for (var _len = arguments.length, props = new Array(_len), _key = 0; _key < _len; _key++) { props[_key] = arguments[_key]; } return function (a, b) { var keys = props.slice(); var output = 0; while (!output && keys.length) { output = compareProp(a, b, keys.shift()); } return output; }; }; var sort = function sort() { var method = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; var log = arguments.length > 1 ? arguments[1] : undefined; if (log) { this.save(); } this.data.sort(typeof method === 'function' ? method : getSortCallback.apply(void 0, _toConsumableArray(method).concat(['label']))); return this; }; exports.sort = sort; },{"../get/modules/label":351,"../get/name":354}],328:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _exportNames = { async: true }; Object.defineProperty(exports, "async", { enumerable: true, get: function get() { return _async.default; } }); var _async = _interopcitationRequireDefault(citationRequire("./async")); var _validate = citationRequire("./validate"); Object.keys(_validate).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; Object.defineProperty(exports, key, { enumerable: true, get: function get() { return _validate[key]; } }); }); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } },{"./async":321,"./validate":329}],329:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.validateOutputOptions = exports.validateOptions = void 0; function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var formats = ['real', 'string']; var types = ['json', 'html', 'string', 'rtf']; var styles = ['csl', 'bibtex', 'bibtxt', 'citation-*']; var wrapperTypes = ['string', 'function']; var validateOutputOptions = function validateOutputOptions(options) { if (_typeof(options) !== 'object') { throw new TypeError('Options not an object!'); } var format = options.format, type = options.type, style = options.style, lang = options.lang, append = options.append, prepend = options.prepend; if (format && !formats.includes(format)) { throw new TypeError("Option format (\"".concat(format, "\") should be one of: ").concat(formats)); } else if (type && !types.includes(type)) { throw new TypeError("Option type (\"".concat(type, "\") should be one of: ").concat(types)); } else if (style && !styles.includes(style) && !/^citation/.test(style)) { throw new TypeError("Option style (\"".concat(style, "\") should be one of: ").concat(styles)); } else if (lang && typeof lang !== 'string') { throw new TypeError("Option lang should be a string, but is a ".concat(_typeof(lang))); } else if (prepend && !wrapperTypes.includes(_typeof(prepend))) { throw new TypeError("Option prepend should be a string or a function, but is a ".concat(_typeof(prepend))); } else if (append && !wrapperTypes.includes(_typeof(append))) { throw new TypeError("Option append should be a string or a function, but is a ".concat(_typeof(append))); } if (/^citation/.test(style) && type === 'json') { throw new Error("Combination type/style of json/citation-* is not valid: ".concat(type, "/").concat(style)); } return true; }; exports.validateOutputOptions = validateOutputOptions; var validateOptions = function validateOptions(options) { if (_typeof(options) !== 'object') { throw new TypeError('Options not an object!'); } if (options.output) { validateOutputOptions(options.output); } else if (options.maxChainLength && typeof options.maxChainLength !== 'number') { throw new TypeError('Option maxChainLength should be a number'); } else if (options.forceType && typeof options.forceType !== 'string') { throw new TypeError('Option forceType should be a string'); } return true; }; exports.validateOptions = validateOptions; },{}],330:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _date = citationRequire("@citation-js/date"); var _default = _date.format; exports.default = _default; },{"@citation-js/date":276}],331:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.textDict = exports.htmlDict = exports.get = exports.list = exports.has = exports.remove = exports.add = exports.register = void 0; var _register = _interopcitationRequireDefault(citationRequire("../util/register")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var validate = function validate(name, dict) { if (typeof name !== 'string') { throw new TypeError("Invalid dict name, expected string, got ".concat(_typeof(name))); } else if (_typeof(dict) !== 'object') { throw new TypeError("Invalid dict, expected object, got ".concat(_typeof(dict))); } for (var entryName in dict) { var entry = dict[entryName]; if (!Array.isArray(entry) || entry.some(function (part) { return typeof part !== 'string'; })) { throw new TypeError("Invalid dict entry \"".concat(entryName, "\", expected array of strings")); } } }; var register = new _register.default({ html: { bibliographyContainer: ['<div class="csl-bib-body>', '</div>'], entry: ['<div class="csl-entry>', '</div>'], list: ['<ul style="list-style-type:none">', '</ul>'], listItem: ['<li>', '</li>'] }, text: { bibliographyContainer: ['', '\n'], entry: ['', '\n'], list: ['\n', ''], listItem: ['\t', '\n'] } }); exports.register = register; var add = function add(name, dict) { validate(name, dict); register.set(name, dict); }; exports.add = add; var remove = function remove(name) { register.remove(name); }; exports.remove = remove; var has = function has(name) { return register.has(name); }; exports.has = has; var list = function list() { return register.list(); }; exports.list = list; var get = function get(name) { if (!register.has(name)) { logger.error('[get]', "Dict \"".concat(name, "\" unavailable")); return undefined; } return register.get(name); }; exports.get = get; var htmlDict = { wr_start: '<div class="csl-bib-body">', wr_end: '</div>', en_start: '<div class="csl-entry">', en_end: '</div>', ul_start: '<ul style="list-style-type:none">', ul_end: '</ul>', li_start: '<li>', li_end: '</li>' }; exports.htmlDict = htmlDict; var textDict = { wr_start: '', wr_end: '\n', en_start: '', en_end: '\n', ul_start: '\n', ul_end: '', li_start: '\t', li_end: '\n' }; exports.textDict = textDict; },{"../util/register":405}],332:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _exportNames = { bibtex: true, date: true, name: true, dict: true, bibtxt: true, json: true, label: true }; Object.defineProperty(exports, "date", { enumerable: true, get: function get() { return _date.default; } }); Object.defineProperty(exports, "name", { enumerable: true, get: function get() { return _name.default; } }); Object.defineProperty(exports, "bibtxt", { enumerable: true, get: function get() { return _bibtxt.default; } }); Object.defineProperty(exports, "json", { enumerable: true, get: function get() { return _json2.getJsonWrapper; } }); Object.defineProperty(exports, "label", { enumerable: true, get: function get() { return _label2.getLabel; } }); exports.dict = exports.bibtex = void 0; var _date = _interopcitationRequireDefault(citationRequire("./date")); var _name = _interopcitationRequireDefault(citationRequire("./name")); citationRequire("./modules/"); var dict = _interopcitationRequireWildcard(citationRequire("./dict")); exports.dict = dict; var _json = _interopcitationRequireDefault(citationRequire("./modules/bibtex/json")); var _label = _interopcitationRequireDefault(citationRequire("./modules/bibtex/label")); var _text = _interopcitationRequireDefault(citationRequire("./modules/bibtex/text")); var _type = _interopcitationRequireDefault(citationRequire("./modules/bibtex/type")); var _bibtxt = _interopcitationRequireDefault(citationRequire("./modules/bibtex/bibtxt")); var _json2 = citationRequire("./modules/json"); var _label2 = citationRequire("./modules/label"); var _registrar = citationRequire("./registrar"); Object.keys(_registrar).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; Object.defineProperty(exports, key, { enumerable: true, get: function get() { return _registrar[key]; } }); }); function _interopcitationRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var bibtex = { json: _json.default, label: _label.default, text: _text.default, type: _type.default }; exports.bibtex = bibtex; },{"./date":330,"./dict":331,"./modules/":349,"./modules/bibtex/bibtxt":333,"./modules/bibtex/json":335,"./modules/bibtex/label":336,"./modules/bibtex/text":337,"./modules/bibtex/type":338,"./modules/json":350,"./modules/label":351,"./name":354,"./registrar":355}],333:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.getBibtxt = void 0; var _json = _interopcitationRequireDefault(citationRequire("./json")); var _dict = citationRequire("../../dict"); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var getBibtxt = function getBibtxt(src, dict) { var entries = src.map(function (entry) { var bib = (0, _json.default)(entry); bib.properties.type = bib.type; var properties = Object.entries(bib.properties).map(function (_ref) { var _ref2 = _slicedToArray(_ref, 2), prop = _ref2[0], value = _ref2[1]; return dict.listItem.join("".concat(prop, ": ").concat(value)); }).join(''); return dict.entry.join("[".concat(bib.label, "]").concat(dict.list.join(properties))); }).join('\n'); return dict.bibliographyContainer.join(entries); }; exports.getBibtxt = getBibtxt; var getBibtxtWrapper = function getBibtxtWrapper(src, html) { var dict = (0, _dict.get)(html ? 'html' : 'text'); return getBibtxt(src, dict); }; var _default = getBibtxtWrapper; exports.default = _default; },{"../../dict":331,"./json":335}],334:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _dict = citationRequire("../../dict"); var _json = _interopcitationRequireDefault(citationRequire("./json")); var _text = citationRequire("./text"); var _bibtxt = citationRequire("./bibtxt"); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var factory = function factory(formatter) { return function (data) { var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, type = _ref.type, _ref$format = _ref.format, format = _ref$format === void 0 ? type || 'text' : _ref$format; if (format === 'object') { return data.map(_json.default); } else { return (0, _dict.has)(format) ? formatter(data, (0, _dict.get)(format)) : ''; } }; }; var _default = { bibtex: factory(_text.getBibtex), bibtxt: factory(_bibtxt.getBibtxt) }; exports.default = _default; },{"../../dict":331,"./bibtxt":333,"./json":335,"./text":337}],335:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _type = _interopcitationRequireDefault(citationRequire("./type")); var _label = _interopcitationRequireDefault(citationRequire("./label")); var _name = _interopcitationRequireDefault(citationRequire("../../name")); var _date = _interopcitationRequireDefault(citationRequire("../../date")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var getBibTeXJSON = function getBibTeXJSON(src) { var res = { label: (0, _label.default)(src), type: (0, _type.default)(src.type) }; var props = {}; var simple = { 'collection-title': 'series', 'container-title': src.type === 'chapter' ? 'booktitle' : 'journal', edition: 'edition', event: 'organization', DOI: 'doi', ISBN: 'isbn', ISSN: 'issn', issue: 'number', language: 'language', note: 'note', 'number-of-pages': 'numpages', PMID: 'pmid', PMCID: 'pmcid', publisher: 'publisher', 'publisher-place': 'address', title: 'title', URL: 'url', volume: 'volume' }; for (var prop in simple) { if (src.hasOwnProperty(prop)) { props[simple[prop]] = src[prop] + ''; } } if (src.author) { props.author = src.author.map(function (name) { return (0, _name.default)(name, true); }).join(' and '); } if (src.editor) { props.editor = src.editor.map(function (name) { return (0, _name.default)(name, true); }).join(' and '); } if (!src.note && src.accessed) { props.note = "[Online; accessed ".concat((0, _date.default)(src.accessed), "]"); } if (src.page) { props.pages = src.page.replace('-', '--'); } if (src.issued) { var dateParts = src.issued['date-parts'][0]; if (dateParts.length > 0) { props.date = (0, _date.default)(src.issued); props.year = dateParts[0].toString(); } if (dateParts.length > 1) { props.month = dateParts[1].toString(); } if (dateParts.length > 2) { props.day = dateParts[2].toString(); } } res.properties = props; return res; }; var _default = getBibTeXJSON; exports.default = _default; },{"../../date":330,"../../name":354,"./label":336,"./type":338}],336:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var getBibTeXLabel = function getBibTeXLabel() { var entry = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; if (entry['citation-label']) { return entry['citation-label']; } var res = ''; if (entry.author) { res += entry.author[0].family || entry.author[0].literal; } if (entry.issued && entry.issued['date-parts'] && entry.issued['date-parts'][0]) { res += entry.issued['date-parts'][0][0]; } if (entry['year-suffix']) { res += entry['year-suffix']; } else if (entry.title) { res += entry.title.replace(/<\/?.*?>/g, '').match(/^(?:(?:the|a|an)\s+)?(\S+)/i)[1]; } return res; }; var _default = getBibTeXLabel; exports.default = _default; },{}],337:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.getBibtex = void 0; var _json = _interopcitationRequireDefault(citationRequire("./json")); var _dict = citationRequire("../../dict"); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var syntaxTokens = { '|': '{\\textbar}', '<': '{\\textless}', '>': '{\\textgreater}', '~': '{\\textasciitilde}', '^': '{\\textasciicircum}', '\\': '{\\textbackslash}', '{': '\\{\\vphantom{\\}}', '}': '\\vphantom{\\{}\\}' }; function escapeValue(value) { return value.replace(/[|<>~^\\{}]/g, function (match) { return syntaxTokens[match]; }); } var bracketMappings = { '': '', '{': '}' }; function wrapInBrackets(prop, value) { var delStart = !isNaN(+value) ? '' : '{'; var delEnd = bracketMappings[delStart]; return delStart + value + delEnd; } var richTextMappings = { 'i': '\\textit{', 'b': '\\textbf{', 'sc': '\\textsc{', 'sup': '\\textsuperscript{', 'sub': '\\textsubscript{', 'span style="font-variant:small-caps;"': '\\textsc{', 'span class="nocase"': '{' }; function serializeRichTextValue(value) { var tokens = value.split(/<(\/.*?|i|b|sc|sup|sub|span.*?)>/g); tokens = tokens.map(function (token, index) { if (index % 2 === 0) { return escapeValue(token); } else if (token in richTextMappings) { return richTextMappings[token]; } else { return '}'; } }); return tokens.join(''); } var richTextFields = ['title']; function serializeValue(prop, value, dict) { if (richTextFields.includes(prop)) { value = serializeRichTextValue(value); } else { value = escapeValue(value); } return dict.listItem.join("".concat(prop, "=").concat(wrapInBrackets(prop, value), ",")); } function serializePropertyList(properties, dict) { return properties.map(function (_ref) { var _ref2 = _slicedToArray(_ref, 2), prop = _ref2[0], value = _ref2[1]; return serializeValue(prop, value, dict); }).join(''); } function serializeEntry(entry, dict) { var _getBibTeXJSON = (0, _json.default)(entry), type = _getBibTeXJSON.type, label = _getBibTeXJSON.label, properties = _getBibTeXJSON.properties; properties = serializePropertyList(Object.entries(properties), dict); return dict.entry.join("@".concat(type, "{").concat(label, ",").concat(dict.list.join(properties), "}")); } var getBibtex = function getBibtex(src, dict) { var entries = src.map(function (entry) { return serializeEntry(entry, dict); }).join(''); return dict.bibliographyContainer.join(entries); }; exports.getBibtex = getBibtex; var getBibTeXWrapper = function getBibTeXWrapper(src, html) { var dict = (0, _dict.get)(html ? 'html' : 'text'); return getBibtex(src, dict); }; var _default = getBibTeXWrapper; exports.default = _default; },{"../../dict":331,"./json":335}],338:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var bibtexTypes = { article: 'article', 'article-journal': 'article', 'article-magazine': 'article', 'article-newspaper': 'article', book: 'book', chapter: 'incollection', graphic: 'misc', interview: 'misc', manuscript: 'unpublished', motion_picture: 'misc', 'paper-conference': 'inproceedings', patent: 'patent', personal_communication: 'misc', report: 'techreport', thesis: 'phdthesis', webpage: 'misc' }; var fetchBibTeXType = function fetchBibTeXType(pubType) { if (pubType in bibtexTypes) { return bibtexTypes[pubType]; } else { logger.warn("CSL publication type not recognized: ".concat(pubType, ". Interpreting as \"misc\".")); return 'misc'; } }; var _default = fetchBibTeXType; exports.default = _default; },{}],339:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getWrappedEntry = void 0; function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var getAffix = function getAffix(source, affix) { return typeof affix === 'function' ? affix(source) : typeof affix === 'string' ? affix : ''; }; var htmlRegex = /^([^>]+>)([\s\S]+)(<[^<]+)$/i; var getWrappedEntry = function getWrappedEntry(value, source, _ref) { var prepend = _ref.prepend, append = _ref.append; var _ref2 = value.match(htmlRegex) || [], _ref3 = _slicedToArray(_ref2, 4), _ref3$ = _ref3[1], start = _ref3$ === void 0 ? '' : _ref3$, _ref3$2 = _ref3[2], content = _ref3$2 === void 0 ? value : _ref3$2, _ref3$3 = _ref3[3], end = _ref3$3 === void 0 ? '' : _ref3$3; var prefix = getAffix(source, prepend); var suffix = getAffix(source, append); return start + prefix + content + suffix + end; }; exports.getWrappedEntry = getWrappedEntry; },{}],340:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getPrefixedEntry = exports.getAttributedEntry = void 0; var getAttributedEntry = function getAttributedEntry(string, name, value) { return string.replace(/^\s*<[a-z]+/i, "$& data-".concat(name, "=\"").concat(value, "\"")); }; exports.getAttributedEntry = getAttributedEntry; var getPrefixedEntry = function getPrefixedEntry(value, id) { return getAttributedEntry(value, 'csl-entry-id', id); }; exports.getPrefixedEntry = getPrefixedEntry; },{}],341:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = bibliography; var _engines = _interopcitationRequireDefault(citationRequire("./engines")); var _attr = citationRequire("./attr.js"); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var getAffix = function getAffix(source, affix) { return typeof affix === 'function' ? affix(source) : affix || ''; }; function bibliography(data) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var _options$template = options.template, template = _options$template === void 0 ? 'apa' : _options$template, _options$lang = options.lang, lang = _options$lang === void 0 ? 'en-US' : _options$lang, _options$format = options.format, format = _options$format === void 0 ? 'text' : _options$format, _options$nosort = options.nosort, nosort = _options$nosort === void 0 ? false : _options$nosort; var citeproc = (0, _engines.default)(data, template, lang, format); var sortedIds = citeproc.updateItems(data.map(function (entry) { return entry.id; }), nosort); if (options.append || options.prepend) { var append = options.append, prepend = options.prepend; var items = data.reduce(function (items, entry) { items[entry.id] = entry; return items; }, {}); citeproc.sys.wrapBibliographyEntry = function (id) { var entry = items[id]; return [getAffix(entry, prepend), getAffix(entry, append)]; }; } else { citeproc.sys.wrapBibliographyEntry = function () { return ['', '']; }; } var bibliography = citeproc.makeBibliography(); var _bibliography = _slicedToArray(bibliography, 2), _bibliography$ = _bibliography[0], bibstart = _bibliography$.bibstart, bibend = _bibliography$.bibend, bibBody = _bibliography[1]; var entries = bibBody.map(function (element, index) { return (0, _attr.getPrefixedEntry)(element, sortedIds[index]); }); return bibstart + entries.join('') + bibend; } },{"./attr.js":340,"./engines":343}],342:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = citation; var _engines = _interopcitationRequireDefault(citationRequire("./engines")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function citation(data) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var _options$template = options.template, template = _options$template === void 0 ? 'apa' : _options$template, _options$lang = options.lang, lang = _options$lang === void 0 ? 'en-US' : _options$lang, _options$format = options.format, format = _options$format === void 0 ? 'text' : _options$format; var ids = data.map(function (_ref) { var id = _ref.id; return id; }); var entries = options.entry ? [].concat(options.entry) : ids; var citeproc = (0, _engines.default)(data, template, lang, format); citeproc.updateItems(ids); var citation = citeproc.previewCitationCluster({ citationItems: entries.map(function (id) { return { id: id }; }), properties: { noteIndex: 0 } }, [], [], format); return citation; } },{"./engines":343}],343:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fetchEngine = exports.default = void 0; var _citeproc = _interopcitationRequireDefault(citationRequire("citeproc")); var _styles = citationRequire("./styles"); var _locales = citationRequire("./locales"); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var getWrapperProxy = function getWrapperProxy(original) { return function (state, entry) { if (state.sys.wrapBibliographyEntry) { var _state$sys$wrapBiblio = state.sys.wrapBibliographyEntry(this.system_id), _state$sys$wrapBiblio2 = _slicedToArray(_state$sys$wrapBiblio, 2), prefix = _state$sys$wrapBiblio2[0], postfix = _state$sys$wrapBiblio2[1]; entry = [prefix, entry, postfix].join(''); } return original(state, entry); }; }; for (var format in _citeproc.default.Output.Formats) { var original = _citeproc.default.Output.Formats[format]['@bibliography/entry']; _citeproc.default.Output.Formats[format]['@bibliography/entry'] = getWrapperProxy(original); } var engines = {}; var fetchEngine = function fetchEngine(style, lang, template, retrieveItem, retrieveLocale) { var engineHash = "".concat(style, "|").concat(lang); var engine; if (engines.hasOwnProperty(engineHash)) { engine = engines[engineHash]; engine.sys.retrieveItem = retrieveItem; } else { engine = engines[engineHash] = new _citeproc.default.Engine({ retrieveLocale: retrieveLocale, retrieveItem: retrieveItem }, template, lang, true); } return engine; }; exports.fetchEngine = fetchEngine; var prepareEngine = function prepareEngine(data, templateName, language, format) { var items = data.reduce(function (store, entry) { store[entry.id] = entry; return store; }, {}); var template = _styles.templates.get(_styles.templates.has(templateName) ? templateName : 'apa'); language = _locales.locales.has(language) ? language : 'en-US'; var engine = fetchEngine(templateName, language, template, function (key) { return items[key]; }, _locales.locales.get.bind(_locales.locales)); engine.setOutputFormat(format); return engine; }; var _default = prepareEngine; exports.default = _default; },{"./locales":346,"./styles":348,"citeproc":282}],344:[function(citationRequire,module,exports){ "use strict"; var _plugins = citationRequire("../../../plugins/"); var _locales = citationRequire("./locales"); var _styles = citationRequire("./styles"); var _engines = _interopcitationRequireDefault(citationRequire("./engines")); var _bibliography = _interopcitationRequireDefault(citationRequire("./bibliography")); var _citation = _interopcitationRequireDefault(citationRequire("./citation")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } (0, _plugins.add)('csl', { output: { bibliography: _bibliography.default, citation: _citation.default }, config: { engine: _engines.default, locales: _locales.locales, templates: _styles.templates } }); },{"../../../plugins/":399,"./bibliography":341,"./citation":342,"./engines":343,"./locales":346,"./styles":348}],345:[function(citationRequire,module,exports){ module.exports={ "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><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=\"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=\"ad\">AD</term><term name=\"bc\">BC</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=\"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=\"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>\n</term><term name=\"volume\"><single>volume</single><multiple>volumes</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=\"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 & translator</single><multiple>editors & translators</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. & tran.</single><multiple>eds. & trans.</multiple></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 & translated 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. & 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>\n<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>", "nl-NL": "<?xml version=\"1.0\" encoding=\"utf-8\"?><locale xmlns=\"http://purl.org/net/xbiblio/csl\" version=\"1.0\" xml:lang=\"nl-NL\"><info><translator><name>Rintze Zelle</name><uri>http://twitter.com/rintzezelle</uri></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>2012-07-04T23:31:02+00:00</updated></info><style-options punctuation-in-quote=\"false\"/><date form=\"text\"><date-part name=\"day\" suffix=\" \"/><date-part name=\"month\" suffix=\" \"/><date-part name=\"year\"/></date><date form=\"numeric\"><date-part name=\"day\" suffix=\"-\" range-delimiter=\"/\"/><date-part name=\"month\" form=\"numeric\" suffix=\"-\" range-delimiter=\"/\"/><date-part name=\"year\"/></date><terms><term name=\"accessed\">geraadpleegd</term><term name=\"and\">en</term><term name=\"and others\">en anderen</term><term name=\"anonymous\">anoniem</term><term name=\"anonymous\" form=\"short\">anon.</term><term name=\"at\">bij</term><term name=\"available at\">beschikbaar op</term><term name=\"by\">door</term><term name=\"circa\">circa</term><term name=\"circa\" form=\"short\">c.</term><term name=\"cited\">geciteerd</term><term name=\"edition\"><single>editie</single><multiple>edities</multiple></term><term name=\"edition\" form=\"short\">ed.</term><term name=\"et-al\">e.a.</term><term name=\"forthcoming\">in voorbereiding</term><term name=\"from\">van</term><term name=\"ibid\">ibid.</term><term name=\"in\">in</term><term name=\"in press\">in druk</term><term name=\"internet\">internet</term><term name=\"interview\">interview</term><term name=\"letter\">brief</term><term name=\"no date\">zonder datum</term><term name=\"no date\" form=\"short\">z.d.</term><term name=\"online\">online</term><term name=\"presented at\">gepresenteerd bij</term><term name=\"reference\"><single>referentie</single><multiple>referenties</multiple></term><term name=\"reference\" form=\"short\"><single>ref.</single><multiple>refs.</multiple></term><term name=\"retrieved\">geraadpleegd</term><term name=\"scale\">schaal</term><term name=\"version\">versie</term><term name=\"ad\">AD</term><term name=\"bc\">BC</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=\"ordinal\">ste</term><term name=\"ordinal-00\" match=\"whole-number\">de</term><term name=\"ordinal-02\" match=\"last-two-digits\">de</term><term name=\"ordinal-03\" match=\"last-two-digits\">de</term><term name=\"ordinal-04\" match=\"last-two-digits\">de</term><term name=\"ordinal-05\" match=\"last-two-digits\">de</term><term name=\"ordinal-06\" match=\"last-two-digits\">de</term><term name=\"ordinal-07\" match=\"last-two-digits\">de</term><term name=\"ordinal-09\" match=\"last-two-digits\">de</term><term name=\"ordinal-10\">de</term><term name=\"ordinal-11\">de</term><term name=\"ordinal-12\">de</term><term name=\"ordinal-13\">de</term><term name=\"ordinal-14\">de</term><term name=\"ordinal-15\">de</term><term name=\"ordinal-16\">de</term><term name=\"ordinal-17\">de</term><term name=\"ordinal-18\">de</term><term name=\"ordinal-19\">de</term><term name=\"long-ordinal-01\">eerste</term><term name=\"long-ordinal-02\">tweede</term><term name=\"long-ordinal-03\">derde</term><term name=\"long-ordinal-04\">vierde</term><term name=\"long-ordinal-05\">vijfde</term><term name=\"long-ordinal-06\">zesde</term><term name=\"long-ordinal-07\">zevende</term><term name=\"long-ordinal-08\">achtste</term><term name=\"long-ordinal-09\">negende</term><term name=\"long-ordinal-10\">tiende</term><term name=\"book\"><single>boek</single><multiple>boeken</multiple></term><term name=\"chapter\"><single>hoofdstuk</single><multiple>hoofdstukken</multiple></term><term name=\"column\"><single>column</single><multiple>columns</multiple></term><term name=\"figure\"><single>figuur</single><multiple>figuren</multiple></term><term name=\"folio\"><single>folio</single><multiple>folio's</multiple></term><term name=\"issue\"><single>nummer</single><multiple>nummers</multiple></term><term name=\"line\"><single>regel</single><multiple>regels</multiple>\n</term><term name=\"note\"><single>aantekening</single><multiple>aantekeningen</multiple></term><term name=\"opus\"><single>opus</single><multiple>opera</multiple></term><term name=\"page\"><single>pagina</single><multiple>pagina's</multiple></term><term name=\"number-of-pages\"><single>pagina</single><multiple>pagina's</multiple></term><term name=\"paragraph\"><single>paragraaf</single><multiple>paragrafen</multiple></term><term name=\"part\"><single>deel</single><multiple>delen</multiple></term><term name=\"section\"><single>sectie</single><multiple>secties</multiple></term><term name=\"sub verbo\"><single>sub verbo</single><multiple>sub verbis</multiple></term><term name=\"verse\"><single>vers</single><multiple>versen</multiple></term><term name=\"volume\"><single>volume</single><multiple>volumes</multiple></term><term name=\"book\" form=\"short\">bk.</term><term name=\"chapter\" form=\"short\">hfdst.</term><term name=\"column\" form=\"short\">col.</term><term name=\"figure\" form=\"short\">fig.</term><term name=\"folio\" form=\"short\">f.</term><term name=\"issue\" form=\"short\">nr.</term><term name=\"line\" form=\"short\">l.</term><term name=\"note\" form=\"short\">n.</term><term name=\"opus\" form=\"short\">op.</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\">par.</term><term name=\"part\" form=\"short\">deel</term><term name=\"section\" form=\"short\">sec.</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=\"director\"><single>regisseur</single><multiple>regisseurs</multiple></term><term name=\"editor\"><single>redacteur</single><multiple>redacteuren</multiple></term><term name=\"editorial-director\"><single>redacteur</single><multiple>redacteuren</multiple></term><term name=\"illustrator\"><single>illustrator</single><multiple>illustrators</multiple></term><term name=\"translator\"><single>vertaler</single><multiple>vertalers</multiple></term><term name=\"editortranslator\"><single>redacteur & vertaler</single><multiple>redacteuren & vertalers</multiple></term><term name=\"director\" form=\"short\"><single>reg.</single><multiple>reg.</multiple></term><term name=\"editor\" form=\"short\"><single>red.</single><multiple>red.</multiple></term><term name=\"editorial-director\" form=\"short\"><single>red.</single><multiple>red.</multiple></term><term name=\"illustrator\" form=\"short\"><single>ill.</single><multiple>ill.</multiple></term><term name=\"translator\" form=\"short\"><single>vert.</single><multiple>vert.</multiple></term><term name=\"editortranslator\" form=\"short\"><single>red. & vert.</single><multiple>red. & vert.</multiple></term><term name=\"container-author\" form=\"verb\">door</term><term name=\"director\" form=\"verb\">geregisseerd door</term><term name=\"editor\" form=\"verb\">bewerkt door</term><term name=\"editorial-director\" form=\"verb\">bewerkt door</term><term name=\"illustrator\" form=\"verb\">geïllustreerd door</term><term name=\"interviewer\" form=\"verb\">geïnterviewd door</term><term name=\"recipient\" form=\"verb\">ontvangen door</term><term name=\"reviewed-author\" form=\"verb\">door</term><term name=\"translator\" form=\"verb\">vertaald door</term><term name=\"editortranslator\" form=\"verb\">bewerkt & vertaald door</term><term name=\"director\" form=\"verb-short\">geregisseerd door</term><term name=\"editor\" form=\"verb-short\">bewerkt door</term><term name=\"editorial-director\" form=\"verb-short\">bewerkt door</term><term name=\"illustrator\" form=\"verb-short\">geïllustreerd door</term><term name=\"translator\" form=\"verb-short\">vertaald door</term><term name=\"editortranslator\" form=\"verb-short\">bewerkt & vertaald door</term>\n<term name=\"month-01\">januari</term><term name=\"month-02\">februari</term><term name=\"month-03\">maart</term><term name=\"month-04\">april</term><term name=\"month-05\">mei</term><term name=\"month-06\">juni</term><term name=\"month-07\">juli</term><term name=\"month-08\">augustus</term><term name=\"month-09\">september</term><term name=\"month-10\">oktober</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\">mrt.</term><term name=\"month-04\" form=\"short\">apr.</term><term name=\"month-05\" form=\"short\">mei</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\">okt.</term><term name=\"month-11\" form=\"short\">nov.</term><term name=\"month-12\" form=\"short\">dec.</term><term name=\"season-01\">lente</term><term name=\"season-02\">zomer</term><term name=\"season-03\">herst</term><term name=\"season-04\">winter</term></terms></locale>", "fr-FR": "<?xml version=\"1.0\" encoding=\"utf-8\"?><locale xmlns=\"http://purl.org/net/xbiblio/csl\" version=\"1.0\" xml:lang=\"fr-FR\"><info><translator><name>Grégoire Colly</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>2012-07-04T23:31:02+00:00</updated></info><style-options punctuation-in-quote=\"false\" limit-day-ordinals-to-day-1=\"true\"/><date form=\"text\"><date-part name=\"day\" suffix=\" \"/><date-part name=\"month\" suffix=\" \"/><date-part name=\"year\"/></date><date form=\"numeric\"><date-part name=\"day\" form=\"numeric-leading-zeros\" suffix=\"/\"/><date-part name=\"month\" form=\"numeric-leading-zeros\" suffix=\"/\"/><date-part name=\"year\"/></date><terms><term name=\"accessed\">consulté le</term><term name=\"and\">et</term><term name=\"and others\">et autres</term><term name=\"anonymous\">anonyme</term><term name=\"anonymous\" form=\"short\">anon.</term><term name=\"at\">sur</term><term name=\"available at\">disponible sur</term><term name=\"by\">par</term><term name=\"circa\">vers</term><term name=\"circa\" form=\"short\">v.</term><term name=\"cited\">cité</term><term name=\"edition\" gender=\"feminine\"><single>édition</single><multiple>éditions</multiple></term><term name=\"edition\" form=\"short\">éd.</term><term name=\"et-al\">et al.</term><term name=\"forthcoming\">à paraître</term><term name=\"from\">à l'adresse</term><term name=\"ibid\">ibid.</term><term name=\"in\">in</term><term name=\"in press\">sous presse</term><term name=\"internet\">Internet</term><term name=\"interview\">entretien</term><term name=\"letter\">lettre</term><term name=\"no date\">sans date</term><term name=\"no date\" form=\"short\">s. d.</term><term name=\"online\">en ligne</term><term name=\"presented at\">présenté à </term><term name=\"reference\"><single>référence</single><multiple>références</multiple></term><term name=\"reference\" form=\"short\"><single>réf.</single><multiple>réf.</multiple></term><term name=\"retrieved\">consulté</term><term name=\"scale\">échelle</term><term name=\"version\">version</term><term name=\"ad\">apr. J.-C.</term><term name=\"bc\">av. J.-C.</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=\"ordinal\">ᵉ</term><term name=\"ordinal-01\" gender-form=\"feminine\" match=\"whole-number\">ʳᵉ</term><term name=\"ordinal-01\" gender-form=\"masculine\" match=\"whole-number\">ᵉʳ</term><term name=\"long-ordinal-01\">premier</term><term name=\"long-ordinal-02\">deuxième</term><term name=\"long-ordinal-03\">troisième</term><term name=\"long-ordinal-04\">quatrième</term><term name=\"long-ordinal-05\">cinquième</term><term name=\"long-ordinal-06\">sixième</term><term name=\"long-ordinal-07\">septième</term><term name=\"long-ordinal-08\">huitième</term><term name=\"long-ordinal-09\">neuvième</term><term name=\"long-ordinal-10\">dixième</term><term name=\"book\"><single>livre</single><multiple>livres</multiple></term><term name=\"chapter\"><single>chapitre</single><multiple>chapitres</multiple></term><term name=\"column\"><single>colonne</single><multiple>colonnes</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\" gender=\"masculine\"><single>numéro</single><multiple>numéros</multiple></term><term name=\"line\"><single>ligne</single><multiple>lignes</multiple></term><term name=\"note\"><single>note</single><multiple>notes</multiple></term><term name=\"opus\"><single>opus</single><multiple>opus</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>paragraphe</single><multiple>paragraphes</multiple></term><term name=\"part\"><single>partie</single><multiple>parties</multiple></term><term name=\"section\"><single>section</single><multiple>sections</multiple>\n</term><term name=\"sub verbo\"><single>sub verbo</single><multiple>sub verbis</multiple></term><term name=\"verse\"><single>verset</single><multiple>versets</multiple></term><term name=\"volume\" gender=\"masculine\"><single>volume</single><multiple>volumes</multiple></term><term name=\"book\" form=\"short\">liv.</term><term name=\"chapter\" form=\"short\">chap.</term><term name=\"column\" form=\"short\">col.</term><term name=\"figure\" form=\"short\">fig.</term><term name=\"folio\" form=\"short\"><single>fáµ’</single><multiple>fáµ’Ë¢</multiple></term><term name=\"issue\" form=\"short\"><single>náµ’</single><multiple>náµ’Ë¢</multiple></term><term name=\"line\" form=\"short\">l.</term><term name=\"note\" form=\"short\">n.</term><term name=\"opus\" form=\"short\">op.</term><term name=\"page\" form=\"short\"><single>p.</single><multiple>p.</multiple></term><term name=\"number-of-pages\" form=\"short\"><single>p.</single><multiple>p.</multiple></term><term name=\"paragraph\" form=\"short\">paragr.</term><term name=\"part\" form=\"short\">part.</term><term name=\"section\" form=\"short\">sect.</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>v.</multiple></term><term name=\"volume\" form=\"short\"><single>vol.</single><multiple>vol.</multiple></term><term name=\"paragraph\" form=\"symbol\"><single>§</single><multiple>§</multiple></term><term name=\"section\" form=\"symbol\"><single>§</single><multiple>§</multiple></term><term name=\"director\"><single>réalisateur</single><multiple>réalisateurs</multiple></term><term name=\"editor\"><single>éditeur</single><multiple>éditeurs</multiple></term><term name=\"editorial-director\"><single>directeur</single><multiple>directeurs</multiple></term><term name=\"illustrator\"><single>illustrateur</single><multiple>illustrateurs</multiple></term><term name=\"translator\"><single>traducteur</single><multiple>traducteurs</multiple></term><term name=\"editortranslator\"><single>éditeur et traducteur</single><multiple>éditeurs et traducteurs</multiple></term><term name=\"director\" form=\"short\"><single>réal.</single><multiple>réal.</multiple></term><term name=\"editor\" form=\"short\"><single>éd.</single><multiple>éd.</multiple></term><term name=\"editorial-director\" form=\"short\"><single>dir.</single><multiple>dir.</multiple></term><term name=\"illustrator\" form=\"short\"><single>ill.</single><multiple>ill.</multiple></term><term name=\"translator\" form=\"short\"><single>trad.</single><multiple>trad.</multiple></term><term name=\"editortranslator\" form=\"short\"><single>éd. et trad.</single><multiple>éd. et trad.</multiple></term><term name=\"container-author\" form=\"verb\">par</term><term name=\"director\" form=\"verb\">réalisé par</term><term name=\"editor\" form=\"verb\">édité par</term><term name=\"editorial-director\" form=\"verb\">sous la direction de</term><term name=\"illustrator\" form=\"verb\">illustré par</term><term name=\"interviewer\" form=\"verb\">entretien réalisé par</term><term name=\"recipient\" form=\"verb\">à </term><term name=\"reviewed-author\" form=\"verb\">par</term><term name=\"translator\" form=\"verb\">traduit par</term><term name=\"editortranslator\" form=\"verb\">édité et traduit par</term><term name=\"director\" form=\"verb-short\">réal. par</term><term name=\"editor\" form=\"verb-short\">éd. par</term><term name=\"editorial-director\" form=\"verb-short\">ss la dir. de</term><term name=\"illustrator\" form=\"verb-short\">ill. par</term><term name=\"translator\" form=\"verb-short\">trad. par</term><term name=\"editortranslator\" form=\"verb-short\">éd. et trad. par</term><term name=\"month-01\" gender=\"masculine\">janvier</term><term name=\"month-02\" gender=\"masculine\">février</term><term name=\"month-03\" gender=\"masculine\">mars</term><term name=\"month-04\" gender=\"masculine\">avril</term><term name=\"month-05\" gender=\"masculine\">mai</term><term name=\"month-06\" gender=\"masculine\">juin</term><term name=\"month-07\" gender=\"masculine\">juillet</term><term name=\"month-08\" gender=\"masculine\">août</term><term name=\"month-09\" gender=\"masculine\">septembre</term><term name=\"month-10\" gender=\"masculine\">\noctobre</term><term name=\"month-11\" gender=\"masculine\">novembre</term><term name=\"month-12\" gender=\"masculine\">décembre</term><term name=\"month-01\" form=\"short\">janv.</term><term name=\"month-02\" form=\"short\">févr.</term><term name=\"month-03\" form=\"short\">mars</term><term name=\"month-04\" form=\"short\">avr.</term><term name=\"month-05\" form=\"short\">mai</term><term name=\"month-06\" form=\"short\">juin</term><term name=\"month-07\" form=\"short\">juill.</term><term name=\"month-08\" form=\"short\">août</term><term name=\"month-09\" form=\"short\">sept.</term><term name=\"month-10\" form=\"short\">oct.</term><term name=\"month-11\" form=\"short\">nov.</term><term name=\"month-12\" form=\"short\">déc.</term><term name=\"season-01\">printemps</term><term name=\"season-02\">été</term><term name=\"season-03\">automne</term><term name=\"season-04\">hiver</term></terms></locale>", "de-DE": "<?xml version=\"1.0\" encoding=\"utf-8\"?><locale xmlns=\"http://purl.org/net/xbiblio/csl\" version=\"1.0\" xml:lang=\"de-DE\"><info><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>2012-07-04T23:31:02+00:00</updated></info><style-options punctuation-in-quote=\"false\"/><date form=\"text\"><date-part name=\"day\" form=\"ordinal\" suffix=\" \"/><date-part name=\"month\" suffix=\" \"/><date-part name=\"year\"/></date><date form=\"numeric\"><date-part name=\"day\" form=\"numeric-leading-zeros\" suffix=\".\"/><date-part name=\"month\" form=\"numeric-leading-zeros\" suffix=\".\"/><date-part name=\"year\"/></date><terms><term name=\"accessed\">zugegriffen</term><term name=\"and\">und</term><term name=\"and others\">und andere</term><term name=\"anonymous\">ohne Autor</term><term name=\"anonymous\" form=\"short\">o. A.</term><term name=\"at\">auf</term><term name=\"available at\">verfügbar unter</term><term name=\"by\">von</term><term name=\"circa\">circa</term><term name=\"circa\" form=\"short\">ca.</term><term name=\"cited\">zitiert</term><term name=\"edition\"><single>Auflage</single><multiple>Auflagen</multiple></term><term name=\"edition\" form=\"short\">Aufl.</term><term name=\"et-al\">u. a.</term><term name=\"forthcoming\">i. E.</term><term name=\"from\">von</term><term name=\"ibid\">ebd.</term><term name=\"in\">in</term><term name=\"in press\">im Druck</term><term name=\"internet\">Internet</term><term name=\"interview\">Interview</term><term name=\"letter\">Brief</term><term name=\"no date\">ohne Datum</term><term name=\"no date\" form=\"short\">o. J.</term><term name=\"online\">online</term><term name=\"presented at\">gehalten auf der</term><term name=\"reference\"><single>Referenz</single><multiple>Referenzen</multiple></term><term name=\"reference\" form=\"short\"><single>Ref.</single><multiple>Ref.</multiple></term><term name=\"retrieved\">abgerufen</term><term name=\"scale\">Maßstab</term><term name=\"version\">Version</term><term name=\"ad\">n. Chr.</term><term name=\"bc\">v. Chr.</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=\"ordinal\">.</term><term name=\"long-ordinal-01\">erster</term><term name=\"long-ordinal-02\">zweiter</term><term name=\"long-ordinal-03\">dritter</term><term name=\"long-ordinal-04\">vierter</term><term name=\"long-ordinal-05\">fünfter</term><term name=\"long-ordinal-06\">sechster</term><term name=\"long-ordinal-07\">siebter</term><term name=\"long-ordinal-08\">achter</term><term name=\"long-ordinal-09\">neunter</term><term name=\"long-ordinal-10\">zehnter</term><term name=\"book\"><single>Buch</single><multiple>Bücher</multiple></term><term name=\"chapter\"><single>Kapitel</single><multiple>Kapitel</multiple></term><term name=\"column\"><single>Spalte</single><multiple>Spalten</multiple></term><term name=\"figure\"><single>Abbildung</single><multiple>Abbildungen</multiple></term><term name=\"folio\"><single>Blatt</single><multiple>Blätter</multiple></term><term name=\"issue\"><single>Nummer</single><multiple>Nummern</multiple></term><term name=\"line\"><single>Zeile</single><multiple>Zeilen</multiple></term><term name=\"note\"><single>Note</single><multiple>Noten</multiple></term><term name=\"opus\"><single>Opus</single><multiple>Opera</multiple></term><term name=\"page\"><single>Seite</single><multiple>Seiten</multiple></term><term name=\"number-of-pages\"><single>Seite</single><multiple>Seiten</multiple></term><term name=\"paragraph\"><single>Absatz</single><multiple>Absätze</multiple></term><term name=\"part\"><single>Teil</single><multiple>Teile</multiple></term><term name=\"section\"><single>Abschnitt</single><multiple>Abschnitte</multiple></term><term name=\"sub verbo\"><single>sub verbo</single><multiple>sub verbis</multiple></term><term name=\"verse\"><single>Vers</single><multiple>Verse</multiple></term><term name=\"volume\"><single>Band</single><multiple>Bände</multiple></term><term name=\"book\" form=\"short\">B.</term>\n<term name=\"chapter\" form=\"short\">Kap.</term><term name=\"column\" form=\"short\">Sp.</term><term name=\"figure\" form=\"short\">Abb.</term><term name=\"folio\" form=\"short\">Fol.</term><term name=\"issue\" form=\"short\">Nr.</term><term name=\"line\" form=\"short\">Z.</term><term name=\"note\" form=\"short\">N.</term><term name=\"opus\" form=\"short\">op.</term><term name=\"page\" form=\"short\"><single>S.</single><multiple>S.</multiple></term><term name=\"number-of-pages\" form=\"short\"><single>S.</single><multiple>S.</multiple></term><term name=\"paragraph\" form=\"short\">Abs.</term><term name=\"part\" form=\"short\">Teil</term><term name=\"section\" form=\"short\">Abschn.</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>V.</multiple></term><term name=\"volume\" form=\"short\"><single>Bd.</single><multiple>Bde.</multiple></term><term name=\"paragraph\" form=\"symbol\"><single>¶</single><multiple>¶¶</multiple></term><term name=\"section\" form=\"symbol\"><single>§</single><multiple>§§</multiple></term><term name=\"director\"><single>Regisseur</single><multiple>Regisseure</multiple></term><term name=\"editor\"><single>Herausgeber</single><multiple>Herausgeber</multiple></term><term name=\"collection-editor\"><single>Reihenherausgeber</single><multiple>Reihenherausgeber</multiple></term><term name=\"editorial-director\"><single>Herausgeber</single><multiple>Herausgeber</multiple></term><term name=\"illustrator\"><single>Illustrator</single><multiple>Illustratoren</multiple></term><term name=\"translator\"><single>Übersetzer</single><multiple>Übersetzer</multiple></term><term name=\"editortranslator\"><single>Herausgeber & Übersetzer</single><multiple>Herausgeber & Übersetzer</multiple></term><term name=\"director\" form=\"short\"><single>Reg.</single><multiple>Reg.</multiple></term><term name=\"editor\" form=\"short\"><single>Hrsg.</single><multiple>Hrsg.</multiple></term><term name=\"collection-editor\" form=\"short\"><single>Hrsg.</single><multiple>Hrsg.</multiple></term><term name=\"editorial-director\" form=\"short\"><single>Hrsg.</single><multiple>Hrsg.</multiple></term><term name=\"illustrator\" form=\"short\"><single>Ill.</single><multiple>Ill.</multiple></term><term name=\"translator\" form=\"short\"><single>Übers.</single><multiple>Übers.</multiple></term><term name=\"editortranslator\" form=\"short\"><single>Hrsg. & Übers.</single><multiple>Hrsg. & Übers</multiple></term><term name=\"container-author\" form=\"verb\">von</term><term name=\"director\" form=\"verb\">Regie von</term><term name=\"editor\" form=\"verb\">herausgegeben von</term><term name=\"collection-editor\" form=\"verb\">herausgegeben von</term><term name=\"editorial-director\" form=\"verb\">herausgegeben von</term><term name=\"illustrator\" form=\"verb\">illustriert von</term><term name=\"interviewer\" form=\"verb\">interviewt von</term><term name=\"recipient\" form=\"verb\">an</term><term name=\"reviewed-author\" form=\"verb\">von</term><term name=\"translator\" form=\"verb\">übersetzt von</term><term name=\"editortranslator\" form=\"verb\">herausgegeben und übersetzt von</term><term name=\"director\" form=\"verb-short\">Reg.</term><term name=\"editor\" form=\"verb-short\">hg. von</term><term name=\"collection-editor\" form=\"verb-short\">hg. von</term><term name=\"editorial-director\" form=\"verb-short\">hg. von</term><term name=\"illustrator\" form=\"verb-short\">illus. von</term><term name=\"translator\" form=\"verb-short\">übers. von</term><term name=\"editortranslator\" form=\"verb-short\">hg. & übers. von</term><term name=\"month-01\">Januar</term><term name=\"month-02\">Februar</term><term name=\"month-03\">März</term><term name=\"month-04\">April</term><term name=\"month-05\">Mai</term><term name=\"month-06\">Juni</term><term name=\"month-07\">Juli</term><term name=\"month-08\">August</term><term name=\"month-09\">September</term><term name=\"month-10\">Oktober</term><term name=\"month-11\">November</term><term name=\"month-12\">Dezember</term><term name=\"month-01\" form=\"short\">Jan.</term><term name=\"month-02\" form=\"short\">Feb.</term>\n<term name=\"month-03\" form=\"short\">März</term><term name=\"month-04\" form=\"short\">Apr.</term><term name=\"month-05\" form=\"short\">Mai</term><term name=\"month-06\" form=\"short\">Juni</term><term name=\"month-07\" form=\"short\">Juli</term><term name=\"month-08\" form=\"short\">Aug.</term><term name=\"month-09\" form=\"short\">Sep.</term><term name=\"month-10\" form=\"short\">Okt.</term><term name=\"month-11\" form=\"short\">Nov.</term><term name=\"month-12\" form=\"short\">Dez.</term><term name=\"season-01\">Frühjahr</term><term name=\"season-02\">Sommer</term><term name=\"season-03\">Herbst</term><term name=\"season-04\">Winter</term></terms></locale>", "es-ES": "<?xml version=\"1.0\" encoding=\"utf-8\"?><locale xmlns=\"http://purl.org/net/xbiblio/csl\" version=\"1.0\" xml:lang=\"es-ES\"><info><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>2012-07-04T23:31:02+00:00</updated></info><style-options punctuation-in-quote=\"false\"/><date form=\"text\"><date-part name=\"day\" suffix=\" de \"/><date-part name=\"month\" suffix=\" de \"/><date-part name=\"year\"/></date><date form=\"numeric\"><date-part name=\"day\" form=\"numeric-leading-zeros\" suffix=\"/\"/><date-part name=\"month\" form=\"numeric-leading-zeros\" suffix=\"/\"/><date-part name=\"year\"/></date><terms><term name=\"accessed\">accedido</term><term name=\"and\">y</term><term name=\"and others\">y otros</term><term name=\"anonymous\">anónimo</term><term name=\"anonymous\" form=\"short\">anón.</term><term name=\"at\">en</term><term name=\"available at\">disponible en</term><term name=\"by\">de</term><term name=\"circa\">circa</term><term name=\"circa\" form=\"short\">c.</term><term name=\"cited\">citado</term><term name=\"edition\"><single>edición</single><multiple>ediciones</multiple></term><term name=\"edition\" form=\"short\">ed.</term><term name=\"et-al\">et al.</term><term name=\"forthcoming\">previsto</term><term name=\"from\">a partir de</term><term name=\"ibid\">ibid.</term><term name=\"in\">en</term><term name=\"in press\">en imprenta</term><term name=\"internet\">internet</term><term name=\"interview\">entrevista</term><term name=\"letter\">carta</term><term name=\"no date\">sin fecha</term><term name=\"no date\" form=\"short\">s. f.</term><term name=\"online\">en lÃnea</term><term name=\"presented at\">presentado en</term><term name=\"reference\"><single>referencia</single><multiple>referencias</multiple></term><term name=\"reference\" form=\"short\"><single>ref.</single><multiple>refs.</multiple></term><term name=\"retrieved\">recuperado</term><term name=\"scale\">escala</term><term name=\"version\">versión</term><term name=\"ad\">d. C.</term><term name=\"bc\">a. C.</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=\"ordinal\">.ª</term><term name=\"long-ordinal-01\">primera</term><term name=\"long-ordinal-02\">segunda</term><term name=\"long-ordinal-03\">tercera</term><term name=\"long-ordinal-04\">cuarta</term><term name=\"long-ordinal-05\">quinta</term><term name=\"long-ordinal-06\">sexta</term><term name=\"long-ordinal-07\">séptima</term><term name=\"long-ordinal-08\">octava</term><term name=\"long-ordinal-09\">novena</term><term name=\"long-ordinal-10\">décima</term><term name=\"book\"><single>libro</single><multiple>libros</multiple></term><term name=\"chapter\"><single>capÃtulo</single><multiple>capÃtulos</multiple></term><term name=\"column\"><single>columna</single><multiple>columnas</multiple></term><term name=\"figure\"><single>figura</single><multiple>figuras</multiple></term><term name=\"folio\"><single>folio</single><multiple>folios</multiple></term><term name=\"issue\"><single>número</single><multiple>números</multiple></term><term name=\"line\"><single>lÃnea</single><multiple>lÃneas</multiple></term><term name=\"note\"><single>nota</single><multiple>notas</multiple></term><term name=\"opus\"><single>opus</single><multiple>opera</multiple></term><term name=\"page\"><single>página</single><multiple>páginas</multiple></term><term name=\"number-of-pages\"><single>página</single><multiple>páginas</multiple></term><term name=\"paragraph\"><single>párrafo</single><multiple>párrafos</multiple></term><term name=\"part\"><single>parte</single><multiple>partes</multiple></term><term name=\"section\"><single>sección</single><multiple>secciones</multiple></term><term name=\"sub verbo\"><single>sub voce</single><multiple>sub vocibus</multiple></term><term name=\"verse\"><single>verso</single><multiple>versos</multiple></term><term name=\"volume\"><single>volumen</single><multiple>volúmenes</multiple></term><term name=\"book\" form=\"short\">lib.</term>\n<term name=\"chapter\" form=\"short\">cap.</term><term name=\"column\" form=\"short\">col.</term><term name=\"figure\" form=\"short\">fig.</term><term name=\"folio\" form=\"short\">f.</term><term name=\"issue\" form=\"short\">n.º</term><term name=\"line\" form=\"short\">l.</term><term name=\"note\" form=\"short\">n.</term><term name=\"opus\" form=\"short\">op.</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\">párr.</term><term name=\"part\" form=\"short\">pt.</term><term name=\"section\" form=\"short\">sec.</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=\"director\"><single>director</single><multiple>directores</multiple></term><term name=\"editor\"><single>editor</single><multiple>editores</multiple></term><term name=\"editorial-director\"><single>editor</single><multiple>editores</multiple></term><term name=\"illustrator\"><single>ilustrador</single><multiple>ilustradores</multiple></term><term name=\"translator\"><single>traductor</single><multiple>traductores</multiple></term><term name=\"editortranslator\"><single>editor y traductor</single><multiple>editores y traductores</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>ilust.</single><multiple>ilusts.</multiple></term><term name=\"translator\" form=\"short\"><single>trad.</single><multiple>trads.</multiple></term><term name=\"editortranslator\" form=\"short\"><single>ed. y trad.</single><multiple>eds. y trads.</multiple></term><term name=\"container-author\" form=\"verb\">de</term><term name=\"director\" form=\"verb\">dirigido por</term><term name=\"editor\" form=\"verb\">editado por</term><term name=\"editorial-director\" form=\"verb\">editado por</term><term name=\"illustrator\" form=\"verb\">ilustrado por</term><term name=\"interviewer\" form=\"verb\">entrevistado por</term><term name=\"recipient\" form=\"verb\">a</term><term name=\"reviewed-author\" form=\"verb\">por</term><term name=\"translator\" form=\"verb\">traducido por</term><term name=\"editortranslator\" form=\"verb\">editado y traducido por</term><term name=\"director\" form=\"verb-short\">dir.</term><term name=\"editor\" form=\"verb-short\">ed.</term><term name=\"editorial-director\" form=\"verb-short\">ed.</term><term name=\"illustrator\" form=\"verb-short\">ilust.</term><term name=\"translator\" form=\"verb-short\">trad.</term><term name=\"editortranslator\" form=\"verb-short\">ed. y trad.</term><term name=\"month-01\">enero</term><term name=\"month-02\">febrero</term><term name=\"month-03\">marzo</term><term name=\"month-04\">abril</term><term name=\"month-05\">mayo</term><term name=\"month-06\">junio</term><term name=\"month-07\">julio</term><term name=\"month-08\">agosto</term><term name=\"month-09\">septiembre</term><term name=\"month-10\">octubre</term><term name=\"month-11\">noviembre</term><term name=\"month-12\">diciembre</term><term name=\"month-01\" form=\"short\">ene.</term><term name=\"month-02\" form=\"short\">feb.</term><term name=\"month-03\" form=\"short\">mar.</term><term name=\"month-04\" form=\"short\">abr.</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\">ago.</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\">\ndic.</term><term name=\"season-01\">primavera</term><term name=\"season-02\">verano</term><term name=\"season-03\">otoño</term><term name=\"season-04\">invierno</term></terms></locale>" } },{}],346:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.locales = exports.default = void 0; var _register = _interopcitationRequireDefault(citationRequire("../../../util/register")); var _locales = _interopcitationRequireDefault(citationRequire("./locales.json")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var locales = new _register.default(_locales.default); exports.locales = locales; var fetchLocale = function fetchLocale(lang) { if (locales.has(lang)) { return locales.get(lang); } else { return locales.get('en-US'); } }; var _default = fetchLocale; exports.default = _default; },{"../../../util/register":405,"./locales.json":345}],347:[function(citationRequire,module,exports){ module.exports={ "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\"><info><title>American Psychological Association 6th 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://owl.english.purdue.edu/owl/resource/560/01/\" rel=\"documentation\"/><author><name>Simon Kornblith</name><email>simon@simonster.com</email></author><contributor><name>Bruce D'Arcus</name></contributor><contributor><name>Curtis M. Humphrey</name></contributor><contributor><name>Richard Karnesky</name><email>karnesky+zotero@gmail.com</email><uri>http://arc.nucapt.northwestern.edu/Richard_Karnesky</uri></contributor><contributor><name>Sebastian Karcher</name></contributor><contributor><name> Brenton M. Wiernik</name><email>zotero@wiernik.org</email></contributor><category citation-format=\"author-date\"/><category field=\"psychology\"/><category field=\"generic-base\"/><updated>2016-05-25T09:01:49+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. & trans.</single><multiple>eds. & trans.</multiple></term><term name=\"translator\" form=\"short\"><single>trans.</single><multiple>trans.</multiple></term></terms></locale><macro name=\"container-contributors\"><choose><if type=\"chapter paper-conference entry-dictionary entry-encyclopedia\" match=\"any\"><group delimiter=\", \"><names variable=\"container-author\" delimiter=\", \"><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/><label form=\"short\" prefix=\" (\" text-case=\"title\" suffix=\")\"/></names><names variable=\"editor translator\" delimiter=\", \"><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/><label form=\"short\" prefix=\" (\" text-case=\"title\" suffix=\")\"/></names></group></if></choose></macro><macro name=\"secondary-contributors\"><choose><if type=\"article-journal chapter paper-conference entry-dictionary entry-encyclopedia\" match=\"none\"><group delimiter=\", \" prefix=\" (\" suffix=\")\"><names variable=\"container-author\" delimiter=\", \"><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/><label form=\"short\" prefix=\", \" text-case=\"title\"/></names><names variable=\"editor translator\" delimiter=\", \"><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/><label form=\"short\" prefix=\", \" text-case=\"title\"/></names></group></if></choose></macro><macro name=\"author\"><names variable=\"author\"><name name-as-sort-order=\"all\" and=\"symbol\" sort-separator=\", \" initialize-with=\". \" delimiter=\", \" delimiter-precedes-last=\"always\"/><label form=\"short\" prefix=\" (\" suffix=\")\" text-case=\"capitalize-first\"/><substitute><names variable=\"editor\"/><names variable=\"translator\"/><choose><if type=\"report\"><text variable=\"publisher\"/><text macro=\"title\"/></if><else><text macro=\"title\"/></else></choose></substitute></names></macro><macro name=\"author-short\"><names variable=\"author\"><name form=\"short\" and=\"symbol\" delimiter=\", \" initialize-with=\". \"/><substitute><names variable=\"editor\"/><names variable=\"translator\"/><choose><if type=\"report\"><text variable=\"publisher\"/><text variable=\"title\" form=\"short\" font-style=\"italic\"/></if><else-if type=\"legal_case\"><text variable=\"title\" font-style=\"italic\"/></else-if><else-if type=\"bill book graphic legislation motion_picture song\" match=\"any\"><text variable=\"title\" form=\"short\" font-style=\"italic\"/></else-if><else-if variable=\"reviewed-author\"><choose><if variable=\"reviewed-title\" match=\"none\"><text variable=\"title\" form=\"short\" font-style=\"italic\" prefix=\"Review of \"/></if><else><text variable=\"title\" form=\"short\" quotes=\"true\"/></else></choose></else-if><else><text variable=\"title\" form=\"short\" quotes=\"true\"/></else></choose></substitute></names></macro><macro name=\"access\"><choose><if type=\"thesis report\" match=\"any\"><choose><if variable=\"DOI\" match=\"any\">\n<text variable=\"DOI\" prefix=\"https://doi.org/\"/></if><else-if variable=\"archive\" match=\"any\"><group><text term=\"retrieved\" text-case=\"capitalize-first\" suffix=\" \"/><text term=\"from\" suffix=\" \"/><text variable=\"archive\" suffix=\".\"/><text variable=\"archive_location\" prefix=\" (\" suffix=\")\"/></group></else-if><else><group><text term=\"retrieved\" text-case=\"capitalize-first\" suffix=\" \"/><text term=\"from\" suffix=\" \"/><text variable=\"URL\"/></group></else></choose></if><else><choose><if variable=\"DOI\"><text variable=\"DOI\" prefix=\"https://doi.org/\"/></if><else><choose><if type=\"webpage\"><group delimiter=\" \"><text term=\"retrieved\" text-case=\"capitalize-first\" suffix=\" \"/><group><date variable=\"accessed\" form=\"text\" suffix=\", \"/></group><text term=\"from\"/><text variable=\"URL\"/></group></if><else><group><text term=\"retrieved\" text-case=\"capitalize-first\" suffix=\" \"/><text term=\"from\" suffix=\" \"/><text variable=\"URL\"/></group></else></choose></else></choose></else></choose></macro><macro name=\"title\"><choose><if type=\"book graphic manuscript motion_picture report song speech thesis\" match=\"any\"><choose><if variable=\"version\" type=\"book\" match=\"all\"><text variable=\"title\"/></if><else><text variable=\"title\" font-style=\"italic\"/></else></choose></if><else-if variable=\"reviewed-author\"><choose><if variable=\"reviewed-title\"><group delimiter=\" \"><text variable=\"title\"/><group delimiter=\", \" prefix=\"[\" suffix=\"]\"><text variable=\"reviewed-title\" font-style=\"italic\" prefix=\"Review of \"/><names variable=\"reviewed-author\" delimiter=\", \"><label form=\"verb-short\" suffix=\" \"/><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/></names></group></group></if><else><group delimiter=\", \" prefix=\"[\" suffix=\"]\"><text variable=\"title\" font-style=\"italic\" prefix=\"Review of \"/><names variable=\"reviewed-author\" delimiter=\", \"><label form=\"verb-short\" suffix=\" \"/><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/></names></group></else></choose></else-if><else><text variable=\"title\"/></else></choose></macro><macro name=\"title-plus-extra\"><text macro=\"title\"/><choose><if type=\"report thesis\" match=\"any\"><group prefix=\" (\" suffix=\")\" delimiter=\", \"><group delimiter=\" \"><choose><if variable=\"genre\" match=\"any\"><text variable=\"genre\"/></if><else><text variable=\"collection-title\"/></else></choose><text variable=\"number\" prefix=\"No. \"/></group><group delimiter=\" \"><text term=\"version\" text-case=\"capitalize-first\"/><text variable=\"version\"/></group><text macro=\"edition\"/></group></if><else-if type=\"post-weblog webpage\" match=\"any\"><text variable=\"genre\" prefix=\" [\" suffix=\"]\"/></else-if><else-if variable=\"version\"><group delimiter=\" \" prefix=\" (\" suffix=\")\"><text term=\"version\" text-case=\"capitalize-first\"/><text variable=\"version\"/></group></else-if></choose><text macro=\"format\" prefix=\" [\" suffix=\"]\"/></macro><macro name=\"format\"><choose><if match=\"any\" variable=\"medium\"><text variable=\"medium\" text-case=\"capitalize-first\"/></if><else-if type=\"dataset\" match=\"any\"><text value=\"Data set\"/></else-if></choose></macro><macro name=\"publisher\"><choose><if type=\"report\" match=\"any\"><group delimiter=\": \"><text variable=\"publisher-place\"/><text variable=\"publisher\"/></group></if><else-if type=\"thesis\" match=\"any\"><group delimiter=\", \"><text variable=\"publisher\"/><text variable=\"publisher-place\"/></group></else-if><else-if type=\"post-weblog webpage\" match=\"none\"><group delimiter=\", \"><choose><if variable=\"event version\" type=\"speech motion_picture\" match=\"none\"><text variable=\"genre\"/></if></choose><choose><if type=\"article-journal article-magazine\" match=\"none\"><group delimiter=\": \"><choose><if variable=\"publisher-place\"><text variable=\"publisher-place\"/></if><else><text variable=\"event-place\"/></else></choose><text variable=\"publisher\"/></group></if></choose></group></else-if></choose></macro><macro name=\"event\"><choose><if variable=\"container-title\" match=\"none\"><choose><if variable=\"event\"><choose><if variable=\"genre\" match=\"none\"><text term=\"presented at\" text-case=\"capitalize-first\" suffix=\" \"/><text variable=\"event\"/></if><else>\n<group delimiter=\" \"><text variable=\"genre\" text-case=\"capitalize-first\"/><text term=\"presented at\"/><text variable=\"event\"/></group></else></choose></if><else-if type=\"speech\"><text variable=\"genre\" text-case=\"capitalize-first\"/></else-if></choose></if></choose></macro><macro name=\"issued\"><choose><if type=\"bill legal_case legislation\" match=\"none\"><choose><if variable=\"issued\"><group prefix=\" (\" suffix=\")\"><date variable=\"issued\"><date-part name=\"year\"/></date><text variable=\"year-suffix\"/><choose><if type=\"speech\" match=\"any\"><date variable=\"issued\"><date-part prefix=\", \" name=\"month\"/></date></if><else-if type=\"article-journal bill book chapter graphic legal_case legislation motion_picture paper-conference report song dataset\" match=\"none\"><date variable=\"issued\"><date-part prefix=\", \" name=\"month\"/><date-part prefix=\" \" name=\"day\"/></date></else-if></choose></group></if><else-if variable=\"status\"><group prefix=\" (\" suffix=\")\"><text variable=\"status\"/><text variable=\"year-suffix\" prefix=\"-\"/></group></else-if><else><group prefix=\" (\" suffix=\")\"><text term=\"no date\" form=\"short\"/><text variable=\"year-suffix\" prefix=\"-\"/></group></else></choose></if></choose></macro><macro name=\"issued-sort\"><choose><if type=\"article-journal bill book chapter graphic legal_case legislation motion_picture paper-conference report song dataset\" match=\"none\"><date variable=\"issued\"><date-part name=\"year\"/><date-part name=\"month\"/><date-part name=\"day\"/></date></if><else><date variable=\"issued\"><date-part name=\"year\"/></date></else></choose></macro><macro name=\"issued-year\"><choose><if variable=\"issued\"><group delimiter=\"/\"><date variable=\"original-date\" form=\"text\"/><group><date variable=\"issued\"><date-part name=\"year\"/></date><text variable=\"year-suffix\"/></group></group></if><else-if variable=\"status\"><text variable=\"status\"/><text variable=\"year-suffix\" prefix=\"-\"/></else-if><else><text term=\"no date\" form=\"short\"/><text variable=\"year-suffix\" prefix=\"-\"/></else></choose></macro><macro name=\"edition\"><choose><if is-numeric=\"edition\"><group delimiter=\" \"><number variable=\"edition\" form=\"ordinal\"/><text term=\"edition\" form=\"short\"/></group></if><else><text variable=\"edition\"/></else></choose></macro><macro name=\"locators\"><choose><if type=\"article-journal article-magazine\" match=\"any\"><group prefix=\", \" delimiter=\", \"><group><text variable=\"volume\" font-style=\"italic\"/><text variable=\"issue\" prefix=\"(\" suffix=\")\"/></group><text variable=\"page\"/></group><choose><if variable=\"issued\"><choose><if variable=\"page issue\" match=\"none\"><text variable=\"status\" prefix=\". \"/></if></choose></if></choose></if><else-if type=\"article-newspaper\"><group delimiter=\" \" prefix=\", \"><label variable=\"page\" form=\"short\"/><text variable=\"page\"/></group></else-if><else-if type=\"book graphic motion_picture report song chapter paper-conference entry-encyclopedia entry-dictionary\" match=\"any\"><group prefix=\" (\" suffix=\")\" delimiter=\", \"><choose><if type=\"report\" match=\"none\"><text macro=\"edition\"/></if></choose><choose><if variable=\"volume\" match=\"any\"><group><text term=\"volume\" form=\"short\" text-case=\"capitalize-first\" suffix=\" \"/><number variable=\"volume\" form=\"numeric\"/></group></if><else><group><text term=\"volume\" form=\"short\" plural=\"true\" text-case=\"capitalize-first\" suffix=\" \"/><number variable=\"number-of-volumes\" form=\"numeric\" prefix=\"1–\"/></group></else></choose><group><label variable=\"page\" form=\"short\" suffix=\" \"/><text variable=\"page\"/></group></group></else-if><else-if type=\"legal_case\"><group prefix=\" (\" suffix=\")\" delimiter=\" \"><text variable=\"authority\"/><date variable=\"issued\" form=\"text\"/></group></else-if><else-if type=\"bill legislation\" match=\"any\"><date variable=\"issued\" prefix=\" (\" suffix=\")\"><date-part name=\"year\"/></date></else-if></choose></macro><macro name=\"citation-locator\"><group><choose><if locator=\"chapter\"><label variable=\"locator\" form=\"long\" text-case=\"capitalize-first\"/></if><else><label variable=\"locator\" form=\"short\"/></else></choose><text variable=\"locator\" prefix=\" \"/></group></macro>\n<macro name=\"container\"><choose><if type=\"post-weblog webpage\" match=\"none\"><group><choose><if type=\"chapter paper-conference entry-encyclopedia\" match=\"any\"><text term=\"in\" text-case=\"capitalize-first\" suffix=\" \"/></if></choose><group delimiter=\", \"><text macro=\"container-contributors\"/><text macro=\"secondary-contributors\"/><text macro=\"container-title\"/></group></group></if></choose></macro><macro name=\"container-title\"><choose><if type=\"article article-journal article-magazine article-newspaper\" match=\"any\"><text variable=\"container-title\" font-style=\"italic\" text-case=\"title\"/></if><else-if type=\"bill legal_case legislation\" match=\"none\"><text variable=\"container-title\" font-style=\"italic\"/></else-if></choose></macro><macro name=\"legal-cites\"><choose><if type=\"bill legal_case legislation\" match=\"any\"><group delimiter=\" \" prefix=\", \"><choose><if variable=\"container-title\"><text variable=\"volume\"/><text variable=\"container-title\"/><group delimiter=\" \"><text term=\"section\" form=\"symbol\"/><text variable=\"section\"/></group><text variable=\"page\"/></if><else><choose><if type=\"legal_case\"><text variable=\"number\" prefix=\"No. \"/></if><else><text variable=\"number\" prefix=\"Pub. L. No. \"/><group delimiter=\" \"><text term=\"section\" form=\"symbol\"/><text variable=\"section\"/></group></else></choose></else></choose></group></if></choose></macro><macro name=\"original-date\"><choose><if variable=\"original-date\"><group prefix=\"(\" suffix=\")\" delimiter=\" \"><text value=\"Original work published\"/><date variable=\"original-date\" form=\"text\"/></group></if></choose></macro><citation et-al-min=\"6\" et-al-use-first=\"1\" et-al-subsequent-min=\"3\" et-al-subsequent-use-first=\"1\" disambiguate-add-year-suffix=\"true\" disambiguate-add-names=\"true\" disambiguate-add-givenname=\"true\" collapse=\"year\" givenname-disambiguation-rule=\"primary-name\"><sort><key macro=\"author\"/><key macro=\"issued-sort\"/></sort><layout prefix=\"(\" suffix=\")\" delimiter=\"; \"><group delimiter=\", \"><text macro=\"author-short\"/><text macro=\"issued-year\"/><text macro=\"citation-locator\"/></group></layout></citation><bibliography hanging-indent=\"true\" et-al-min=\"8\" et-al-use-first=\"6\" et-al-use-last=\"true\" entry-spacing=\"0\" line-spacing=\"2\"><sort><key macro=\"author\"/><key macro=\"issued-sort\" sort=\"ascending\"/><key macro=\"title\"/></sort><layout><group suffix=\".\"><group delimiter=\". \"><text macro=\"author\"/><text macro=\"issued\"/><text macro=\"title-plus-extra\"/><text macro=\"container\"/></group><text macro=\"legal-cites\"/><text macro=\"locators\"/><group delimiter=\", \" prefix=\". \"><text macro=\"event\"/><text macro=\"publisher\"/></group></group><text macro=\"access\" prefix=\" \"/><text macro=\"original-date\" prefix=\" \"/></layout></bibliography></style>", "vancouver": "<?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=\"sort-only\" page-range-format=\"minimal\"><info><title>Vancouver</title><id>http://www.zotero.org/styles/vancouver</id><link href=\"http://www.zotero.org/styles/vancouver\" rel=\"self\"/><link href=\"http://www.nlm.nih.gov/bsd/uniform_citationRequirements.html\" rel=\"documentation\"/><author><name>Michael Berkowitz</name><email>mberkowi@gmu.edu</email></author><contributor><name>Sean Takats</name><email>stakats@gmu.edu</email></contributor><contributor><name>Sebastian Karcher</name></contributor><category citation-format=\"numeric\"/><category field=\"medicine\"/><summary>Vancouver style as outlined by International Committee of Medical Journal Editors Uniform citationRequirements for Manuscripts Submitted to Biomedical Journals: Sample References</summary><updated>2014-09-06T16:03:01+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\"><date form=\"text\" delimiter=\" \"><date-part name=\"year\"/><date-part name=\"month\" form=\"short\" strip-periods=\"true\"/><date-part name=\"day\"/></date><terms><term name=\"collection-editor\" form=\"long\"><single>editor</single><multiple>editors</multiple></term><term name=\"presented at\">presented at</term><term name=\"available at\">available from</term><term name=\"section\" form=\"short\">sect.</term></terms></locale><locale xml:lang=\"fr\"><date form=\"text\" delimiter=\" \"><date-part name=\"day\"/><date-part name=\"month\" form=\"short\" strip-periods=\"true\"/><date-part name=\"year\"/></date></locale><macro name=\"author\"><names variable=\"author\"><name sort-separator=\" \" initialize-with=\"\" name-as-sort-order=\"all\" delimiter=\", \" delimiter-precedes-last=\"always\"/><label form=\"long\" prefix=\", \"/><substitute><names variable=\"editor\"/></substitute></names></macro><macro name=\"editor\"><names variable=\"editor\" suffix=\".\"><name sort-separator=\" \" initialize-with=\"\" name-as-sort-order=\"all\" delimiter=\", \" delimiter-precedes-last=\"always\"/><label form=\"long\" prefix=\", \"/></names></macro><macro name=\"chapter-marker\"><choose><if type=\"chapter paper-conference entry-dictionary entry-encyclopedia\" match=\"any\"><text term=\"in\" text-case=\"capitalize-first\"/></if></choose></macro><macro name=\"publisher\"><choose><if type=\"article-journal article-magazine article-newspaper\" match=\"none\"><group delimiter=\": \" suffix=\";\"><choose><if type=\"thesis\"><text variable=\"publisher-place\" prefix=\"[\" suffix=\"]\"/></if><else-if type=\"speech\"/><else><text variable=\"publisher-place\"/></else></choose><text variable=\"publisher\"/></group></if></choose></macro><macro name=\"access\"><choose><if variable=\"URL\"><group delimiter=\": \"><text term=\"available at\" text-case=\"capitalize-first\"/><text variable=\"URL\"/></group></if></choose></macro><macro name=\"accessed-date\"><choose><if variable=\"URL\"><group prefix=\"[\" suffix=\"]\" delimiter=\" \"><text term=\"cited\" text-case=\"lowercase\"/><date variable=\"accessed\" form=\"text\"/></group></if></choose></macro><macro name=\"container-title\"><choose><if type=\"article-journal article-magazine chapter paper-conference article-newspaper review review-book entry-dictionary entry-encyclopedia\" match=\"any\"><group suffix=\".\" delimiter=\" \"><choose><if type=\"article-journal review review-book\" match=\"any\"><text variable=\"container-title\" form=\"short\" strip-periods=\"true\"/></if><else><text variable=\"container-title\" strip-periods=\"true\"/></else></choose><choose><if variable=\"URL\"><text term=\"internet\" prefix=\"[\" suffix=\"]\" text-case=\"capitalize-first\"/></if></choose></group><text macro=\"edition\" prefix=\" \"/></if><else-if type=\"bill legislation\" match=\"any\"><group delimiter=\", \"><group delimiter=\". \"><text variable=\"container-title\"/><group delimiter=\" \"><text term=\"section\" form=\"short\" text-case=\"capitalize-first\"/><text variable=\"section\"/></group></group><text variable=\"number\"/></group></else-if><else-if type=\"speech\">\n<group delimiter=\": \" suffix=\";\"><group delimiter=\" \"><text variable=\"genre\" text-case=\"capitalize-first\"/><text term=\"presented at\"/></group><text variable=\"event\"/></group></else-if><else><group delimiter=\", \" suffix=\".\"><choose><if variable=\"collection-title\" match=\"none\"><group delimiter=\" \"><label variable=\"volume\" form=\"short\" text-case=\"capitalize-first\"/><text variable=\"volume\"/></group></if></choose><text variable=\"container-title\"/></group></else></choose></macro><macro name=\"title\"><text variable=\"title\"/><choose><if type=\"article-journal article-magazine chapter paper-conference article-newspaper review review-book entry-dictionary entry-encyclopedia\" match=\"none\"><choose><if variable=\"URL\"><text term=\"internet\" prefix=\" [\" suffix=\"]\" text-case=\"capitalize-first\"/></if></choose><text macro=\"edition\" prefix=\". \"/></if></choose><choose><if type=\"thesis\"><text variable=\"genre\" prefix=\" [\" suffix=\"]\"/></if></choose></macro><macro name=\"edition\"><choose><if is-numeric=\"edition\"><group delimiter=\" \"><number variable=\"edition\" form=\"ordinal\"/><text term=\"edition\" form=\"short\"/></group></if><else><text variable=\"edition\" suffix=\".\"/></else></choose></macro><macro name=\"date\"><choose><if type=\"article-journal article-magazine article-newspaper review review-book\" match=\"any\"><group suffix=\";\" delimiter=\" \"><date variable=\"issued\" form=\"text\"/><text macro=\"accessed-date\"/></group></if><else-if type=\"bill legislation\" match=\"any\"><group delimiter=\", \"><date variable=\"issued\" delimiter=\" \"><date-part name=\"month\" form=\"short\" strip-periods=\"true\"/><date-part name=\"day\"/></date><date variable=\"issued\"><date-part name=\"year\"/></date></group></else-if><else-if type=\"report\"><date variable=\"issued\" delimiter=\" \"><date-part name=\"year\"/><date-part name=\"month\" form=\"short\" strip-periods=\"true\"/></date><text macro=\"accessed-date\" prefix=\" \"/></else-if><else-if type=\"patent\"><group suffix=\".\"><group delimiter=\", \"><text variable=\"number\"/><date variable=\"issued\"><date-part name=\"year\"/></date></group><text macro=\"accessed-date\" prefix=\" \"/></group></else-if><else-if type=\"speech\"><group delimiter=\"; \"><group delimiter=\" \"><date variable=\"issued\" delimiter=\" \"><date-part name=\"year\"/><date-part name=\"month\" form=\"short\" strip-periods=\"true\"/><date-part name=\"day\"/></date><text macro=\"accessed-date\"/></group><text variable=\"event-place\"/></group></else-if><else><group suffix=\".\"><date variable=\"issued\"><date-part name=\"year\"/></date><text macro=\"accessed-date\" prefix=\" \"/></group></else></choose></macro><macro name=\"pages\"><choose><if type=\"article-journal article-magazine article-newspaper review review-book\" match=\"any\"><text variable=\"page\" prefix=\":\"/></if><else-if type=\"book\" match=\"any\"><text variable=\"number-of-pages\" prefix=\" \"/><choose><if is-numeric=\"number-of-pages\"><label variable=\"number-of-pages\" form=\"short\" prefix=\" \" plural=\"never\"/></if></choose></else-if><else><group prefix=\" \" delimiter=\" \"><label variable=\"page\" form=\"short\" plural=\"never\"/><text variable=\"page\"/></group></else></choose></macro><macro name=\"journal-location\"><choose><if type=\"article-journal article-magazine review review-book\" match=\"any\"><text variable=\"volume\"/><text variable=\"issue\" prefix=\"(\" suffix=\")\"/></if></choose></macro><macro name=\"collection-details\"><choose><if type=\"article-journal article-magazine article-newspaper review review-book\" match=\"none\"><choose><if variable=\"collection-title\"><group delimiter=\" \" prefix=\"(\" suffix=\")\"><names variable=\"collection-editor\" suffix=\".\"><name sort-separator=\" \" initialize-with=\"\" name-as-sort-order=\"all\" delimiter=\", \" delimiter-precedes-last=\"always\"/><label form=\"long\" prefix=\", \"/></names><group delimiter=\"; \"><text variable=\"collection-title\"/><group delimiter=\" \"><label variable=\"volume\" form=\"short\"/><text variable=\"volume\"/></group></group></group></if></choose></if></choose></macro><macro name=\"report-details\"><choose><if type=\"report\"><text variable=\"number\" prefix=\"Report No.: \"/></if></choose></macro><citation collapse=\"citation-number\">\n<sort><key variable=\"citation-number\"/></sort><layout prefix=\"(\" suffix=\")\" delimiter=\",\"><text variable=\"citation-number\"/></layout></citation><bibliography et-al-min=\"7\" et-al-use-first=\"6\" second-field-align=\"flush\"><layout><text variable=\"citation-number\" suffix=\". \"/><group delimiter=\". \" suffix=\". \"><text macro=\"author\"/><text macro=\"title\"/></group><group delimiter=\" \" suffix=\". \"><group delimiter=\": \"><text macro=\"chapter-marker\"/><group delimiter=\" \"><text macro=\"editor\"/><text macro=\"container-title\"/></group></group><text macro=\"publisher\"/><group><text macro=\"date\"/><text macro=\"journal-location\"/><text macro=\"pages\"/></group></group><text macro=\"collection-details\" suffix=\". \"/><text macro=\"report-details\" suffix=\". \"/><text macro=\"access\"/></layout></bibliography></style>", "harvard1": "<?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=\"sort-only\"><info><title>Harvard Reference format 1 (author-date)</title><id>http://www.zotero.org/styles/harvard1</id><link href=\"http://www.zotero.org/styles/harvard1\" rel=\"self\"/><link href=\"http://libweb.anglia.ac.uk/referencing/harvard.htm\" rel=\"documentation\"/><author><name>Julian Onions</name><email>julian.onions@gmail.com</email></author><category citation-format=\"author-date\"/><category field=\"generic-base\"/><summary>The Harvard author-date style</summary><updated>2012-09-27T22:06:38+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><macro name=\"editor\"><names variable=\"editor\" delimiter=\", \"><name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/><label form=\"short\" prefix=\", \" text-case=\"lowercase\"/></names></macro><macro name=\"anon\"><text term=\"anonymous\" form=\"short\" text-case=\"capitalize-first\" strip-periods=\"true\"/></macro><macro name=\"author\"><names variable=\"author\"><name name-as-sort-order=\"all\" and=\"symbol\" sort-separator=\", \" initialize-with=\".\" delimiter-precedes-last=\"never\" delimiter=\", \"/><label form=\"short\" prefix=\" \" text-case=\"lowercase\"/><substitute><names variable=\"editor\"/><text macro=\"anon\"/></substitute></names></macro><macro name=\"author-short\"><names variable=\"author\"><name form=\"short\" and=\"symbol\" delimiter=\", \" delimiter-precedes-last=\"never\" initialize-with=\". \"/><substitute><names variable=\"editor\"/><names variable=\"translator\"/><text macro=\"anon\"/></substitute></names></macro><macro name=\"access\"><choose><if variable=\"URL\"><text value=\"Available at:\" suffix=\" \"/><text variable=\"URL\"/><group prefix=\" [\" suffix=\"]\"><text term=\"accessed\" text-case=\"capitalize-first\" suffix=\" \"/><date variable=\"accessed\"><date-part name=\"month\" suffix=\" \"/><date-part name=\"day\" suffix=\", \"/><date-part name=\"year\"/></date></group></if></choose></macro><macro name=\"title\"><choose><if type=\"bill book graphic legal_case legislation motion_picture report song thesis\" match=\"any\"><text variable=\"title\" font-style=\"italic\"/></if><else><text variable=\"title\"/></else></choose></macro><macro name=\"publisher\"><group delimiter=\": \"><text variable=\"publisher-place\"/><text variable=\"publisher\"/></group></macro><macro name=\"year-date\"><choose><if variable=\"issued\"><date variable=\"issued\"><date-part name=\"year\"/></date></if><else><text term=\"no date\" form=\"short\"/></else></choose></macro><macro name=\"edition\"><choose><if is-numeric=\"edition\"><group delimiter=\" \"><number variable=\"edition\" form=\"ordinal\"/><text term=\"edition\" form=\"short\"/></group></if><else><text variable=\"edition\" suffix=\".\"/></else></choose></macro><macro name=\"pages\"><group><label variable=\"page\" form=\"short\" suffix=\" \"/><text variable=\"page\"/></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\"><layout prefix=\"(\" suffix=\")\" delimiter=\"; \"><group delimiter=\", \"><group delimiter=\" \"><text macro=\"author-short\"/><text macro=\"year-date\"/></group><group><label variable=\"locator\" form=\"short\"/><text variable=\"locator\"/></group></group></layout></citation><bibliography hanging-indent=\"true\" et-al-min=\"4\" et-al-use-first=\"1\"><sort><key macro=\"author\"/><key variable=\"title\"/></sort><layout><text macro=\"author\" suffix=\",\"/><date variable=\"issued\" prefix=\" \" suffix=\".\"><date-part name=\"year\"/></date><choose><if type=\"bill book graphic legal_case legislation motion_picture report song\" match=\"any\"><group prefix=\" \" delimiter=\" \" suffix=\",\"><text macro=\"title\"/><text macro=\"edition\"/><text macro=\"editor\"/></group><text prefix=\" \" suffix=\".\" macro=\"publisher\"/></if><else-if type=\"chapter paper-conference\" match=\"any\"><text macro=\"title\" prefix=\" \" suffix=\".\"/><group prefix=\" \" delimiter=\" \"><text term=\"in\" text-case=\"capitalize-first\"/>\n<text macro=\"editor\"/><text variable=\"container-title\" font-style=\"italic\" suffix=\".\"/><text variable=\"collection-title\" suffix=\".\"/><text variable=\"event\" suffix=\".\"/><group suffix=\".\" delimiter=\", \"><text macro=\"publisher\" prefix=\" \"/><text macro=\"pages\"/></group></group></else-if><else-if type=\"thesis\"><group prefix=\" \" suffix=\".\" delimiter=\". \"><text macro=\"title\"/><text variable=\"genre\"/><text macro=\"publisher\"/></group></else-if><else><group suffix=\".\"><text macro=\"title\" prefix=\" \"/><text macro=\"editor\" prefix=\" \"/></group><group prefix=\" \" suffix=\".\"><text variable=\"container-title\" font-style=\"italic\"/><group prefix=\", \"><text variable=\"volume\"/><text variable=\"issue\" prefix=\"(\" suffix=\")\"/></group><group prefix=\", \"><label variable=\"page\" form=\"short\"/><text variable=\"page\"/></group></group></else></choose><text prefix=\" \" macro=\"access\" suffix=\".\"/></layout></bibliography></style>" } },{}],348:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.templates = exports.default = void 0; var _register = _interopcitationRequireDefault(citationRequire("../../../util/register")); var _styles = _interopcitationRequireDefault(citationRequire("./styles.json")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var templates = new _register.default(_styles.default); exports.templates = templates; var fetchStyle = function fetchStyle(style) { if (templates.has(style)) { return templates.get(style); } else { return templates.get('apa'); } }; var _default = fetchStyle; exports.default = _default; },{"../../../util/register":405,"./styles.json":347}],349:[function(citationRequire,module,exports){ "use strict"; var _plugins = citationRequire("../../plugins/"); var modules = _interopcitationRequireWildcard(citationRequire("./modules")); function _interopcitationRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } for (var name in modules) { var _module = modules[name]; (0, _plugins.add)(name, { output: _module }); } },{"../../plugins/":399,"./modules":352}],350:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.getJsonWrapper = void 0; var _deepCopy = _interopcitationRequireDefault(citationRequire("../../util/deepCopy.js")); var _dict = citationRequire("../dict"); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var appendCommas = function appendCommas(string, index, array) { return string + (index < array.length - 1 ? ',' : ''); }; var getJsonObject = function getJsonObject(src, dict) { var isArray = Array.isArray(src); var entries; if (isArray) { entries = src.map(function (entry) { return getJsonValue(entry, dict); }); } else { entries = Object.entries(src).map(function (_ref) { var _ref2 = _slicedToArray(_ref, 2), prop = _ref2[0], value = _ref2[1]; return "\"".concat(prop, "\": ").concat(getJsonValue(value, dict)); }); } entries = entries.map(appendCommas).map(function (entry) { return dict.listItem.join(entry); }); entries = dict.list.join(entries.join('')); return isArray ? "[".concat(entries, "]") : "{".concat(entries, "}"); }; var getJsonValue = function getJsonValue(src, dict) { if (_typeof(src) === 'object' && src !== null) { if (src.length === 0) { return '[]'; } else if (Object.keys(src).length === 0) { return '{}'; } else { return getJsonObject(src, dict); } } else { return JSON.stringify(src) + ''; } }; var getJson = function getJson(src, dict) { var entries = src.map(function (entry) { return getJsonObject(entry, dict); }); entries = entries.map(appendCommas).map(function (entry) { return dict.entry.join(entry); }); entries = entries.join(''); return dict.bibliographyContainer.join("[".concat(entries, "]")); }; var getJsonWrapper = function getJsonWrapper(src) { return getJson(src, (0, _dict.get)('html')); }; exports.getJsonWrapper = getJsonWrapper; var _default = { data: function data(_data) { var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, type = _ref3.type, _ref3$format = _ref3.format, format = _ref3$format === void 0 ? type || 'text' : _ref3$format; if (format === 'object') { return (0, _deepCopy.default)(_data); } else if (format === 'text') { return JSON.stringify(_data, null, 2); } else { logger.warn('[get]', 'This feature (JSON output with special formatting) is unstable. See https://github.com/larsgw/citation.js/issues/144'); return (0, _dict.has)(format) ? getJson(_data, (0, _dict.get)(format)) : ''; } } }; exports.default = _default; },{"../../util/deepCopy.js":400,"../dict":331}],351:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.getLabel = void 0; var _label = _interopcitationRequireDefault(citationRequire("./bibtex/label")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var getLabel = _label.default; exports.getLabel = getLabel; var _default = { label: function label(data) { return data.reduce(function (object, entry) { object[entry.id] = getLabel(entry); return object; }, {}); } }; exports.default = _default; },{"./bibtex/label":336}],352:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "bibtex", { enumerable: true, get: function get() { return _bibtex.default; } }); Object.defineProperty(exports, "data", { enumerable: true, get: function get() { return _json.default; } }); Object.defineProperty(exports, "label", { enumerable: true, get: function get() { return _label.default; } }); Object.defineProperty(exports, "ris", { enumerable: true, get: function get() { return _ris.default; } }); citationRequire("./csl/"); var _bibtex = _interopcitationRequireDefault(citationRequire("./bibtex/")); var _json = _interopcitationRequireDefault(citationRequire("./json")); var _label = _interopcitationRequireDefault(citationRequire("./label")); var _ris = _interopcitationRequireDefault(citationRequire("./ris/")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } },{"./bibtex/":334,"./csl/":344,"./json":350,"./label":351,"./ris/":353}],353:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _name = _interopcitationRequireDefault(citationRequire("../../name")); var _date = _interopcitationRequireDefault(citationRequire("../../date")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var typeMap = { graphic: 'ART', bill: 'BILL', 'post-webblog': 'BLOG', book: 'BOOK', 'review-book': 'BOOK', legal_case: 'CASE', chapter: 'CHAP', 'paper-conference': 'CONF', dataset: 'DATA', 'entry-dictionary': 'DICT', 'entry-encyclopedia': 'ENCYC', figure: 'FIGURE', interview: 'GEN', treaty: 'GEN', post: 'ICOMM', article: 'JOUR', 'article-journal': 'JOUR', review: 'JOUR', legislation: 'LEGAL', manuscript: 'MANSCPT', map: 'MAP', 'article-magazine': 'MGZN', broadcast: 'MPCT', motion_picture: 'MPCT', musical_score: 'MUSIC', 'article-newspaper': 'NEWS', pamphlet: 'PAMP', patent: 'PAT', personal_communication: 'PCOMM', report: 'RPRT', song: 'SOUND', speech: 'SOUND', thesis: 'THES' }; var name = function name(names) { return names.map(function (name) { return (0, _name.default)(name, true); }); }; var fieldMap = { TY: { fieldName: 'type', convert: function convert(type) { return typeMap[type] || 'GEN'; } }, AU: [{ type: ['review', 'review-book'], fieldName: 'reviewed-author', convert: name }, { type: '__default', fieldName: 'author', convert: name }], DA: { fieldName: 'issued', convert: function convert(date) { return (0, _date.default)(date, '/'); } }, PY: { fieldName: 'issued', convert: function convert(date) { return date['date-parts'][0][0]; } }, Y2: { fieldName: 'accessed', convert: function convert(date) { return (0, _date.default)(date, '/'); } }, AB: 'abstract', CN: 'call-number', CY: ['event-place', 'publisher-place'], DO: 'DOI', ET: [{ type: 'book', fieldName: ['version', 'edition'] }], IS: [{ type: '__default', fieldName: 'issue' }], J2: ['journalAbbreviation'], LA: 'language', LB: 'citation-label', M1: 'number', M3: ['genre', 'medium'], N1: 'note', RI: 'reviewed-title', SE: 'section', SN: [{ type: '__default', fieldName: ['ISBN', 'ISSN'] }, { type: ['patent', 'report'], fieldName: 'number' }], SP: { fieldName: ['first-page', 'page'] }, T2: ['container-title', 'collection-title'], T3: { fieldName: ['container-title', 'collection-title'], keepAll: true, convert: function convert(con, col) { return con ? col : undefined; } }, TI: ['original-title', 'title'], TT: { fieldName: ['original-title', 'title'], keepAll: true, convert: function convert(origTitle, title) { return origTitle ? title : undefined; } }, UR: 'URL', VL: 'volume', A2: { fieldName: 'editor', convert: name }, C1: [{ type: 'chapter', fieldName: 'section' }, { type: 'paper-conference', fieldName: 'publisher-place' }, { type: 'map', fieldName: 'scale' }, { type: 'musical_score', fieldName: 'medium' }], C2: [{ type: ['article-journal', 'article'], fieldName: 'PMCID' }, { type: 'paper-conference', fieldName: 'issued', convert: function convert(date) { return date['date-parts'][0][0]; } }, { type: 'article-newspaper', fieldName: 'issue' }], C3: [{ type: ['graphic', 'speech', 'sound', 'map'], fieldName: 'dimensions' }, { type: 'paper-conference', fieldName: 'container-title' }], C4: [{ type: ['review', 'review-book'], fieldName: 'author', convert: name }, { type: ['motion_picture', 'broadcast'], fieldName: 'genre' }], C5: [{ type: ['graphic', 'speech', 'sound', 'motion_picture', 'broadcast'], fieldName: 'medium' }], C6: [{ type: 'report', fieldName: 'issue' }, { type: 'patent', fieldName: 'status' }], C7: [{ type: ['article-journal', 'article'], fieldName: 'number' }], BT: [{ type: 'chapter', fieldName: 'container-title' }], DB: 'archive', DP: 'source', ED: { fieldName: 'editor', convert: name }, ID: 'id', NV: 'number-of-volumes', OP: 'references', PP: 'publiser-place', ST: ['short-title', 'titleShort'] }; var parseFieldInfo = function parseFieldInfo(fieldInfo, field, entry) { if (typeof fieldInfo === 'string') { return { sourceFields: [fieldInfo] }; } else if (Array.isArray(fieldInfo) && typeof fieldInfo[0] === 'string') { return { sourceFields: fieldInfo }; } else if (Array.isArray(fieldInfo) && _typeof(fieldInfo[0]) === 'object') { var specificInfo; var genericInfo; fieldInfo.forEach(function (infoPart) { if (typeof infoPart.type === 'string' && infoPart.type === entry.type || Array.isArray(infoPart.type) && infoPart.type.includes(entry.type)) { specificInfo = infoPart; } else if (infoPart.type === '__default') { genericInfo = infoPart; } }); var combinedInfo = specificInfo || genericInfo; if (!combinedInfo) { return {}; } return parseFieldInfo(combinedInfo.convert ? combinedInfo : combinedInfo.fieldName, field, entry); } else if (_typeof(fieldInfo) === 'object' && fieldInfo !== null) { return { sourceFields: [].concat(fieldInfo.fieldName), workOnEmptyInput: fieldInfo.fieldName === undefined, convert: fieldInfo.convert, keepAll: fieldInfo.keepAll === true }; } }; var json = function json(entry) { var target = {}; for (var field in fieldMap) { var _parseFieldInfo = parseFieldInfo(fieldMap[field], field, entry), _parseFieldInfo$sourc = _parseFieldInfo.sourceFields, sourceFields = _parseFieldInfo$sourc === void 0 ? [] : _parseFieldInfo$sourc, _parseFieldInfo$workO = _parseFieldInfo.workOnEmptyInput, workOnEmptyInput = _parseFieldInfo$workO === void 0 ? false : _parseFieldInfo$workO, _parseFieldInfo$conve = _parseFieldInfo.convert, convert = _parseFieldInfo$conve === void 0 ? false : _parseFieldInfo$conve, _parseFieldInfo$keepA = _parseFieldInfo.keepAll, keepAll = _parseFieldInfo$keepA === void 0 ? false : _parseFieldInfo$keepA; if (!keepAll) { sourceFields = sourceFields.filter(entry.hasOwnProperty.bind(entry)); } if (!workOnEmptyInput && sourceFields.length === 0) { continue; } var value = sourceFields.map(function (sourceField) { return entry[sourceField]; }); if (typeof convert === 'function') { value = convert.call.apply(convert, [entry].concat(_toConsumableArray(value))); if (value !== undefined) { target[field] = value; } } else { target[field] = value[0]; } } return target; }; var getRisLine = function getRisLine(prop) { var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; return "".concat(prop, " - ").concat(value, "\n"); }; var getRisField = function getRisField(_ref) { var _ref2 = _slicedToArray(_ref, 2), prop = _ref2[0], value = _ref2[1]; if (Array.isArray(value)) { return value.map(function (valuePart) { return getRisLine(prop, valuePart); }).join(''); } else { return getRisLine(prop, value); } }; var getRisPropList = function getRisPropList(entry) { var props = Object.entries(entry); if (props[0][0] !== 'TY') { var typeTagIndex = props.findIndex(function (_ref3) { var _ref4 = _slicedToArray(_ref3, 1), prop = _ref4[0]; return prop === 'TY'; }); var _props$splice = props.splice(typeTagIndex, 1), _props$splice2 = _slicedToArray(_props$splice, 1), typeTag = _props$splice2[0]; props.unshift(typeTag); } props.push(['ER']); return props.map(getRisField).join(''); }; var getRis = function getRis(entries) { return entries.map(json).map(getRisPropList).join(''); }; var _default = { ris: function ris(data) { var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, type = _ref5.type, _ref5$format = _ref5.format, format = _ref5$format === void 0 ? type || 'text' : _ref5$format; if (format === 'object') { return data.map(json); } else { return getRis(data); } } }; exports.default = _default; },{"../../date":330,"../../name":354}],354:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _name = citationRequire("@citation-js/name"); var _default = _name.format; exports.default = _default; },{"@citation-js/name":279}],355:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.format = exports.list = exports.has = exports.remove = exports.add = exports.register = void 0; var _register = _interopcitationRequireDefault(citationRequire("../util/register")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var validate = function validate(name, formatter) { if (typeof name !== 'string') { throw new TypeError("Invalid output format name, expected string, got ".concat(_typeof(name))); } else if (typeof formatter !== 'function') { throw new TypeError("Invalid formatter, expected function, got ".concat(_typeof(formatter))); } }; var register = new _register.default(); exports.register = register; var add = function add(name, formatter) { validate(name, formatter); register.set(name, formatter); }; exports.add = add; var remove = function remove(name) { register.remove(name); }; exports.remove = remove; var has = function has(name) { return register.has(name); }; exports.has = has; var list = function list() { return register.list(); }; exports.list = list; var format = function format(name, data) { if (!register.has(name)) { logger.error('[get]', "Output plugin \"".concat(name, "\" unavailable")); return undefined; } for (var _len = arguments.length, options = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { options[_key - 2] = arguments[_key]; } return register.get(name).apply(void 0, [data].concat(options)); }; exports.format = format; },{"../util/register":405}],356:[function(citationRequire,module,exports){ (function (process,global){ "use strict"; if (process.env.TEST_MOCHA === 'true') { global.logger = { error: function error() {}, warn: function warn() {}, info: function info() {} }; } else if (typeof console.Console === 'function') { global.logger = new console.Console(process.stderr); } else { global.logger = console; } }).call(this,citationRequire('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"_process":286}],357:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _name = _interopcitationRequireDefault(citationRequire("./name")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var NAME = 1; var NAME_LIST = 2; var DATE = 3; var fieldTypes = { author: NAME_LIST, 'collection-editor': NAME_LIST, composer: NAME_LIST, 'container-author': NAME_LIST, editor: NAME_LIST, 'editorial-director': NAME_LIST, director: NAME_LIST, interviewer: NAME_LIST, illustrator: NAME_LIST, 'original-author': NAME_LIST, 'reviewed-author': NAME_LIST, recipient: NAME_LIST, translator: NAME_LIST, accessed: DATE, container: DATE, 'event-date': DATE, issued: DATE, 'original-date': DATE, submitted: DATE, categories: 'object', id: ['string', 'number'], type: 'string', language: 'string', journalAbbreviation: 'string', shortTitle: 'string', abstract: 'string', annote: 'string', archive: 'string', archive_location: 'string', 'archive-place': 'string', authority: 'string', 'call-number': 'string', 'chapter-number': 'string', 'citation-number': 'string', 'citation-label': 'string', 'collection-number': 'string', 'collection-title': 'string', 'container-title': 'string', 'container-title-short': 'string', dimensions: 'string', DOI: 'string', edition: ['string', 'number'], event: 'string', 'event-place': 'string', 'first-reference-note-number': 'string', genre: 'string', ISBN: 'string', ISSN: 'string', issue: ['string', 'number'], jurisdiction: 'string', keyword: 'string', locator: 'string', medium: 'string', note: 'string', number: ['string', 'number'], 'number-of-pages': 'string', 'number-of-volumes': ['string', 'number'], 'original-publisher': 'string', 'original-publisher-place': 'string', 'original-title': 'string', page: 'string', 'page-first': 'string', PMCID: 'string', PMID: 'string', publisher: 'string', 'publisher-place': 'string', references: 'string', 'reviewed-title': 'string', scale: 'string', section: 'string', source: 'string', status: 'string', title: 'string', 'title-short': 'string', URL: 'string', version: 'string', volume: ['string', 'number'], 'year-suffix': 'string' }; var correctName = function correctName(name) { var bestGuessConversions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; if (_typeof(name) === 'object' && (name.literal || name.given || name.family)) { return name; } else if (!bestGuessConversions) { return undefined; } else if (typeof name === 'string') { return (0, _name.default)(name); } }; var correctNameList = function correctNameList(nameList) { var bestGuessConversions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; if (nameList instanceof Array) { return nameList.map(function (name) { return correctName(name, bestGuessConversions); }).filter(Boolean) || undefined; } }; var correctDate = function correctDate(date) { var bestGuessConversions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var dp = 'date-parts'; if (date && date[dp] instanceof Array && date[dp].every(function (part) { return part instanceof Array; })) { if (date[dp].every(function (part) { return part.every(function (datePart) { return typeof datePart === 'number'; }); })) { return _defineProperty({}, dp, date[dp].map(function (part) { return part.slice(); })); } else if (!bestGuessConversions) { return undefined; } else if (date[dp].some(function (part) { return part.some(function (datePart) { return typeof datePart === 'string'; }); })) { return _defineProperty({}, dp, date[dp].map(function (part) { return part.map(parseFloat); })); } } else if (date && date instanceof Array && date[0][dp] instanceof Array) { if (date[0][dp].every(function (datePart) { return typeof datePart === 'number'; })) { return _defineProperty({}, dp, [date[0][dp].slice()]); } else if (!bestGuessConversions) { return undefined; } else if (date[0][dp].every(function (datePart) { return typeof datePart === 'string'; })) { return _defineProperty({}, dp, [date[0][dp].map(parseFloat)]); } } }; var correctField = function correctField(fieldName, value) { var bestGuessConversions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; var fieldType = [].concat(fieldTypes[fieldName]); switch (fieldTypes[fieldName]) { case NAME: return correctName(value, bestGuessConversions); case NAME_LIST: return correctNameList(value, bestGuessConversions); case DATE: return correctDate(value, bestGuessConversions); } if (fieldType.includes(_typeof(value))) { return value; } else if (/^_/.test(value)) { return value; } else if (!bestGuessConversions) { return undefined; } else if (typeof value === 'string' && fieldType.includes('number') && parseFloat(value)) { return parseFloat(value); } else if (typeof value === 'number' && fieldType.includes('string') && !fieldType.includes('number')) { return value.toString(); } else if (Array.isArray(value) && value.length) { return correctField(fieldName, value[0]); } }; var parseCsl = function parseCsl(data) { return data.map(function (entry) { var clean = {}; for (var field in entry) { var correction = correctField(field, entry[field]); if (correction !== undefined) { clean[field] = correction; } } return clean; }); }; var _default = parseCsl; exports.default = _default; },{"./name":397}],358:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "parse", { enumerable: true, get: function get() { return _date.parse; } }); Object.defineProperty(exports, "default", { enumerable: true, get: function get() { return _date.parse; } }); exports.types = exports.scope = void 0; var _date = citationRequire("@citation-js/date"); var scope = '@date'; exports.scope = scope; var types = '@date'; exports.types = types; },{"@citation-js/date":276}],359:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _exportNames = { wikidata: true, bibtex: true, bibtxt: true, bibjson: true, doi: true, input: true, json: true, date: true, name: true, csl: true }; Object.defineProperty(exports, "json", { enumerable: true, get: function get() { return _json.parse; } }); Object.defineProperty(exports, "date", { enumerable: true, get: function get() { return _date.default; } }); Object.defineProperty(exports, "name", { enumerable: true, get: function get() { return _name.default; } }); Object.defineProperty(exports, "csl", { enumerable: true, get: function get() { return _csl.default; } }); exports.input = exports.doi = exports.bibjson = exports.bibtxt = exports.bibtex = exports.wikidata = void 0; citationRequire("./modules/"); var _chain = citationRequire("./interface/chain"); var _data = citationRequire("./interface/data"); var _type = citationRequire("./interface/type"); var _bibjson = citationRequire("./modules/bibjson/"); var _bibtex = citationRequire("./modules/bibtex/"); var _doi = citationRequire("./modules/doi/"); var _wikidata = citationRequire("./modules/wikidata/"); var _json = citationRequire("./modules/other/json"); var _date = _interopcitationRequireDefault(citationRequire("./date")); var _name = _interopcitationRequireDefault(citationRequire("./name")); var _csl = _interopcitationRequireDefault(citationRequire("./csl")); var _interface = citationRequire("./interface/"); Object.keys(_interface).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; Object.defineProperty(exports, key, { enumerable: true, get: function get() { return _interface[key]; } }); }); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var wikidata = { list: _wikidata.parsers.list.parse, json: _wikidata.parsers.json.parse, prop: _wikidata.parsers.prop.parse, type: _wikidata.parsers.type.parse, async: { json: _wikidata.parsers.json.parseAsync, prop: _wikidata.parsers.prop.parseAsync } }; exports.wikidata = wikidata; var bibtex = { json: _bibtex.parsers.json.parse, text: _bibtex.parsers.text.parse, prop: _bibtex.parsers.prop.parse, type: _bibtex.parsers.type.parse }; exports.bibtex = bibtex; var bibtxt = { text: _bibtex.parsers.bibtxt.text, textEntry: _bibtex.parsers.bibtxt.textEntry }; exports.bibtxt = bibtxt; var bibjson = _bibjson.parsers.json.parse; exports.bibjson = bibjson; var doi = { id: _doi.parsers.id.parse, api: _doi.parsers.api.parse, async: { api: _doi.parsers.api.parseAsync } }; exports.doi = doi; var input = { chain: _chain.chain, chainAsync: _chain.chainAsync, chainLink: _chain.chainLink, chainLinkAsync: _chain.chainLinkAsync, data: _data.data, dataAsync: _data.dataAsync, type: _type.type, async: { chain: _chain.chainAsync, chainLink: _chain.chainLinkAsync, data: _data.dataAsync } }; exports.input = input; },{"./csl":357,"./date":358,"./interface/":364,"./interface/chain":360,"./interface/data":361,"./interface/type":367,"./modules/":382,"./modules/bibjson/":368,"./modules/bibtex/":371,"./modules/doi/":379,"./modules/other/json":388,"./modules/wikidata/":391,"./name":397}],360:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.chainLinkAsync = exports.chainAsync = exports.chainLink = exports.chain = void 0; var _deepCopy = _interopcitationRequireDefault(citationRequire("../../util/deepCopy")); var _type = citationRequire("./type"); var _data = citationRequire("./data"); var _graph = citationRequire("./graph"); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } var chain = function chain(input) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var _options$maxChainLeng = options.maxChainLength, maxChainLength = _options$maxChainLeng === void 0 ? 10 : _options$maxChainLeng, _options$generateGrap = options.generateGraph, generateGraph = _options$generateGrap === void 0 ? true : _options$generateGrap, forceType = options.forceType; var type = forceType || (0, _type.type)(input); var output = type.match(/object$/) ? (0, _deepCopy.default)(input) : input; var graph = [{ type: type, data: input }]; while (type !== '@csl/list+object') { if (maxChainLength-- <= 0) { logger.error('[set]', 'Max. number of parsing iterations reached'); return []; } output = (0, _data.data)(output, type); type = (0, _type.type)(output); graph.push({ type: type }); } return output.map(generateGraph ? function (entry) { return (0, _graph.applyGraph)(entry, graph); } : _graph.removeGraph); }; exports.chain = chain; var chainLink = function chainLink(input) { var type = (0, _type.type)(input); var output = type.match(/array|object/) ? (0, _deepCopy.default)(input) : input; return (0, _data.data)(output, type); }; exports.chainLink = chainLink; var chainAsync = function () { var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(input) { var options, _options$maxChainLeng2, maxChainLength, _options$generateGrap2, generateGraph, forceType, type, output, graph, _args = arguments; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; _options$maxChainLeng2 = options.maxChainLength, maxChainLength = _options$maxChainLeng2 === void 0 ? 10 : _options$maxChainLeng2, _options$generateGrap2 = options.generateGraph, generateGraph = _options$generateGrap2 === void 0 ? true : _options$generateGrap2, forceType = options.forceType; type = forceType || (0, _type.type)(input); output = type.match(/array|object/) ? (0, _deepCopy.default)(input) : input; graph = [{ type: type, data: input }]; case 5: if (!(type !== '@csl/list+object')) { _context.next = 16; break; } if (!(maxChainLength-- <= 0)) { _context.next = 9; break; } logger.error('[set]', 'Max. number of parsing iterations reached'); return _context.abrupt("return", []); case 9: _context.next = 11; return (0, _data.dataAsync)(output, type); case 11: output = _context.sent; type = (0, _type.type)(output); graph.push({ type: type }); _context.next = 5; break; case 16: return _context.abrupt("return", output.map(generateGraph ? function (entry) { return (0, _graph.applyGraph)(entry, graph); } : _graph.removeGraph)); case 17: case "end": return _context.stop(); } } }, _callee, this); })); return function chainAsync(_x) { return _ref.apply(this, arguments); }; }(); exports.chainAsync = chainAsync; var chainLinkAsync = function () { var _ref2 = _asyncToGenerator(regeneratorRuntime.mark(function _callee2(input) { var type, output; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: type = (0, _type.type)(input); output = type.match(/array|object/) ? (0, _deepCopy.default)(input) : input; return _context2.abrupt("return", (0, _data.dataAsync)(output, type)); case 3: case "end": return _context2.stop(); } } }, _callee2, this); })); return function chainLinkAsync(_x2) { return _ref2.apply(this, arguments); }; }(); exports.chainLinkAsync = chainLinkAsync; },{"../../util/deepCopy":400,"./data":361,"./graph":363,"./type":367}],361:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.listDataParser = exports.removeDataParser = exports.hasDataParser = exports.addDataParser = exports.dataAsync = exports.data = void 0; var _chain = citationRequire("./chain"); function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } var flatten = function flatten(array) { var _ref; return (_ref = []).concat.apply(_ref, _toConsumableArray(array)); }; var parsers = {}; var asyncParsers = {}; var nativeParsers = { '@csl/object': function cslObject(input) { return [input]; }, '@csl/list+object': function cslListObject(input) { return input; }, '@else/list+object': function elseListObject(input) { return flatten(input.map(_chain.chain)); }, '@invalid': function invalid() { return []; } }; var nativeAsyncParsers = { '@else/list+object': function () { var _elseListObject = _asyncToGenerator(regeneratorRuntime.mark(function _callee(input) { return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.t0 = flatten; _context.next = 3; return Promise.all(input.map(_chain.chainAsync)); case 3: _context.t1 = _context.sent; return _context.abrupt("return", (0, _context.t0)(_context.t1)); case 5: case "end": return _context.stop(); } } }, _callee, this); })); return function elseListObject(_x) { return _elseListObject.apply(this, arguments); }; }() }; var data = function data(input, type) { if (parsers.hasOwnProperty(type)) { return parsers[type](input); } else if (nativeParsers.hasOwnProperty(type)) { return nativeParsers[type](input); } else { logger.error('[set]', "No synchronous parser found for ".concat(type)); return null; } }; exports.data = data; var dataAsync = function () { var _ref2 = _asyncToGenerator(regeneratorRuntime.mark(function _callee2(input, type) { return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: if (!asyncParsers.hasOwnProperty(type)) { _context2.next = 4; break; } return _context2.abrupt("return", asyncParsers[type](input)); case 4: if (!nativeAsyncParsers.hasOwnProperty(type)) { _context2.next = 8; break; } return _context2.abrupt("return", nativeAsyncParsers[type](input)); case 8: if (!hasDataParser(type, false)) { _context2.next = 12; break; } return _context2.abrupt("return", data(input, type)); case 12: logger.error('[set]', "No parser found for ".concat(type)); return _context2.abrupt("return", null); case 14: case "end": return _context2.stop(); } } }, _callee2, this); })); return function dataAsync(_x2, _x3) { return _ref2.apply(this, arguments); }; }(); exports.dataAsync = dataAsync; var addDataParser = function addDataParser(format, _ref3) { var parser = _ref3.parser, async = _ref3.async; if (async) { asyncParsers[format] = parser; } else { parsers[format] = parser; } }; exports.addDataParser = addDataParser; var hasDataParser = function hasDataParser(type, async) { return async ? asyncParsers[type] || nativeAsyncParsers[type] : parsers[type] || nativeParsers[type]; }; exports.hasDataParser = hasDataParser; var removeDataParser = function removeDataParser(type, async) { delete (async ? asyncParsers : parsers)[type]; }; exports.removeDataParser = removeDataParser; var listDataParser = function listDataParser(async) { return Object.keys(async ? asyncParsers : parsers); }; exports.listDataParser = listDataParser; },{"./chain":360}],362:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.dataTypeOf = exports.typeOf = void 0; function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var typeOf = function typeOf(thing) { switch (thing) { case undefined: return 'Undefined'; case null: return 'Null'; default: return thing.constructor.name; } }; exports.typeOf = typeOf; var dataTypeOf = function dataTypeOf(thing) { switch (_typeof(thing)) { case 'string': return 'String'; case 'object': if (Array.isArray(thing)) { return 'Array'; } else if (typeOf(thing) === 'Object') { return 'SimpleObject'; } else if (typeOf(thing) !== 'Null') { return 'ComplexObject'; } default: return 'Primitive'; } }; exports.dataTypeOf = dataTypeOf; },{}],363:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.removeGraph = exports.applyGraph = void 0; function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } var applyGraph = function applyGraph(entry, graph) { var isArrayElse = function isArrayElse(_ref) { var type = _ref.type; return type === '@else/list+object'; }; if (!Array.isArray(entry._graph)) { entry._graph = graph; } else if (graph.find(isArrayElse)) { graph.splice.apply(graph, [graph.findIndex(isArrayElse), 1].concat(_toConsumableArray(entry._graph.slice(0, -1)))); entry._graph = graph; } return entry; }; exports.applyGraph = applyGraph; var removeGraph = function removeGraph(entry) { delete entry._graph; return entry; }; exports.removeGraph = removeGraph; },{}],364:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _exportNames = { util: true }; exports.util = void 0; var dataType = _interopcitationRequireWildcard(citationRequire("./dataType")); var graph = _interopcitationRequireWildcard(citationRequire("./graph")); var parser = _interopcitationRequireWildcard(citationRequire("./parser")); var _register = citationRequire("./register"); Object.keys(_register).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; Object.defineProperty(exports, key, { enumerable: true, get: function get() { return _register[key]; } }); }); var _chain = citationRequire("./chain"); Object.keys(_chain).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; Object.defineProperty(exports, key, { enumerable: true, get: function get() { return _chain[key]; } }); }); var _type = citationRequire("./type"); Object.keys(_type).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; Object.defineProperty(exports, key, { enumerable: true, get: function get() { return _type[key]; } }); }); var _data = citationRequire("./data"); Object.keys(_data).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; Object.defineProperty(exports, key, { enumerable: true, get: function get() { return _data[key]; } }); }); function _interopcitationRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var util = _objectSpread({}, dataType, graph, parser); exports.util = util; },{"./chain":360,"./data":361,"./dataType":362,"./graph":363,"./parser":365,"./register":366,"./type":367}],365:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FormatParser = exports.DataParser = exports.TypeParser = void 0; var _type = citationRequire("./type"); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var TypeParser = function () { function TypeParser(data) { _classCallCheck(this, TypeParser); _defineProperty(this, "validDataTypes", ['String', 'Array', 'SimpleObject', 'ComplexObject', 'Primitive']); this.data = data; } _createClass(TypeParser, [{ key: "validateDataType", value: function validateDataType() { var dataType = this.data.dataType; if (dataType && !this.validDataTypes.includes(dataType)) { throw new RangeError("dataType was ".concat(dataType, "; expected one of ").concat(this.validDataTypes)); } } }, { key: "validateParseType", value: function validateParseType() { var predicate = this.data.predicate; if (predicate && !(predicate instanceof RegExp || typeof predicate === 'function')) { throw new TypeError("predicate was ".concat(_typeof(predicate), "; expected RegExp or function")); } } }, { key: "validateTokenList", value: function validateTokenList() { var tokenList = this.data.tokenList; if (tokenList && _typeof(tokenList) !== 'object') { throw new TypeError("tokenList was ".concat(_typeof(tokenList), "; expected object or RegExp")); } } }, { key: "validatePropertyConstraint", value: function validatePropertyConstraint() { var propertyConstraint = this.data.propertyConstraint; if (propertyConstraint && _typeof(propertyConstraint) !== 'object') { throw new TypeError("propertyConstraint was ".concat(_typeof(propertyConstraint), "; expected array or object")); } } }, { key: "validateElementConstraint", value: function validateElementConstraint() { var elementConstraint = this.data.elementConstraint; if (elementConstraint && typeof elementConstraint !== 'string') { throw new TypeError("elementConstraint was ".concat(_typeof(elementConstraint), "; expected string")); } } }, { key: "validateExtends", value: function validateExtends() { var extend = this.data.extends; if (extend && typeof extend !== 'string') { throw new TypeError("extends was ".concat(_typeof(extend), "; expected string")); } } }, { key: "validate", value: function validate() { if (this.data === null || _typeof(this.data) !== 'object') { throw new TypeError("typeParser was ".concat(_typeof(this.data), "; expected object")); } this.validateDataType(); this.validateParseType(); this.validateTokenList(); this.validatePropertyConstraint(); this.validateElementConstraint(); this.validateExtends(); } }, { key: "parseTokenList", value: function parseTokenList() { var tokenList = this.data.tokenList; if (!tokenList) { return []; } else if (tokenList instanceof RegExp) { tokenList = { token: tokenList }; } var _tokenList = tokenList, token = _tokenList.token, _tokenList$split = _tokenList.split, split = _tokenList$split === void 0 ? /\s+/ : _tokenList$split, _tokenList$trim = _tokenList.trim, trim = _tokenList$trim === void 0 ? true : _tokenList$trim, _tokenList$every = _tokenList.every, every = _tokenList$every === void 0 ? true : _tokenList$every; var trimInput = function trimInput(input) { return trim ? input.trim() : input; }; var testTokens = every ? 'every' : 'some'; var predicate = function predicate(input) { return trimInput(input).split(split)[testTokens](function (part) { return token.test(part); }); }; return [predicate]; } }, { key: "parsePropertyConstraint", value: function parsePropertyConstraint() { var constraints = [].concat(this.data.propertyConstraint || []); return constraints.map(function (_ref) { var props = _ref.props, _ref$match = _ref.match, match = _ref$match === void 0 ? 'every' : _ref$match, _ref$value = _ref.value, value = _ref$value === void 0 ? function () { return true; } : _ref$value; props = [].concat(props); return function (input) { return props[match](function (prop) { return prop in input && value(input[prop]); }); }; }); } }, { key: "parseElementConstraint", value: function parseElementConstraint() { var constraint = this.data.elementConstraint; return !constraint ? [] : [function (input) { return input.every(function (entry) { return (0, _type.type)(entry) === constraint; }); }]; } }, { key: "parsePredicate", value: function parsePredicate() { if (this.data.predicate instanceof RegExp) { return [this.data.predicate.test.bind(this.data.predicate)]; } else if (this.data.predicate) { return [this.data.predicate]; } else { return []; } } }, { key: "getCombinedPredicate", value: function getCombinedPredicate() { var predicates = _toConsumableArray(this.parsePredicate()).concat(_toConsumableArray(this.parseTokenList()), _toConsumableArray(this.parsePropertyConstraint()), _toConsumableArray(this.parseElementConstraint())); if (predicates.length === 0) { return function () { return true; }; } else if (predicates.length === 1) { return predicates[0]; } else { return function (input) { return predicates.every(function (predicate) { return predicate(input); }); }; } } }, { key: "getDataType", value: function getDataType() { if (this.data.dataType) { return this.data.dataType; } else if (this.data.predicate instanceof RegExp) { return 'String'; } else if (this.data.tokenList) { return 'String'; } else if (this.data.elementConstraint) { return 'Array'; } else { return 'Primitive'; } } }, { key: "dataType", get: function get() { return this.getDataType(); } }, { key: "predicate", get: function get() { return this.getCombinedPredicate(); } }, { key: "extends", get: function get() { return this.data.extends; } }]); return TypeParser; }(); exports.TypeParser = TypeParser; var DataParser = function () { function DataParser(parser) { var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, async = _ref2.async; _classCallCheck(this, DataParser); this.parser = parser; this.async = async; } _createClass(DataParser, [{ key: "validate", value: function validate() { var parser = this.parser; if (typeof parser !== 'function') { throw new TypeError("parser was ".concat(_typeof(parser), "; expected function")); } } }]); return DataParser; }(); exports.DataParser = DataParser; var FormatParser = function () { function FormatParser(format) { var parsers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; _classCallCheck(this, FormatParser); this.format = format; if (parsers.parseType) { this.typeParser = new TypeParser(parsers.parseType); } if (parsers.parse) { this.dataParser = new DataParser(parsers.parse, { async: false }); } if (parsers.parseAsync) { this.asyncDataParser = new DataParser(parsers.parseAsync, { async: true }); } } _createClass(FormatParser, [{ key: "validateFormat", value: function validateFormat() { var format = this.format; if (!_type.typeMatcher.test(format)) { throw new TypeError("format name was \"".concat(format, "\"; didn't match expected pattern")); } } }, { key: "validate", value: function validate() { this.validateFormat(); if (this.typeParser) { this.typeParser.validate(); } if (this.dataParser) { this.dataParser.validate(); } if (this.asyncDataParser) { this.asyncDataParser.validate(); } } }]); return FormatParser; }(); exports.FormatParser = FormatParser; },{"./type":367}],366:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.list = exports.has = exports.remove = exports.add = void 0; var _parser = citationRequire("./parser"); var _type = citationRequire("./type"); var _data = citationRequire("./data"); var formats = {}; var add = function add(format, parsers) { var formatParser = new _parser.FormatParser(format, parsers); formatParser.validate(); var index = formats[format] = {}; if (formatParser.typeParser) { (0, _type.addTypeParser)(format, formatParser.typeParser); index.type = true; } if (formatParser.dataParser) { (0, _data.addDataParser)(format, formatParser.dataParser); index.data = true; } if (formatParser.asyncDataParser) { (0, _data.addDataParser)(format, formatParser.asyncDataParser); index.asyncData = true; } }; exports.add = add; var remove = function remove(format) { var index = formats[format]; if (!index) { return; } if (index.type) { (0, _type.removeTypeParser)(format); } if (index.data) { (0, _data.removeDataParser)(format); } if (index.asyncData) { (0, _data.removeDataParser)(format, true); } delete formats[format]; }; exports.remove = remove; var has = function has(format) { return format in formats; }; exports.has = has; var list = function list() { return Object.keys(formats); }; exports.list = list; },{"./data":361,"./parser":365,"./type":367}],367:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.typeMatcher = exports.treeTypeParser = exports.listTypeParser = exports.removeTypeParser = exports.hasTypeParser = exports.addTypeParser = exports.type = void 0; var _dataType = citationRequire("./dataType"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } var types = {}; var dataTypes = {}; var unregExts = {}; var parseNativeTypes = function parseNativeTypes(input, dataType) { switch (dataType) { case 'Array': if (input.length === 0 || input.every(function (entry) { return type(entry) === '@csl/object'; })) { return '@csl/list+object'; } else { return '@else/list+object'; } case 'SimpleObject': case 'ComplexObject': return '@csl/object'; default: logger.warn('[set]', 'This format is not supported or recognized'); return '@invalid'; } }; var matchType = function matchType() { var typeList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; var data = arguments.length > 1 ? arguments[1] : undefined; var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = typeList[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var _type = _step.value; if (types[_type].predicate(data)) { return matchType(types[_type].extensions, data) || _type; } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } }; var type = function type(input) { var dataType = (0, _dataType.dataTypeOf)(input); if (dataType === 'Array' && input.length === 0) { return parseNativeTypes(input, dataType); } var match = matchType(dataTypes[dataType], input); return match || parseNativeTypes(input, dataType); }; exports.type = type; var addTypeParser = function addTypeParser(format, _ref) { var dataType = _ref.dataType, predicate = _ref.predicate, extend = _ref.extends; var extensions = []; if (format in unregExts) { extensions = unregExts[format]; delete unregExts[format]; logger.info('[set]', "Subclasses \"".concat(extensions, "\" finally registered to parent type \"").concat(format, "\"")); } var object = { predicate: predicate, extensions: extensions }; types[format] = object; if (extend) { var parentTypeParser = types[extend]; if (parentTypeParser) { parentTypeParser.extensions.push(format); } else { if (!unregExts[extend]) { unregExts[extend] = []; } unregExts[extend].push(format); logger.info('[set]', "Subclass \"".concat(format, "\" is waiting on parent type \"").concat(extend, "\"")); } } else { var typeList = dataTypes[dataType] || (dataTypes[dataType] = []); typeList.push(format); } }; exports.addTypeParser = addTypeParser; var hasTypeParser = function hasTypeParser(type) { return types.hasOwnProperty(type); }; exports.hasTypeParser = hasTypeParser; var removeTypeParser = function removeTypeParser(type) { delete types[type]; var typeLists = _toConsumableArray(Object.values(dataTypes)).concat(_toConsumableArray(Object.values(types).map(function (type) { return type.extensions; }).filter(function (list) { return list.length > 0; }))); typeLists.forEach(function (typeList) { var index = typeList.indexOf(type); if (index > -1) { typeList.splice(index, 1); } }); }; exports.removeTypeParser = removeTypeParser; var listTypeParser = function listTypeParser() { return Object.keys(types); }; exports.listTypeParser = listTypeParser; var treeTypeParser = function treeTypeParser() { var attachNode = function attachNode(name) { return { name: name, children: types[name].extensions.map(attachNode) }; }; return { name: 'Type tree', children: Object.entries(dataTypes).map(function (_ref2) { var _ref3 = _slicedToArray(_ref2, 2), name = _ref3[0], children = _ref3[1]; return { name: name, children: children.map(attachNode) }; }) }; }; exports.treeTypeParser = treeTypeParser; var typeMatcher = /^(?:@(.+?))(?:\/(?:(.+?)\+)?(?:(.+)))?$/; exports.typeMatcher = typeMatcher; },{"./dataType":362}],368:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formats = exports.parsers = exports.ref = void 0; var json = _interopcitationRequireWildcard(citationRequire("./json")); function _interopcitationRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } var scraperLinks = ['fulltext_html', 'fulltext_xml', 'fulltext_pdf']; var ref = '@bibjson'; exports.ref = ref; var parsers = { json: json }; exports.parsers = parsers; var formats = { '@bibjson/quickscrape+record+object': { parse: json.quickscrapeRecord, parseType: { propertyConstraint: { props: 'link', value: function value(links) { return scraperLinks.some(function (link) { return links.find(function (_ref) { var type = _ref.type; return type === link; }); }); } }, extends: '@bibjson/record+object' } }, '@bibjson/record+object': { parse: json.record, parseType: { dataType: 'SimpleObject', propertyConstraint: [{ props: 'title' }, { props: ['author', 'editor'], match: 'some', value: function value(authors) { return Array.isArray(authors) && authors[0] && 'name' in authors[0]; } }] } }, '@bibjson/collection+object': { parse: function parse(collection) { return collection.records; }, parseType: { dataType: 'SimpleObject', propertyConstraint: [{ props: 'metadata', value: function value(metadata) { return 'collection' in metadata; } }, { props: 'records', value: function value(records) { return Array.isArray(records); } }] } } }; exports.formats = formats; },{"./json":369}],369:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.record = exports.quickscrapeRecord = void 0; var _date = _interopcitationRequireDefault(citationRequire("../../date")); var _name = _interopcitationRequireDefault(citationRequire("../../name")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function nameProps(person) { var firstname = person.firstname, lastname = person.lastname, _person$firstName = person.firstName, given = _person$firstName === void 0 ? firstname : _person$firstName, _person$lastName = person.lastName, family = _person$lastName === void 0 ? lastname : _person$lastName; if (given && family) { return { given: given, family: family }; } else if (person.name) { return (0, _name.default)(person.name); } } var identifiers = ['PMID', 'PMCID', 'DOI', 'ISBN']; var journalIdentifiers = ['ISSN']; function idProps(input, identifiers) { var output = {}; for (var prop in input) { var upperCaseProp = prop.toUpperCase(); if (identifiers.includes(upperCaseProp)) { output[upperCaseProp] = input[prop]; } } if (input.identifier) { var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = input.identifier[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var _ref2 = _step.value; var id = _ref2.id, _ref2$type = _ref2.type, type = _ref2$type === void 0 ? '' : _ref2$type; type = type.toUpperCase(); if (identifiers.includes(type)) { output[type] = id; } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } } return output; } var typeMap = { article: 'article', book: 'book', booklet: 'book', proceedings: 'book', mastersthesis: 'thesis', inbook: 'chapter', incollection: 'chapter', conference: 'paper-conference', inproceedings: 'paper-conference', online: 'website', patent: 'patent', phdthesis: 'thesis', techreport: 'report', unpublished: 'manuscript', manual: undefined, misc: undefined }; function quickscrapeSpecificProps() { return { type: 'article-journal' }; } function generalProps(input) { var output = { type: typeMap[input.type] || 'book' }; if (input.title) { output.title = input.title; } if (input.author) { output.author = input.author.map(nameProps).filter(Boolean); } if (input.editor) { output.editor = input.editor.map(nameProps).filter(Boolean); } if (input.reviewer) { if (input.author) { output['reviewed-author'] = output.author; } output.author = input.reviewer.map(nameProps).filter(Boolean); } if (Array.isArray(input.keywords)) { output.keyword = input.keywords.join(); } else if (input.keywords) { output.keyword = input.keywords; } if (input.publisher) { output.publisher = input.publisher.name || input.publisher; } if (input.date && Object.keys(input.date).length > 0) { var dates = input.date; if (dates.submitted) { output.submitted = (0, _date.default)(dates.submitted); } if (dates.published) { output.issued = (0, _date.default)(dates.published); } } else if (input.year) { output.issued = { 'date-parts': [[+input.year]] }; } if (input.journal) { var journal = input.journal; if (journal.name) { output['container-title'] = journal.name; } if (journal.volume) { output.volume = +journal.volume; } if (journal.issue) { output.issue = +journal.issue; } Object.assign(output, idProps(journal, journalIdentifiers)); if (journal.firstpage) { output['page-first'] = journal.firstpage; } if (journal.pages) { output.page = journal.pages.replace('--', '-'); } else if (journal.firstpage && journal.lastpage) { output.page = journal.firstpage + '-' + journal.lastpage; } } if (input.link && _typeof(input.link[0]) === 'object') { output.URL = input.link[0].url; } Object.assign(output, idProps(input, identifiers)); if (input.cid) { output.id = input.cid; } else if (output.DOI) { output.id = output.DOI; } return output; } var parseContentMine = function parseContentMine(data) { return Object.assign(generalProps(data), quickscrapeSpecificProps(data)); }; exports.quickscrapeRecord = parseContentMine; var parseBibJson = function parseBibJson(data) { return generalProps(data); }; exports.record = parseBibJson; },{"../../date":358,"../../name":397}],370:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.textEntry = exports.text = exports.parse = void 0; function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var bibTxtRegex = { splitEntries: /\n\s*(?=\[)/g, parseEntry: /^\[(.+?)\]\s*(?:\n([\s\S]+))?$/, splitPairs: /((?=.)\s)*\n\s*/g, splitPair: /:(.*)/ }; var parseBibTxtEntry = function parseBibTxtEntry(entry) { var _ref = entry.match(bibTxtRegex.parseEntry) || [], _ref2 = _slicedToArray(_ref, 3), label = _ref2[1], pairs = _ref2[2]; if (!label || !pairs) { return {}; } else { var out = { type: 'book', label: label, properties: {} }; pairs.trim().split(bibTxtRegex.splitPairs).filter(function (v) { return v; }).forEach(function (pair) { var _pair$split = pair.split(bibTxtRegex.splitPair), _pair$split2 = _slicedToArray(_pair$split, 2), key = _pair$split2[0], value = _pair$split2[1]; if (value) { key = key.trim(); value = value.trim(); if (key === 'type') { out.type = value; } else { out.properties[key] = value; } } }); return out; } }; exports.textEntry = parseBibTxtEntry; var parseBibTxt = function parseBibTxt(src) { return src.trim().split(bibTxtRegex.splitEntries).map(parseBibTxtEntry); }; exports.text = exports.parse = parseBibTxt; },{}],371:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formats = exports.parsers = exports.ref = void 0; var text = _interopcitationRequireWildcard(citationRequire("./text")); var json = _interopcitationRequireWildcard(citationRequire("./json")); var prop = _interopcitationRequireWildcard(citationRequire("./prop")); var type = _interopcitationRequireWildcard(citationRequire("./type")); var bibtxt = _interopcitationRequireWildcard(citationRequire("./bibtxt")); function _interopcitationRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } var ref = '@bibtex'; exports.ref = ref; var parsers = { text: text, json: json, prop: prop, type: type, bibtxt: bibtxt }; exports.parsers = parsers; var formats = { '@bibtex/text': { parse: text.parse, parseType: { dataType: 'String', predicate: /@\s{0,5}[A-Za-z]{1,13}\s{0,5}\{\s{0,5}[^@{}"=,\\\s]{0,100}\s{0,5},[\s\S]*\}/ } }, '@bibtxt/text': { parse: bibtxt.parse, parseType: { dataType: 'String', predicate: /^\s*(\[(?!\s*[{[]).*?\]\s*(\n\s*[^[]((?!:)\S)+\s*:\s*.+?\s*)*\s*)+$/ } }, '@bibtex/object': { parse: json.parse, parseType: { dataType: 'SimpleObject', propertyConstraint: { props: ['type', 'label', 'properties'] } } }, '@bibtex/prop': { parse: prop.parse }, '@bibtex/type': { parse: type.parse } }; exports.formats = formats; },{"./bibtxt":370,"./json":372,"./prop":373,"./text":374,"./type":376}],372:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.parse = void 0; var _prop2 = _interopcitationRequireDefault(citationRequire("./prop")); var _type = _interopcitationRequireDefault(citationRequire("./type")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var parseBibTeXJSON = function parseBibTeXJSON(data) { return [].concat(data).map(function (entry) { var newEntry = {}; var toMerge = []; for (var prop in entry.properties) { var oldValue = entry.properties[prop]; var _ref = (0, _prop2.default)(prop, oldValue) || [], _ref2 = _slicedToArray(_ref, 2), cslField = _ref2[0], cslValue = _ref2[1]; if (cslField) { if (/^[^:\s]+?:[^.\s]+(\.[^.\s]+)*$/.test(cslField)) { toMerge.push([cslField, cslValue]); } else { newEntry[cslField] = cslValue; } } } newEntry.type = (0, _type.default)(entry.type); newEntry.id = newEntry['citation-label'] = entry.label; if (/\d(\D+)$/.test(entry.label)) { newEntry['year-suffix'] = entry.label.match(/\d(\D+)$/)[1]; } toMerge.forEach(function (_ref3) { var _ref4 = _slicedToArray(_ref3, 2), cslField = _ref4[0], value = _ref4[1]; var props = cslField.split(/:|\./g); var cursor = newEntry; while (props.length > 0) { var _prop = props.shift(); cursor = cursor[_prop] || (cursor[_prop] = !props.length ? value : isNaN(+props[0]) ? {} : []); } }); return newEntry; }); }; exports.default = exports.parse = parseBibTeXJSON; },{"./prop":373,"./type":376}],373:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.parse = void 0; var _name = _interopcitationRequireDefault(citationRequire("../../name")); var _date = _interopcitationRequireDefault(citationRequire("../../date")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var months = [/jan(uary)?\.?/i, /feb(ruary)?\.?/i, /mar(ch)?\.?/i, /apr(il)?\.?/i, /may\.?/i, /jun(e)?\.?/i, /jul(y)?\.?/i, /aug(ust)?\.?/i, /sep(tember)?\.?/i, /oct(ober)?\.?/i, /nov(ember)?\.?/i, /dec(ember)?\.?/i]; var parseBibtexDate = function parseBibtexDate(value) { if (/{|}/.test(value)) { return { literal: value.replace(/[{}]/g, '') }; } else { return (0, _date.default)(value); } }; var parseBibtexName = function parseBibtexName(name) { if (/{|}/.test(name)) { return { literal: name.replace(/[{}]/g, '') }; } else { return (0, _name.default)(name); } }; var parseBibtexNameList = function parseBibtexNameList(list) { var literals = []; list = list.replace(/%/g, '%0').replace(/{.*?}/g, function (m) { return "%[".concat(literals.push(m) - 1, "]"); }); return list.split(' and ').map(function (name) { return name.replace(/%\[(\d+)\]/, function (_, i) { return literals[+i]; }).replace(/%0/g, '%'); }).map(parseBibtexName); }; var richTextMappings = { textit: 'i', textbf: 'b', textsc: 'sc', textsuperscript: 'sup', textsubscript: 'sub' }; var parseBibtexRichText = function parseBibtexRichText(text) { var tokens = text.split(/((?:\\text[a-z]+)?{|})/); var closingTags = []; var hasTopLevelTag = text[0] === '{' && text[text.length - 1] === '}'; tokens = tokens.map(function (token, index) { if (index % 2 === 0) { return token; } else if (token[0] === '\\') { var tag = richTextMappings[token.slice(1, -1)]; closingTags.push("</".concat(tag, ">")); return "<".concat(tag, ">"); } else if (token === '{') { closingTags.push('</span>'); return '<span class="nocase">'; } else if (token === '}') { if (closingTags.length === 1 && index !== tokens.length - 2) { hasTopLevelTag = false; } return closingTags.pop(); } }); if (hasTopLevelTag) { tokens.splice(0, 2); tokens.splice(-2, 2); } return tokens.join(''); }; var propMap = { address: 'publisher-place', author: true, booktitle: 'container-title', doi: 'DOI', date: 'issued', edition: true, editor: true, isbn: 'ISBN', issn: 'ISSN', issue: 'issue', journal: 'container-title', language: true, location: 'publisher-place', note: true, number: 'issue', numpages: 'number-of-pages', pages: 'page', pmid: 'PMID', pmcid: 'PMCID', publisher: true, series: 'collection-title', title: true, url: 'URL', volume: true, year: 'issued:date-parts.0.0', month: 'issued:date-parts.0.1', day: 'issued:date-parts.0.2', crossref: false, keywords: false }; var parseBibTeXProp = function parseBibTeXProp(name, value) { if (!propMap.hasOwnProperty(name)) { logger.info('[set]', "Unknown property: ".concat(name)); return undefined; } else if (propMap[name] === false) { return undefined; } var cslProp = propMap[name] === true ? name : propMap[name]; var cslValue = function (name, value) { switch (name) { case 'author': case 'editor': return parseBibtexNameList(value); case 'issued': return parseBibtexDate(value); case 'edition': return value; case 'issued:date-parts.0.1': return parseFloat(value) ? value : months.findIndex(function (month) { return month.test(value); }) + 1; case 'page': return value.replace(/[—–]/, '-'); case 'title': return parseBibtexRichText(value); default: return value.replace(/[{}]/g, ''); } }(cslProp, value); return [cslProp, cslValue]; }; exports.default = exports.parse = parseBibTeXProp; },{"../../date":358,"../../name":397}],374:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.parse = void 0; var _stack = _interopcitationRequireDefault(citationRequire("../../../util/stack")); var _tokens = _interopcitationRequireDefault(citationRequire("./tokens.json")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var tokenPattern = /\\url|\\href|{\\[a-zA-Z]+}|\$\\[a-zA-Z]+\$|\$[_^]{[0-9()+=\-n]}\$|`{2,3}|'{2,3}|-{2,3}|[!?]!|!\?|{\\~}|\\[#$%&~_^\\{}]|{\\(?:[a-z] |[`"'^~=.])\\?[a-zA-Z]}|[\s\S]/g; var whitespace = /^\s$/; var syntax = /^[@{}"=,\\]$/; var delimiters = { '"': '"', '{': '}', '': '' }; var getTokenizedBibtex = function getTokenizedBibtex(str) { str = str.replace(/(\\[`"'^~=.]){\\?([A-Za-z])}/g, '{$1$2}').replace(/(\\[a-z]) ?{\\?([A-Za-z])}/g, '{$1 $2}'); return str.match(tokenPattern); }; var parseBibTeX = function parseBibTeX(str) { var entries = []; var tokens = getTokenizedBibtex(str); var stack = new _stack.default(tokens); try { stack.consumeWhitespace(); while (stack.tokensLeft()) { stack.consumeToken('@', { spaced: false }); stack.consumeWhitespace(); var type = stack.consume([whitespace, syntax], { inverse: true }).toLowerCase(); stack.consumeToken('{'); var label = stack.consume([whitespace, syntax], { inverse: true }); stack.consumeToken(','); var properties = {}; var _loop = function _loop() { var key = stack.consume([whitespace, '='], { inverse: true }).toLowerCase(); stack.consumeToken('='); var startDelimiter = stack.consume(/^({|"|)$/g); var endDelimiter = delimiters[startDelimiter]; if (!delimiters.hasOwnProperty(startDelimiter)) { throw new SyntaxError("Unexpected field delimiter at index ".concat(stack.index, ". Expected ") + "".concat(Object.keys(delimiters).map(function (v) { return "\"".concat(v, "\""); }).join(', '), "; got \"").concat(startDelimiter, "\"")); } var tokenMap = function tokenMap(token) { if (_tokens.default.hasOwnProperty(token)) { return _tokens.default[token]; } else if (token.match(/^\\[#$%&~_^\\{}]$/)) { return token.slice(1); } else if (token.length > 1) { throw new SyntaxError("Escape sequence not recognized: ".concat(token)); } else { return token; } }; var openBrackets = 0; var val = stack.consume(function (token, index) { if (token === '{') { openBrackets++; } if (stack.tokensLeft() < endDelimiter.length) { throw new SyntaxError("Unmatched delimiter at index ".concat(stack.index, ": Expected ").concat(endDelimiter)); } else if (!endDelimiter.length) { return ![whitespace, syntax].some(function (rgx) { return rgx.test(token); }); } else { return token === '}' && openBrackets-- || !stack.matchesSequence(endDelimiter); } }, { tokenMap: tokenMap }); properties[key] = val; stack.consumeN(endDelimiter.length); stack.consumeWhitespace(); if (stack.matches('}')) { return "break"; } stack.consumeToken(',', { spaced: false }); stack.consumeWhitespace(); if (stack.matches('}')) { return "break"; } }; while (stack.tokensLeft()) { var _ret = _loop(); if (_ret === "break") break; } stack.consumeToken('}', { spaced: false }); stack.consumeWhitespace(); if (stack.matches(',')) { stack.consumeToken(','); stack.consumeWhitespace(); } entries.push({ type: type, label: label, properties: properties }); } } catch (e) { logger.error("Uncaught SyntaxError: ".concat(e.message, ". Returning completed entries.")); entries.pop(); } return entries; }; exports.default = exports.parse = parseBibTeX; },{"../../../util/stack":406,"./tokens.json":375}],375:[function(citationRequire,module,exports){ module.exports={ "\\url":"", "\\href":"", "{\\textexclamdown}":"\u00A1", "{\\textcent}":"\u00A2", "{\\textsterling}":"\u00A3", "{\\textyen}":"\u00A5", "{\\textbrokenbar}":"\u00A6", "{\\textsection}":"\u00A7", "{\\textasciidieresis}":"\u00A8", "{\\textcopyright}":"\u00A9", "{\\textordfeminine}":"\u00AA", "{\\guillemotleft}":"\u00AB", "{\\textlnot}":"\u00AC", "{\\textregistered}":"\u00AE", "{\\textasciimacron}":"\u00AF", "{\\textdegree}":"\u00B0", "{\\textpm}":"\u00B1", "{\\texttwosuperior}":"\u00B2", "{\\textthreesuperior}":"\u00B3", "{\\textasciiacute}":"\u00B4", "{\\textmu}":"\u00B5", "{\\textparagraph}":"\u00B6", "{\\textperiodcentered}":"\u00B7", "{\\c\\ }":"\u00B8", "{\\textonesuperior}":"\u00B9", "{\\textordmasculine}":"\u00BA", "{\\guillemotright}":"\u00BB", "{\\textonequarter}":"\u00BC", "{\\textonehalf}":"\u00BD", "{\\textthreequarters}":"\u00BE", "{\\textquestiondown}":"\u00BF", "{\\AE}":"\u00C6", "{\\DH}":"\u00D0", "{\\texttimes}":"\u00D7", "{\\O}":"\u00D8", "{\\TH}":"\u00DE", "{\\ss}":"\u00DF", "{\\ae}":"\u00E6", "{\\dh}":"\u00F0", "{\\textdiv}":"\u00F7", "{\\o}":"\u00F8", "{\\th}":"\u00FE", "{\\i}":"\u0131", "{\\NG}":"\u014A", "{\\ng}":"\u014B", "{\\OE}":"\u0152", "{\\oe}":"\u0153", "{\\textasciicircum}":"\u02C6", "{\\textacutedbl}":"\u02DD", "$\\Gamma$":"\u0393", "$\\Delta$":"\u0394", "$\\Theta$":"\u0398", "$\\Lambda$":"\u039B", "$\\Xi$":"\u039E", "$\\Pi$":"\u03A0", "$\\Sigma$":"\u03A3", "$\\Phi$":"\u03A6", "$\\Psi$":"\u03A8", "$\\Omega$":"\u03A9", "$\\alpha$":"\u03B1", "$\\beta$":"\u03B2", "$\\gamma$":"\u03B3", "$\\delta$":"\u03B4", "$\\varepsilon$":"\u03B5", "$\\zeta$":"\u03B6", "$\\eta$":"\u03B7", "$\\theta$":"\u03B8", "$\\iota$":"\u03B9", "$\\kappa$":"\u03BA", "$\\lambda$":"\u03BB", "$\\mu$":"\u03BC", "$\\nu$":"\u03BD", "$\\xi$":"\u03BE", "$\\pi$":"\u03C0", "$\\rho$":"\u03C1", "$\\varsigma$":"\u03C2", "$\\sigma$":"\u03C3", "$\\tau$":"\u03C4", "$\\upsilon$":"\u03C5", "$\\varphi$":"\u03C6", "$\\chi$":"\u03C7", "$\\psi$":"\u03C8", "$\\omega$":"\u03C9", "$\\vartheta$":"\u03D1", "$\\Upsilon$":"\u03D2", "$\\phi$":"\u03D5", "$\\varpi$":"\u03D6", "$\\varrho$":"\u03F1", "$\\epsilon$":"\u03F5", "{\\textendash}":"\u2013", "{\\textemdash}":"\u2014", "---":"\u2014", "--":"\u2013", "{\\textbardbl}":"\u2016", "{\\textunderscore}":"\u2017", "{\\textquoteleft}":"\u2018", "{\\textquoteright}":"\u2019", "{\\quotesinglbase}":"\u201A", "{\\textquotedblleft}":"\u201C", "{\\textquotedblright}":"\u201D", "{\\quotedblbase}":"\u201E", "{\\textdagger}":"\u2020", "{\\textdaggerdbl}":"\u2021", "{\\textbullet}":"\u2022", "{\\textellipsis}":"\u2026", "{\\textperthousand}":"\u2030", "'''":"\u2034", "''":"\u201D", "``":"\u201C", "```":"\u2037", "{\\guilsinglleft}":"\u2039", "{\\guilsinglright}":"\u203A", "!!":"\u203C", "{\\textfractionsolidus}":"\u2044", "?!":"\u2048", "!?":"\u2049", "$^{0}$":"\u2070", "$^{4}$":"\u2074", "$^{5}$":"\u2075", "$^{6}$":"\u2076", "$^{7}$":"\u2077", "$^{8}$":"\u2078", "$^{9}$":"\u2079", "$^{+}$":"\u207A", "$^{-}$":"\u207B", "$^{=}$":"\u207C", "$^{(}$":"\u207D", "$^{)}$":"\u207E", "$^{n}$":"\u207F", "$_{0}$":"\u2080", "$_{1}$":"\u2081", "$_{2}$":"\u2082", "$_{3}$":"\u2083", "$_{4}$":"\u2084", "$_{5}$":"\u2085", "$_{6}$":"\u2086", "$_{7}$":"\u2087", "$_{8}$":"\u2088", "$_{9}$":"\u2089", "$_{+}$":"\u208A", "$_{-}$":"\u208B", "$_{=}$":"\u208C", "$_{(}$":"\u208D", "$_{)}$":"\u208E", "{\\texteuro}":"\u20AC", "{\\textcelsius}":"\u2103", "{\\textnumero}":"\u2116", "{\\textcircledP}":"\u2117", "{\\textservicemark}":"\u2120", "{TEL}":"\u2121", "{\\texttrademark}":"\u2122", "{\\textohm}":"\u2126", "{\\textestimated}":"\u212E", "{\\`A}":"\u00C0", "{\\'A}":"\u00C1", "{\\^A}":"\u00C2", "{\\~A}":"\u00C3", "{\\\"A}":"\u00C4", "{\\r A}":"\u00C5", "{\\c C}":"\u00C7", "{\\`E}":"\u00C8", "{\\'E}":"\u00C9", "{\\^E}":"\u00CA", "{\\\"E}":"\u00CB", "{\\`I}":"\u00CC", "{\\'I}":"\u00CD", "{\\^I}":"\u00CE", "{\\\"I}":"\u00CF", "{\\~N}":"\u00D1", "{\\`O}":"\u00D2", "{\\'O}":"\u00D3", "{\\^O}":"\u00D4", "{\\~O}":"\u00D5", "{\\\"O}":"\u00D6", "{\\`U}":"\u00D9", "{\\'U}":"\u00DA", "{\\^U}":"\u00DB", "{\\\"U}":"\u00DC", "{\\'Y}":"\u00DD", "{\\`a}":"\u00E0", "{\\'a}":"\u00E1", "{\\^a}":"\u00E2", "{\\~a}":"\u00E3", "{\\\"a}":"\u00E4", "{\\r a}":"\u00E5", "{\\c c}":"\u00E7", "{\\`e}":"\u00E8", "{\\'e}":"\u00E9", "{\\^e}":"\u00EA", "{\\\"e}":"\u00EB", "{\\`i}":"\u00EC", "{\\'i}":"\u00ED", "{\\^i}":"\u00EE", "{\\\"i}":"\u00EF", "{\\~n}":"\u00F1", "{\\`o}":"\u00F2", "{\\'o}":"\u00F3", "{\\^o}":"\u00F4", "{\\~o}":"\u00F5", "{\\\"o}":"\u00F6", "{\\`u}":"\u00F9", "{\\'u}":"\u00FA", "{\\^u}":"\u00FB", "{\\\"u}":"\u00FC", "{\\'y}":"\u00FD", "{\\\"y}":"\u00FF", "{\\=A}":"\u0100", "{\\=a}":"\u0101", "{\\u A}":"\u0102", "{\\u a}":"\u0103", "{\\k A}":"\u0104", "{\\k a}":"\u0105", "{\\'C}":"\u0106", "{\\'c}":"\u0107", "{\\^C}":"\u0108", "{\\^c}":"\u0109", "{\\.C}":"\u010A", "{\\.c}":"\u010B", "{\\v C}":"\u010C", "{\\v c}":"\u010D", "{\\v D}":"\u010E", "{\\v d}":"\u010F", "{\\=E}":"\u0112", "{\\=e}":"\u0113", "{\\u E}":"\u0114", "{\\u e}":"\u0115", "{\\.E}":"\u0116", "{\\.e}":"\u0117", "{\\k E}":"\u0118", "{\\k e}":"\u0119", "{\\v E}":"\u011A", "{\\v e}":"\u011B", "{\\^G}":"\u011C", "{\\^g}":"\u011D", "{\\u G}":"\u011E", "{\\u g}":"\u011F", "{\\.G}":"\u0120", "{\\.g}":"\u0121", "{\\c G}":"\u0122", "{\\c g}":"\u0123", "{\\^H}":"\u0124", "{\\^h}":"\u0125", "{\\~I}":"\u0128", "{\\~i}":"\u0129", "{\\=I}":"\u012A", "{\\=i}":"\u012B", "{\\=\\i}":"\u012B", "{\\u I}":"\u012C", "{\\u i}":"\u012D", "{\\k I}":"\u012E", "{\\k i}":"\u012F", "{\\.I}":"\u0130", "{\\^J}":"\u0134", "{\\^j}":"\u0135", "{\\c K}":"\u0136", "{\\c k}":"\u0137", "{\\'L}":"\u0139", "{\\'l}":"\u013A", "{\\c L}":"\u013B", "{\\c l}":"\u013C", "{\\v L}":"\u013D", "{\\v l}":"\u013E", "{\\L }":"\u0141", "{\\l }":"\u0142", "{\\'N}":"\u0143", "{\\'n}":"\u0144", "{\\c N}":"\u0145", "{\\c n}":"\u0146", "{\\v N}":"\u0147", "{\\v n}":"\u0148", "{\\=O}":"\u014C", "{\\=o}":"\u014D", "{\\u O}":"\u014E", "{\\u o}":"\u014F", "{\\H O}":"\u0150", "{\\H o}":"\u0151", "{\\'R}":"\u0154", "{\\'r}":"\u0155", "{\\c R}":"\u0156", "{\\c r}":"\u0157", "{\\v R}":"\u0158", "{\\v r}":"\u0159", "{\\'S}":"\u015A", "{\\'s}":"\u015B", "{\\^S}":"\u015C", "{\\^s}":"\u015D", "{\\c S}":"\u015E", "{\\c s}":"\u015F", "{\\v S}":"\u0160", "{\\v s}":"\u0161", "{\\c T}":"\u0162", "{\\c t}":"\u0163", "{\\v T}":"\u0164", "{\\v t}":"\u0165", "{\\~U}":"\u0168", "{\\~u}":"\u0169", "{\\=U}":"\u016A", "{\\=u}":"\u016B", "{\\u U}":"\u016C", "{\\u u}":"\u016D", "{\\r U}":"\u016E", "{\\r u}":"\u016F", "{\\H U}":"\u0170", "{\\H u}":"\u0171", "{\\k U}":"\u0172", "{\\k u}":"\u0173", "{\\^W}":"\u0174", "{\\^w}":"\u0175", "{\\^Y}":"\u0176", "{\\^y}":"\u0177", "{\\\"Y}":"\u0178", "{\\'Z}":"\u0179", "{\\'z}":"\u017A", "{\\.Z}":"\u017B", "{\\.z}":"\u017C", "{\\v Z}":"\u017D", "{\\v z}":"\u017E", "{\\v A}":"\u01CD", "{\\v a}":"\u01CE", "{\\v I}":"\u01CF", "{\\v i}":"\u01D0", "{\\v O}":"\u01D1", "{\\v o}":"\u01D2", "{\\v U}":"\u01D3", "{\\v u}":"\u01D4", "{\\v G}":"\u01E6", "{\\v g}":"\u01E7", "{\\v K}":"\u01E8", "{\\v k}":"\u01E9", "{\\k O}":"\u01EA", "{\\k o}":"\u01EB", "{\\v j}":"\u01F0", "{\\'G}":"\u01F4", "{\\'g}":"\u01F5", "{\\.B}":"\u1E02", "{\\.b}":"\u1E03", "{\\d B}":"\u1E04", "{\\d b}":"\u1E05", "{\\b B}":"\u1E06", "{\\b b}":"\u1E07", "{\\.D}":"\u1E0A", "{\\.d}":"\u1E0B", "{\\d D}":"\u1E0C", "{\\d d}":"\u1E0D", "{\\b D}":"\u1E0E", "{\\b d}":"\u1E0F", "{\\c D}":"\u1E10", "{\\c d}":"\u1E11", "{\\.F}":"\u1E1E", "{\\.f}":"\u1E1F", "{\\=G}":"\u1E20", "{\\=g}":"\u1E21", "{\\.H}":"\u1E22", "{\\.h}":"\u1E23", "{\\d H}":"\u1E24", "{\\d h}":"\u1E25", "{\\\"H}":"\u1E26", "{\\\"h}":"\u1E27", "{\\c H}":"\u1E28", "{\\c h}":"\u1E29", "{\\'K}":"\u1E30", "{\\'k}":"\u1E31", "{\\d K}":"\u1E32", "{\\d k}":"\u1E33", "{\\b K}":"\u1E34", "{\\b k}":"\u1E35", "{\\d L}":"\u1E36", "{\\d l}":"\u1E37", "{\\b L}":"\u1E3A", "{\\b l}":"\u1E3B", "{\\'M}":"\u1E3E", "{\\'m}":"\u1E3F", "{\\.M}":"\u1E40", "{\\.m}":"\u1E41", "{\\d M}":"\u1E42", "{\\d m}":"\u1E43", "{\\.N}":"\u1E44", "{\\.n}":"\u1E45", "{\\d N}":"\u1E46", "{\\d n}":"\u1E47", "{\\b N}":"\u1E48", "{\\b n}":"\u1E49", "{\\'P}":"\u1E54", "{\\'p}":"\u1E55", "{\\.P}":"\u1E56", "{\\.p}":"\u1E57", "{\\.R}":"\u1E58", "{\\.r}":"\u1E59", "{\\d R}":"\u1E5A", "{\\d r}":"\u1E5B", "{\\b R}":"\u1E5E", "{\\b r}":"\u1E5F", "{\\.S}":"\u1E60", "{\\.s}":"\u1E61", "{\\d S}":"\u1E62", "{\\d s}":"\u1E63", "{\\.T}":"\u1E6A", "{\\.t}":"\u1E6B", "{\\d T}":"\u1E6C", "{\\d t}":"\u1E6D", "{\\b T}":"\u1E6E", "{\\b t}":"\u1E6F", "{\\~V}":"\u1E7C", "{\\~v}":"\u1E7D", "{\\d V}":"\u1E7E", "{\\d v}":"\u1E7F", "{\\`W}":"\u1E80", "{\\`w}":"\u1E81", "{\\'W}":"\u1E82", "{\\'w}":"\u1E83", "{\\\"W}":"\u1E84", "{\\\"w}":"\u1E85", "{\\.W}":"\u1E86", "{\\.w}":"\u1E87", "{\\d W}":"\u1E88", "{\\d w}":"\u1E89", "{\\.X}":"\u1E8A", "{\\.x}":"\u1E8B", "{\\\"X}":"\u1E8C", "{\\\"x}":"\u1E8D", "{\\.Y}":"\u1E8E", "{\\.y}":"\u1E8F", "{\\^Z}":"\u1E90", "{\\^z}":"\u1E91", "{\\d Z}":"\u1E92", "{\\d z}":"\u1E93", "{\\b Z}":"\u1E94", "{\\b z}":"\u1E95", "{\\b h}":"\u1E96", "{\\\"t}":"\u1E97", "{\\r w}":"\u1E98", "{\\r y}":"\u1e99", "{\\d A}":"\u1EA0", "{\\d a}":"\u1EA1", "{\\d E}":"\u1EB8", "{\\d e}":"\u1EB9", "{\\~E}":"\u1EBC", "{\\~e}":"\u1EBD", "{\\d I}":"\u1ECA", "{\\d i}":"\u1ECB", "{\\d O}":"\u1ECC", "{\\d o}":"\u1ECD", "{\\d U}":"\u1EE4", "{\\d u}":"\u1EE5", "{\\`Y}":"\u1EF2", "{\\`y}":"\u1EF3", "{\\d Y}":"\u1EF4", "{\\d y}":"\u1EF5", "{\\~Y}":"\u1EF8", "{\\~y}":"\u1EF9", "{\\~}":"\u223C", "~":"\u00A0" } },{}],376:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.parse = void 0; var typeMap = { article: 'article-journal', book: 'book', booklet: 'book', proceedings: 'book', manual: false, mastersthesis: 'thesis', misc: false, inbook: 'chapter', incollection: 'chapter', conference: 'paper-conference', inproceedings: 'paper-conference', online: 'website', patent: 'patent', phdthesis: 'thesis', techreport: 'report', unpublished: 'manuscript' }; var parseBibTeXType = function parseBibTeXType(pubType) { if (!typeMap.hasOwnProperty(pubType)) { logger.warn('[set]', "BibTeX publication type not recognized: ".concat(pubType, ". Defaulting to \"book\".")); return 'book'; } else if (typeMap[pubType] === false) { return 'book'; } else { return typeMap[pubType]; } }; exports.default = exports.parse = parseBibTeXType; },{}],377:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parseAsync = exports.parse = void 0; var _json = _interopcitationRequireDefault(citationRequire("./json")); var _fetchFile = _interopcitationRequireDefault(citationRequire("../../../util/fetchFile")); var _fetchFileAsync = _interopcitationRequireDefault(citationRequire("../../../util/fetchFileAsync")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } var apiHeaders = { Accept: 'application/vnd.citationstyles.csl+json' }; var fetchDoiApiAsync = function () { var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(url) { var result; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.next = 2; return (0, _fetchFileAsync.default)(url, { headers: apiHeaders }); case 2: result = _context.sent; return _context.abrupt("return", result === '[]' ? {} : JSON.parse(result)); case 4: case "end": return _context.stop(); } } }, _callee, this); })); return function fetchDoiApiAsync(_x) { return _ref.apply(this, arguments); }; }(); var parseDoiApiAsync = function () { var _ref2 = _asyncToGenerator(regeneratorRuntime.mark(function _callee2(data) { var doiJsonList; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: _context2.next = 2; return Promise.all([].concat(data).map(fetchDoiApiAsync)); case 2: doiJsonList = _context2.sent; return _context2.abrupt("return", doiJsonList.map(_json.default)); case 4: case "end": return _context2.stop(); } } }, _callee2, this); })); return function parseDoiApiAsync(_x2) { return _ref2.apply(this, arguments); }; }(); exports.parseAsync = parseDoiApiAsync; var fetchDoiApi = function fetchDoiApi(url) { var result = (0, _fetchFile.default)(url, { headers: apiHeaders }); return result === '[]' ? {} : JSON.parse(result); }; var parseDoiApi = function parseDoiApi(data) { return [].concat(data).map(fetchDoiApi).map(_json.default); }; exports.parse = parseDoiApi; },{"../../../util/fetchFile":401,"../../../util/fetchFileAsync":402,"./json":380}],378:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.parse = void 0; var parseDoi = function parseDoi(data) { var list = Array.isArray(data) ? data : data.trim().split(/(?:\s+)/g); return list.map(function (doi) { return "https://doi.org/".concat(doi); }); }; exports.default = exports.parse = parseDoi; },{}],379:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formats = exports.parsers = exports.ref = void 0; var id = _interopcitationRequireWildcard(citationRequire("./id")); var api = _interopcitationRequireWildcard(citationRequire("./api")); var json = _interopcitationRequireWildcard(citationRequire("./json")); var type = _interopcitationRequireWildcard(citationRequire("./type")); function _interopcitationRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } var ref = '@doi'; exports.ref = ref; var parsers = { id: id, api: api, json: json, type: type }; exports.parsers = parsers; var formats = { '@doi/api': { parse: api.parse, parseAsync: api.parseAsync, parseType: { dataType: 'String', predicate: /^\s*(https?:\/\/(?:dx\.)?doi\.org\/(10.\d{4,9}\/[-._;()/:A-Z0-9]+))\s*$/i, extends: '@else/url' } }, '@doi/id': { parse: id.parse, parseType: { dataType: 'String', predicate: /^\s*(10.\d{4,9}\/[-._;()/:A-Z0-9]+)\s*$/i } }, '@doi/list+text': { parse: id.parse, parseType: { dataType: 'String', tokenList: /^10.\d{4,9}\/[-._;()/:A-Z0-9]+$/i } }, '@doi/list+object': { parse: id.parse, parseType: { dataType: 'Array', elementConstraint: '@doi/id' } }, '@doi/type': { parse: type.parse } }; exports.formats = formats; },{"./api":377,"./id":378,"./json":380,"./type":381}],380:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.parse = void 0; var _type = _interopcitationRequireDefault(citationRequire("./type")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var parseDoiJson = function parseDoiJson(data) { var res = { type: (0, _type.default)(data.type) }; var dateFields = ['submitted', 'issued', 'event-date', 'original-date', 'container', 'accessed']; dateFields.forEach(function (field) { var value = data[field]; if (value && value['date-parts'] && typeof value['date-parts'][0] === 'number') { value['date-parts'] = [value['date-parts']]; } }); return Object.assign({}, data, res); }; exports.default = exports.parse = parseDoiJson; },{"./type":381}],381:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.parse = void 0; var varDoiTypes = { 'journal-article': 'article-journal', 'book-chapter': 'chapter', 'posted-content': 'manuscript', 'proceedings-article': 'paper-conference' }; var fetchDoiType = function fetchDoiType(value) { return varDoiTypes[value] || value; }; exports.default = exports.parse = fetchDoiType; },{}],382:[function(citationRequire,module,exports){ "use strict"; var _plugins = citationRequire("../../plugins/"); var modules = _interopcitationRequireWildcard(citationRequire("./modules")); function _interopcitationRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } for (var _module in modules) { var _modules$module = modules[_module], ref = _modules$module.ref, formats = _modules$module.formats; (0, _plugins.add)(ref, { input: formats }); } },{"../../plugins/":399,"./modules":383}],383:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.other = exports.wikidata = exports.doi = exports.bibtex = exports.bibjson = void 0; var bibjson = _interopcitationRequireWildcard(citationRequire("./bibjson/")); exports.bibjson = bibjson; var bibtex = _interopcitationRequireWildcard(citationRequire("./bibtex/")); exports.bibtex = bibtex; var doi = _interopcitationRequireWildcard(citationRequire("./doi/")); exports.doi = doi; var wikidata = _interopcitationRequireWildcard(citationRequire("./wikidata/")); exports.wikidata = wikidata; var other = _interopcitationRequireWildcard(citationRequire("./other/")); exports.other = other; function _interopcitationRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } },{"./bibjson/":368,"./bibtex/":371,"./doi/":379,"./other/":386,"./wikidata/":391}],384:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parse = void 0; var parse = function parse() { return []; }; exports.parse = parse; },{}],385:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parse = void 0; var parse = function parse(input) { return input.value || input.textContent; }; exports.parse = parse; },{}],386:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formats = exports.parsers = exports.ref = void 0; var empty = _interopcitationRequireWildcard(citationRequire("./empty")); var url = _interopcitationRequireWildcard(citationRequire("./url")); var json = _interopcitationRequireWildcard(citationRequire("./json")); var jquery = _interopcitationRequireWildcard(citationRequire("./jquery")); var html = _interopcitationRequireWildcard(citationRequire("./html")); function _interopcitationRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } var ref = '@else'; exports.ref = ref; var parsers = { empty: empty, url: url, json: json, jquery: jquery, html: html }; exports.parsers = parsers; var formats = { '@empty/text': { parse: empty.parse, parseType: { dataType: 'String', predicate: function predicate(input) { return input === ''; } } }, '@empty/whitespace+text': { parse: empty.parse, parseType: { dataType: 'String', predicate: /^\s+$/ } }, '@empty': { parse: empty.parse, parseType: { dataType: 'Primitive', predicate: function predicate(input) { return input == null; } } }, '@else/json': { parse: json.parse, parseType: { dataType: 'String', predicate: /^\s*(\{[\S\s]*\}|\[[\S\s]*\])\s*$/ } }, '@else/url': { parse: url.parse, parseAsync: url.parseAsync, parseType: { dataType: 'String', predicate: /^https?:\/\/(([\w-]+\.)*[\w-]+)(:\d+)?(\/[^?/]*)*(\?[^#]*)?(#.*)?$/i } }, '@else/jquery': { parse: jquery.parse, parseType: { dataType: 'ComplexObject', predicate: function predicate(input) { return typeof jQuery !== 'undefined' && input instanceof jQuery; } } }, '@else/html': { parse: html.parse, parseType: { dataType: 'ComplexObject', predicate: function predicate(input) { return typeof HTMLElement !== 'undefined' && input instanceof HTMLElement; } } } }; exports.formats = formats; },{"./empty":384,"./html":385,"./jquery":387,"./json":388,"./url":389}],387:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parse = void 0; var parse = function parse(input) { return input.val() || input.text() || input.html(); }; exports.parse = parse; },{}],388:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.parse = void 0; function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var substituters = [[/((?:\[|:|,)\s*)'((?:\\'|[^'])*?[^\\])?'(?=\s*(?:\]|}|,))/g, '$1"$2"'], [/((?:(?:"|]|}|\/[gmiuys]|\.|(?:\d|\.|-)*\d)\s*,|{)\s*)(?:"([^":\n]+?)"|'([^":\n]+?)'|([^":\n]+?))(\s*):/g, '$1"$2$3$4"$5:']]; var parseJSON = function parseJSON(str) { try { return JSON.parse(str); } catch (e) { logger.info('[set]', 'Input was not valid JSON, switching to experimental parser for invalid JSON'); try { substituters.forEach(function (_ref) { var _ref2 = _slicedToArray(_ref, 2), regex = _ref2[0], subst = _ref2[1]; str = str.replace(regex, subst); }); return JSON.parse(str); } catch (e) { logger.error('[set]', 'Experimental parser failed. Please improve the JSON. If this is not JSON, please re-read the supported formats.'); return undefined; } } }; exports.default = exports.parse = parseJSON; },{}],389:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "parse", { enumerable: true, get: function get() { return _fetchFile.default; } }); Object.defineProperty(exports, "parseAsync", { enumerable: true, get: function get() { return _fetchFileAsync.default; } }); var _fetchFile = _interopcitationRequireDefault(citationRequire("../../../util/fetchFile")); var _fetchFileAsync = _interopcitationRequireDefault(citationRequire("../../../util/fetchFileAsync")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } },{"../../../util/fetchFile":401,"../../../util/fetchFileAsync":402}],390:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "parse", { enumerable: true, get: function get() { return _fetchFile.default; } }); Object.defineProperty(exports, "parseAsync", { enumerable: true, get: function get() { return _fetchFileAsync.default; } }); var _fetchFile = _interopcitationRequireDefault(citationRequire("../../../util/fetchFile")); var _fetchFileAsync = _interopcitationRequireDefault(citationRequire("../../../util/fetchFileAsync")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } },{"../../../util/fetchFile":401,"../../../util/fetchFileAsync":402}],391:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formats = exports.parsers = exports.ref = void 0; var list = _interopcitationRequireWildcard(citationRequire("./list")); var json = _interopcitationRequireWildcard(citationRequire("./json")); var prop = _interopcitationRequireWildcard(citationRequire("./prop")); var type = _interopcitationRequireWildcard(citationRequire("./type")); var url = _interopcitationRequireWildcard(citationRequire("./url")); var api = _interopcitationRequireWildcard(citationRequire("./api")); function _interopcitationRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } var ref = '@wikidata'; exports.ref = ref; var parsers = { list: list, json: json, prop: prop, type: type, url: url, api: api }; exports.parsers = parsers; var formats = { '@wikidata/id': { parse: list.parse, parseType: { dataType: 'String', predicate: /^\s*(Q\d+)\s*$/ } }, '@wikidata/list+text': { parse: list.parse, parseType: { dataType: 'String', predicate: /^\s*((?:Q\d+(?:\s+|,|))*Q\d+)\s*$/ } }, '@wikidata/api': { parse: api.parse, parseAsync: api.parseAsync, parseType: { dataType: 'String', predicate: /^(https?:\/\/(?:www\.)?wikidata.org\/w\/api\.php(?:\?.*)?)$/, extends: '@else/url' } }, '@wikidata/url': { parse: url.parse, parseType: { dataType: 'String', predicate: /\/(Q\d+)(?:[#?/]|\s*$)/, extends: '@else/url' } }, '@wikidata/list+object': { parse: list.parse, parseType: { dataType: 'Array', elementConstraint: '@wikidata/id' } }, '@wikidata/object': { parse: json.parse, parseAsync: json.parseAsync, parseType: { dataType: 'SimpleObject', propertyConstraint: { props: 'entities' } } }, '@wikidata/prop': { parse: prop.parse }, '@wikidata/type': { parse: type.parse } }; exports.formats = formats; },{"./api":390,"./json":392,"./list":393,"./prop":394,"./type":395,"./url":396}],392:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parseAsync = exports.default = exports.parse = void 0; var _wikidataSdk = _interopcitationRequireDefault(citationRequire("wikidata-sdk")); var _prop = citationRequire("./prop"); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } var parseWikidataJSONAsync = function () { var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee3(data) { return regeneratorRuntime.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: return _context3.abrupt("return", Promise.all(Object.keys(data.entities).map(function () { var _ref2 = _asyncToGenerator(regeneratorRuntime.mark(function _callee2(entityKey) { var _data$entities$entity, labels, claims, entity, json; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: _data$entities$entity = data.entities[entityKey], labels = _data$entities$entity.labels, claims = _data$entities$entity.claims; entity = _wikidataSdk.default.simplifyClaims(claims, null, null, true); json = { _wikiId: entityKey, id: entityKey }; _context2.next = 5; return Promise.all(Object.keys(entity).map(function () { var _ref3 = _asyncToGenerator(regeneratorRuntime.mark(function _callee(prop) { var field, _field, fieldName, fieldValue; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.next = 2; return (0, _prop.parseAsync)(prop, entity[prop], 'en'); case 2: field = _context.sent; if (field) { _field = _slicedToArray(field, 2), fieldName = _field[0], fieldValue = _field[1]; if (Array.isArray(json[fieldName])) { json[fieldName] = json[fieldName].concat(fieldValue); } else if (fieldValue !== undefined) { json[fieldName] = fieldValue; } } case 4: case "end": return _context.stop(); } } }, _callee, this); })); return function (_x3) { return _ref3.apply(this, arguments); }; }())); case 5: if (Array.isArray(json.author)) { json.author.sort(function (_ref4, _ref5) { var a = _ref4._ordinal; var b = _ref5._ordinal; return a - b; }); } if (!json.title) { json.title = labels['en'].value; } return _context2.abrupt("return", json); case 8: case "end": return _context2.stop(); } } }, _callee2, this); })); return function (_x2) { return _ref2.apply(this, arguments); }; }()))); case 1: case "end": return _context3.stop(); } } }, _callee3, this); })); return function parseWikidataJSONAsync(_x) { return _ref.apply(this, arguments); }; }(); exports.parseAsync = parseWikidataJSONAsync; var parseWikidataJSON = function parseWikidataJSON(data) { return Object.keys(data.entities).map(function (entityKey) { var _data$entities$entity2 = data.entities[entityKey], labels = _data$entities$entity2.labels, claims = _data$entities$entity2.claims; var entity = _wikidataSdk.default.simplifyClaims(claims, null, null, true); var json = { _wikiId: entityKey, id: entityKey }; Object.keys(entity).forEach(function (prop) { var field = (0, _prop.parse)(prop, entity[prop], 'en'); if (field) { var _field2 = _slicedToArray(field, 2), fieldName = _field2[0], fieldValue = _field2[1]; if (Array.isArray(json[fieldName])) { json[fieldName] = json[fieldName].concat(fieldValue); } else if (fieldValue !== undefined) { json[fieldName] = fieldValue; } } }); if (Array.isArray(json.author)) { json.author.sort(function (_ref6, _ref7) { var a = _ref6._ordinal; var b = _ref7._ordinal; return a - b; }); } if (!json.title) { json.title = labels['en'].value; } return json; }); }; exports.default = exports.parse = parseWikidataJSON; },{"./prop":394,"wikidata-sdk":309}],393:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.parse = void 0; var _wikidataSdk = _interopcitationRequireDefault(citationRequire("wikidata-sdk")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var parseWikidata = function parseWikidata(data) { var list = Array.isArray(data) ? data : data.trim().split(/(?:[\s,]\s*)/g); return [].concat(_wikidataSdk.default.getEntities(list, ['en'])); }; exports.default = exports.parse = parseWikidata; },{"wikidata-sdk":309}],394:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parseAsync = exports.default = exports.parse = void 0; var _wikidataSdk = _interopcitationRequireDefault(citationRequire("wikidata-sdk")); var _fetchFile = _interopcitationRequireDefault(citationRequire("../../../util/fetchFile")); var _fetchFileAsync = _interopcitationRequireDefault(citationRequire("../../../util/fetchFileAsync")); var _type = _interopcitationRequireDefault(citationRequire("./type")); var _date = _interopcitationRequireDefault(citationRequire("../../date")); var _name = _interopcitationRequireDefault(citationRequire("../../name")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } var getSeriesOrdinal = function getSeriesOrdinal(qualifiers) { return qualifiers.P1545 ? parseInt(qualifiers.P1545[0]) : -1; }; var getStatedAs = function getStatedAs(qualifiers) { return qualifiers.P1932; }; var propMap = { P31: 'type', P50: 'author', P57: 'director', P86: 'composer', P98: 'editor', P110: 'illustrator', P123: 'publisher', P136: 'genre', P212: 'ISBN', P236: 'ISSN', P291: 'publisher-place', P304: 'page', P348: 'version', P356: 'DOI', P393: 'edition', P433: 'issue', P478: 'volume', P577: 'issued', P655: 'translator', P698: 'PMID', P932: 'PMCID', P953: 'URL', P957: 'ISBN', P1104: 'number-of-pages', P1433: 'container-title', P1476: 'title', P2093: 'author', P2860: false, P921: false, P3181: false, P364: false }; var fetchWikidataLabel = function fetchWikidataLabel(q, lang) { var ids = Array.isArray(q) ? q : typeof q === 'string' ? q.split('|') : ''; var url = _wikidataSdk.default.getEntities(ids, [lang], 'labels'); var entities = JSON.parse((0, _fetchFile.default)(url)).entities || {}; return Object.keys(entities).map(function (entityKey) { return (entities[entityKey].labels[lang] || {}).value; }); }; var parseWikidataName = function parseWikidataName(_ref, lang) { var value = _ref.value, qualifiers = _ref.qualifiers; var statedAs = getStatedAs(qualifiers); var name = statedAs || fetchWikidataLabel(value, lang)[0]; name = (0, _name.default)(name); name._ordinal = getSeriesOrdinal(qualifiers); return name; }; var parseWikidataProp = function parseWikidataProp(name, value, lang) { if (!propMap.hasOwnProperty(name)) { logger.info('[set]', "Unknown property: ".concat(name)); return undefined; } else if (propMap[name] === false) { return undefined; } var cslProp = propMap[name]; if (!value) { return cslProp; } var cslValue = function (prop, valueList) { var value = valueList[0].value; switch (prop) { case 'P31': var type = (0, _type.default)(value); if (!type) { logger.warn('[set]', "Wikidata entry type not recognized: ".concat(value, ". Defaulting to \"book\".")); return 'book'; } return type; case 'P50': case 'P57': case 'P86': case 'P98': case 'P110': case 'P655': return valueList.map(function (name) { return parseWikidataName(name, lang); }); case 'P577': return (0, _date.default)(value); case 'P123': case 'P136': case 'P291': case 'P1433': return fetchWikidataLabel(value, lang)[0]; case 'P2093': return valueList.map(function (_ref2) { var value = _ref2.value, qualifiers = _ref2.qualifiers; var name = (0, _name.default)(value); name._ordinal = getSeriesOrdinal(qualifiers); return name; }); default: return value; } }(name, value); return [cslProp, cslValue]; }; exports.default = exports.parse = parseWikidataProp; var fetchWikidataLabelAsync = function () { var _ref3 = _asyncToGenerator(regeneratorRuntime.mark(function _callee(q, lang) { var ids, url, entities; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: ids = Array.isArray(q) ? q : typeof q === 'string' ? q.split('|') : ''; url = _wikidataSdk.default.getEntities(ids, [lang], 'labels'); _context.t1 = JSON; _context.next = 5; return (0, _fetchFileAsync.default)(url); case 5: _context.t2 = _context.sent; _context.t0 = _context.t1.parse.call(_context.t1, _context.t2).entities; if (_context.t0) { _context.next = 9; break; } _context.t0 = {}; case 9: entities = _context.t0; return _context.abrupt("return", Object.keys(entities).map(function (entityKey) { return (entities[entityKey].labels[lang] || {}).value; })); case 11: case "end": return _context.stop(); } } }, _callee, this); })); return function fetchWikidataLabelAsync(_x, _x2) { return _ref3.apply(this, arguments); }; }(); var parseWikidataNameAsync = function () { var _ref5 = _asyncToGenerator(regeneratorRuntime.mark(function _callee2(_ref4, lang) { var value, qualifiers, statedAs, name; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: value = _ref4.value, qualifiers = _ref4.qualifiers; statedAs = getStatedAs(qualifiers); _context2.t0 = statedAs; if (_context2.t0) { _context2.next = 7; break; } _context2.next = 6; return fetchWikidataLabelAsync(value, lang); case 6: _context2.t0 = _context2.sent[0]; case 7: name = _context2.t0; name = (0, _name.default)(name); name._ordinal = getSeriesOrdinal(qualifiers); return _context2.abrupt("return", name); case 11: case "end": return _context2.stop(); } } }, _callee2, this); })); return function parseWikidataNameAsync(_x3, _x4) { return _ref5.apply(this, arguments); }; }(); var parseWikidataPropAsync = function () { var _ref6 = _asyncToGenerator(regeneratorRuntime.mark(function _callee4(prop, value, lang) { var cslValue; return regeneratorRuntime.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: _context4.next = 2; return function () { var _ref7 = _asyncToGenerator(regeneratorRuntime.mark(function _callee3(prop, valueList) { var value; return regeneratorRuntime.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: value = valueList[0].value; _context3.t0 = prop; _context3.next = _context3.t0 === 'P50' ? 4 : _context3.t0 === 'P57' ? 4 : _context3.t0 === 'P86' ? 4 : _context3.t0 === 'P98' ? 4 : _context3.t0 === 'P110' ? 4 : _context3.t0 === 'P655' ? 4 : _context3.t0 === 'P123' ? 5 : _context3.t0 === 'P136' ? 5 : _context3.t0 === 'P291' ? 5 : _context3.t0 === 'P1433' ? 5 : 8; break; case 4: return _context3.abrupt("return", Promise.all(valueList.map(function (name) { return parseWikidataNameAsync(name, lang); }))); case 5: _context3.next = 7; return fetchWikidataLabelAsync(value, lang); case 7: return _context3.abrupt("return", _context3.sent[0]); case 8: case "end": return _context3.stop(); } } }, _callee3, this); })); return function (_x8, _x9) { return _ref7.apply(this, arguments); }; }()(prop, value); case 2: cslValue = _context4.sent; if (!cslValue) { _context4.next = 7; break; } return _context4.abrupt("return", [parseWikidataProp(prop), cslValue]); case 7: return _context4.abrupt("return", parseWikidataProp(prop, value, lang)); case 8: case "end": return _context4.stop(); } } }, _callee4, this); })); return function parseWikidataPropAsync(_x5, _x6, _x7) { return _ref6.apply(this, arguments); }; }(); exports.parseAsync = parseWikidataPropAsync; },{"../../../util/fetchFile":401,"../../../util/fetchFileAsync":402,"../../date":358,"../../name":397,"./type":395,"wikidata-sdk":309}],395:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.parse = void 0; var varWikidataTypes = { Q49848: 'article', Q191067: 'article', Q13442814: 'article-journal', Q18918145: 'article-journal', Q38926: 'article-newspaper', Q5707594: 'article-newspaper', Q30070590: 'article-magazine', Q686822: 'bill', Q3331189: 'book', Q571: 'book', Q1555508: 'broadcast', Q15416: 'broadcast', Q1980247: 'chapter', Q1172284: 'dataset', Q10389811: 'entry', Q19389637: 'entry', Q17329259: 'entry-encyclopedia', Q30070753: 'figure', Q1027879: 'graphic', Q4502142: 'graphic', Q478798: 'graphic', Q838948: 'graphic', Q178651: 'interview', Q49371: 'legislation', Q820655: 'legislation', Q2334719: 'legal_case', Q87167: 'manuscript', Q4006: 'map', Q11424: 'motion_picture', Q30070675: 'motion_picture', Q187947: 'musical_score', Q18536349: 'pamphlet', Q190399: 'pamphlet', Q26973022: 'paper-conference', Q23927052: 'paper-conference', Q253623: 'patent', Q30070565: 'personal_communication', Q30070439: 'personal_communication', Q133492: 'personal_communication', Q628523: 'personal_communication', Q7216866: 'post', Q17928402: 'post-blog', Q10870555: 'report', Q265158: 'review', Q637866: 'review-book', Q7366: 'song', Q3741908: 'song', Q30070318: 'song', Q24634210: 'song', Q861911: 'speech', Q1266946: 'thesis', Q187685: 'thesis', Q131569: 'treaty', Q36774: 'webpage' }; var fetchWikidataType = function fetchWikidataType(value) { return varWikidataTypes[value]; }; exports.default = exports.parse = fetchWikidataType; },{}],396:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parse = void 0; var parse = function parse(input) { return input.match(/\/(Q\d+)(?:[#?/]|\s*$)/)[1]; }; exports.parse = parse; },{}],397:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "parse", { enumerable: true, get: function get() { return _name.parse; } }); Object.defineProperty(exports, "default", { enumerable: true, get: function get() { return _name.parse; } }); exports.types = exports.scope = void 0; var _name = citationRequire("@citation-js/name"); var scope = '@name'; exports.scope = scope; var types = '@name'; exports.types = types; },{"@citation-js/name":279}],398:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.remove = exports.get = exports.add = void 0; var configs = {}; var add = function add(ref, config) { configs[ref] = config; }; exports.add = add; var get = function get(ref) { return configs[ref]; }; exports.get = get; var remove = function remove(ref) { delete configs[ref]; }; exports.remove = remove; },{}],399:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.config = exports.dict = exports.output = exports.input = exports.list = exports.has = exports.remove = exports.add = void 0; var input = _interopcitationRequireWildcard(citationRequire("../parse/interface/")); exports.input = input; var output = _interopcitationRequireWildcard(citationRequire("../get/registrar")); exports.output = output; var dict = _interopcitationRequireWildcard(citationRequire("../get/dict")); exports.dict = dict; var config = _interopcitationRequireWildcard(citationRequire("./config")); exports.config = config; function _interopcitationRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } var registers = { input: input, output: output, dict: dict, config: config }; var indices = {}; var add = function add(ref) { var plugins = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var mainIndex = indices[ref] = {}; if ('config' in plugins) { registers.config.add(ref, plugins.config); delete plugins.config; } for (var type in plugins) { var typeIndex = mainIndex[type] = {}; var typePlugins = plugins[type]; for (var name in typePlugins) { var typePlugin = typePlugins[name]; typeIndex[name] = true; registers[type].add(name, typePlugin); } } }; exports.add = add; var remove = function remove(ref) { var mainIndex = indices[ref]; for (var type in mainIndex) { var typeIndex = mainIndex[type]; for (var name in typeIndex) { registers[type].remove(name); } } delete indices[ref]; }; exports.remove = remove; var has = function has(ref) { return ref in indices; }; exports.has = has; var list = function list() { return Object.keys(indices); }; exports.list = list; },{"../get/dict":331,"../get/registrar":355,"../parse/interface/":364,"./config":398}],400:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var deepCopy = function deepCopy(obj) { return JSON.parse(JSON.stringify(obj)); }; var _default = deepCopy; exports.default = _default; },{}],401:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _syncRequest = _interopcitationRequireDefault(citationRequire("sync-request")); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var fetchFile = function fetchFile(url) { var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var reqOpts = {}; if (opts.headers) { reqOpts.headers = opts.headers; reqOpts.allowRedirectHeaders = Object.keys(opts.headers); } try { return (0, _syncRequest.default)('GET', url, reqOpts).getBody('utf8'); } catch (e) { logger.error('[set]', "File '".concat(url, "' could not be fetched:"), e.message); return '[]'; } }; var _default = fetchFile; exports.default = _default; },{"sync-request":291}],402:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; citationRequire("isomorphic-fetch"); function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } var fetchFileAsync = function () { var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(url) { var opts, reqOpts, _args = arguments; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: opts = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; reqOpts = {}; if (opts.headers) { reqOpts.headers = opts.headers; reqOpts.allowRedirectHeaders = Object.keys(opts.headers); } _context.prev = 3; return _context.abrupt("return", fetch(url, reqOpts).then(function (response) { return response.text(); })); case 7: _context.prev = 7; _context.t0 = _context["catch"](3); logger.error('[set]', "File '".concat(url, "' could not be fetched:"), _context.t0.message); return _context.abrupt("return", '[]'); case 11: case "end": return _context.stop(); } } }, _callee, this, [[3, 7]]); })); return function fetchFileAsync(_x) { return _ref.apply(this, arguments); }; }(); var _default = fetchFileAsync; exports.default = _default; },{"isomorphic-fetch":284}],403:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var fetchId = function fetchId(list, prefix) { var id; while (list.includes(id)) { id = "".concat(prefix).concat(Math.random().toString().slice(2)); } return id; }; var _default = fetchId; exports.default = _default; },{}],404:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "deepCopy", { enumerable: true, get: function get() { return _deepCopy.default; } }); Object.defineProperty(exports, "fetchFile", { enumerable: true, get: function get() { return _fetchFile.default; } }); Object.defineProperty(exports, "fetchFileAsync", { enumerable: true, get: function get() { return _fetchFileAsync.default; } }); Object.defineProperty(exports, "fetchId", { enumerable: true, get: function get() { return _fetchId.default; } }); Object.defineProperty(exports, "TokenStack", { enumerable: true, get: function get() { return _stack.default; } }); Object.defineProperty(exports, "Register", { enumerable: true, get: function get() { return _register.default; } }); exports.attr = void 0; var _deepCopy = _interopcitationRequireDefault(citationRequire("./deepCopy")); var _fetchFile = _interopcitationRequireDefault(citationRequire("./fetchFile")); var _fetchFileAsync = _interopcitationRequireDefault(citationRequire("./fetchFileAsync")); var _fetchId = _interopcitationRequireDefault(citationRequire("./fetchId")); var _stack = _interopcitationRequireDefault(citationRequire("./stack")); var _register = _interopcitationRequireDefault(citationRequire("./register")); var _attr = citationRequire("../get/modules/csl/attr"); var _affix = citationRequire("../get/modules/csl/affix"); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var attr = { getAttributedEntry: _attr.getAttributedEntry, getPrefixedEntry: _attr.getPrefixedEntry, getWrappedEntry: _affix.getWrappedEntry }; exports.attr = attr; },{"../get/modules/csl/affix":339,"../get/modules/csl/attr":340,"./deepCopy":400,"./fetchFile":401,"./fetchFileAsync":402,"./fetchId":403,"./register":405,"./stack":406}],405:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var Register = function () { function Register() { var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; _classCallCheck(this, Register); this.data = data; } _createClass(Register, [{ key: "set", value: function set(key, value) { this.data[key] = value; return this; } }, { key: "add", value: function add() { return this.set.apply(this, arguments); } }, { key: "delete", value: function _delete(key) { delete this.data[key]; return this; } }, { key: "remove", value: function remove() { return this.delete.apply(this, arguments); } }, { key: "get", value: function get(key) { return this.data[key]; } }, { key: "has", value: function has(key) { return this.data.hasOwnProperty(key); } }, { key: "list", value: function list() { return Object.keys(this.data); } }]); return Register; }(); var _default = Register; exports.default = _default; },{}],406:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var TokenStack = function () { function TokenStack(array) { _classCallCheck(this, TokenStack); this.stack = array; this.index = 0; this.current = this.stack[this.index]; } _createClass(TokenStack, [{ key: "tokensLeft", value: function tokensLeft() { return this.stack.length - this.index; } }, { key: "matches", value: function matches(pattern) { return TokenStack.getMatchCallback(pattern)(this.current, this.index, this.stack); } }, { key: "matchesSequence", value: function matchesSequence(sequence) { var part = this.stack.slice(this.index, this.index + sequence.length).join(''); return typeof sequence === 'string' ? part === sequence : sequence.every(function (pattern, index) { return TokenStack.getMatchCallback(pattern)(part[index]); }); } }, { key: "consumeToken", value: function consumeToken() { var pattern = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : /^[\s\S]$/; var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref$inverse = _ref.inverse, inverse = _ref$inverse === void 0 ? false : _ref$inverse, _ref$spaced = _ref.spaced, spaced = _ref$spaced === void 0 ? true : _ref$spaced; if (spaced) { this.consumeWhitespace(); } var token = this.current; var match = TokenStack.getMatchCallback(pattern)(token, this.index, this.stack); if (match) { this.current = this.stack[++this.index]; } else { throw new SyntaxError("Unexpected token at index ".concat(this.index, ": Expected ").concat(TokenStack.getPatternText(pattern), ", got \"").concat(token, "\"")); } if (spaced) { this.consumeWhitespace(); } return token; } }, { key: "consumeWhitespace", value: function consumeWhitespace() { var pattern = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : /^\s$/; var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref2$optional = _ref2.optional, optional = _ref2$optional === void 0 ? true : _ref2$optional; return this.consume(pattern, { min: +!optional }); } }, { key: "consumeN", value: function consumeN(length) { if (this.tokensLeft() < length) { throw new SyntaxError('Not enough tokens left'); } var start = this.index; while (length--) { this.current = this.stack[++this.index]; } return this.stack.slice(start, this.index).join(''); } }, { key: "consumeSequence", value: function consumeSequence(sequence) { if (this.matchesSequence(sequence)) { return this.consumeN(sequence.length); } else { throw new SyntaxError("Expected \"".concat(sequence, "\", got \"").concat(this.consumeN(sequence.length), "\"")); } } }, { key: "consume", value: function consume() { var pattern = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : /^[\s\S]$/; var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref3$min = _ref3.min, min = _ref3$min === void 0 ? 0 : _ref3$min, _ref3$max = _ref3.max, max = _ref3$max === void 0 ? Infinity : _ref3$max, _ref3$inverse = _ref3.inverse, inverse = _ref3$inverse === void 0 ? false : _ref3$inverse, tokenMap = _ref3.tokenMap, tokenFilter = _ref3.tokenFilter; var start = this.index; var match = TokenStack.getMatchCallback(pattern); while (match(this.current, this.index, this.stack) !== inverse) { this.current = this.stack[++this.index]; } var consumed = this.stack.slice(start, this.index); if (consumed.length < min) { throw new SyntaxError("Not enough ".concat(TokenStack.getPatternText(pattern))); } else if (consumed.length > max) { throw new SyntaxError("Too many ".concat(TokenStack.getPatternText(pattern))); } if (tokenMap) { consumed = consumed.map(tokenMap); } if (tokenFilter) { consumed = consumed.filter(tokenFilter); } return consumed.join(''); } }], [{ key: "getPatternText", value: function getPatternText(pattern) { return "\"".concat(pattern instanceof RegExp ? pattern.source : pattern, "\""); } }, { key: "getMatchCallback", value: function getMatchCallback(pattern) { if (Array.isArray(pattern)) { var matches = pattern.map(TokenStack.getMatchCallback); return function (token) { return matches.some(function (matchCallback) { return matchCallback(token); }); }; } else if (pattern instanceof Function) { return pattern; } else if (pattern instanceof RegExp) { return function (token) { return pattern.test(token); }; } else { return function (token) { return pattern === token; }; } } }]); return TokenStack; }(); var _default = TokenStack; exports.default = _default; },{}],407:[function(citationRequire,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "cite", { enumerable: true, get: function get() { return _package.version; } }); Object.defineProperty(exports, "citeproc", { enumerable: true, get: function get() { return _citeproc.PROCESSOR_VERSION; } }); var _package = citationRequire("../package.json"); var _citeproc = citationRequire("citeproc"); },{"../package.json":320,"citeproc":282}],"citation-js":[function(citationRequire,module,exports){ "use strict"; citationRequire("@babel/polyfill"); citationRequire("./logger"); var staticMethods = _interopcitationRequireWildcard(citationRequire("./Cite/static")); var plugins = _interopcitationRequireWildcard(citationRequire("./plugins/index")); var get = _interopcitationRequireWildcard(citationRequire("./get/index")); var parse = _interopcitationRequireWildcard(citationRequire("./parse/index")); var util = _interopcitationRequireWildcard(citationRequire("./util/index")); var version = _interopcitationRequireWildcard(citationRequire("./version")); var _index5 = _interopcitationRequireDefault(citationRequire("./Cite/index")); var _locales = _interopcitationRequireWildcard(citationRequire("./get/modules/csl/locales")); var _styles = _interopcitationRequireWildcard(citationRequire("./get/modules/csl/styles")); var _engines = citationRequire("./get/modules/csl/engines"); function _interopcitationRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopcitationRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } var CSL = { engine: _engines.fetchEngine, style: _styles.default, locale: _locales.default, item: function item(data) { return function (id) { return data.find(function (entry) { return entry.id === id; }); }; }, register: { addTemplate: _styles.templates.add.bind(_styles.templates), getTemplate: _styles.templates.get.bind(_styles.templates), hasTemplate: _styles.templates.has.bind(_styles.templates), addLocale: _locales.locales.add.bind(_locales.locales), getLocale: _locales.locales.get.bind(_locales.locales), hasLocale: _locales.locales.has.bind(_locales.locales) } }; Object.assign(_index5.default, staticMethods, { plugins: plugins, get: get, CSL: CSL, parse: parse, util: util, version: version, input: parse.chain, inputAsync: parse.chainAsync }); module.exports = _index5.default; },{"./Cite/index":323,"./Cite/static":328,"./get/index":332,"./get/modules/csl/engines":343,"./get/modules/csl/locales":346,"./get/modules/csl/styles":348,"./logger":356,"./parse/index":359,"./plugins/index":399,"./util/index":404,"./version":407,"@babel/polyfill":1}]},{},[]);