@internetarchive/bookreader 5.0.0-63 → 5.0.0-64
Sign up to get free protection for your applications and to get access to all the features.
- package/.github/workflows/node.js.yml +1 -0
- package/BookReader/BookReader.css +45 -58
- package/BookReader/BookReader.js +1 -1
- package/BookReader/BookReader.js.LICENSE.txt +2 -0
- package/BookReader/BookReader.js.map +1 -1
- package/BookReader/ia-bookreader-bundle.js +95 -95
- package/BookReader/ia-bookreader-bundle.js.LICENSE.txt +2 -0
- package/BookReader/ia-bookreader-bundle.js.map +1 -1
- package/BookReader/icons/1up.svg +1 -1
- package/BookReader/icons/2up.svg +1 -1
- package/BookReader/icons/advance.svg +1 -1
- package/BookReader/icons/chevron-right.svg +1 -1
- package/BookReader/icons/close-circle-dark.svg +1 -1
- package/BookReader/icons/close-circle.svg +1 -1
- package/BookReader/icons/fullscreen.svg +1 -1
- package/BookReader/icons/fullscreen_exit.svg +1 -1
- package/BookReader/icons/hamburger.svg +1 -1
- package/BookReader/icons/left-arrow.svg +1 -1
- package/BookReader/icons/magnify-minus.svg +1 -1
- package/BookReader/icons/magnify-plus.svg +1 -1
- package/BookReader/icons/magnify.svg +1 -1
- package/BookReader/icons/pause.svg +1 -1
- package/BookReader/icons/play.svg +1 -1
- package/BookReader/icons/playback-speed.svg +1 -1
- package/BookReader/icons/read-aloud.svg +1 -1
- package/BookReader/icons/review.svg +1 -1
- package/BookReader/icons/thumbnails.svg +1 -1
- package/BookReader/icons/voice.svg +1 -1
- package/BookReader/icons/volume-full.svg +1 -1
- package/BookReader/images/BRicons.svg +3 -3
- package/BookReader/images/books_graphic.svg +1 -1
- package/BookReader/images/icon_book.svg +1 -1
- package/BookReader/images/icon_bookmark.svg +1 -1
- package/BookReader/images/icon_gear.svg +1 -1
- package/BookReader/images/icon_hamburger.svg +1 -1
- package/BookReader/images/icon_home.svg +1 -1
- package/BookReader/images/icon_info.svg +1 -1
- package/BookReader/images/icon_one_page.svg +1 -1
- package/BookReader/images/icon_pause.svg +1 -1
- package/BookReader/images/icon_play.svg +1 -1
- package/BookReader/images/icon_search_button.svg +1 -1
- package/BookReader/images/icon_share.svg +1 -1
- package/BookReader/images/icon_skip-ahead.svg +1 -1
- package/BookReader/images/icon_skip-back.svg +1 -1
- package/BookReader/images/icon_speaker.svg +1 -1
- package/BookReader/images/icon_speaker_open.svg +1 -1
- package/BookReader/images/icon_thumbnails.svg +1 -1
- package/BookReader/images/icon_toc.svg +1 -1
- package/BookReader/images/icon_two_pages.svg +1 -1
- package/BookReader/images/marker_chap-off.svg +1 -1
- package/BookReader/images/marker_chap-on.svg +1 -1
- package/BookReader/images/marker_srch-on.svg +1 -1
- package/BookReader/jquery-3.js +1 -1
- package/BookReader/plugins/plugin.archive_analytics.js +1 -1
- package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
- package/BookReader/plugins/plugin.autoplay.js +1 -1
- package/BookReader/plugins/plugin.autoplay.js.map +1 -1
- package/BookReader/plugins/plugin.chapters.js +2 -1
- package/BookReader/plugins/plugin.chapters.js.LICENSE.txt +1 -0
- package/BookReader/plugins/plugin.chapters.js.map +1 -1
- package/BookReader/plugins/plugin.iframe.js.map +1 -1
- package/BookReader/plugins/plugin.mobile_nav.js +1 -1
- package/BookReader/plugins/plugin.mobile_nav.js.map +1 -1
- package/BookReader/plugins/plugin.resume.js +1 -1
- package/BookReader/plugins/plugin.resume.js.map +1 -1
- package/BookReader/plugins/plugin.search.js +2 -1
- package/BookReader/plugins/plugin.search.js.LICENSE.txt +1 -0
- package/BookReader/plugins/plugin.search.js.map +1 -1
- package/BookReader/plugins/plugin.text_selection.js +2 -1
- package/BookReader/plugins/plugin.text_selection.js.LICENSE.txt +1 -0
- package/BookReader/plugins/plugin.text_selection.js.map +1 -1
- package/BookReader/plugins/plugin.tts.js +1 -1
- package/BookReader/plugins/plugin.tts.js.LICENSE.txt +2 -0
- package/BookReader/plugins/plugin.tts.js.map +1 -1
- package/BookReader/plugins/plugin.url.js +1 -1
- package/BookReader/plugins/plugin.url.js.map +1 -1
- package/BookReader/plugins/plugin.vendor-fullscreen.js +1 -1
- package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -1
- package/BookReader/webcomponents-bundle.js +1 -1
- package/BookReader/webcomponents-bundle.js.map +1 -1
- package/CHANGELOG.md +5 -0
- package/babel.config.js +5 -4
- package/netlify.toml +4 -0
- package/package.json +15 -15
- package/src/BookNavigator/search/search-results.js +1 -7
- package/src/BookReader/utils.js +10 -0
- package/src/css/_BRnav.scss +2 -2
- package/src/css/_BRsearch.scss +38 -10
- package/src/plugins/search/plugin.search.js +14 -21
- package/src/plugins/search/utils.js +43 -0
- package/src/plugins/search/view.js +11 -24
- package/tests/e2e/helpers/desktopSearch.js +3 -3
- package/tests/jest/BookNavigator/search/search-results.test.js +6 -1
- package/tests/jest/BookReader/utils.test.js +12 -0
- package/tests/jest/plugins/search/plugin.search.test.js +2 -39
- package/tests/jest/plugins/search/plugin.search.view.test.js +5 -0
- package/tests/jest/plugins/search/utils.js +25 -0
- package/tests/jest/plugins/search/utils.test.js +29 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"plugins/plugin.url.js","mappings":"mwBAAO,ICkCgCA,EDlC1BC,EAAb,WACE,aAA0B,IAAdC,EAAc,uDAAJ,GAAI,UACxBC,KAAKC,kBAAoBF,EAGzBC,KAAKE,UAAY,CACf,CAAEC,KAAM,OAAQC,SAAU,OAAQC,QAAS,MAC3C,CAAEF,KAAM,OAAQC,SAAU,OAAQC,QAAS,OAC3C,CAAEF,KAAM,SAAUC,SAAU,OAAQE,eAAgB,KACpD,CAAEH,KAAM,IAAKC,SAAU,eACvB,CAAED,KAAM,OAAQC,SAAU,eAC1B,CAAED,KAAM,OAAQC,SAAU,eAC1B,CAAED,KAAM,QAASC,SAAU,gBAG7BJ,KAAKO,SAAW,GAChBP,KAAKQ,QAAUR,KAAKC,kBAAkBO,SAAW,OACjDR,KAAKS,mBAAqBT,KAAKC,kBAAkBQ,oBAAuB,IACxET,KAAKU,kBAAoB,KACzBV,KAAKW,gBAAk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GACFE,EAAiBiL,GAAc,CAG7B7B,KAAM+B,GAAmB,YAAa,WAGtC3B,OAAQ2B,GAAmB,aAG3BvB,SAAUuB,GAAmB,cAAe,eAG5C9D,SAAU8D,GAAmB,cAAe,eAG5C7D,SAAU6D,GAAmB,cAAe,eAG5CrI,KAAMqI,GAAmB,UAAW,WAGpCd,SAAUc,GAAmB,cAAe,eAG5C5D,KAAM4D,GAAmB,UAAW,WAGpCpV,SAAUoV,GAAmB,cAAe,eAG5CvT,OAAQuT,GAAmB,YAAa,aAGxC/W,aAAc+W,GAAmB,mBAGjC/T,KAAM+T,GAAmB,UAAW,aAMxClL,EAASgL,GAAc,UAAU,WAC/B,OAAOjK,EAAoBzN,MAAM2V,cAChC,CAAEqC,YAAY,IAIjBtL,EAASgL,GAAc,YAAY,WACjC,OAAOjK,EAAoBzN,MAAM2V,cAChC,CAAEqC,YAAY,IAEbnK,EAAW,CACb,IAAIoK,GAAwBpK,EAAUqK,gBAClCC,GAAwBtK,EAAUuK,gBAGlCH,IAAuBvL,EAASsJ,GAAgB,kBAAmB5Q,EAAK6S,GAAuBpK,IAG/FsK,IAAuBzL,EAASsJ,GAAgB,kBAAmB5Q,EAAK+S,GAAuBtK,IAGrGV,EAAe6I,GAAgB,OAE/BzK,EAAE,CAAEpD,QAAQ,EAAMiE,QAASI,EAAgB6L,MAAO9L,GAAe,CAC/DpK,IAAK6T,M,oBCjhCP,EAAQ,Q","sources":["webpack://@internetarchive/bookreader/./src/plugins/url/UrlPlugin.js","webpack://@internetarchive/bookreader/./src/plugins/url/plugin.url.js","webpack://@internetarchive/bookreader/./node_modules/core-js/internals/string-punycode-to-ascii.js","webpack://@internetarchive/bookreader/./node_modules/core-js/internals/string-trim-forced.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.object.entries.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.object.from-entries.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.string.trim.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/web.url.constructor.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/web.url.js"],"sourcesContent":["export class UrlPlugin {\n constructor(options = {}) {\n this.bookReaderOptions = options;\n\n // the canonical order of elements is important in the path and query string\n this.urlSchema = [\n { name: 'page', position: 'path', default: 'n0' },\n { name: 'mode', position: 'path', default: '2up' },\n { name: 'search', position: 'path', deprecated_for: 'q' },\n { name: 'q', position: 'query_param' },\n { name: 'sort', position: 'query_param' },\n { name: 'view', position: 'query_param' },\n { name: 'admin', position: 'query_param' },\n ];\n\n this.urlState = {};\n this.urlMode = this.bookReaderOptions.urlMode || 'hash';\n this.urlHistoryBasePath = this.bookReaderOptions.urlHistoryBasePath || '/';\n this.urlLocationPollId = null;\n this.oldLocationHash = null;\n this.oldUserHash = null;\n }\n\n /**\n * Parse JSON object URL state to string format\n * Arrange path names in an order that it is positioned on the urlSchema\n * @param {Object} urlState\n * @returns {string}\n */\n urlStateToUrlString(urlState) {\n const searchParams = new URLSearchParams();\n const pathParams = {};\n\n Object.keys(urlState).forEach(key => {\n let schema = this.urlSchema.find(schema => schema.name === key);\n if (schema?.deprecated_for) {\n schema = this.urlSchema.find(schemaKey => schemaKey.name === schema.deprecated_for);\n }\n if (schema?.position == 'path') {\n pathParams[schema?.name] = urlState[key];\n } else {\n searchParams.append(schema?.name || key, urlState[key]);\n }\n });\n\n const strPathParams = this.urlSchema\n .filter(s => s.position == 'path')\n .map(schema => pathParams[schema.name] ? `${schema.name}/${pathParams[schema.name]}` : '')\n .join('/');\n\n // replace consecutive slashes with a single slash + remove trailing slashes\n const strStrippedTrailingSlash = `${strPathParams.replace(/\\/+/g, '/').replace(/\\/+$/, '')}`;\n const concatenatedPath = `${strStrippedTrailingSlash}?${searchParams.toString()}`;\n return searchParams.toString() ? concatenatedPath : `${strStrippedTrailingSlash}`;\n }\n\n /**\n * Parse string URL and add it in the current urlState\n * Example:\n * /page/n7/mode/2up => {page: 'n7', mode: '2up'}\n * /page/n7/mode/2up/search/hello => {page: 'n7', mode: '2up', q: 'hello'}\n * @param {string} urlString\n * @returns {object}\n */\n urlStringToUrlState(urlString) {\n const urlState = {};\n\n // Fetch searchParams from given {str}\n // Note: whole URL path is needed for URL parsing\n const urlPath = new URL(urlString, 'http://example.com');\n const urlSearchParamsObj = Object.fromEntries(urlPath.searchParams.entries());\n const splitUrlMatches = urlPath.pathname.match(/[^\\\\/]+\\/[^\\\\/]+/g);\n const urlStrSplitSlashObj = splitUrlMatches ? Object.fromEntries(splitUrlMatches.map(x => x.split('/'))) : {};\n\n const doesKeyExists = (_object, _key) => {\n return Object.keys(_object).some(value => value == _key);\n };\n\n // Add path objects to urlState\n this.urlSchema\n .filter(schema => schema.position == 'path')\n .forEach(schema => {\n const hasPropertyKey = doesKeyExists(urlStrSplitSlashObj, schema.name);\n const hasDeprecatedKey = doesKeyExists(schema, 'deprecated_for') && hasPropertyKey;\n\n if (hasDeprecatedKey) {\n urlState[schema.deprecated_for] = urlStrSplitSlashObj[schema.name];\n return;\n }\n\n if (hasPropertyKey) {\n urlState[schema.name] = urlStrSplitSlashObj[schema.name];\n return;\n }\n });\n\n // Add searchParams to urlState\n Object.entries(urlSearchParamsObj).forEach(([key, value]) => {\n urlState[key] = value;\n });\n\n return urlState;\n }\n\n /**\n * Add or update key-value to the urlState\n * @param {string} key\n * @param {string} val\n */\n setUrlParam(key, value) {\n this.urlState[key] = value;\n\n this.pushToAddressBar();\n }\n\n /**\n * Delete key-value to the urlState\n * @param {string} key\n */\n removeUrlParam(key) {\n delete this.urlState[key];\n\n this.pushToAddressBar();\n }\n\n /**\n * Get key-value from the urlState\n * @param {string} key\n * @return {string}\n */\n getUrlParam(key) {\n return this.urlState[key];\n }\n\n /**\n * Push URL params to addressbar\n */\n pushToAddressBar() {\n const urlStrPath = this.urlStateToUrlString(this.urlState);\n const concatenatedPath = urlStrPath !== '/' ? urlStrPath : '';\n if (this.urlMode == 'history') {\n if (!window.history || !window.history.replaceState) {\n this.options.urlMode = 'hash';\n } else {\n const newUrlPath = `${this.urlHistoryBasePath}${concatenatedPath}`.trim().replace(/(\\/+)/g, '/');\n try {\n window.history.replaceState({}, null, newUrlPath);\n } catch (e) {\n // DOMException on Chrome when in sandboxed iframe\n this.urlMode = 'hash';\n }\n }\n }\n\n if (this.urlMode == 'hash') {\n window.location.replace('#' + concatenatedPath);\n }\n this.oldLocationHash = urlStrPath;\n }\n\n /**\n * Get the url and check if it has changed\n * If it was changeed, update the urlState\n */\n listenForHashChanges() {\n this.oldLocationHash = window.location.hash.substr(1);\n if (this.urlLocationPollId) {\n clearInterval(this.urlLocationPollId);\n this.urlLocationPollId = null;\n }\n\n // check if the URL changes\n const updateHash = () => {\n const newFragment = window.location.hash.substr(1);\n const hasFragmentChange = newFragment != this.oldLocationHash;\n\n if (!hasFragmentChange) { return; }\n\n this.urlState = this.urlStringToUrlState(newFragment);\n };\n this.urlLocationPollId = setInterval(updateHash, 500);\n }\n\n /**\n * Will read either the hash or URL and return the bookreader fragment\n */\n pullFromAddressBar (location = window.location) {\n const path = this.urlMode === 'history'\n ? (location.pathname.substr(this.urlHistoryBasePath.length) + location.search)\n : location.hash.substr(1);\n this.urlState = this.urlStringToUrlState(path);\n }\n}\n","/* global BookReader */\n\nimport { UrlPlugin } from \"./UrlPlugin\";\n\n/**\n * Plugin for URL management in BookReader\n * Note read more about the url \"fragment\" here:\n * https://openlibrary.org/dev/docs/bookurls\n */\n\njQuery.extend(BookReader.defaultOptions, {\n enableUrlPlugin: true,\n bookId: '',\n /** @type {string} Defaults can be a urlFragment string */\n defaults: null,\n updateWindowTitle: false,\n\n /** @type {'history' | 'hash'} */\n urlMode: 'hash',\n\n /**\n * When using 'history' mode, this part of the URL is kept constant\n * @example /details/plato/\n */\n urlHistoryBasePath: '/',\n\n /** Only these params will be reflected onto the URL */\n urlTrackedParams: ['page', 'search', 'mode', 'region', 'highlight', 'view'],\n\n /** If true, don't update the URL when `page == n0 (eg \"/page/n0\")` */\n urlTrackIndex0: false,\n});\n\n/** @override */\nBookReader.prototype.setup = (function(super_) {\n return function(options) {\n super_.call(this, options);\n\n this.bookId = options.bookId;\n this.defaults = options.defaults;\n\n this.locationPollId = null;\n this.oldLocationHash = null;\n this.oldUserHash = null;\n };\n})(BookReader.prototype.setup);\n\n/** @override */\nBookReader.prototype.init = (function(super_) {\n return function() {\n\n if (this.options.enableUrlPlugin) {\n this.bind(BookReader.eventNames.PostInit, () => {\n const { updateWindowTitle, urlMode } = this.options;\n if (updateWindowTitle) {\n document.title = this.shortTitle(this.bookTitle, 50);\n }\n if (urlMode === 'hash') {\n this.urlStartLocationPolling();\n }\n });\n\n this.bind(BookReader.eventNames.fragmentChange,\n this.urlUpdateFragment.bind(this)\n );\n }\n super_.call(this);\n };\n})(BookReader.prototype.init);\n\n/**\n * Returns a shortened version of the title with the maximum number of characters\n * @param {number} maximumCharacters\n * @return {string}\n */\nBookReader.prototype.shortTitle = function(maximumCharacters) {\n if (this.bookTitle.length < maximumCharacters) {\n return this.bookTitle;\n }\n\n const title = `${this.bookTitle.substr(0, maximumCharacters - 3)}...`;\n return title;\n};\n\n/**\n * Starts polling of window.location to see hash fragment changes\n */\nBookReader.prototype.urlStartLocationPolling = function() {\n this.oldLocationHash = this.urlReadFragment();\n\n if (this.locationPollId) {\n clearInterval(this.locationPollId);\n this.locationPollId = null;\n }\n\n const updateHash = () => {\n const newFragment = this.urlReadFragment();\n const hasFragmentChange = (newFragment != this.oldLocationHash) && (newFragment != this.oldUserHash);\n\n if (!hasFragmentChange) { return; }\n\n const params = this.paramsFromFragment(newFragment);\n\n const updateParams = () => this.updateFromParams(params);\n\n this.trigger(BookReader.eventNames.stop);\n if (this.animating) {\n // Queue change if animating\n if (this.autoStop) this.autoStop();\n this.animationFinishedCallback = updateParams;\n } else {\n // update immediately\n updateParams();\n }\n this.oldUserHash = newFragment;\n };\n\n this.locationPollId = setInterval(updateHash, 500);\n};\n\n/**\n * Update URL from the current parameters.\n * Call this instead of manually using window.location.replace\n */\nBookReader.prototype.urlUpdateFragment = function() {\n const allParams = this.paramsFromCurrent();\n const { urlTrackIndex0, urlTrackedParams } = this.options;\n\n if (!urlTrackIndex0\n && (typeof(allParams.index) !== 'undefined')\n && allParams.index === 0) {\n delete allParams.index;\n delete allParams.page;\n }\n\n const params = urlTrackedParams.reduce((validParams, paramName) => {\n if (paramName in allParams) {\n validParams[paramName] = allParams[paramName];\n }\n return validParams;\n }, {});\n\n const newFragment = this.fragmentFromParams(params, this.options.urlMode);\n const currFragment = this.urlReadFragment();\n const currQueryString = this.getLocationSearch();\n const newQueryString = this.queryStringFromParams(params, currQueryString, this.options.urlMode);\n if (currFragment === newFragment && currQueryString === newQueryString) {\n return;\n }\n\n if (this.options.urlMode === 'history') {\n if (!window.history || !window.history.replaceState) {\n this.options.urlMode = 'hash';\n } else {\n const baseWithoutSlash = this.options.urlHistoryBasePath.replace(/\\/+$/, '');\n const newFragmentWithSlash = newFragment === '' ? '' : `/${newFragment}`;\n\n const newUrlPath = `${baseWithoutSlash}${newFragmentWithSlash}${newQueryString}`;\n try {\n window.history.replaceState({}, null, newUrlPath);\n this.oldLocationHash = newFragment + newQueryString;\n } catch (e) {\n // DOMException on Chrome when in sandboxed iframe\n this.options.urlMode = 'hash';\n }\n }\n }\n\n if (this.options.urlMode === 'hash') {\n const newQueryStringSearch = this.urlParamsFiltersOnlySearch(this.readQueryString());\n window.location.replace('#' + newFragment + newQueryStringSearch);\n this.oldLocationHash = newFragment + newQueryStringSearch;\n }\n};\n\n/**\n * @private\n * Filtering query parameters to select only book search param (?q=foo)\n This needs to be updated/URL system modified if future query params are to be added\n * @param {string} url\n * @return {string}\n * */\nBookReader.prototype.urlParamsFiltersOnlySearch = function(url) {\n const params = new URLSearchParams(url);\n return params.has('q') ? `?${new URLSearchParams({ q: params.get('q') })}` : '';\n};\n\n\n/**\n * Will read either the hash or URL and return the bookreader fragment\n * @return {string}\n */\nBookReader.prototype.urlReadFragment = function() {\n const { urlMode, urlHistoryBasePath } = this.options;\n if (urlMode === 'history') {\n return window.location.pathname.substr(urlHistoryBasePath.length);\n } else {\n return window.location.hash.substr(1);\n }\n};\n\n/**\n * Will read the hash return the bookreader fragment\n * @return {string}\n */\nBookReader.prototype.urlReadHashFragment = function() {\n return window.location.hash.substr(1);\n};\nexport class BookreaderUrlPlugin extends BookReader {\n init() {\n if (this.options.enableUrlPlugin) {\n this.urlPlugin = new UrlPlugin(this.options);\n this.bind(BookReader.eventNames.PostInit, () => {\n const { urlMode } = this.options;\n\n if (urlMode === 'hash') {\n this.urlPlugin.listenForHashChanges();\n }\n });\n }\n\n super.init();\n }\n}\n\nwindow.BookReader = BookreaderUrlPlugin;\nexport default BookreaderUrlPlugin;\n","'use strict';\n// based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js\nvar global = require('../internals/global');\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nvar maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\nvar base = 36;\nvar tMin = 1;\nvar tMax = 26;\nvar skew = 38;\nvar damp = 700;\nvar initialBias = 72;\nvar initialN = 128; // 0x80\nvar delimiter = '-'; // '\\x2D'\nvar regexNonASCII = /[^\\0-\\u007E]/; // non-ASCII chars\nvar regexSeparators = /[.\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\nvar OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';\nvar baseMinusTMin = base - tMin;\n\nvar RangeError = global.RangeError;\nvar exec = uncurryThis(regexSeparators.exec);\nvar floor = Math.floor;\nvar fromCharCode = String.fromCharCode;\nvar charCodeAt = uncurryThis(''.charCodeAt);\nvar join = uncurryThis([].join);\nvar push = uncurryThis([].push);\nvar replace = uncurryThis(''.replace);\nvar split = uncurryThis(''.split);\nvar toLowerCase = uncurryThis(''.toLowerCase);\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n */\nvar ucs2decode = function (string) {\n var output = [];\n var counter = 0;\n var length = string.length;\n while (counter < length) {\n var value = charCodeAt(string, counter++);\n if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n // It's a high surrogate, and there is a next character.\n var extra = charCodeAt(string, counter++);\n if ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n push(output, ((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n } else {\n // It's an unmatched surrogate; only append this code unit, in case the\n // next code unit is the high surrogate of a surrogate pair.\n push(output, value);\n counter--;\n }\n } else {\n push(output, value);\n }\n }\n return output;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n */\nvar digitToBasic = function (digit) {\n // 0..25 map to ASCII a..z or A..Z\n // 26..35 map to ASCII 0..9\n return digit + 22 + 75 * (digit < 26);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n */\nvar adapt = function (delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n while (delta > baseMinusTMin * tMax >> 1) {\n delta = floor(delta / baseMinusTMin);\n k += base;\n }\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n */\nvar encode = function (input) {\n var output = [];\n\n // Convert the input in UCS-2 to an array of Unicode code points.\n input = ucs2decode(input);\n\n // Cache the length.\n var inputLength = input.length;\n\n // Initialize the state.\n var n = initialN;\n var delta = 0;\n var bias = initialBias;\n var i, currentValue;\n\n // Handle the basic code points.\n for (i = 0; i < input.length; i++) {\n currentValue = input[i];\n if (currentValue < 0x80) {\n push(output, fromCharCode(currentValue));\n }\n }\n\n var basicLength = output.length; // number of basic code points.\n var handledCPCount = basicLength; // number of code points that have been handled;\n\n // Finish the basic string with a delimiter unless it's empty.\n if (basicLength) {\n push(output, delimiter);\n }\n\n // Main encoding loop:\n while (handledCPCount < inputLength) {\n // All non-basic code points < n have been handled already. Find the next larger one:\n var m = maxInt;\n for (i = 0; i < input.length; i++) {\n currentValue = input[i];\n if (currentValue >= n && currentValue < m) {\n m = currentValue;\n }\n }\n\n // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, but guard against overflow.\n var handledCPCountPlusOne = handledCPCount + 1;\n if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n throw RangeError(OVERFLOW_ERROR);\n }\n\n delta += (m - n) * handledCPCountPlusOne;\n n = m;\n\n for (i = 0; i < input.length; i++) {\n currentValue = input[i];\n if (currentValue < n && ++delta > maxInt) {\n throw RangeError(OVERFLOW_ERROR);\n }\n if (currentValue == n) {\n // Represent delta as a generalized variable-length integer.\n var q = delta;\n var k = base;\n while (true) {\n var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n if (q < t) break;\n var qMinusT = q - t;\n var baseMinusT = base - t;\n push(output, fromCharCode(digitToBasic(t + qMinusT % baseMinusT)));\n q = floor(qMinusT / baseMinusT);\n k += base;\n }\n\n push(output, fromCharCode(digitToBasic(q)));\n bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n delta = 0;\n handledCPCount++;\n }\n }\n\n delta++;\n n++;\n }\n return join(output, '');\n};\n\nmodule.exports = function (input) {\n var encoded = [];\n var labels = split(replace(toLowerCase(input), regexSeparators, '\\u002E'), '.');\n var i, label;\n for (i = 0; i < labels.length; i++) {\n label = labels[i];\n push(encoded, exec(regexNonASCII, label) ? 'xn--' + encode(label) : label);\n }\n return join(encoded, '.');\n};\n","var PROPER_FUNCTION_NAME = require('../internals/function-name').PROPER;\nvar fails = require('../internals/fails');\nvar whitespaces = require('../internals/whitespaces');\n\nvar non = '\\u200B\\u0085\\u180E';\n\n// check that a method works with the correct list\n// of whitespaces and has a correct name\nmodule.exports = function (METHOD_NAME) {\n return fails(function () {\n return !!whitespaces[METHOD_NAME]()\n || non[METHOD_NAME]() !== non\n || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);\n });\n};\n","var $ = require('../internals/export');\nvar $entries = require('../internals/object-to-array').entries;\n\n// `Object.entries` method\n// https://tc39.es/ecma262/#sec-object.entries\n$({ target: 'Object', stat: true }, {\n entries: function entries(O) {\n return $entries(O);\n }\n});\n","var $ = require('../internals/export');\nvar iterate = require('../internals/iterate');\nvar createProperty = require('../internals/create-property');\n\n// `Object.fromEntries` method\n// https://github.com/tc39/proposal-object-from-entries\n$({ target: 'Object', stat: true }, {\n fromEntries: function fromEntries(iterable) {\n var obj = {};\n iterate(iterable, function (k, v) {\n createProperty(obj, k, v);\n }, { AS_ENTRIES: true });\n return obj;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar $trim = require('../internals/string-trim').trim;\nvar forcedStringTrimMethod = require('../internals/string-trim-forced');\n\n// `String.prototype.trim` method\n// https://tc39.es/ecma262/#sec-string.prototype.trim\n$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {\n trim: function trim() {\n return $trim(this);\n }\n});\n","'use strict';\n// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`\nrequire('../modules/es.string.iterator');\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar USE_NATIVE_URL = require('../internals/native-url');\nvar global = require('../internals/global');\nvar bind = require('../internals/function-bind-context');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar defineProperties = require('../internals/object-define-properties').f;\nvar redefine = require('../internals/redefine');\nvar anInstance = require('../internals/an-instance');\nvar hasOwn = require('../internals/has-own-property');\nvar assign = require('../internals/object-assign');\nvar arrayFrom = require('../internals/array-from');\nvar arraySlice = require('../internals/array-slice-simple');\nvar codeAt = require('../internals/string-multibyte').codeAt;\nvar toASCII = require('../internals/string-punycode-to-ascii');\nvar $toString = require('../internals/to-string');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar validateArgumentsLength = require('../internals/validate-arguments-length');\nvar URLSearchParamsModule = require('../modules/web.url-search-params.constructor');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar setInternalState = InternalStateModule.set;\nvar getInternalURLState = InternalStateModule.getterFor('URL');\nvar URLSearchParams = URLSearchParamsModule.URLSearchParams;\nvar getInternalSearchParamsState = URLSearchParamsModule.getState;\n\nvar NativeURL = global.URL;\nvar TypeError = global.TypeError;\nvar parseInt = global.parseInt;\nvar floor = Math.floor;\nvar pow = Math.pow;\nvar charAt = uncurryThis(''.charAt);\nvar exec = uncurryThis(/./.exec);\nvar join = uncurryThis([].join);\nvar numberToString = uncurryThis(1.0.toString);\nvar pop = uncurryThis([].pop);\nvar push = uncurryThis([].push);\nvar replace = uncurryThis(''.replace);\nvar shift = uncurryThis([].shift);\nvar split = uncurryThis(''.split);\nvar stringSlice = uncurryThis(''.slice);\nvar toLowerCase = uncurryThis(''.toLowerCase);\nvar unshift = uncurryThis([].unshift);\n\nvar INVALID_AUTHORITY = 'Invalid authority';\nvar INVALID_SCHEME = 'Invalid scheme';\nvar INVALID_HOST = 'Invalid host';\nvar INVALID_PORT = 'Invalid port';\n\nvar ALPHA = /[a-z]/i;\n// eslint-disable-next-line regexp/no-obscure-range -- safe\nvar ALPHANUMERIC = /[\\d+-.a-z]/i;\nvar DIGIT = /\\d/;\nvar HEX_START = /^0x/i;\nvar OCT = /^[0-7]+$/;\nvar DEC = /^\\d+$/;\nvar HEX = /^[\\da-f]+$/i;\n/* eslint-disable regexp/no-control-character -- safe */\nvar FORBIDDEN_HOST_CODE_POINT = /[\\0\\t\\n\\r #%/:<>?@[\\\\\\]^|]/;\nvar FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\\0\\t\\n\\r #/:<>?@[\\\\\\]^|]/;\nvar LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\\u0000-\\u0020]+|[\\u0000-\\u0020]+$/g;\nvar TAB_AND_NEW_LINE = /[\\t\\n\\r]/g;\n/* eslint-enable regexp/no-control-character -- safe */\nvar EOF;\n\n// https://url.spec.whatwg.org/#ipv4-number-parser\nvar parseIPv4 = function (input) {\n var parts = split(input, '.');\n var partsLength, numbers, index, part, radix, number, ipv4;\n if (parts.length && parts[parts.length - 1] == '') {\n parts.length--;\n }\n partsLength = parts.length;\n if (partsLength > 4) return input;\n numbers = [];\n for (index = 0; index < partsLength; index++) {\n part = parts[index];\n if (part == '') return input;\n radix = 10;\n if (part.length > 1 && charAt(part, 0) == '0') {\n radix = exec(HEX_START, part) ? 16 : 8;\n part = stringSlice(part, radix == 8 ? 1 : 2);\n }\n if (part === '') {\n number = 0;\n } else {\n if (!exec(radix == 10 ? DEC : radix == 8 ? OCT : HEX, part)) return input;\n number = parseInt(part, radix);\n }\n push(numbers, number);\n }\n for (index = 0; index < partsLength; index++) {\n number = numbers[index];\n if (index == partsLength - 1) {\n if (number >= pow(256, 5 - partsLength)) return null;\n } else if (number > 255) return null;\n }\n ipv4 = pop(numbers);\n for (index = 0; index < numbers.length; index++) {\n ipv4 += numbers[index] * pow(256, 3 - index);\n }\n return ipv4;\n};\n\n// https://url.spec.whatwg.org/#concept-ipv6-parser\n// eslint-disable-next-line max-statements -- TODO\nvar parseIPv6 = function (input) {\n var address = [0, 0, 0, 0, 0, 0, 0, 0];\n var pieceIndex = 0;\n var compress = null;\n var pointer = 0;\n var value, length, numbersSeen, ipv4Piece, number, swaps, swap;\n\n var chr = function () {\n return charAt(input, pointer);\n };\n\n if (chr() == ':') {\n if (charAt(input, 1) != ':') return;\n pointer += 2;\n pieceIndex++;\n compress = pieceIndex;\n }\n while (chr()) {\n if (pieceIndex == 8) return;\n if (chr() == ':') {\n if (compress !== null) return;\n pointer++;\n pieceIndex++;\n compress = pieceIndex;\n continue;\n }\n value = length = 0;\n while (length < 4 && exec(HEX, chr())) {\n value = value * 16 + parseInt(chr(), 16);\n pointer++;\n length++;\n }\n if (chr() == '.') {\n if (length == 0) return;\n pointer -= length;\n if (pieceIndex > 6) return;\n numbersSeen = 0;\n while (chr()) {\n ipv4Piece = null;\n if (numbersSeen > 0) {\n if (chr() == '.' && numbersSeen < 4) pointer++;\n else return;\n }\n if (!exec(DIGIT, chr())) return;\n while (exec(DIGIT, chr())) {\n number = parseInt(chr(), 10);\n if (ipv4Piece === null) ipv4Piece = number;\n else if (ipv4Piece == 0) return;\n else ipv4Piece = ipv4Piece * 10 + number;\n if (ipv4Piece > 255) return;\n pointer++;\n }\n address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;\n numbersSeen++;\n if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++;\n }\n if (numbersSeen != 4) return;\n break;\n } else if (chr() == ':') {\n pointer++;\n if (!chr()) return;\n } else if (chr()) return;\n address[pieceIndex++] = value;\n }\n if (compress !== null) {\n swaps = pieceIndex - compress;\n pieceIndex = 7;\n while (pieceIndex != 0 && swaps > 0) {\n swap = address[pieceIndex];\n address[pieceIndex--] = address[compress + swaps - 1];\n address[compress + --swaps] = swap;\n }\n } else if (pieceIndex != 8) return;\n return address;\n};\n\nvar findLongestZeroSequence = function (ipv6) {\n var maxIndex = null;\n var maxLength = 1;\n var currStart = null;\n var currLength = 0;\n var index = 0;\n for (; index < 8; index++) {\n if (ipv6[index] !== 0) {\n if (currLength > maxLength) {\n maxIndex = currStart;\n maxLength = currLength;\n }\n currStart = null;\n currLength = 0;\n } else {\n if (currStart === null) currStart = index;\n ++currLength;\n }\n }\n if (currLength > maxLength) {\n maxIndex = currStart;\n maxLength = currLength;\n }\n return maxIndex;\n};\n\n// https://url.spec.whatwg.org/#host-serializing\nvar serializeHost = function (host) {\n var result, index, compress, ignore0;\n // ipv4\n if (typeof host == 'number') {\n result = [];\n for (index = 0; index < 4; index++) {\n unshift(result, host % 256);\n host = floor(host / 256);\n } return join(result, '.');\n // ipv6\n } else if (typeof host == 'object') {\n result = '';\n compress = findLongestZeroSequence(host);\n for (index = 0; index < 8; index++) {\n if (ignore0 && host[index] === 0) continue;\n if (ignore0) ignore0 = false;\n if (compress === index) {\n result += index ? ':' : '::';\n ignore0 = true;\n } else {\n result += numberToString(host[index], 16);\n if (index < 7) result += ':';\n }\n }\n return '[' + result + ']';\n } return host;\n};\n\nvar C0ControlPercentEncodeSet = {};\nvar fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {\n ' ': 1, '\"': 1, '<': 1, '>': 1, '`': 1\n});\nvar pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {\n '#': 1, '?': 1, '{': 1, '}': 1\n});\nvar userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {\n '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\\\': 1, ']': 1, '^': 1, '|': 1\n});\n\nvar percentEncode = function (chr, set) {\n var code = codeAt(chr, 0);\n return code > 0x20 && code < 0x7F && !hasOwn(set, chr) ? chr : encodeURIComponent(chr);\n};\n\n// https://url.spec.whatwg.org/#special-scheme\nvar specialSchemes = {\n ftp: 21,\n file: null,\n http: 80,\n https: 443,\n ws: 80,\n wss: 443\n};\n\n// https://url.spec.whatwg.org/#windows-drive-letter\nvar isWindowsDriveLetter = function (string, normalized) {\n var second;\n return string.length == 2 && exec(ALPHA, charAt(string, 0))\n && ((second = charAt(string, 1)) == ':' || (!normalized && second == '|'));\n};\n\n// https://url.spec.whatwg.org/#start-with-a-windows-drive-letter\nvar startsWithWindowsDriveLetter = function (string) {\n var third;\n return string.length > 1 && isWindowsDriveLetter(stringSlice(string, 0, 2)) && (\n string.length == 2 ||\n ((third = charAt(string, 2)) === '/' || third === '\\\\' || third === '?' || third === '#')\n );\n};\n\n// https://url.spec.whatwg.org/#single-dot-path-segment\nvar isSingleDot = function (segment) {\n return segment === '.' || toLowerCase(segment) === '%2e';\n};\n\n// https://url.spec.whatwg.org/#double-dot-path-segment\nvar isDoubleDot = function (segment) {\n segment = toLowerCase(segment);\n return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';\n};\n\n// States:\nvar SCHEME_START = {};\nvar SCHEME = {};\nvar NO_SCHEME = {};\nvar SPECIAL_RELATIVE_OR_AUTHORITY = {};\nvar PATH_OR_AUTHORITY = {};\nvar RELATIVE = {};\nvar RELATIVE_SLASH = {};\nvar SPECIAL_AUTHORITY_SLASHES = {};\nvar SPECIAL_AUTHORITY_IGNORE_SLASHES = {};\nvar AUTHORITY = {};\nvar HOST = {};\nvar HOSTNAME = {};\nvar PORT = {};\nvar FILE = {};\nvar FILE_SLASH = {};\nvar FILE_HOST = {};\nvar PATH_START = {};\nvar PATH = {};\nvar CANNOT_BE_A_BASE_URL_PATH = {};\nvar QUERY = {};\nvar FRAGMENT = {};\n\nvar URLState = function (url, isBase, base) {\n var urlString = $toString(url);\n var baseState, failure, searchParams;\n if (isBase) {\n failure = this.parse(urlString);\n if (failure) throw TypeError(failure);\n this.searchParams = null;\n } else {\n if (base !== undefined) baseState = new URLState(base, true);\n failure = this.parse(urlString, null, baseState);\n if (failure) throw TypeError(failure);\n searchParams = getInternalSearchParamsState(new URLSearchParams());\n searchParams.bindURL(this);\n this.searchParams = searchParams;\n }\n};\n\nURLState.prototype = {\n type: 'URL',\n // https://url.spec.whatwg.org/#url-parsing\n // eslint-disable-next-line max-statements -- TODO\n parse: function (input, stateOverride, base) {\n var url = this;\n var state = stateOverride || SCHEME_START;\n var pointer = 0;\n var buffer = '';\n var seenAt = false;\n var seenBracket = false;\n var seenPasswordToken = false;\n var codePoints, chr, bufferCodePoints, failure;\n\n input = $toString(input);\n\n if (!stateOverride) {\n url.scheme = '';\n url.username = '';\n url.password = '';\n url.host = null;\n url.port = null;\n url.path = [];\n url.query = null;\n url.fragment = null;\n url.cannotBeABaseURL = false;\n input = replace(input, LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, '');\n }\n\n input = replace(input, TAB_AND_NEW_LINE, '');\n\n codePoints = arrayFrom(input);\n\n while (pointer <= codePoints.length) {\n chr = codePoints[pointer];\n switch (state) {\n case SCHEME_START:\n if (chr && exec(ALPHA, chr)) {\n buffer += toLowerCase(chr);\n state = SCHEME;\n } else if (!stateOverride) {\n state = NO_SCHEME;\n continue;\n } else return INVALID_SCHEME;\n break;\n\n case SCHEME:\n if (chr && (exec(ALPHANUMERIC, chr) || chr == '+' || chr == '-' || chr == '.')) {\n buffer += toLowerCase(chr);\n } else if (chr == ':') {\n if (stateOverride && (\n (url.isSpecial() != hasOwn(specialSchemes, buffer)) ||\n (buffer == 'file' && (url.includesCredentials() || url.port !== null)) ||\n (url.scheme == 'file' && !url.host)\n )) return;\n url.scheme = buffer;\n if (stateOverride) {\n if (url.isSpecial() && specialSchemes[url.scheme] == url.port) url.port = null;\n return;\n }\n buffer = '';\n if (url.scheme == 'file') {\n state = FILE;\n } else if (url.isSpecial() && base && base.scheme == url.scheme) {\n state = SPECIAL_RELATIVE_OR_AUTHORITY;\n } else if (url.isSpecial()) {\n state = SPECIAL_AUTHORITY_SLASHES;\n } else if (codePoints[pointer + 1] == '/') {\n state = PATH_OR_AUTHORITY;\n pointer++;\n } else {\n url.cannotBeABaseURL = true;\n push(url.path, '');\n state = CANNOT_BE_A_BASE_URL_PATH;\n }\n } else if (!stateOverride) {\n buffer = '';\n state = NO_SCHEME;\n pointer = 0;\n continue;\n } else return INVALID_SCHEME;\n break;\n\n case NO_SCHEME:\n if (!base || (base.cannotBeABaseURL && chr != '#')) return INVALID_SCHEME;\n if (base.cannotBeABaseURL && chr == '#') {\n url.scheme = base.scheme;\n url.path = arraySlice(base.path);\n url.query = base.query;\n url.fragment = '';\n url.cannotBeABaseURL = true;\n state = FRAGMENT;\n break;\n }\n state = base.scheme == 'file' ? FILE : RELATIVE;\n continue;\n\n case SPECIAL_RELATIVE_OR_AUTHORITY:\n if (chr == '/' && codePoints[pointer + 1] == '/') {\n state = SPECIAL_AUTHORITY_IGNORE_SLASHES;\n pointer++;\n } else {\n state = RELATIVE;\n continue;\n } break;\n\n case PATH_OR_AUTHORITY:\n if (chr == '/') {\n state = AUTHORITY;\n break;\n } else {\n state = PATH;\n continue;\n }\n\n case RELATIVE:\n url.scheme = base.scheme;\n if (chr == EOF) {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = arraySlice(base.path);\n url.query = base.query;\n } else if (chr == '/' || (chr == '\\\\' && url.isSpecial())) {\n state = RELATIVE_SLASH;\n } else if (chr == '?') {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = arraySlice(base.path);\n url.query = '';\n state = QUERY;\n } else if (chr == '#') {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = arraySlice(base.path);\n url.query = base.query;\n url.fragment = '';\n state = FRAGMENT;\n } else {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = arraySlice(base.path);\n url.path.length--;\n state = PATH;\n continue;\n } break;\n\n case RELATIVE_SLASH:\n if (url.isSpecial() && (chr == '/' || chr == '\\\\')) {\n state = SPECIAL_AUTHORITY_IGNORE_SLASHES;\n } else if (chr == '/') {\n state = AUTHORITY;\n } else {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n state = PATH;\n continue;\n } break;\n\n case SPECIAL_AUTHORITY_SLASHES:\n state = SPECIAL_AUTHORITY_IGNORE_SLASHES;\n if (chr != '/' || charAt(buffer, pointer + 1) != '/') continue;\n pointer++;\n break;\n\n case SPECIAL_AUTHORITY_IGNORE_SLASHES:\n if (chr != '/' && chr != '\\\\') {\n state = AUTHORITY;\n continue;\n } break;\n\n case AUTHORITY:\n if (chr == '@') {\n if (seenAt) buffer = '%40' + buffer;\n seenAt = true;\n bufferCodePoints = arrayFrom(buffer);\n for (var i = 0; i < bufferCodePoints.length; i++) {\n var codePoint = bufferCodePoints[i];\n if (codePoint == ':' && !seenPasswordToken) {\n seenPasswordToken = true;\n continue;\n }\n var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);\n if (seenPasswordToken) url.password += encodedCodePoints;\n else url.username += encodedCodePoints;\n }\n buffer = '';\n } else if (\n chr == EOF || chr == '/' || chr == '?' || chr == '#' ||\n (chr == '\\\\' && url.isSpecial())\n ) {\n if (seenAt && buffer == '') return INVALID_AUTHORITY;\n pointer -= arrayFrom(buffer).length + 1;\n buffer = '';\n state = HOST;\n } else buffer += chr;\n break;\n\n case HOST:\n case HOSTNAME:\n if (stateOverride && url.scheme == 'file') {\n state = FILE_HOST;\n continue;\n } else if (chr == ':' && !seenBracket) {\n if (buffer == '') return INVALID_HOST;\n failure = url.parseHost(buffer);\n if (failure) return failure;\n buffer = '';\n state = PORT;\n if (stateOverride == HOSTNAME) return;\n } else if (\n chr == EOF || chr == '/' || chr == '?' || chr == '#' ||\n (chr == '\\\\' && url.isSpecial())\n ) {\n if (url.isSpecial() && buffer == '') return INVALID_HOST;\n if (stateOverride && buffer == '' && (url.includesCredentials() || url.port !== null)) return;\n failure = url.parseHost(buffer);\n if (failure) return failure;\n buffer = '';\n state = PATH_START;\n if (stateOverride) return;\n continue;\n } else {\n if (chr == '[') seenBracket = true;\n else if (chr == ']') seenBracket = false;\n buffer += chr;\n } break;\n\n case PORT:\n if (exec(DIGIT, chr)) {\n buffer += chr;\n } else if (\n chr == EOF || chr == '/' || chr == '?' || chr == '#' ||\n (chr == '\\\\' && url.isSpecial()) ||\n stateOverride\n ) {\n if (buffer != '') {\n var port = parseInt(buffer, 10);\n if (port > 0xFFFF) return INVALID_PORT;\n url.port = (url.isSpecial() && port === specialSchemes[url.scheme]) ? null : port;\n buffer = '';\n }\n if (stateOverride) return;\n state = PATH_START;\n continue;\n } else return INVALID_PORT;\n break;\n\n case FILE:\n url.scheme = 'file';\n if (chr == '/' || chr == '\\\\') state = FILE_SLASH;\n else if (base && base.scheme == 'file') {\n if (chr == EOF) {\n url.host = base.host;\n url.path = arraySlice(base.path);\n url.query = base.query;\n } else if (chr == '?') {\n url.host = base.host;\n url.path = arraySlice(base.path);\n url.query = '';\n state = QUERY;\n } else if (chr == '#') {\n url.host = base.host;\n url.path = arraySlice(base.path);\n url.query = base.query;\n url.fragment = '';\n state = FRAGMENT;\n } else {\n if (!startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {\n url.host = base.host;\n url.path = arraySlice(base.path);\n url.shortenPath();\n }\n state = PATH;\n continue;\n }\n } else {\n state = PATH;\n continue;\n } break;\n\n case FILE_SLASH:\n if (chr == '/' || chr == '\\\\') {\n state = FILE_HOST;\n break;\n }\n if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {\n if (isWindowsDriveLetter(base.path[0], true)) push(url.path, base.path[0]);\n else url.host = base.host;\n }\n state = PATH;\n continue;\n\n case FILE_HOST:\n if (chr == EOF || chr == '/' || chr == '\\\\' || chr == '?' || chr == '#') {\n if (!stateOverride && isWindowsDriveLetter(buffer)) {\n state = PATH;\n } else if (buffer == '') {\n url.host = '';\n if (stateOverride) return;\n state = PATH_START;\n } else {\n failure = url.parseHost(buffer);\n if (failure) return failure;\n if (url.host == 'localhost') url.host = '';\n if (stateOverride) return;\n buffer = '';\n state = PATH_START;\n } continue;\n } else buffer += chr;\n break;\n\n case PATH_START:\n if (url.isSpecial()) {\n state = PATH;\n if (chr != '/' && chr != '\\\\') continue;\n } else if (!stateOverride && chr == '?') {\n url.query = '';\n state = QUERY;\n } else if (!stateOverride && chr == '#') {\n url.fragment = '';\n state = FRAGMENT;\n } else if (chr != EOF) {\n state = PATH;\n if (chr != '/') continue;\n } break;\n\n case PATH:\n if (\n chr == EOF || chr == '/' ||\n (chr == '\\\\' && url.isSpecial()) ||\n (!stateOverride && (chr == '?' || chr == '#'))\n ) {\n if (isDoubleDot(buffer)) {\n url.shortenPath();\n if (chr != '/' && !(chr == '\\\\' && url.isSpecial())) {\n push(url.path, '');\n }\n } else if (isSingleDot(buffer)) {\n if (chr != '/' && !(chr == '\\\\' && url.isSpecial())) {\n push(url.path, '');\n }\n } else {\n if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {\n if (url.host) url.host = '';\n buffer = charAt(buffer, 0) + ':'; // normalize windows drive letter\n }\n push(url.path, buffer);\n }\n buffer = '';\n if (url.scheme == 'file' && (chr == EOF || chr == '?' || chr == '#')) {\n while (url.path.length > 1 && url.path[0] === '') {\n shift(url.path);\n }\n }\n if (chr == '?') {\n url.query = '';\n state = QUERY;\n } else if (chr == '#') {\n url.fragment = '';\n state = FRAGMENT;\n }\n } else {\n buffer += percentEncode(chr, pathPercentEncodeSet);\n } break;\n\n case CANNOT_BE_A_BASE_URL_PATH:\n if (chr == '?') {\n url.query = '';\n state = QUERY;\n } else if (chr == '#') {\n url.fragment = '';\n state = FRAGMENT;\n } else if (chr != EOF) {\n url.path[0] += percentEncode(chr, C0ControlPercentEncodeSet);\n } break;\n\n case QUERY:\n if (!stateOverride && chr == '#') {\n url.fragment = '';\n state = FRAGMENT;\n } else if (chr != EOF) {\n if (chr == \"'\" && url.isSpecial()) url.query += '%27';\n else if (chr == '#') url.query += '%23';\n else url.query += percentEncode(chr, C0ControlPercentEncodeSet);\n } break;\n\n case FRAGMENT:\n if (chr != EOF) url.fragment += percentEncode(chr, fragmentPercentEncodeSet);\n break;\n }\n\n pointer++;\n }\n },\n // https://url.spec.whatwg.org/#host-parsing\n parseHost: function (input) {\n var result, codePoints, index;\n if (charAt(input, 0) == '[') {\n if (charAt(input, input.length - 1) != ']') return INVALID_HOST;\n result = parseIPv6(stringSlice(input, 1, -1));\n if (!result) return INVALID_HOST;\n this.host = result;\n // opaque host\n } else if (!this.isSpecial()) {\n if (exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT, input)) return INVALID_HOST;\n result = '';\n codePoints = arrayFrom(input);\n for (index = 0; index < codePoints.length; index++) {\n result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);\n }\n this.host = result;\n } else {\n input = toASCII(input);\n if (exec(FORBIDDEN_HOST_CODE_POINT, input)) return INVALID_HOST;\n result = parseIPv4(input);\n if (result === null) return INVALID_HOST;\n this.host = result;\n }\n },\n // https://url.spec.whatwg.org/#cannot-have-a-username-password-port\n cannotHaveUsernamePasswordPort: function () {\n return !this.host || this.cannotBeABaseURL || this.scheme == 'file';\n },\n // https://url.spec.whatwg.org/#include-credentials\n includesCredentials: function () {\n return this.username != '' || this.password != '';\n },\n // https://url.spec.whatwg.org/#is-special\n isSpecial: function () {\n return hasOwn(specialSchemes, this.scheme);\n },\n // https://url.spec.whatwg.org/#shorten-a-urls-path\n shortenPath: function () {\n var path = this.path;\n var pathSize = path.length;\n if (pathSize && (this.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) {\n path.length--;\n }\n },\n // https://url.spec.whatwg.org/#concept-url-serializer\n serialize: function () {\n var url = this;\n var scheme = url.scheme;\n var username = url.username;\n var password = url.password;\n var host = url.host;\n var port = url.port;\n var path = url.path;\n var query = url.query;\n var fragment = url.fragment;\n var output = scheme + ':';\n if (host !== null) {\n output += '//';\n if (url.includesCredentials()) {\n output += username + (password ? ':' + password : '') + '@';\n }\n output += serializeHost(host);\n if (port !== null) output += ':' + port;\n } else if (scheme == 'file') output += '//';\n output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : '';\n if (query !== null) output += '?' + query;\n if (fragment !== null) output += '#' + fragment;\n return output;\n },\n // https://url.spec.whatwg.org/#dom-url-href\n setHref: function (href) {\n var failure = this.parse(href);\n if (failure) throw TypeError(failure);\n this.searchParams.update();\n },\n // https://url.spec.whatwg.org/#dom-url-origin\n getOrigin: function () {\n var scheme = this.scheme;\n var port = this.port;\n if (scheme == 'blob') try {\n return new URLConstructor(scheme.path[0]).origin;\n } catch (error) {\n return 'null';\n }\n if (scheme == 'file' || !this.isSpecial()) return 'null';\n return scheme + '://' + serializeHost(this.host) + (port !== null ? ':' + port : '');\n },\n // https://url.spec.whatwg.org/#dom-url-protocol\n getProtocol: function () {\n return this.scheme + ':';\n },\n setProtocol: function (protocol) {\n this.parse($toString(protocol) + ':', SCHEME_START);\n },\n // https://url.spec.whatwg.org/#dom-url-username\n getUsername: function () {\n return this.username;\n },\n setUsername: function (username) {\n var codePoints = arrayFrom($toString(username));\n if (this.cannotHaveUsernamePasswordPort()) return;\n this.username = '';\n for (var i = 0; i < codePoints.length; i++) {\n this.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);\n }\n },\n // https://url.spec.whatwg.org/#dom-url-password\n getPassword: function () {\n return this.password;\n },\n setPassword: function (password) {\n var codePoints = arrayFrom($toString(password));\n if (this.cannotHaveUsernamePasswordPort()) return;\n this.password = '';\n for (var i = 0; i < codePoints.length; i++) {\n this.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);\n }\n },\n // https://url.spec.whatwg.org/#dom-url-host\n getHost: function () {\n var host = this.host;\n var port = this.port;\n return host === null ? ''\n : port === null ? serializeHost(host)\n : serializeHost(host) + ':' + port;\n },\n setHost: function (host) {\n if (this.cannotBeABaseURL) return;\n this.parse(host, HOST);\n },\n // https://url.spec.whatwg.org/#dom-url-hostname\n getHostname: function () {\n var host = this.host;\n return host === null ? '' : serializeHost(host);\n },\n setHostname: function (hostname) {\n if (this.cannotBeABaseURL) return;\n this.parse(hostname, HOSTNAME);\n },\n // https://url.spec.whatwg.org/#dom-url-port\n getPort: function () {\n var port = this.port;\n return port === null ? '' : $toString(port);\n },\n setPort: function (port) {\n if (this.cannotHaveUsernamePasswordPort()) return;\n port = $toString(port);\n if (port == '') this.port = null;\n else this.parse(port, PORT);\n },\n // https://url.spec.whatwg.org/#dom-url-pathname\n getPathname: function () {\n var path = this.path;\n return this.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : '';\n },\n setPathname: function (pathname) {\n if (this.cannotBeABaseURL) return;\n this.path = [];\n this.parse(pathname, PATH_START);\n },\n // https://url.spec.whatwg.org/#dom-url-search\n getSearch: function () {\n var query = this.query;\n return query ? '?' + query : '';\n },\n setSearch: function (search) {\n search = $toString(search);\n if (search == '') {\n this.query = null;\n } else {\n if ('?' == charAt(search, 0)) search = stringSlice(search, 1);\n this.query = '';\n this.parse(search, QUERY);\n }\n this.searchParams.update();\n },\n // https://url.spec.whatwg.org/#dom-url-searchparams\n getSearchParams: function () {\n return this.searchParams.facade;\n },\n // https://url.spec.whatwg.org/#dom-url-hash\n getHash: function () {\n var fragment = this.fragment;\n return fragment ? '#' + fragment : '';\n },\n setHash: function (hash) {\n hash = $toString(hash);\n if (hash == '') {\n this.fragment = null;\n return;\n }\n if ('#' == charAt(hash, 0)) hash = stringSlice(hash, 1);\n this.fragment = '';\n this.parse(hash, FRAGMENT);\n },\n update: function () {\n this.query = this.searchParams.serialize() || null;\n }\n};\n\n// `URL` constructor\n// https://url.spec.whatwg.org/#url-class\nvar URLConstructor = function URL(url /* , base */) {\n var that = anInstance(this, URLPrototype);\n var base = validateArgumentsLength(arguments.length, 1) > 1 ? arguments[1] : undefined;\n var state = setInternalState(that, new URLState(url, false, base));\n if (!DESCRIPTORS) {\n that.href = state.serialize();\n that.origin = state.getOrigin();\n that.protocol = state.getProtocol();\n that.username = state.getUsername();\n that.password = state.getPassword();\n that.host = state.getHost();\n that.hostname = state.getHostname();\n that.port = state.getPort();\n that.pathname = state.getPathname();\n that.search = state.getSearch();\n that.searchParams = state.getSearchParams();\n that.hash = state.getHash();\n }\n};\n\nvar URLPrototype = URLConstructor.prototype;\n\nvar accessorDescriptor = function (getter, setter) {\n return {\n get: function () {\n return getInternalURLState(this)[getter]();\n },\n set: setter && function (value) {\n return getInternalURLState(this)[setter](value);\n },\n configurable: true,\n enumerable: true\n };\n};\n\nif (DESCRIPTORS) {\n defineProperties(URLPrototype, {\n // `URL.prototype.href` accessors pair\n // https://url.spec.whatwg.org/#dom-url-href\n href: accessorDescriptor('serialize', 'setHref'),\n // `URL.prototype.origin` getter\n // https://url.spec.whatwg.org/#dom-url-origin\n origin: accessorDescriptor('getOrigin'),\n // `URL.prototype.protocol` accessors pair\n // https://url.spec.whatwg.org/#dom-url-protocol\n protocol: accessorDescriptor('getProtocol', 'setProtocol'),\n // `URL.prototype.username` accessors pair\n // https://url.spec.whatwg.org/#dom-url-username\n username: accessorDescriptor('getUsername', 'setUsername'),\n // `URL.prototype.password` accessors pair\n // https://url.spec.whatwg.org/#dom-url-password\n password: accessorDescriptor('getPassword', 'setPassword'),\n // `URL.prototype.host` accessors pair\n // https://url.spec.whatwg.org/#dom-url-host\n host: accessorDescriptor('getHost', 'setHost'),\n // `URL.prototype.hostname` accessors pair\n // https://url.spec.whatwg.org/#dom-url-hostname\n hostname: accessorDescriptor('getHostname', 'setHostname'),\n // `URL.prototype.port` accessors pair\n // https://url.spec.whatwg.org/#dom-url-port\n port: accessorDescriptor('getPort', 'setPort'),\n // `URL.prototype.pathname` accessors pair\n // https://url.spec.whatwg.org/#dom-url-pathname\n pathname: accessorDescriptor('getPathname', 'setPathname'),\n // `URL.prototype.search` accessors pair\n // https://url.spec.whatwg.org/#dom-url-search\n search: accessorDescriptor('getSearch', 'setSearch'),\n // `URL.prototype.searchParams` getter\n // https://url.spec.whatwg.org/#dom-url-searchparams\n searchParams: accessorDescriptor('getSearchParams'),\n // `URL.prototype.hash` accessors pair\n // https://url.spec.whatwg.org/#dom-url-hash\n hash: accessorDescriptor('getHash', 'setHash')\n });\n}\n\n// `URL.prototype.toJSON` method\n// https://url.spec.whatwg.org/#dom-url-tojson\nredefine(URLPrototype, 'toJSON', function toJSON() {\n return getInternalURLState(this).serialize();\n}, { enumerable: true });\n\n// `URL.prototype.toString` method\n// https://url.spec.whatwg.org/#URL-stringification-behavior\nredefine(URLPrototype, 'toString', function toString() {\n return getInternalURLState(this).serialize();\n}, { enumerable: true });\n\nif (NativeURL) {\n var nativeCreateObjectURL = NativeURL.createObjectURL;\n var nativeRevokeObjectURL = NativeURL.revokeObjectURL;\n // `URL.createObjectURL` method\n // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL\n if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', bind(nativeCreateObjectURL, NativeURL));\n // `URL.revokeObjectURL` method\n // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL\n if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', bind(nativeRevokeObjectURL, NativeURL));\n}\n\nsetToStringTag(URLConstructor, 'URL');\n\n$({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {\n URL: URLConstructor\n});\n","// TODO: Remove this module from `core-js@4` since it's replaced to module below\nrequire('../modules/web.url.constructor');\n"],"names":["super_","UrlPlugin","options","this","bookReaderOptions","urlSchema","name","position","default","deprecated_for","urlState","urlMode","urlHistoryBasePath","urlLocationPollId","oldLocationHash","oldUserHash","searchParams","URLSearchParams","pathParams","Object","keys","forEach","key","schema","find","schemaKey","append","strPathParams","filter","s","map","join","strStrippedTrailingSlash","replace","concatenatedPath","toString","urlString","urlPath","URL","urlSearchParamsObj","fromEntries","entries","splitUrlMatches","pathname","match","urlStrSplitSlashObj","x","split","doesKeyExists","_object","_key","some","value","hasPropertyKey","pushToAddressBar","urlStrPath","urlStateToUrlString","window","history","replaceState","newUrlPath","trim","e","location","hash","substr","clearInterval","setInterval","newFragment","urlStringToUrlState","path","length","search","extend","BookReader","defaultOptions","enableUrlPlugin","bookId","defaults","updateWindowTitle","urlTrackedParams","urlTrackIndex0","prototype","setup","call","locationPollId","init","bind","eventNames","PostInit","document","title","shortTitle","bookTitle","urlStartLocationPolling","fragmentChange","urlUpdateFragment","maximumCharacters","urlReadFragment","params","paramsFromFragment","updateParams","updateFromParams","trigger","stop","animating","autoStop","animationFinishedCallback","allParams","paramsFromCurrent","index","page","reduce","validParams","paramName","fragmentFromParams","currFragment","currQueryString","getLocationSearch","newQueryString","queryStringFromParams","baseWithoutSlash","newFragmentWithSlash","newQueryStringSearch","urlParamsFiltersOnlySearch","readQueryString","url","has","q","get","urlReadHashFragment","BookreaderUrlPlugin","urlPlugin","listenForHashChanges","global","uncurryThis","maxInt","regexNonASCII","regexSeparators","OVERFLOW_ERROR","RangeError","exec","floor","Math","fromCharCode","String","charCodeAt","push","toLowerCase","digitToBasic","digit","adapt","delta","numPoints","firstTime","k","baseMinusTMin","base","encode","input","i","currentValue","output","inputLength","string","counter","extra","ucs2decode","n","bias","basicLength","handledCPCount","m","handledCPCountPlusOne","t","qMinusT","baseMinusT","module","exports","label","encoded","labels","PROPER_FUNCTION_NAME","fails","whitespaces","METHOD_NAME","$","$entries","target","stat","O","iterate","createProperty","iterable","obj","v","AS_ENTRIES","$trim","proto","forced","forcedStringTrimMethod","EOF","DESCRIPTORS","USE_NATIVE_URL","defineProperties","redefine","anInstance","hasOwn","assign","arrayFrom","arraySlice","codeAt","toASCII","$toString","setToStringTag","validateArgumentsLength","URLSearchParamsModule","InternalStateModule","setInternalState","set","getInternalURLState","getterFor","getInternalSearchParamsState","getState","NativeURL","TypeError","parseInt","pow","charAt","numberToString","pop","shift","stringSlice","slice","unshift","INVALID_SCHEME","INVALID_HOST","INVALID_PORT","ALPHA","ALPHANUMERIC","DIGIT","HEX_START","OCT","DEC","HEX","FORBIDDEN_HOST_CODE_POINT","FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT","LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE","TAB_AND_NEW_LINE","serializeHost","host","result","compress","ignore0","ipv6","maxIndex","maxLength","currStart","currLength","findLongestZeroSequence","C0ControlPercentEncodeSet","fragmentPercentEncodeSet","pathPercentEncodeSet","userinfoPercentEncodeSet","percentEncode","chr","code","encodeURIComponent","specialSchemes","ftp","file","http","https","ws","wss","isWindowsDriveLetter","normalized","second","startsWithWindowsDriveLetter","third","isSingleDot","segment","SCHEME_START","SCHEME","NO_SCHEME","SPECIAL_RELATIVE_OR_AUTHORITY","PATH_OR_AUTHORITY","RELATIVE","RELATIVE_SLASH","SPECIAL_AUTHORITY_SLASHES","SPECIAL_AUTHORITY_IGNORE_SLASHES","AUTHORITY","HOST","HOSTNAME","PORT","FILE","FILE_SLASH","FILE_HOST","PATH_START","PATH","CANNOT_BE_A_BASE_URL_PATH","QUERY","FRAGMENT","URLState","isBase","baseState","failure","parse","undefined","bindURL","type","stateOverride","codePoints","bufferCodePoints","state","pointer","buffer","seenAt","seenBracket","seenPasswordToken","scheme","username","password","port","query","fragment","cannotBeABaseURL","isSpecial","includesCredentials","codePoint","encodedCodePoints","parseHost","shortenPath","numbersSeen","ipv4Piece","number","swaps","swap","address","pieceIndex","parseIPv6","partsLength","numbers","part","radix","ipv4","parts","parseIPv4","cannotHaveUsernamePasswordPort","pathSize","serialize","setHref","href","update","getOrigin","URLConstructor","origin","error","getProtocol","setProtocol","protocol","getUsername","setUsername","getPassword","setPassword","getHost","setHost","getHostname","setHostname","hostname","getPort","setPort","getPathname","setPathname","getSearch","setSearch","getSearchParams","facade","getHash","setHash","that","URLPrototype","arguments","accessorDescriptor","getter","setter","configurable","enumerable","nativeCreateObjectURL","createObjectURL","nativeRevokeObjectURL","revokeObjectURL","sham"],"sourceRoot":""}
|
1
|
+
{"version":3,"file":"plugins/plugin.url.js","mappings":"krCAAO,ICkCgCA,EDlC1BC,EAAS,WACpB,SAAAA,IAA0B,IAAdC,EAAOC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAC,G,4FAACG,CAAA,KAAAL,GACtBM,KAAKC,kBAAoBN,EAGzBK,KAAKE,UAAY,CACf,CAAEC,KAAM,OAAQC,SAAU,OAAQC,QAAS,MAC3C,CAAEF,KAAM,OAAQC,SAAU,OAAQC,QAAS,OAC3C,CAAEF,KAAM,SAAUC,SAAU,OAAQE,eAAgB,KACpD,CAAEH,KAAM,IAAKC,SAAU,eACvB,CAAED,KAAM,OAAQC,SAAU,eAC1B,CAAED,KAAM,OAAQC,SAAU,eAC1B,CAAED,KAAM,QAASC,SAAU,gBAG7BJ,KAAKO,SAAW,CAAC,EACjBP,KAAKQ,QAAUR,KAAKC,kBAAkBO,SAAW,OACjDR,KAAKS,mBAAqBT,KAAKC,kBAAkBQ,oBAAuB,IACxET,KAAKU,kBAAoB,KACzBV,KAAKW,gBAAkB,KACvBX,KAAKY,YAAc,IACrB,C,QA0KC,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AOjK,EAAoB5O,MAAM8W,WACnC,GAAG,CAAEoC,YAAY,IAIjBtL,EAAciL,GAAc,YAAY,WACtC,OAAOjK,EAAoB5O,MAAM8W,WACnC,GAAG,CAAEoC,YAAY,IAEblK,EAAW,CACb,IAAImK,GAAwBnK,EAAUoK,gBAClCC,GAAwBrK,EAAUsK,gBAGlCH,IAAuBvL,EAAcuJ,GAAgB,kBAAmBvR,EAAKuT,GAAuBnK,IAGpGqK,IAAuBzL,EAAcuJ,GAAgB,kBAAmBvR,EAAKyT,GAAuBrK,GAC1G,CAEAV,EAAe6I,GAAgB,OAE/B1K,EAAE,CAAEkB,QAAQ,EAAM4L,aAAa,EAAMjM,QAASI,EAAgB8L,MAAO/L,GAAe,CAClF/K,IAAKyU,I,sBCjhCP,EAAQ,K","sources":["webpack://@internetarchive/bookreader/./src/plugins/url/UrlPlugin.js","webpack://@internetarchive/bookreader/./src/plugins/url/plugin.url.js","webpack://@internetarchive/bookreader/./node_modules/core-js/internals/string-punycode-to-ascii.js","webpack://@internetarchive/bookreader/./node_modules/core-js/internals/string-trim-forced.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.object.entries.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.object.from-entries.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.string.trim.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/web.url.constructor.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/web.url.js"],"sourcesContent":["export class UrlPlugin {\n constructor(options = {}) {\n this.bookReaderOptions = options;\n\n // the canonical order of elements is important in the path and query string\n this.urlSchema = [\n { name: 'page', position: 'path', default: 'n0' },\n { name: 'mode', position: 'path', default: '2up' },\n { name: 'search', position: 'path', deprecated_for: 'q' },\n { name: 'q', position: 'query_param' },\n { name: 'sort', position: 'query_param' },\n { name: 'view', position: 'query_param' },\n { name: 'admin', position: 'query_param' },\n ];\n\n this.urlState = {};\n this.urlMode = this.bookReaderOptions.urlMode || 'hash';\n this.urlHistoryBasePath = this.bookReaderOptions.urlHistoryBasePath || '/';\n this.urlLocationPollId = null;\n this.oldLocationHash = null;\n this.oldUserHash = null;\n }\n\n /**\n * Parse JSON object URL state to string format\n * Arrange path names in an order that it is positioned on the urlSchema\n * @param {Object} urlState\n * @returns {string}\n */\n urlStateToUrlString(urlState) {\n const searchParams = new URLSearchParams();\n const pathParams = {};\n\n Object.keys(urlState).forEach(key => {\n let schema = this.urlSchema.find(schema => schema.name === key);\n if (schema?.deprecated_for) {\n schema = this.urlSchema.find(schemaKey => schemaKey.name === schema.deprecated_for);\n }\n if (schema?.position == 'path') {\n pathParams[schema?.name] = urlState[key];\n } else {\n searchParams.append(schema?.name || key, urlState[key]);\n }\n });\n\n const strPathParams = this.urlSchema\n .filter(s => s.position == 'path')\n .map(schema => pathParams[schema.name] ? `${schema.name}/${pathParams[schema.name]}` : '')\n .join('/');\n\n // replace consecutive slashes with a single slash + remove trailing slashes\n const strStrippedTrailingSlash = `${strPathParams.replace(/\\/+/g, '/').replace(/\\/+$/, '')}`;\n const concatenatedPath = `${strStrippedTrailingSlash}?${searchParams.toString()}`;\n return searchParams.toString() ? concatenatedPath : `${strStrippedTrailingSlash}`;\n }\n\n /**\n * Parse string URL and add it in the current urlState\n * Example:\n * /page/n7/mode/2up => {page: 'n7', mode: '2up'}\n * /page/n7/mode/2up/search/hello => {page: 'n7', mode: '2up', q: 'hello'}\n * @param {string} urlString\n * @returns {object}\n */\n urlStringToUrlState(urlString) {\n const urlState = {};\n\n // Fetch searchParams from given {str}\n // Note: whole URL path is needed for URL parsing\n const urlPath = new URL(urlString, 'http://example.com');\n const urlSearchParamsObj = Object.fromEntries(urlPath.searchParams.entries());\n const splitUrlMatches = urlPath.pathname.match(/[^\\\\/]+\\/[^\\\\/]+/g);\n const urlStrSplitSlashObj = splitUrlMatches ? Object.fromEntries(splitUrlMatches.map(x => x.split('/'))) : {};\n\n const doesKeyExists = (_object, _key) => {\n return Object.keys(_object).some(value => value == _key);\n };\n\n // Add path objects to urlState\n this.urlSchema\n .filter(schema => schema.position == 'path')\n .forEach(schema => {\n const hasPropertyKey = doesKeyExists(urlStrSplitSlashObj, schema.name);\n const hasDeprecatedKey = doesKeyExists(schema, 'deprecated_for') && hasPropertyKey;\n\n if (hasDeprecatedKey) {\n urlState[schema.deprecated_for] = urlStrSplitSlashObj[schema.name];\n return;\n }\n\n if (hasPropertyKey) {\n urlState[schema.name] = urlStrSplitSlashObj[schema.name];\n return;\n }\n });\n\n // Add searchParams to urlState\n Object.entries(urlSearchParamsObj).forEach(([key, value]) => {\n urlState[key] = value;\n });\n\n return urlState;\n }\n\n /**\n * Add or update key-value to the urlState\n * @param {string} key\n * @param {string} val\n */\n setUrlParam(key, value) {\n this.urlState[key] = value;\n\n this.pushToAddressBar();\n }\n\n /**\n * Delete key-value to the urlState\n * @param {string} key\n */\n removeUrlParam(key) {\n delete this.urlState[key];\n\n this.pushToAddressBar();\n }\n\n /**\n * Get key-value from the urlState\n * @param {string} key\n * @return {string}\n */\n getUrlParam(key) {\n return this.urlState[key];\n }\n\n /**\n * Push URL params to addressbar\n */\n pushToAddressBar() {\n const urlStrPath = this.urlStateToUrlString(this.urlState);\n const concatenatedPath = urlStrPath !== '/' ? urlStrPath : '';\n if (this.urlMode == 'history') {\n if (!window.history || !window.history.replaceState) {\n this.options.urlMode = 'hash';\n } else {\n const newUrlPath = `${this.urlHistoryBasePath}${concatenatedPath}`.trim().replace(/(\\/+)/g, '/');\n try {\n window.history.replaceState({}, null, newUrlPath);\n } catch (e) {\n // DOMException on Chrome when in sandboxed iframe\n this.urlMode = 'hash';\n }\n }\n }\n\n if (this.urlMode == 'hash') {\n window.location.replace('#' + concatenatedPath);\n }\n this.oldLocationHash = urlStrPath;\n }\n\n /**\n * Get the url and check if it has changed\n * If it was changeed, update the urlState\n */\n listenForHashChanges() {\n this.oldLocationHash = window.location.hash.substr(1);\n if (this.urlLocationPollId) {\n clearInterval(this.urlLocationPollId);\n this.urlLocationPollId = null;\n }\n\n // check if the URL changes\n const updateHash = () => {\n const newFragment = window.location.hash.substr(1);\n const hasFragmentChange = newFragment != this.oldLocationHash;\n\n if (!hasFragmentChange) { return; }\n\n this.urlState = this.urlStringToUrlState(newFragment);\n };\n this.urlLocationPollId = setInterval(updateHash, 500);\n }\n\n /**\n * Will read either the hash or URL and return the bookreader fragment\n */\n pullFromAddressBar (location = window.location) {\n const path = this.urlMode === 'history'\n ? (location.pathname.substr(this.urlHistoryBasePath.length) + location.search)\n : location.hash.substr(1);\n this.urlState = this.urlStringToUrlState(path);\n }\n}\n","/* global BookReader */\n\nimport { UrlPlugin } from \"./UrlPlugin\";\n\n/**\n * Plugin for URL management in BookReader\n * Note read more about the url \"fragment\" here:\n * https://openlibrary.org/dev/docs/bookurls\n */\n\njQuery.extend(BookReader.defaultOptions, {\n enableUrlPlugin: true,\n bookId: '',\n /** @type {string} Defaults can be a urlFragment string */\n defaults: null,\n updateWindowTitle: false,\n\n /** @type {'history' | 'hash'} */\n urlMode: 'hash',\n\n /**\n * When using 'history' mode, this part of the URL is kept constant\n * @example /details/plato/\n */\n urlHistoryBasePath: '/',\n\n /** Only these params will be reflected onto the URL */\n urlTrackedParams: ['page', 'search', 'mode', 'region', 'highlight', 'view'],\n\n /** If true, don't update the URL when `page == n0 (eg \"/page/n0\")` */\n urlTrackIndex0: false,\n});\n\n/** @override */\nBookReader.prototype.setup = (function(super_) {\n return function(options) {\n super_.call(this, options);\n\n this.bookId = options.bookId;\n this.defaults = options.defaults;\n\n this.locationPollId = null;\n this.oldLocationHash = null;\n this.oldUserHash = null;\n };\n})(BookReader.prototype.setup);\n\n/** @override */\nBookReader.prototype.init = (function(super_) {\n return function() {\n\n if (this.options.enableUrlPlugin) {\n this.bind(BookReader.eventNames.PostInit, () => {\n const { updateWindowTitle, urlMode } = this.options;\n if (updateWindowTitle) {\n document.title = this.shortTitle(this.bookTitle, 50);\n }\n if (urlMode === 'hash') {\n this.urlStartLocationPolling();\n }\n });\n\n this.bind(BookReader.eventNames.fragmentChange,\n this.urlUpdateFragment.bind(this)\n );\n }\n super_.call(this);\n };\n})(BookReader.prototype.init);\n\n/**\n * Returns a shortened version of the title with the maximum number of characters\n * @param {number} maximumCharacters\n * @return {string}\n */\nBookReader.prototype.shortTitle = function(maximumCharacters) {\n if (this.bookTitle.length < maximumCharacters) {\n return this.bookTitle;\n }\n\n const title = `${this.bookTitle.substr(0, maximumCharacters - 3)}...`;\n return title;\n};\n\n/**\n * Starts polling of window.location to see hash fragment changes\n */\nBookReader.prototype.urlStartLocationPolling = function() {\n this.oldLocationHash = this.urlReadFragment();\n\n if (this.locationPollId) {\n clearInterval(this.locationPollId);\n this.locationPollId = null;\n }\n\n const updateHash = () => {\n const newFragment = this.urlReadFragment();\n const hasFragmentChange = (newFragment != this.oldLocationHash) && (newFragment != this.oldUserHash);\n\n if (!hasFragmentChange) { return; }\n\n const params = this.paramsFromFragment(newFragment);\n\n const updateParams = () => this.updateFromParams(params);\n\n this.trigger(BookReader.eventNames.stop);\n if (this.animating) {\n // Queue change if animating\n if (this.autoStop) this.autoStop();\n this.animationFinishedCallback = updateParams;\n } else {\n // update immediately\n updateParams();\n }\n this.oldUserHash = newFragment;\n };\n\n this.locationPollId = setInterval(updateHash, 500);\n};\n\n/**\n * Update URL from the current parameters.\n * Call this instead of manually using window.location.replace\n */\nBookReader.prototype.urlUpdateFragment = function() {\n const allParams = this.paramsFromCurrent();\n const { urlTrackIndex0, urlTrackedParams } = this.options;\n\n if (!urlTrackIndex0\n && (typeof(allParams.index) !== 'undefined')\n && allParams.index === 0) {\n delete allParams.index;\n delete allParams.page;\n }\n\n const params = urlTrackedParams.reduce((validParams, paramName) => {\n if (paramName in allParams) {\n validParams[paramName] = allParams[paramName];\n }\n return validParams;\n }, {});\n\n const newFragment = this.fragmentFromParams(params, this.options.urlMode);\n const currFragment = this.urlReadFragment();\n const currQueryString = this.getLocationSearch();\n const newQueryString = this.queryStringFromParams(params, currQueryString, this.options.urlMode);\n if (currFragment === newFragment && currQueryString === newQueryString) {\n return;\n }\n\n if (this.options.urlMode === 'history') {\n if (!window.history || !window.history.replaceState) {\n this.options.urlMode = 'hash';\n } else {\n const baseWithoutSlash = this.options.urlHistoryBasePath.replace(/\\/+$/, '');\n const newFragmentWithSlash = newFragment === '' ? '' : `/${newFragment}`;\n\n const newUrlPath = `${baseWithoutSlash}${newFragmentWithSlash}${newQueryString}`;\n try {\n window.history.replaceState({}, null, newUrlPath);\n this.oldLocationHash = newFragment + newQueryString;\n } catch (e) {\n // DOMException on Chrome when in sandboxed iframe\n this.options.urlMode = 'hash';\n }\n }\n }\n\n if (this.options.urlMode === 'hash') {\n const newQueryStringSearch = this.urlParamsFiltersOnlySearch(this.readQueryString());\n window.location.replace('#' + newFragment + newQueryStringSearch);\n this.oldLocationHash = newFragment + newQueryStringSearch;\n }\n};\n\n/**\n * @private\n * Filtering query parameters to select only book search param (?q=foo)\n This needs to be updated/URL system modified if future query params are to be added\n * @param {string} url\n * @return {string}\n * */\nBookReader.prototype.urlParamsFiltersOnlySearch = function(url) {\n const params = new URLSearchParams(url);\n return params.has('q') ? `?${new URLSearchParams({ q: params.get('q') })}` : '';\n};\n\n\n/**\n * Will read either the hash or URL and return the bookreader fragment\n * @return {string}\n */\nBookReader.prototype.urlReadFragment = function() {\n const { urlMode, urlHistoryBasePath } = this.options;\n if (urlMode === 'history') {\n return window.location.pathname.substr(urlHistoryBasePath.length);\n } else {\n return window.location.hash.substr(1);\n }\n};\n\n/**\n * Will read the hash return the bookreader fragment\n * @return {string}\n */\nBookReader.prototype.urlReadHashFragment = function() {\n return window.location.hash.substr(1);\n};\nexport class BookreaderUrlPlugin extends BookReader {\n init() {\n if (this.options.enableUrlPlugin) {\n this.urlPlugin = new UrlPlugin(this.options);\n this.bind(BookReader.eventNames.PostInit, () => {\n const { urlMode } = this.options;\n\n if (urlMode === 'hash') {\n this.urlPlugin.listenForHashChanges();\n }\n });\n }\n\n super.init();\n }\n}\n\nwindow.BookReader = BookreaderUrlPlugin;\nexport default BookreaderUrlPlugin;\n","// based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nvar maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\nvar base = 36;\nvar tMin = 1;\nvar tMax = 26;\nvar skew = 38;\nvar damp = 700;\nvar initialBias = 72;\nvar initialN = 128; // 0x80\nvar delimiter = '-'; // '\\x2D'\nvar regexNonASCII = /[^\\0-\\u007E]/; // non-ASCII chars\nvar regexSeparators = /[.\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\nvar OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';\nvar baseMinusTMin = base - tMin;\n\nvar $RangeError = RangeError;\nvar exec = uncurryThis(regexSeparators.exec);\nvar floor = Math.floor;\nvar fromCharCode = String.fromCharCode;\nvar charCodeAt = uncurryThis(''.charCodeAt);\nvar join = uncurryThis([].join);\nvar push = uncurryThis([].push);\nvar replace = uncurryThis(''.replace);\nvar split = uncurryThis(''.split);\nvar toLowerCase = uncurryThis(''.toLowerCase);\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n */\nvar ucs2decode = function (string) {\n var output = [];\n var counter = 0;\n var length = string.length;\n while (counter < length) {\n var value = charCodeAt(string, counter++);\n if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n // It's a high surrogate, and there is a next character.\n var extra = charCodeAt(string, counter++);\n if ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n push(output, ((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n } else {\n // It's an unmatched surrogate; only append this code unit, in case the\n // next code unit is the high surrogate of a surrogate pair.\n push(output, value);\n counter--;\n }\n } else {\n push(output, value);\n }\n }\n return output;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n */\nvar digitToBasic = function (digit) {\n // 0..25 map to ASCII a..z or A..Z\n // 26..35 map to ASCII 0..9\n return digit + 22 + 75 * (digit < 26);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n */\nvar adapt = function (delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n while (delta > baseMinusTMin * tMax >> 1) {\n delta = floor(delta / baseMinusTMin);\n k += base;\n }\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n */\nvar encode = function (input) {\n var output = [];\n\n // Convert the input in UCS-2 to an array of Unicode code points.\n input = ucs2decode(input);\n\n // Cache the length.\n var inputLength = input.length;\n\n // Initialize the state.\n var n = initialN;\n var delta = 0;\n var bias = initialBias;\n var i, currentValue;\n\n // Handle the basic code points.\n for (i = 0; i < input.length; i++) {\n currentValue = input[i];\n if (currentValue < 0x80) {\n push(output, fromCharCode(currentValue));\n }\n }\n\n var basicLength = output.length; // number of basic code points.\n var handledCPCount = basicLength; // number of code points that have been handled;\n\n // Finish the basic string with a delimiter unless it's empty.\n if (basicLength) {\n push(output, delimiter);\n }\n\n // Main encoding loop:\n while (handledCPCount < inputLength) {\n // All non-basic code points < n have been handled already. Find the next larger one:\n var m = maxInt;\n for (i = 0; i < input.length; i++) {\n currentValue = input[i];\n if (currentValue >= n && currentValue < m) {\n m = currentValue;\n }\n }\n\n // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, but guard against overflow.\n var handledCPCountPlusOne = handledCPCount + 1;\n if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n throw $RangeError(OVERFLOW_ERROR);\n }\n\n delta += (m - n) * handledCPCountPlusOne;\n n = m;\n\n for (i = 0; i < input.length; i++) {\n currentValue = input[i];\n if (currentValue < n && ++delta > maxInt) {\n throw $RangeError(OVERFLOW_ERROR);\n }\n if (currentValue == n) {\n // Represent delta as a generalized variable-length integer.\n var q = delta;\n var k = base;\n while (true) {\n var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n if (q < t) break;\n var qMinusT = q - t;\n var baseMinusT = base - t;\n push(output, fromCharCode(digitToBasic(t + qMinusT % baseMinusT)));\n q = floor(qMinusT / baseMinusT);\n k += base;\n }\n\n push(output, fromCharCode(digitToBasic(q)));\n bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n delta = 0;\n handledCPCount++;\n }\n }\n\n delta++;\n n++;\n }\n return join(output, '');\n};\n\nmodule.exports = function (input) {\n var encoded = [];\n var labels = split(replace(toLowerCase(input), regexSeparators, '\\u002E'), '.');\n var i, label;\n for (i = 0; i < labels.length; i++) {\n label = labels[i];\n push(encoded, exec(regexNonASCII, label) ? 'xn--' + encode(label) : label);\n }\n return join(encoded, '.');\n};\n","var PROPER_FUNCTION_NAME = require('../internals/function-name').PROPER;\nvar fails = require('../internals/fails');\nvar whitespaces = require('../internals/whitespaces');\n\nvar non = '\\u200B\\u0085\\u180E';\n\n// check that a method works with the correct list\n// of whitespaces and has a correct name\nmodule.exports = function (METHOD_NAME) {\n return fails(function () {\n return !!whitespaces[METHOD_NAME]()\n || non[METHOD_NAME]() !== non\n || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);\n });\n};\n","var $ = require('../internals/export');\nvar $entries = require('../internals/object-to-array').entries;\n\n// `Object.entries` method\n// https://tc39.es/ecma262/#sec-object.entries\n$({ target: 'Object', stat: true }, {\n entries: function entries(O) {\n return $entries(O);\n }\n});\n","var $ = require('../internals/export');\nvar iterate = require('../internals/iterate');\nvar createProperty = require('../internals/create-property');\n\n// `Object.fromEntries` method\n// https://github.com/tc39/proposal-object-from-entries\n$({ target: 'Object', stat: true }, {\n fromEntries: function fromEntries(iterable) {\n var obj = {};\n iterate(iterable, function (k, v) {\n createProperty(obj, k, v);\n }, { AS_ENTRIES: true });\n return obj;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar $trim = require('../internals/string-trim').trim;\nvar forcedStringTrimMethod = require('../internals/string-trim-forced');\n\n// `String.prototype.trim` method\n// https://tc39.es/ecma262/#sec-string.prototype.trim\n$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {\n trim: function trim() {\n return $trim(this);\n }\n});\n","'use strict';\n// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`\nrequire('../modules/es.string.iterator');\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar USE_NATIVE_URL = require('../internals/url-constructor-detection');\nvar global = require('../internals/global');\nvar bind = require('../internals/function-bind-context');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar anInstance = require('../internals/an-instance');\nvar hasOwn = require('../internals/has-own-property');\nvar assign = require('../internals/object-assign');\nvar arrayFrom = require('../internals/array-from');\nvar arraySlice = require('../internals/array-slice-simple');\nvar codeAt = require('../internals/string-multibyte').codeAt;\nvar toASCII = require('../internals/string-punycode-to-ascii');\nvar $toString = require('../internals/to-string');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar validateArgumentsLength = require('../internals/validate-arguments-length');\nvar URLSearchParamsModule = require('../modules/web.url-search-params.constructor');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar setInternalState = InternalStateModule.set;\nvar getInternalURLState = InternalStateModule.getterFor('URL');\nvar URLSearchParams = URLSearchParamsModule.URLSearchParams;\nvar getInternalSearchParamsState = URLSearchParamsModule.getState;\n\nvar NativeURL = global.URL;\nvar TypeError = global.TypeError;\nvar parseInt = global.parseInt;\nvar floor = Math.floor;\nvar pow = Math.pow;\nvar charAt = uncurryThis(''.charAt);\nvar exec = uncurryThis(/./.exec);\nvar join = uncurryThis([].join);\nvar numberToString = uncurryThis(1.0.toString);\nvar pop = uncurryThis([].pop);\nvar push = uncurryThis([].push);\nvar replace = uncurryThis(''.replace);\nvar shift = uncurryThis([].shift);\nvar split = uncurryThis(''.split);\nvar stringSlice = uncurryThis(''.slice);\nvar toLowerCase = uncurryThis(''.toLowerCase);\nvar unshift = uncurryThis([].unshift);\n\nvar INVALID_AUTHORITY = 'Invalid authority';\nvar INVALID_SCHEME = 'Invalid scheme';\nvar INVALID_HOST = 'Invalid host';\nvar INVALID_PORT = 'Invalid port';\n\nvar ALPHA = /[a-z]/i;\n// eslint-disable-next-line regexp/no-obscure-range -- safe\nvar ALPHANUMERIC = /[\\d+-.a-z]/i;\nvar DIGIT = /\\d/;\nvar HEX_START = /^0x/i;\nvar OCT = /^[0-7]+$/;\nvar DEC = /^\\d+$/;\nvar HEX = /^[\\da-f]+$/i;\n/* eslint-disable regexp/no-control-character -- safe */\nvar FORBIDDEN_HOST_CODE_POINT = /[\\0\\t\\n\\r #%/:<>?@[\\\\\\]^|]/;\nvar FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\\0\\t\\n\\r #/:<>?@[\\\\\\]^|]/;\nvar LEADING_C0_CONTROL_OR_SPACE = /^[\\u0000-\\u0020]+/;\nvar TRAILING_C0_CONTROL_OR_SPACE = /(^|[^\\u0000-\\u0020])[\\u0000-\\u0020]+$/;\nvar TAB_AND_NEW_LINE = /[\\t\\n\\r]/g;\n/* eslint-enable regexp/no-control-character -- safe */\nvar EOF;\n\n// https://url.spec.whatwg.org/#ipv4-number-parser\nvar parseIPv4 = function (input) {\n var parts = split(input, '.');\n var partsLength, numbers, index, part, radix, number, ipv4;\n if (parts.length && parts[parts.length - 1] == '') {\n parts.length--;\n }\n partsLength = parts.length;\n if (partsLength > 4) return input;\n numbers = [];\n for (index = 0; index < partsLength; index++) {\n part = parts[index];\n if (part == '') return input;\n radix = 10;\n if (part.length > 1 && charAt(part, 0) == '0') {\n radix = exec(HEX_START, part) ? 16 : 8;\n part = stringSlice(part, radix == 8 ? 1 : 2);\n }\n if (part === '') {\n number = 0;\n } else {\n if (!exec(radix == 10 ? DEC : radix == 8 ? OCT : HEX, part)) return input;\n number = parseInt(part, radix);\n }\n push(numbers, number);\n }\n for (index = 0; index < partsLength; index++) {\n number = numbers[index];\n if (index == partsLength - 1) {\n if (number >= pow(256, 5 - partsLength)) return null;\n } else if (number > 255) return null;\n }\n ipv4 = pop(numbers);\n for (index = 0; index < numbers.length; index++) {\n ipv4 += numbers[index] * pow(256, 3 - index);\n }\n return ipv4;\n};\n\n// https://url.spec.whatwg.org/#concept-ipv6-parser\n// eslint-disable-next-line max-statements -- TODO\nvar parseIPv6 = function (input) {\n var address = [0, 0, 0, 0, 0, 0, 0, 0];\n var pieceIndex = 0;\n var compress = null;\n var pointer = 0;\n var value, length, numbersSeen, ipv4Piece, number, swaps, swap;\n\n var chr = function () {\n return charAt(input, pointer);\n };\n\n if (chr() == ':') {\n if (charAt(input, 1) != ':') return;\n pointer += 2;\n pieceIndex++;\n compress = pieceIndex;\n }\n while (chr()) {\n if (pieceIndex == 8) return;\n if (chr() == ':') {\n if (compress !== null) return;\n pointer++;\n pieceIndex++;\n compress = pieceIndex;\n continue;\n }\n value = length = 0;\n while (length < 4 && exec(HEX, chr())) {\n value = value * 16 + parseInt(chr(), 16);\n pointer++;\n length++;\n }\n if (chr() == '.') {\n if (length == 0) return;\n pointer -= length;\n if (pieceIndex > 6) return;\n numbersSeen = 0;\n while (chr()) {\n ipv4Piece = null;\n if (numbersSeen > 0) {\n if (chr() == '.' && numbersSeen < 4) pointer++;\n else return;\n }\n if (!exec(DIGIT, chr())) return;\n while (exec(DIGIT, chr())) {\n number = parseInt(chr(), 10);\n if (ipv4Piece === null) ipv4Piece = number;\n else if (ipv4Piece == 0) return;\n else ipv4Piece = ipv4Piece * 10 + number;\n if (ipv4Piece > 255) return;\n pointer++;\n }\n address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;\n numbersSeen++;\n if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++;\n }\n if (numbersSeen != 4) return;\n break;\n } else if (chr() == ':') {\n pointer++;\n if (!chr()) return;\n } else if (chr()) return;\n address[pieceIndex++] = value;\n }\n if (compress !== null) {\n swaps = pieceIndex - compress;\n pieceIndex = 7;\n while (pieceIndex != 0 && swaps > 0) {\n swap = address[pieceIndex];\n address[pieceIndex--] = address[compress + swaps - 1];\n address[compress + --swaps] = swap;\n }\n } else if (pieceIndex != 8) return;\n return address;\n};\n\nvar findLongestZeroSequence = function (ipv6) {\n var maxIndex = null;\n var maxLength = 1;\n var currStart = null;\n var currLength = 0;\n var index = 0;\n for (; index < 8; index++) {\n if (ipv6[index] !== 0) {\n if (currLength > maxLength) {\n maxIndex = currStart;\n maxLength = currLength;\n }\n currStart = null;\n currLength = 0;\n } else {\n if (currStart === null) currStart = index;\n ++currLength;\n }\n }\n if (currLength > maxLength) {\n maxIndex = currStart;\n maxLength = currLength;\n }\n return maxIndex;\n};\n\n// https://url.spec.whatwg.org/#host-serializing\nvar serializeHost = function (host) {\n var result, index, compress, ignore0;\n // ipv4\n if (typeof host == 'number') {\n result = [];\n for (index = 0; index < 4; index++) {\n unshift(result, host % 256);\n host = floor(host / 256);\n } return join(result, '.');\n // ipv6\n } else if (typeof host == 'object') {\n result = '';\n compress = findLongestZeroSequence(host);\n for (index = 0; index < 8; index++) {\n if (ignore0 && host[index] === 0) continue;\n if (ignore0) ignore0 = false;\n if (compress === index) {\n result += index ? ':' : '::';\n ignore0 = true;\n } else {\n result += numberToString(host[index], 16);\n if (index < 7) result += ':';\n }\n }\n return '[' + result + ']';\n } return host;\n};\n\nvar C0ControlPercentEncodeSet = {};\nvar fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {\n ' ': 1, '\"': 1, '<': 1, '>': 1, '`': 1\n});\nvar pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {\n '#': 1, '?': 1, '{': 1, '}': 1\n});\nvar userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {\n '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\\\': 1, ']': 1, '^': 1, '|': 1\n});\n\nvar percentEncode = function (chr, set) {\n var code = codeAt(chr, 0);\n return code > 0x20 && code < 0x7F && !hasOwn(set, chr) ? chr : encodeURIComponent(chr);\n};\n\n// https://url.spec.whatwg.org/#special-scheme\nvar specialSchemes = {\n ftp: 21,\n file: null,\n http: 80,\n https: 443,\n ws: 80,\n wss: 443\n};\n\n// https://url.spec.whatwg.org/#windows-drive-letter\nvar isWindowsDriveLetter = function (string, normalized) {\n var second;\n return string.length == 2 && exec(ALPHA, charAt(string, 0))\n && ((second = charAt(string, 1)) == ':' || (!normalized && second == '|'));\n};\n\n// https://url.spec.whatwg.org/#start-with-a-windows-drive-letter\nvar startsWithWindowsDriveLetter = function (string) {\n var third;\n return string.length > 1 && isWindowsDriveLetter(stringSlice(string, 0, 2)) && (\n string.length == 2 ||\n ((third = charAt(string, 2)) === '/' || third === '\\\\' || third === '?' || third === '#')\n );\n};\n\n// https://url.spec.whatwg.org/#single-dot-path-segment\nvar isSingleDot = function (segment) {\n return segment === '.' || toLowerCase(segment) === '%2e';\n};\n\n// https://url.spec.whatwg.org/#double-dot-path-segment\nvar isDoubleDot = function (segment) {\n segment = toLowerCase(segment);\n return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';\n};\n\n// States:\nvar SCHEME_START = {};\nvar SCHEME = {};\nvar NO_SCHEME = {};\nvar SPECIAL_RELATIVE_OR_AUTHORITY = {};\nvar PATH_OR_AUTHORITY = {};\nvar RELATIVE = {};\nvar RELATIVE_SLASH = {};\nvar SPECIAL_AUTHORITY_SLASHES = {};\nvar SPECIAL_AUTHORITY_IGNORE_SLASHES = {};\nvar AUTHORITY = {};\nvar HOST = {};\nvar HOSTNAME = {};\nvar PORT = {};\nvar FILE = {};\nvar FILE_SLASH = {};\nvar FILE_HOST = {};\nvar PATH_START = {};\nvar PATH = {};\nvar CANNOT_BE_A_BASE_URL_PATH = {};\nvar QUERY = {};\nvar FRAGMENT = {};\n\nvar URLState = function (url, isBase, base) {\n var urlString = $toString(url);\n var baseState, failure, searchParams;\n if (isBase) {\n failure = this.parse(urlString);\n if (failure) throw TypeError(failure);\n this.searchParams = null;\n } else {\n if (base !== undefined) baseState = new URLState(base, true);\n failure = this.parse(urlString, null, baseState);\n if (failure) throw TypeError(failure);\n searchParams = getInternalSearchParamsState(new URLSearchParams());\n searchParams.bindURL(this);\n this.searchParams = searchParams;\n }\n};\n\nURLState.prototype = {\n type: 'URL',\n // https://url.spec.whatwg.org/#url-parsing\n // eslint-disable-next-line max-statements -- TODO\n parse: function (input, stateOverride, base) {\n var url = this;\n var state = stateOverride || SCHEME_START;\n var pointer = 0;\n var buffer = '';\n var seenAt = false;\n var seenBracket = false;\n var seenPasswordToken = false;\n var codePoints, chr, bufferCodePoints, failure;\n\n input = $toString(input);\n\n if (!stateOverride) {\n url.scheme = '';\n url.username = '';\n url.password = '';\n url.host = null;\n url.port = null;\n url.path = [];\n url.query = null;\n url.fragment = null;\n url.cannotBeABaseURL = false;\n input = replace(input, LEADING_C0_CONTROL_OR_SPACE, '');\n input = replace(input, TRAILING_C0_CONTROL_OR_SPACE, '$1');\n }\n\n input = replace(input, TAB_AND_NEW_LINE, '');\n\n codePoints = arrayFrom(input);\n\n while (pointer <= codePoints.length) {\n chr = codePoints[pointer];\n switch (state) {\n case SCHEME_START:\n if (chr && exec(ALPHA, chr)) {\n buffer += toLowerCase(chr);\n state = SCHEME;\n } else if (!stateOverride) {\n state = NO_SCHEME;\n continue;\n } else return INVALID_SCHEME;\n break;\n\n case SCHEME:\n if (chr && (exec(ALPHANUMERIC, chr) || chr == '+' || chr == '-' || chr == '.')) {\n buffer += toLowerCase(chr);\n } else if (chr == ':') {\n if (stateOverride && (\n (url.isSpecial() != hasOwn(specialSchemes, buffer)) ||\n (buffer == 'file' && (url.includesCredentials() || url.port !== null)) ||\n (url.scheme == 'file' && !url.host)\n )) return;\n url.scheme = buffer;\n if (stateOverride) {\n if (url.isSpecial() && specialSchemes[url.scheme] == url.port) url.port = null;\n return;\n }\n buffer = '';\n if (url.scheme == 'file') {\n state = FILE;\n } else if (url.isSpecial() && base && base.scheme == url.scheme) {\n state = SPECIAL_RELATIVE_OR_AUTHORITY;\n } else if (url.isSpecial()) {\n state = SPECIAL_AUTHORITY_SLASHES;\n } else if (codePoints[pointer + 1] == '/') {\n state = PATH_OR_AUTHORITY;\n pointer++;\n } else {\n url.cannotBeABaseURL = true;\n push(url.path, '');\n state = CANNOT_BE_A_BASE_URL_PATH;\n }\n } else if (!stateOverride) {\n buffer = '';\n state = NO_SCHEME;\n pointer = 0;\n continue;\n } else return INVALID_SCHEME;\n break;\n\n case NO_SCHEME:\n if (!base || (base.cannotBeABaseURL && chr != '#')) return INVALID_SCHEME;\n if (base.cannotBeABaseURL && chr == '#') {\n url.scheme = base.scheme;\n url.path = arraySlice(base.path);\n url.query = base.query;\n url.fragment = '';\n url.cannotBeABaseURL = true;\n state = FRAGMENT;\n break;\n }\n state = base.scheme == 'file' ? FILE : RELATIVE;\n continue;\n\n case SPECIAL_RELATIVE_OR_AUTHORITY:\n if (chr == '/' && codePoints[pointer + 1] == '/') {\n state = SPECIAL_AUTHORITY_IGNORE_SLASHES;\n pointer++;\n } else {\n state = RELATIVE;\n continue;\n } break;\n\n case PATH_OR_AUTHORITY:\n if (chr == '/') {\n state = AUTHORITY;\n break;\n } else {\n state = PATH;\n continue;\n }\n\n case RELATIVE:\n url.scheme = base.scheme;\n if (chr == EOF) {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = arraySlice(base.path);\n url.query = base.query;\n } else if (chr == '/' || (chr == '\\\\' && url.isSpecial())) {\n state = RELATIVE_SLASH;\n } else if (chr == '?') {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = arraySlice(base.path);\n url.query = '';\n state = QUERY;\n } else if (chr == '#') {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = arraySlice(base.path);\n url.query = base.query;\n url.fragment = '';\n state = FRAGMENT;\n } else {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = arraySlice(base.path);\n url.path.length--;\n state = PATH;\n continue;\n } break;\n\n case RELATIVE_SLASH:\n if (url.isSpecial() && (chr == '/' || chr == '\\\\')) {\n state = SPECIAL_AUTHORITY_IGNORE_SLASHES;\n } else if (chr == '/') {\n state = AUTHORITY;\n } else {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n state = PATH;\n continue;\n } break;\n\n case SPECIAL_AUTHORITY_SLASHES:\n state = SPECIAL_AUTHORITY_IGNORE_SLASHES;\n if (chr != '/' || charAt(buffer, pointer + 1) != '/') continue;\n pointer++;\n break;\n\n case SPECIAL_AUTHORITY_IGNORE_SLASHES:\n if (chr != '/' && chr != '\\\\') {\n state = AUTHORITY;\n continue;\n } break;\n\n case AUTHORITY:\n if (chr == '@') {\n if (seenAt) buffer = '%40' + buffer;\n seenAt = true;\n bufferCodePoints = arrayFrom(buffer);\n for (var i = 0; i < bufferCodePoints.length; i++) {\n var codePoint = bufferCodePoints[i];\n if (codePoint == ':' && !seenPasswordToken) {\n seenPasswordToken = true;\n continue;\n }\n var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);\n if (seenPasswordToken) url.password += encodedCodePoints;\n else url.username += encodedCodePoints;\n }\n buffer = '';\n } else if (\n chr == EOF || chr == '/' || chr == '?' || chr == '#' ||\n (chr == '\\\\' && url.isSpecial())\n ) {\n if (seenAt && buffer == '') return INVALID_AUTHORITY;\n pointer -= arrayFrom(buffer).length + 1;\n buffer = '';\n state = HOST;\n } else buffer += chr;\n break;\n\n case HOST:\n case HOSTNAME:\n if (stateOverride && url.scheme == 'file') {\n state = FILE_HOST;\n continue;\n } else if (chr == ':' && !seenBracket) {\n if (buffer == '') return INVALID_HOST;\n failure = url.parseHost(buffer);\n if (failure) return failure;\n buffer = '';\n state = PORT;\n if (stateOverride == HOSTNAME) return;\n } else if (\n chr == EOF || chr == '/' || chr == '?' || chr == '#' ||\n (chr == '\\\\' && url.isSpecial())\n ) {\n if (url.isSpecial() && buffer == '') return INVALID_HOST;\n if (stateOverride && buffer == '' && (url.includesCredentials() || url.port !== null)) return;\n failure = url.parseHost(buffer);\n if (failure) return failure;\n buffer = '';\n state = PATH_START;\n if (stateOverride) return;\n continue;\n } else {\n if (chr == '[') seenBracket = true;\n else if (chr == ']') seenBracket = false;\n buffer += chr;\n } break;\n\n case PORT:\n if (exec(DIGIT, chr)) {\n buffer += chr;\n } else if (\n chr == EOF || chr == '/' || chr == '?' || chr == '#' ||\n (chr == '\\\\' && url.isSpecial()) ||\n stateOverride\n ) {\n if (buffer != '') {\n var port = parseInt(buffer, 10);\n if (port > 0xFFFF) return INVALID_PORT;\n url.port = (url.isSpecial() && port === specialSchemes[url.scheme]) ? null : port;\n buffer = '';\n }\n if (stateOverride) return;\n state = PATH_START;\n continue;\n } else return INVALID_PORT;\n break;\n\n case FILE:\n url.scheme = 'file';\n if (chr == '/' || chr == '\\\\') state = FILE_SLASH;\n else if (base && base.scheme == 'file') {\n if (chr == EOF) {\n url.host = base.host;\n url.path = arraySlice(base.path);\n url.query = base.query;\n } else if (chr == '?') {\n url.host = base.host;\n url.path = arraySlice(base.path);\n url.query = '';\n state = QUERY;\n } else if (chr == '#') {\n url.host = base.host;\n url.path = arraySlice(base.path);\n url.query = base.query;\n url.fragment = '';\n state = FRAGMENT;\n } else {\n if (!startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {\n url.host = base.host;\n url.path = arraySlice(base.path);\n url.shortenPath();\n }\n state = PATH;\n continue;\n }\n } else {\n state = PATH;\n continue;\n } break;\n\n case FILE_SLASH:\n if (chr == '/' || chr == '\\\\') {\n state = FILE_HOST;\n break;\n }\n if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {\n if (isWindowsDriveLetter(base.path[0], true)) push(url.path, base.path[0]);\n else url.host = base.host;\n }\n state = PATH;\n continue;\n\n case FILE_HOST:\n if (chr == EOF || chr == '/' || chr == '\\\\' || chr == '?' || chr == '#') {\n if (!stateOverride && isWindowsDriveLetter(buffer)) {\n state = PATH;\n } else if (buffer == '') {\n url.host = '';\n if (stateOverride) return;\n state = PATH_START;\n } else {\n failure = url.parseHost(buffer);\n if (failure) return failure;\n if (url.host == 'localhost') url.host = '';\n if (stateOverride) return;\n buffer = '';\n state = PATH_START;\n } continue;\n } else buffer += chr;\n break;\n\n case PATH_START:\n if (url.isSpecial()) {\n state = PATH;\n if (chr != '/' && chr != '\\\\') continue;\n } else if (!stateOverride && chr == '?') {\n url.query = '';\n state = QUERY;\n } else if (!stateOverride && chr == '#') {\n url.fragment = '';\n state = FRAGMENT;\n } else if (chr != EOF) {\n state = PATH;\n if (chr != '/') continue;\n } break;\n\n case PATH:\n if (\n chr == EOF || chr == '/' ||\n (chr == '\\\\' && url.isSpecial()) ||\n (!stateOverride && (chr == '?' || chr == '#'))\n ) {\n if (isDoubleDot(buffer)) {\n url.shortenPath();\n if (chr != '/' && !(chr == '\\\\' && url.isSpecial())) {\n push(url.path, '');\n }\n } else if (isSingleDot(buffer)) {\n if (chr != '/' && !(chr == '\\\\' && url.isSpecial())) {\n push(url.path, '');\n }\n } else {\n if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {\n if (url.host) url.host = '';\n buffer = charAt(buffer, 0) + ':'; // normalize windows drive letter\n }\n push(url.path, buffer);\n }\n buffer = '';\n if (url.scheme == 'file' && (chr == EOF || chr == '?' || chr == '#')) {\n while (url.path.length > 1 && url.path[0] === '') {\n shift(url.path);\n }\n }\n if (chr == '?') {\n url.query = '';\n state = QUERY;\n } else if (chr == '#') {\n url.fragment = '';\n state = FRAGMENT;\n }\n } else {\n buffer += percentEncode(chr, pathPercentEncodeSet);\n } break;\n\n case CANNOT_BE_A_BASE_URL_PATH:\n if (chr == '?') {\n url.query = '';\n state = QUERY;\n } else if (chr == '#') {\n url.fragment = '';\n state = FRAGMENT;\n } else if (chr != EOF) {\n url.path[0] += percentEncode(chr, C0ControlPercentEncodeSet);\n } break;\n\n case QUERY:\n if (!stateOverride && chr == '#') {\n url.fragment = '';\n state = FRAGMENT;\n } else if (chr != EOF) {\n if (chr == \"'\" && url.isSpecial()) url.query += '%27';\n else if (chr == '#') url.query += '%23';\n else url.query += percentEncode(chr, C0ControlPercentEncodeSet);\n } break;\n\n case FRAGMENT:\n if (chr != EOF) url.fragment += percentEncode(chr, fragmentPercentEncodeSet);\n break;\n }\n\n pointer++;\n }\n },\n // https://url.spec.whatwg.org/#host-parsing\n parseHost: function (input) {\n var result, codePoints, index;\n if (charAt(input, 0) == '[') {\n if (charAt(input, input.length - 1) != ']') return INVALID_HOST;\n result = parseIPv6(stringSlice(input, 1, -1));\n if (!result) return INVALID_HOST;\n this.host = result;\n // opaque host\n } else if (!this.isSpecial()) {\n if (exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT, input)) return INVALID_HOST;\n result = '';\n codePoints = arrayFrom(input);\n for (index = 0; index < codePoints.length; index++) {\n result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);\n }\n this.host = result;\n } else {\n input = toASCII(input);\n if (exec(FORBIDDEN_HOST_CODE_POINT, input)) return INVALID_HOST;\n result = parseIPv4(input);\n if (result === null) return INVALID_HOST;\n this.host = result;\n }\n },\n // https://url.spec.whatwg.org/#cannot-have-a-username-password-port\n cannotHaveUsernamePasswordPort: function () {\n return !this.host || this.cannotBeABaseURL || this.scheme == 'file';\n },\n // https://url.spec.whatwg.org/#include-credentials\n includesCredentials: function () {\n return this.username != '' || this.password != '';\n },\n // https://url.spec.whatwg.org/#is-special\n isSpecial: function () {\n return hasOwn(specialSchemes, this.scheme);\n },\n // https://url.spec.whatwg.org/#shorten-a-urls-path\n shortenPath: function () {\n var path = this.path;\n var pathSize = path.length;\n if (pathSize && (this.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) {\n path.length--;\n }\n },\n // https://url.spec.whatwg.org/#concept-url-serializer\n serialize: function () {\n var url = this;\n var scheme = url.scheme;\n var username = url.username;\n var password = url.password;\n var host = url.host;\n var port = url.port;\n var path = url.path;\n var query = url.query;\n var fragment = url.fragment;\n var output = scheme + ':';\n if (host !== null) {\n output += '//';\n if (url.includesCredentials()) {\n output += username + (password ? ':' + password : '') + '@';\n }\n output += serializeHost(host);\n if (port !== null) output += ':' + port;\n } else if (scheme == 'file') output += '//';\n output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : '';\n if (query !== null) output += '?' + query;\n if (fragment !== null) output += '#' + fragment;\n return output;\n },\n // https://url.spec.whatwg.org/#dom-url-href\n setHref: function (href) {\n var failure = this.parse(href);\n if (failure) throw TypeError(failure);\n this.searchParams.update();\n },\n // https://url.spec.whatwg.org/#dom-url-origin\n getOrigin: function () {\n var scheme = this.scheme;\n var port = this.port;\n if (scheme == 'blob') try {\n return new URLConstructor(scheme.path[0]).origin;\n } catch (error) {\n return 'null';\n }\n if (scheme == 'file' || !this.isSpecial()) return 'null';\n return scheme + '://' + serializeHost(this.host) + (port !== null ? ':' + port : '');\n },\n // https://url.spec.whatwg.org/#dom-url-protocol\n getProtocol: function () {\n return this.scheme + ':';\n },\n setProtocol: function (protocol) {\n this.parse($toString(protocol) + ':', SCHEME_START);\n },\n // https://url.spec.whatwg.org/#dom-url-username\n getUsername: function () {\n return this.username;\n },\n setUsername: function (username) {\n var codePoints = arrayFrom($toString(username));\n if (this.cannotHaveUsernamePasswordPort()) return;\n this.username = '';\n for (var i = 0; i < codePoints.length; i++) {\n this.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);\n }\n },\n // https://url.spec.whatwg.org/#dom-url-password\n getPassword: function () {\n return this.password;\n },\n setPassword: function (password) {\n var codePoints = arrayFrom($toString(password));\n if (this.cannotHaveUsernamePasswordPort()) return;\n this.password = '';\n for (var i = 0; i < codePoints.length; i++) {\n this.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);\n }\n },\n // https://url.spec.whatwg.org/#dom-url-host\n getHost: function () {\n var host = this.host;\n var port = this.port;\n return host === null ? ''\n : port === null ? serializeHost(host)\n : serializeHost(host) + ':' + port;\n },\n setHost: function (host) {\n if (this.cannotBeABaseURL) return;\n this.parse(host, HOST);\n },\n // https://url.spec.whatwg.org/#dom-url-hostname\n getHostname: function () {\n var host = this.host;\n return host === null ? '' : serializeHost(host);\n },\n setHostname: function (hostname) {\n if (this.cannotBeABaseURL) return;\n this.parse(hostname, HOSTNAME);\n },\n // https://url.spec.whatwg.org/#dom-url-port\n getPort: function () {\n var port = this.port;\n return port === null ? '' : $toString(port);\n },\n setPort: function (port) {\n if (this.cannotHaveUsernamePasswordPort()) return;\n port = $toString(port);\n if (port == '') this.port = null;\n else this.parse(port, PORT);\n },\n // https://url.spec.whatwg.org/#dom-url-pathname\n getPathname: function () {\n var path = this.path;\n return this.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : '';\n },\n setPathname: function (pathname) {\n if (this.cannotBeABaseURL) return;\n this.path = [];\n this.parse(pathname, PATH_START);\n },\n // https://url.spec.whatwg.org/#dom-url-search\n getSearch: function () {\n var query = this.query;\n return query ? '?' + query : '';\n },\n setSearch: function (search) {\n search = $toString(search);\n if (search == '') {\n this.query = null;\n } else {\n if ('?' == charAt(search, 0)) search = stringSlice(search, 1);\n this.query = '';\n this.parse(search, QUERY);\n }\n this.searchParams.update();\n },\n // https://url.spec.whatwg.org/#dom-url-searchparams\n getSearchParams: function () {\n return this.searchParams.facade;\n },\n // https://url.spec.whatwg.org/#dom-url-hash\n getHash: function () {\n var fragment = this.fragment;\n return fragment ? '#' + fragment : '';\n },\n setHash: function (hash) {\n hash = $toString(hash);\n if (hash == '') {\n this.fragment = null;\n return;\n }\n if ('#' == charAt(hash, 0)) hash = stringSlice(hash, 1);\n this.fragment = '';\n this.parse(hash, FRAGMENT);\n },\n update: function () {\n this.query = this.searchParams.serialize() || null;\n }\n};\n\n// `URL` constructor\n// https://url.spec.whatwg.org/#url-class\nvar URLConstructor = function URL(url /* , base */) {\n var that = anInstance(this, URLPrototype);\n var base = validateArgumentsLength(arguments.length, 1) > 1 ? arguments[1] : undefined;\n var state = setInternalState(that, new URLState(url, false, base));\n if (!DESCRIPTORS) {\n that.href = state.serialize();\n that.origin = state.getOrigin();\n that.protocol = state.getProtocol();\n that.username = state.getUsername();\n that.password = state.getPassword();\n that.host = state.getHost();\n that.hostname = state.getHostname();\n that.port = state.getPort();\n that.pathname = state.getPathname();\n that.search = state.getSearch();\n that.searchParams = state.getSearchParams();\n that.hash = state.getHash();\n }\n};\n\nvar URLPrototype = URLConstructor.prototype;\n\nvar accessorDescriptor = function (getter, setter) {\n return {\n get: function () {\n return getInternalURLState(this)[getter]();\n },\n set: setter && function (value) {\n return getInternalURLState(this)[setter](value);\n },\n configurable: true,\n enumerable: true\n };\n};\n\nif (DESCRIPTORS) {\n // `URL.prototype.href` accessors pair\n // https://url.spec.whatwg.org/#dom-url-href\n defineBuiltInAccessor(URLPrototype, 'href', accessorDescriptor('serialize', 'setHref'));\n // `URL.prototype.origin` getter\n // https://url.spec.whatwg.org/#dom-url-origin\n defineBuiltInAccessor(URLPrototype, 'origin', accessorDescriptor('getOrigin'));\n // `URL.prototype.protocol` accessors pair\n // https://url.spec.whatwg.org/#dom-url-protocol\n defineBuiltInAccessor(URLPrototype, 'protocol', accessorDescriptor('getProtocol', 'setProtocol'));\n // `URL.prototype.username` accessors pair\n // https://url.spec.whatwg.org/#dom-url-username\n defineBuiltInAccessor(URLPrototype, 'username', accessorDescriptor('getUsername', 'setUsername'));\n // `URL.prototype.password` accessors pair\n // https://url.spec.whatwg.org/#dom-url-password\n defineBuiltInAccessor(URLPrototype, 'password', accessorDescriptor('getPassword', 'setPassword'));\n // `URL.prototype.host` accessors pair\n // https://url.spec.whatwg.org/#dom-url-host\n defineBuiltInAccessor(URLPrototype, 'host', accessorDescriptor('getHost', 'setHost'));\n // `URL.prototype.hostname` accessors pair\n // https://url.spec.whatwg.org/#dom-url-hostname\n defineBuiltInAccessor(URLPrototype, 'hostname', accessorDescriptor('getHostname', 'setHostname'));\n // `URL.prototype.port` accessors pair\n // https://url.spec.whatwg.org/#dom-url-port\n defineBuiltInAccessor(URLPrototype, 'port', accessorDescriptor('getPort', 'setPort'));\n // `URL.prototype.pathname` accessors pair\n // https://url.spec.whatwg.org/#dom-url-pathname\n defineBuiltInAccessor(URLPrototype, 'pathname', accessorDescriptor('getPathname', 'setPathname'));\n // `URL.prototype.search` accessors pair\n // https://url.spec.whatwg.org/#dom-url-search\n defineBuiltInAccessor(URLPrototype, 'search', accessorDescriptor('getSearch', 'setSearch'));\n // `URL.prototype.searchParams` getter\n // https://url.spec.whatwg.org/#dom-url-searchparams\n defineBuiltInAccessor(URLPrototype, 'searchParams', accessorDescriptor('getSearchParams'));\n // `URL.prototype.hash` accessors pair\n // https://url.spec.whatwg.org/#dom-url-hash\n defineBuiltInAccessor(URLPrototype, 'hash', accessorDescriptor('getHash', 'setHash'));\n}\n\n// `URL.prototype.toJSON` method\n// https://url.spec.whatwg.org/#dom-url-tojson\ndefineBuiltIn(URLPrototype, 'toJSON', function toJSON() {\n return getInternalURLState(this).serialize();\n}, { enumerable: true });\n\n// `URL.prototype.toString` method\n// https://url.spec.whatwg.org/#URL-stringification-behavior\ndefineBuiltIn(URLPrototype, 'toString', function toString() {\n return getInternalURLState(this).serialize();\n}, { enumerable: true });\n\nif (NativeURL) {\n var nativeCreateObjectURL = NativeURL.createObjectURL;\n var nativeRevokeObjectURL = NativeURL.revokeObjectURL;\n // `URL.createObjectURL` method\n // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL\n if (nativeCreateObjectURL) defineBuiltIn(URLConstructor, 'createObjectURL', bind(nativeCreateObjectURL, NativeURL));\n // `URL.revokeObjectURL` method\n // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL\n if (nativeRevokeObjectURL) defineBuiltIn(URLConstructor, 'revokeObjectURL', bind(nativeRevokeObjectURL, NativeURL));\n}\n\nsetToStringTag(URLConstructor, 'URL');\n\n$({ global: true, constructor: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {\n URL: URLConstructor\n});\n","// TODO: Remove this module from `core-js@4` since it's replaced to module below\nrequire('../modules/web.url.constructor');\n"],"names":["super_","UrlPlugin","options","arguments","length","undefined","_classCallCheck","this","bookReaderOptions","urlSchema","name","position","default","deprecated_for","urlState","urlMode","urlHistoryBasePath","urlLocationPollId","oldLocationHash","oldUserHash","key","value","_this","searchParams","URLSearchParams","pathParams","Object","keys","forEach","_schema","_schema2","_schema3","_schema4","schema","find","schemaKey","append","strPathParams","filter","s","map","concat","join","strStrippedTrailingSlash","replace","concatenatedPath","toString","urlString","urlPath","URL","urlSearchParamsObj","fromEntries","entries","splitUrlMatches","pathname","match","urlStrSplitSlashObj","x","split","doesKeyExists","_object","_key","some","hasPropertyKey","_ref","_ref2","pushToAddressBar","urlStrPath","urlStateToUrlString","window","history","replaceState","newUrlPath","trim","e","location","_this2","hash","substr","clearInterval","setInterval","newFragment","urlStringToUrlState","path","search","extend","BookReader","defaultOptions","enableUrlPlugin","bookId","defaults","updateWindowTitle","urlTrackedParams","urlTrackIndex0","prototype","setup","call","locationPollId","init","bind","eventNames","PostInit","_this$options","document","title","shortTitle","bookTitle","urlStartLocationPolling","fragmentChange","urlUpdateFragment","maximumCharacters","urlReadFragment","params","paramsFromFragment","updateParams","updateFromParams","trigger","stop","animating","autoStop","animationFinishedCallback","allParams","paramsFromCurrent","_this$options2","index","page","reduce","validParams","paramName","fragmentFromParams","currFragment","currQueryString","getLocationSearch","newQueryString","queryStringFromParams","baseWithoutSlash","newFragmentWithSlash","newQueryStringSearch","urlParamsFiltersOnlySearch","readQueryString","url","has","q","get","_this$options3","urlReadHashFragment","BookreaderUrlPlugin","_BookReader","_inherits","_super","apply","_this3","urlPlugin","listenForHashChanges","_get","_getPrototypeOf","uncurryThis","maxInt","regexNonASCII","regexSeparators","OVERFLOW_ERROR","$RangeError","RangeError","exec","floor","Math","fromCharCode","String","charCodeAt","push","toLowerCase","digitToBasic","digit","adapt","delta","numPoints","firstTime","k","baseMinusTMin","base","encode","input","output","string","counter","extra","ucs2decode","i","currentValue","inputLength","n","bias","basicLength","handledCPCount","m","handledCPCountPlusOne","t","qMinusT","baseMinusT","module","exports","label","encoded","labels","PROPER_FUNCTION_NAME","fails","whitespaces","METHOD_NAME","$","$entries","target","stat","O","iterate","createProperty","iterable","obj","v","AS_ENTRIES","$trim","proto","forced","forcedStringTrimMethod","EOF","DESCRIPTORS","USE_NATIVE_URL","global","defineBuiltIn","defineBuiltInAccessor","anInstance","hasOwn","assign","arrayFrom","arraySlice","codeAt","toASCII","$toString","setToStringTag","validateArgumentsLength","URLSearchParamsModule","InternalStateModule","setInternalState","set","getInternalURLState","getterFor","getInternalSearchParamsState","getState","NativeURL","TypeError","parseInt","pow","charAt","numberToString","pop","shift","stringSlice","slice","unshift","INVALID_SCHEME","INVALID_HOST","INVALID_PORT","ALPHA","ALPHANUMERIC","DIGIT","HEX_START","OCT","DEC","HEX","FORBIDDEN_HOST_CODE_POINT","FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT","LEADING_C0_CONTROL_OR_SPACE","TRAILING_C0_CONTROL_OR_SPACE","TAB_AND_NEW_LINE","serializeHost","host","result","compress","ignore0","ipv6","maxIndex","maxLength","currStart","currLength","findLongestZeroSequence","C0ControlPercentEncodeSet","fragmentPercentEncodeSet","pathPercentEncodeSet","userinfoPercentEncodeSet","percentEncode","chr","code","encodeURIComponent","specialSchemes","ftp","file","http","https","ws","wss","isWindowsDriveLetter","normalized","second","startsWithWindowsDriveLetter","third","isSingleDot","segment","SCHEME_START","SCHEME","NO_SCHEME","SPECIAL_RELATIVE_OR_AUTHORITY","PATH_OR_AUTHORITY","RELATIVE","RELATIVE_SLASH","SPECIAL_AUTHORITY_SLASHES","SPECIAL_AUTHORITY_IGNORE_SLASHES","AUTHORITY","HOST","HOSTNAME","PORT","FILE","FILE_SLASH","FILE_HOST","PATH_START","PATH","CANNOT_BE_A_BASE_URL_PATH","QUERY","FRAGMENT","URLState","isBase","baseState","failure","parse","bindURL","type","stateOverride","codePoints","bufferCodePoints","state","pointer","buffer","seenAt","seenBracket","seenPasswordToken","scheme","username","password","port","query","fragment","cannotBeABaseURL","isSpecial","includesCredentials","codePoint","encodedCodePoints","parseHost","shortenPath","numbersSeen","ipv4Piece","number","swaps","swap","address","pieceIndex","parseIPv6","partsLength","numbers","part","radix","ipv4","parts","parseIPv4","cannotHaveUsernamePasswordPort","pathSize","serialize","setHref","href","update","getOrigin","URLConstructor","origin","error","getProtocol","setProtocol","protocol","getUsername","setUsername","getPassword","setPassword","getHost","setHost","getHostname","setHostname","hostname","getPort","setPort","getPathname","setPathname","getSearch","setSearch","getSearchParams","facade","getHash","setHash","that","URLPrototype","accessorDescriptor","getter","setter","configurable","enumerable","nativeCreateObjectURL","createObjectURL","nativeRevokeObjectURL","revokeObjectURL","constructor","sham"],"sourceRoot":""}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[46],{8688:function(e,t,n){"use strict";n(3210),n(9600);var o,r=n(
|
1
|
+
(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[46],{8688:function(e,t,n){"use strict";n(3210),n(9600);var o,r=n(5311),i=n(5311);if(!m()){var u=".bookreader_vendor-fullscreen";r.extend(BookReader.defaultOptions,{enableVendorFullscreenPlugin:!0}),BookReader.prototype.setup=(o=BookReader.prototype.setup,function(e){o.call(this,e),this.isVendorFullscreenActive=!1}),BookReader.prototype.getInitialMode=function(e){return function(t){var n=e.call(this,t);return this.isVendorFullscreenActive&&(n=this.constMode1up),n}}(BookReader.prototype.getInitialMode),BookReader.prototype.init=function(e){return function(){e.call(this),d()&&p(this,(function(e){e.data.resize(),e.data.updateBrClasses();var t=i("#cboxOverlay"),n=i("#colorbox");s()?i(l()).append(t).append(n):i(document.body).append(t).append(n)}))}}(BookReader.prototype.init),BookReader.prototype.enterFullWindow=function(){var e=this;this.refs.$brContainer.css("opacity",0),i(window).width()<=this.onePageMinBreakpoint&&this.switchMode(this.constMode1up),this.isVendorFullscreenActive=!0,this.updateBrClasses(),this.resize(),this.jumpToIndex(this.currentIndex()),this.refs.$brContainer.animate({opacity:1},400,"linear"),i(document).on("keyup.".concat(u),(function(t){27===t.keyCode&&e.exitFullScreen()}))},BookReader.prototype.exitFullWindow=function(){this.refs.$brContainer.css("opacity",0),i(document).off("keyup"+u),this.isFullscreenActive=!1,this.updateBrClasses(),this.resize(),this.refs.$brContainer.animate({opacity:1},400,"linear")},BookReader.prototype.isFullscreen=function(){return s()||this.isVendorFullscreenActive},BookReader.prototype.toggleFullscreen=function(){this.isFullscreen()?d()?c():this.exitFullWindow():d()?a(this.refs.$br[0]):this.enterFullWindow()},BookReader.util.isMobile=m,BookReader.util.getFullscreenElement=l,BookReader.util.bindFullscreenChangeListener=p,BookReader.util.fullscreenAllowed=d,BookReader.util.requestFullscreen=a,BookReader.util.exitFullscreen=c,BookReader.util.isFullscreenActive=s}function l(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement}function s(){return null!=l()}function c(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()}function a(e){e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen()}function d(){return document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullScreenEnabled}function p(e,t){var n="fullscreenchange ",o=(n+["webkit","moz","ms"].join(n)+n).trim();i(document).on(o,e,t)}function m(){return void 0!==window.orientation||-1!==navigator.userAgent.indexOf("IEMobile")}},6091:function(e,t,n){var o=n(6530).PROPER,r=n(7293),i=n(1361);e.exports=function(e){return r((function(){return!!i[e]()||"
"!=="
"[e]()||o&&i[e].name!==e}))}},3210:function(e,t,n){"use strict";var o=n(2109),r=n(3111).trim;o({target:"String",proto:!0,forced:n(6091)("trim")},{trim:function(){return r(this)}})}},function(e){e(e.s=8688)}]);
|
2
2
|
//# sourceMappingURL=plugin.vendor-fullscreen.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"plugins/plugin.vendor-fullscreen.js","mappings":"kKAcyCA,E,oBATzC,IAAKC,IAAY,CACf,IAAMC,EAAkB,gCAExBC,EAAOC,OAAOC,WAAWC,eAAgB,CAEvCC,8BAA8B,IAIhCF,WAAWG,UAAUC,OAAkBT,EAMpCK,WAAWG,UAAUC,MALf,SAASC,GACdV,EAAOW,KAAKC,KAAMF,GAElBE,KAAKC,0BAA2B,IAKpCR,WAAWG,UAAUM,eAAkB,SAASd,GAC9C,OAAO,SAASe,GACd,IAAIC,EAAWhB,EAAOW,KAAKC,KAAMG,GAIjC,OAHIH,KAAKC,2BACPG,EAAWJ,KAAKK,cAEXD,GAN4B,CAQpCX,WAAWG,UAAUM,gBAGxBT,WAAWG,UAAUU,KAAQ,SAASlB,GACpC,OAAO,WACLA,EAAOW,KAAKC,MAEPO,KAILC,EAA6BR,MAAM,SAACS,GAClCA,EAAEC,KAAKC,SACPF,EAAEC,KAAKE,kBACP,IAAMC,EAAcC,EAAE,gBAChBC,EAAOD,EAAE,aACXE,IAGkBF,EAAEG,KACVC,OAAOL,GAAaK,OAAOH,GAIvCD,EAAEK,SAASC,MAAMF,OAAOL,GAAaK,OAAOH,OArBvB,CAyB1BtB,WAAWG,UAAUU,MAKxBb,WAAWG,UAAUyB,gBAAkB,WAAW,WAChDrB,KAAKsB,KAAKC,aAAaC,IAAI,UAAW,GAElBV,EAAEW,QAAQC,SACX1B,KAAK2B,sBACtB3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BASN,SAAST,EAAkBU,GAC5BA,EAAQV,kBACVU,EAAQV,oBACCU,EAAQC,wBACjBD,EAAQC,0BACCD,EAAQE,qBACjBF,EAAQE,uBACCF,EAAQG,qBACjBH,EAAQG,sBAUL,SAAS/C,IACd,OAAQY,SAASoC,mBACfpC,SAASqC,yBACTrC,SAASsC,sBACTtC,SAASuC,oBAQN,SAASlD,EACdE,EAAMiD,GAEN,IAAMC,EAAQ,oBAMRC,GAAcD,EALI,CACtB,SACA,MACA,MAE0CE,KAAKF,GAASA,GAAOG,OACjEjD,EAAEK,UAAUc,GAAG4B,EAAYnD,EAAMiD,GAQ5B,SAAStE,IACd,YAAsC,IAAvBoC,OAAOuC,cAA8E,IAA7CC,UAAUC,UAAUC,QAAQ,c,qBCrPrF,IAAIC,EAAuB,eACvBC,EAAQ,EAAQ,MAChBC,EAAc,EAAQ,MAM1BC,EAAOC,QAAU,SAAUC,GACzB,OAAOJ,GAAM,WACX,QAASC,EAAYG,MANf,cAOGA,MACHL,GAAwBE,EAAYG,GAAaC,OAASD,O,kCCXpE,IAAI3D,EAAI,EAAQ,MACZ6D,EAAQ,aAKZ7D,EAAE,CAAE8D,OAAQ,SAAUC,OAAO,EAAMC,OAJN,EAAQ,KAIMC,CAAuB,SAAW,CAC3EhB,KAAM,WACJ,OAAOY,EAAM3E,W","sources":["webpack://@internetarchive/bookreader/./src/plugins/plugin.vendor-fullscreen.js","webpack://@internetarchive/bookreader/./node_modules/core-js/internals/string-trim-forced.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.string.trim.js"],"sourcesContent":["/* global BookReader */\n\n/**\n * Toggles browser's native fullscreen mode if available device is not mobile\n */\nif (!isMobile()) {\n const EVENT_NAMESPACE = '.bookreader_vendor-fullscreen';\n\n jQuery.extend(BookReader.defaultOptions, {\n /** @type {boolean} */\n enableVendorFullscreenPlugin: true\n });\n\n /** @override */\n BookReader.prototype.setup = (function(super_) {\n return function(options) {\n super_.call(this, options);\n\n this.isVendorFullscreenActive = false;\n };\n })(BookReader.prototype.setup);\n\n /** @override */\n BookReader.prototype.getInitialMode = (function(super_) {\n return function(params) {\n let nextMode = super_.call(this, params);\n if (this.isVendorFullscreenActive) {\n nextMode = this.constMode1up;\n }\n return nextMode;\n };\n })(BookReader.prototype.getInitialMode);\n\n /** @override */\n BookReader.prototype.init = (function(super_) {\n return function() {\n super_.call(this);\n\n if (!fullscreenAllowed()) {\n return;\n }\n // In fullscreen mode the colorbox and overlay need to be inside the fullscreen element to display properly.\n bindFullscreenChangeListener(this, (e) => {\n e.data.resize();\n e.data.updateBrClasses();\n const cboxOverlay = $('#cboxOverlay');\n const cbox = $('#colorbox');\n if (isFullscreenActive()) {\n // In full screen mode, the colorbox and overlay need\n // to be children of the fullscreen element to display properly.\n const $fullscreen = $(getFullscreenElement());\n $fullscreen.append(cboxOverlay).append(cbox);\n } else {\n // In non-fullscreen mode, the colorbox and overlay need\n // to be children of the main document body.\n $(document.body).append(cboxOverlay).append(cbox);\n }\n });\n };\n })(BookReader.prototype.init);\n\n /**\n * Start fullscreen mode\n */\n BookReader.prototype.enterFullWindow = function() {\n this.refs.$brContainer.css('opacity', 0);\n\n const windowWidth = $(window).width();\n if (windowWidth <= this.onePageMinBreakpoint) {\n this.switchMode(this.constMode1up);\n }\n\n this.isVendorFullscreenActive = true;\n this.updateBrClasses();\n\n this.resize();\n this.jumpToIndex(this.currentIndex());\n\n this.refs.$brContainer.animate({ opacity: 1 }, 400, 'linear');\n\n $(document).on(`keyup.${EVENT_NAMESPACE}`, e => {\n if (e.keyCode === 27) this.exitFullScreen();\n });\n };\n\n /**\n * Exit from fullscreen mode\n */\n BookReader.prototype.exitFullWindow = function() {\n this.refs.$brContainer.css('opacity', 0);\n\n $(document).off('keyup' + EVENT_NAMESPACE);\n\n this.isFullscreenActive = false;\n this.updateBrClasses();\n\n this.resize();\n this.refs.$brContainer.animate({ opacity: 1 }, 400, 'linear');\n };\n\n /**\n * Returns true if fullscreen mode is enabled\n *\n * @returns {boolean}\n */\n BookReader.prototype.isFullscreen = function() {\n return isFullscreenActive() || this.isVendorFullscreenActive;\n };\n\n /**\n * Toggle screen\n */\n BookReader.prototype.toggleFullscreen = function() {\n if (this.isFullscreen()) {\n if (fullscreenAllowed()) {\n exitFullscreen();\n } else {\n this.exitFullWindow();\n }\n } else {\n if (fullscreenAllowed()) {\n requestFullscreen(this.refs.$br[0]);\n } else {\n this.enterFullWindow();\n }\n }\n };\n\n /** @deprecated */\n BookReader.util.isMobile = isMobile;\n\n /** @deprecated */\n BookReader.util.getFullscreenElement = getFullscreenElement;\n\n /** @deprecated */\n BookReader.util.bindFullscreenChangeListener = bindFullscreenChangeListener;\n\n /** @deprecated */\n BookReader.util.fullscreenAllowed = fullscreenAllowed;\n\n /** @deprecated */\n BookReader.util.requestFullscreen = requestFullscreen;\n\n /** @deprecated */\n BookReader.util.exitFullscreen = exitFullscreen;\n\n /** @deprecated */\n BookReader.util.isFullscreenActive = isFullscreenActive;\n}\n\n\n/**\n * Returns the DOM element being used for fullscreen.\n *\n * @returns {HTMLElement}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DocumentOrShadowRoot/fullscreenElement\n */\nexport function getFullscreenElement() {\n return document.fullscreenElement ||\n document.webkitFullscreenElement ||\n document.mozFullScreenElement ||\n document.msFullscreenElement;\n}\n\n/**\n * Returns true if the document is in fullscreen mode.\n *\n * @returns {boolean}\n */\nexport function isFullscreenActive() {\n const fullscreenElement = getFullscreenElement();\n return fullscreenElement !== null && fullscreenElement !== undefined;\n}\n\n/**\n * Exits fullscreen mode.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/exitFullscreen\n */\nexport function exitFullscreen() {\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.msExitFullscreen) {\n document.msExitFullscreen();\n }\n}\n\n/**\n * Requests fullscreen mode for the given element\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullscreen\n */\nexport function requestFullscreen(element) {\n if (element.requestFullscreen) {\n element.requestFullscreen();\n } else if (element.webkitRequestFullscreen) {\n element.webkitRequestFullscreen();\n } else if (element.mozRequestFullScreen) {\n element.mozRequestFullScreen();\n } else if (element.msRequestFullscreen) {\n element.msRequestFullscreen();\n }\n}\n\n/**\n * Returns true if fullscreen mode is allowed on this device and document.\n *\n * @returns {boolean}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenEnabled\n */\nexport function fullscreenAllowed() {\n return (document.fullscreenEnabled ||\n document.webkitFullscreenEnabled ||\n document.mozFullScreenEnabled ||\n document.msFullScreenEnabled);\n}\n\n/**\n * jQuery-style binding to a fullscreenchange event.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenchange_event\n */\nexport function bindFullscreenChangeListener(\n data, fullscreenchangeListener\n) {\n const event = 'fullscreenchange ';\n const vendor_prefixes = [\n 'webkit',\n 'moz',\n 'ms'\n ];\n const all_events = (event + vendor_prefixes.join(event) + event).trim();\n $(document).on(all_events, data, fullscreenchangeListener);\n}\n\n/**\n * Returns true if current device is mobile\n *\n * @returns {boolean}\n */\nexport function isMobile() {\n return (typeof window.orientation !== 'undefined') || (navigator.userAgent.indexOf('IEMobile') !== -1);\n}\n","var PROPER_FUNCTION_NAME = require('../internals/function-name').PROPER;\nvar fails = require('../internals/fails');\nvar whitespaces = require('../internals/whitespaces');\n\nvar non = '\\u200B\\u0085\\u180E';\n\n// check that a method works with the correct list\n// of whitespaces and has a correct name\nmodule.exports = function (METHOD_NAME) {\n return fails(function () {\n return !!whitespaces[METHOD_NAME]()\n || non[METHOD_NAME]() !== non\n || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);\n });\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar $trim = require('../internals/string-trim').trim;\nvar forcedStringTrimMethod = require('../internals/string-trim-forced');\n\n// `String.prototype.trim` method\n// https://tc39.es/ecma262/#sec-string.prototype.trim\n$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {\n trim: function trim() {\n return $trim(this);\n }\n});\n"],"names":["super_","isMobile","EVENT_NAMESPACE","jQuery","extend","BookReader","defaultOptions","enableVendorFullscreenPlugin","prototype","setup","options","call","this","isVendorFullscreenActive","getInitialMode","params","nextMode","constMode1up","init","fullscreenAllowed","bindFullscreenChangeListener","e","data","resize","updateBrClasses","cboxOverlay","$","cbox","isFullscreenActive","getFullscreenElement","append","document","body","enterFullWindow","refs","$brContainer","css","window","width","onePageMinBreakpoint","switchMode","jumpToIndex","currentIndex","animate","opacity","on","keyCode","exitFullScreen","exitFullWindow","off","isFullscreen","toggleFullscreen","exitFullscreen","requestFullscreen","$br","util","fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen","element","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen","fullscreenEnabled","webkitFullscreenEnabled","mozFullScreenEnabled","msFullScreenEnabled","fullscreenchangeListener","event","all_events","join","trim","orientation","navigator","userAgent","indexOf","PROPER_FUNCTION_NAME","fails","whitespaces","module","exports","METHOD_NAME","name","$trim","target","proto","forced","forcedStringTrimMethod"],"sourceRoot":""}
|
1
|
+
{"version":3,"file":"plugins/plugin.vendor-fullscreen.js","mappings":"kKAcyCA,E,oBATzC,IAAKC,IAAY,CACf,IAAMC,EAAkB,gCAExBC,EAAOC,OAAOC,WAAWC,eAAgB,CAEvCC,8BAA8B,IAIhCF,WAAWG,UAAUC,OAAkBT,EAMpCK,WAAWG,UAAUC,MALf,SAASC,GACdV,EAAOW,KAAKC,KAAMF,GAElBE,KAAKC,0BAA2B,CAClC,GAIFR,WAAWG,UAAUM,eAAkB,SAASd,GAC9C,OAAO,SAASe,GACd,IAAIC,EAAWhB,EAAOW,KAAKC,KAAMG,GAIjC,OAHIH,KAAKC,2BACPG,EAAWJ,KAAKK,cA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GAAaC,OAASD,CAClE,GACF,C,oCCbA,IAAI7D,EAAI,EAAQ,MACZ+D,EAAQ,aAKZ/D,EAAE,CAAEgE,OAAQ,SAAUC,OAAO,EAAMC,OAJN,EAAQ,KAIMC,CAAuB,SAAW,CAC3EhB,KAAM,WACJ,OAAOY,EAAM7E,KACf,G","sources":["webpack://@internetarchive/bookreader/./src/plugins/plugin.vendor-fullscreen.js","webpack://@internetarchive/bookreader/./node_modules/core-js/internals/string-trim-forced.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.string.trim.js"],"sourcesContent":["/* global BookReader */\n\n/**\n * Toggles browser's native fullscreen mode if available device is not mobile\n */\nif (!isMobile()) {\n const EVENT_NAMESPACE = '.bookreader_vendor-fullscreen';\n\n jQuery.extend(BookReader.defaultOptions, {\n /** @type {boolean} */\n enableVendorFullscreenPlugin: true\n });\n\n /** @override */\n BookReader.prototype.setup = (function(super_) {\n return function(options) {\n super_.call(this, options);\n\n this.isVendorFullscreenActive = false;\n };\n })(BookReader.prototype.setup);\n\n /** @override */\n BookReader.prototype.getInitialMode = (function(super_) {\n return function(params) {\n let nextMode = super_.call(this, params);\n if (this.isVendorFullscreenActive) {\n nextMode = this.constMode1up;\n }\n return nextMode;\n };\n })(BookReader.prototype.getInitialMode);\n\n /** @override */\n BookReader.prototype.init = (function(super_) {\n return function() {\n super_.call(this);\n\n if (!fullscreenAllowed()) {\n return;\n }\n // In fullscreen mode the colorbox and overlay need to be inside the fullscreen element to display properly.\n bindFullscreenChangeListener(this, (e) => {\n e.data.resize();\n e.data.updateBrClasses();\n const cboxOverlay = $('#cboxOverlay');\n const cbox = $('#colorbox');\n if (isFullscreenActive()) {\n // In full screen mode, the colorbox and overlay need\n // to be children of the fullscreen element to display properly.\n const $fullscreen = $(getFullscreenElement());\n $fullscreen.append(cboxOverlay).append(cbox);\n } else {\n // In non-fullscreen mode, the colorbox and overlay need\n // to be children of the main document body.\n $(document.body).append(cboxOverlay).append(cbox);\n }\n });\n };\n })(BookReader.prototype.init);\n\n /**\n * Start fullscreen mode\n */\n BookReader.prototype.enterFullWindow = function() {\n this.refs.$brContainer.css('opacity', 0);\n\n const windowWidth = $(window).width();\n if (windowWidth <= this.onePageMinBreakpoint) {\n this.switchMode(this.constMode1up);\n }\n\n this.isVendorFullscreenActive = true;\n this.updateBrClasses();\n\n this.resize();\n this.jumpToIndex(this.currentIndex());\n\n this.refs.$brContainer.animate({ opacity: 1 }, 400, 'linear');\n\n $(document).on(`keyup.${EVENT_NAMESPACE}`, e => {\n if (e.keyCode === 27) this.exitFullScreen();\n });\n };\n\n /**\n * Exit from fullscreen mode\n */\n BookReader.prototype.exitFullWindow = function() {\n this.refs.$brContainer.css('opacity', 0);\n\n $(document).off('keyup' + EVENT_NAMESPACE);\n\n this.isFullscreenActive = false;\n this.updateBrClasses();\n\n this.resize();\n this.refs.$brContainer.animate({ opacity: 1 }, 400, 'linear');\n };\n\n /**\n * Returns true if fullscreen mode is enabled\n *\n * @returns {boolean}\n */\n BookReader.prototype.isFullscreen = function() {\n return isFullscreenActive() || this.isVendorFullscreenActive;\n };\n\n /**\n * Toggle screen\n */\n BookReader.prototype.toggleFullscreen = function() {\n if (this.isFullscreen()) {\n if (fullscreenAllowed()) {\n exitFullscreen();\n } else {\n this.exitFullWindow();\n }\n } else {\n if (fullscreenAllowed()) {\n requestFullscreen(this.refs.$br[0]);\n } else {\n this.enterFullWindow();\n }\n }\n };\n\n /** @deprecated */\n BookReader.util.isMobile = isMobile;\n\n /** @deprecated */\n BookReader.util.getFullscreenElement = getFullscreenElement;\n\n /** @deprecated */\n BookReader.util.bindFullscreenChangeListener = bindFullscreenChangeListener;\n\n /** @deprecated */\n BookReader.util.fullscreenAllowed = fullscreenAllowed;\n\n /** @deprecated */\n BookReader.util.requestFullscreen = requestFullscreen;\n\n /** @deprecated */\n BookReader.util.exitFullscreen = exitFullscreen;\n\n /** @deprecated */\n BookReader.util.isFullscreenActive = isFullscreenActive;\n}\n\n\n/**\n * Returns the DOM element being used for fullscreen.\n *\n * @returns {HTMLElement}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DocumentOrShadowRoot/fullscreenElement\n */\nexport function getFullscreenElement() {\n return document.fullscreenElement ||\n document.webkitFullscreenElement ||\n document.mozFullScreenElement ||\n document.msFullscreenElement;\n}\n\n/**\n * Returns true if the document is in fullscreen mode.\n *\n * @returns {boolean}\n */\nexport function isFullscreenActive() {\n const fullscreenElement = getFullscreenElement();\n return fullscreenElement !== null && fullscreenElement !== undefined;\n}\n\n/**\n * Exits fullscreen mode.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/exitFullscreen\n */\nexport function exitFullscreen() {\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.msExitFullscreen) {\n document.msExitFullscreen();\n }\n}\n\n/**\n * Requests fullscreen mode for the given element\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullscreen\n */\nexport function requestFullscreen(element) {\n if (element.requestFullscreen) {\n element.requestFullscreen();\n } else if (element.webkitRequestFullscreen) {\n element.webkitRequestFullscreen();\n } else if (element.mozRequestFullScreen) {\n element.mozRequestFullScreen();\n } else if (element.msRequestFullscreen) {\n element.msRequestFullscreen();\n }\n}\n\n/**\n * Returns true if fullscreen mode is allowed on this device and document.\n *\n * @returns {boolean}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenEnabled\n */\nexport function fullscreenAllowed() {\n return (document.fullscreenEnabled ||\n document.webkitFullscreenEnabled ||\n document.mozFullScreenEnabled ||\n document.msFullScreenEnabled);\n}\n\n/**\n * jQuery-style binding to a fullscreenchange event.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenchange_event\n */\nexport function bindFullscreenChangeListener(\n data, fullscreenchangeListener\n) {\n const event = 'fullscreenchange ';\n const vendor_prefixes = [\n 'webkit',\n 'moz',\n 'ms'\n ];\n const all_events = (event + vendor_prefixes.join(event) + event).trim();\n $(document).on(all_events, data, fullscreenchangeListener);\n}\n\n/**\n * Returns true if current device is mobile\n *\n * @returns {boolean}\n */\nexport function isMobile() {\n return (typeof window.orientation !== 'undefined') || (navigator.userAgent.indexOf('IEMobile') !== -1);\n}\n","var PROPER_FUNCTION_NAME = require('../internals/function-name').PROPER;\nvar fails = require('../internals/fails');\nvar whitespaces = require('../internals/whitespaces');\n\nvar non = '\\u200B\\u0085\\u180E';\n\n// check that a method works with the correct list\n// of whitespaces and has a correct name\nmodule.exports = function (METHOD_NAME) {\n return fails(function () {\n return !!whitespaces[METHOD_NAME]()\n || non[METHOD_NAME]() !== non\n || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);\n });\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar $trim = require('../internals/string-trim').trim;\nvar forcedStringTrimMethod = require('../internals/string-trim-forced');\n\n// `String.prototype.trim` method\n// https://tc39.es/ecma262/#sec-string.prototype.trim\n$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {\n trim: function trim() {\n return $trim(this);\n }\n});\n"],"names":["super_","isMobile","EVENT_NAMESPACE","jQuery","extend","BookReader","defaultOptions","enableVendorFullscreenPlugin","prototype","setup","options","call","this","isVendorFullscreenActive","getInitialMode","params","nextMode","constMode1up","init","fullscreenAllowed","bindFullscreenChangeListener","e","data","resize","updateBrClasses","cboxOverlay","$","cbox","isFullscreenActive","getFullscreenElement","append","document","body","enterFullWindow","_this","refs","$brContainer","css","window","width","onePageMinBreakpoint","switchMode","jumpToIndex","currentIndex","animate","opacity","on","concat","keyCode","exitFullScreen","exitFullWindow","off","isFullscreen","toggleFullscreen","exitFullscreen","requestFullscreen","$br","util","fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen","element","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen","fullscreenEnabled","webkitFullscreenEnabled","mozFullScreenEnabled","msFullScreenEnabled","fullscreenchangeListener","event","all_events","join","trim","orientation","navigator","userAgent","indexOf","PROPER_FUNCTION_NAME","fails","whitespaces","module","exports","METHOD_NAME","name","$trim","target","proto","forced","forcedStringTrimMethod"],"sourceRoot":""}
|