@internetarchive/bookreader 5.0.0-120 → 5.0.0-121
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BookReader/ia-bookreader.js +1 -1
- package/BookReader/plugins/plugin.text_selection.js +1 -1
- package/BookReader/plugins/plugin.text_selection.js.map +1 -1
- package/BookReader/plugins/plugin.translate.js +1 -1
- package/BookReader/plugins/plugin.translate.js.map +1 -1
- package/dist/esm/ia-bookreader.js +1 -1
- package/dist/esm/plugins/plugin.text_selection.js +1 -1
- package/dist/esm/plugins/plugin.text_selection.js.map +1 -1
- package/dist/esm/plugins/plugin.translate.js +1 -1
- package/dist/esm/plugins/plugin.translate.js.map +1 -1
- package/package.json +1 -1
- package/src/plugins/plugin.text_selection.js +1 -1
- package/src/util/TextSelectionManager.js +15 -8
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see plugin.text_selection.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[326],{5703:function(e,t,n){var r=n(1354),o=n.n(r),i=n(6314),a=n.n(i)()(o());a.push([e.id,'.BRtextLayer,.BRtranslateLayer{z-index:2;position:absolute;top:0;left:0;color:rgba(0,0,0,0);transform-origin:0 0;pointer-events:none;cursor:text}.BRtextLayer{mix-blend-mode:multiply}.BRtranslateLayer{hyphens:auto}.BRparagraphElement{margin:0;cursor:text;font-family:Georgia,serif;line-height:0}.BRlineElement{pointer-events:all;white-space:nowrap;display:inline-block}.BRtextLayer[dir=ltr] .BRlineElement{margin-right:100%}.BRtextLayer[dir=rtl] .BRlineElement{margin-left:100%}.BRwordElement::selection,.BRspace::selection,.BRparagraphElement::selection,.BRparagraphElement br::selection{background:hsla(210,74%,62%,.4)}.BRwordElement::-moz-selection,.BRspace::-moz-selection,.BRparagraphElement::-moz-selection,.BRparagraphElement br::-moz-selection{background:hsla(210,74%,62%,.4);color:rgba(0,0,0,0)}.BRtranslateLayer ::selection{background:hsla(210,74%,62%,.4)}.BRtranslateLayer ::-moz-selection{background:hsla(210,74%,62%,.4)}.BRparagraphElement br{visibility:hidden}.BRwordElement--hyphen::after{content:"-"}.BRsmooth-zooming .BRpagecontainer:not(.BRpagecontainer--hasSelection):not(:has(hypothesis-highlight)):not(:has(.BRhighlight)) .BRtextLayer,.BRscrolling-active .BRpagecontainer:not(.BRpagecontainer--hasSelection):not(:has(hypothesis-highlight)):not(:has(.BRhighlight)) .BRtextLayer{display:none}.BRmode1up .BRpagecontainer:not(.BRpage-visible) .BRtextLayer{display:none}.BRpagecontainer img{-webkit-user-select:none;-moz-user-select:none;user-select:none}.BRtextLayer:has([_istranslated="1"],msreadoutspan){mix-blend-mode:normal}.BRwordElement[_istranslated="1"],.BRwordElement[_msttexthash],.BRspace[_istranslated="1"],.BRspace[_msttexthash]{color:#000;letter-spacing:unset !important}.BRlineElement:has([_istranslated="1"],[_msttexthash]){background:rgba(248,237,192,.8);backdrop-filter:blur(8px);color:#000;text-align:justify;width:inherit}.BRlineElement:has([_istranslated="1"],[_msttexthash]):not(:nth-last-child(2)){text-align-last:justify}.BRlineElement[_msttexthash]{word-spacing:unset !important}.BRtranslateLayer .BRparagraphElement{pointer-events:auto;overflow-y:auto;background:rgba(248,237,192,.8);backdrop-filter:blur(8px);color:#000;line-height:1em;text-align:justify}.BRtranslateLayer .BRparagraphElement .BRlineElement{white-space:break-spaces;display:inline-block}.BRtextLayer.showingTranslation{display:none}.BRtranslateLayer .BRparagraphElement.BRtranslateHidden{display:none}.br-select-menu__root{display:none;color:#fff;color-scheme:dark;padding:2px;overflow:hidden;opacity:1;transition:opacity .2s;gap:5px}.br-select-menu__root[open]{display:flex}.br-select-menu__root[showextended]{display:block;gap:0px;background-color:#333;border-radius:10px}@starting-style{.br-select-menu__root{opacity:0}}.br-select-menu__root--scrolling{opacity:0;pointer-events:none}.br-select-menu__option{--iconWidth: 15px;--iconHeight: 15px;--iconFillColor: currentColor;background:rgba(0,0,0,0);display:flex;align-items:center;border-radius:25px;font-family:inherit;color:inherit;border:0;cursor:pointer;text-wrap:nowrap;background-color:#333;position:relative}@media(pointer: coarse)and (hover: none){.br-select-menu__option{padding:4px 8px}#br-select-more .br-select-menu__option{padding:4px}}.br-select-menu__option:hover:after{position:absolute;left:2px;right:2px;top:2px;bottom:2px;content:"";pointer-events:none;background-color:rgba(255,255,255,.1);border-radius:23px}.br-select-menu__root[showextended] .br-select-menu__option{width:100%}.br-select-menu__root[showextended] .br-select-menu__option:hover:after{border-radius:8px}.br-select-menu__icon{display:block;flex-shrink:0;width:17px;height:17px;padding:2px}.br-select-menu__label{margin-left:4px;font-size:12px;margin-right:4px}@media(hover: hover){.br-select-menu__option{padding:4px}.br-select-menu__label{width:0px;margin:0;opacity:0;interpolate-size:allow-keywords;transition:width .2s}.br-select-menu__root:hover .br-select-menu__label{width:auto;margin:0 4px;opacity:1}}.BRtextLayer .BRhighlight{background-color:#ff0;pointer-events:all;color:rgba(0,0,0,0)}@keyframes highlightTargetFlash{to{background-color:hsl(45,80%,66%)}}.BRtextLayer .BRhighlight--target-text,.BRtextLayer ::target-text{background-color:hsla(45,80%,66%,.6);color:rgba(0,0,0,0);animation:highlightTargetFlash 600ms 1 reverse}',"",{version:3,sources:["webpack://./src/css/_TextSelection.scss"],names:[],mappings:"AAAA,+BACI,SAAA,CACA,iBAAA,CACA,KAAA,CACA,MAAA,CACA,mBAAA,CACA,oBAAA,CAEA,mBAAA,CACA,WAAA,CAGJ,aACI,uBAAA,CAGJ,kBACI,YAAA,CAGJ,oBACI,QAAA,CACA,WAAA,CACA,yBAAA,CACA,aAAA,CAGJ,eACI,kBAAA,CACA,kBAAA,CACA,oBAAA,CASA,qCAAA,iBAAA,CACA,qCAAA,gBAAA,CAMA,+GACI,+BAAA,CAGJ,mIACI,+BAAA,CACA,mBAAA,CAIR,8BACI,+BAAA,CAGJ,mCACI,+BAAA,CAGJ,uBACI,iBAAA,CAKJ,8BACI,WAAA,CAMA,0RACI,YAAA,CAKR,8DACI,YAAA,CAIJ,qBACI,wBAAA,CACA,qBAAA,CACA,gBAAA,CAOJ,oDACI,qBAAA,CAIA,kHACI,UAAA,CACA,+BAAA,CAIR,uDACI,+BAAA,CACA,yBAAA,CACA,UAAA,CACA,kBAAA,CACA,aAAA,CACA,+EACI,uBAAA,CAIR,6BACI,6BAAA,CAGJ,sCACI,mBAAA,CACA,eAAA,CACA,+BAAA,CACA,yBAAA,CACA,UAAA,CACA,eAAA,CACA,kBAAA,CAGJ,qDACI,wBAAA,CACA,oBAAA,CAGJ,gCACI,YAAA,CAGJ,wDACI,YAAA,CAMJ,sBACE,YAAA,CACA,UAAA,CACA,iBAAA,CACA,WAAA,CACA,eAAA,CACA,SAAA,CACA,sBAAA,CACA,OAAA,CAEA,4BACE,YAAA,CAGF,oCACE,aAAA,CACA,OAAA,CACA,qBAAA,CACA,kBAnB0B,CAsB5B,gBArBF,sBAsBI,SAAA,CAAA,CAGJ,iCACE,SAAA,CACA,mBAAA,CAGF,wBACE,iBAAA,CACA,kBAAA,CACA,6BAAA,CACA,wBAAA,CACA,YAAA,CACA,kBAAA,CACA,kBAvCmB,CAwCnB,mBAAA,CACA,aAAA,CACA,QAAA,CACA,cAAA,CACA,gBAAA,CACA,qBAAA,CACA,iBAAA,CAEA,yCAhBF,wBAiBI,eAAA,CACA,wCACI,WAAA,CAAA,CAIN,oCACE,iBAAA,CACA,QAAA,CACA,SAAA,CACA,OAAA,CACA,UAAA,CACA,UAAA,CACA,mBAAA,CACA,qCAAA,CACA,kBAAA,CAGF,4DACI,UAAA,CACA,wEACE,iBAAA,CAKR,sBACE,aAAA,CACA,aAAA,CACA,UAAA,CACA,WAAA,CACA,WAAA,CAGF,uBACE,eAAA,CACA,cAAA,CACA,gBAAA,CAGF,qBACI,wBACI,WAAA,CAEJ,uBACI,SAAA,CACA,QAAA,CACA,SAAA,CACA,+BAAA,CACA,oBAAA,CAEJ,mDACI,UAAA,CACA,YAAA,CACA,SAAA,CAAA,CAIR,0BACI,qBAAA,CACA,kBAAA,CACA,mBAAA,CAGJ,gCACE,GAAA,gCAAA,CAAA,CAIF,kEAEI,oCAAA,CACA,mBAAA,CACA,8CAAA",sourcesContent:['.BRtextLayer, .BRtranslateLayer {\n z-index: 2;\n position: absolute;\n top: 0;\n left: 0;\n color: transparent;\n transform-origin: 0 0;\n // Make it so right-clicking on "blank" part of text layer sends events to the image (for saving)\n pointer-events: none;\n cursor: text;\n}\n\n.BRtextLayer {\n mix-blend-mode: multiply;\n}\n\n.BRtranslateLayer {\n hyphens: auto;\n}\n\n.BRparagraphElement {\n margin: 0;\n cursor: text;\n font-family: Georgia, serif;\n line-height: 0;\n}\n\n.BRlineElement {\n pointer-events: all;\n white-space: nowrap;\n display: inline-block;\n\n // We use display: inline-block, otherwise this causes every line\n // to have newlines at the end in safari. BUT, since they\'re inline,\n // if the OCR has to short line in the same paragraph, they can wrap\n // and one can go onto the other. This adds an arbitrary margin to\n // the right of each line, forcing things to wrap.\n // See eg https://www-drini.archive.org/details/countofmontecris00duma_7/page/261/mode/2up\n // Page 261, second last line on the page.\n .BRtextLayer[dir=ltr] & { margin-right: 100%; }\n .BRtextLayer[dir=rtl] & { margin-left: 100%; }\n}\n\n// Highlight colors for text selection layer\n.BRwordElement, .BRspace, .BRparagraphElement, .BRparagraphElement br {\n // these 2 properties do not work if joined\n &::selection {\n background: hsla(210, 74%, 62%, 0.4);\n }\n\n &::-moz-selection {\n background: hsla(210, 74%, 62%, 0.4);\n color:transparent;\n }\n}\n\n.BRtranslateLayer ::selection {\n background: hsla(210, 74%, 62%, 0.4);\n}\n\n.BRtranslateLayer ::-moz-selection {\n background: hsla(210, 74%, 62%, 0.4);\n}\n\n.BRparagraphElement br {\n visibility: hidden;\n}\n\n// Use CSS pseudo-elements to render the hyphens. This makes them\n// not selectable, so copy/pasting text doesn\'t include them.\n.BRwordElement--hyphen::after {\n content: "-";\n}\n\n// Hide text layer for performance during zooming & scrolling\n.BRsmooth-zooming, .BRscrolling-active {\n // If the text layer has an annotation, don\'t hide it\n .BRpagecontainer:not(.BRpagecontainer--hasSelection):not(:has(hypothesis-highlight)):not(:has(.BRhighlight)) .BRtextLayer {\n display: none;\n }\n}\n\n// Hide text selection layers of off-screen pages\n.BRmode1up .BRpagecontainer:not(.BRpage-visible) .BRtextLayer {\n display: none;\n}\n\n// Makes page image unselectable\n.BRpagecontainer img {\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n\n\n// These are Microsoft Edge specific fixed to make some of the\n// browsers features work well. These are for the in-place\n// translation.\n.BRtextLayer:has([_istranslated="1"], msreadoutspan) {\n mix-blend-mode: normal;\n}\n\n.BRwordElement, .BRspace {\n &[_istranslated="1"], &[_msttexthash] {\n color: black;\n letter-spacing: unset !important;\n }\n}\n\n.BRlineElement:has([_istranslated="1"], [_msttexthash]) {\n background: rgba(248, 237, 192, 0.8);\n backdrop-filter: blur(8px);\n color: black;\n text-align: justify;\n width: inherit;\n &:not(:nth-last-child(2)) {\n text-align-last: justify;\n }\n}\n\n.BRlineElement[_msttexthash] {\n word-spacing: unset !important;\n}\n\n.BRtranslateLayer .BRparagraphElement {\n pointer-events: auto;\n overflow-y: auto;\n background: rgba(248, 237, 192, 0.8);\n backdrop-filter: blur(8px);\n color:black;\n line-height: 1em;\n text-align: justify;\n}\n\n.BRtranslateLayer .BRparagraphElement .BRlineElement {\n white-space: break-spaces;\n display: inline-block;\n}\n\n.BRtextLayer.showingTranslation {\n display: none;\n}\n\n.BRtranslateLayer .BRparagraphElement.BRtranslateHidden {\n display: none;\n}\n\n\n$select-menu-radius: 25px;\n$select-menu-extended-radius: 10px;\n.br-select-menu__root {\n display: none;\n color: white;\n color-scheme: dark;\n padding: 2px;\n overflow: hidden;\n opacity: 1;\n transition: opacity 0.2s;\n gap: 5px;\n\n &[open] {\n display: flex;\n }\n\n &[showextended] {\n display: block;\n gap: 0px;\n background-color: #333;\n border-radius: $select-menu-extended-radius;\n }\n\n @starting-style {\n opacity: 0;\n }\n}\n.br-select-menu__root--scrolling {\n opacity: 0;\n pointer-events: none;\n}\n\n.br-select-menu__option {\n --iconWidth: 15px;\n --iconHeight: 15px;\n --iconFillColor: currentColor;\n background: transparent;\n display: flex;\n align-items: center;\n border-radius: $select-menu-radius;\n font-family: inherit;\n color: inherit;\n border: 0;\n cursor: pointer;\n text-wrap: nowrap;\n background-color: #333;\n position: relative;\n\n @media (pointer: coarse) and (hover: none) {\n padding: 4px 8px;\n #br-select-more & {\n padding: 4px;\n }\n }\n\n &:hover:after {\n position: absolute;\n left: 2px;\n right: 2px;\n top: 2px;\n bottom: 2px;\n content: "";\n pointer-events: none;\n background-color: rgba(255, 255, 255, 0.1);\n border-radius: calc($select-menu-radius - 2px);\n }\n\n .br-select-menu__root[showextended] & {\n width:100%;\n &:hover:after {\n border-radius: calc($select-menu-extended-radius - 2px);\n }\n }\n}\n\n.br-select-menu__icon {\n display: block;\n flex-shrink: 0;\n width: 17px;\n height: 17px;\n padding: 2px;\n}\n\n.br-select-menu__label {\n margin-left: 4px;\n font-size: 12px;\n margin-right: 4px;\n}\n\n@media (hover: hover) {\n .br-select-menu__option {\n padding: 4px;\n }\n .br-select-menu__label {\n width: 0px;\n margin: 0;\n opacity: 0;\n interpolate-size: allow-keywords;\n transition: width 0.2s;\n }\n .br-select-menu__root:hover .br-select-menu__label {\n width: auto;\n margin: 0 4px;\n opacity: 1;\n }\n}\n\n.BRtextLayer .BRhighlight {\n background-color: yellow;\n pointer-events: all;\n color: transparent;\n}\n\n@keyframes highlightTargetFlash {\n to { background-color: hsla(45, 80%, 66%, 1); }\n}\n\n// Style URI TextFragments, eg ?text=example\n.BRtextLayer .BRhighlight--target-text, .BRtextLayer ::target-text {\n // Similar colour to the default one used in Safari, Firefox. Note Chrome uses a purple colour\n background-color: hsla(45, 80%, 66%, 0.6);\n color: transparent;\n animation: highlightTargetFlash 600ms 1 reverse;\n}\n'],sourceRoot:""}]),t.A=a.toString()},6314:function(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var l=0;l<this.length;l++){var s=this[l][0];null!=s&&(a[s]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&a[u[0]]||(void 0!==i&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},1354:function(e){e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),i="/*# ".concat(o," */");return[t].concat([i]).join("\n")}return[t].join("\n")}},706:function(e,t,n){var r=n(350).PROPER,o=n(9039),i=n(7452);e.exports=function(e){return o(function(){return!!i[e]()||"
"!=="
"[e]()||r&&i[e].name!==e})}},2762:function(e,t,n){var r=n(6518),o=n(3802).Bq;r({target:"String",proto:!0,forced:n(706)("trim")},{trim:function(){return o(this)}})},1041:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}n.d(t,{S:function(){return a}}),n(2675),n(9463),n(2259),n(5700),n(3792),n(9572),n(2892),n(9085),n(6099),n(7764),n(2953);var a=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.br=t,this.options},(t=[{key:"setup",value:function(e){this.options=Object.assign({},this.options,e)}},{key:"init",value:function(){}},{key:"_configurePageContainer",value:function(e){}},{key:"_configureToolbar",value:function(e){}},{key:"_bindNavigationHandlers",value:function(){}},{key:"extendNavBar",value:function(e){}}])&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}()},296:function(e,t,n){n(2675),n(9463),n(2259),n(5700),n(8706),n(2008),n(113),n(3418),n(3792),n(8598),n(2062),n(4782),n(6910),n(9572),n(2010),n(6033),n(2892),n(9085),n(875),n(6099),n(8459),n(3362),n(825),n(7495),n(8781),n(9449),n(7764),n(5746),n(2762),n(2953),n(8408);var r=n(4907),o=n(1041),i=n(9073),a=n(4565),l=n(4160),s=n(7279),c=n(1989),u=n(5703),d=n(1669);function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function f(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||g(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=g(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||g(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){if(e){if("string"==typeof e)return y(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function v(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return b(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,h.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=h.p,p=i[2];n>3?(o=p===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,h.v=r,h.n=i[1]):f<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,h.n=p,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,p),l=u,s=p;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(h.n=-1),f(l,s)):h.n=s:h.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=h.n<0)?s:n.call(r,h))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(b(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,b(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,b(d,"constructor",c),b(c,"constructor",s),s.displayName="GeneratorFunction",b(c,o,"GeneratorFunction"),b(d),b(d,o,"Generator"),b(d,r,function(){return this}),b(d,"toString",function(){return"[object Generator]"}),(v=function(){return{w:i,m:h}})()}function b(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}b=function(e,t,n,r){function i(t,n){b(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},b(e,t,n,r)}function A(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function k(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){A(i,r,o,a,l,"next",e)}function l(e){A(i,r,o,a,l,"throw",e)}a(void 0)})}}function w(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,T(r.key),r)}}function x(e,t,n){return t&&C(e.prototype,t),n&&C(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(S=function(){return!!e})()}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function B(e,t){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},B(e,t)}function R(e,t,n){return(t=T(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T(e){var t=function(e){if("object"!=h(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==h(t)?t:t+""}var _=window.BookReader,j=function(e){function t(e){var n,r,o,i;return w(this,t),R((r=this,i=[e],o=E(o=t),n=function(e,t){if(t&&("object"==h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(r,S()?Reflect.construct(o,i||[],E(r).constructor):o.apply(r,i))),"options",{enabled:!0,fullDjvuXmlUrl:null,singlePageDjvuXmlUrl:null,jsonp:!1,maxProtectedWords:200}),R(n,"djvuPagesPromise",null),R(n,"pageTextCache",new a.l),R(n,"maxWordRendered",2500),R(n,"_jumpedToHighlight",!1),R(n,"_measurementDocument",void 0),n.rtl="rl"===n.br.pageProgression,n.textSelectionManager=new s.bg(".BRtextLayer",n.br,{selectionElement:[".BRwordElement",".BRspace","mark"]},n.options.maxProtectedWords),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&B(e,t)}(t,e),x(t,[{key:"init",value:function(){var e=this;if(this.options.enabled){var t=document.createElement("iframe");t.setAttribute("aria-hidden","true"),t.tabIndex=-1,t.style.cssText="position:fixed; top:-99999px; left:-99999px; width:2000px; height:4000px; border:0; visibility:hidden;",document.body.appendChild(t),this._measurementDocument=t.contentDocument;var n=this._measurementDocument.createElement("style");n.textContent=u.A,this._measurementDocument.head.appendChild(n),this.br.on("pageVisible",function(t,n){var r=n.pageContainerEl,o=r.querySelector(".BRtextLayer");o&&e.br.trigger("textLayerVisible",{pageContainerEl:r,textLayer:o})}),this.loadData(),this.textSelectionManager.init();var r=new URLSearchParams(location.search).get("text");r&&(this.br.targetTextFragment=s.yc.fromString(r,this.br.book,this.br.firstIndex),this.initTextFragment())}}},{key:"initTextFragment",value:(g=k(v().m(function e(){var t,n,r,o=this;return v().w(function(e){for(;;)switch(e.n){case 0:if(!(r=this.br.options.verifyTextFragment)){e.n=2;break}return e.n=1,this.br.options.verifyTextFragment(this.br.targetTextFragment);case 1:r=!e.v;case 2:if(!r){e.n=3;break}return e.a(2);case 3:if(t=this.br.targetTextFragment,this.br.on("textLayerVisible",function(){var e=k(v().m(function e(n,r){var i,a,l;return v().w(function(e){for(;;)switch(e.n){case 0:i=r.pageContainerEl,a=r.textLayer,t.pageIndex===parseFloat(i.getAttribute("data-index"))&&(l=(0,s.lB)(a,t,"BRhighlight--target-text"),o._jumpedToHighlight||(o.br.scrollIntoView(l[0],{behavior:"smooth",block:"center"}),o._jumpedToHighlight=!0));case 1:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}()),(n=this.br.book.getPage(this.br.targetTextFragment.pageIndex)).isViewable){e.n=5;break}return e.n=4,this.br.requestPage(n);case 4:this.br.jumpToIndex(n.index,{ariaLive:!0,allowUnviewable:!0});case 5:return e.a(2)}},e,this)})),function(){return g.apply(this,arguments)})},{key:"_configurePageContainer",value:function(e){var t;return this.options.enabled&&this.br.mode!==this.br.constModeThumb&&null!==(t=e.page)&&void 0!==t&&t.isViewable&&this.createTextLayer(e),e}},{key:"loadData",value:function(){this.options.singlePageDjvuXmlUrl||(this.djvuPagesPromise=d.ajax({type:"GET",url:(0,i.gT)(this.options.fullDjvuXmlUrl,this.br.options.vars),dataType:this.options.jsonp?"jsonp":"html",cache:!0,xhrFields:{withCredentials:this.br.protected},error:function(e){}}).then(function(e){try{var t=d.parseXML(e);return t&&d(t).find("OBJECT")}catch(e){return}}))}},{key:"getPageText",value:(o=k(v().m(function e(t){var n,r,o,a,l;return v().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this.options.singlePageDjvuXmlUrl){e.n=5;break}if(!(n=this.pageTextCache.entries.find(function(e){return e.index==t}))){e.n=1;break}return e.a(2,n.response);case 1:return e.n=2,d.ajax({type:"GET",url:(0,i.gT)(this.options.singlePageDjvuXmlUrl,this.br.options.vars,{pageIndex:t}),dataType:this.options.jsonp?"jsonp":"html",cache:!0,xhrFields:{withCredentials:this.br.protected},error:function(e){}});case 2:return r=e.v,e.p=3,o=d.parseXML(r),a=o&&d(o).find("OBJECT")[0],this.pageTextCache.add({index:t,response:a}),e.a(2,a);case 4:return e.p=4,e.v,e.a(2,void 0);case 5:return e.n=6,this.djvuPagesPromise;case 6:if(!(l=e.v)){e.n=7;break}return e.a(2,l[t]);case 7:return e.a(2)}},e,this,[[3,4]])})),function(e){return o.apply(this,arguments)})},{key:"createTextLayer",value:(n=k(v().m(function e(t){var n,o,i,a,s,u,h,f,g,y,b,A,k,w,C,x,S,E,B,R,T,_,j,I,P,N=this;return v().w(function(e){for(;;)switch(e.n){case 0:if(n=t.page.index,!(o=t.$container).find(".BRtextLayer").length){e.n=1;break}return e.a(2);case 1:return e.n=2,this.getPageText(n);case 2:if(i=e.v){e.n=3;break}return e.a(2);case 3:if(d(i).find("WORD").filter(function(e,t){var n=m(t.getAttribute("coords").split(",").map(parseFloat),4),r=n[0],o=n[3];if(0==r&&0==o)return console.error("Found invalid ocr word coordinates"),!0}).remove(),L(i),!((a=d(i).find("WORD").length)>this.maxWordRendered)){e.n=4;break}return console.log("Page ".concat(n," has too many words (").concat(a," > ").concat(this.maxWordRendered,"). Not rendering text layer.")),e.a(2);case 4:return s=(0,r.Ql)(t.page,"BRtextLayer"),e.n=5,Promise.resolve();case 5:u=parseFloat(t.$container[0].style.width)/t.page.width,h=parseFloat(t.$container[0].style.height)/t.page.height,s.style.transform="scale(".concat(u,", ").concat(h,")"),(f=(0,l.YH)(this.br.options.bookLanguage))&&s.setAttribute("lang",f),s.setAttribute("dir",this.rtl?"rtl":"ltr"),g=d(i).find("PARAGRAPH[coords]").toArray(),y=g.map(function(e){var t=N.renderParagraph(e);return s.appendChild(t),t}),b=O(s,".BRparagraphElement",this._measurementDocument),A=0,k=p((0,c.yU)(g,y));try{for(k.s();!(w=k.n()).done;)C=m(w.value,2),x=C[0],S=C[1],E=d(x).attr("coords").split(",").map(parseFloat),B=b.get(S),R=m(E,4),T=R[0],_=R[2],j=R[3],I=this.rtl?B.right-_:T-B.left,P=j-(B.top+A),S.style[this.rtl?"marginRight":"marginLeft"]="".concat(I,"px"),S.style.marginTop="".concat(P,"px"),A+=P,s.appendChild(S),s.appendChild(document.createTextNode("\n"))}catch(e){k.e(e)}finally{k.f()}o.append(s),this.textSelectionManager.stopPageFlip(o),this.br.trigger("textLayerRendered",{pageIndex:n,pageContainer:t}),o.hasClass("BRpage-visible")&&this.br.trigger("textLayerVisible",{pageContainerEl:o[0],textLayer:s});case 6:return e.a(2)}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"renderParagraph",value:function(e){var t=document.createElement("p");t.classList.add("BRparagraphElement"),e.getAttribute("x-role")&&(t.classList.add("ocr-role-header-footer"),t.ariaHidden="true");var n=m(d(e).attr("coords").split(",").map(parseFloat),4),r=n[0],o=n[1],i=n[2],a=n[3],l=[],s=d(e).find("LINE[coords]").toArray();if(!s.length)return t;var u,h=p((0,c.pp)((0,c.Px)(s,I)));try{for(h.s();!(u=h.n()).done;){var g=m(u.value,3),y=g[0],v=g[1],b=g[2],A=v.ocrElement==s[s.length-1],k=document.createElement("span");k.classList.add("BRlineElement");var w,C=p(v.words.entries());try{for(C.s();!(w=C.n()).done;){var x=m(w.value,2),S=x[0],E=x[1],B=m(d(E).attr("coords").split(",").map(parseFloat),4),R=B[1],T=B[2],_=B[3],j=R-_;if(l.push(j),0==S&&null!=y&&y.lastWord.textContent.trim().endsWith("-")){var L=m(d((b||y).firstWord).attr("coords").split(",").map(parseFloat),3)[0];d(E).attr("coords","".concat(L,",").concat(R,",").concat(T,",").concat(_))}var P=document.createElement("span");if(P.setAttribute("class","BRwordElement"),P.textContent=E.textContent.trim(),S>0){var N=document.createElement("span");N.classList.add("BRspace"),N.textContent=" ",N.setAttribute("aria-label"," "),k.append(N),k.appendChild(document.createTextNode(" "))}k.appendChild(P)}}catch(e){C.e(e)}finally{C.f()}var F=v.lastWord.textContent.trim().endsWith("-"),D=k.children[k.children.length-1];F&&!A&&(D.textContent=D.textContent.trim().slice(0,-1),D.classList.add("BRwordElement--hyphen")),t.appendChild(k),A||F||t.appendChild(document.createTextNode(" "))}}catch(e){h.e(e)}finally{h.f()}l.sort(function(e,t){return e-t});var z=l[Math.floor(.85*l.length)]+4;t.style.left="".concat(r,"px"),t.style.top="".concat(a,"px"),t.style.width="".concat(i-r,"px"),t.style.height="".concat(o-a,"px"),t.style.fontSize="".concat(z,"px");var M,q=O(t,".BRwordElement",this._measurementDocument),H=d(e).find("WORD").toArray(),G=t.querySelectorAll(".BRwordElement"),U=p((0,c.yU)(H,G));try{for(U.s();!(M=U.n()).done;){var W=m(M.value,2),K=W[0],J=W[1],$=q.get(J),V=m(d(K).attr("coords").split(",").map(parseFloat),3),X=V[0],Y=V[2]-X;K.textContent.endsWith(" ")&&(Y=Y*(K.textContent.length-1)/K.textContent.length);var Z=Y-$.width;J.style.letterSpacing="".concat(Z/(K.textContent.length-1),"px")}}catch(e){U.e(e)}finally{U.f()}q=O(t,".BRwordElement",this._measurementDocument);var Q,ee=O(t,".BRspace",this._measurementDocument),te=d(e).find("LINE[coords]").toArray(),ne=Array.from(t.querySelectorAll(".BRlineElement")),re=a,oe=p((0,c.yU)(te,ne));try{for(oe.s();!(Q=oe.n()).done;){var ie,ae=m(Q.value,2),le=ae[0],se=ae[1],ce=d(le).find("WORD").toArray(),ue=this.rtl?i:r,de=p((0,c.yU)(ce,se.querySelectorAll(".BRwordElement")));try{for(de.s();!(ie=de.n()).done;){var he=m(ie.value,2),fe=he[0],pe=he[1],me=q.get(pe),ge=m(d(fe).attr("coords").split(",").map(parseFloat),3),ye=ge[0],ve=ge[2],be=this.rtl?-(ve-ue):ye-ue;if(pe.previousElementSibling){var Ae=pe.previousElementSibling;Ae.style.letterSpacing="".concat(be-ee.get(Ae).width,"px")}else pe.style[this.rtl?"paddingRight":"paddingLeft"]="".concat(be,"px");this.rtl?ue-=be+me.width:ue+=be+me.width}}catch(e){de.e(e)}finally{de.f()}var ke=Math.min.apply(Math,f(ce.map(function(e){return parseFloat(d(e).attr("coords").split(",")[3])})))-re;se.previousElementSibling&&(se.previousElementSibling.style.lineHeight="".concat(ke,"px"),re+=ke)}}catch(e){oe.e(e)}finally{oe.f()}return ne[ne.length-1].style.lineHeight="".concat(o-re,"px"),t.appendChild(document.createElement("br")),t}}]);var n,o,g}(o.S);function O(e,t,n){var r={position:e.style.position,visibility:e.style.visibility,top:e.style.top,left:e.style.left,transform:e.style.transform};e.style.position="absolute",e.style.visibility="hidden",e.style.top="0",e.style.left="0",e.style.transform="none",n.body.appendChild(e);var o=new Map(Array.from(e.querySelectorAll(t)).map(function(e){var t=e.getBoundingClientRect();return[e,new P(t.left+n.defaultView.scrollX,t.top+n.defaultView.scrollY,t.width,t.height)]}));return n.body.removeChild(e),Object.assign(e.style,r),document.adoptNode(e),o}function I(e){var t=d(e).find("WORD").toArray();return{ocrElement:e,words:t,firstWord:t[0],lastWord:t[t.length-1]}}function L(e){if(!d(e).attr("coords")&&e.children){var t=d(e).children().toArray();if(0!==t.length){var n,r=p(t);try{for(r.s();!(n=r.n()).done;)L(n.value)}catch(e){r.e(e)}finally{r.f()}var o,i=[],a=p(t);try{for(a.s();!(o=a.n()).done;){var l=o.value;d(l).attr("coords")&&i.push(d(l).attr("coords").split(",").map(parseFloat))}}catch(e){a.e(e)}finally{a.f()}var s=function(e){var t,n=1/0,r=-1/0,o=-1/0,i=1/0,a=p(e);try{for(a.s();!(t=a.n()).done;){var l=m(t.value,4),s=l[0],c=l[1],u=l[2],d=l[3];n=Math.min(n,s),r=Math.max(r,c),o=Math.max(o,u),i=Math.min(i,d)}}catch(e){a.e(e)}finally{a.f()}return[n,r,o,i]}(i);Math.abs(s[0])!=1/0&&d(e).attr("coords",s.join(","))}}}null==_||_.registerPlugin("textSelection",j);var P=function(){return x(function e(t,n,r,o){w(this,e),this.x=t,this.y=n,this.width=r,this.height=o},[{key:"right",get:function(){return this.x+this.width}},{key:"bottom",get:function(){return this.y+this.height}},{key:"top",get:function(){return this.y}},{key:"left",get:function(){return this.x}}])}()},4160:function(e,t,n){n.d(t,{$x:function(){return m},ND:function(){return p},YH:function(){return d},_4:function(){return h}}),n(2675),n(9463),n(2259),n(3418),n(4423),n(3792),n(4782),n(2010),n(875),n(6099),n(3362),n(7495),n(8781),n(1699),n(7764),n(2953);var r=[],o={},i={},a={};[["Serbian","српски језик","sr","srp","srp"],["Romanian, Moldavian, Moldovan","Română","ro","ron","rum"],["Sichuan Yi, Nuosu","ꆈꌠ꒿ Nuosuhxop","ii","iii","iii"],["Tahitian","Reo Tahiti","ty","tah","tah"],["Tagalog","Wikang Tagalog","tl","tgl","tgl"],["Yiddish","ייִדיש","yi","yid","yid"],["Akan","Akan","ak","aka","aka"],["Malay","Bahasa Melayu, بهاس ملايو","ms","msa","may"],["Arabic","العربية","ar","ara","ara"],["Norwegian","Norsk","no","nor","nor"],["Ojibwa","ᐊᓂᔑᓈᐯᒧᐎᓐ","oj","oji","oji"],["Fulah","Fulfulde, Pulaar, Pular","ff","ful","ful"],["Persian","فارسی","fa","fas","per"],["Albanian","Shqip","sq","sqi","alb"],["Aymara","aymar aru","ay","aym","aym"],["Azerbaijani","azərbaycan dili","az","aze","aze"],["Chinese","中文 (Zhōngwén), 汉语, 漢語","zh","zho","chi"],["Cree","ᓀᐦᐃᔭᐍᐏᐣ","cr","cre","cre"],["Estonian","eesti, eesti keel","et","est","est"],["Guaraní","Avañe'ẽ","gn","grn","grn"],["Inupiaq","Iñupiaq, Iñupiatun","ik","ipk","ipk"],["Inuktitut","ᐃᓄᒃᑎᑐᑦ","iu","iku","iku"],["Kanuri","Kanuri","kr","kau","kau"],["Komi","коми кыв","kv","kom","kom"],["Kongo","Kikongo","kg","kon","kon"],["Kurdish","Kurdî, أۇزبېك","ku","kur","kur"],["Latvian","latviešu valoda","lv","lav","lav"],["Malagasy","fiteny malagasy","mg","mlg","mlg"],["Mongolian","Монгол хэл","mn","mon","mon"],["Oromo","Afaan Oromoo","om","orm","orm"],["Pashto, Pushto","پښتو","ps","pus","pus"],["Quechua","Runa Simi, Kichwa","qu","que","que"],["Sardinian","sardu","sc","srd","srd"],["Swahili","Kiswahili","sw","swa","swa"],["Uzbek","Oʻzbek, Ўзбек, ","uz","uzb","uzb"],["Zhuang, Chuang","Saɯ cueŋƅ, Saw cuengh","za","zha","zha"],["Bislama","Bislama","bi","bis","bis"],["Norwegian Bokmål","Norsk Bokmål","nb","nob","nob"],["Norwegian Nynorsk","Norsk Nynorsk","nn","nno","nno"],["Indonesian","Bahasa Indonesia","id","ind","ind"],["Twi","Twi","tw","twi","twi"],["Esperanto","Esperanto","eo","epo","epo"],["Interlingua","Interlingua","ia","ina","ina"],["Interlingue","Originally called Occidental; then Interlingue after WWII","ie","ile","ile"],["Ido","Ido","io","ido","ido"],["Volapük","Volapük","vo","vol","vol"],["Bihari languages","भोजपुरी","bh","bih","bih"],["Hebrew (modern)","עברית","he","heb","heb"],["Sanskrit","संस्कृतम्","sa","san","san"],["Church Slavic, Church Slavonic, Old Church Slavonic, Old Slavonic, Old Bulgarian","ѩзыкъ словѣньскъ","cu","chu","chu"],["Pali","पाऴि","pi","pli","pli"],["Avestan","avesta","ae","ave","ave"],["Latin","latine, lingua latina","la","lat","lat"],["Armenian","Հայերեն","hy","hye","arm"],["Swati","SiSwati","ss","ssw","ssw"],["Tibetan","བོད་ཡིག","bo","bod","tib"],["South Ndebele","isiNdebele","nr","nbl","nbl"],["Slovene","Slovenski Jezik, Slovenščina","sl","slv","slv"],["Oriya","ଓଡ଼ିଆ","or","ori","ori"],["North Ndebele","isiNdebele","nd","nde","nde"],["Nauru","Dorerin Naoero","na","nau","nau"],["Maori","te reo Māori","mi","mri","mao"],["Marathi","मराठी","mr","mar","mar"],["Luba-Katanga","Kiluba","lu","lub","lub"],["Rundi","Ikirundi","rn","run","run"],["Central Khmer","ខ្មែរ, ខេមរភាសា, ភាសាខ្មែរ","km","khm","khm"],["Western Frisian","Frysk","fy","fry","fry"],["Bengali","বাংলা","bn","ben","ben"],["Avaric","авар мацӀ, магӀарул мацӀ","av","ava","ava"],["Abkhazian","аҧсуа бызшәа, аҧсшәа","ab","abk","abk"],["Afar","Afaraf","aa","aar","aar"],["Afrikaans","Afrikaans","af","afr","afr"],["Amharic","አማርኛ","am","amh","amh"],["Aragonese","aragonés","an","arg","arg"],["Assamese","অসমীয়া","as","asm","asm"],["Bambara","bamanankan","bm","bam","bam"],["Bashkir","башҡорт теле","ba","bak","bak"],["Basque","euskara, euskera","eu","eus","baq"],["Belarusian","беларуская мова","be","bel","bel"],["Bosnian","bosanski jezik","bs","bos","bos"],["Breton","brezhoneg","br","bre","bre"],["Bulgarian","български език","bg","bul","bul"],["Burmese","ဗမာစာ","my","mya","bur"],["Catalan, Valencian","català, valencià","ca","cat","cat"],["Chamorro","Chamoru","ch","cha","cha"],["Chechen","нохчийн мотт","ce","che","che"],["Chichewa, Chewa, Nyanja","chiCheŵa, chinyanja","ny","nya","nya"],["Chuvash","чӑваш чӗлхи","cv","chv","chv"],["Cornish","Kernewek","kw","cor","cor"],["Corsican","corsu, lingua corsa","co","cos","cos"],["Croatian","hrvatski jezik","hr","hrv","hrv"],["Czech","čeština, český jazyk","cs","ces","cze"],["Danish","dansk","da","dan","dan"],["Divehi, Dhivehi, Maldivian","ދިވެހި","dv","div","div"],["Dutch, Flemish","Nederlands, Vlaams","nl","nld","dut"],["Dzongkha","རྫོང་ཁ","dz","dzo","dzo"],["English","English","en","eng","eng"],["Ewe","Eʋegbe","ee","ewe","ewe"],["Faroese","føroyskt","fo","fao","fao"],["Fijian","vosa Vakaviti","fj","fij","fij"],["Finnish","suomi, suomen kieli","fi","fin","fin"],["French","français, langue française","fr","fra","fre"],["Galician","Galego","gl","glg","glg"],["Georgian","ქართული","ka","kat","geo"],["German","Deutsch","de","deu","ger"],["Greek (modern)","ελληνικά","el","ell","gre"],["Gujarati","ગુજરાતી","gu","guj","guj"],["Haitian, Haitian Creole","Kreyòl ayisyen","ht","hat","hat"],["Hausa","(Hausa) هَوُسَ","ha","hau","hau"],["Herero","Otjiherero","hz","her","her"],["Hindi","हिन्दी, हिंदी","hi","hin","hin"],["Hiri Motu","Hiri Motu","ho","hmo","hmo"],["Hungarian","magyar","hu","hun","hun"],["Irish","Gaeilge","ga","gle","gle"],["Igbo","Asụsụ Igbo","ig","ibo","ibo"],["Icelandic","Íslenska","is","isl","ice"],["Italian","Italiano","it","ita","ita"],["Japanese","日本語 (にほんご)","ja","jpn","jpn"],["Javanese","ꦧꦱꦗꦮ, Basa Jawa","jv","jav","jav"],["Kalaallisut, Greenlandic","kalaallisut, kalaallit oqaasii","kl","kal","kal"],["Kannada","ಕನ್ನಡ","kn","kan","kan"],["Kashmiri","कश्मीरी, كشميري","ks","kas","kas"],["Kazakh","қазақ тілі","kk","kaz","kaz"],["Kikuyu, Gikuyu","Gĩkũyũ","ki","kik","kik"],["Kinyarwanda","Ikinyarwanda","rw","kin","kin"],["Kirghiz, Kyrgyz","Кыргызча, Кыргыз тили","ky","kir","kir"],["Korean","한국어","ko","kor","kor"],["Kuanyama, Kwanyama","Kuanyama","kj","kua","kua"],["Luxembourgish, Letzeburgesch","Lëtzebuergesch","lb","ltz","ltz"],["Ganda","Luganda","lg","lug","lug"],["Limburgan, Limburger, Limburgish","Limburgs","li","lim","lim"],["Lingala","Lingála","ln","lin","lin"],["Lao","ພາສາລາວ","lo","lao","lao"],["Lithuanian","lietuvių kalba","lt","lit","lit"],["Manx","Gaelg, Gailck","gv","glv","glv"],["Macedonian","македонски јазик","mk","mkd","mac"],["Malayalam","മലയാളം","ml","mal","mal"],["Maltese","Malti","mt","mlt","mlt"],["Marshallese","Kajin M̧ajeļ","mh","mah","mah"],["Navajo, Navaho","Diné bizaad","nv","nav","nav"],["Nepali","नेपाली","ne","nep","nep"],["Ndonga","Owambo","ng","ndo","ndo"],["Occitan","occitan, lenga d'òc","oc","oci","oci"],["Ossetian, Ossetic","ирон æвзаг","os","oss","oss"],["Panjabi, Punjabi","ਪੰਜਾਬੀ","pa","pan","pan"],["Polish","język polski, polszczyzna","pl","pol","pol"],["Portuguese","Português","pt","por","por"],["Romansh","Rumantsch Grischun","rm","roh","roh"],["Russian","русский","ru","rus","rus"],["Sindhi","सिन्धी, سنڌي، سندھی","sd","snd","snd"],["Northern Sami","Davvisámegiella","se","sme","sme"],["Samoan","gagana fa'a Samoa","sm","smo","smo"],["Sango","yângâ tî sängö","sg","sag","sag"],["Gaelic, Scottish Gaelic","Gàidhlig","gd","gla","gla"],["Shona","chiShona","sn","sna","sna"],["Sinhala, Sinhalese","සිංහල","si","sin","sin"],["Slovak","Slovenčina, Slovenský Jazyk","sk","slk","slo"],["Somali","Soomaaliga, af Soomaali","so","som","som"],["Southern Sotho","Sesotho","st","sot","sot"],["Spanish, Castilian","Español","es","spa","spa"],["Sundanese","Basa Sunda","su","sun","sun"],["Swedish","Svenska","sv","swe","swe"],["Tamil","தமிழ்","ta","tam","tam"],["Telugu","తెలుగు","te","tel","tel"],["Tajik","тоҷикӣ, toçikī, تاجیکی","tg","tgk","tgk"],["Thai","ไทย","th","tha","tha"],["Tigrinya","ትግርኛ","ti","tir","tir"],["Turkmen","Türkmen, Түркмен","tk","tuk","tuk"],["Tswana","Setswana","tn","tsn","tsn"],["Tongan (Tonga Islands)","Faka Tonga","to","ton","ton"],["Turkish","Türkçe","tr","tur","tur"],["Tsonga","Xitsonga","ts","tso","tso"],["Tatar","татар теле, tatar tele","tt","tat","tat"],["Uighur, Uyghur","ئۇيغۇرچە, Uyghurche","ug","uig","uig"],["Ukrainian","Українська","uk","ukr","ukr"],["Urdu","اردو","ur","urd","urd"],["Venda","Tshivenḓa","ve","ven","ven"],["Vietnamese","Tiếng Việt","vi","vie","vie"],["Walloon","Walon","wa","wln","wln"],["Welsh","Cymraeg","cy","cym","wel"],["Wolof","Wollof","wo","wol","wol"],["Xhosa","isiXhosa","xh","xho","xho"],["Yoruba","Yorùbá","yo","yor","yor"],["Zulu","isiZulu","zu","zul","zul"]].forEach(e=>{var t={name:e[0],nativeName:e[1],iso639_1:e[2],iso639_2T:e[3],iso639_2B:e[4]};o[e[2]]=i[e[3]]=a[e[4]]=t,r.push(t)});var l=r;function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var u={"zh-hans":"中文 (Zhōngwén)"};function d(e){if(!e)return null;if(e=e.toLocaleLowerCase(),u[e])return e;var t=f(e,["iso639_1"])||f(e,["iso639_2T"])||f(e,["iso639_2B","name","nativeName"]);return t?t.iso639_1:null}function h(e){if(!e)return null;if(e=e.toLocaleLowerCase(),u[e])return u[e];var t=f(e,["iso639_1"])||f(e,["iso639_2T"])||f(e,["iso639_2B","name","nativeName"]);return null!=t&&t.nativeName?t.nativeName.split(", ")[0]:null}function f(e,t){if(!e)return null;e=e.toLowerCase();var n,r=s(l);try{for(r.s();!(n=r.n()).done;){var o,i=n.value,a=s(t);try{for(a.s();!(o=a.n()).done;){var c;if(null!==(c=i[o.value])&&void 0!==c&&c.toLowerCase().split(", ").includes(e))return i}}catch(e){a.e(e)}finally{a.f()}}}catch(e){r.e(e)}finally{r.f()}return null}function p(){try{return!!window.localStorage}catch(e){return!1}}var m=-1!=location.toString().indexOf("_debugReadAloud=true")},7279:function(e,t,n){n.d(t,{yc:function(){return _e},bg:function(){return ge},lB:function(){return Be}});var r=function(){return n(6518)},o=function(){return n(655)},i=n.cw(function(e,t){var r=n(3724),o=n(2106),i=n(5213),a=n(7979);r&&!i.correct&&(o(RegExp.prototype,"flags",{configurable:!0,get:a}),i.correct=!0)}),a=n.cw(function(e,t){var i=r(),a=n(9565),l=n(7476),s=n(3994),c=n(2529),u=n(7750),d=n(8014),h=o(),f=n(8551),p=n(34),m=n(2195),g=n(788),y=n(1034),v=n(5966),b=n(6840),A=n(9039),k=n(8227),w=n(2293),C=n(7829),x=n(6682),S=n(1181),E=n(6395),B=k("matchAll"),R="RegExp String",T=R+" Iterator",_=S.set,j=S.getterFor(T),O=RegExp.prototype,I=TypeError,L=l("".indexOf),P=l("".matchAll),N=!!P&&!A(function(){P("a",/./)}),F=s(function(e,t,n,r){_(this,{type:T,regexp:e,string:t,global:n,unicode:r,done:!1})},R,function(){var e=j(this);if(e.done)return c(void 0,!0);var t=e.regexp,n=e.string,r=x(t,n);return null===r?(e.done=!0,c(void 0,!0)):e.global?(""===h(r[0])&&(t.lastIndex=C(n,d(t.lastIndex),e.unicode)),c(r,!1)):(e.done=!0,c(r,!1))}),D=function(e){var t,n,r,o=f(this),i=h(e),a=w(o,RegExp),l=h(y(o));return t=new a(a===RegExp?o.source:o,l),n=!!~L(l,"g"),r=!!~L(l,"u")||!!~L(l,"v"),t.lastIndex=d(o.lastIndex),new F(t,i,n,r)};i({target:"String",proto:!0,forced:N},{matchAll:function(e){var t,n,r,o,i=u(this);if(p(e)){if(g(e)&&(t=h(u(y(e))),!~L(t,"g")))throw new I("`.matchAll` does not allow non-global regexes");if(N)return P(i,e);if(void 0===(r=v(e,B))&&E&&"RegExp"===m(e)&&(r=D),r)return a(r,e,i)}else if(N)return P(i,e);return n=h(i),o=new RegExp(e,"g"),E?a(D,o,n):o[B](n)}}),E||B in O||b(O,B,D)}),l=n.cw(function(e,t){var i=r(),a=n(9504),l=n(5397),s=n(8981),c=o(),u=n(6198),d=a([].push),h=a([].join);i({target:"String",stat:!0},{raw:function(e){var t=l(s(e).raw),n=u(t);if(!n)return"";for(var r=arguments.length,o=[],i=0;;){if(d(o,c(t[i++])),i===n)return h(o,"");i<r&&d(o,c(arguments[i]))}}})}),s=n.cw(function(e,t){a()});n(2675),n(9463),n(2259),n(5700),n(8125),n(8706),n(2008),n(113),n(3418),n(4423),n(3792),n(8598),n(2062),n(4782),n(4554),n(739),n(9572),n(2010),n(4731),n(479),n(2892),n(9085),n(2811),n(3851),n(875),n(9432),n(6099),n(8459),n(3362),n(825),n(888),n(4864),n(7495),i(),n(8781),n(1699),n(7764),n(1761),l(),n(5440),n(5746),n(2762),s(),n(3500),n(2953),n(8408);var c=n(9073),u=n(1669);function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,p(r.key),r)}}function f(e,t,n){return(t=p(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e){var t=function(e){if("object"!=d(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==d(t)?t:t+""}var m,g,y,v,b,A,k,w,C,x,S,E,B,R,T,_,j,O=function(){return e=function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),f(this,"selecting",!1),f(this,"startedInSelector",!1),f(this,"target",null),f(this,"lastKnownFocusNode",null),f(this,"_onSelectionChange",function(){var e=window.getSelection();if(e){var t=function(e){if(!e.isCollapsed)return!1;for(var t=0;t<e.rangeCount;t++)if(!e.getRangeAt(t).collapsed)return!1;return!0}(e);if(!r.selecting&&e.toString()){var n=u(e.anchorNode).closest(r.selector)[0];if(!n)return;r.target=n,r.selecting=!0,r.lastKnownFocusNode=e.focusNode,r.handler("started",r.target)}r.selecting&&r.lastKnownFocusNode!=e.focusNode&&e.toString()&&!t&&(r.lastKnownFocusNode=e.focusNode,r.handler("changed",r.target)),!r.selecting||!t&&e.toString()&&u(e.anchorNode).closest(r.selector)[0]||(r.selecting=!1,r.lastKnownFocusNode=null,r.handler("cleared",r.target))}}),this.selector=t,this.handler=n},(t=[{key:"attach",value:function(){document.addEventListener("selectionchange",this._onSelectionChange)}},{key:"detach",value:function(){document.removeEventListener("selectionchange",this._onSelectionChange)}}])&&h(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),I=n(8004),L=n(6205),P=n(9696),N=n(4535),F=(n(90),n(8918),n(6090),n(7583)),D=n(1989),z=n(1669);function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}function q(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ne(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function H(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function G(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){H(i,r,o,a,l,"next",e)}function l(e){H(i,r,o,a,l,"throw",e)}a(void 0)})}}function U(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function W(e,t,n){return t=ae(t),function(e,t){if(t&&("object"==M(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,K()?Reflect.construct(t,n||[],ae(e).constructor):t.apply(e,n))}function K(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(K=function(){return!!e})()}function J(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$(e,t)}function $(e,t){return $=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$(e,t)}function V(e,t,n,r){var o=X();if(r)for(var i=0;i<r.length;i++)o=r[i](o);var a=t(function(e){o.initializeInstanceElements(e,l.elements)},n),l=o.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===i.key&&e.placement===i.placement},r=0;r<e.length;r++){var o,i=e[r];if("method"===i.kind&&(o=t.find(n)))if(ee(i.descriptor)||ee(o.descriptor)){if(Q(i)||Q(o))throw new ReferenceError("Duplicated methods ("+i.key+") can't be decorated.");o.descriptor=i.descriptor}else{if(Q(i)){if(Q(o))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+i.key+").");o.decorators=i.decorators}Z(i,o)}else t.push(i)}return t}(a.d.map(Y)),e);return o.initializeClassElements(a.F,l.elements),o.runClassFinishers(a.F,l.finishers)}function X(){X=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach(function(n){t.forEach(function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)},this)},this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach(function(r){t.forEach(function(t){var o=t.placement;if(t.kind===r&&("static"===o||"prototype"===o)){var i="static"===o?e:n;this.defineClassElement(i,t)}},this)},this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],o={static:[],prototype:[],own:[]};if(e.forEach(function(e){this.addElementPlacement(e,o)},this),e.forEach(function(e){if(!Q(e))return n.push(e);var t=this.decorateElement(e,o);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)},this),!t)return{elements:n,finishers:r};var i=this.decorateConstructor(n,t);return r.push.apply(r,i.finishers),i.finishers=r,i},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],o=e.decorators,i=o.length-1;i>=0;i--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var l=this.fromElementDescriptor(e),s=this.toElementFinisherExtras((0,o[i])(l)||l);e=s.element,this.addElementPlacement(e,t),s.finisher&&r.push(s.finisher);var c=s.extras;if(c){for(var u=0;u<c.length;u++)this.addElementPlacement(c[u],t);n.push.apply(n,c)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var o=this.fromClassDescriptor(e),i=this.toClassDescriptor((0,t[r])(o)||o);if(void 0!==i.finisher&&n.push(i.finisher),void 0!==i.elements){e=i.elements;for(var a=0;a<e.length-1;a++)for(var l=a+1;l<e.length;l++)if(e[a].key===e[l].key&&e[a].placement===e[l].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:n}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||ne(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map(function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t},this);var t},toElementDescriptor:function(e){var t=e.kind+"";if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var n=pe(e.key),r=e.placement+"";if("static"!==r&&"prototype"!==r&&"own"!==r)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+r+'"');var o=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var i={kind:t,key:n,placement:r,descriptor:Object.assign({},o)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(o,"get","The property descriptor of a field descriptor"),this.disallowProperty(o,"set","The property descriptor of a field descriptor"),this.disallowProperty(o,"value","The property descriptor of a field descriptor"),i.initializer=e.initializer),i},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:te(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=e.kind+"";if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var n=te(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function Y(e){var t,n=pe(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function Z(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function Q(e){return e.decorators&&e.decorators.length}function ee(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function te(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function ne(e,t){if(e){if("string"==typeof e)return re(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?re(e,t):void 0}}function re(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oe(e,t,n,r){var o=ie(ae(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function ie(){return ie="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=ae(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},ie.apply(null,arguments)}function ae(e){return ae=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ae(e)}function le(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(M(e)+" is not iterable")}function se(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return ce(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,h.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=h.p,p=i[2];n>3?(o=p===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,h.v=r,h.n=i[1]):f<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,h.n=p,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,p),l=u,s=p;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(h.n=-1),f(l,s)):h.n=s:h.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=h.n<0)?s:n.call(r,h))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(ce(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ce(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,ce(d,"constructor",c),ce(c,"constructor",s),s.displayName="GeneratorFunction",ce(c,o,"GeneratorFunction"),ce(d),ce(d,o,"Generator"),ce(d,r,function(){return this}),ce(d,"toString",function(){return"[object Generator]"}),(se=function(){return{w:i,m:h}})()}function ce(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ce=function(e,t,n,r){function i(t,n){ce(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},ce(e,t,n,r)}function ue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function de(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,pe(r.key),r)}}function he(e,t,n){return t&&de(e.prototype,t),n&&de(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fe(e,t,n){return(t=pe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pe(e){var t=function(e){if("object"!=M(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=M(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==M(t)?t:t+""}var me="BRhighlightStorage",ge=function(){return he(function e(t,n,r,o){var i=this,a=r.selectionElement;ue(this,e),fe(this,"options",{maxProtectedWords:200}),fe(this,"selectMenu",void 0),fe(this,"_onSelectionChange",function(e,t){if("started"===e)i.textSelectingMode(t);else if("cleared"===e)i.defaultMode(t);else if("changed"!==e)throw new Error("Unknown type ".concat(e))}),fe(this,"_limitSelection",function(){var e=window.getSelection();if(e.rangeCount){var t=e.getRangeAt(0),n=!!t.startContainer.parentElement.closest(".BRcontainer"),r=!!t.endContainer.parentElement.closest(".BRcontainer");if(n||r)if(n&&r){var o=(0,D.eU)((0,D.nC)(ye(t,"element"),function(e){return e.classList.contains(i.selectionElement[0].replace(".",""))}),i.options.maxProtectedWords-1);if(o&&t.endContainer.parentNode!=o){var a=document.createRange();a.setStart(t.startContainer,t.startOffset),a.setEnd(o.firstChild,o.textContent.length),e.removeAllRanges(),e.addRange(a)}}else e.removeAllRanges()}}),this.layer=t,this.br=n,this.selectionElement=a,this.selectionObserver=new O(this.layer,this._onSelectionChange),this.options.maxProtectedWords=o||200,this.selectMenu=new ve(n),this.selectMenu.className="br-select-menu__root"},[{key:"selectMenuEnabled",get:function(){var e,t;return(null===(e=this.br.plugins.experiments)||void 0===e?void 0:e.isEnabled("copyLinkToHighlight"))||(null===(t=this.br.plugins.experiments)||void 0===t?void 0:t.isEnabled("annotateHighlight"))}},{key:"init",value:function(){var e=this;this.attach(),new O(this.layer,function(t){var n,r;"started"==t&&(null===(n=e.br.plugins.archiveAnalytics)||void 0===n||n.sendEvent("BookReader","SelectStart"),e.br.refs.$br.find(".BRpagecontainer--hasSelection").removeClass("BRpagecontainer--hasSelection"),z(window.getSelection().anchorNode).closest(".BRpagecontainer").addClass("BRpagecontainer--hasSelection"),e.mouseIsDown||e.showSelectMenu()),"changed"==t&&!e.mouseIsDown&&null!==(r=window.getSelection())&&void 0!==r&&r.toString()&&e.showSelectMenu(),"cleared"==t&&e.hideSelectMenu()}).attach()}},{key:"attach",value:function(){var e=this;this.selectionObserver.attach(),this.br.protected&&(document.addEventListener("selectionchange",this._limitSelection),z(document.body).on("contextmenu dragstart copy",function(t){var n=document.getSelection();if(null!=n&&n.toString()&&z(e.layer).toArray().some(function(e){return n.containsNode(e,!0)}))return t.preventDefault(),!1}))}},{key:"detach",value:function(){this.selectionObserver.detach(),this.br.protected&&document.removeEventListener("selectionchange",this._limitSelection)}},{key:"interceptCopy",value:function(e){e[0].addEventListener("copy",function(e){var t=document.getSelection();e.clipboardData.setData("text/plain",t.toString()),e.preventDefault()})}},{key:"stopPageFlip",value:function(e){var t=this,n=e.find(this.layer);n.length&&(n.each(function(e,n){return t.defaultMode(n)}),this.br.protected||this.interceptCopy(e))}},{key:"defaultMode",value:function(e){var t=this,n=z(e).closest(".BRpagecontainer");e.style.pointerEvents="none",n.find("img").css("pointer-events","auto"),z(e).off(".textSelectPluginHandler");var r=this.mouseIsDown,o=this.mouseIsDown;r&&(e.style.pointerEvents="auto"),z(e).on("mousedown.textSelectPluginHandler",function(e){t.mouseIsDown=!0,z(e.target).is(t.selectionElement.join(", "))&&e.stopPropagation()}),z(e).on("mouseup.textSelectPluginHandler",function(n){t.mouseIsDown=!1,e.style.pointerEvents="none",o&&(o=!1,n.stopPropagation())})}},{key:"textSelectingMode",value:function(e){var t=this,n=z(e).closest(".BRpagecontainer");e.style.pointerEvents="all",n.find("img").css("pointer-events","none"),z(e).off(".textSelectPluginHandler"),z(e).on("mousedown.textSelectPluginHandler",function(e){1==e.which&&(t.mouseIsDown=!0,e.stopPropagation())}),z(e).on("mouseup.textSelectPluginHandler",function(e){t.mouseIsDown=!1,1==e.which&&(e.stopPropagation(),t.showSelectMenu())})}},{key:"showSelectMenu",value:function(){this.selectMenuEnabled&&(this.selectMenu.copyLinkToHighlightEnabled=this.br.plugins.experiments.isEnabled("copyLinkToHighlight"),this.selectMenu.highlightAnnotationEnabled=this.br.plugins.experiments.isEnabled("annotateHighlight"),this.selectMenu.isConnected||document.body.append(this.selectMenu),this.selectMenu.open?this.selectMenu.repositionToSelection():this.selectMenu.show())}},{key:"hideSelectMenu",value:function(){this.selectMenu.hide()}}])}();function ye(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text+element";return se().m(function n(){var r,o,i,a,l;return se().w(function(n){for(;;)switch(n.n){case 0:return l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.children,r=void 0===n||n,s=t.parents,c=void 0===s||s,u=t.siblings,d=void 0===u||u;return se().m(function t(){var n;return se().w(function(t){for(;;)switch(t.n){case 0:if(e!==o){t.n=2;break}if(i=!0,!a(e)){t.n=1;break}return t.n=1,e;case 1:return t.a(2);case 2:if(!a(e)){t.n=3;break}return t.n=3,e;case 3:if(!r||!e.firstChild){t.n=5;break}return t.d(le(l(e.firstChild,{children:!0,parents:!1,siblings:!0})),4);case 4:if(!i){t.n=5;break}return t.a(2);case 5:if(!d){t.n=9;break}n=e.nextSibling;case 6:if(!n){t.n=9;break}return t.d(le(l(n,{children:!0,parents:!1,siblings:!1})),7);case 7:if(!i){t.n=8;break}return t.a(2);case 8:n=n.nextSibling,t.n=6;break;case 9:if(!c||!e.parentNode){t.n=11;break}return t.d(le(l(e.parentNode,{children:!1,parents:!0,siblings:!0})),10);case 10:if(!i){t.n=11;break}return t.a(2);case 11:return t.a(2)}},t)})()},r=e.startContainer,o=e.endContainer,i=!1,a=function(e){return"text"===t&&e.nodeType===Node.TEXT_NODE||"element"===t&&e.nodeType===Node.ELEMENT_NODE||"text+element"===t},n.d(le(l(r)),1);case 1:return n.a(2)}},n)})()}V([(0,P.EM)("br-menu-option")],function(e,t){var n=function(t){function n(){var t;ue(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return t=W(this,n,[].concat(o)),e(t),t}return J(n,t),he(n)}(t);return{F:n,d:[{kind:"field",decorators:[(0,P.MZ)({type:String})],key:"icon",value:function(){return""}},{kind:"field",decorators:[(0,P.MZ)({type:String})],key:"label",value:function(){return""}},{kind:"field",key:"temporaryText",value:function(){return null}},{kind:"field",decorators:[(0,P.MZ)({type:Number,attribute:"temporary-text-duration"})],key:"temporaryTextDuration",value:function(){return 1200}},{kind:"field",decorators:[(0,P.MZ)({type:String,attribute:"aria-label"})],key:"ariaLabel",value:function(){return""}},{kind:"field",decorators:[(0,P.MZ)({type:Boolean,attribute:"live-label"})],key:"liveLabel",value:function(){return!1}},{kind:"field",decorators:[(0,P.MZ)({type:Boolean})],key:"temporaryTextVisible",value:function(){return!1}},{kind:"field",key:"temporaryTextTimeoutId",value:function(){return null}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"disconnectedCallback",value:function(){null!=this.temporaryTextTimeoutId&&(window.clearTimeout(this.temporaryTextTimeoutId),this.temporaryTextTimeoutId=null),oe(n,"disconnectedCallback",this,3)([])}},{kind:"method",key:"showTemporaryText",value:function(e){var t=this;null!=e&&e.trim()&&(this.temporaryText=e,this.temporaryTextVisible=!0,null!=this.temporaryTextTimeoutId&&window.clearTimeout(this.temporaryTextTimeoutId),this.temporaryTextTimeoutId=window.setTimeout(function(){t.temporaryTextVisible=!1,t.temporaryText=null,t.temporaryTextTimeoutId=null},this.temporaryTextDuration))}},{kind:"method",key:"renderIcon",value:function(){return"share"===this.icon?(0,L.qy)(m||(m=U(['<ia-icon-share class="br-select-menu__icon" aria-hidden="true"></ia-icon-share>']))):"edit-pencil"===this.icon?(0,L.qy)(g||(g=U(['<ia-icon-edit-pencil class="br-select-menu__icon" aria-hidden="true"></ia-icon-edit-pencil>']))):"ellipses"===this.icon?(0,L.qy)(y||(y=U(['<ia-icon-ellipses class="br-select-menu__icon" aria-hidden="true"></ia-icon-ellipses>']))):""}},{kind:"method",key:"render",value:function(){var e,t,n=null!==(e=this.label)&&void 0!==e?e:"",r=!!this.temporaryText,o=r?this.temporaryText:n,i=r&&this.temporaryTextVisible,a=i?o:n,l=null===(t=this.ariaLabel)||void 0===t?void 0:t.trim(),s=l&&l!==a.trim()?l:void 0,c=n.length>=o.length?n:o;return(0,L.qy)(v||(v=U(['\n <button\n type="button"\n class="br-select-menu__option"\n role="menuitem"\n aria-label=',"\n >\n ","\n ","\n </button>\n "])),(0,N.J)(s),this.renderIcon(),r||n?r?(0,L.qy)(b||(b=U(['\n <span class="br-select-menu__label-wrap" style="display: inline-flex; position: relative; align-items: center;">\n <span\n class="br-select-menu__label"\n style="visibility: hidden;"\n aria-hidden="true"\n >','</span>\n <span\n class="br-select-menu__label"\n style="position: absolute; inset: 0; display: inline-flex; align-items: center;"\n aria-live=',"\n >","</span>\n </span>\n "])),c,this.liveLabel?"polite":"off",i?o:n):(0,L.qy)(A||(A=U(['\n <span class="br-select-menu__label" aria-live=',">","</span>\n "])),this.liveLabel?"polite":"off",n):"")}}]}},L.WF);var ve=V([(0,P.EM)("br-select-menu")],function(e,t){var n,r,o=function(t){function n(t){var r;return ue(this,n),r=W(this,n),e(r),r.br=t,r}return J(n,t),he(n)}(t);return{F:o,d:[{kind:"field",key:"br",value:void 0},{kind:"field",decorators:[(0,P.MZ)({type:Boolean,reflect:!0})],key:"showExtended",value:function(){return!1}},{kind:"field",decorators:[(0,P.P)("#br-select-copy-link-option")],key:"copyLinkOption",value:void 0},{kind:"field",decorators:[(0,P.MZ)({type:Boolean,reflect:!0})],key:"open",value:function(){return!1}},{kind:"field",decorators:[(0,P.MZ)({type:Boolean})],key:"copyLinkToHighlightEnabled",value:function(){return!0}},{kind:"field",decorators:[(0,P.MZ)({type:Boolean})],key:"highlightAnnotationEnabled",value:function(){return!0}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"field",key:"_scrollTimeoutId",value:function(){return null}},{kind:"field",key:"_onScroll",value:function(){var e=this;return function(){e.classList.add("br-select-menu__root--scrolling"),null!=e._scrollTimeoutId&&clearTimeout(e._scrollTimeoutId),e._scrollTimeoutId=window.setTimeout(function(){e._scrollTimeoutId=null,e.repositionToSelection(),e.classList.remove("br-select-menu__root--scrolling")},150)}}},{kind:"method",key:"connectedCallback",value:function(){oe(o,"connectedCallback",this,3)([]),this.setAttribute("role","menu"),this.setAttribute("aria-label","Text selection actions"),this.setAttribute("aria-orientation","vertical")}},{kind:"method",key:"disconnectedCallback",value:function(){oe(o,"disconnectedCallback",this,3)([]),window.removeEventListener("scroll",this._onScroll,{capture:!0}),null!=this._scrollTimeoutId&&(clearTimeout(this._scrollTimeoutId),this._scrollTimeoutId=null)}},{kind:"method",key:"renderCopyLinkToHighlightOption",value:function(){return(0,L.qy)(k||(k=U(['\n <br-menu-option\n id="br-select-copy-link-option"\n @mousedown=',"\n @click=",'\n icon="share"\n label="Copy Link to Highlight"\n live-label\n ></br-menu-option>\n '])),function(e){return e.preventDefault()},this.handleCopyLinkToHighlight)}},{kind:"method",key:"renderRemoveOption",value:function(){return(0,L.qy)(w||(w=U(["\n <br-menu-option\n @click=",'\n icon="share"\n label="Delete Highlight and Annotation"\n ></br-menu-option>\n '])),this.handleDeleteHighlight)}},{kind:"method",key:"renderAddAnnotationOption",value:function(){return(0,L.qy)(C||(C=U(["\n <br-menu-option\n @click=",'\n icon="edit-pencil"\n label="Annotate"\n ></br-menu-option>\n '])),this.handleAddAnnotation)}},{kind:"method",key:"renderHighlightOption",value:function(){return(0,L.qy)(x||(x=U(["\n <br-menu-option\n @click=",'\n icon="edit-pencil"\n label="Highlight Selection"\n ></br-menu-option>\n '])),this.handleHighlightSave)}},{kind:"method",key:"renderShowMoreOption",value:function(){return(0,L.qy)(S||(S=U(['\n <br-menu-option\n id="br-select-more"\n @mousedown=',"\n @click=",'\n icon="ellipses"\n aria-label="Show more options"\n ></br-menu-option>\n '])),function(e){return e.preventDefault()},this.toggleExtendedMenu)}},{kind:"method",key:"renderLocalStorageOptions",value:function(){return(0,L.qy)(E||(E=U(["\n <br-menu-option\n @click=",'\n icon="share"\n label="Load Highlights"\n ></br-menu-option>\n <br-menu-option\n @click=','\n icon="share"\n label="Remove Stored Highlights"\n ></br-menu-option>'])),this.renderSavedHighlights,function(){window.localStorage.removeItem(me)})}},{kind:"method",key:"renderDefaultOptions",value:function(){return(0,L.qy)(B||(B=U(["\n ","\n ","\n ","\n "])),this.copyLinkToHighlightEnabled?this.renderCopyLinkToHighlightOption():"",this.highlightAnnotationEnabled&&!this.nodesForRemoval?this.renderHighlightOption():"",this.nodesForRemoval?this.renderRemoveOption():"")}},{kind:"method",key:"renderExtendedOptions",value:function(){return(0,L.qy)(R||(R=U(["\n ","\n ","\n "])),this.renderDefaultOptions(),this.renderLocalStorageOptions())}},{kind:"method",key:"render",value:function(){var e,t=null===(e=this.br.plugins.experiments)||void 0===e?void 0:e.isEnabled("annotateHighlight");return(0,L.qy)(T||(T=U(["\n ","\n ","\n "])),this.showExtended?this.renderExtendedOptions():this.renderDefaultOptions(),!this.showExtended&&t?this.renderShowMoreOption():"")}},{kind:"method",key:"handleCopyLinkToHighlight",value:(r=G(se().m(function e(t){var n,r,o,i,a,l;return se().w(function(e){for(;;)switch(e.n){case 0:if(t.preventDefault(),r=window.getSelection(),o=r.getRangeAt(0),i=this.getNodeTextLayer(o.startContainer)){e.n=1;break}return console.warn("No text layer found for selection"),e.a(2);case 1:return a=_e.fromSelection(r,[i]),l=a.toUrl(),e.n=2,navigator.clipboard.writeText(l);case 2:null===(n=this.copyLinkOption)||void 0===n||n.showTemporaryText("Copied!"),this.br.trigger("copyLinkToHighlight",{textFragment:a,link:l});case 3:return e.a(2)}},e,this)})),function(e){return r.apply(this,arguments)})},{kind:"method",key:"toggleExtendedMenu",value:function(e){e.preventDefault(),this.showExtended=!this.showExtended}},{kind:"method",key:"getNodeTextLayer",value:function(e){var t;if(!e)return null;var n=e instanceof Element?e:e.parentElement;return null!==(t=null==n?void 0:n.closest(".BRtextLayer"))&&void 0!==t?t:null}},{kind:"method",key:"handleHighlightSave",value:function(){var e=window.getSelection(),t="backward"===e.direction?e.focusNode.parentElement:e.anchorNode.parentElement,n=this.getNodeTextLayer(t),r=_e.fromSelection(e,[n.parentElement]);r.uuid="id-".concat(crypto.randomUUID().split("-")[4]);var o=this.loadHighlightsFromLocalStorage();o.push(r),this.saveToLocalStorage(o),this.renderSavedHighlights()}},{kind:"method",key:"handleAddAnnotation",value:function(e){}},{kind:"method",key:"handleDeleteHighlight",value:function(){if(this.nodesForRemoval){var e,t=Te(this.nodesForRemoval[0]),n=q(this.nodesForRemoval);try{for(n.s();!(e=n.n()).done;){var r=e.value,o=r.textContent,i=r.parentElement;i.classList.contains("BRwordElement")||i.classList.contains("BRspace")?(r.remove(),i.textContent=o):console.log("This element did not match removal criteria:",i,r)}}catch(e){n.e(e)}finally{n.f()}this.deleteHighlight(t),this.clearNodesForRemoval()}else console.log("there is nothing to remove")}},{kind:"method",key:"deleteHighlight",value:function(e){for(var t=this.loadHighlightsFromLocalStorage(),n=0;n<t.length;n++)if(t[n].uuid===e)return t.splice(n,1),void this.saveToLocalStorage(t)}},{kind:"method",key:"saveToLocalStorage",value:function(e){window.localStorage.setItem(me,JSON.stringify(e.map(function(e){return e.toJSON()})))}},{kind:"method",key:"loadHighlightsFromLocalStorage",value:function(){return JSON.parse(window.localStorage.getItem(me)||"[]").map(function(e){return _e.fromJSON(e)})}},{kind:"method",key:"renderSavedHighlights",value:function(){var e,t=this,n=q(this.loadHighlightsFromLocalStorage());try{for(n.s();!(e=n.n()).done;){var r=e.value,o=this.br.$(".pagediv".concat(r.pageIndex," .BRtextLayer"))[0];o&&(Be(o,r),z(o).off("mouseup.BRHighlightClick").on("mouseup.BRHighlightClick",function(e){e.target.classList.contains("BRhighlight")&&(e.stopPropagation(),t.handleHighlightClick(e.target))}))}}catch(e){n.e(e)}finally{n.f()}}},{kind:"method",key:"handleHighlightClick",value:function(e){var t=this.getNodeTextLayer(e),n=Te(e),r=t.querySelectorAll(".".concat(n)),o=r[0],i=r[r.length-1],a=document.createRange();a.setStart(o,0),a.setEnd(i,1);var l=window.getSelection();l.removeAllRanges(),l.addRange(a),this.show()}},{kind:"method",key:"repositionToSelection",value:function(){var e=window.getSelection().getRangeAt(0).getBoundingClientRect(),t=(0,F.un)()||(0,F.m0)(),n=(0,F.m0)()?25:(0,F.un)()?15:10,r=t?60:0,o=(e.top<r?e.bottom+r:e.bottom)+n,i=Math.max(10,o)+window.scrollY,a=this.getBoundingClientRect().width,l=document.documentElement.clientWidth,s=a>e.width?e.left+e.width/2-a/2:e.left,c=(0,I.qE)(s,10,l-a-10)+window.scrollX;this.style.top="".concat(i,"px"),this.style.left="".concat(c,"px")}},{kind:"method",key:"show",value:(n=G(se().m(function e(){var t;return se().w(function(e){for(;;)switch(e.n){case 0:if(null===(t=this.br.plugins.translate)||void 0===t||!t.userToggleTranslate){e.n=1;break}return e.a(2);case 1:return this.style.zIndex="1",this.style.position="absolute",this.open=!0,this.classList.remove("br-select-menu__root--scrolling"),window.removeEventListener("scroll",this._onScroll,{capture:!0}),window.addEventListener("scroll",this._onScroll,{capture:!0,passive:!0}),e.n=2,this.updateComplete;case 2:this.repositionToSelection(),this.clearNodesForRemoval();case 3:return e.a(2)}},e,this)})),function(){return n.apply(this,arguments)})},{kind:"method",key:"hide",value:function(){this.open&&(this.showExtended=!1,this.open=!1,window.removeEventListener("scroll",this._onScroll,{capture:!0}),this.clearNodesForRemoval())}},{kind:"field",key:"clearNodesForRemoval",value:function(){var e=this;return function(){e.nodesForRemoval=null,e.requestUpdate()}}}]}},L.WF);function be(e,t){t=t.trim();var n=new RegExp(String.raw(_||(_=U(["^(S+(s+|$)){1,","}"],["^(\\S+(\\s+|$)){1,","}"])),e)),r=t.match(n);return r?r[0].trim():""}function Ae(e,t){t=t.trim();var n=new RegExp(String.raw(j||(j=U(["((^|s+)S+){1,","}s*?$"],["((^|\\s+)\\S+){1,","}\\s*?$"])),e)),r=t.match(n);return r?r[0].trim():""}function ke(e){for(;e.firstChild;)e=e.firstChild;return e}function we(e){for(;e.lastChild;)e=e.lastChild;return e}function Ce(e){return e.replace(/(:|-,|,-|,|\n)/g,function(e){return 1===e.length?" ":" "})}function xe(e,t,n){var r=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).normalize,o=void 0===r?function(e){return e}:r;if(n.length){var i=n[0]===t.startContainer?t.startOffset:0,a=o(Ee(t)),l=o(n[0].textContent.slice(0,i)).length,s=new RegExp(e.source,e.flags.includes("g")?e.flags:"".concat(e.flags,"g")),c=Array.from(a.matchAll(s)).map(function(e){var t=Se(l+e.index,n,!1,{normalize:o}),r=Se(l+e.index+e[0].length,n,!0,{normalize:o});if(t&&r){var i=new Range;return i.setStart(t.node,t.offset),i.setEnd(r.node,r.offset),i}console.warn("Could not find boundary points for regex match, skipping this match",{match:e,start:t,end:r})}).filter(function(e){return!!e});if(null!=c&&c.length)return c}}function Se(e,t,n){var r,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).normalize,i=void 0===o?function(e){return e}:o,a=e,l=0,s=q(t);try{for(s.s();!(r=s.n()).done;){var c=r.value,u=c.textContent||"",d=i(u),h=l;if(h+d.length+(n?1:0)>a)for(var f=a-h,p=Math.min(f,u.length),m=n?d.substring(0,f):d.substring(f),g=i(n?u.substring(0,f):u.substring(f)),y=(n?-1:1)*(m.length>g.length?-1:1);p>=0&&p<=u.length;){if(g.length===m.length)return{node:c,offset:p};p+=y,g=i(n?u.substring(0,p):u.substring(p))}l+=d.length}}catch(e){s.e(e)}finally{s.f()}}function Ee(e){var t=Array.from((0,D.nC)(ye(e,"text"),Re)),n=t.map(function(e){return e.textContent}).join(""),r=t[0],o=t[t.length-1];return e.startContainer===r&&(n=n.substring(e.startOffset)),e.endContainer===o&&(n=n.substring(0,n.length-(o.textContent.length-e.endOffset))),n}function Be(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=ke(e),o=we(e),i=new Range;i.setStart(r,0),i.setEnd(o,o.textContent.length);var a=Array.from((0,D.nC)(ye(i,"text"),Re)),l=xe(t.toRegExp({context:!0}),i,a,{normalize:Ce});if(l){var s=Array.from((0,D.nC)(ye(l[0],"text"),Re)),c=xe(t.toRegExp({context:!1}),l[0],s,{normalize:Ce});if(!c)throw new Error("Could not find quote in page");var u=ke(c[0].startContainer),d=ke(c[0].endContainer),h=new Range;if(h.setStart(u,0),h.setEnd(d,d.textContent.length),!u.parentElement.classList.contains("BRhighlight")&&!d.parentElement.classList.contains("BRhighlight"))return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return document.createElement("mark")};if(e.startContainer.nodeType!=Node.TEXT_NODE||e.endContainer.nodeType!=Node.TEXT_NODE)return[];if(e.startContainer===e.endContainer){var n=t();return e.surroundContents(n),[n]}var r=e.startContainer,o=e.cloneRange();o.setEndAfter(r);var i=e.endContainer,a=e.cloneRange();a.setStartBefore(i);var l=[];e.setStartAfter(r),e.setEndBefore(i);for(var s=document.createTreeWalker(e.commonAncestorContainer,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,{acceptNode:function(t){return e.intersectsNode(t)?t.nodeType===Node.TEXT_NODE?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP:NodeFilter.FILTER_REJECT}}),c=s.nextNode();c;){if(c.nodeType===Node.TEXT_NODE){var u=t();c.parentNode.insertBefore(u,c),u.appendChild(c),l.push(u)}c=s.nextNode()}var d=t();o.surroundContents(d);var h=t();return a.surroundContents(h),[d].concat(l,[h])}(h,function(){var e=document.createElement("mark");return e.classList.add("BRhighlight"),n&&e.classList.add(n),t.uuid&&e.classList.add(t.uuid),e})}else console.warn("Could not find quote with context in page")}function Re(e){var t;return!(null!==(t=e.previousElementSibling)&&void 0!==t&&t.classList.contains("BRspace"))}function Te(e){if(!e)return null;var t=Array.from(null==e?void 0:e.classList).filter(function(e){if(e.slice(0,2).includes("id"))return e});return t.length?t[0]:null}var _e=function(){function e(t){var n=t.prefix,r=t.quote,o=t.quoteStart,i=t.quoteEnd,a=t.suffix,l=t.pageNumber,s=t.pageIndex,c=t.uuid;ue(this,e),this.prefix=n,this.quote=null!=r?r:null,this.quoteStart=null!=o?o:null,this.quoteEnd=null!=i?i:null,this.suffix=a,this.pageNumber=l,this.pageIndex=s,this.uuid=null!=c?c:null}return he(e,[{key:"toUrl",value:function(){var e=new URLSearchParams(window.location.search);e.set("text",this.toNormalizedString());var t=window.location,n=this.pageNumber||"n".concat(this.pageIndex),r=t.pathname.replace(/((?:^|[#/])page)\/[^/]+/,"$1/".concat(n)),o=t.hash?t.hash.replace(/((?:^|[#/])page)\/[^/]+/,"$1/".concat(n)):"";return"".concat(t.origin).concat(r,"?").concat(e).concat(o)}},{key:"toNormalizedString",value:function(){var e=function(e){return function(e){return e.replace(/\s+/g," ").trim()}(Ce(e).trim())},t=this.pageNumber?this.pageNumber:"n".concat(this.pageIndex);t+=":",this.prefix&&(t+=e(this.prefix),t+="-,");var n=this.quote?e(this.quote):null,r=null;if(n&&n.length>80&&(n.match(/\S+/g)||[]).length>=6){var o=be(3,n),i=Ae(3,n);o&&i&&(r={quoteStart:o,quoteEnd:i})}if(n&&!r)t+=n;else if(r)t+="".concat(r.quoteStart,",").concat(r.quoteEnd);else{if(!this.quoteStart||!this.quoteEnd)throw new Error("Text fragment requires either a quote or quoteStart/quoteEnd");t+="".concat(this.quoteStart,",").concat(this.quoteEnd)}return this.suffix&&(t+=",-",t+=e(this.suffix)),t}},{key:"toRegExp",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).context,t=void 0!==e&&e,n=this.quote?[this.quote]:[this.quoteStart,this.quoteEnd];t&&(this.prefix&&(n[0]=this.prefix+" "+n[0]),this.suffix&&(n[n.length-1]=n[n.length-1]+" "+this.suffix));var r=function(e){return RegExp.escape(Ce(e)).replace(/(\\x20)+/g,"\\s+")};return 1===n.length?new RegExp(r(n[0]),"gi"):new RegExp(r(n[0])+"[\\s\\S]*?"+r(n[1]),"gi")}},{key:"toJSON",value:function(){return{prefix:this.prefix,quote:this.quote,quoteStart:this.quoteStart,quoteEnd:this.quoteEnd,suffix:this.suffix,pageNumber:this.pageNumber,pageIndex:this.pageIndex,uuid:this.uuid}}}],[{key:"fromString",value:function(t,n,r){var o=t.match(/^(?:(.*?):)?(?:(.*?)-,)?(.*?)(?:,-(.*))?$/);if(!o)throw new Error("Invalid text fragment format: ".concat(t));var i=o[1]||null,a=o[2]||null,l=(o[3]||"").split(","),s=null,c=null,u=null;if(1===l.length)s=l[0];else{if(2!==l.length)throw new Error("Invalid text fragment quote format: ".concat(t));c=l[0],u=l[1]}var d=o[4]||null,h=i?n.getPageIndex(i):r;if("number"!=typeof h)throw new Error("Could not determine page index for text fragment with page number ".concat(i));if(!(s||c&&u))throw new Error("Invalid text fragment quote format: ".concat(t));return new e({prefix:a,quote:s,quoteStart:c,quoteEnd:u,suffix:d,pageNumber:i,pageIndex:h})}},{key:"fromJSON",value:function(t){return new e(t)}},{key:"fromSelection",value:function(t,n){var r,o,i=t.getRangeAt(0),a=new Range,l=we(i.startContainer),s=ke(i.endContainer);a.setStart(l,0),a.setEnd(s,0==i.endOffset?0:null!==(r=null===(o=s.textContent)||void 0===o?void 0:o.length)&&void 0!==r?r:0);var u=document.createRange();u.setStart(ke(n[0]),0),u.setEnd(l,0);var d=document.createRange();d.setStart(s,a.endOffset);var h=we(n[n.length-1]);d.setEnd(h,Math.max(0,h.textContent.length-1));var f=Ee(u),p=Ae(3,f),m=(0,c.rj)(p),g=Ee(d),y=be(3,g),v=(0,c.rj)(y);m<3&&(y=be(6-m,g),v=(0,c.rj)(y)),v<3&&(p=Ae(6-v,f),m=(0,c.rj)(p));var b=Ee(a),A=l.parentElement.closest(".BRpagecontainer");return new e({quote:b,prefix:p,suffix:y,pageNumber:A.getAttribute("data-page-num"),pageIndex:parseFloat(A.getAttribute("data-index"))})}}])}()},4565:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}n.d(t,{l:function(){return a}}),n(2675),n(9463),n(2259),n(5700),n(3792),n(9572),n(2892),n(6099),n(7764),n(2953);var a=function(){return e=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.maxSize=t,this.entries=[]},(t=[{key:"add",value:function(e){this.entries.length>=this.maxSize&&this.entries.shift(),this.entries.push(e)}}])&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}()},1989:function(e,t,n){function r(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function l(n,r,i,a){var l=r&&r.prototype instanceof c?r:c,u=Object.create(l.prototype);return o(u,"_invoke",function(n,r,o){var i,a,l,c=0,u=o||[],d=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,a=0,l=e,h.n=n,s}};function f(n,r){for(a=n,l=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=h.p,p=i[2];n>3?(o=p===r)&&(l=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(a=0,h.v=r,h.n=i[1]):f<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,h.n=p,a=0))}if(o||n>1)return s;throw d=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,p),a=u,l=p;(t=a<2?e:l)||!d;){i||(a?a<3?(a>1&&(h.n=-1),f(a,l)):h.n=l:h.v=l);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(d=h.n<0)?l:n.call(r,h))!==s)break}catch(t){i=e,a=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,i,a),!0),u}var s={};function c(){}function u(){}function d(){}t=Object.getPrototypeOf;var h=[][i]?t(t([][i]())):(o(t={},i,function(){return this}),t),f=d.prototype=c.prototype=Object.create(h);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,o(e,a,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=d,o(f,"constructor",d),o(d,"constructor",u),u.displayName="GeneratorFunction",o(d,a,"GeneratorFunction"),o(f),o(f,a,"Generator"),o(f,i,function(){return this}),o(f,"toString",function(){return"[object Generator]"}),(r=function(){return{w:l,m:p}})()}function o(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function(e,t,n,r){function a(t,n){o(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},o(e,t,n,r)}n.d(t,{Px:function(){return f},eU:function(){return d},nC:function(){return h},pp:function(){return p},yU:function(){return m}}),n(2675),n(9463),n(2259),n(3418),n(3792),n(4782),n(2010),n(875),n(6099),n(7495),n(8781),n(7764),n(2953);var i=r().m(h),a=r().m(f),l=r().m(p),s=r().m(m);function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t){var n,r=0,o=c(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(r==t)return i;r++}}catch(e){o.e(e)}finally{o.f()}}function h(e,t){var n,o,a,l;return r().w(function(r){for(;;)switch(r.p=r.n){case 0:n=c(e),r.p=1,n.s();case 2:if((o=n.n()).done){r.n=4;break}if(a=o.value,!t(a)){r.n=3;break}return r.n=3,a;case 3:r.n=2;break;case 4:r.n=6;break;case 5:r.p=5,l=r.v,n.e(l);case 6:return r.p=6,n.f(),r.f(6);case 7:return r.a(2)}},i,null,[[1,5,6,7]])}function f(e,t){var n,o,i,l;return r().w(function(r){for(;;)switch(r.p=r.n){case 0:n=c(e),r.p=1,n.s();case 2:if((o=n.n()).done){r.n=4;break}return i=o.value,r.n=3,t(i);case 3:r.n=2;break;case 4:r.n=6;break;case 5:r.p=5,l=r.v,n.e(l);case 6:return r.p=6,n.f(),r.f(6);case 7:return r.a(2)}},a,null,[[1,5,6,7]])}function p(e){var t,n,o,i,a,s,u;return r().w(function(r){for(;;)switch(r.p=r.n){case 0:t=void 0,n=void 0,o=void 0,i=c(e),r.p=1,i.s();case 2:if((a=i.n()).done){r.n=5;break}if(s=a.value,void 0===n){r.n=3;break}return o=s,r.n=3,[t,n,o];case 3:t=n,n=s,o=void 0;case 4:r.n=2;break;case 5:r.n=7;break;case 6:r.p=6,u=r.v,i.e(u);case 7:return r.p=7,i.f(),r.f(7);case 8:if(void 0===n){r.n=9;break}return r.n=9,[t,n,o];case 9:return r.a(2)}},l,null,[[1,6,7,8]])}function m(e,t){var n,o,i,a;return r().w(function(r){for(;;)switch(r.n){case 0:n=e[Symbol.iterator](),o=t[Symbol.iterator]();case 1:if(i=n.next(),a=o.next(),!i.done||!a.done){r.n=2;break}return r.a(2);case 2:if(!i.done&&!a.done){r.n=3;break}throw new Error("zip: one of the iterators is done");case 3:return r.n=4,[i.value,a.value];case 4:r.n=1;break;case 5:return r.a(2)}},s)}},9073:function(e,t,n){function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e){var t=e.match(/\S+/g);return t?t.length:0}function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a;return null==e?void 0:e.replace(/\{\{([^}]*?)\}\}/g,function(e,i){if(!i)return e;var a,l=function(e){if(Array.isArray(e))return e}(a=i.split("|").map(function(e){return e.trim()}))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),s=l[0],c=r(l).slice(1);if(!(s in n)&&!(s in t))return e;var u=s in n?n[s]:s in t?t[s]:null;return c.map(function(e){return o[e]}).reduce(function(e,t){return t(e)},u&&u.toString())})}n.d(t,{gT:function(){return i},rj:function(){return o}}),n(2675),n(9463),n(2259),n(3418),n(3792),n(2062),n(2712),n(4782),n(2010),n(6099),n(7495),n(8781),n(7764),n(1761),n(5440),n(2762),n(2953);var a={urlencode:encodeURIComponent}}},function(e){e(296)}]);
|
|
2
|
+
"use strict";(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[326],{5703:function(e,t,n){var r=n(1354),o=n.n(r),i=n(6314),a=n.n(i)()(o());a.push([e.id,'.BRtextLayer,.BRtranslateLayer{z-index:2;position:absolute;top:0;left:0;color:rgba(0,0,0,0);transform-origin:0 0;pointer-events:none;cursor:text}.BRtextLayer{mix-blend-mode:multiply}.BRtranslateLayer{hyphens:auto}.BRparagraphElement{margin:0;cursor:text;font-family:Georgia,serif;line-height:0}.BRlineElement{pointer-events:all;white-space:nowrap;display:inline-block}.BRtextLayer[dir=ltr] .BRlineElement{margin-right:100%}.BRtextLayer[dir=rtl] .BRlineElement{margin-left:100%}.BRwordElement::selection,.BRspace::selection,.BRparagraphElement::selection,.BRparagraphElement br::selection{background:hsla(210,74%,62%,.4)}.BRwordElement::-moz-selection,.BRspace::-moz-selection,.BRparagraphElement::-moz-selection,.BRparagraphElement br::-moz-selection{background:hsla(210,74%,62%,.4);color:rgba(0,0,0,0)}.BRtranslateLayer ::selection{background:hsla(210,74%,62%,.4)}.BRtranslateLayer ::-moz-selection{background:hsla(210,74%,62%,.4)}.BRparagraphElement br{visibility:hidden}.BRwordElement--hyphen::after{content:"-"}.BRsmooth-zooming .BRpagecontainer:not(.BRpagecontainer--hasSelection):not(:has(hypothesis-highlight)):not(:has(.BRhighlight)) .BRtextLayer,.BRscrolling-active .BRpagecontainer:not(.BRpagecontainer--hasSelection):not(:has(hypothesis-highlight)):not(:has(.BRhighlight)) .BRtextLayer{display:none}.BRmode1up .BRpagecontainer:not(.BRpage-visible) .BRtextLayer{display:none}.BRpagecontainer img{-webkit-user-select:none;-moz-user-select:none;user-select:none}.BRtextLayer:has([_istranslated="1"],msreadoutspan){mix-blend-mode:normal}.BRwordElement[_istranslated="1"],.BRwordElement[_msttexthash],.BRspace[_istranslated="1"],.BRspace[_msttexthash]{color:#000;letter-spacing:unset !important}.BRlineElement:has([_istranslated="1"],[_msttexthash]){background:rgba(248,237,192,.8);backdrop-filter:blur(8px);color:#000;text-align:justify;width:inherit}.BRlineElement:has([_istranslated="1"],[_msttexthash]):not(:nth-last-child(2)){text-align-last:justify}.BRlineElement[_msttexthash]{word-spacing:unset !important}.BRtranslateLayer .BRparagraphElement{pointer-events:auto;overflow-y:auto;background:rgba(248,237,192,.8);backdrop-filter:blur(8px);color:#000;line-height:1em;text-align:justify}.BRtranslateLayer .BRparagraphElement .BRlineElement{white-space:break-spaces;display:inline-block}.BRtextLayer.showingTranslation{display:none}.BRtranslateLayer .BRparagraphElement.BRtranslateHidden{display:none}.br-select-menu__root{display:none;color:#fff;color-scheme:dark;padding:2px;overflow:hidden;opacity:1;transition:opacity .2s;gap:5px}.br-select-menu__root[open]{display:flex}.br-select-menu__root[showextended]{display:block;gap:0px;background-color:#333;border-radius:10px}@starting-style{.br-select-menu__root{opacity:0}}.br-select-menu__root--scrolling{opacity:0;pointer-events:none}.br-select-menu__option{--iconWidth: 15px;--iconHeight: 15px;--iconFillColor: currentColor;background:rgba(0,0,0,0);display:flex;align-items:center;border-radius:25px;font-family:inherit;color:inherit;border:0;cursor:pointer;text-wrap:nowrap;background-color:#333;position:relative}@media(pointer: coarse)and (hover: none){.br-select-menu__option{padding:4px 8px}#br-select-more .br-select-menu__option{padding:4px}}.br-select-menu__option:hover:after{position:absolute;left:2px;right:2px;top:2px;bottom:2px;content:"";pointer-events:none;background-color:rgba(255,255,255,.1);border-radius:23px}.br-select-menu__root[showextended] .br-select-menu__option{width:100%}.br-select-menu__root[showextended] .br-select-menu__option:hover:after{border-radius:8px}.br-select-menu__icon{display:block;flex-shrink:0;width:17px;height:17px;padding:2px}.br-select-menu__label{margin-left:4px;font-size:12px;margin-right:4px}@media(hover: hover){.br-select-menu__option{padding:4px}.br-select-menu__label{width:0px;margin:0;opacity:0;interpolate-size:allow-keywords;transition:width .2s}.br-select-menu__root:hover .br-select-menu__label{width:auto;margin:0 4px;opacity:1}}.BRtextLayer .BRhighlight{background-color:#ff0;pointer-events:all;color:rgba(0,0,0,0)}@keyframes highlightTargetFlash{to{background-color:hsl(45,80%,66%)}}.BRtextLayer .BRhighlight--target-text,.BRtextLayer ::target-text{background-color:hsla(45,80%,66%,.6);color:rgba(0,0,0,0);animation:highlightTargetFlash 600ms 1 reverse}',"",{version:3,sources:["webpack://./src/css/_TextSelection.scss"],names:[],mappings:"AAAA,+BACI,SAAA,CACA,iBAAA,CACA,KAAA,CACA,MAAA,CACA,mBAAA,CACA,oBAAA,CAEA,mBAAA,CACA,WAAA,CAGJ,aACI,uBAAA,CAGJ,kBACI,YAAA,CAGJ,oBACI,QAAA,CACA,WAAA,CACA,yBAAA,CACA,aAAA,CAGJ,eACI,kBAAA,CACA,kBAAA,CACA,oBAAA,CASA,qCAAA,iBAAA,CACA,qCAAA,gBAAA,CAMA,+GACI,+BAAA,CAGJ,mIACI,+BAAA,CACA,mBAAA,CAIR,8BACI,+BAAA,CAGJ,mCACI,+BAAA,CAGJ,uBACI,iBAAA,CAKJ,8BACI,WAAA,CAMA,0RACI,YAAA,CAKR,8DACI,YAAA,CAIJ,qBACI,wBAAA,CACA,qBAAA,CACA,gBAAA,CAOJ,oDACI,qBAAA,CAIA,kHACI,UAAA,CACA,+BAAA,CAIR,uDACI,+BAAA,CACA,yBAAA,CACA,UAAA,CACA,kBAAA,CACA,aAAA,CACA,+EACI,uBAAA,CAIR,6BACI,6BAAA,CAGJ,sCACI,mBAAA,CACA,eAAA,CACA,+BAAA,CACA,yBAAA,CACA,UAAA,CACA,eAAA,CACA,kBAAA,CAGJ,qDACI,wBAAA,CACA,oBAAA,CAGJ,gCACI,YAAA,CAGJ,wDACI,YAAA,CAMJ,sBACE,YAAA,CACA,UAAA,CACA,iBAAA,CACA,WAAA,CACA,eAAA,CACA,SAAA,CACA,sBAAA,CACA,OAAA,CAEA,4BACE,YAAA,CAGF,oCACE,aAAA,CACA,OAAA,CACA,qBAAA,CACA,kBAnB0B,CAsB5B,gBArBF,sBAsBI,SAAA,CAAA,CAGJ,iCACE,SAAA,CACA,mBAAA,CAGF,wBACE,iBAAA,CACA,kBAAA,CACA,6BAAA,CACA,wBAAA,CACA,YAAA,CACA,kBAAA,CACA,kBAvCmB,CAwCnB,mBAAA,CACA,aAAA,CACA,QAAA,CACA,cAAA,CACA,gBAAA,CACA,qBAAA,CACA,iBAAA,CAEA,yCAhBF,wBAiBI,eAAA,CACA,wCACI,WAAA,CAAA,CAIN,oCACE,iBAAA,CACA,QAAA,CACA,SAAA,CACA,OAAA,CACA,UAAA,CACA,UAAA,CACA,mBAAA,CACA,qCAAA,CACA,kBAAA,CAGF,4DACI,UAAA,CACA,wEACE,iBAAA,CAKR,sBACE,aAAA,CACA,aAAA,CACA,UAAA,CACA,WAAA,CACA,WAAA,CAGF,uBACE,eAAA,CACA,cAAA,CACA,gBAAA,CAGF,qBACI,wBACI,WAAA,CAEJ,uBACI,SAAA,CACA,QAAA,CACA,SAAA,CACA,+BAAA,CACA,oBAAA,CAEJ,mDACI,UAAA,CACA,YAAA,CACA,SAAA,CAAA,CAIR,0BACI,qBAAA,CACA,kBAAA,CACA,mBAAA,CAGJ,gCACE,GAAA,gCAAA,CAAA,CAIF,kEAEI,oCAAA,CACA,mBAAA,CACA,8CAAA",sourcesContent:['.BRtextLayer, .BRtranslateLayer {\n z-index: 2;\n position: absolute;\n top: 0;\n left: 0;\n color: transparent;\n transform-origin: 0 0;\n // Make it so right-clicking on "blank" part of text layer sends events to the image (for saving)\n pointer-events: none;\n cursor: text;\n}\n\n.BRtextLayer {\n mix-blend-mode: multiply;\n}\n\n.BRtranslateLayer {\n hyphens: auto;\n}\n\n.BRparagraphElement {\n margin: 0;\n cursor: text;\n font-family: Georgia, serif;\n line-height: 0;\n}\n\n.BRlineElement {\n pointer-events: all;\n white-space: nowrap;\n display: inline-block;\n\n // We use display: inline-block, otherwise this causes every line\n // to have newlines at the end in safari. BUT, since they\'re inline,\n // if the OCR has to short line in the same paragraph, they can wrap\n // and one can go onto the other. This adds an arbitrary margin to\n // the right of each line, forcing things to wrap.\n // See eg https://www-drini.archive.org/details/countofmontecris00duma_7/page/261/mode/2up\n // Page 261, second last line on the page.\n .BRtextLayer[dir=ltr] & { margin-right: 100%; }\n .BRtextLayer[dir=rtl] & { margin-left: 100%; }\n}\n\n// Highlight colors for text selection layer\n.BRwordElement, .BRspace, .BRparagraphElement, .BRparagraphElement br {\n // these 2 properties do not work if joined\n &::selection {\n background: hsla(210, 74%, 62%, 0.4);\n }\n\n &::-moz-selection {\n background: hsla(210, 74%, 62%, 0.4);\n color:transparent;\n }\n}\n\n.BRtranslateLayer ::selection {\n background: hsla(210, 74%, 62%, 0.4);\n}\n\n.BRtranslateLayer ::-moz-selection {\n background: hsla(210, 74%, 62%, 0.4);\n}\n\n.BRparagraphElement br {\n visibility: hidden;\n}\n\n// Use CSS pseudo-elements to render the hyphens. This makes them\n// not selectable, so copy/pasting text doesn\'t include them.\n.BRwordElement--hyphen::after {\n content: "-";\n}\n\n// Hide text layer for performance during zooming & scrolling\n.BRsmooth-zooming, .BRscrolling-active {\n // If the text layer has an annotation, don\'t hide it\n .BRpagecontainer:not(.BRpagecontainer--hasSelection):not(:has(hypothesis-highlight)):not(:has(.BRhighlight)) .BRtextLayer {\n display: none;\n }\n}\n\n// Hide text selection layers of off-screen pages\n.BRmode1up .BRpagecontainer:not(.BRpage-visible) .BRtextLayer {\n display: none;\n}\n\n// Makes page image unselectable\n.BRpagecontainer img {\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n\n\n// These are Microsoft Edge specific fixed to make some of the\n// browsers features work well. These are for the in-place\n// translation.\n.BRtextLayer:has([_istranslated="1"], msreadoutspan) {\n mix-blend-mode: normal;\n}\n\n.BRwordElement, .BRspace {\n &[_istranslated="1"], &[_msttexthash] {\n color: black;\n letter-spacing: unset !important;\n }\n}\n\n.BRlineElement:has([_istranslated="1"], [_msttexthash]) {\n background: rgba(248, 237, 192, 0.8);\n backdrop-filter: blur(8px);\n color: black;\n text-align: justify;\n width: inherit;\n &:not(:nth-last-child(2)) {\n text-align-last: justify;\n }\n}\n\n.BRlineElement[_msttexthash] {\n word-spacing: unset !important;\n}\n\n.BRtranslateLayer .BRparagraphElement {\n pointer-events: auto;\n overflow-y: auto;\n background: rgba(248, 237, 192, 0.8);\n backdrop-filter: blur(8px);\n color:black;\n line-height: 1em;\n text-align: justify;\n}\n\n.BRtranslateLayer .BRparagraphElement .BRlineElement {\n white-space: break-spaces;\n display: inline-block;\n}\n\n.BRtextLayer.showingTranslation {\n display: none;\n}\n\n.BRtranslateLayer .BRparagraphElement.BRtranslateHidden {\n display: none;\n}\n\n\n$select-menu-radius: 25px;\n$select-menu-extended-radius: 10px;\n.br-select-menu__root {\n display: none;\n color: white;\n color-scheme: dark;\n padding: 2px;\n overflow: hidden;\n opacity: 1;\n transition: opacity 0.2s;\n gap: 5px;\n\n &[open] {\n display: flex;\n }\n\n &[showextended] {\n display: block;\n gap: 0px;\n background-color: #333;\n border-radius: $select-menu-extended-radius;\n }\n\n @starting-style {\n opacity: 0;\n }\n}\n.br-select-menu__root--scrolling {\n opacity: 0;\n pointer-events: none;\n}\n\n.br-select-menu__option {\n --iconWidth: 15px;\n --iconHeight: 15px;\n --iconFillColor: currentColor;\n background: transparent;\n display: flex;\n align-items: center;\n border-radius: $select-menu-radius;\n font-family: inherit;\n color: inherit;\n border: 0;\n cursor: pointer;\n text-wrap: nowrap;\n background-color: #333;\n position: relative;\n\n @media (pointer: coarse) and (hover: none) {\n padding: 4px 8px;\n #br-select-more & {\n padding: 4px;\n }\n }\n\n &:hover:after {\n position: absolute;\n left: 2px;\n right: 2px;\n top: 2px;\n bottom: 2px;\n content: "";\n pointer-events: none;\n background-color: rgba(255, 255, 255, 0.1);\n border-radius: calc($select-menu-radius - 2px);\n }\n\n .br-select-menu__root[showextended] & {\n width:100%;\n &:hover:after {\n border-radius: calc($select-menu-extended-radius - 2px);\n }\n }\n}\n\n.br-select-menu__icon {\n display: block;\n flex-shrink: 0;\n width: 17px;\n height: 17px;\n padding: 2px;\n}\n\n.br-select-menu__label {\n margin-left: 4px;\n font-size: 12px;\n margin-right: 4px;\n}\n\n@media (hover: hover) {\n .br-select-menu__option {\n padding: 4px;\n }\n .br-select-menu__label {\n width: 0px;\n margin: 0;\n opacity: 0;\n interpolate-size: allow-keywords;\n transition: width 0.2s;\n }\n .br-select-menu__root:hover .br-select-menu__label {\n width: auto;\n margin: 0 4px;\n opacity: 1;\n }\n}\n\n.BRtextLayer .BRhighlight {\n background-color: yellow;\n pointer-events: all;\n color: transparent;\n}\n\n@keyframes highlightTargetFlash {\n to { background-color: hsla(45, 80%, 66%, 1); }\n}\n\n// Style URI TextFragments, eg ?text=example\n.BRtextLayer .BRhighlight--target-text, .BRtextLayer ::target-text {\n // Similar colour to the default one used in Safari, Firefox. Note Chrome uses a purple colour\n background-color: hsla(45, 80%, 66%, 0.6);\n color: transparent;\n animation: highlightTargetFlash 600ms 1 reverse;\n}\n'],sourceRoot:""}]),t.A=a.toString()},6314:function(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var l=0;l<this.length;l++){var s=this[l][0];null!=s&&(a[s]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&a[u[0]]||(void 0!==i&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},1354:function(e){e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),i="/*# ".concat(o," */");return[t].concat([i]).join("\n")}return[t].join("\n")}},706:function(e,t,n){var r=n(350).PROPER,o=n(9039),i=n(7452);e.exports=function(e){return o(function(){return!!i[e]()||"
"!=="
"[e]()||r&&i[e].name!==e})}},2762:function(e,t,n){var r=n(6518),o=n(3802).Bq;r({target:"String",proto:!0,forced:n(706)("trim")},{trim:function(){return o(this)}})},1041:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}n.d(t,{S:function(){return a}}),n(2675),n(9463),n(2259),n(5700),n(3792),n(9572),n(2892),n(9085),n(6099),n(7764),n(2953);var a=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.br=t,this.options},(t=[{key:"setup",value:function(e){this.options=Object.assign({},this.options,e)}},{key:"init",value:function(){}},{key:"_configurePageContainer",value:function(e){}},{key:"_configureToolbar",value:function(e){}},{key:"_bindNavigationHandlers",value:function(){}},{key:"extendNavBar",value:function(e){}}])&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}()},296:function(e,t,n){n(2675),n(9463),n(2259),n(5700),n(8706),n(2008),n(113),n(3418),n(3792),n(8598),n(2062),n(4782),n(6910),n(9572),n(2010),n(6033),n(2892),n(9085),n(875),n(6099),n(8459),n(3362),n(825),n(7495),n(8781),n(9449),n(7764),n(5746),n(2762),n(2953),n(8408);var r=n(4907),o=n(1041),i=n(9073),a=n(4565),l=n(4160),s=n(7279),c=n(1989),u=n(5703),d=n(1669);function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function f(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||g(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=g(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||g(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){if(e){if("string"==typeof e)return y(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function v(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return b(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,h.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=h.p,p=i[2];n>3?(o=p===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,h.v=r,h.n=i[1]):f<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,h.n=p,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,p),l=u,s=p;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(h.n=-1),f(l,s)):h.n=s:h.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=h.n<0)?s:n.call(r,h))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(b(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,b(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,b(d,"constructor",c),b(c,"constructor",s),s.displayName="GeneratorFunction",b(c,o,"GeneratorFunction"),b(d),b(d,o,"Generator"),b(d,r,function(){return this}),b(d,"toString",function(){return"[object Generator]"}),(v=function(){return{w:i,m:h}})()}function b(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}b=function(e,t,n,r){function i(t,n){b(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},b(e,t,n,r)}function A(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function k(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){A(i,r,o,a,l,"next",e)}function l(e){A(i,r,o,a,l,"throw",e)}a(void 0)})}}function w(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,T(r.key),r)}}function x(e,t,n){return t&&C(e.prototype,t),n&&C(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(S=function(){return!!e})()}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function B(e,t){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},B(e,t)}function R(e,t,n){return(t=T(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T(e){var t=function(e){if("object"!=h(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==h(t)?t:t+""}var _=window.BookReader,j=function(e){function t(e){var n,r,o,i;return w(this,t),R((r=this,i=[e],o=E(o=t),n=function(e,t){if(t&&("object"==h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(r,S()?Reflect.construct(o,i||[],E(r).constructor):o.apply(r,i))),"options",{enabled:!0,fullDjvuXmlUrl:null,singlePageDjvuXmlUrl:null,jsonp:!1,maxProtectedWords:200}),R(n,"djvuPagesPromise",null),R(n,"pageTextCache",new a.l),R(n,"maxWordRendered",2500),R(n,"_jumpedToHighlight",!1),R(n,"_measurementDocument",void 0),n.rtl="rl"===n.br.pageProgression,n.textSelectionManager=new s.bg(".BRtextLayer",n.br,{selectionElement:[".BRwordElement",".BRspace","mark"]},n.options.maxProtectedWords),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&B(e,t)}(t,e),x(t,[{key:"init",value:function(){var e=this;if(this.options.enabled){var t=document.createElement("iframe");t.setAttribute("aria-hidden","true"),t.tabIndex=-1,t.style.cssText="position:fixed; top:-99999px; left:-99999px; width:2000px; height:4000px; border:0; visibility:hidden;",document.body.appendChild(t),this._measurementDocument=t.contentDocument;var n=this._measurementDocument.createElement("style");n.textContent=u.A,this._measurementDocument.head.appendChild(n),this.br.on("pageVisible",function(t,n){var r=n.pageContainerEl,o=r.querySelector(".BRtextLayer");o&&e.br.trigger("textLayerVisible",{pageContainerEl:r,textLayer:o})}),this.loadData(),this.textSelectionManager.init();var r=new URLSearchParams(location.search).get("text");r&&(this.br.targetTextFragment=s.yc.fromString(r,this.br.book,this.br.firstIndex),this.initTextFragment())}}},{key:"initTextFragment",value:(g=k(v().m(function e(){var t,n,r,o=this;return v().w(function(e){for(;;)switch(e.n){case 0:if(!(r=this.br.options.verifyTextFragment)){e.n=2;break}return e.n=1,this.br.options.verifyTextFragment.call(this,this.br.targetTextFragment);case 1:r=!e.v;case 2:if(!r){e.n=3;break}return e.a(2);case 3:if(t=this.br.targetTextFragment,this.br.on("textLayerVisible",function(){var e=k(v().m(function e(n,r){var i,a,l;return v().w(function(e){for(;;)switch(e.n){case 0:i=r.pageContainerEl,a=r.textLayer,t.pageIndex===parseFloat(i.getAttribute("data-index"))&&(l=(0,s.lB)(a,t,"BRhighlight--target-text"),o._jumpedToHighlight||(o.br.scrollIntoView(l[0],{behavior:"smooth",block:"center"}),o._jumpedToHighlight=!0));case 1:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}()),(n=this.br.book.getPage(this.br.targetTextFragment.pageIndex)).isViewable){e.n=5;break}return e.n=4,this.br.requestPage(n);case 4:this.br.jumpToIndex(n.index,{ariaLive:!0,allowUnviewable:!0});case 5:return e.a(2)}},e,this)})),function(){return g.apply(this,arguments)})},{key:"_configurePageContainer",value:function(e){var t;return this.options.enabled&&this.br.mode!==this.br.constModeThumb&&null!==(t=e.page)&&void 0!==t&&t.isViewable&&this.createTextLayer(e),e}},{key:"loadData",value:function(){this.options.singlePageDjvuXmlUrl||(this.djvuPagesPromise=d.ajax({type:"GET",url:(0,i.gT)(this.options.fullDjvuXmlUrl,this.br.options.vars),dataType:this.options.jsonp?"jsonp":"html",cache:!0,xhrFields:{withCredentials:this.br.protected},error:function(e){}}).then(function(e){try{var t=d.parseXML(e);return t&&d(t).find("OBJECT")}catch(e){return}}))}},{key:"getPageText",value:(o=k(v().m(function e(t){var n,r,o,a,l;return v().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this.options.singlePageDjvuXmlUrl){e.n=5;break}if(!(n=this.pageTextCache.entries.find(function(e){return e.index==t}))){e.n=1;break}return e.a(2,n.response);case 1:return e.n=2,d.ajax({type:"GET",url:(0,i.gT)(this.options.singlePageDjvuXmlUrl,this.br.options.vars,{pageIndex:t}),dataType:this.options.jsonp?"jsonp":"html",cache:!0,xhrFields:{withCredentials:this.br.protected},error:function(e){}});case 2:return r=e.v,e.p=3,o=d.parseXML(r),a=o&&d(o).find("OBJECT")[0],this.pageTextCache.add({index:t,response:a}),e.a(2,a);case 4:return e.p=4,e.v,e.a(2,void 0);case 5:return e.n=6,this.djvuPagesPromise;case 6:if(!(l=e.v)){e.n=7;break}return e.a(2,l[t]);case 7:return e.a(2)}},e,this,[[3,4]])})),function(e){return o.apply(this,arguments)})},{key:"createTextLayer",value:(n=k(v().m(function e(t){var n,o,i,a,s,u,h,f,g,y,b,A,k,w,C,x,S,E,B,R,T,_,j,I,P,N=this;return v().w(function(e){for(;;)switch(e.n){case 0:if(n=t.page.index,!(o=t.$container).find(".BRtextLayer").length){e.n=1;break}return e.a(2);case 1:return e.n=2,this.getPageText(n);case 2:if(i=e.v){e.n=3;break}return e.a(2);case 3:if(d(i).find("WORD").filter(function(e,t){var n=m(t.getAttribute("coords").split(",").map(parseFloat),4),r=n[0],o=n[3];if(0==r&&0==o)return console.error("Found invalid ocr word coordinates"),!0}).remove(),L(i),!((a=d(i).find("WORD").length)>this.maxWordRendered)){e.n=4;break}return console.log("Page ".concat(n," has too many words (").concat(a," > ").concat(this.maxWordRendered,"). Not rendering text layer.")),e.a(2);case 4:return s=(0,r.Ql)(t.page,"BRtextLayer"),e.n=5,Promise.resolve();case 5:u=parseFloat(t.$container[0].style.width)/t.page.width,h=parseFloat(t.$container[0].style.height)/t.page.height,s.style.transform="scale(".concat(u,", ").concat(h,")"),(f=(0,l.YH)(this.br.options.bookLanguage))&&s.setAttribute("lang",f),s.setAttribute("dir",this.rtl?"rtl":"ltr"),g=d(i).find("PARAGRAPH[coords]").toArray(),y=g.map(function(e){var t=N.renderParagraph(e);return s.appendChild(t),t}),b=O(s,".BRparagraphElement",this._measurementDocument),A=0,k=p((0,c.yU)(g,y));try{for(k.s();!(w=k.n()).done;)C=m(w.value,2),x=C[0],S=C[1],E=d(x).attr("coords").split(",").map(parseFloat),B=b.get(S),R=m(E,4),T=R[0],_=R[2],j=R[3],I=this.rtl?B.right-_:T-B.left,P=j-(B.top+A),S.style[this.rtl?"marginRight":"marginLeft"]="".concat(I,"px"),S.style.marginTop="".concat(P,"px"),A+=P,s.appendChild(S),s.appendChild(document.createTextNode("\n"))}catch(e){k.e(e)}finally{k.f()}o.append(s),this.textSelectionManager.stopPageFlip(o),this.br.trigger("textLayerRendered",{pageIndex:n,pageContainer:t}),o.hasClass("BRpage-visible")&&this.br.trigger("textLayerVisible",{pageContainerEl:o[0],textLayer:s});case 6:return e.a(2)}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"renderParagraph",value:function(e){var t=document.createElement("p");t.classList.add("BRparagraphElement"),e.getAttribute("x-role")&&(t.classList.add("ocr-role-header-footer"),t.ariaHidden="true");var n=m(d(e).attr("coords").split(",").map(parseFloat),4),r=n[0],o=n[1],i=n[2],a=n[3],l=[],s=d(e).find("LINE[coords]").toArray();if(!s.length)return t;var u,h=p((0,c.pp)((0,c.Px)(s,I)));try{for(h.s();!(u=h.n()).done;){var g=m(u.value,3),y=g[0],v=g[1],b=g[2],A=v.ocrElement==s[s.length-1],k=document.createElement("span");k.classList.add("BRlineElement");var w,C=p(v.words.entries());try{for(C.s();!(w=C.n()).done;){var x=m(w.value,2),S=x[0],E=x[1],B=m(d(E).attr("coords").split(",").map(parseFloat),4),R=B[1],T=B[2],_=B[3],j=R-_;if(l.push(j),0==S&&null!=y&&y.lastWord.textContent.trim().endsWith("-")){var L=m(d((b||y).firstWord).attr("coords").split(",").map(parseFloat),3)[0];d(E).attr("coords","".concat(L,",").concat(R,",").concat(T,",").concat(_))}var P=document.createElement("span");if(P.setAttribute("class","BRwordElement"),P.textContent=E.textContent.trim(),S>0){var N=document.createElement("span");N.classList.add("BRspace"),N.textContent=" ",N.setAttribute("aria-label"," "),k.append(N),k.appendChild(document.createTextNode(" "))}k.appendChild(P)}}catch(e){C.e(e)}finally{C.f()}var F=v.lastWord.textContent.trim().endsWith("-"),D=k.children[k.children.length-1];F&&!A&&(D.textContent=D.textContent.trim().slice(0,-1),D.classList.add("BRwordElement--hyphen")),t.appendChild(k),A||F||t.appendChild(document.createTextNode(" "))}}catch(e){h.e(e)}finally{h.f()}l.sort(function(e,t){return e-t});var z=l[Math.floor(.85*l.length)]+4;t.style.left="".concat(r,"px"),t.style.top="".concat(a,"px"),t.style.width="".concat(i-r,"px"),t.style.height="".concat(o-a,"px"),t.style.fontSize="".concat(z,"px");var M,q=O(t,".BRwordElement",this._measurementDocument),H=d(e).find("WORD").toArray(),G=t.querySelectorAll(".BRwordElement"),U=p((0,c.yU)(H,G));try{for(U.s();!(M=U.n()).done;){var W=m(M.value,2),K=W[0],J=W[1],$=q.get(J),V=m(d(K).attr("coords").split(",").map(parseFloat),3),X=V[0],Y=V[2]-X;K.textContent.endsWith(" ")&&(Y=Y*(K.textContent.length-1)/K.textContent.length);var Z=Y-$.width;J.style.letterSpacing="".concat(Z/(K.textContent.length-1),"px")}}catch(e){U.e(e)}finally{U.f()}q=O(t,".BRwordElement",this._measurementDocument);var Q,ee=O(t,".BRspace",this._measurementDocument),te=d(e).find("LINE[coords]").toArray(),ne=Array.from(t.querySelectorAll(".BRlineElement")),re=a,oe=p((0,c.yU)(te,ne));try{for(oe.s();!(Q=oe.n()).done;){var ie,ae=m(Q.value,2),le=ae[0],se=ae[1],ce=d(le).find("WORD").toArray(),ue=this.rtl?i:r,de=p((0,c.yU)(ce,se.querySelectorAll(".BRwordElement")));try{for(de.s();!(ie=de.n()).done;){var he=m(ie.value,2),fe=he[0],pe=he[1],me=q.get(pe),ge=m(d(fe).attr("coords").split(",").map(parseFloat),3),ye=ge[0],ve=ge[2],be=this.rtl?-(ve-ue):ye-ue;if(pe.previousElementSibling){var Ae=pe.previousElementSibling;Ae.style.letterSpacing="".concat(be-ee.get(Ae).width,"px")}else pe.style[this.rtl?"paddingRight":"paddingLeft"]="".concat(be,"px");this.rtl?ue-=be+me.width:ue+=be+me.width}}catch(e){de.e(e)}finally{de.f()}var ke=Math.min.apply(Math,f(ce.map(function(e){return parseFloat(d(e).attr("coords").split(",")[3])})))-re;se.previousElementSibling&&(se.previousElementSibling.style.lineHeight="".concat(ke,"px"),re+=ke)}}catch(e){oe.e(e)}finally{oe.f()}return ne[ne.length-1].style.lineHeight="".concat(o-re,"px"),t.appendChild(document.createElement("br")),t}}]);var n,o,g}(o.S);function O(e,t,n){var r={position:e.style.position,visibility:e.style.visibility,top:e.style.top,left:e.style.left,transform:e.style.transform};e.style.position="absolute",e.style.visibility="hidden",e.style.top="0",e.style.left="0",e.style.transform="none",n.body.appendChild(e);var o=new Map(Array.from(e.querySelectorAll(t)).map(function(e){var t=e.getBoundingClientRect();return[e,new P(t.left+n.defaultView.scrollX,t.top+n.defaultView.scrollY,t.width,t.height)]}));return n.body.removeChild(e),Object.assign(e.style,r),document.adoptNode(e),o}function I(e){var t=d(e).find("WORD").toArray();return{ocrElement:e,words:t,firstWord:t[0],lastWord:t[t.length-1]}}function L(e){if(!d(e).attr("coords")&&e.children){var t=d(e).children().toArray();if(0!==t.length){var n,r=p(t);try{for(r.s();!(n=r.n()).done;)L(n.value)}catch(e){r.e(e)}finally{r.f()}var o,i=[],a=p(t);try{for(a.s();!(o=a.n()).done;){var l=o.value;d(l).attr("coords")&&i.push(d(l).attr("coords").split(",").map(parseFloat))}}catch(e){a.e(e)}finally{a.f()}var s=function(e){var t,n=1/0,r=-1/0,o=-1/0,i=1/0,a=p(e);try{for(a.s();!(t=a.n()).done;){var l=m(t.value,4),s=l[0],c=l[1],u=l[2],d=l[3];n=Math.min(n,s),r=Math.max(r,c),o=Math.max(o,u),i=Math.min(i,d)}}catch(e){a.e(e)}finally{a.f()}return[n,r,o,i]}(i);Math.abs(s[0])!=1/0&&d(e).attr("coords",s.join(","))}}}null==_||_.registerPlugin("textSelection",j);var P=function(){return x(function e(t,n,r,o){w(this,e),this.x=t,this.y=n,this.width=r,this.height=o},[{key:"right",get:function(){return this.x+this.width}},{key:"bottom",get:function(){return this.y+this.height}},{key:"top",get:function(){return this.y}},{key:"left",get:function(){return this.x}}])}()},4160:function(e,t,n){n.d(t,{$x:function(){return m},ND:function(){return p},YH:function(){return d},_4:function(){return h}}),n(2675),n(9463),n(2259),n(3418),n(4423),n(3792),n(4782),n(2010),n(875),n(6099),n(3362),n(7495),n(8781),n(1699),n(7764),n(2953);var r=[],o={},i={},a={};[["Serbian","српски језик","sr","srp","srp"],["Romanian, Moldavian, Moldovan","Română","ro","ron","rum"],["Sichuan Yi, Nuosu","ꆈꌠ꒿ Nuosuhxop","ii","iii","iii"],["Tahitian","Reo Tahiti","ty","tah","tah"],["Tagalog","Wikang Tagalog","tl","tgl","tgl"],["Yiddish","ייִדיש","yi","yid","yid"],["Akan","Akan","ak","aka","aka"],["Malay","Bahasa Melayu, بهاس ملايو","ms","msa","may"],["Arabic","العربية","ar","ara","ara"],["Norwegian","Norsk","no","nor","nor"],["Ojibwa","ᐊᓂᔑᓈᐯᒧᐎᓐ","oj","oji","oji"],["Fulah","Fulfulde, Pulaar, Pular","ff","ful","ful"],["Persian","فارسی","fa","fas","per"],["Albanian","Shqip","sq","sqi","alb"],["Aymara","aymar aru","ay","aym","aym"],["Azerbaijani","azərbaycan dili","az","aze","aze"],["Chinese","中文 (Zhōngwén), 汉语, 漢語","zh","zho","chi"],["Cree","ᓀᐦᐃᔭᐍᐏᐣ","cr","cre","cre"],["Estonian","eesti, eesti keel","et","est","est"],["Guaraní","Avañe'ẽ","gn","grn","grn"],["Inupiaq","Iñupiaq, Iñupiatun","ik","ipk","ipk"],["Inuktitut","ᐃᓄᒃᑎᑐᑦ","iu","iku","iku"],["Kanuri","Kanuri","kr","kau","kau"],["Komi","коми кыв","kv","kom","kom"],["Kongo","Kikongo","kg","kon","kon"],["Kurdish","Kurdî, أۇزبېك","ku","kur","kur"],["Latvian","latviešu valoda","lv","lav","lav"],["Malagasy","fiteny malagasy","mg","mlg","mlg"],["Mongolian","Монгол хэл","mn","mon","mon"],["Oromo","Afaan Oromoo","om","orm","orm"],["Pashto, Pushto","پښتو","ps","pus","pus"],["Quechua","Runa Simi, Kichwa","qu","que","que"],["Sardinian","sardu","sc","srd","srd"],["Swahili","Kiswahili","sw","swa","swa"],["Uzbek","Oʻzbek, Ўзбек, ","uz","uzb","uzb"],["Zhuang, Chuang","Saɯ cueŋƅ, Saw cuengh","za","zha","zha"],["Bislama","Bislama","bi","bis","bis"],["Norwegian Bokmål","Norsk Bokmål","nb","nob","nob"],["Norwegian Nynorsk","Norsk Nynorsk","nn","nno","nno"],["Indonesian","Bahasa Indonesia","id","ind","ind"],["Twi","Twi","tw","twi","twi"],["Esperanto","Esperanto","eo","epo","epo"],["Interlingua","Interlingua","ia","ina","ina"],["Interlingue","Originally called Occidental; then Interlingue after WWII","ie","ile","ile"],["Ido","Ido","io","ido","ido"],["Volapük","Volapük","vo","vol","vol"],["Bihari languages","भोजपुरी","bh","bih","bih"],["Hebrew (modern)","עברית","he","heb","heb"],["Sanskrit","संस्कृतम्","sa","san","san"],["Church Slavic, Church Slavonic, Old Church Slavonic, Old Slavonic, Old Bulgarian","ѩзыкъ словѣньскъ","cu","chu","chu"],["Pali","पाऴि","pi","pli","pli"],["Avestan","avesta","ae","ave","ave"],["Latin","latine, lingua latina","la","lat","lat"],["Armenian","Հայերեն","hy","hye","arm"],["Swati","SiSwati","ss","ssw","ssw"],["Tibetan","བོད་ཡིག","bo","bod","tib"],["South Ndebele","isiNdebele","nr","nbl","nbl"],["Slovene","Slovenski Jezik, Slovenščina","sl","slv","slv"],["Oriya","ଓଡ଼ିଆ","or","ori","ori"],["North Ndebele","isiNdebele","nd","nde","nde"],["Nauru","Dorerin Naoero","na","nau","nau"],["Maori","te reo Māori","mi","mri","mao"],["Marathi","मराठी","mr","mar","mar"],["Luba-Katanga","Kiluba","lu","lub","lub"],["Rundi","Ikirundi","rn","run","run"],["Central Khmer","ខ្មែរ, ខេមរភាសា, ភាសាខ្មែរ","km","khm","khm"],["Western Frisian","Frysk","fy","fry","fry"],["Bengali","বাংলা","bn","ben","ben"],["Avaric","авар мацӀ, магӀарул мацӀ","av","ava","ava"],["Abkhazian","аҧсуа бызшәа, аҧсшәа","ab","abk","abk"],["Afar","Afaraf","aa","aar","aar"],["Afrikaans","Afrikaans","af","afr","afr"],["Amharic","አማርኛ","am","amh","amh"],["Aragonese","aragonés","an","arg","arg"],["Assamese","অসমীয়া","as","asm","asm"],["Bambara","bamanankan","bm","bam","bam"],["Bashkir","башҡорт теле","ba","bak","bak"],["Basque","euskara, euskera","eu","eus","baq"],["Belarusian","беларуская мова","be","bel","bel"],["Bosnian","bosanski jezik","bs","bos","bos"],["Breton","brezhoneg","br","bre","bre"],["Bulgarian","български език","bg","bul","bul"],["Burmese","ဗမာစာ","my","mya","bur"],["Catalan, Valencian","català, valencià","ca","cat","cat"],["Chamorro","Chamoru","ch","cha","cha"],["Chechen","нохчийн мотт","ce","che","che"],["Chichewa, Chewa, Nyanja","chiCheŵa, chinyanja","ny","nya","nya"],["Chuvash","чӑваш чӗлхи","cv","chv","chv"],["Cornish","Kernewek","kw","cor","cor"],["Corsican","corsu, lingua corsa","co","cos","cos"],["Croatian","hrvatski jezik","hr","hrv","hrv"],["Czech","čeština, český jazyk","cs","ces","cze"],["Danish","dansk","da","dan","dan"],["Divehi, Dhivehi, Maldivian","ދިވެހި","dv","div","div"],["Dutch, Flemish","Nederlands, Vlaams","nl","nld","dut"],["Dzongkha","རྫོང་ཁ","dz","dzo","dzo"],["English","English","en","eng","eng"],["Ewe","Eʋegbe","ee","ewe","ewe"],["Faroese","føroyskt","fo","fao","fao"],["Fijian","vosa Vakaviti","fj","fij","fij"],["Finnish","suomi, suomen kieli","fi","fin","fin"],["French","français, langue française","fr","fra","fre"],["Galician","Galego","gl","glg","glg"],["Georgian","ქართული","ka","kat","geo"],["German","Deutsch","de","deu","ger"],["Greek (modern)","ελληνικά","el","ell","gre"],["Gujarati","ગુજરાતી","gu","guj","guj"],["Haitian, Haitian Creole","Kreyòl ayisyen","ht","hat","hat"],["Hausa","(Hausa) هَوُسَ","ha","hau","hau"],["Herero","Otjiherero","hz","her","her"],["Hindi","हिन्दी, हिंदी","hi","hin","hin"],["Hiri Motu","Hiri Motu","ho","hmo","hmo"],["Hungarian","magyar","hu","hun","hun"],["Irish","Gaeilge","ga","gle","gle"],["Igbo","Asụsụ Igbo","ig","ibo","ibo"],["Icelandic","Íslenska","is","isl","ice"],["Italian","Italiano","it","ita","ita"],["Japanese","日本語 (にほんご)","ja","jpn","jpn"],["Javanese","ꦧꦱꦗꦮ, Basa Jawa","jv","jav","jav"],["Kalaallisut, Greenlandic","kalaallisut, kalaallit oqaasii","kl","kal","kal"],["Kannada","ಕನ್ನಡ","kn","kan","kan"],["Kashmiri","कश्मीरी, كشميري","ks","kas","kas"],["Kazakh","қазақ тілі","kk","kaz","kaz"],["Kikuyu, Gikuyu","Gĩkũyũ","ki","kik","kik"],["Kinyarwanda","Ikinyarwanda","rw","kin","kin"],["Kirghiz, Kyrgyz","Кыргызча, Кыргыз тили","ky","kir","kir"],["Korean","한국어","ko","kor","kor"],["Kuanyama, Kwanyama","Kuanyama","kj","kua","kua"],["Luxembourgish, Letzeburgesch","Lëtzebuergesch","lb","ltz","ltz"],["Ganda","Luganda","lg","lug","lug"],["Limburgan, Limburger, Limburgish","Limburgs","li","lim","lim"],["Lingala","Lingála","ln","lin","lin"],["Lao","ພາສາລາວ","lo","lao","lao"],["Lithuanian","lietuvių kalba","lt","lit","lit"],["Manx","Gaelg, Gailck","gv","glv","glv"],["Macedonian","македонски јазик","mk","mkd","mac"],["Malayalam","മലയാളം","ml","mal","mal"],["Maltese","Malti","mt","mlt","mlt"],["Marshallese","Kajin M̧ajeļ","mh","mah","mah"],["Navajo, Navaho","Diné bizaad","nv","nav","nav"],["Nepali","नेपाली","ne","nep","nep"],["Ndonga","Owambo","ng","ndo","ndo"],["Occitan","occitan, lenga d'òc","oc","oci","oci"],["Ossetian, Ossetic","ирон æвзаг","os","oss","oss"],["Panjabi, Punjabi","ਪੰਜਾਬੀ","pa","pan","pan"],["Polish","język polski, polszczyzna","pl","pol","pol"],["Portuguese","Português","pt","por","por"],["Romansh","Rumantsch Grischun","rm","roh","roh"],["Russian","русский","ru","rus","rus"],["Sindhi","सिन्धी, سنڌي، سندھی","sd","snd","snd"],["Northern Sami","Davvisámegiella","se","sme","sme"],["Samoan","gagana fa'a Samoa","sm","smo","smo"],["Sango","yângâ tî sängö","sg","sag","sag"],["Gaelic, Scottish Gaelic","Gàidhlig","gd","gla","gla"],["Shona","chiShona","sn","sna","sna"],["Sinhala, Sinhalese","සිංහල","si","sin","sin"],["Slovak","Slovenčina, Slovenský Jazyk","sk","slk","slo"],["Somali","Soomaaliga, af Soomaali","so","som","som"],["Southern Sotho","Sesotho","st","sot","sot"],["Spanish, Castilian","Español","es","spa","spa"],["Sundanese","Basa Sunda","su","sun","sun"],["Swedish","Svenska","sv","swe","swe"],["Tamil","தமிழ்","ta","tam","tam"],["Telugu","తెలుగు","te","tel","tel"],["Tajik","тоҷикӣ, toçikī, تاجیکی","tg","tgk","tgk"],["Thai","ไทย","th","tha","tha"],["Tigrinya","ትግርኛ","ti","tir","tir"],["Turkmen","Türkmen, Түркмен","tk","tuk","tuk"],["Tswana","Setswana","tn","tsn","tsn"],["Tongan (Tonga Islands)","Faka Tonga","to","ton","ton"],["Turkish","Türkçe","tr","tur","tur"],["Tsonga","Xitsonga","ts","tso","tso"],["Tatar","татар теле, tatar tele","tt","tat","tat"],["Uighur, Uyghur","ئۇيغۇرچە, Uyghurche","ug","uig","uig"],["Ukrainian","Українська","uk","ukr","ukr"],["Urdu","اردو","ur","urd","urd"],["Venda","Tshivenḓa","ve","ven","ven"],["Vietnamese","Tiếng Việt","vi","vie","vie"],["Walloon","Walon","wa","wln","wln"],["Welsh","Cymraeg","cy","cym","wel"],["Wolof","Wollof","wo","wol","wol"],["Xhosa","isiXhosa","xh","xho","xho"],["Yoruba","Yorùbá","yo","yor","yor"],["Zulu","isiZulu","zu","zul","zul"]].forEach(e=>{var t={name:e[0],nativeName:e[1],iso639_1:e[2],iso639_2T:e[3],iso639_2B:e[4]};o[e[2]]=i[e[3]]=a[e[4]]=t,r.push(t)});var l=r;function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var u={"zh-hans":"中文 (Zhōngwén)"};function d(e){if(!e)return null;if(e=e.toLocaleLowerCase(),u[e])return e;var t=f(e,["iso639_1"])||f(e,["iso639_2T"])||f(e,["iso639_2B","name","nativeName"]);return t?t.iso639_1:null}function h(e){if(!e)return null;if(e=e.toLocaleLowerCase(),u[e])return u[e];var t=f(e,["iso639_1"])||f(e,["iso639_2T"])||f(e,["iso639_2B","name","nativeName"]);return null!=t&&t.nativeName?t.nativeName.split(", ")[0]:null}function f(e,t){if(!e)return null;e=e.toLowerCase();var n,r=s(l);try{for(r.s();!(n=r.n()).done;){var o,i=n.value,a=s(t);try{for(a.s();!(o=a.n()).done;){var c;if(null!==(c=i[o.value])&&void 0!==c&&c.toLowerCase().split(", ").includes(e))return i}}catch(e){a.e(e)}finally{a.f()}}}catch(e){r.e(e)}finally{r.f()}return null}function p(){try{return!!window.localStorage}catch(e){return!1}}var m=-1!=location.toString().indexOf("_debugReadAloud=true")},7279:function(e,t,n){n.d(t,{yc:function(){return _e},bg:function(){return ge},lB:function(){return Be}});var r=function(){return n(6518)},o=function(){return n(655)},i=n.cw(function(e,t){var r=n(3724),o=n(2106),i=n(5213),a=n(7979);r&&!i.correct&&(o(RegExp.prototype,"flags",{configurable:!0,get:a}),i.correct=!0)}),a=n.cw(function(e,t){var i=r(),a=n(9565),l=n(7476),s=n(3994),c=n(2529),u=n(7750),d=n(8014),h=o(),f=n(8551),p=n(34),m=n(2195),g=n(788),y=n(1034),v=n(5966),b=n(6840),A=n(9039),k=n(8227),w=n(2293),C=n(7829),x=n(6682),S=n(1181),E=n(6395),B=k("matchAll"),R="RegExp String",T=R+" Iterator",_=S.set,j=S.getterFor(T),O=RegExp.prototype,I=TypeError,L=l("".indexOf),P=l("".matchAll),N=!!P&&!A(function(){P("a",/./)}),F=s(function(e,t,n,r){_(this,{type:T,regexp:e,string:t,global:n,unicode:r,done:!1})},R,function(){var e=j(this);if(e.done)return c(void 0,!0);var t=e.regexp,n=e.string,r=x(t,n);return null===r?(e.done=!0,c(void 0,!0)):e.global?(""===h(r[0])&&(t.lastIndex=C(n,d(t.lastIndex),e.unicode)),c(r,!1)):(e.done=!0,c(r,!1))}),D=function(e){var t,n,r,o=f(this),i=h(e),a=w(o,RegExp),l=h(y(o));return t=new a(a===RegExp?o.source:o,l),n=!!~L(l,"g"),r=!!~L(l,"u")||!!~L(l,"v"),t.lastIndex=d(o.lastIndex),new F(t,i,n,r)};i({target:"String",proto:!0,forced:N},{matchAll:function(e){var t,n,r,o,i=u(this);if(p(e)){if(g(e)&&(t=h(u(y(e))),!~L(t,"g")))throw new I("`.matchAll` does not allow non-global regexes");if(N)return P(i,e);if(void 0===(r=v(e,B))&&E&&"RegExp"===m(e)&&(r=D),r)return a(r,e,i)}else if(N)return P(i,e);return n=h(i),o=new RegExp(e,"g"),E?a(D,o,n):o[B](n)}}),E||B in O||b(O,B,D)}),l=n.cw(function(e,t){var i=r(),a=n(9504),l=n(5397),s=n(8981),c=o(),u=n(6198),d=a([].push),h=a([].join);i({target:"String",stat:!0},{raw:function(e){var t=l(s(e).raw),n=u(t);if(!n)return"";for(var r=arguments.length,o=[],i=0;;){if(d(o,c(t[i++])),i===n)return h(o,"");i<r&&d(o,c(arguments[i]))}}})}),s=n.cw(function(e,t){a()});n(2675),n(9463),n(2259),n(5700),n(8125),n(8706),n(2008),n(113),n(3418),n(4423),n(3792),n(8598),n(2062),n(4782),n(4554),n(739),n(9572),n(2010),n(4731),n(479),n(2892),n(9085),n(2811),n(3851),n(875),n(9432),n(6099),n(8459),n(3362),n(825),n(888),n(4864),n(7495),i(),n(8781),n(1699),n(7764),n(1761),l(),n(5440),n(2762),s(),n(3500),n(2953),n(8408);var c=n(9073),u=n(1669);function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,p(r.key),r)}}function f(e,t,n){return(t=p(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e){var t=function(e){if("object"!=d(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==d(t)?t:t+""}var m,g,y,v,b,A,k,w,C,x,S,E,B,R,T,_,j,O=function(){return e=function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),f(this,"selecting",!1),f(this,"startedInSelector",!1),f(this,"target",null),f(this,"lastKnownFocusNode",null),f(this,"_onSelectionChange",function(){var e=window.getSelection();if(e){var t=function(e){if(!e.isCollapsed)return!1;for(var t=0;t<e.rangeCount;t++)if(!e.getRangeAt(t).collapsed)return!1;return!0}(e);if(!r.selecting&&e.toString()){var n=u(e.anchorNode).closest(r.selector)[0];if(!n)return;r.target=n,r.selecting=!0,r.lastKnownFocusNode=e.focusNode,r.handler("started",r.target)}r.selecting&&r.lastKnownFocusNode!=e.focusNode&&e.toString()&&!t&&(r.lastKnownFocusNode=e.focusNode,r.handler("changed",r.target)),!r.selecting||!t&&e.toString()&&u(e.anchorNode).closest(r.selector)[0]||(r.selecting=!1,r.lastKnownFocusNode=null,r.handler("cleared",r.target))}}),this.selector=t,this.handler=n},(t=[{key:"attach",value:function(){document.addEventListener("selectionchange",this._onSelectionChange)}},{key:"detach",value:function(){document.removeEventListener("selectionchange",this._onSelectionChange)}}])&&h(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),I=n(8004),L=n(6205),P=n(9696),N=n(4535),F=(n(90),n(8918),n(6090),n(7583)),D=n(1989),z=n(1669);function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}function q(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ne(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function H(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function G(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){H(i,r,o,a,l,"next",e)}function l(e){H(i,r,o,a,l,"throw",e)}a(void 0)})}}function U(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function W(e,t,n){return t=ae(t),function(e,t){if(t&&("object"==M(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,K()?Reflect.construct(t,n||[],ae(e).constructor):t.apply(e,n))}function K(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(K=function(){return!!e})()}function J(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$(e,t)}function $(e,t){return $=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$(e,t)}function V(e,t,n,r){var o=X();if(r)for(var i=0;i<r.length;i++)o=r[i](o);var a=t(function(e){o.initializeInstanceElements(e,l.elements)},n),l=o.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===i.key&&e.placement===i.placement},r=0;r<e.length;r++){var o,i=e[r];if("method"===i.kind&&(o=t.find(n)))if(ee(i.descriptor)||ee(o.descriptor)){if(Q(i)||Q(o))throw new ReferenceError("Duplicated methods ("+i.key+") can't be decorated.");o.descriptor=i.descriptor}else{if(Q(i)){if(Q(o))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+i.key+").");o.decorators=i.decorators}Z(i,o)}else t.push(i)}return t}(a.d.map(Y)),e);return o.initializeClassElements(a.F,l.elements),o.runClassFinishers(a.F,l.finishers)}function X(){X=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach(function(n){t.forEach(function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)},this)},this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach(function(r){t.forEach(function(t){var o=t.placement;if(t.kind===r&&("static"===o||"prototype"===o)){var i="static"===o?e:n;this.defineClassElement(i,t)}},this)},this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],o={static:[],prototype:[],own:[]};if(e.forEach(function(e){this.addElementPlacement(e,o)},this),e.forEach(function(e){if(!Q(e))return n.push(e);var t=this.decorateElement(e,o);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)},this),!t)return{elements:n,finishers:r};var i=this.decorateConstructor(n,t);return r.push.apply(r,i.finishers),i.finishers=r,i},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],o=e.decorators,i=o.length-1;i>=0;i--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var l=this.fromElementDescriptor(e),s=this.toElementFinisherExtras((0,o[i])(l)||l);e=s.element,this.addElementPlacement(e,t),s.finisher&&r.push(s.finisher);var c=s.extras;if(c){for(var u=0;u<c.length;u++)this.addElementPlacement(c[u],t);n.push.apply(n,c)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var o=this.fromClassDescriptor(e),i=this.toClassDescriptor((0,t[r])(o)||o);if(void 0!==i.finisher&&n.push(i.finisher),void 0!==i.elements){e=i.elements;for(var a=0;a<e.length-1;a++)for(var l=a+1;l<e.length;l++)if(e[a].key===e[l].key&&e[a].placement===e[l].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:n}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||ne(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map(function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t},this);var t},toElementDescriptor:function(e){var t=e.kind+"";if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var n=pe(e.key),r=e.placement+"";if("static"!==r&&"prototype"!==r&&"own"!==r)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+r+'"');var o=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var i={kind:t,key:n,placement:r,descriptor:Object.assign({},o)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(o,"get","The property descriptor of a field descriptor"),this.disallowProperty(o,"set","The property descriptor of a field descriptor"),this.disallowProperty(o,"value","The property descriptor of a field descriptor"),i.initializer=e.initializer),i},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:te(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=e.kind+"";if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var n=te(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function Y(e){var t,n=pe(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function Z(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function Q(e){return e.decorators&&e.decorators.length}function ee(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function te(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function ne(e,t){if(e){if("string"==typeof e)return re(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?re(e,t):void 0}}function re(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oe(e,t,n,r){var o=ie(ae(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function ie(){return ie="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=ae(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},ie.apply(null,arguments)}function ae(e){return ae=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ae(e)}function le(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(M(e)+" is not iterable")}function se(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return ce(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,h.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=h.p,p=i[2];n>3?(o=p===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,h.v=r,h.n=i[1]):f<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,h.n=p,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,p),l=u,s=p;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(h.n=-1),f(l,s)):h.n=s:h.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=h.n<0)?s:n.call(r,h))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(ce(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ce(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,ce(d,"constructor",c),ce(c,"constructor",s),s.displayName="GeneratorFunction",ce(c,o,"GeneratorFunction"),ce(d),ce(d,o,"Generator"),ce(d,r,function(){return this}),ce(d,"toString",function(){return"[object Generator]"}),(se=function(){return{w:i,m:h}})()}function ce(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ce=function(e,t,n,r){function i(t,n){ce(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},ce(e,t,n,r)}function ue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function de(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,pe(r.key),r)}}function he(e,t,n){return t&&de(e.prototype,t),n&&de(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fe(e,t,n){return(t=pe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pe(e){var t=function(e){if("object"!=M(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=M(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==M(t)?t:t+""}var me="BRhighlightStorage",ge=function(){return he(function e(t,n,r,o){var i=this,a=r.selectionElement;ue(this,e),fe(this,"options",{maxProtectedWords:200}),fe(this,"selectMenu",void 0),fe(this,"_onSelectionChange",function(e,t){if("started"===e)i.textSelectingMode(t);else if("cleared"===e)i.defaultMode(t);else if("changed"!==e)throw new Error("Unknown type ".concat(e))}),fe(this,"_limitSelection",function(){var e=window.getSelection();if(e.rangeCount){var t=e.getRangeAt(0),n=!!t.startContainer.parentElement.closest(".BRcontainer"),r=!!t.endContainer.parentElement.closest(".BRcontainer");if(n||r)if(n&&r){var o=(0,D.eU)((0,D.nC)(ye(t,"element"),function(e){return e.classList.contains(i.selectionElement[0].replace(".",""))}),i.options.maxProtectedWords-1);if(o&&t.endContainer.parentNode!=o){var a=document.createRange();a.setStart(t.startContainer,t.startOffset),a.setEnd(o.firstChild,o.textContent.length),e.removeAllRanges(),e.addRange(a)}}else e.removeAllRanges()}}),this.layer=t,this.br=n,this.selectionElement=a,this.selectionObserver=new O(this.layer,this._onSelectionChange),this.options.maxProtectedWords=o||200,this.selectMenu=new ve(n),this.selectMenu.className="br-select-menu__root"},[{key:"selectMenuEnabled",get:function(){var e,t;return(null===(e=this.br.plugins.experiments)||void 0===e?void 0:e.isEnabled("copyLinkToHighlight"))||(null===(t=this.br.plugins.experiments)||void 0===t?void 0:t.isEnabled("annotateHighlight"))}},{key:"init",value:function(){var e=this;this.attach(),new O(this.layer,function(t){var n,r;"started"==t&&(null===(n=e.br.plugins.archiveAnalytics)||void 0===n||n.sendEvent("BookReader","SelectStart"),e.br.refs.$br.find(".BRpagecontainer--hasSelection").removeClass("BRpagecontainer--hasSelection"),z(window.getSelection().anchorNode).closest(".BRpagecontainer").addClass("BRpagecontainer--hasSelection"),e.mouseIsDown||e.showSelectMenu()),"changed"==t&&!e.mouseIsDown&&null!==(r=window.getSelection())&&void 0!==r&&r.toString()&&e.showSelectMenu(),"cleared"==t&&e.hideSelectMenu()}).attach()}},{key:"attach",value:function(){var e=this;this.selectionObserver.attach(),this.br.protected&&(document.addEventListener("selectionchange",this._limitSelection),z(document.body).on("contextmenu dragstart copy",function(t){var n=document.getSelection();if(null!=n&&n.toString()&&z(e.layer).toArray().some(function(e){return n.containsNode(e,!0)}))return t.preventDefault(),!1}))}},{key:"detach",value:function(){this.selectionObserver.detach(),this.br.protected&&document.removeEventListener("selectionchange",this._limitSelection)}},{key:"interceptCopy",value:function(e){e[0].addEventListener("copy",function(e){var t=document.getSelection();e.clipboardData.setData("text/plain",t.toString()),e.preventDefault()})}},{key:"stopPageFlip",value:function(e){var t=this,n=e.find(this.layer);n.length&&(n.each(function(e,n){return t.defaultMode(n)}),this.br.protected||this.interceptCopy(e))}},{key:"defaultMode",value:function(e){var t=this,n=z(e).closest(".BRpagecontainer");e.style.pointerEvents="none",n.find("img").css("pointer-events","auto"),z(e).off(".textSelectPluginHandler");var r=this.mouseIsDown,o=this.mouseIsDown;r&&(e.style.pointerEvents="auto"),z(e).on("mousedown.textSelectPluginHandler",function(e){t.mouseIsDown=!0,z(e.target).is(t.selectionElement.join(", "))&&e.stopPropagation()}),z(e).on("mouseup.textSelectPluginHandler",function(n){t.mouseIsDown=!1,e.style.pointerEvents="none",o&&(o=!1,n.stopPropagation())})}},{key:"textSelectingMode",value:function(e){var t=this,n=z(e).closest(".BRpagecontainer");e.style.pointerEvents="all",n.find("img").css("pointer-events","none"),z(e).off(".textSelectPluginHandler"),z(e).on("mousedown.textSelectPluginHandler",function(e){1==e.which&&(t.mouseIsDown=!0,e.stopPropagation())}),z(e).on("mouseup.textSelectPluginHandler",function(e){t.mouseIsDown=!1,1==e.which&&(e.stopPropagation(),t.showSelectMenu())})}},{key:"showSelectMenu",value:function(){this.selectMenuEnabled&&(this.selectMenu.copyLinkToHighlightEnabled=this.br.plugins.experiments.isEnabled("copyLinkToHighlight"),this.selectMenu.highlightAnnotationEnabled=this.br.plugins.experiments.isEnabled("annotateHighlight"),this.selectMenu.isConnected||document.body.append(this.selectMenu),this.selectMenu.open?this.selectMenu.repositionToSelection():this.selectMenu.show())}},{key:"hideSelectMenu",value:function(){this.selectMenu.hide()}}])}();function ye(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text+element";return se().m(function n(){var r,o,i,a,l;return se().w(function(n){for(;;)switch(n.n){case 0:return l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.children,r=void 0===n||n,s=t.parents,c=void 0===s||s,u=t.siblings,d=void 0===u||u;return se().m(function t(){var n;return se().w(function(t){for(;;)switch(t.n){case 0:if(e!==o){t.n=2;break}if(i=!0,!a(e)){t.n=1;break}return t.n=1,e;case 1:return t.a(2);case 2:if(!a(e)){t.n=3;break}return t.n=3,e;case 3:if(!r||!e.firstChild){t.n=5;break}return t.d(le(l(e.firstChild,{children:!0,parents:!1,siblings:!0})),4);case 4:if(!i){t.n=5;break}return t.a(2);case 5:if(!d){t.n=9;break}n=e.nextSibling;case 6:if(!n){t.n=9;break}return t.d(le(l(n,{children:!0,parents:!1,siblings:!1})),7);case 7:if(!i){t.n=8;break}return t.a(2);case 8:n=n.nextSibling,t.n=6;break;case 9:if(!c||!e.parentNode){t.n=11;break}return t.d(le(l(e.parentNode,{children:!1,parents:!0,siblings:!0})),10);case 10:if(!i){t.n=11;break}return t.a(2);case 11:return t.a(2)}},t)})()},r=e.startContainer,o=e.endContainer,i=!1,a=function(e){return"text"===t&&e.nodeType===Node.TEXT_NODE||"element"===t&&e.nodeType===Node.ELEMENT_NODE||"text+element"===t},n.d(le(l(r)),1);case 1:return n.a(2)}},n)})()}V([(0,P.EM)("br-menu-option")],function(e,t){var n=function(t){function n(){var t;ue(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return t=W(this,n,[].concat(o)),e(t),t}return J(n,t),he(n)}(t);return{F:n,d:[{kind:"field",decorators:[(0,P.MZ)({type:String})],key:"icon",value:function(){return""}},{kind:"field",decorators:[(0,P.MZ)({type:String})],key:"label",value:function(){return""}},{kind:"field",key:"temporaryText",value:function(){return null}},{kind:"field",decorators:[(0,P.MZ)({type:Number,attribute:"temporary-text-duration"})],key:"temporaryTextDuration",value:function(){return 1200}},{kind:"field",decorators:[(0,P.MZ)({type:String,attribute:"aria-label"})],key:"ariaLabel",value:function(){return""}},{kind:"field",decorators:[(0,P.MZ)({type:Boolean,attribute:"live-label"})],key:"liveLabel",value:function(){return!1}},{kind:"field",decorators:[(0,P.MZ)({type:Boolean})],key:"temporaryTextVisible",value:function(){return!1}},{kind:"field",key:"temporaryTextTimeoutId",value:function(){return null}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"disconnectedCallback",value:function(){null!=this.temporaryTextTimeoutId&&(window.clearTimeout(this.temporaryTextTimeoutId),this.temporaryTextTimeoutId=null),oe(n,"disconnectedCallback",this,3)([])}},{kind:"method",key:"showTemporaryText",value:function(e){var t=this;null!=e&&e.trim()&&(this.temporaryText=e,this.temporaryTextVisible=!0,null!=this.temporaryTextTimeoutId&&window.clearTimeout(this.temporaryTextTimeoutId),this.temporaryTextTimeoutId=window.setTimeout(function(){t.temporaryTextVisible=!1,t.temporaryText=null,t.temporaryTextTimeoutId=null},this.temporaryTextDuration))}},{kind:"method",key:"renderIcon",value:function(){return"share"===this.icon?(0,L.qy)(m||(m=U(['<ia-icon-share class="br-select-menu__icon" aria-hidden="true"></ia-icon-share>']))):"edit-pencil"===this.icon?(0,L.qy)(g||(g=U(['<ia-icon-edit-pencil class="br-select-menu__icon" aria-hidden="true"></ia-icon-edit-pencil>']))):"ellipses"===this.icon?(0,L.qy)(y||(y=U(['<ia-icon-ellipses class="br-select-menu__icon" aria-hidden="true"></ia-icon-ellipses>']))):""}},{kind:"method",key:"render",value:function(){var e,t,n=null!==(e=this.label)&&void 0!==e?e:"",r=!!this.temporaryText,o=r?this.temporaryText:n,i=r&&this.temporaryTextVisible,a=i?o:n,l=null===(t=this.ariaLabel)||void 0===t?void 0:t.trim(),s=l&&l!==a.trim()?l:void 0,c=n.length>=o.length?n:o;return(0,L.qy)(v||(v=U(['\n <button\n type="button"\n class="br-select-menu__option"\n role="menuitem"\n aria-label=',"\n >\n ","\n ","\n </button>\n "])),(0,N.J)(s),this.renderIcon(),r||n?r?(0,L.qy)(b||(b=U(['\n <span class="br-select-menu__label-wrap" style="display: inline-flex; position: relative; align-items: center;">\n <span\n class="br-select-menu__label"\n style="visibility: hidden;"\n aria-hidden="true"\n >','</span>\n <span\n class="br-select-menu__label"\n style="position: absolute; inset: 0; display: inline-flex; align-items: center;"\n aria-live=',"\n >","</span>\n </span>\n "])),c,this.liveLabel?"polite":"off",i?o:n):(0,L.qy)(A||(A=U(['\n <span class="br-select-menu__label" aria-live=',">","</span>\n "])),this.liveLabel?"polite":"off",n):"")}}]}},L.WF);var ve=V([(0,P.EM)("br-select-menu")],function(e,t){var n,r,o=function(t){function n(t){var r;return ue(this,n),r=W(this,n),e(r),r.br=t,r}return J(n,t),he(n)}(t);return{F:o,d:[{kind:"field",key:"br",value:void 0},{kind:"field",decorators:[(0,P.MZ)({type:Boolean,reflect:!0})],key:"showExtended",value:function(){return!1}},{kind:"field",decorators:[(0,P.P)("#br-select-copy-link-option")],key:"copyLinkOption",value:void 0},{kind:"field",decorators:[(0,P.MZ)({type:Boolean,reflect:!0})],key:"open",value:function(){return!1}},{kind:"field",decorators:[(0,P.MZ)({type:Boolean})],key:"copyLinkToHighlightEnabled",value:function(){return!0}},{kind:"field",decorators:[(0,P.MZ)({type:Boolean})],key:"highlightAnnotationEnabled",value:function(){return!0}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"field",key:"_scrollTimeoutId",value:function(){return null}},{kind:"field",key:"_onScroll",value:function(){var e=this;return function(){e.classList.add("br-select-menu__root--scrolling"),null!=e._scrollTimeoutId&&clearTimeout(e._scrollTimeoutId),e._scrollTimeoutId=window.setTimeout(function(){e._scrollTimeoutId=null,e.repositionToSelection(),e.classList.remove("br-select-menu__root--scrolling")},150)}}},{kind:"method",key:"connectedCallback",value:function(){oe(o,"connectedCallback",this,3)([]),this.setAttribute("role","menu"),this.setAttribute("aria-label","Text selection actions"),this.setAttribute("aria-orientation","vertical")}},{kind:"method",key:"disconnectedCallback",value:function(){oe(o,"disconnectedCallback",this,3)([]),window.removeEventListener("scroll",this._onScroll,{capture:!0}),null!=this._scrollTimeoutId&&(clearTimeout(this._scrollTimeoutId),this._scrollTimeoutId=null)}},{kind:"method",key:"renderCopyLinkToHighlightOption",value:function(){return(0,L.qy)(k||(k=U(['\n <br-menu-option\n id="br-select-copy-link-option"\n @mousedown=',"\n @click=",'\n icon="share"\n label="Copy Link to Highlight"\n live-label\n ></br-menu-option>\n '])),function(e){return e.preventDefault()},this.handleCopyLinkToHighlight)}},{kind:"method",key:"renderRemoveOption",value:function(){return(0,L.qy)(w||(w=U(["\n <br-menu-option\n @click=",'\n icon="share"\n label="Delete Highlight and Annotation"\n ></br-menu-option>\n '])),this.handleDeleteHighlight)}},{kind:"method",key:"renderAddAnnotationOption",value:function(){return(0,L.qy)(C||(C=U(["\n <br-menu-option\n @click=",'\n icon="edit-pencil"\n label="Annotate"\n ></br-menu-option>\n '])),this.handleAddAnnotation)}},{kind:"method",key:"renderHighlightOption",value:function(){return(0,L.qy)(x||(x=U(["\n <br-menu-option\n @click=",'\n icon="edit-pencil"\n label="Highlight Selection"\n ></br-menu-option>\n '])),this.handleHighlightSave)}},{kind:"method",key:"renderShowMoreOption",value:function(){return(0,L.qy)(S||(S=U(['\n <br-menu-option\n id="br-select-more"\n @mousedown=',"\n @click=",'\n icon="ellipses"\n aria-label="Show more options"\n ></br-menu-option>\n '])),function(e){return e.preventDefault()},this.toggleExtendedMenu)}},{kind:"method",key:"renderLocalStorageOptions",value:function(){return(0,L.qy)(E||(E=U(["\n <br-menu-option\n @click=",'\n icon="share"\n label="Load Highlights"\n ></br-menu-option>\n <br-menu-option\n @click=','\n icon="share"\n label="Remove Stored Highlights"\n ></br-menu-option>'])),this.renderSavedHighlights,function(){window.localStorage.removeItem(me)})}},{kind:"method",key:"renderDefaultOptions",value:function(){return(0,L.qy)(B||(B=U(["\n ","\n ","\n ","\n "])),this.copyLinkToHighlightEnabled?this.renderCopyLinkToHighlightOption():"",this.highlightAnnotationEnabled&&!this.nodesForRemoval?this.renderHighlightOption():"",this.nodesForRemoval?this.renderRemoveOption():"")}},{kind:"method",key:"renderExtendedOptions",value:function(){return(0,L.qy)(R||(R=U(["\n ","\n ","\n "])),this.renderDefaultOptions(),this.renderLocalStorageOptions())}},{kind:"method",key:"render",value:function(){var e,t=null===(e=this.br.plugins.experiments)||void 0===e?void 0:e.isEnabled("annotateHighlight");return(0,L.qy)(T||(T=U(["\n ","\n ","\n "])),this.showExtended?this.renderExtendedOptions():this.renderDefaultOptions(),!this.showExtended&&t?this.renderShowMoreOption():"")}},{kind:"method",key:"handleCopyLinkToHighlight",value:(r=G(se().m(function e(t){var n,r,o,i,a,l;return se().w(function(e){for(;;)switch(e.n){case 0:if(t.preventDefault(),r=window.getSelection(),o=r.getRangeAt(0),i=this.getNodeTextLayer(o.startContainer)){e.n=1;break}return console.warn("No text layer found for selection"),e.a(2);case 1:return a=_e.fromSelection(r,[i]),l=a.toUrl(),e.n=2,navigator.clipboard.writeText(l);case 2:null===(n=this.copyLinkOption)||void 0===n||n.showTemporaryText("Copied!"),this.br.trigger("copyLinkToHighlight",{textFragment:a,link:l});case 3:return e.a(2)}},e,this)})),function(e){return r.apply(this,arguments)})},{kind:"method",key:"toggleExtendedMenu",value:function(e){e.preventDefault(),this.showExtended=!this.showExtended}},{kind:"method",key:"getNodeTextLayer",value:function(e){var t;if(!e)return null;var n=e instanceof Element?e:e.parentElement;return null!==(t=null==n?void 0:n.closest(".BRtextLayer"))&&void 0!==t?t:null}},{kind:"method",key:"handleHighlightSave",value:function(){var e=window.getSelection(),t="backward"===e.direction?e.focusNode.parentElement:e.anchorNode.parentElement,n=this.getNodeTextLayer(t),r=_e.fromSelection(e,[n.parentElement]);r.uuid="id-".concat(crypto.randomUUID().split("-")[4]);var o=this.loadHighlightsFromLocalStorage();o.push(r),this.saveToLocalStorage(o),this.renderSavedHighlights()}},{kind:"method",key:"handleAddAnnotation",value:function(e){}},{kind:"method",key:"handleDeleteHighlight",value:function(){if(this.nodesForRemoval){var e,t=Te(this.nodesForRemoval[0]),n=q(this.nodesForRemoval);try{for(n.s();!(e=n.n()).done;){var r=e.value,o=r.textContent,i=r.parentElement;i.classList.contains("BRwordElement")||i.classList.contains("BRspace")?(r.remove(),i.textContent=o):console.log("This element did not match removal criteria:",i,r)}}catch(e){n.e(e)}finally{n.f()}this.deleteHighlight(t),this.clearNodesForRemoval()}else console.log("there is nothing to remove")}},{kind:"method",key:"deleteHighlight",value:function(e){for(var t=this.loadHighlightsFromLocalStorage(),n=0;n<t.length;n++)if(t[n].uuid===e)return t.splice(n,1),void this.saveToLocalStorage(t)}},{kind:"method",key:"saveToLocalStorage",value:function(e){window.localStorage.setItem(me,JSON.stringify(e.map(function(e){return e.toJSON()})))}},{kind:"method",key:"loadHighlightsFromLocalStorage",value:function(){return JSON.parse(window.localStorage.getItem(me)||"[]").map(function(e){return _e.fromJSON(e)})}},{kind:"method",key:"renderSavedHighlights",value:function(){var e,t=this,n=q(this.loadHighlightsFromLocalStorage());try{for(n.s();!(e=n.n()).done;){var r=e.value,o=this.br.$(".pagediv".concat(r.pageIndex," .BRtextLayer"))[0];o&&(Be(o,r),z(o).off("mouseup.BRHighlightClick").on("mouseup.BRHighlightClick",function(e){e.target.classList.contains("BRhighlight")&&(e.stopPropagation(),t.handleHighlightClick(e.target))}))}}catch(e){n.e(e)}finally{n.f()}}},{kind:"method",key:"handleHighlightClick",value:function(e){var t=this.getNodeTextLayer(e),n=Te(e),r=t.querySelectorAll(".".concat(n)),o=r[0],i=r[r.length-1],a=document.createRange();a.setStart(o,0),a.setEnd(i,1);var l=window.getSelection();l.removeAllRanges(),l.addRange(a),this.show()}},{kind:"method",key:"repositionToSelection",value:function(){var e=window.getSelection().getRangeAt(0).getBoundingClientRect(),t=(0,F.un)()||(0,F.m0)(),n=(0,F.m0)()?25:(0,F.un)()?15:10,r=t?60:0,o=(e.top<r?e.bottom+r:e.bottom)+n,i=Math.max(10,o)+window.scrollY,a=this.getBoundingClientRect().width,l=document.documentElement.clientWidth,s=a>e.width?e.left+e.width/2-a/2:e.left,c=(0,I.qE)(s,10,l-a-10)+window.scrollX;this.style.top="".concat(i,"px"),this.style.left="".concat(c,"px")}},{kind:"method",key:"show",value:(n=G(se().m(function e(){var t;return se().w(function(e){for(;;)switch(e.n){case 0:if(null===(t=this.br.plugins.translate)||void 0===t||!t.userToggleTranslate){e.n=1;break}return e.a(2);case 1:return this.style.zIndex="1",this.style.position="absolute",this.open=!0,this.classList.remove("br-select-menu__root--scrolling"),window.removeEventListener("scroll",this._onScroll,{capture:!0}),window.addEventListener("scroll",this._onScroll,{capture:!0,passive:!0}),e.n=2,this.updateComplete;case 2:this.repositionToSelection(),this.clearNodesForRemoval();case 3:return e.a(2)}},e,this)})),function(){return n.apply(this,arguments)})},{kind:"method",key:"hide",value:function(){this.open&&(this.showExtended=!1,this.open=!1,window.removeEventListener("scroll",this._onScroll,{capture:!0}),this.clearNodesForRemoval())}},{kind:"field",key:"clearNodesForRemoval",value:function(){var e=this;return function(){e.nodesForRemoval=null,e.requestUpdate()}}}]}},L.WF);function be(e,t){t=t.trim();var n=new RegExp(String.raw(_||(_=U(["^(S+(s+|$)){1,","}"],["^(\\S+(\\s+|$)){1,","}"])),e)),r=t.match(n);return r?r[0].trim():""}function Ae(e,t){t=t.trim();var n=new RegExp(String.raw(j||(j=U(["((^|s+)S+){1,","}s*?$"],["((^|\\s+)\\S+){1,","}\\s*?$"])),e)),r=t.match(n);return r?r[0].trim():""}function ke(e){for(;e.firstChild;)e=e.firstChild;return e}function we(e){for(;e.lastChild;)e=e.lastChild;return e}function Ce(e){return e.replace(/(:|-,|,-|,|\n)/g,function(e){return 1===e.length?" ":" "})}function xe(e,t,n){var r=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).normalize,o=void 0===r?function(e){return e}:r;if(n.length){var i=n[0]===t.startContainer?t.startOffset:0,a=o(Ee(t)),l=o(n[0].textContent.slice(0,i)).length,s=new RegExp(e.source,e.flags.includes("g")?e.flags:"".concat(e.flags,"g")),c=Array.from(a.matchAll(s)).map(function(e){var t=Se(l+e.index,n,!1,{normalize:o}),r=Se(l+e.index+e[0].length,n,!0,{normalize:o});if(t&&r){var i=new Range;return i.setStart(t.node,t.offset),i.setEnd(r.node,r.offset),i}console.warn("Could not find boundary points for regex match, skipping this match",{match:e,start:t,end:r})}).filter(function(e){return!!e});if(null!=c&&c.length)return c}}function Se(e,t,n){var r,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).normalize,i=void 0===o?function(e){return e}:o,a=e,l=0,s=q(t);try{for(s.s();!(r=s.n()).done;){var c=r.value,u=c.textContent||"",d=i(u),h=l;if(h+d.length+(n?1:0)>a)for(var f=a-h,p=Math.min(f,u.length),m=n?d.substring(0,f):d.substring(f),g=i(n?u.substring(0,f):u.substring(f)),y=(n?-1:1)*(m.length>g.length?-1:1);p>=0&&p<=u.length;){if(g.length===m.length)return{node:c,offset:p};p+=y,g=i(n?u.substring(0,p):u.substring(p))}l+=d.length}}catch(e){s.e(e)}finally{s.f()}}function Ee(e){var t=Array.from((0,D.nC)(ye(e,"text"),Re)),n=t.map(function(e){return e.textContent}).join(""),r=t[0],o=t[t.length-1];return e.startContainer===r&&(n=n.substring(e.startOffset)),e.endContainer===o&&(n=n.substring(0,n.length-(o.textContent.length-e.endOffset))),n}function Be(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=ke(e),o=we(e),i=new Range;i.setStart(r,0),i.setEnd(o,o.textContent.length);var a=Array.from((0,D.nC)(ye(i,"text"),Re)),l=xe(t.toRegExp({context:!0}),i,a,{normalize:Ce});if(l){var s=Array.from((0,D.nC)(ye(l[0],"text"),Re)),c=xe(t.toRegExp({context:!1}),l[0],s,{normalize:Ce});if(!c)throw new Error("Could not find quote in page");var u=ke(c[0].startContainer),d=ke(c[0].endContainer),h=new Range;if(h.setStart(u,0),h.setEnd(d,d.textContent.length),!u.parentElement.classList.contains("BRhighlight")&&!d.parentElement.classList.contains("BRhighlight"))return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return document.createElement("mark")};if(e.startContainer.nodeType!=Node.TEXT_NODE||e.endContainer.nodeType!=Node.TEXT_NODE)return[];if(e.startContainer===e.endContainer){var n=t();return e.surroundContents(n),[n]}var r=e.startContainer,o=e.cloneRange();o.setEndAfter(r);var i=e.endContainer,a=e.cloneRange();a.setStartBefore(i);var l=[];e.setStartAfter(r),e.setEndBefore(i);for(var s=document.createTreeWalker(e.commonAncestorContainer,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,{acceptNode:function(t){return e.intersectsNode(t)?t.nodeType===Node.TEXT_NODE?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP:NodeFilter.FILTER_REJECT}}),c=s.nextNode();c;){if(c.nodeType===Node.TEXT_NODE){var u=t();c.parentNode.insertBefore(u,c),u.appendChild(c),l.push(u)}c=s.nextNode()}var d=t();o.surroundContents(d);var h=t();return a.surroundContents(h),[d].concat(l,[h])}(h,function(){var e=document.createElement("mark");return e.classList.add("BRhighlight"),n&&e.classList.add(n),t.uuid&&e.classList.add(t.uuid),e})}else console.warn("Could not find quote with context in page")}function Re(e){var t;return!(null!==(t=e.previousElementSibling)&&void 0!==t&&t.classList.contains("BRspace"))}function Te(e){if(!e)return null;var t=Array.from(null==e?void 0:e.classList).filter(function(e){if(e.slice(0,2).includes("id"))return e});return t.length?t[0]:null}var _e=function(){function e(t){var n=t.prefix,r=t.quote,o=t.quoteStart,i=t.quoteEnd,a=t.suffix,l=t.pageNumber,s=t.pageIndex,c=t.uuid;ue(this,e),this.prefix=n,this.quote=null!=r?r:null,this.quoteStart=null!=o?o:null,this.quoteEnd=null!=i?i:null,this.suffix=a,this.pageNumber=l,this.pageIndex=s,this.uuid=null!=c?c:null}return he(e,[{key:"toUrl",value:function(){var e=new URLSearchParams({text:this.toNormalizedString()}),t=window.location,n=encodeURIComponent(this.pageNumber||"n".concat(this.pageIndex));if(/^#\/?page\//.test(t.hash))return"".concat(t.origin).concat(t.pathname,"?").concat(e,"#page/").concat(n);var r=t.pathname.replace(/\/page\/.*/,"").replace(/\/+$/,"");return"".concat(t.origin).concat(r,"/page/").concat(n,"?").concat(e)}},{key:"toNormalizedString",value:function(){var e=function(e){return function(e){return e.replace(/\s+/g," ").trim()}(Ce(e).trim())},t=this.pageNumber?this.pageNumber:"n".concat(this.pageIndex);t+=":",this.prefix&&(t+=e(this.prefix),t+="-,");var n=this.quote?e(this.quote):null,r=null;if(n&&n.length>80&&(n.match(/\S+/g)||[]).length>=6){var o=be(3,n),i=Ae(3,n);o&&i&&(r={quoteStart:o,quoteEnd:i})}if(n&&!r)t+=n;else if(r)t+="".concat(r.quoteStart,",").concat(r.quoteEnd);else{if(!this.quoteStart||!this.quoteEnd)throw new Error("Text fragment requires either a quote or quoteStart/quoteEnd");t+="".concat(this.quoteStart,",").concat(this.quoteEnd)}return this.suffix&&(t+=",-",t+=e(this.suffix)),t}},{key:"toRegExp",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).context,t=void 0!==e&&e,n=this.quote?[this.quote]:[this.quoteStart,this.quoteEnd];t&&(this.prefix&&(n[0]=this.prefix+" "+n[0]),this.suffix&&(n[n.length-1]=n[n.length-1]+" "+this.suffix));var r=function(e){return RegExp.escape(Ce(e)).replace(/(\\x20)+/g,"\\s+")};return 1===n.length?new RegExp(r(n[0]),"gi"):new RegExp(r(n[0])+"[\\s\\S]*?"+r(n[1]),"gi")}},{key:"toJSON",value:function(){return{prefix:this.prefix,quote:this.quote,quoteStart:this.quoteStart,quoteEnd:this.quoteEnd,suffix:this.suffix,pageNumber:this.pageNumber,pageIndex:this.pageIndex,uuid:this.uuid}}}],[{key:"fromString",value:function(t,n,r){var o=t.match(/^(?:(.*?):)?(?:(.*?)-,)?(.*?)(?:,-(.*))?$/);if(!o)throw new Error("Invalid text fragment format: ".concat(t));var i=o[1]||null,a=o[2]||null,l=(o[3]||"").split(","),s=null,c=null,u=null;if(1===l.length)s=l[0];else{if(2!==l.length)throw new Error("Invalid text fragment quote format: ".concat(t));c=l[0],u=l[1]}var d=o[4]||null,h=i?n.getPageIndex(i):r;if("number"!=typeof h)throw new Error("Could not determine page index for text fragment with page number ".concat(i));if(!(s||c&&u))throw new Error("Invalid text fragment quote format: ".concat(t));return new e({prefix:a,quote:s,quoteStart:c,quoteEnd:u,suffix:d,pageNumber:i,pageIndex:h})}},{key:"fromJSON",value:function(t){return new e(t)}},{key:"fromSelection",value:function(t,n){var r,o,i=t.getRangeAt(0),a=new Range,l=we(i.startContainer),s=ke(i.endContainer);a.setStart(l,0),a.setEnd(s,0==i.endOffset?0:null!==(r=null===(o=s.textContent)||void 0===o?void 0:o.length)&&void 0!==r?r:0);var u=document.createRange();u.setStart(ke(n[0]),0),u.setEnd(l,0);var d=document.createRange();d.setStart(s,a.endOffset);var h=we(n[n.length-1]);d.setEnd(h,Math.max(0,h.textContent.length-1));var f=Ee(u),p=Ae(3,f),m=(0,c.rj)(p),g=Ee(d),y=be(3,g),v=(0,c.rj)(y);m<3&&(y=be(6-m,g),v=(0,c.rj)(y)),v<3&&(p=Ae(6-v,f),m=(0,c.rj)(p));var b=Ee(a),A=l.parentElement.closest(".BRpagecontainer");return new e({quote:b,prefix:p,suffix:y,pageNumber:A.getAttribute("data-page-num"),pageIndex:parseFloat(A.getAttribute("data-index"))})}}])}()},4565:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}n.d(t,{l:function(){return a}}),n(2675),n(9463),n(2259),n(5700),n(3792),n(9572),n(2892),n(6099),n(7764),n(2953);var a=function(){return e=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.maxSize=t,this.entries=[]},(t=[{key:"add",value:function(e){this.entries.length>=this.maxSize&&this.entries.shift(),this.entries.push(e)}}])&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}()},1989:function(e,t,n){function r(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function l(n,r,i,a){var l=r&&r.prototype instanceof c?r:c,u=Object.create(l.prototype);return o(u,"_invoke",function(n,r,o){var i,a,l,c=0,u=o||[],d=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,a=0,l=e,h.n=n,s}};function f(n,r){for(a=n,l=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=h.p,p=i[2];n>3?(o=p===r)&&(l=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(a=0,h.v=r,h.n=i[1]):f<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,h.n=p,a=0))}if(o||n>1)return s;throw d=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,p),a=u,l=p;(t=a<2?e:l)||!d;){i||(a?a<3?(a>1&&(h.n=-1),f(a,l)):h.n=l:h.v=l);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(d=h.n<0)?l:n.call(r,h))!==s)break}catch(t){i=e,a=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,i,a),!0),u}var s={};function c(){}function u(){}function d(){}t=Object.getPrototypeOf;var h=[][i]?t(t([][i]())):(o(t={},i,function(){return this}),t),f=d.prototype=c.prototype=Object.create(h);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,o(e,a,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=d,o(f,"constructor",d),o(d,"constructor",u),u.displayName="GeneratorFunction",o(d,a,"GeneratorFunction"),o(f),o(f,a,"Generator"),o(f,i,function(){return this}),o(f,"toString",function(){return"[object Generator]"}),(r=function(){return{w:l,m:p}})()}function o(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function(e,t,n,r){function a(t,n){o(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},o(e,t,n,r)}n.d(t,{Px:function(){return f},eU:function(){return d},nC:function(){return h},pp:function(){return p},yU:function(){return m}}),n(2675),n(9463),n(2259),n(3418),n(3792),n(4782),n(2010),n(875),n(6099),n(7495),n(8781),n(7764),n(2953);var i=r().m(h),a=r().m(f),l=r().m(p),s=r().m(m);function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t){var n,r=0,o=c(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(r==t)return i;r++}}catch(e){o.e(e)}finally{o.f()}}function h(e,t){var n,o,a,l;return r().w(function(r){for(;;)switch(r.p=r.n){case 0:n=c(e),r.p=1,n.s();case 2:if((o=n.n()).done){r.n=4;break}if(a=o.value,!t(a)){r.n=3;break}return r.n=3,a;case 3:r.n=2;break;case 4:r.n=6;break;case 5:r.p=5,l=r.v,n.e(l);case 6:return r.p=6,n.f(),r.f(6);case 7:return r.a(2)}},i,null,[[1,5,6,7]])}function f(e,t){var n,o,i,l;return r().w(function(r){for(;;)switch(r.p=r.n){case 0:n=c(e),r.p=1,n.s();case 2:if((o=n.n()).done){r.n=4;break}return i=o.value,r.n=3,t(i);case 3:r.n=2;break;case 4:r.n=6;break;case 5:r.p=5,l=r.v,n.e(l);case 6:return r.p=6,n.f(),r.f(6);case 7:return r.a(2)}},a,null,[[1,5,6,7]])}function p(e){var t,n,o,i,a,s,u;return r().w(function(r){for(;;)switch(r.p=r.n){case 0:t=void 0,n=void 0,o=void 0,i=c(e),r.p=1,i.s();case 2:if((a=i.n()).done){r.n=5;break}if(s=a.value,void 0===n){r.n=3;break}return o=s,r.n=3,[t,n,o];case 3:t=n,n=s,o=void 0;case 4:r.n=2;break;case 5:r.n=7;break;case 6:r.p=6,u=r.v,i.e(u);case 7:return r.p=7,i.f(),r.f(7);case 8:if(void 0===n){r.n=9;break}return r.n=9,[t,n,o];case 9:return r.a(2)}},l,null,[[1,6,7,8]])}function m(e,t){var n,o,i,a;return r().w(function(r){for(;;)switch(r.n){case 0:n=e[Symbol.iterator](),o=t[Symbol.iterator]();case 1:if(i=n.next(),a=o.next(),!i.done||!a.done){r.n=2;break}return r.a(2);case 2:if(!i.done&&!a.done){r.n=3;break}throw new Error("zip: one of the iterators is done");case 3:return r.n=4,[i.value,a.value];case 4:r.n=1;break;case 5:return r.a(2)}},s)}},9073:function(e,t,n){function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e){var t=e.match(/\S+/g);return t?t.length:0}function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a;return null==e?void 0:e.replace(/\{\{([^}]*?)\}\}/g,function(e,i){if(!i)return e;var a,l=function(e){if(Array.isArray(e))return e}(a=i.split("|").map(function(e){return e.trim()}))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),s=l[0],c=r(l).slice(1);if(!(s in n)&&!(s in t))return e;var u=s in n?n[s]:s in t?t[s]:null;return c.map(function(e){return o[e]}).reduce(function(e,t){return t(e)},u&&u.toString())})}n.d(t,{gT:function(){return i},rj:function(){return o}}),n(2675),n(9463),n(2259),n(3418),n(3792),n(2062),n(2712),n(4782),n(2010),n(6099),n(7495),n(8781),n(7764),n(1761),n(5440),n(2762),n(2953);var a={urlencode:encodeURIComponent}}},function(e){e(296)}]);
|
|
3
3
|
//# sourceMappingURL=plugin.text_selection.js.map
|