@internetarchive/bookreader 5.0.0-63 → 5.0.0-64

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. package/.github/workflows/node.js.yml +1 -0
  2. package/BookReader/BookReader.css +45 -58
  3. package/BookReader/BookReader.js +1 -1
  4. package/BookReader/BookReader.js.LICENSE.txt +2 -0
  5. package/BookReader/BookReader.js.map +1 -1
  6. package/BookReader/ia-bookreader-bundle.js +95 -95
  7. package/BookReader/ia-bookreader-bundle.js.LICENSE.txt +2 -0
  8. package/BookReader/ia-bookreader-bundle.js.map +1 -1
  9. package/BookReader/icons/1up.svg +1 -1
  10. package/BookReader/icons/2up.svg +1 -1
  11. package/BookReader/icons/advance.svg +1 -1
  12. package/BookReader/icons/chevron-right.svg +1 -1
  13. package/BookReader/icons/close-circle-dark.svg +1 -1
  14. package/BookReader/icons/close-circle.svg +1 -1
  15. package/BookReader/icons/fullscreen.svg +1 -1
  16. package/BookReader/icons/fullscreen_exit.svg +1 -1
  17. package/BookReader/icons/hamburger.svg +1 -1
  18. package/BookReader/icons/left-arrow.svg +1 -1
  19. package/BookReader/icons/magnify-minus.svg +1 -1
  20. package/BookReader/icons/magnify-plus.svg +1 -1
  21. package/BookReader/icons/magnify.svg +1 -1
  22. package/BookReader/icons/pause.svg +1 -1
  23. package/BookReader/icons/play.svg +1 -1
  24. package/BookReader/icons/playback-speed.svg +1 -1
  25. package/BookReader/icons/read-aloud.svg +1 -1
  26. package/BookReader/icons/review.svg +1 -1
  27. package/BookReader/icons/thumbnails.svg +1 -1
  28. package/BookReader/icons/voice.svg +1 -1
  29. package/BookReader/icons/volume-full.svg +1 -1
  30. package/BookReader/images/BRicons.svg +3 -3
  31. package/BookReader/images/books_graphic.svg +1 -1
  32. package/BookReader/images/icon_book.svg +1 -1
  33. package/BookReader/images/icon_bookmark.svg +1 -1
  34. package/BookReader/images/icon_gear.svg +1 -1
  35. package/BookReader/images/icon_hamburger.svg +1 -1
  36. package/BookReader/images/icon_home.svg +1 -1
  37. package/BookReader/images/icon_info.svg +1 -1
  38. package/BookReader/images/icon_one_page.svg +1 -1
  39. package/BookReader/images/icon_pause.svg +1 -1
  40. package/BookReader/images/icon_play.svg +1 -1
  41. package/BookReader/images/icon_search_button.svg +1 -1
  42. package/BookReader/images/icon_share.svg +1 -1
  43. package/BookReader/images/icon_skip-ahead.svg +1 -1
  44. package/BookReader/images/icon_skip-back.svg +1 -1
  45. package/BookReader/images/icon_speaker.svg +1 -1
  46. package/BookReader/images/icon_speaker_open.svg +1 -1
  47. package/BookReader/images/icon_thumbnails.svg +1 -1
  48. package/BookReader/images/icon_toc.svg +1 -1
  49. package/BookReader/images/icon_two_pages.svg +1 -1
  50. package/BookReader/images/marker_chap-off.svg +1 -1
  51. package/BookReader/images/marker_chap-on.svg +1 -1
  52. package/BookReader/images/marker_srch-on.svg +1 -1
  53. package/BookReader/jquery-3.js +1 -1
  54. package/BookReader/plugins/plugin.archive_analytics.js +1 -1
  55. package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
  56. package/BookReader/plugins/plugin.autoplay.js +1 -1
  57. package/BookReader/plugins/plugin.autoplay.js.map +1 -1
  58. package/BookReader/plugins/plugin.chapters.js +2 -1
  59. package/BookReader/plugins/plugin.chapters.js.LICENSE.txt +1 -0
  60. package/BookReader/plugins/plugin.chapters.js.map +1 -1
  61. package/BookReader/plugins/plugin.iframe.js.map +1 -1
  62. package/BookReader/plugins/plugin.mobile_nav.js +1 -1
  63. package/BookReader/plugins/plugin.mobile_nav.js.map +1 -1
  64. package/BookReader/plugins/plugin.resume.js +1 -1
  65. package/BookReader/plugins/plugin.resume.js.map +1 -1
  66. package/BookReader/plugins/plugin.search.js +2 -1
  67. package/BookReader/plugins/plugin.search.js.LICENSE.txt +1 -0
  68. package/BookReader/plugins/plugin.search.js.map +1 -1
  69. package/BookReader/plugins/plugin.text_selection.js +2 -1
  70. package/BookReader/plugins/plugin.text_selection.js.LICENSE.txt +1 -0
  71. package/BookReader/plugins/plugin.text_selection.js.map +1 -1
  72. package/BookReader/plugins/plugin.tts.js +1 -1
  73. package/BookReader/plugins/plugin.tts.js.LICENSE.txt +2 -0
  74. package/BookReader/plugins/plugin.tts.js.map +1 -1
  75. package/BookReader/plugins/plugin.url.js +1 -1
  76. package/BookReader/plugins/plugin.url.js.map +1 -1
  77. package/BookReader/plugins/plugin.vendor-fullscreen.js +1 -1
  78. package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -1
  79. package/BookReader/webcomponents-bundle.js +1 -1
  80. package/BookReader/webcomponents-bundle.js.map +1 -1
  81. package/CHANGELOG.md +5 -0
  82. package/babel.config.js +5 -4
  83. package/netlify.toml +4 -0
  84. package/package.json +15 -15
  85. package/src/BookNavigator/search/search-results.js +1 -7
  86. package/src/BookReader/utils.js +10 -0
  87. package/src/css/_BRnav.scss +2 -2
  88. package/src/css/_BRsearch.scss +38 -10
  89. package/src/plugins/search/plugin.search.js +14 -21
  90. package/src/plugins/search/utils.js +43 -0
  91. package/src/plugins/search/view.js +11 -24
  92. package/tests/e2e/helpers/desktopSearch.js +3 -3
  93. package/tests/jest/BookNavigator/search/search-results.test.js +6 -1
  94. package/tests/jest/BookReader/utils.test.js +12 -0
  95. package/tests/jest/plugins/search/plugin.search.test.js +2 -39
  96. package/tests/jest/plugins/search/plugin.search.view.test.js +5 -0
  97. package/tests/jest/plugins/search/utils.js +25 -0
  98. package/tests/jest/plugins/search/utils.test.js +29 -0
