{"version":3,"file":"bookUtils-CKJku77y.js","sources":["../../../node_modules/lodash/_createBaseEach.js","../../../node_modules/lodash/_baseEach.js","../../../node_modules/lodash/_baseMap.js","../../../node_modules/lodash/_baseSortBy.js","../../../node_modules/lodash/_compareAscending.js","../../../node_modules/lodash/_compareMultiple.js","../../../node_modules/lodash/_baseOrderBy.js","../../../node_modules/lodash/_baseRest.js","../../../node_modules/lodash/_isIterateeCall.js","../../../node_modules/lodash/sortBy.js","../../../app/javascript/lib/bookUtils.ts"],"sourcesContent":["var isArrayLike = require('./isArrayLike');\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nmodule.exports = createBaseEach;\n","var baseForOwn = require('./_baseForOwn'),\n createBaseEach = require('./_createBaseEach');\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nmodule.exports = baseEach;\n","var baseEach = require('./_baseEach'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n}\n\nmodule.exports = baseMap;\n","/**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\nfunction baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n}\n\nmodule.exports = baseSortBy;\n","var isSymbol = require('./isSymbol');\n\n/**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\nfunction compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n}\n\nmodule.exports = compareAscending;\n","var compareAscending = require('./_compareAscending');\n\n/**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\nfunction compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n}\n\nmodule.exports = compareMultiple;\n","var arrayMap = require('./_arrayMap'),\n baseGet = require('./_baseGet'),\n baseIteratee = require('./_baseIteratee'),\n baseMap = require('./_baseMap'),\n baseSortBy = require('./_baseSortBy'),\n baseUnary = require('./_baseUnary'),\n compareMultiple = require('./_compareMultiple'),\n identity = require('./identity'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\nfunction baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(baseIteratee));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n}\n\nmodule.exports = baseOrderBy;\n","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n","var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n","var baseFlatten = require('./_baseFlatten'),\n baseOrderBy = require('./_baseOrderBy'),\n baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\nvar sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n});\n\nmodule.exports = sortBy;\n","import { isPrimaryContribution } from \"lib/contributions\";\nimport { roundRating } from \"lib/numberUtils\";\nimport sortBy from \"lodash/sortBy\";\nimport uniqBy from \"lodash/uniqBy\";\nimport isNull from \"lodash/isNull\";\nimport maxBy from \"lodash/maxBy\";\nimport minBy from \"lodash/minBy\";\nimport pluralize from \"./pluralize\";\nimport BookType from \"types/BookType\";\nimport BookSeriesType from \"types/BookSeriesType\";\nimport EditionType from \"types/EditionType\";\nimport SeriesType from \"types/SeriesType\";\nimport { BookSerializersBookByline } from \"types/serializers\";\n\nexport function secondsFormat(\n seconds: number,\n options?: { showSeconds: boolean }\n) {\n const parts = [];\n const hours = Math.floor(seconds / 3600);\n const hourSecondsUsed = hours * 3600;\n if (hours > 0) {\n parts.push(`${hours}h`);\n }\n\n const minutes = Math.round((seconds - hourSecondsUsed) / 60);\n const minuteSecondsUsed = minutes * 60;\n if (minutes > 0) {\n parts.push(`${minutes}m`);\n }\n\n if (options?.showSeconds) {\n const remainingSeconds = Math.round(\n seconds - hourSecondsUsed - minuteSecondsUsed\n );\n if (remainingSeconds > 0) {\n parts.push(`${remainingSeconds}s`);\n }\n }\n\n return parts.join(\" \");\n}\n\nexport function genereateBookTitle(book: BookSerializersBookByline) {\n const primaryContributions = book.contributions.filter((contribution) =>\n isPrimaryContribution(contribution)\n );\n const title = `${book.title} by ${primaryContributions\n .map((contribution) => contribution.author.name)\n .join(\" and \")}`;\n return title;\n}\n\nexport function generateFeaturedBookSeries(book: BookSerializersBookByline) {\n let series = \"\";\n\n const { featuredSeries } = book;\n\n if(!featuredSeries?.id) {\n return null;\n }\n\n if (!isNull(featuredSeries.position)) {\n if (book.compilation) {\n series = `#${featuredSeries.details || featuredSeries.position}`;\n } else {\n series = `#${featuredSeries.position}`;\n }\n }\n\n if (featuredSeries.series.primaryBooksCount) {\n if (!isNull(featuredSeries.position)) {\n series = `${series} of ${featuredSeries.series.primaryBooksCount.toLocaleString()}`;\n } else {\n series = featuredSeries.series.primaryBooksCount.toLocaleString();\n }\n }\n\n if (!isNull(featuredSeries.position)) {\n series = `${series} in`;\n }\n\n series = `${series} ${featuredSeries.series.name}`;\n return series;\n}\n\nconst DESCRIPTION_LENGTH = 80;\nexport function genereateBookDescription(book: BookType) {\n const title = genereateBookTitle(book as unknown as BookSerializersBookByline);\n const data = [title];\n const featuredSeries = generateFeaturedBookSeries(book as unknown as BookSerializersBookByline);\n if (featuredSeries) {\n data.push(featuredSeries);\n }\n if (book.rating) {\n data.push(`${roundRating(book.rating, 2)}⭐`);\n }\n if (book.ratingsCount > 0) {\n data.push(\n `${book.ratingsCount.toLocaleString()} ${pluralize(\n \"rating\",\n book.ratingsCount\n )}`\n );\n }\n if (book.reviewsCount > 0) {\n data.push(\n `${book.reviewsCount.toLocaleString()} ${pluralize(\n \"review\",\n book.reviewsCount\n )}`\n );\n }\n if (book.readCount > 0) {\n data.push(\n `${book.readCount.toLocaleString()} ${pluralize(\n \"reader\",\n book.readCount\n )}`\n );\n }\n if (book.pages > 0) {\n data.push(\n `${book.pages.toLocaleString()} ${pluralize(\"page\", book.pages)}`\n );\n }\n\n const description =\n book.description?.length > DESCRIPTION_LENGTH\n ? `${book.description.slice(0, DESCRIPTION_LENGTH)}...`\n : book.description;\n\n if (description?.length > 0) {\n data.push(description);\n }\n return data.join(\". \");\n}\n\nexport function isPrimaryBook(bookSeries: BookSeriesType) {\n if (bookSeries.position > 0) {\n return bookSeries.position % 1 === 0;\n }\n return false;\n}\n\nexport function isBookReleased(book: BookType | EditionType) {\n if (!book.releaseYear) {\n return true;\n }\n const now = new Date();\n const thisYear = now.getFullYear();\n if (book.releaseYear > now.getFullYear()) {\n return false;\n }\n\n if (book.releaseYear && book.releaseYear !== thisYear) {\n return thisYear > book.releaseYear;\n }\n\n if (book.releaseDate) {\n const releaseDate = new Date(book.releaseDate);\n return now.getTime() >= releaseDate.getTime();\n }\n\n return false;\n}\n\nexport function uniqBooksInSeries(series: SeriesType) {\n const bookSeriesByUsers = sortBy(\n series.bookSeries,\n (bs) => bs.book.usersCount * -1\n );\n const uniqueBookSeries = uniqBy(\n bookSeriesByUsers,\n (bs) =>\n `${\n (bs.details?.length > 0 ? bs.details : false) ||\n bs.position ||\n bs.book.id\n }`\n );\n\n const bookSeriesByPopularity = sortBy(\n uniqueBookSeries,\n (bs) => (isNull(bs.position) ? bs.book.title : bs.position) // Move position-less books to the bottom\n );\n return bookSeriesByPopularity;\n}\n\n// Sorts by position, then date\nexport function sortByPosition(bookSeries: BookSeriesType[]) {\n return bookSeries.sort((x, y) => {\n // Push null position books to the back\n if (isNull(x.position)) {\n return 1;\n }\n if (isNull(y.position)) {\n return -1;\n }\n // sort by date if positions are the same\n if (x.position === y.position) {\n if (x.book.releaseDate && y.book.releaseDate) {\n return new Date(x.book.releaseDate) < new Date(y.book.releaseDate)\n ? -1\n : 1;\n }\n if (x.book.releaseYear && y.book.releaseYear) {\n return x.book.releaseYear < y.book.releaseYear ? -1 : 1;\n }\n return 0;\n }\n\n return x.position - y.position;\n });\n}\n\nexport function filterCompilations(\n series: SeriesType,\n bookSeries: BookSeriesType[],\n isCompilation = false\n) {\n const nonCollectionBooks = bookSeries.filter((bs) => {\n const hasRange = (bs.details || \"\").indexOf(\"-\") !== -1;\n const hasSeparator = (bs.details || \"\").indexOf(\",\") !== -1;\n\n // Return false for compilations\n if (bs.book.compilation && isCompilation && (hasRange || hasSeparator)) {\n return true;\n }\n\n if (!bs.details || bs.details.length === 0) {\n return true; // Can't tell\n }\n\n const show = isCompilation\n ? hasRange || hasSeparator\n : !(hasRange || hasSeparator);\n return show;\n });\n\n return sortByPosition(nonCollectionBooks);\n}\n\nexport function mostPopular(bookSeries: BookSeriesType[]) {\n const maxBs = maxBy(bookSeries, (bs) => {\n return bs.position ? bs.book.usersCount : 0;\n });\n\n return maxBs ? maxBs.book.id : null;\n}\n\nexport function findFirstPublished(bookSeries: BookSeriesType[]) {\n const firstPub = minBy(bookSeries, (bs) => {\n if (bs.position > 0) {\n if (bs.book.releaseDate) {\n return new Date(bs.book.releaseDate);\n }\n if (bs.book.releaseYear) {\n const day = bs.position ? bs.position : 31;\n return new Date(`${bs.book.releaseYear}-01-${day}T00:00:00`);\n }\n }\n\n return new Date();\n });\n\n return firstPub ? firstPub.book.id : null;\n}\n"],"names":["isArrayLike","require$$0","createBaseEach","eachFunc","fromRight","collection","iteratee","length","index","iterable","_createBaseEach","baseForOwn","require$$1","baseEach","_baseEach","baseMap","result","value","key","_baseMap","baseSortBy","array","comparer","_baseSortBy","isSymbol","compareAscending","other","valIsDefined","valIsNull","valIsReflexive","valIsSymbol","othIsDefined","othIsNull","othIsReflexive","othIsSymbol","_compareAscending","compareMultiple","object","orders","objCriteria","othCriteria","ordersLength","order","_compareMultiple","arrayMap","baseGet","baseIteratee","require$$2","require$$3","require$$4","baseUnary","require$$5","require$$6","identity","require$$7","isArray","require$$8","baseOrderBy","iteratees","criteria","_baseOrderBy","overRest","setToString","baseRest","func","start","_baseRest","eq","isIndex","isObject","isIterateeCall","type","_isIterateeCall","baseFlatten","secondsFormat","seconds","options","parts","hours","hourSecondsUsed","minutes","minuteSecondsUsed","remainingSeconds","generateFeaturedBookSeries","book","series","featuredSeries","isNull","isBookReleased","now","thisYear","releaseDate"],"mappings":"0rBA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