@@ -1 +1 @@
1
- {"version":3,"file":"plugins/plugin.text_selection.js","mappings":"4qBACO,IAAMA,EAAb,WAUE,WAAYC,EAAUC,GAAS,Y,4FAAA,6BATnB,GASmB,4BARX,GAQW,gBANtB,MAMsB,6BAiBV,WACnB,IAAMC,EAAMC,OAAOC,gBAEd,EAAKC,WAAaH,EAAII,aACzB,EAAKD,WAAY,EACjB,EAAKE,OAASC,EAAEN,EAAIO,YAAYC,QAAQ,EAAKV,UAAU,GACvD,EAAKC,QAAQ,UAAW,EAAKM,UAG3B,EAAKF,YAAcH,EAAIS,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EAAS,SAAoBG,GAC5C,IAAIC,EAAgB7P,EAAKvB,EAASmR,IAC9BpM,EAAS+L,EAAaM,GAC1B,OAAkB,IAAXrM,GAA4C,KAA5B8L,EAAOO,EAAe,IAAa,EAAIrM,GAC5D+L,G,qBCrBJ,IAAIO,EAAuB,eACvBX,EAAQ,EAAQ,MAChBE,EAAc,EAAQ,MAM1BK,EAAOC,QAAU,SAAUI,GACzB,OAAOZ,GAAM,WACX,QAASE,EAAYU,MANf,cAOGA,MACHD,GAAwBT,EAAYU,GAAaC,OAASD,O,qBCZpE,IAAIpR,EAAI,EAAQ,MACZsR,EAAc,EAAQ,MAI1BtR,EAAE,CAAEuQ,QAAQ,EAAMgB,OAAQrK,YAAcoK,GAAe,CACrDpK,WAAYoK,K,kCCLd,IAAItR,EAAI,EAAQ,MACZwR,EAAQ,aAKZxR,EAAE,CAAED,OAAQ,SAAU0R,OAAO,EAAMF,OAJN,EAAQ,KAIMG,CAAuB,SAAW,CAC3ErQ,KAAM,WACJ,OAAOmQ,EAAMpR,W","sources":["webpack://@internetarchive/bookreader/./src/BookReader/utils/SelectionObserver.js","webpack://@internetarchive/bookreader/./src/util/strings.js","webpack://@internetarchive/bookreader/./src/plugins/plugin.text_selection.js","webpack://@internetarchive/bookreader/./node_modules/core-js/internals/number-parse-float.js","webpack://@internetarchive/bookreader/./node_modules/core-js/internals/string-trim-forced.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.parse-float.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.string.trim.js"],"sourcesContent":["// @ts-check\nexport class SelectionObserver {\n selecting = false;\n startedInSelector = false;\n /** @type {HTMLElement} */\n target = null;\n\n /**\n * @param {string} selector\n * @param {function('started' | 'cleared', HTMLElement): any} handler\n */\n constructor(selector, handler) {\n this.selector = selector;\n this.handler = handler;\n }\n\n attach() {\n // We can't just use selectstart, because safari on iOS just\n // randomly decides when to fire it 😤\n // document.addEventListener(\"selectstart\", this._onSelectStart);\n // This has to be on document :/\n document.addEventListener(\"selectionchange\", this._onSelectionChange);\n }\n\n detach() {\n document.removeEventListener(\"selectionchange\", this._onSelectionChange);\n }\n\n _onSelectionChange = () => {\n const sel = window.getSelection();\n\n if (!this.selecting && sel.toString()) {\n this.selecting = true;\n this.target = $(sel.anchorNode).closest(this.selector)[0];\n this.handler('started', this.target);\n }\n\n if (this.selecting && (sel.isCollapsed || !sel.toString() || !$(sel.anchorNode).closest(this.selector)[0])) {\n this.selecting = false;\n this.handler('cleared', this.target);\n }\n };\n}\n","/**\n * @typedef {String} StringWithVars\n * A template string with {{foo}} style variables\n * Also supports filters, like {{bookPath|urlencode}} (See APPLY_FILTERS for the\n * supported list of filters)\n **/\n\n/**\n * @param {StringWithVars|String} template\n * @param { {[varName: string]: { toString: () => string} } } vars\n * @param { {[varName: string]: { toString: () => string} } } [overrides]\n */\nexport function applyVariables(template, vars, overrides = {}, possibleFilters = APPLY_FILTERS) {\n return template?.replace(/\\{\\{([^}]*?)\\}\\}/g, ($0, $1) => {\n if (!$1) return $0;\n /** @type {string} */\n const expression = $1;\n const [varName, ...filterNames] = expression.split('|').map(x => x.trim());\n const defined = varName in overrides || varName in vars;\n\n // If it's not defined, don't expand it at all\n if (!defined) return $0;\n\n const value = varName in overrides ? overrides[varName]\n : varName in vars ? vars[varName] : null;\n const filters = filterNames.map(n => possibleFilters[n]);\n return filters.reduce((acc, cur) => cur(acc), value && value.toString());\n });\n}\n\n/** @type { {[filterName: String]:( string => string)} } */\nexport const APPLY_FILTERS = {\n urlencode: encodeURIComponent,\n};\n","//@ts-check\nimport { createDIVPageLayer } from '../BookReader/PageContainer.js';\nimport { SelectionObserver } from '../BookReader/utils/SelectionObserver.js';\nimport { applyVariables } from '../util/strings.js';\n/** @typedef {import('../util/strings.js').StringWithVars} StringWithVars */\n/** @typedef {import('../BookReader/PageContainer.js').PageContainer} PageContainer */\n\nconst BookReader = /** @type {typeof import('../BookReader').default} */(window.BookReader);\n\nexport const DEFAULT_OPTIONS = {\n enabled: true,\n /** @type {StringWithVars} The URL to fetch the entire DJVU xml. Supports options.vars */\n fullDjvuXmlUrl: null,\n /** @type {StringWithVars} The URL to fetch a single page of the DJVU xml. Supports options.vars. Also has {{pageIndex}} */\n singlePageDjvuXmlUrl: null,\n /** Whether to fetch the XML as a jsonp */\n jsonp: false,\n};\n/** @typedef {typeof DEFAULT_OPTIONS} TextSelectionPluginOptions */\n\n/**\n * @template T\n */\nexport class Cache {\n constructor(maxSize = 10) {\n this.maxSize = maxSize;\n /** @type {T[]} */\n this.entries = [];\n }\n\n /**\n * @param {T} entry\n */\n add(entry) {\n if (this.entries.length >= this.maxSize) {\n this.entries.shift();\n }\n this.entries.push(entry);\n }\n}\n\nexport class TextSelectionPlugin {\n /**\n * @param {'lr' | 'rl'} pageProgression In the future this should be in the ocr file\n * since a book being right to left doesn't mean the ocr is right to left. But for\n * now we do make that assumption.\n */\n constructor(options = DEFAULT_OPTIONS, optionVariables, pageProgression = 'lr') {\n this.options = options;\n this.optionVariables = optionVariables;\n /**@type {PromiseLike<JQuery<HTMLElement>|undefined>} */\n this.djvuPagesPromise = null;\n /** Whether the book is right-to-left */\n this.rtl = pageProgression === 'rl';\n\n /** @type {Cache<{index: number, response: any}>} */\n this.pageTextCache = new Cache();\n\n /**\n * Sometimes there are too many words on a page, and the browser becomes near\n * unusable. For now don't render text layer for pages with too many words.\n */\n this.maxWordRendered = 2500;\n\n this.selectionObserver = new SelectionObserver('.BRtextLayer', this._onSelectionChange);\n }\n\n /**\n * @param {'started' | 'cleared'} type\n * @param {HTMLElement} target\n */\n _onSelectionChange = (type, target) => {\n if (type === 'started') {\n this.textSelectingMode(target);\n } else if (type === 'cleared') {\n this.defaultMode(target);\n } else {\n throw new Error(`Unknown type ${type}`);\n }\n }\n\n init() {\n this.selectionObserver.attach();\n\n // Only fetch the full djvu xml if the single page url isn't there\n if (this.options.singlePageDjvuXmlUrl) return;\n this.djvuPagesPromise = $.ajax({\n type: \"GET\",\n url: applyVariables(this.options.fullDjvuXmlUrl, this.optionVariables),\n dataType: this.options.jsonp ? \"jsonp\" : \"html\",\n cache: true,\n error: (e) => undefined\n }).then((res) => {\n try {\n const xmlMap = $.parseXML(res);\n return xmlMap && $(xmlMap).find(\"OBJECT\");\n } catch (e) {\n return undefined;\n }\n });\n }\n\n /**\n * @param {number} index\n * @returns {Promise<HTMLElement|undefined>}\n */\n async getPageText(index) {\n if (this.options.singlePageDjvuXmlUrl) {\n const cachedEntry = this.pageTextCache.entries.find(x => x.index == index);\n if (cachedEntry) {\n return cachedEntry.response;\n }\n const res = await $.ajax({\n type: \"GET\",\n url: applyVariables(this.options.singlePageDjvuXmlUrl, this.optionVariables, { pageIndex: index }),\n dataType: this.options.jsonp ? \"jsonp\" : \"html\",\n cache: true,\n error: (e) => undefined,\n });\n try {\n const xmlDoc = $.parseXML(res);\n const result = xmlDoc && $(xmlDoc).find(\"OBJECT\")[0];\n this.pageTextCache.add({ index, response: result });\n return result;\n } catch (e) {\n return undefined;\n }\n } else {\n const XMLpagesArr = await this.djvuPagesPromise;\n if (XMLpagesArr) return XMLpagesArr[index];\n }\n }\n\n /**\n * Intercept copied text to remove any styling applied to it\n * @param {JQuery} $container\n */\n interceptCopy($container) {\n $container[0].addEventListener('copy', (event) => {\n const selection = document.getSelection();\n event.clipboardData.setData('text/plain', selection.toString());\n event.preventDefault();\n });\n }\n\n /**\n * Applies mouse events when in default mode\n * @param {HTMLElement} textLayer\n */\n defaultMode(textLayer) {\n const $pageContainer = $(textLayer).closest('.BRpagecontainer');\n textLayer.style.pointerEvents = \"none\";\n $pageContainer.find(\"img\").css(\"pointer-events\", \"auto\");\n\n $(textLayer).off(\".textSelectPluginHandler\");\n const startedMouseDown = this.mouseIsDown;\n let skipNextMouseup = this.mouseIsDown;\n if (startedMouseDown) {\n textLayer.style.pointerEvents = \"auto\";\n }\n\n // Need to stop propagation to prevent DragScrollable from\n // blocking selection\n $(textLayer).on(\"mousedown.textSelectPluginHandler\", (event) => {\n this.mouseIsDown = true;\n if ($(event.target).is(\".BRwordElement, .BRspace\")) {\n event.stopPropagation();\n }\n });\n\n $(textLayer).on(\"mouseup.textSelectPluginHandler\", (event) => {\n this.mouseIsDown = false;\n textLayer.style.pointerEvents = \"none\";\n if (skipNextMouseup) {\n skipNextMouseup = false;\n event.stopPropagation();\n }\n });\n }\n\n /**\n * This mode is active while there is a selection on the given textLayer\n * @param {HTMLElement} textLayer\n */\n textSelectingMode(textLayer) {\n const $pageContainer = $(textLayer).closest('.BRpagecontainer');\n // Make text layer consume all events\n textLayer.style.pointerEvents = \"all\";\n // Block img from getting long-press to save while selecting\n $pageContainer.find(\"img\").css(\"pointer-events\", \"none\");\n\n $(textLayer).off(\".textSelectPluginHandler\");\n\n $(textLayer).on('mousedown.textSelectPluginHandler', (event) => {\n this.mouseIsDown = true;\n event.stopPropagation();\n });\n\n // Prevent page flip on click\n $(textLayer).on('mouseup.textSelectPluginHandler', (event) => {\n this.mouseIsDown = false;\n event.stopPropagation();\n });\n }\n\n /**\n * Initializes text selection modes if there is a text layer on the page\n * @param {JQuery} $container\n */\n stopPageFlip($container) {\n /** @type {JQuery<HTMLElement>} */\n const $textLayer = $container.find('.BRtextLayer');\n if (!$textLayer.length) return;\n $textLayer.each((i, s) => this.defaultMode(s));\n this.interceptCopy($container);\n }\n\n /**\n * @param {PageContainer} pageContainer\n */\n async createTextLayer(pageContainer) {\n const pageIndex = pageContainer.page.index;\n const $container = pageContainer.$container;\n const $textLayers = $container.find('.BRtextLayer');\n if ($textLayers.length) return;\n const XMLpage = await this.getPageText(pageIndex);\n if (!XMLpage) return;\n recursivelyAddCoords(XMLpage);\n\n const totalWords = $(XMLpage).find(\"WORD\").length;\n if (totalWords > this.maxWordRendered) {\n console.log(`Page ${pageIndex} has too many words (${totalWords} > ${this.maxWordRendered}). Not rendering text layer.`);\n return;\n }\n\n const textLayer = createDIVPageLayer(pageContainer.page, 'BRtextLayer');\n const ratioW = parseFloat(pageContainer.$container[0].style.width) / pageContainer.page.width;\n const ratioH = parseFloat(pageContainer.$container[0].style.height) / pageContainer.page.height;\n textLayer.style.transform = `scale(${ratioW}, ${ratioH})`;\n textLayer.setAttribute(\"dir\", this.rtl ? \"rtl\" : \"ltr\");\n\n const ocrParagraphs = $(XMLpage).find(\"PARAGRAPH[coords]\").toArray();\n const paragEls = ocrParagraphs.map(p => {\n const el = this.renderParagraph(p);\n textLayer.appendChild(el);\n return el;\n });\n\n // Fix up paragraph positions\n const paragraphRects = determineRealRects(textLayer, '.BRparagraphElement');\n let yAdded = 0;\n for (const [ocrParagraph, paragEl] of zip(ocrParagraphs, paragEls)) {\n const ocrParagBounds = $(ocrParagraph).attr(\"coords\").split(\",\").map(parseFloat);\n const realRect = paragraphRects.get(paragEl);\n const [ocrLeft, , ocrRight, ocrTop] = ocrParagBounds;\n const newStartMargin = this.rtl ? (realRect.right - ocrRight) : (ocrLeft - realRect.left);\n const newTop = ocrTop - (realRect.top + yAdded);\n\n paragEl.style[this.rtl ? 'marginRight' : 'marginLeft'] = `${newStartMargin}px`;\n paragEl.style.marginTop = `${newTop}px`;\n yAdded += newTop;\n textLayer.appendChild(paragEl);\n }\n $container.append(textLayer);\n this.stopPageFlip($container);\n }\n\n /**\n * @param {HTMLElement} ocrParagraph\n * @returns {HTMLParagraphElement}\n */\n renderParagraph(ocrParagraph) {\n const paragEl = document.createElement('p');\n paragEl.classList.add('BRparagraphElement');\n const [paragLeft, paragBottom, paragRight, paragTop] = $(ocrParagraph).attr(\"coords\").split(\",\").map(parseFloat);\n const wordHeightArr = [];\n const lines = $(ocrParagraph).find(\"LINE[coords]\").toArray();\n if (!lines.length) return paragEl;\n\n\n for (const [prevLine, line, nextLine] of lookAroundWindow(genMap(lines, augmentLine))) {\n const isLastLineOfParagraph = line.ocrElement == lines[lines.length - 1];\n const lineEl = document.createElement('span');\n lineEl.classList.add('BRlineElement');\n\n for (const [wordIndex, currWord] of line.words.entries()) {\n const [, bottom, right, top] = $(currWord).attr(\"coords\").split(',').map(parseFloat);\n const wordHeight = bottom - top;\n wordHeightArr.push(wordHeight);\n\n if (wordIndex == 0 && prevLine?.lastWord.textContent.trim().endsWith('-')) {\n // ideally prefer the next line to determine the left position,\n // since the previous line could be the first line of the paragraph\n // and hence have an incorrectly indented first word.\n // E.g. https://archive.org/details/driitaleofdaring00bachuoft/page/360/mode/2up\n const [newLeft, , , ] = $((nextLine || prevLine).firstWord).attr(\"coords\").split(',').map(parseFloat);\n $(currWord).attr(\"coords\", `${newLeft},${bottom},${right},${top}`);\n }\n\n const wordEl = document.createElement('span');\n wordEl.setAttribute(\"class\", \"BRwordElement\");\n wordEl.textContent = currWord.textContent.trim();\n\n if (wordIndex > 0) {\n const space = document.createElement('span');\n space.classList.add('BRspace');\n space.textContent = ' ';\n lineEl.append(space);\n\n // Edge ignores empty elements (like BRspace), so add another\n // space to ensure Edge's ReadAloud works correctly.\n lineEl.appendChild(document.createTextNode(' '));\n }\n\n lineEl.appendChild(wordEl);\n }\n\n const hasHyphen = line.lastWord.textContent.trim().endsWith('-');\n const lastWordEl = lineEl.children[lineEl.children.length - 1];\n if (hasHyphen && !isLastLineOfParagraph) {\n lastWordEl.textContent = lastWordEl.textContent.trim().slice(0, -1);\n lastWordEl.classList.add('BRwordElement--hyphen');\n }\n\n paragEl.appendChild(lineEl);\n if (!isLastLineOfParagraph && !hasHyphen) {\n // Edge does not correctly have spaces between the lines.\n paragEl.appendChild(document.createTextNode(' '));\n }\n }\n\n wordHeightArr.sort((a, b) => a - b);\n const paragWordHeight = wordHeightArr[Math.floor(wordHeightArr.length * 0.85)] + 4;\n paragEl.style.left = `${paragLeft}px`;\n paragEl.style.top = `${paragTop}px`;\n paragEl.style.width = `${paragRight - paragLeft}px`;\n paragEl.style.height = `${paragBottom - paragTop}px`;\n paragEl.style.fontSize = `${paragWordHeight}px`;\n\n // Fix up sizes - stretch/crush words as necessary using letter spacing\n let wordRects = determineRealRects(paragEl, '.BRwordElement');\n const ocrWords = $(ocrParagraph).find(\"WORD\").toArray();\n const wordEls = paragEl.querySelectorAll('.BRwordElement');\n for (const [ocrWord, wordEl] of zip(ocrWords, wordEls)) {\n const realRect = wordRects.get(wordEl);\n const [left, , right ] = $(ocrWord).attr(\"coords\").split(',').map(parseFloat);\n let ocrWidth = right - left;\n // Some books (eg theworksofplato01platiala) have a space _inside_ the <WORD>\n // element. That makes it impossible to determine the correct positining\n // of everything, but to avoid the BRspace's being width 0, which makes selection\n // janky on Chrome Android, assume the space is the same width as one of the\n // letters.\n if (ocrWord.textContent.endsWith(' ')) {\n ocrWidth = ocrWidth * (ocrWord.textContent.length - 1) / ocrWord.textContent.length;\n }\n const diff = ocrWidth - realRect.width;\n wordEl.style.letterSpacing = `${diff / (ocrWord.textContent.length - 1)}px`;\n }\n\n // Stretch/crush lines as necessary using line spacing\n // Recompute rects after letter spacing\n wordRects = determineRealRects(paragEl, '.BRwordElement');\n const spaceRects = determineRealRects(paragEl, '.BRspace');\n\n const ocrLines = $(ocrParagraph).find(\"LINE[coords]\").toArray();\n const lineEls = Array.from(paragEl.querySelectorAll('.BRlineElement'));\n\n let ySoFar = paragTop;\n for (const [ocrLine, lineEl] of zip(ocrLines, lineEls)) {\n // shift words using marginLeft to align with the correct x position\n const words = $(ocrLine).find(\"WORD\").toArray();\n // const ocrLineLeft = Math.min(...words.map(w => parseFloat($(w).attr(\"coords\").split(',')[0])));\n let xSoFar = this.rtl ? paragRight : paragLeft;\n for (const [ocrWord, wordEl] of zip(words, lineEl.querySelectorAll('.BRwordElement'))) {\n // start of line, need to compute the offset relative to the OCR words\n const wordRect = wordRects.get(wordEl);\n const [ocrLeft, , ocrRight ] = $(ocrWord).attr(\"coords\").split(',').map(parseFloat);\n const diff = (this.rtl ? -(ocrRight - xSoFar) : ocrLeft - xSoFar);\n\n if (wordEl.previousElementSibling) {\n const space = wordEl.previousElementSibling;\n space.style.letterSpacing = `${diff - spaceRects.get(space).width}px`;\n } else {\n wordEl.style[this.rtl ? 'paddingRight' : 'paddingLeft'] = `${diff}px`;\n }\n if (this.rtl) xSoFar -= diff + wordRect.width;\n else xSoFar += diff + wordRect.width;\n }\n // And also fix y position\n const ocrLineTop = Math.min(...words.map(w => parseFloat($(w).attr(\"coords\").split(',')[3])));\n const diff = ocrLineTop - ySoFar;\n if (lineEl.previousElementSibling) {\n lineEl.previousElementSibling.style.lineHeight = `${diff}px`;\n ySoFar += diff;\n }\n }\n\n // The last line will have a line height subtracting from the paragraph height\n lineEls[lineEls.length - 1].style.lineHeight = `${paragBottom - ySoFar}px`;\n\n // Edge does not include a newline for some reason when copying/pasting the <p> els\n paragEl.appendChild(document.createElement('br'));\n return paragEl;\n }\n}\n\nexport class BookreaderWithTextSelection extends BookReader {\n init() {\n const options = Object.assign({}, DEFAULT_OPTIONS, this.options.plugins.textSelection);\n if (options.enabled) {\n this.textSelectionPlugin = new TextSelectionPlugin(options, this.options.vars, this.pageProgression);\n // Write this back; this way the plugin is the source of truth, and BR just\n // contains a reference to it.\n this.options.plugins.textSelection = options;\n this.textSelectionPlugin.init();\n\n new SelectionObserver('.BRtextLayer', (selectEvent) => {\n // Track how often selection is used\n if (selectEvent == 'started') {\n this.archiveAnalyticsSendEvent?.('BookReader', 'SelectStart');\n\n // Set a class on the page to avoid hiding it when zooming/etc\n this.refs.$br.find('.BRpagecontainer--hasSelection').removeClass('BRpagecontainer--hasSelection');\n $(window.getSelection().anchorNode).closest('.BRpagecontainer').addClass('BRpagecontainer--hasSelection');\n }\n }).attach();\n }\n\n super.init();\n }\n\n /**\n * @param {number} index\n */\n _createPageContainer(index) {\n const pageContainer = super._createPageContainer(index);\n // Disable if thumb mode; it's too janky\n // .page can be null for \"pre-cover\" region\n if (this.mode !== this.constModeThumb && pageContainer.page) {\n this.textSelectionPlugin?.createTextLayer(pageContainer);\n }\n return pageContainer;\n }\n}\nwindow.BookReader = BookreaderWithTextSelection;\nexport default BookreaderWithTextSelection;\n\n\n/**\n * @param {HTMLElement} parentEl\n * @param {string} selector\n * @returns {Map<Element, Rect>}\n */\nfunction determineRealRects(parentEl, selector) {\n const initals = {\n position: parentEl.style.position,\n visibility: parentEl.style.visibility,\n top: parentEl.style.top,\n left: parentEl.style.left,\n transform: parentEl.style.transform,\n };\n parentEl.style.position = 'absolute';\n parentEl.style.visibility = 'hidden';\n parentEl.style.top = '0';\n parentEl.style.left = '0';\n parentEl.style.transform = 'none';\n document.body.appendChild(parentEl);\n const rects = new Map(\n Array.from(parentEl.querySelectorAll(selector))\n .map(wordEl => {\n const origRect = wordEl.getBoundingClientRect();\n return [wordEl, new Rect(\n origRect.left + window.scrollX,\n origRect.top + window.scrollY,\n origRect.width,\n origRect.height,\n )];\n })\n );\n document.body.removeChild(parentEl);\n Object.assign(parentEl.style, initals);\n return rects;\n}\n\n/**\n * @param {HTMLElement} line\n */\nfunction augmentLine(line) {\n const words = $(line).find(\"WORD\").toArray();\n return {\n ocrElement: line,\n words,\n firstWord: words[0],\n lastWord: words[words.length - 1],\n };\n}\n\n/**\n * @template TFrom, TTo\n * Generator version of map\n * @param {Iterable<TFrom>} gen\n * @param {function(TFrom): TTo} fn\n * @returns {Iterable<TTo>}\n */\nexport function* genMap(gen, fn) {\n for (const x of gen) yield fn(x);\n}\n\n/**\n * @template T\n * Generator that provides a sliding window of 3 elements,\n * prev, current, and next.\n * @param {Iterable<T>} gen\n * @returns {Iterable<[T | undefined, T, T | undefined]>}\n */\nexport function* lookAroundWindow(gen) {\n let prev = undefined;\n let cur = undefined;\n let next = undefined;\n for (const x of gen) {\n if (typeof cur !== 'undefined') {\n next = x;\n yield [prev, cur, next];\n }\n prev = cur;\n cur = x;\n next = undefined;\n }\n\n if (typeof cur !== 'undefined') {\n yield [prev, cur, next];\n }\n}\n\n/**\n * @template T1, T2\n * Lazy zip implementation to avoid importing lodash\n * Expects iterators to be of the same length\n * @param {Iterable<T1>} gen1\n * @param {Iterable<T2>} gen2\n * @returns {Iterable<[T1, T2]>}\n */\nexport function* zip(gen1, gen2) {\n const it1 = gen1[Symbol.iterator]();\n const it2 = gen2[Symbol.iterator]();\n while (true) {\n const r1 = it1.next();\n const r2 = it2.next();\n if (r1.done && r2.done) {\n return;\n }\n if (r1.done || r2.done) {\n throw new Error('zip: one of the iterators is done');\n }\n yield [r1.value, r2.value];\n }\n}\n\n/**\n * [left, bottom, right, top]\n * @param {Array<[number, number, number, number]>} bounds\n * @returns {[number, number, number, number]}\n */\nfunction determineBounds(bounds) {\n let leftMost = Infinity;\n let bottomMost = -Infinity;\n let rightMost = -Infinity;\n let topMost = Infinity;\n\n for (const [left, bottom, right, top] of bounds) {\n leftMost = Math.min(leftMost, left);\n bottomMost = Math.max(bottomMost, bottom);\n rightMost = Math.max(rightMost, right);\n topMost = Math.min(topMost, top);\n }\n\n return [leftMost, bottomMost, rightMost, topMost];\n}\n\n/**\n * Recursively traverses the XML tree and adds coords\n * which are the bounding box of all child coords\n * @param {Element} xmlEl\n */\nfunction recursivelyAddCoords(xmlEl) {\n if ($(xmlEl).attr('coords') || !xmlEl.children) {\n return;\n }\n\n const children = $(xmlEl).children().toArray();\n if (children.length === 0) {\n return;\n }\n\n for (const child of children) {\n recursivelyAddCoords(child);\n }\n\n const childCoords = [];\n\n for (const child of children) {\n if (!$(child).attr('coords')) continue;\n childCoords.push($(child).attr('coords').split(',').map(parseFloat));\n }\n\n const boundingCoords = determineBounds(childCoords);\n if (Math.abs(boundingCoords[0]) != Infinity) {\n $(xmlEl).attr('coords', boundingCoords.join(','));\n }\n}\n\n/**\n * Basically a polyfill for the native DOMRect class\n */\nclass Rect {\n /**\n * @param {number} x\n * @param {number} y\n * @param {number} width\n * @param {number} height\n */\n constructor(x, y, width, height) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }\n\n get right() { return this.x + this.width; }\n get bottom() { return this.y + this.height; }\n get top() { return this.y; }\n get left() { return this.x; }\n}\n","var global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toString = require('../internals/to-string');\nvar trim = require('../internals/string-trim').trim;\nvar whitespaces = require('../internals/whitespaces');\n\nvar charAt = uncurryThis(''.charAt);\nvar n$ParseFloat = global.parseFloat;\nvar Symbol = global.Symbol;\nvar ITERATOR = Symbol && Symbol.iterator;\nvar FORCED = 1 / n$ParseFloat(whitespaces + '-0') !== -Infinity\n // MS Edge 18- broken with boxed symbols\n || (ITERATOR && !fails(function () { n$ParseFloat(Object(ITERATOR)); }));\n\n// `parseFloat` method\n// https://tc39.es/ecma262/#sec-parsefloat-string\nmodule.exports = FORCED ? function parseFloat(string) {\n var trimmedString = trim(toString(string));\n var result = n$ParseFloat(trimmedString);\n return result === 0 && charAt(trimmedString, 0) == '-' ? -0 : result;\n} : n$ParseFloat;\n","var PROPER_FUNCTION_NAME = require('../internals/function-name').PROPER;\nvar fails = require('../internals/fails');\nvar whitespaces = require('../internals/whitespaces');\n\nvar non = '\\u200B\\u0085\\u180E';\n\n// check that a method works with the correct list\n// of whitespaces and has a correct name\nmodule.exports = function (METHOD_NAME) {\n return fails(function () {\n return !!whitespaces[METHOD_NAME]()\n || non[METHOD_NAME]() !== non\n || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);\n });\n};\n","var $ = require('../internals/export');\nvar $parseFloat = require('../internals/number-parse-float');\n\n// `parseFloat` method\n// https://tc39.es/ecma262/#sec-parsefloat-string\n$({ global: true, forced: parseFloat != $parseFloat }, {\n parseFloat: $parseFloat\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar $trim = require('../internals/string-trim').trim;\nvar forcedStringTrimMethod = require('../internals/string-trim-forced');\n\n// `String.prototype.trim` method\n// https://tc39.es/ecma262/#sec-string.prototype.trim\n$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {\n trim: function trim() {\n return $trim(this);\n }\n});\n"],"names":["SelectionObserver","selector","handler","sel","window","getSelection","selecting","toString","target","$","anchorNode","closest","isCollapsed","this","document","addEventListener","_onSelectionChange","removeEventListener","applyVariables","template","vars","overrides","possibleFilters","APPLY_FILTERS","replace","$0","$1","split","map","x","trim","varName","filterNames","value","n","reduce","acc","cur","urlencode","encodeURIComponent","genMap","lookAroundWindow","zip","BookReader","DEFAULT_OPTIONS","enabled","fullDjvuXmlUrl","singlePageDjvuXmlUrl","jsonp","Cache","maxSize","entries","entry","length","shift","push","TextSelectionPlugin","options","optionVariables","pageProgression","type","textSelectingMode","Error","defaultMode","djvuPagesPromise","rtl","pageTextCache","maxWordRendered","selectionObserver","attach","ajax","url","dataType","cache","error","e","then","res","xmlMap","parseXML","find","index","cachedEntry","response","pageIndex","xmlDoc","result","add","undefined","XMLpagesArr","$container","event","selection","clipboardData","setData","preventDefault","textLayer","$pageContainer","style","pointerEvents","css","off","startedMouseDown","mouseIsDown","skipNextMouseup","on","is","stopPropagation","$textLayer","each","i","s","interceptCopy","pageContainer","page","getPageText","XMLpage","recursivelyAddCoords","totalWords","console","log","createDIVPageLayer","ratioW","parseFloat","width","ratioH","height","transform","setAttribute","ocrParagraphs","toArray","paragEls","p","el","renderParagraph","appendChild","paragraphRects","determineRealRects","yAdded","ocrParagraph","paragEl","ocrParagBounds","attr","realRect","get","ocrLeft","ocrRight","ocrTop","newStartMargin","right","left","newTop","top","marginTop","append","stopPageFlip","createElement","classList","paragLeft","paragBottom","paragRight","paragTop","wordHeightArr","lines","augmentLine","prevLine","line","nextLine","isLastLineOfParagraph","ocrElement","lineEl","words","wordIndex","currWord","bottom","wordHeight","lastWord","textContent","endsWith","newLeft","firstWord","wordEl","space","createTextNode","hasHyphen","lastWordEl","children","slice","sort","a","b","paragWordHeight","Math","floor","fontSize","wordRects","querySelectorAll","ocrWord","ocrWidth","diff","letterSpacing","spaceRects","ocrLines","lineEls","Array","from","ySoFar","ocrLine","xSoFar","wordRect","previousElementSibling","min","w","lineHeight","BookreaderWithTextSelection","Object","assign","plugins","textSelection","textSelectionPlugin","init","selectEvent","archiveAnalyticsSendEvent","refs","$br","removeClass","addClass","mode","constModeThumb","createTextLayer","parentEl","initals","position","visibility","body","rects","Map","origRect","getBoundingClientRect","Rect","scrollX","scrollY","removeChild","gen","fn","f","prev","next","gen1","gen2","it1","Symbol","iterator","it2","r1","r2","done","xmlEl","childCoords","child","boundingCoords","bounds","leftMost","Infinity","bottomMost","rightMost","topMost","max","determineBounds","abs","join","y","global","fails","uncurryThis","whitespaces","charAt","n$ParseFloat","ITERATOR","FORCED","module","exports","string","trimmedString","PROPER_FUNCTION_NAME","METHOD_NAME","name","$parseFloat","forced","$trim","proto","forcedStringTrimMethod"],"sourceRoot":""}
1
+ {"version":3,"file":"plugins/plugin.text_selection.js","mappings":";qvCACO,IAAMA,EAAiB,WAU5B,SAAAA,EAAYC,EAAUC,GAAS,IAAAC,EAAA,kGAAAC,CAAA,KAAAJ,GAAAK,EAAA,kBATnB,GAAKA,EAAA,0BACG,GACpBA,EAAA,cACS,MAAIA,EAAA,2BAuBQ,WACnB,IAAMC,EAAMC,OAAOC,gBAEdL,EAAKM,WAAaH,EAAII,aACzBP,EAAKM,WAAY,EACjBN,EAAKQ,OAASC,EAAEN,EAAIO,YAAYC,QAAQX,EAAKF,UAAU,GACvDE,EAAKD,QAAQ,UAAWC,EAAKQ,UAG3BR,EAAKM,YAAcH,EAAIS,aAAgBT,EAAII,YAAeE,EAAEN,EAAIO,YAAYC,QAAQX,EAAKF,UAAU,KACrGE,EAAKM,WAAY,EACjBN,EAAKD,QAAQ,UAAWC,EAAKQ,QAEjC,IA7BEK,KAAKf,SAAWA,EAChBe,KAAKd,QAAUA,CACjB,SAYC,SAZAF,KAAA,EAAAiB,IAAA,SAAAC,MAED,WAKEC,SAASC,iBAAiB,kBAAmBJ,KAAKK,mBACpD,GAAC,CAAAJ,IAAA,SAAAC,MAED,WACEC,SAASG,oBAAoB,kBAAmBN,KAAKK,mBACvD,0EAACrB,CAAA,CAzB2B,6GCWvB,SAASuB,EAAeC,EAAUC,GAAuD,IAAjDC,EAASC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAC,EAAGG,E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AI,EAAQ,MACZ2hB,EAAQ,aAKZ3hB,EAAE,CAAED,OAAQ,SAAU6hB,OAAO,EAAMF,OAJN,EAAQ,KAIMG,CAAuB,SAAW,CAC3ElgB,KAAM,WACJ,OAAOggB,EAAMvhB,KACf","sources":["webpack://@internetarchive/bookreader/./src/BookReader/utils/SelectionObserver.js","webpack://@internetarchive/bookreader/./src/util/strings.js","webpack://@internetarchive/bookreader/./src/plugins/plugin.text_selection.js","webpack://@internetarchive/bookreader/./node_modules/core-js/internals/number-parse-float.js","webpack://@internetarchive/bookreader/./node_modules/core-js/internals/string-trim-forced.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.parse-float.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.string.trim.js"],"sourcesContent":["// @ts-check\nexport class SelectionObserver {\n selecting = false;\n startedInSelector = false;\n /** @type {HTMLElement} */\n target = null;\n\n /**\n * @param {string} selector\n * @param {function('started' | 'cleared', HTMLElement): any} handler\n */\n constructor(selector, handler) {\n this.selector = selector;\n this.handler = handler;\n }\n\n attach() {\n // We can't just use selectstart, because safari on iOS just\n // randomly decides when to fire it 😤\n // document.addEventListener(\"selectstart\", this._onSelectStart);\n // This has to be on document :/\n document.addEventListener(\"selectionchange\", this._onSelectionChange);\n }\n\n detach() {\n document.removeEventListener(\"selectionchange\", this._onSelectionChange);\n }\n\n _onSelectionChange = () => {\n const sel = window.getSelection();\n\n if (!this.selecting && sel.toString()) {\n this.selecting = true;\n this.target = $(sel.anchorNode).closest(this.selector)[0];\n this.handler('started', this.target);\n }\n\n if (this.selecting && (sel.isCollapsed || !sel.toString() || !$(sel.anchorNode).closest(this.selector)[0])) {\n this.selecting = false;\n this.handler('cleared', this.target);\n }\n };\n}\n","/**\n * @typedef {String} StringWithVars\n * A template string with {{foo}} style variables\n * Also supports filters, like {{bookPath|urlencode}} (See APPLY_FILTERS for the\n * supported list of filters)\n **/\n\n/**\n * @param {StringWithVars|String} template\n * @param { {[varName: string]: { toString: () => string} } } vars\n * @param { {[varName: string]: { toString: () => string} } } [overrides]\n */\nexport function applyVariables(template, vars, overrides = {}, possibleFilters = APPLY_FILTERS) {\n return template?.replace(/\\{\\{([^}]*?)\\}\\}/g, ($0, $1) => {\n if (!$1) return $0;\n /** @type {string} */\n const expression = $1;\n const [varName, ...filterNames] = expression.split('|').map(x => x.trim());\n const defined = varName in overrides || varName in vars;\n\n // If it's not defined, don't expand it at all\n if (!defined) return $0;\n\n const value = varName in overrides ? overrides[varName]\n : varName in vars ? vars[varName] : null;\n const filters = filterNames.map(n => possibleFilters[n]);\n return filters.reduce((acc, cur) => cur(acc), value && value.toString());\n });\n}\n\n/** @type { {[filterName: String]:( string => string)} } */\nexport const APPLY_FILTERS = {\n urlencode: encodeURIComponent,\n};\n","//@ts-check\nimport { createDIVPageLayer } from '../BookReader/PageContainer.js';\nimport { SelectionObserver } from '../BookReader/utils/SelectionObserver.js';\nimport { applyVariables } from '../util/strings.js';\n/** @typedef {import('../util/strings.js').StringWithVars} StringWithVars */\n/** @typedef {import('../BookReader/PageContainer.js').PageContainer} PageContainer */\n\nconst BookReader = /** @type {typeof import('../BookReader').default} */(window.BookReader);\n\nexport const DEFAULT_OPTIONS = {\n enabled: true,\n /** @type {StringWithVars} The URL to fetch the entire DJVU xml. Supports options.vars */\n fullDjvuXmlUrl: null,\n /** @type {StringWithVars} The URL to fetch a single page of the DJVU xml. Supports options.vars. Also has {{pageIndex}} */\n singlePageDjvuXmlUrl: null,\n /** Whether to fetch the XML as a jsonp */\n jsonp: false,\n};\n/** @typedef {typeof DEFAULT_OPTIONS} TextSelectionPluginOptions */\n\n/**\n * @template T\n */\nexport class Cache {\n constructor(maxSize = 10) {\n this.maxSize = maxSize;\n /** @type {T[]} */\n this.entries = [];\n }\n\n /**\n * @param {T} entry\n */\n add(entry) {\n if (this.entries.length >= this.maxSize) {\n this.entries.shift();\n }\n this.entries.push(entry);\n }\n}\n\nexport class TextSelectionPlugin {\n /**\n * @param {'lr' | 'rl'} pageProgression In the future this should be in the ocr file\n * since a book being right to left doesn't mean the ocr is right to left. But for\n * now we do make that assumption.\n */\n constructor(options = DEFAULT_OPTIONS, optionVariables, pageProgression = 'lr') {\n this.options = options;\n this.optionVariables = optionVariables;\n /**@type {PromiseLike<JQuery<HTMLElement>|undefined>} */\n this.djvuPagesPromise = null;\n /** Whether the book is right-to-left */\n this.rtl = pageProgression === 'rl';\n\n /** @type {Cache<{index: number, response: any}>} */\n this.pageTextCache = new Cache();\n\n /**\n * Sometimes there are too many words on a page, and the browser becomes near\n * unusable. For now don't render text layer for pages with too many words.\n */\n this.maxWordRendered = 2500;\n\n this.selectionObserver = new SelectionObserver('.BRtextLayer', this._onSelectionChange);\n }\n\n /**\n * @param {'started' | 'cleared'} type\n * @param {HTMLElement} target\n */\n _onSelectionChange = (type, target) => {\n if (type === 'started') {\n this.textSelectingMode(target);\n } else if (type === 'cleared') {\n this.defaultMode(target);\n } else {\n throw new Error(`Unknown type ${type}`);\n }\n }\n\n init() {\n this.selectionObserver.attach();\n\n // Only fetch the full djvu xml if the single page url isn't there\n if (this.options.singlePageDjvuXmlUrl) return;\n this.djvuPagesPromise = $.ajax({\n type: \"GET\",\n url: applyVariables(this.options.fullDjvuXmlUrl, this.optionVariables),\n dataType: this.options.jsonp ? \"jsonp\" : \"html\",\n cache: true,\n error: (e) => undefined\n }).then((res) => {\n try {\n const xmlMap = $.parseXML(res);\n return xmlMap && $(xmlMap).find(\"OBJECT\");\n } catch (e) {\n return undefined;\n }\n });\n }\n\n /**\n * @param {number} index\n * @returns {Promise<HTMLElement|undefined>}\n */\n async getPageText(index) {\n if (this.options.singlePageDjvuXmlUrl) {\n const cachedEntry = this.pageTextCache.entries.find(x => x.index == index);\n if (cachedEntry) {\n return cachedEntry.response;\n }\n const res = await $.ajax({\n type: \"GET\",\n url: applyVariables(this.options.singlePageDjvuXmlUrl, this.optionVariables, { pageIndex: index }),\n dataType: this.options.jsonp ? \"jsonp\" : \"html\",\n cache: true,\n error: (e) => undefined,\n });\n try {\n const xmlDoc = $.parseXML(res);\n const result = xmlDoc && $(xmlDoc).find(\"OBJECT\")[0];\n this.pageTextCache.add({ index, response: result });\n return result;\n } catch (e) {\n return undefined;\n }\n } else {\n const XMLpagesArr = await this.djvuPagesPromise;\n if (XMLpagesArr) return XMLpagesArr[index];\n }\n }\n\n /**\n * Intercept copied text to remove any styling applied to it\n * @param {JQuery} $container\n */\n interceptCopy($container) {\n $container[0].addEventListener('copy', (event) => {\n const selection = document.getSelection();\n event.clipboardData.setData('text/plain', selection.toString());\n event.preventDefault();\n });\n }\n\n /**\n * Applies mouse events when in default mode\n * @param {HTMLElement} textLayer\n */\n defaultMode(textLayer) {\n const $pageContainer = $(textLayer).closest('.BRpagecontainer');\n textLayer.style.pointerEvents = \"none\";\n $pageContainer.find(\"img\").css(\"pointer-events\", \"auto\");\n\n $(textLayer).off(\".textSelectPluginHandler\");\n const startedMouseDown = this.mouseIsDown;\n let skipNextMouseup = this.mouseIsDown;\n if (startedMouseDown) {\n textLayer.style.pointerEvents = \"auto\";\n }\n\n // Need to stop propagation to prevent DragScrollable from\n // blocking selection\n $(textLayer).on(\"mousedown.textSelectPluginHandler\", (event) => {\n this.mouseIsDown = true;\n if ($(event.target).is(\".BRwordElement, .BRspace\")) {\n event.stopPropagation();\n }\n });\n\n $(textLayer).on(\"mouseup.textSelectPluginHandler\", (event) => {\n this.mouseIsDown = false;\n textLayer.style.pointerEvents = \"none\";\n if (skipNextMouseup) {\n skipNextMouseup = false;\n event.stopPropagation();\n }\n });\n }\n\n /**\n * This mode is active while there is a selection on the given textLayer\n * @param {HTMLElement} textLayer\n */\n textSelectingMode(textLayer) {\n const $pageContainer = $(textLayer).closest('.BRpagecontainer');\n // Make text layer consume all events\n textLayer.style.pointerEvents = \"all\";\n // Block img from getting long-press to save while selecting\n $pageContainer.find(\"img\").css(\"pointer-events\", \"none\");\n\n $(textLayer).off(\".textSelectPluginHandler\");\n\n $(textLayer).on('mousedown.textSelectPluginHandler', (event) => {\n this.mouseIsDown = true;\n event.stopPropagation();\n });\n\n // Prevent page flip on click\n $(textLayer).on('mouseup.textSelectPluginHandler', (event) => {\n this.mouseIsDown = false;\n event.stopPropagation();\n });\n }\n\n /**\n * Initializes text selection modes if there is a text layer on the page\n * @param {JQuery} $container\n */\n stopPageFlip($container) {\n /** @type {JQuery<HTMLElement>} */\n const $textLayer = $container.find('.BRtextLayer');\n if (!$textLayer.length) return;\n $textLayer.each((i, s) => this.defaultMode(s));\n this.interceptCopy($container);\n }\n\n /**\n * @param {PageContainer} pageContainer\n */\n async createTextLayer(pageContainer) {\n const pageIndex = pageContainer.page.index;\n const $container = pageContainer.$container;\n const $textLayers = $container.find('.BRtextLayer');\n if ($textLayers.length) return;\n const XMLpage = await this.getPageText(pageIndex);\n if (!XMLpage) return;\n recursivelyAddCoords(XMLpage);\n\n const totalWords = $(XMLpage).find(\"WORD\").length;\n if (totalWords > this.maxWordRendered) {\n console.log(`Page ${pageIndex} has too many words (${totalWords} > ${this.maxWordRendered}). Not rendering text layer.`);\n return;\n }\n\n const textLayer = createDIVPageLayer(pageContainer.page, 'BRtextLayer');\n const ratioW = parseFloat(pageContainer.$container[0].style.width) / pageContainer.page.width;\n const ratioH = parseFloat(pageContainer.$container[0].style.height) / pageContainer.page.height;\n textLayer.style.transform = `scale(${ratioW}, ${ratioH})`;\n textLayer.setAttribute(\"dir\", this.rtl ? \"rtl\" : \"ltr\");\n\n const ocrParagraphs = $(XMLpage).find(\"PARAGRAPH[coords]\").toArray();\n const paragEls = ocrParagraphs.map(p => {\n const el = this.renderParagraph(p);\n textLayer.appendChild(el);\n return el;\n });\n\n // Fix up paragraph positions\n const paragraphRects = determineRealRects(textLayer, '.BRparagraphElement');\n let yAdded = 0;\n for (const [ocrParagraph, paragEl] of zip(ocrParagraphs, paragEls)) {\n const ocrParagBounds = $(ocrParagraph).attr(\"coords\").split(\",\").map(parseFloat);\n const realRect = paragraphRects.get(paragEl);\n const [ocrLeft, , ocrRight, ocrTop] = ocrParagBounds;\n const newStartMargin = this.rtl ? (realRect.right - ocrRight) : (ocrLeft - realRect.left);\n const newTop = ocrTop - (realRect.top + yAdded);\n\n paragEl.style[this.rtl ? 'marginRight' : 'marginLeft'] = `${newStartMargin}px`;\n paragEl.style.marginTop = `${newTop}px`;\n yAdded += newTop;\n textLayer.appendChild(paragEl);\n }\n $container.append(textLayer);\n this.stopPageFlip($container);\n }\n\n /**\n * @param {HTMLElement} ocrParagraph\n * @returns {HTMLParagraphElement}\n */\n renderParagraph(ocrParagraph) {\n const paragEl = document.createElement('p');\n paragEl.classList.add('BRparagraphElement');\n const [paragLeft, paragBottom, paragRight, paragTop] = $(ocrParagraph).attr(\"coords\").split(\",\").map(parseFloat);\n const wordHeightArr = [];\n const lines = $(ocrParagraph).find(\"LINE[coords]\").toArray();\n if (!lines.length) return paragEl;\n\n\n for (const [prevLine, line, nextLine] of lookAroundWindow(genMap(lines, augmentLine))) {\n const isLastLineOfParagraph = line.ocrElement == lines[lines.length - 1];\n const lineEl = document.createElement('span');\n lineEl.classList.add('BRlineElement');\n\n for (const [wordIndex, currWord] of line.words.entries()) {\n const [, bottom, right, top] = $(currWord).attr(\"coords\").split(',').map(parseFloat);\n const wordHeight = bottom - top;\n wordHeightArr.push(wordHeight);\n\n if (wordIndex == 0 && prevLine?.lastWord.textContent.trim().endsWith('-')) {\n // ideally prefer the next line to determine the left position,\n // since the previous line could be the first line of the paragraph\n // and hence have an incorrectly indented first word.\n // E.g. https://archive.org/details/driitaleofdaring00bachuoft/page/360/mode/2up\n const [newLeft, , , ] = $((nextLine || prevLine).firstWord).attr(\"coords\").split(',').map(parseFloat);\n $(currWord).attr(\"coords\", `${newLeft},${bottom},${right},${top}`);\n }\n\n const wordEl = document.createElement('span');\n wordEl.setAttribute(\"class\", \"BRwordElement\");\n wordEl.textContent = currWord.textContent.trim();\n\n if (wordIndex > 0) {\n const space = document.createElement('span');\n space.classList.add('BRspace');\n space.textContent = ' ';\n lineEl.append(space);\n\n // Edge ignores empty elements (like BRspace), so add another\n // space to ensure Edge's ReadAloud works correctly.\n lineEl.appendChild(document.createTextNode(' '));\n }\n\n lineEl.appendChild(wordEl);\n }\n\n const hasHyphen = line.lastWord.textContent.trim().endsWith('-');\n const lastWordEl = lineEl.children[lineEl.children.length - 1];\n if (hasHyphen && !isLastLineOfParagraph) {\n lastWordEl.textContent = lastWordEl.textContent.trim().slice(0, -1);\n lastWordEl.classList.add('BRwordElement--hyphen');\n }\n\n paragEl.appendChild(lineEl);\n if (!isLastLineOfParagraph && !hasHyphen) {\n // Edge does not correctly have spaces between the lines.\n paragEl.appendChild(document.createTextNode(' '));\n }\n }\n\n wordHeightArr.sort((a, b) => a - b);\n const paragWordHeight = wordHeightArr[Math.floor(wordHeightArr.length * 0.85)] + 4;\n paragEl.style.left = `${paragLeft}px`;\n paragEl.style.top = `${paragTop}px`;\n paragEl.style.width = `${paragRight - paragLeft}px`;\n paragEl.style.height = `${paragBottom - paragTop}px`;\n paragEl.style.fontSize = `${paragWordHeight}px`;\n\n // Fix up sizes - stretch/crush words as necessary using letter spacing\n let wordRects = determineRealRects(paragEl, '.BRwordElement');\n const ocrWords = $(ocrParagraph).find(\"WORD\").toArray();\n const wordEls = paragEl.querySelectorAll('.BRwordElement');\n for (const [ocrWord, wordEl] of zip(ocrWords, wordEls)) {\n const realRect = wordRects.get(wordEl);\n const [left, , right ] = $(ocrWord).attr(\"coords\").split(',').map(parseFloat);\n let ocrWidth = right - left;\n // Some books (eg theworksofplato01platiala) have a space _inside_ the <WORD>\n // element. That makes it impossible to determine the correct positining\n // of everything, but to avoid the BRspace's being width 0, which makes selection\n // janky on Chrome Android, assume the space is the same width as one of the\n // letters.\n if (ocrWord.textContent.endsWith(' ')) {\n ocrWidth = ocrWidth * (ocrWord.textContent.length - 1) / ocrWord.textContent.length;\n }\n const diff = ocrWidth - realRect.width;\n wordEl.style.letterSpacing = `${diff / (ocrWord.textContent.length - 1)}px`;\n }\n\n // Stretch/crush lines as necessary using line spacing\n // Recompute rects after letter spacing\n wordRects = determineRealRects(paragEl, '.BRwordElement');\n const spaceRects = determineRealRects(paragEl, '.BRspace');\n\n const ocrLines = $(ocrParagraph).find(\"LINE[coords]\").toArray();\n const lineEls = Array.from(paragEl.querySelectorAll('.BRlineElement'));\n\n let ySoFar = paragTop;\n for (const [ocrLine, lineEl] of zip(ocrLines, lineEls)) {\n // shift words using marginLeft to align with the correct x position\n const words = $(ocrLine).find(\"WORD\").toArray();\n // const ocrLineLeft = Math.min(...words.map(w => parseFloat($(w).attr(\"coords\").split(',')[0])));\n let xSoFar = this.rtl ? paragRight : paragLeft;\n for (const [ocrWord, wordEl] of zip(words, lineEl.querySelectorAll('.BRwordElement'))) {\n // start of line, need to compute the offset relative to the OCR words\n const wordRect = wordRects.get(wordEl);\n const [ocrLeft, , ocrRight ] = $(ocrWord).attr(\"coords\").split(',').map(parseFloat);\n const diff = (this.rtl ? -(ocrRight - xSoFar) : ocrLeft - xSoFar);\n\n if (wordEl.previousElementSibling) {\n const space = wordEl.previousElementSibling;\n space.style.letterSpacing = `${diff - spaceRects.get(space).width}px`;\n } else {\n wordEl.style[this.rtl ? 'paddingRight' : 'paddingLeft'] = `${diff}px`;\n }\n if (this.rtl) xSoFar -= diff + wordRect.width;\n else xSoFar += diff + wordRect.width;\n }\n // And also fix y position\n const ocrLineTop = Math.min(...words.map(w => parseFloat($(w).attr(\"coords\").split(',')[3])));\n const diff = ocrLineTop - ySoFar;\n if (lineEl.previousElementSibling) {\n lineEl.previousElementSibling.style.lineHeight = `${diff}px`;\n ySoFar += diff;\n }\n }\n\n // The last line will have a line height subtracting from the paragraph height\n lineEls[lineEls.length - 1].style.lineHeight = `${paragBottom - ySoFar}px`;\n\n // Edge does not include a newline for some reason when copying/pasting the <p> els\n paragEl.appendChild(document.createElement('br'));\n return paragEl;\n }\n}\n\nexport class BookreaderWithTextSelection extends BookReader {\n init() {\n const options = Object.assign({}, DEFAULT_OPTIONS, this.options.plugins.textSelection);\n if (options.enabled) {\n this.textSelectionPlugin = new TextSelectionPlugin(options, this.options.vars, this.pageProgression);\n // Write this back; this way the plugin is the source of truth, and BR just\n // contains a reference to it.\n this.options.plugins.textSelection = options;\n this.textSelectionPlugin.init();\n\n new SelectionObserver('.BRtextLayer', (selectEvent) => {\n // Track how often selection is used\n if (selectEvent == 'started') {\n this.archiveAnalyticsSendEvent?.('BookReader', 'SelectStart');\n\n // Set a class on the page to avoid hiding it when zooming/etc\n this.refs.$br.find('.BRpagecontainer--hasSelection').removeClass('BRpagecontainer--hasSelection');\n $(window.getSelection().anchorNode).closest('.BRpagecontainer').addClass('BRpagecontainer--hasSelection');\n }\n }).attach();\n }\n\n super.init();\n }\n\n /**\n * @param {number} index\n */\n _createPageContainer(index) {\n const pageContainer = super._createPageContainer(index);\n // Disable if thumb mode; it's too janky\n // .page can be null for \"pre-cover\" region\n if (this.mode !== this.constModeThumb && pageContainer.page) {\n this.textSelectionPlugin?.createTextLayer(pageContainer);\n }\n return pageContainer;\n }\n}\nwindow.BookReader = BookreaderWithTextSelection;\nexport default BookreaderWithTextSelection;\n\n\n/**\n * @param {HTMLElement} parentEl\n * @param {string} selector\n * @returns {Map<Element, Rect>}\n */\nfunction determineRealRects(parentEl, selector) {\n const initals = {\n position: parentEl.style.position,\n visibility: parentEl.style.visibility,\n top: parentEl.style.top,\n left: parentEl.style.left,\n transform: parentEl.style.transform,\n };\n parentEl.style.position = 'absolute';\n parentEl.style.visibility = 'hidden';\n parentEl.style.top = '0';\n parentEl.style.left = '0';\n parentEl.style.transform = 'none';\n document.body.appendChild(parentEl);\n const rects = new Map(\n Array.from(parentEl.querySelectorAll(selector))\n .map(wordEl => {\n const origRect = wordEl.getBoundingClientRect();\n return [wordEl, new Rect(\n origRect.left + window.scrollX,\n origRect.top + window.scrollY,\n origRect.width,\n origRect.height,\n )];\n })\n );\n document.body.removeChild(parentEl);\n Object.assign(parentEl.style, initals);\n return rects;\n}\n\n/**\n * @param {HTMLElement} line\n */\nfunction augmentLine(line) {\n const words = $(line).find(\"WORD\").toArray();\n return {\n ocrElement: line,\n words,\n firstWord: words[0],\n lastWord: words[words.length - 1],\n };\n}\n\n/**\n * @template TFrom, TTo\n * Generator version of map\n * @param {Iterable<TFrom>} gen\n * @param {function(TFrom): TTo} fn\n * @returns {Iterable<TTo>}\n */\nexport function* genMap(gen, fn) {\n for (const x of gen) yield fn(x);\n}\n\n/**\n * @template T\n * Generator that provides a sliding window of 3 elements,\n * prev, current, and next.\n * @param {Iterable<T>} gen\n * @returns {Iterable<[T | undefined, T, T | undefined]>}\n */\nexport function* lookAroundWindow(gen) {\n let prev = undefined;\n let cur = undefined;\n let next = undefined;\n for (const x of gen) {\n if (typeof cur !== 'undefined') {\n next = x;\n yield [prev, cur, next];\n }\n prev = cur;\n cur = x;\n next = undefined;\n }\n\n if (typeof cur !== 'undefined') {\n yield [prev, cur, next];\n }\n}\n\n/**\n * @template T1, T2\n * Lazy zip implementation to avoid importing lodash\n * Expects iterators to be of the same length\n * @param {Iterable<T1>} gen1\n * @param {Iterable<T2>} gen2\n * @returns {Iterable<[T1, T2]>}\n */\nexport function* zip(gen1, gen2) {\n const it1 = gen1[Symbol.iterator]();\n const it2 = gen2[Symbol.iterator]();\n while (true) {\n const r1 = it1.next();\n const r2 = it2.next();\n if (r1.done && r2.done) {\n return;\n }\n if (r1.done || r2.done) {\n throw new Error('zip: one of the iterators is done');\n }\n yield [r1.value, r2.value];\n }\n}\n\n/**\n * [left, bottom, right, top]\n * @param {Array<[number, number, number, number]>} bounds\n * @returns {[number, number, number, number]}\n */\nfunction determineBounds(bounds) {\n let leftMost = Infinity;\n let bottomMost = -Infinity;\n let rightMost = -Infinity;\n let topMost = Infinity;\n\n for (const [left, bottom, right, top] of bounds) {\n leftMost = Math.min(leftMost, left);\n bottomMost = Math.max(bottomMost, bottom);\n rightMost = Math.max(rightMost, right);\n topMost = Math.min(topMost, top);\n }\n\n return [leftMost, bottomMost, rightMost, topMost];\n}\n\n/**\n * Recursively traverses the XML tree and adds coords\n * which are the bounding box of all child coords\n * @param {Element} xmlEl\n */\nfunction recursivelyAddCoords(xmlEl) {\n if ($(xmlEl).attr('coords') || !xmlEl.children) {\n return;\n }\n\n const children = $(xmlEl).children().toArray();\n if (children.length === 0) {\n return;\n }\n\n for (const child of children) {\n recursivelyAddCoords(child);\n }\n\n const childCoords = [];\n\n for (const child of children) {\n if (!$(child).attr('coords')) continue;\n childCoords.push($(child).attr('coords').split(',').map(parseFloat));\n }\n\n const boundingCoords = determineBounds(childCoords);\n if (Math.abs(boundingCoords[0]) != Infinity) {\n $(xmlEl).attr('coords', boundingCoords.join(','));\n }\n}\n\n/**\n * Basically a polyfill for the native DOMRect class\n */\nclass Rect {\n /**\n * @param {number} x\n * @param {number} y\n * @param {number} width\n * @param {number} height\n */\n constructor(x, y, width, height) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }\n\n get right() { return this.x + this.width; }\n get bottom() { return this.y + this.height; }\n get top() { return this.y; }\n get left() { return this.x; }\n}\n","var global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toString = require('../internals/to-string');\nvar trim = require('../internals/string-trim').trim;\nvar whitespaces = require('../internals/whitespaces');\n\nvar charAt = uncurryThis(''.charAt);\nvar $parseFloat = global.parseFloat;\nvar Symbol = global.Symbol;\nvar ITERATOR = Symbol && Symbol.iterator;\nvar FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity\n // MS Edge 18- broken with boxed symbols\n || (ITERATOR && !fails(function () { $parseFloat(Object(ITERATOR)); }));\n\n// `parseFloat` method\n// https://tc39.es/ecma262/#sec-parsefloat-string\nmodule.exports = FORCED ? function parseFloat(string) {\n var trimmedString = trim(toString(string));\n var result = $parseFloat(trimmedString);\n return result === 0 && charAt(trimmedString, 0) == '-' ? -0 : result;\n} : $parseFloat;\n","var PROPER_FUNCTION_NAME = require('../internals/function-name').PROPER;\nvar fails = require('../internals/fails');\nvar whitespaces = require('../internals/whitespaces');\n\nvar non = '\\u200B\\u0085\\u180E';\n\n// check that a method works with the correct list\n// of whitespaces and has a correct name\nmodule.exports = function (METHOD_NAME) {\n return fails(function () {\n return !!whitespaces[METHOD_NAME]()\n || non[METHOD_NAME]() !== non\n || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);\n });\n};\n","var $ = require('../internals/export');\nvar $parseFloat = require('../internals/number-parse-float');\n\n// `parseFloat` method\n// https://tc39.es/ecma262/#sec-parsefloat-string\n$({ global: true, forced: parseFloat != $parseFloat }, {\n parseFloat: $parseFloat\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar $trim = require('../internals/string-trim').trim;\nvar forcedStringTrimMethod = require('../internals/string-trim-forced');\n\n// `String.prototype.trim` method\n// https://tc39.es/ecma262/#sec-string.prototype.trim\n$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {\n trim: function trim() {\n return $trim(this);\n }\n});\n"],"names":["SelectionObserver","selector","handler","_this","_classCallCheck","_defineProperty","sel","window","getSelection","selecting","toString","target","$","anchorNode","closest","isCollapsed","this","key","value","document","addEventListener","_onSelectionChange","removeEventListener","applyVariables","template","vars","overrides","arguments","length","undefined","possibleFilters","APPLY_FILTERS","replace","$0","$1","_expression$split$map2","split","map","x","trim","varName","filterNames","slice","n","reduce","acc","cur","urlencode","encodeURIComponent","genMap","_marked2","_regeneratorRuntime","mark","lookAroundWindow","_marked3","zip","_get","Reflect","get","bind","property","receiver","base","object","Object","prototype","hasOwnProperty","call","_getPrototypeOf","_superPropBase","desc","getOwnPropertyDescriptor","apply","_setPrototypeOf","o","p","setPrototypeOf","__proto__","getPrototypeOf","_slicedToArray","arr","i","Array","isArray","_arrayWithHoles","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","err","return","_iterableToArrayLimit","_unsupportedIterableToArray","TypeError","_nonIterableRest","_createForOfIteratorHelper","allowArrayLike","it","F","s","e","_e2","f","normalCompletion","didErr","step","_e3","minLen","_arrayLikeToArray","constructor","name","from","test","len","arr2","exports","Op","hasOwn","defineProperty","obj","$Symbol","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","enumerable","configurable","writable","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","makeInvokeMethod","tryCatch","fn","arg","type","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","method","_invoke","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","_typeof","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","state","Error","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","methodName","info","resultName","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","doneResult","displayName","isGeneratorFunction","genFun","ctor","awrap","async","Promise","iter","keys","val","reverse","pop","skipTempReset","prev","charAt","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","catch","thrown","delegateYield","asyncGeneratorStep","gen","_next","_throw","_asyncToGenerator","args","instance","Constructor","_defineProperties","props","descriptor","_toPropertyKey","_createClass","protoProps","staticProps","input","hint","prim","toPrimitive","res","String","_toPrimitive","BookReader","DEFAULT_OPTIONS","enabled","fullDjvuXmlUrl","singlePageDjvuXmlUrl","jsonp","Cache","maxSize","entries","shift","TextSelectionPlugin","options","optionVariables","pageProgression","textSelectingMode","concat","defaultMode","djvuPagesPromise","rtl","pageTextCache","maxWordRendered","selectionObserver","_createTextLayer","_getPageText","attach","ajax","url","dataType","cache","xmlMap","parseXML","find","_callee","index","cachedEntry","xmlDoc","XMLpagesArr","_context","response","pageIndex","add","t0","$container","event","selection","clipboardData","setData","preventDefault","textLayer","_this2","$pageContainer","style","pointerEvents","css","off","startedMouseDown","mouseIsDown","skipNextMouseup","on","is","stopPropagation","_this3","_this4","$textLayer","each","interceptCopy","_callee2","pageContainer","XMLpage","totalWords","ratioW","ratioH","ocrParagraphs","paragEls","paragraphRects","yAdded","_iterator","_step","_step$value","ocrParagraph","paragEl","ocrParagBounds","realRect","_ocrParagBounds","ocrLeft","ocrRight","ocrTop","newStartMargin","newTop","_this5","_context2","page","getPageText","recursivelyAddCoords","console","log","createDIVPageLayer","parseFloat","width","height","transform","setAttribute","toArray","el","renderParagraph","appendChild","determineRealRects","attr","right","left","top","marginTop","append","stopPageFlip","_x2","createElement","classList","_$$attr$split$map2","paragLeft","paragBottom","paragRight","paragTop","wordHeightArr","lines","_step2","_iterator2","augmentLine","_step2$value","prevLine","line","nextLine","isLastLineOfParagraph","ocrElement","lineEl","_step5","_iterator5","words","_step5$value","wordIndex","currWord","_$$attr$split$map4","bottom","wordHeight","lastWord","textContent","endsWith","newLeft","firstWord","wordEl","space","createTextNode","hasHyphen","lastWordEl","children","sort","a","b","paragWordHeight","Math","floor","fontSize","_step3","wordRects","_iterator3","querySelectorAll","_step3$value","ocrWord","_$$attr$split$map8","ocrWidth","diff","letterSpacing","_step4","spaceRects","ocrLines","lineEls","ySoFar","_iterator4","_step6","_step4$value","ocrLine","xSoFar","_iterator6","_step6$value","wordRect","_$$attr$split$map10","previousElementSibling","min","_arrayWithoutHoles","w","_iterableToArray","_nonIterableSpread","lineHeight","BookreaderWithTextSelection","_BookReader","subClass","superClass","_inherits","Derived","hasNativeReflectConstruct","_super","construct","sham","Proxy","Boolean","valueOf","_isNativeReflectConstruct","Super","NewTarget","ReferenceError","_assertThisInitialized","_possibleConstructorReturn","_this6","assign","plugins","textSelection","textSelectionPlugin","init","selectEvent","_this6$archiveAnalyti","archiveAnalyticsSendEvent","refs","$br","removeClass","addClass","_this$textSelectionPl","mode","constModeThumb","createTextLayer","parentEl","initals","position","visibility","body","rects","Map","origRect","getBoundingClientRect","Rect","scrollX","scrollY","removeChild","_iterator7","_step7","_context3","_marked","_iterator8","_step8","_context4","gen1","gen2","it1","it2","r1","r2","_context5","xmlEl","_step10","_iterator10","_step11","childCoords","_iterator11","child","boundingCoords","bounds","_step9","leftMost","Infinity","bottomMost","rightMost","topMost","_iterator9","_step9$value","max","determineBounds","abs","join","y","global","fails","uncurryThis","whitespaces","$parseFloat","ITERATOR","FORCED","module","string","trimmedString","PROPER_FUNCTION_NAME","METHOD_NAME","forced","$trim","proto","forcedStringTrimMethod"],"sourceRoot":""}