@internetarchive/bookreader 5.0.0-42 → 5.0.0-43

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. package/.github/workflows/node.js.yml +14 -14
  2. package/.github/workflows/npm-publish.yml +4 -4
  3. package/BookReader/BookReader.css +13 -13
  4. package/BookReader/BookReader.js +1 -1
  5. package/BookReader/BookReader.js.map +1 -1
  6. package/BookReader/ia-bookreader-bundle.js +87 -87
  7. package/BookReader/ia-bookreader-bundle.js.map +1 -1
  8. package/BookReader/icons/pause.svg +1 -1
  9. package/BookReader/icons/playback-speed.svg +1 -1
  10. package/BookReader/icons/read-aloud.svg +1 -1
  11. package/BookReader/images/BRicons.svg +2 -2
  12. package/BookReader/images/books_graphic.svg +1 -1
  13. package/BookReader/images/icon_book.svg +1 -1
  14. package/BookReader/images/icon_gear.svg +1 -1
  15. package/BookReader/images/icon_info.svg +1 -1
  16. package/BookReader/images/icon_playback-rate.svg +1 -1
  17. package/BookReader/images/icon_search_button.svg +1 -1
  18. package/BookReader/images/icon_share.svg +1 -1
  19. package/BookReader/images/icon_speaker.svg +1 -1
  20. package/BookReader/images/icon_speaker_open.svg +1 -1
  21. package/BookReader/images/marker_chap-off.svg +1 -1
  22. package/BookReader/images/marker_chap-on.svg +1 -1
  23. package/BookReader/images/marker_srch-on.svg +1 -1
  24. package/BookReader/jquery-1.10.1.js +1 -1
  25. package/BookReader/jquery-1.10.1.js.LICENSE.txt +6 -6
  26. package/BookReader/plugins/plugin.archive_analytics.js +1 -1
  27. package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
  28. package/BookReader/plugins/plugin.resume.js +1 -1
  29. package/BookReader/plugins/plugin.resume.js.map +1 -1
  30. package/BookReader/plugins/plugin.search.js +1 -1
  31. package/BookReader/plugins/plugin.search.js.map +1 -1
  32. package/BookReader/plugins/plugin.text_selection.js +1 -1
  33. package/BookReader/plugins/plugin.text_selection.js.map +1 -1
  34. package/BookReader/plugins/plugin.tts.js +1 -1
  35. package/BookReader/plugins/plugin.tts.js.map +1 -1
  36. package/BookReader/plugins/plugin.url.js +1 -1
  37. package/BookReader/plugins/plugin.url.js.map +1 -1
  38. package/BookReader/plugins/plugin.vendor-fullscreen.js +1 -1
  39. package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -1
  40. package/CHANGELOG.md +5 -0
  41. package/package.json +17 -16
  42. package/renovate.json +6 -0
  43. package/scripts/preversion.js +4 -1
  44. package/src/BookNavigator/search/a-search-result.js +4 -6
  45. package/src/plugins/search/plugin.search.js +17 -4
  46. package/src/plugins/search/view.js +1 -3
  47. package/tests/{karma → jest}/BookNavigator/search/search-provider.test.js +29 -29
  48. package/tests/{karma → jest}/BookNavigator/search/search-results.test.js +57 -56
  49. package/tests/jest/plugins/search/plugin.search.test.js +40 -23
@@ -1,2 +1,2 @@
1
- (self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[336],{1226:function(t,e,r){"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}r(5827),r(1539),r(4916),r(5306),r(2222),r(6992),r(8783),r(3948),r(1637),r(489),r(2419),r(4819),r(5003),r(2526),r(1817),r(2165),r(4747),r(7941),r(9826),r(8309),r(9600),r(1249),r(7327),r(9714),r(285),r(8559),r(4723),r(3123),r(9720),r(3210),r(4765),r(7042),r(1038);var i,s=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,t),this.bookReaderOptions=e,this.urlSchema=[{name:"page",position:"path",default:"n0"},{name:"mode",position:"path",default:"2up"},{name:"search",position:"path",deprecated_for:"q"},{name:"q",position:"query_param"},{name:"sort",position:"query_param"},{name:"view",position:"query_param"},{name:"admin",position:"query_param"}],this.urlState={},this.urlMode=this.bookReaderOptions.urlMode||"hash",this.urlHistoryBasePath=this.bookReaderOptions.urlHistoryBasePath||"/",this.urlLocationPollId=null,this.oldLocationHash=null,this.oldUserHash=null}var e,r;return e=t,(r=[{key:"urlStateToUrlString",value:function(t){var e=this,r=new URLSearchParams,n={};Object.keys(t).forEach((function(o){var a,i,s,u,l=e.urlSchema.find((function(t){return t.name===o}));null!==(a=l)&&void 0!==a&&a.deprecated_for&&(l=e.urlSchema.find((function(t){return t.name===l.deprecated_for}))),"path"==(null===(i=l)||void 0===i?void 0:i.position)?n[null===(s=l)||void 0===s?void 0:s.name]=t[o]:r.append((null===(u=l)||void 0===u?void 0:u.name)||o,t[o])}));var o=this.urlSchema.filter((function(t){return"path"==t.position})).map((function(t){return n[t.name]?"".concat(t.name,"/").concat(n[t.name]):""})).join("/"),a="".concat(o.replace(/\/+/g,"/").replace(/\/+$/,"")),i="".concat(a,"?").concat(r.toString());return r.toString()?i:"".concat(a)}},{key:"urlStringToUrlState",value:function(t){var e={},r=new URL(t,"http://example.com"),o=Object.fromEntries(r.searchParams.entries()),a=r.pathname.match(/[^\\/]+\/[^\\/]+/g),i=a?Object.fromEntries(a.map((function(t){return t.split("/")}))):{},s=function(t,e){return Object.keys(t).some((function(t){return t==e}))};return this.urlSchema.filter((function(t){return"path"==t.position})).forEach((function(t){var r=s(i,t.name);s(t,"deprecated_for")&&r?e[t.deprecated_for]=i[t.name]:r&&(e[t.name]=i[t.name])})),Object.entries(o).forEach((function(t){var r,o,a=(o=2,function(t){if(Array.isArray(t))return t}(r=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a=[],i=!0,s=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(t){s=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(s)throw o}}return a}}(r,o)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(r,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=a[0],s=a[1];e[i]=s})),e}},{key:"setUrlParam",value:function(t,e){this.urlState[t]=e,this.pushToAddressBar()}},{key:"removeUrlParam",value:function(t){delete this.urlState[t],this.pushToAddressBar()}},{key:"getUrlParam",value:function(t){return this.urlState[t]}},{key:"pushToAddressBar",value:function(){var t=this.urlStateToUrlString(this.urlState),e="/"!==t?t:"";if("history"==this.urlMode){if(window.history&&window.history.replaceState){var r="".concat(this.urlHistoryBasePath).concat(e).trim().replace(/(\/+)/g,"/");window.history.replaceState({},null,r)}}else window.location.replace("#"+e);this.oldLocationHash=t}},{key:"listenForHashChanges",value:function(){var t=this;this.oldLocationHash=window.location.hash.substr(1),this.urlLocationPollId&&(clearInterval(this.urlLocationPollId),this.urlLocationPollId=null),this.urlLocationPollId=setInterval((function(){var e=window.location.hash.substr(1);e!=t.oldLocationHash&&(t.urlState=t.urlStringToUrlState(e))}),500)}},{key:"pullFromAddressBar",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,e="history"===this.urlMode?t.pathname.substr(this.urlHistoryBasePath.length)+t.search:t.hash.substr(1);this.urlState=this.urlStringToUrlState(e)}}])&&a(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function h(){return(h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=f(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}}).apply(this,arguments)}function f(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=m(t)););return t}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function d(t,e){if(e&&("object"===u(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function m(t){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}r(3609).extend(BookReader.defaultOptions,{enableUrlPlugin:!0,bookId:"",defaults:null,updateWindowTitle:!1,urlMode:"hash",urlHistoryBasePath:"/",urlTrackedParams:["page","search","mode","region","highlight","view"],urlTrackIndex0:!1}),BookReader.prototype.setup=(i=BookReader.prototype.setup,function(t){i.call(this,t),this.bookId=t.bookId,this.defaults=t.defaults,this.locationPollId=null,this.oldLocationHash=null,this.oldUserHash=null}),BookReader.prototype.init=function(t){return function(){var e=this;this.options.enableUrlPlugin&&(this.bind(BookReader.eventNames.PostInit,(function(){var t=e.options,r=t.updateWindowTitle,n=t.urlMode;r&&(document.title=e.shortTitle(e.bookTitle,50)),"hash"===n&&e.urlStartLocationPolling()})),this.bind(BookReader.eventNames.fragmentChange,this.urlUpdateFragment.bind(this))),t.call(this)}}(BookReader.prototype.init),BookReader.prototype.shortTitle=function(t){return this.bookTitle.length<t?this.bookTitle:"".concat(this.bookTitle.substr(0,t-3),"...")},BookReader.prototype.urlStartLocationPolling=function(){var t=this;this.oldLocationHash=this.urlReadFragment(),this.locationPollId&&(clearInterval(this.locationPollId),this.locationPollId=null),this.locationPollId=setInterval((function(){var e=t.urlReadFragment();if(e!=t.oldLocationHash&&e!=t.oldUserHash){var r=t.paramsFromFragment(e),n=function(){return t.updateFromParams(r)};t.trigger(BookReader.eventNames.stop),t.animating?(t.autoStop&&t.autoStop(),t.animationFinishedCallback=n):n(),t.oldUserHash=e}}),500)},BookReader.prototype.urlUpdateFragment=function(){var t=this.paramsFromCurrent(),e=this.options,r=e.urlMode,n=e.urlTrackIndex0,o=e.urlTrackedParams;n||void 0===t.index||0!==t.index||(delete t.index,delete t.page);var a=o.reduce((function(e,r){return r in t&&(e[r]=t[r]),e}),{}),i=this.fragmentFromParams(a,r),s=this.urlReadFragment(),u=this.getLocationSearch(),l=this.queryStringFromParams(a,u,r);if(s!==i||u!==l)if("history"===r){if(window.history&&window.history.replaceState){var c=this.options.urlHistoryBasePath.replace(/\/+$/,""),h=""===i?"":"/".concat(i),f="".concat(c).concat(h).concat(l);window.history.replaceState({},null,f),this.oldLocationHash=i+l}}else{var p=this.urlParamsFiltersOnlySearch(this.readQueryString());window.location.replace("#"+i+p),this.oldLocationHash=i+p}},BookReader.prototype.urlParamsFiltersOnlySearch=function(t){var e=new URLSearchParams(t);return e.has("q")?"?".concat(new URLSearchParams({q:e.get("q")})):""},BookReader.prototype.urlReadFragment=function(){var t=this.options,e=t.urlMode,r=t.urlHistoryBasePath;return"history"===e?window.location.pathname.substr(r.length):window.location.hash.substr(1)},BookReader.prototype.urlReadHashFragment=function(){return window.location.hash.substr(1)};var v=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&p(t,e)}(i,BookReader);var e,r,n,o,a=(n=i,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=m(n);if(o){var r=m(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return d(this,t)});function i(){return l(this,i),a.apply(this,arguments)}return e=i,(r=[{key:"init",value:function(){var t=this;this.options.enableUrlPlugin&&(this.urlPlugin=new s(this.options),this.bind(BookReader.eventNames.PostInit,(function(){"hash"===t.options.urlMode&&t.urlPlugin.listenForHashChanges()}))),h(m(i.prototype),"init",this).call(this)}}])&&c(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),i}();window.BookReader=v},3197:function(t){"use strict";var e=2147483647,r=/[^\0-\u007E]/,n=/[.\u3002\uFF0E\uFF61]/g,o="Overflow: input needs wider integers to process",a=Math.floor,i=String.fromCharCode,s=function(t){return t+22+75*(t<26)},u=function(t,e,r){var n=0;for(t=r?a(t/700):t>>1,t+=a(t/e);t>455;n+=36)t=a(t/35);return a(n+36*t/(t+38))},l=function(t){var r,n,l=[],c=(t=function(t){for(var e=[],r=0,n=t.length;r<n;){var o=t.charCodeAt(r++);if(o>=55296&&o<=56319&&r<n){var a=t.charCodeAt(r++);56320==(64512&a)?e.push(((1023&o)<<10)+(1023&a)+65536):(e.push(o),r--)}else e.push(o)}return e}(t)).length,h=128,f=0,p=72;for(r=0;r<t.length;r++)(n=t[r])<128&&l.push(i(n));var d=l.length,m=d;for(d&&l.push("-");m<c;){var v=e;for(r=0;r<t.length;r++)(n=t[r])>=h&&n<v&&(v=n);var y=m+1;if(v-h>a((e-f)/y))throw RangeError(o);for(f+=(v-h)*y,h=v,r=0;r<t.length;r++){if((n=t[r])<h&&++f>e)throw RangeError(o);if(n==h){for(var g=f,b=36;;b+=36){var w=b<=p?1:b>=p+26?26:b-p;if(g<w)break;var k=g-w,R=36-w;l.push(i(s(w+k%R))),g=a(k/R)}l.push(i(s(g))),p=u(f,y,m==d),f=0,++m}}++f,++h}return l.join("")};t.exports=function(t){var e,o,a=[],i=t.toLowerCase().replace(n,".").split(".");for(e=0;e<i.length;e++)o=i[e],a.push(r.test(o)?"xn--"+l(o):o);return a.join(".")}},6091:function(t,e,r){var n=r(7293),o=r(1361);t.exports=function(t){return n((function(){return!!o[t]()||"​…᠎"!="​…᠎"[t]()||o[t].name!==t}))}},9720:function(t,e,r){var n=r(2109),o=r(4699).entries;n({target:"Object",stat:!0},{entries:function(t){return o(t)}})},8559:function(t,e,r){var n=r(2109),o=r(408),a=r(6135);n({target:"Object",stat:!0},{fromEntries:function(t){var e={};return o(t,(function(t,r){a(e,t,r)}),{AS_ENTRIES:!0}),e}})},4723:function(t,e,r){"use strict";var n=r(7007),o=r(9670),a=r(7466),i=r(1340),s=r(4488),u=r(1530),l=r(7651);n("match",(function(t,e,r){return[function(e){var r=s(this),n=null==e?void 0:e[t];return void 0!==n?n.call(e,r):new RegExp(e)[t](i(r))},function(t){var n=o(this),s=i(t),c=r(e,n,s);if(c.done)return c.value;if(!n.global)return l(n,s);var h=n.unicode;n.lastIndex=0;for(var f,p=[],d=0;null!==(f=l(n,s));){var m=i(f[0]);p[d]=m,""===m&&(n.lastIndex=u(s,a(n.lastIndex),h)),d++}return 0===d?null:p}]}))},3210:function(t,e,r){"use strict";var n=r(2109),o=r(3111).trim;n({target:"String",proto:!0,forced:r(6091)("trim")},{trim:function(){return o(this)}})},285:function(t,e,r){"use strict";r(8783);var n,o=r(2109),a=r(9781),i=r(590),s=r(7854),u=r(6048),l=r(1320),c=r(5787),h=r(6656),f=r(1574),p=r(8457),d=r(8710).codeAt,m=r(3197),v=r(1340),y=r(8003),g=r(1637),b=r(9909),w=s.URL,k=g.URLSearchParams,R=g.getState,S=b.set,P=b.getterFor("URL"),B=Math.floor,L=Math.pow,U="Invalid scheme",A="Invalid host",O="Invalid port",j=/[A-Za-z]/,I=/[\d+-.A-Za-z]/,q=/\d/,T=/^0x/i,F=/^[0-7]+$/,H=/^\d+$/,E=/^[\dA-Fa-f]+$/,_=/[\0\t\n\r #%/:<>?@[\\\]^|]/,C=/[\0\t\n\r #/:<>?@[\\\]^|]/,x=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,M=/[\t\n\r]/g,$=function(t,e){var r,n,o;if("["==e.charAt(0)){if("]"!=e.charAt(e.length-1))return A;if(!(r=z(e.slice(1,-1))))return A;t.host=r}else if(V(t)){if(e=m(e),_.test(e))return A;if(null===(r=N(e)))return A;t.host=r}else{if(C.test(e))return A;for(r="",n=p(e),o=0;o<n.length;o++)r+=G(n[o],W);t.host=r}},N=function(t){var e,r,n,o,a,i,s,u=t.split(".");if(u.length&&""==u[u.length-1]&&u.pop(),(e=u.length)>4)return t;for(r=[],n=0;n<e;n++){if(""==(o=u[n]))return t;if(a=10,o.length>1&&"0"==o.charAt(0)&&(a=T.test(o)?16:8,o=o.slice(8==a?1:2)),""===o)i=0;else{if(!(10==a?H:8==a?F:E).test(o))return t;i=parseInt(o,a)}r.push(i)}for(n=0;n<e;n++)if(i=r[n],n==e-1){if(i>=L(256,5-e))return null}else if(i>255)return null;for(s=r.pop(),n=0;n<r.length;n++)s+=r[n]*L(256,3-n);return s},z=function(t){var e,r,n,o,a,i,s,u=[0,0,0,0,0,0,0,0],l=0,c=null,h=0,f=function(){return t.charAt(h)};if(":"==f()){if(":"!=t.charAt(1))return;h+=2,c=++l}for(;f();){if(8==l)return;if(":"!=f()){for(e=r=0;r<4&&E.test(f());)e=16*e+parseInt(f(),16),h++,r++;if("."==f()){if(0==r)return;if(h-=r,l>6)return;for(n=0;f();){if(o=null,n>0){if(!("."==f()&&n<4))return;h++}if(!q.test(f()))return;for(;q.test(f());){if(a=parseInt(f(),10),null===o)o=a;else{if(0==o)return;o=10*o+a}if(o>255)return;h++}u[l]=256*u[l]+o,2!=++n&&4!=n||l++}if(4!=n)return;break}if(":"==f()){if(h++,!f())return}else if(f())return;u[l++]=e}else{if(null!==c)return;h++,c=++l}}if(null!==c)for(i=l-c,l=7;0!=l&&i>0;)s=u[l],u[l--]=u[c+i-1],u[c+--i]=s;else if(8!=l)return;return u},D=function(t){var e,r,n,o;if("number"==typeof t){for(e=[],r=0;r<4;r++)e.unshift(t%256),t=B(t/256);return e.join(".")}if("object"==typeof t){for(e="",n=function(t){for(var e=null,r=1,n=null,o=0,a=0;a<8;a++)0!==t[a]?(o>r&&(e=n,r=o),n=null,o=0):(null===n&&(n=a),++o);return o>r&&(e=n,r=o),e}(t),r=0;r<8;r++)o&&0===t[r]||(o&&(o=!1),n===r?(e+=r?":":"::",o=!0):(e+=t[r].toString(16),r<7&&(e+=":")));return"["+e+"]"}return t},W={},Z=f({},W,{" ":1,'"':1,"<":1,">":1,"`":1}),J=f({},Z,{"#":1,"?":1,"{":1,"}":1}),Q=f({},J,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),G=function(t,e){var r=d(t,0);return r>32&&r<127&&!h(e,t)?t:encodeURIComponent(t)},K={ftp:21,file:null,http:80,https:443,ws:80,wss:443},V=function(t){return h(K,t.scheme)},X=function(t){return""!=t.username||""!=t.password},Y=function(t){return!t.host||t.cannotBeABaseURL||"file"==t.scheme},tt=function(t,e){var r;return 2==t.length&&j.test(t.charAt(0))&&(":"==(r=t.charAt(1))||!e&&"|"==r)},et=function(t){var e;return t.length>1&&tt(t.slice(0,2))&&(2==t.length||"/"===(e=t.charAt(2))||"\\"===e||"?"===e||"#"===e)},rt=function(t){var e=t.path,r=e.length;!r||"file"==t.scheme&&1==r&&tt(e[0],!0)||e.pop()},nt=function(t){return"."===t||"%2e"===t.toLowerCase()},ot={},at={},it={},st={},ut={},lt={},ct={},ht={},ft={},pt={},dt={},mt={},vt={},yt={},gt={},bt={},wt={},kt={},Rt={},St={},Pt={},Bt=function(t,e,r,o){var a,i,s,u,l,c=r||ot,f=0,d="",m=!1,v=!1,y=!1;for(r||(t.scheme="",t.username="",t.password="",t.host=null,t.port=null,t.path=[],t.query=null,t.fragment=null,t.cannotBeABaseURL=!1,e=e.replace(x,"")),e=e.replace(M,""),a=p(e);f<=a.length;){switch(i=a[f],c){case ot:if(!i||!j.test(i)){if(r)return U;c=it;continue}d+=i.toLowerCase(),c=at;break;case at:if(i&&(I.test(i)||"+"==i||"-"==i||"."==i))d+=i.toLowerCase();else{if(":"!=i){if(r)return U;d="",c=it,f=0;continue}if(r&&(V(t)!=h(K,d)||"file"==d&&(X(t)||null!==t.port)||"file"==t.scheme&&!t.host))return;if(t.scheme=d,r)return void(V(t)&&K[t.scheme]==t.port&&(t.port=null));d="","file"==t.scheme?c=yt:V(t)&&o&&o.scheme==t.scheme?c=st:V(t)?c=ht:"/"==a[f+1]?(c=ut,f++):(t.cannotBeABaseURL=!0,t.path.push(""),c=Rt)}break;case it:if(!o||o.cannotBeABaseURL&&"#"!=i)return U;if(o.cannotBeABaseURL&&"#"==i){t.scheme=o.scheme,t.path=o.path.slice(),t.query=o.query,t.fragment="",t.cannotBeABaseURL=!0,c=Pt;break}c="file"==o.scheme?yt:lt;continue;case st:if("/"!=i||"/"!=a[f+1]){c=lt;continue}c=ft,f++;break;case ut:if("/"==i){c=pt;break}c=kt;continue;case lt:if(t.scheme=o.scheme,i==n)t.username=o.username,t.password=o.password,t.host=o.host,t.port=o.port,t.path=o.path.slice(),t.query=o.query;else if("/"==i||"\\"==i&&V(t))c=ct;else if("?"==i)t.username=o.username,t.password=o.password,t.host=o.host,t.port=o.port,t.path=o.path.slice(),t.query="",c=St;else{if("#"!=i){t.username=o.username,t.password=o.password,t.host=o.host,t.port=o.port,t.path=o.path.slice(),t.path.pop(),c=kt;continue}t.username=o.username,t.password=o.password,t.host=o.host,t.port=o.port,t.path=o.path.slice(),t.query=o.query,t.fragment="",c=Pt}break;case ct:if(!V(t)||"/"!=i&&"\\"!=i){if("/"!=i){t.username=o.username,t.password=o.password,t.host=o.host,t.port=o.port,c=kt;continue}c=pt}else c=ft;break;case ht:if(c=ft,"/"!=i||"/"!=d.charAt(f+1))continue;f++;break;case ft:if("/"!=i&&"\\"!=i){c=pt;continue}break;case pt:if("@"==i){m&&(d="%40"+d),m=!0,s=p(d);for(var g=0;g<s.length;g++){var b=s[g];if(":"!=b||y){var w=G(b,Q);y?t.password+=w:t.username+=w}else y=!0}d=""}else if(i==n||"/"==i||"?"==i||"#"==i||"\\"==i&&V(t)){if(m&&""==d)return"Invalid authority";f-=p(d).length+1,d="",c=dt}else d+=i;break;case dt:case mt:if(r&&"file"==t.scheme){c=bt;continue}if(":"!=i||v){if(i==n||"/"==i||"?"==i||"#"==i||"\\"==i&&V(t)){if(V(t)&&""==d)return A;if(r&&""==d&&(X(t)||null!==t.port))return;if(u=$(t,d))return u;if(d="",c=wt,r)return;continue}"["==i?v=!0:"]"==i&&(v=!1),d+=i}else{if(""==d)return A;if(u=$(t,d))return u;if(d="",c=vt,r==mt)return}break;case vt:if(!q.test(i)){if(i==n||"/"==i||"?"==i||"#"==i||"\\"==i&&V(t)||r){if(""!=d){var k=parseInt(d,10);if(k>65535)return O;t.port=V(t)&&k===K[t.scheme]?null:k,d=""}if(r)return;c=wt;continue}return O}d+=i;break;case yt:if(t.scheme="file","/"==i||"\\"==i)c=gt;else{if(!o||"file"!=o.scheme){c=kt;continue}if(i==n)t.host=o.host,t.path=o.path.slice(),t.query=o.query;else if("?"==i)t.host=o.host,t.path=o.path.slice(),t.query="",c=St;else{if("#"!=i){et(a.slice(f).join(""))||(t.host=o.host,t.path=o.path.slice(),rt(t)),c=kt;continue}t.host=o.host,t.path=o.path.slice(),t.query=o.query,t.fragment="",c=Pt}}break;case gt:if("/"==i||"\\"==i){c=bt;break}o&&"file"==o.scheme&&!et(a.slice(f).join(""))&&(tt(o.path[0],!0)?t.path.push(o.path[0]):t.host=o.host),c=kt;continue;case bt:if(i==n||"/"==i||"\\"==i||"?"==i||"#"==i){if(!r&&tt(d))c=kt;else if(""==d){if(t.host="",r)return;c=wt}else{if(u=$(t,d))return u;if("localhost"==t.host&&(t.host=""),r)return;d="",c=wt}continue}d+=i;break;case wt:if(V(t)){if(c=kt,"/"!=i&&"\\"!=i)continue}else if(r||"?"!=i)if(r||"#"!=i){if(i!=n&&(c=kt,"/"!=i))continue}else t.fragment="",c=Pt;else t.query="",c=St;break;case kt:if(i==n||"/"==i||"\\"==i&&V(t)||!r&&("?"==i||"#"==i)){if(".."===(l=(l=d).toLowerCase())||"%2e."===l||".%2e"===l||"%2e%2e"===l?(rt(t),"/"==i||"\\"==i&&V(t)||t.path.push("")):nt(d)?"/"==i||"\\"==i&&V(t)||t.path.push(""):("file"==t.scheme&&!t.path.length&&tt(d)&&(t.host&&(t.host=""),d=d.charAt(0)+":"),t.path.push(d)),d="","file"==t.scheme&&(i==n||"?"==i||"#"==i))for(;t.path.length>1&&""===t.path[0];)t.path.shift();"?"==i?(t.query="",c=St):"#"==i&&(t.fragment="",c=Pt)}else d+=G(i,J);break;case Rt:"?"==i?(t.query="",c=St):"#"==i?(t.fragment="",c=Pt):i!=n&&(t.path[0]+=G(i,W));break;case St:r||"#"!=i?i!=n&&("'"==i&&V(t)?t.query+="%27":t.query+="#"==i?"%23":G(i,W)):(t.fragment="",c=Pt);break;case Pt:i!=n&&(t.fragment+=G(i,Z))}f++}},Lt=function(t){var e,r,n=c(this,Lt,"URL"),o=arguments.length>1?arguments[1]:void 0,i=v(t),s=S(n,{type:"URL"});if(void 0!==o)if(o instanceof Lt)e=P(o);else if(r=Bt(e={},v(o)))throw TypeError(r);if(r=Bt(s,i,null,e))throw TypeError(r);var u=s.searchParams=new k,l=R(u);l.updateSearchParams(s.query),l.updateURL=function(){s.query=String(u)||null},a||(n.href=At.call(n),n.origin=Ot.call(n),n.protocol=jt.call(n),n.username=It.call(n),n.password=qt.call(n),n.host=Tt.call(n),n.hostname=Ft.call(n),n.port=Ht.call(n),n.pathname=Et.call(n),n.search=_t.call(n),n.searchParams=Ct.call(n),n.hash=xt.call(n))},Ut=Lt.prototype,At=function(){var t=P(this),e=t.scheme,r=t.username,n=t.password,o=t.host,a=t.port,i=t.path,s=t.query,u=t.fragment,l=e+":";return null!==o?(l+="//",X(t)&&(l+=r+(n?":"+n:"")+"@"),l+=D(o),null!==a&&(l+=":"+a)):"file"==e&&(l+="//"),l+=t.cannotBeABaseURL?i[0]:i.length?"/"+i.join("/"):"",null!==s&&(l+="?"+s),null!==u&&(l+="#"+u),l},Ot=function(){var t=P(this),e=t.scheme,r=t.port;if("blob"==e)try{return new Lt(e.path[0]).origin}catch(t){return"null"}return"file"!=e&&V(t)?e+"://"+D(t.host)+(null!==r?":"+r:""):"null"},jt=function(){return P(this).scheme+":"},It=function(){return P(this).username},qt=function(){return P(this).password},Tt=function(){var t=P(this),e=t.host,r=t.port;return null===e?"":null===r?D(e):D(e)+":"+r},Ft=function(){var t=P(this).host;return null===t?"":D(t)},Ht=function(){var t=P(this).port;return null===t?"":String(t)},Et=function(){var t=P(this),e=t.path;return t.cannotBeABaseURL?e[0]:e.length?"/"+e.join("/"):""},_t=function(){var t=P(this).query;return t?"?"+t:""},Ct=function(){return P(this).searchParams},xt=function(){var t=P(this).fragment;return t?"#"+t:""},Mt=function(t,e){return{get:t,set:e,configurable:!0,enumerable:!0}};if(a&&u(Ut,{href:Mt(At,(function(t){var e=P(this),r=v(t),n=Bt(e,r);if(n)throw TypeError(n);R(e.searchParams).updateSearchParams(e.query)})),origin:Mt(Ot),protocol:Mt(jt,(function(t){var e=P(this);Bt(e,v(t)+":",ot)})),username:Mt(It,(function(t){var e=P(this),r=p(v(t));if(!Y(e)){e.username="";for(var n=0;n<r.length;n++)e.username+=G(r[n],Q)}})),password:Mt(qt,(function(t){var e=P(this),r=p(v(t));if(!Y(e)){e.password="";for(var n=0;n<r.length;n++)e.password+=G(r[n],Q)}})),host:Mt(Tt,(function(t){var e=P(this);e.cannotBeABaseURL||Bt(e,v(t),dt)})),hostname:Mt(Ft,(function(t){var e=P(this);e.cannotBeABaseURL||Bt(e,v(t),mt)})),port:Mt(Ht,(function(t){var e=P(this);Y(e)||(""==(t=v(t))?e.port=null:Bt(e,t,vt))})),pathname:Mt(Et,(function(t){var e=P(this);e.cannotBeABaseURL||(e.path=[],Bt(e,v(t),wt))})),search:Mt(_t,(function(t){var e=P(this);""==(t=v(t))?e.query=null:("?"==t.charAt(0)&&(t=t.slice(1)),e.query="",Bt(e,t,St)),R(e.searchParams).updateSearchParams(e.query)})),searchParams:Mt(Ct),hash:Mt(xt,(function(t){var e=P(this);""!=(t=v(t))?("#"==t.charAt(0)&&(t=t.slice(1)),e.fragment="",Bt(e,t,Pt)):e.fragment=null}))}),l(Ut,"toJSON",(function(){return At.call(this)}),{enumerable:!0}),l(Ut,"toString",(function(){return At.call(this)}),{enumerable:!0}),w){var $t=w.createObjectURL,Nt=w.revokeObjectURL;$t&&l(Lt,"createObjectURL",(function(t){return $t.apply(w,arguments)})),Nt&&l(Lt,"revokeObjectURL",(function(t){return Nt.apply(w,arguments)}))}y(Lt,"URL"),o({global:!0,forced:!i,sham:!a},{URL:Lt})}},function(t){t(t.s=1226)}]);
1
+ (self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[336],{1226:function(t,e,r){"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}r(5827),r(1539),r(4916),r(5306),r(2222),r(6992),r(8783),r(3948),r(1637),r(489),r(2419),r(4819),r(5003),r(2526),r(1817),r(2165),r(4747),r(7941),r(9826),r(8309),r(9600),r(1249),r(7327),r(9714),r(285),r(8559),r(4723),r(3123),r(9720),r(3210),r(4765),r(7042),r(1038);var i,s=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,t),this.bookReaderOptions=e,this.urlSchema=[{name:"page",position:"path",default:"n0"},{name:"mode",position:"path",default:"2up"},{name:"search",position:"path",deprecated_for:"q"},{name:"q",position:"query_param"},{name:"sort",position:"query_param"},{name:"view",position:"query_param"},{name:"admin",position:"query_param"}],this.urlState={},this.urlMode=this.bookReaderOptions.urlMode||"hash",this.urlHistoryBasePath=this.bookReaderOptions.urlHistoryBasePath||"/",this.urlLocationPollId=null,this.oldLocationHash=null,this.oldUserHash=null}var e,r;return e=t,(r=[{key:"urlStateToUrlString",value:function(t){var e=this,r=new URLSearchParams,n={};Object.keys(t).forEach((function(o){var a,i,s,u,l=e.urlSchema.find((function(t){return t.name===o}));null!==(a=l)&&void 0!==a&&a.deprecated_for&&(l=e.urlSchema.find((function(t){return t.name===l.deprecated_for}))),"path"==(null===(i=l)||void 0===i?void 0:i.position)?n[null===(s=l)||void 0===s?void 0:s.name]=t[o]:r.append((null===(u=l)||void 0===u?void 0:u.name)||o,t[o])}));var o=this.urlSchema.filter((function(t){return"path"==t.position})).map((function(t){return n[t.name]?"".concat(t.name,"/").concat(n[t.name]):""})).join("/"),a="".concat(o.replace(/\/+/g,"/").replace(/\/+$/,"")),i="".concat(a,"?").concat(r.toString());return r.toString()?i:"".concat(a)}},{key:"urlStringToUrlState",value:function(t){var e={},r=new URL(t,"http://example.com"),o=Object.fromEntries(r.searchParams.entries()),a=r.pathname.match(/[^\\/]+\/[^\\/]+/g),i=a?Object.fromEntries(a.map((function(t){return t.split("/")}))):{},s=function(t,e){return Object.keys(t).some((function(t){return t==e}))};return this.urlSchema.filter((function(t){return"path"==t.position})).forEach((function(t){var r=s(i,t.name);s(t,"deprecated_for")&&r?e[t.deprecated_for]=i[t.name]:r&&(e[t.name]=i[t.name])})),Object.entries(o).forEach((function(t){var r,o,a=(o=2,function(t){if(Array.isArray(t))return t}(r=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a=[],i=!0,s=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(t){s=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(s)throw o}}return a}}(r,o)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(r,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=a[0],s=a[1];e[i]=s})),e}},{key:"setUrlParam",value:function(t,e){this.urlState[t]=e,this.pushToAddressBar()}},{key:"removeUrlParam",value:function(t){delete this.urlState[t],this.pushToAddressBar()}},{key:"getUrlParam",value:function(t){return this.urlState[t]}},{key:"pushToAddressBar",value:function(){var t=this.urlStateToUrlString(this.urlState),e="/"!==t?t:"";if("history"==this.urlMode){if(window.history&&window.history.replaceState){var r="".concat(this.urlHistoryBasePath).concat(e).trim().replace(/(\/+)/g,"/");window.history.replaceState({},null,r)}}else window.location.replace("#"+e);this.oldLocationHash=t}},{key:"listenForHashChanges",value:function(){var t=this;this.oldLocationHash=window.location.hash.substr(1),this.urlLocationPollId&&(clearInterval(this.urlLocationPollId),this.urlLocationPollId=null),this.urlLocationPollId=setInterval((function(){var e=window.location.hash.substr(1);e!=t.oldLocationHash&&(t.urlState=t.urlStringToUrlState(e))}),500)}},{key:"pullFromAddressBar",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,e="history"===this.urlMode?t.pathname.substr(this.urlHistoryBasePath.length)+t.search:t.hash.substr(1);this.urlState=this.urlStringToUrlState(e)}}])&&a(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function h(){return(h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=f(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}}).apply(this,arguments)}function f(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=m(t)););return t}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function d(t,e){if(e&&("object"===u(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function m(t){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}r(3609).extend(BookReader.defaultOptions,{enableUrlPlugin:!0,bookId:"",defaults:null,updateWindowTitle:!1,urlMode:"hash",urlHistoryBasePath:"/",urlTrackedParams:["page","search","mode","region","highlight","view"],urlTrackIndex0:!1}),BookReader.prototype.setup=(i=BookReader.prototype.setup,function(t){i.call(this,t),this.bookId=t.bookId,this.defaults=t.defaults,this.locationPollId=null,this.oldLocationHash=null,this.oldUserHash=null}),BookReader.prototype.init=function(t){return function(){var e=this;this.options.enableUrlPlugin&&(this.bind(BookReader.eventNames.PostInit,(function(){var t=e.options,r=t.updateWindowTitle,n=t.urlMode;r&&(document.title=e.shortTitle(e.bookTitle,50)),"hash"===n&&e.urlStartLocationPolling()})),this.bind(BookReader.eventNames.fragmentChange,this.urlUpdateFragment.bind(this))),t.call(this)}}(BookReader.prototype.init),BookReader.prototype.shortTitle=function(t){return this.bookTitle.length<t?this.bookTitle:"".concat(this.bookTitle.substr(0,t-3),"...")},BookReader.prototype.urlStartLocationPolling=function(){var t=this;this.oldLocationHash=this.urlReadFragment(),this.locationPollId&&(clearInterval(this.locationPollId),this.locationPollId=null),this.locationPollId=setInterval((function(){var e=t.urlReadFragment();if(e!=t.oldLocationHash&&e!=t.oldUserHash){var r=t.paramsFromFragment(e),n=function(){return t.updateFromParams(r)};t.trigger(BookReader.eventNames.stop),t.animating?(t.autoStop&&t.autoStop(),t.animationFinishedCallback=n):n(),t.oldUserHash=e}}),500)},BookReader.prototype.urlUpdateFragment=function(){var t=this.paramsFromCurrent(),e=this.options,r=e.urlMode,n=e.urlTrackIndex0,o=e.urlTrackedParams;n||void 0===t.index||0!==t.index||(delete t.index,delete t.page);var a=o.reduce((function(e,r){return r in t&&(e[r]=t[r]),e}),{}),i=this.fragmentFromParams(a,r),s=this.urlReadFragment(),u=this.getLocationSearch(),l=this.queryStringFromParams(a,u,r);if(s!==i||u!==l)if("history"===r){if(window.history&&window.history.replaceState){var c=this.options.urlHistoryBasePath.replace(/\/+$/,""),h=""===i?"":"/".concat(i),f="".concat(c).concat(h).concat(l);window.history.replaceState({},null,f),this.oldLocationHash=i+l}}else{var p=this.urlParamsFiltersOnlySearch(this.readQueryString());window.location.replace("#"+i+p),this.oldLocationHash=i+p}},BookReader.prototype.urlParamsFiltersOnlySearch=function(t){var e=new URLSearchParams(t);return e.has("q")?"?".concat(new URLSearchParams({q:e.get("q")})):""},BookReader.prototype.urlReadFragment=function(){var t=this.options,e=t.urlMode,r=t.urlHistoryBasePath;return"history"===e?window.location.pathname.substr(r.length):window.location.hash.substr(1)},BookReader.prototype.urlReadHashFragment=function(){return window.location.hash.substr(1)};var g=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&p(t,e)}(i,BookReader);var e,r,n,o,a=(n=i,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=m(n);if(o){var r=m(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return d(this,t)});function i(){return l(this,i),a.apply(this,arguments)}return e=i,(r=[{key:"init",value:function(){var t=this;this.options.enableUrlPlugin&&(this.urlPlugin=new s(this.options),this.bind(BookReader.eventNames.PostInit,(function(){"hash"===t.options.urlMode&&t.urlPlugin.listenForHashChanges()}))),h(m(i.prototype),"init",this).call(this)}}])&&c(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),i}();window.BookReader=g},3197:function(t,e,r){"use strict";var n=r(7854),o=r(1702),a=2147483647,i=/[^\0-\u007E]/,s=/[.\u3002\uFF0E\uFF61]/g,u="Overflow: input needs wider integers to process",l=n.RangeError,c=o(s.exec),h=Math.floor,f=String.fromCharCode,p=o("".charCodeAt),d=o([].join),m=o([].push),g=o("".replace),v=o("".split),y=o("".toLowerCase),b=function(t){return t+22+75*(t<26)},w=function(t,e,r){var n=0;for(t=r?h(t/700):t>>1,t+=h(t/e);t>455;)t=h(t/35),n+=36;return h(n+36*t/(t+38))},P=function(t){var e,r,n=[],o=(t=function(t){for(var e=[],r=0,n=t.length;r<n;){var o=p(t,r++);if(o>=55296&&o<=56319&&r<n){var a=p(t,r++);56320==(64512&a)?m(e,((1023&o)<<10)+(1023&a)+65536):(m(e,o),r--)}else m(e,o)}return e}(t)).length,i=128,s=0,c=72;for(e=0;e<t.length;e++)(r=t[e])<128&&m(n,f(r));var g=n.length,v=g;for(g&&m(n,"-");v<o;){var y=a;for(e=0;e<t.length;e++)(r=t[e])>=i&&r<y&&(y=r);var P=v+1;if(y-i>h((a-s)/P))throw l(u);for(s+=(y-i)*P,i=y,e=0;e<t.length;e++){if((r=t[e])<i&&++s>a)throw l(u);if(r==i){for(var S=s,k=36;;){var R=k<=c?1:k>=c+26?26:k-c;if(S<R)break;var U=S-R,B=36-R;m(n,f(b(R+U%B))),S=h(U/B),k+=36}m(n,f(b(S))),c=w(s,P,v==g),s=0,v++}}s++,i++}return d(n,"")};t.exports=function(t){var e,r,n=[],o=v(g(y(t),s,"."),".");for(e=0;e<o.length;e++)r=o[e],m(n,c(i,r)?"xn--"+P(r):r);return d(n,".")}},6091:function(t,e,r){var n=r(6530).PROPER,o=r(7293),a=r(1361);t.exports=function(t){return o((function(){return!!a[t]()||"​…᠎"!=="​…᠎"[t]()||n&&a[t].name!==t}))}},9720:function(t,e,r){var n=r(2109),o=r(4699).entries;n({target:"Object",stat:!0},{entries:function(t){return o(t)}})},8559:function(t,e,r){var n=r(2109),o=r(408),a=r(6135);n({target:"Object",stat:!0},{fromEntries:function(t){var e={};return o(t,(function(t,r){a(e,t,r)}),{AS_ENTRIES:!0}),e}})},4723:function(t,e,r){"use strict";var n=r(6916),o=r(7007),a=r(9670),i=r(7466),s=r(1340),u=r(4488),l=r(8173),c=r(1530),h=r(7651);o("match",(function(t,e,r){return[function(e){var r=u(this),o=null==e?void 0:l(e,t);return o?n(o,e,r):new RegExp(e)[t](s(r))},function(t){var n=a(this),o=s(t),u=r(e,n,o);if(u.done)return u.value;if(!n.global)return h(n,o);var l=n.unicode;n.lastIndex=0;for(var f,p=[],d=0;null!==(f=h(n,o));){var m=s(f[0]);p[d]=m,""===m&&(n.lastIndex=c(o,i(n.lastIndex),l)),d++}return 0===d?null:p}]}))},3210:function(t,e,r){"use strict";var n=r(2109),o=r(3111).trim;n({target:"String",proto:!0,forced:r(6091)("trim")},{trim:function(){return o(this)}})},8789:function(t,e,r){"use strict";r(8783);var n,o=r(2109),a=r(9781),i=r(590),s=r(7854),u=r(9974),l=r(1702),c=r(6048).f,h=r(1320),f=r(5787),p=r(2597),d=r(1574),m=r(8457),g=r(1589),v=r(8710).codeAt,y=r(3197),b=r(1340),w=r(8003),P=r(8053),S=r(5556),k=r(9909),R=k.set,U=k.getterFor("URL"),B=S.URLSearchParams,H=S.getState,L=s.URL,O=s.TypeError,I=s.parseInt,q=Math.floor,j=Math.pow,T=l("".charAt),A=l(/./.exec),F=l([].join),_=l(1..toString),x=l([].pop),C=l([].push),E=l("".replace),M=l([].shift),z=l("".split),$=l("".slice),N=l("".toLowerCase),D=l([].unshift),W="Invalid scheme",J="Invalid host",Q="Invalid port",G=/[a-z]/i,K=/[\d+-.a-z]/i,V=/\d/,X=/^0x/i,Y=/^[0-7]+$/,Z=/^\d+$/,tt=/^[\da-f]+$/i,et=/[\0\t\n\r #%/:<>?@[\\\]^|]/,rt=/[\0\t\n\r #/:<>?@[\\\]^|]/,nt=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,ot=/[\t\n\r]/g,at=function(t){var e,r,n,o;if("number"==typeof t){for(e=[],r=0;r<4;r++)D(e,t%256),t=q(t/256);return F(e,".")}if("object"==typeof t){for(e="",n=function(t){for(var e=null,r=1,n=null,o=0,a=0;a<8;a++)0!==t[a]?(o>r&&(e=n,r=o),n=null,o=0):(null===n&&(n=a),++o);return o>r&&(e=n,r=o),e}(t),r=0;r<8;r++)o&&0===t[r]||(o&&(o=!1),n===r?(e+=r?":":"::",o=!0):(e+=_(t[r],16),r<7&&(e+=":")));return"["+e+"]"}return t},it={},st=d({},it,{" ":1,'"':1,"<":1,">":1,"`":1}),ut=d({},st,{"#":1,"?":1,"{":1,"}":1}),lt=d({},ut,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ct=function(t,e){var r=v(t,0);return r>32&&r<127&&!p(e,t)?t:encodeURIComponent(t)},ht={ftp:21,file:null,http:80,https:443,ws:80,wss:443},ft=function(t,e){var r;return 2==t.length&&A(G,T(t,0))&&(":"==(r=T(t,1))||!e&&"|"==r)},pt=function(t){var e;return t.length>1&&ft($(t,0,2))&&(2==t.length||"/"===(e=T(t,2))||"\\"===e||"?"===e||"#"===e)},dt=function(t){return"."===t||"%2e"===N(t)},mt={},gt={},vt={},yt={},bt={},wt={},Pt={},St={},kt={},Rt={},Ut={},Bt={},Ht={},Lt={},Ot={},It={},qt={},jt={},Tt={},At={},Ft={},_t=function(t,e,r){var n,o,a,i=b(t);if(e){if(o=this.parse(i))throw O(o);this.searchParams=null}else{if(void 0!==r&&(n=new _t(r,!0)),o=this.parse(i,null,n))throw O(o);(a=H(new B)).bindURL(this),this.searchParams=a}};_t.prototype={type:"URL",parse:function(t,e,r){var o,a,i,s,u,l=this,c=e||mt,h=0,f="",d=!1,v=!1,y=!1;for(t=b(t),e||(l.scheme="",l.username="",l.password="",l.host=null,l.port=null,l.path=[],l.query=null,l.fragment=null,l.cannotBeABaseURL=!1,t=E(t,nt,"")),t=E(t,ot,""),o=m(t);h<=o.length;){switch(a=o[h],c){case mt:if(!a||!A(G,a)){if(e)return W;c=vt;continue}f+=N(a),c=gt;break;case gt:if(a&&(A(K,a)||"+"==a||"-"==a||"."==a))f+=N(a);else{if(":"!=a){if(e)return W;f="",c=vt,h=0;continue}if(e&&(l.isSpecial()!=p(ht,f)||"file"==f&&(l.includesCredentials()||null!==l.port)||"file"==l.scheme&&!l.host))return;if(l.scheme=f,e)return void(l.isSpecial()&&ht[l.scheme]==l.port&&(l.port=null));f="","file"==l.scheme?c=Lt:l.isSpecial()&&r&&r.scheme==l.scheme?c=yt:l.isSpecial()?c=St:"/"==o[h+1]?(c=bt,h++):(l.cannotBeABaseURL=!0,C(l.path,""),c=Tt)}break;case vt:if(!r||r.cannotBeABaseURL&&"#"!=a)return W;if(r.cannotBeABaseURL&&"#"==a){l.scheme=r.scheme,l.path=g(r.path),l.query=r.query,l.fragment="",l.cannotBeABaseURL=!0,c=Ft;break}c="file"==r.scheme?Lt:wt;continue;case yt:if("/"!=a||"/"!=o[h+1]){c=wt;continue}c=kt,h++;break;case bt:if("/"==a){c=Rt;break}c=jt;continue;case wt:if(l.scheme=r.scheme,a==n)l.username=r.username,l.password=r.password,l.host=r.host,l.port=r.port,l.path=g(r.path),l.query=r.query;else if("/"==a||"\\"==a&&l.isSpecial())c=Pt;else if("?"==a)l.username=r.username,l.password=r.password,l.host=r.host,l.port=r.port,l.path=g(r.path),l.query="",c=At;else{if("#"!=a){l.username=r.username,l.password=r.password,l.host=r.host,l.port=r.port,l.path=g(r.path),l.path.length--,c=jt;continue}l.username=r.username,l.password=r.password,l.host=r.host,l.port=r.port,l.path=g(r.path),l.query=r.query,l.fragment="",c=Ft}break;case Pt:if(!l.isSpecial()||"/"!=a&&"\\"!=a){if("/"!=a){l.username=r.username,l.password=r.password,l.host=r.host,l.port=r.port,c=jt;continue}c=Rt}else c=kt;break;case St:if(c=kt,"/"!=a||"/"!=T(f,h+1))continue;h++;break;case kt:if("/"!=a&&"\\"!=a){c=Rt;continue}break;case Rt:if("@"==a){d&&(f="%40"+f),d=!0,i=m(f);for(var w=0;w<i.length;w++){var P=i[w];if(":"!=P||y){var S=ct(P,lt);y?l.password+=S:l.username+=S}else y=!0}f=""}else if(a==n||"/"==a||"?"==a||"#"==a||"\\"==a&&l.isSpecial()){if(d&&""==f)return"Invalid authority";h-=m(f).length+1,f="",c=Ut}else f+=a;break;case Ut:case Bt:if(e&&"file"==l.scheme){c=It;continue}if(":"!=a||v){if(a==n||"/"==a||"?"==a||"#"==a||"\\"==a&&l.isSpecial()){if(l.isSpecial()&&""==f)return J;if(e&&""==f&&(l.includesCredentials()||null!==l.port))return;if(s=l.parseHost(f))return s;if(f="",c=qt,e)return;continue}"["==a?v=!0:"]"==a&&(v=!1),f+=a}else{if(""==f)return J;if(s=l.parseHost(f))return s;if(f="",c=Ht,e==Bt)return}break;case Ht:if(!A(V,a)){if(a==n||"/"==a||"?"==a||"#"==a||"\\"==a&&l.isSpecial()||e){if(""!=f){var k=I(f,10);if(k>65535)return Q;l.port=l.isSpecial()&&k===ht[l.scheme]?null:k,f=""}if(e)return;c=qt;continue}return Q}f+=a;break;case Lt:if(l.scheme="file","/"==a||"\\"==a)c=Ot;else{if(!r||"file"!=r.scheme){c=jt;continue}if(a==n)l.host=r.host,l.path=g(r.path),l.query=r.query;else if("?"==a)l.host=r.host,l.path=g(r.path),l.query="",c=At;else{if("#"!=a){pt(F(g(o,h),""))||(l.host=r.host,l.path=g(r.path),l.shortenPath()),c=jt;continue}l.host=r.host,l.path=g(r.path),l.query=r.query,l.fragment="",c=Ft}}break;case Ot:if("/"==a||"\\"==a){c=It;break}r&&"file"==r.scheme&&!pt(F(g(o,h),""))&&(ft(r.path[0],!0)?C(l.path,r.path[0]):l.host=r.host),c=jt;continue;case It:if(a==n||"/"==a||"\\"==a||"?"==a||"#"==a){if(!e&&ft(f))c=jt;else if(""==f){if(l.host="",e)return;c=qt}else{if(s=l.parseHost(f))return s;if("localhost"==l.host&&(l.host=""),e)return;f="",c=qt}continue}f+=a;break;case qt:if(l.isSpecial()){if(c=jt,"/"!=a&&"\\"!=a)continue}else if(e||"?"!=a)if(e||"#"!=a){if(a!=n&&(c=jt,"/"!=a))continue}else l.fragment="",c=Ft;else l.query="",c=At;break;case jt:if(a==n||"/"==a||"\\"==a&&l.isSpecial()||!e&&("?"==a||"#"==a)){if(".."===(u=N(u=f))||"%2e."===u||".%2e"===u||"%2e%2e"===u?(l.shortenPath(),"/"==a||"\\"==a&&l.isSpecial()||C(l.path,"")):dt(f)?"/"==a||"\\"==a&&l.isSpecial()||C(l.path,""):("file"==l.scheme&&!l.path.length&&ft(f)&&(l.host&&(l.host=""),f=T(f,0)+":"),C(l.path,f)),f="","file"==l.scheme&&(a==n||"?"==a||"#"==a))for(;l.path.length>1&&""===l.path[0];)M(l.path);"?"==a?(l.query="",c=At):"#"==a&&(l.fragment="",c=Ft)}else f+=ct(a,ut);break;case Tt:"?"==a?(l.query="",c=At):"#"==a?(l.fragment="",c=Ft):a!=n&&(l.path[0]+=ct(a,it));break;case At:e||"#"!=a?a!=n&&("'"==a&&l.isSpecial()?l.query+="%27":l.query+="#"==a?"%23":ct(a,it)):(l.fragment="",c=Ft);break;case Ft:a!=n&&(l.fragment+=ct(a,st))}h++}},parseHost:function(t){var e,r,n;if("["==T(t,0)){if("]"!=T(t,t.length-1))return J;if(!(e=function(t){var e,r,n,o,a,i,s,u=[0,0,0,0,0,0,0,0],l=0,c=null,h=0,f=function(){return T(t,h)};if(":"==f()){if(":"!=T(t,1))return;h+=2,c=++l}for(;f();){if(8==l)return;if(":"!=f()){for(e=r=0;r<4&&A(tt,f());)e=16*e+I(f(),16),h++,r++;if("."==f()){if(0==r)return;if(h-=r,l>6)return;for(n=0;f();){if(o=null,n>0){if(!("."==f()&&n<4))return;h++}if(!A(V,f()))return;for(;A(V,f());){if(a=I(f(),10),null===o)o=a;else{if(0==o)return;o=10*o+a}if(o>255)return;h++}u[l]=256*u[l]+o,2!=++n&&4!=n||l++}if(4!=n)return;break}if(":"==f()){if(h++,!f())return}else if(f())return;u[l++]=e}else{if(null!==c)return;h++,c=++l}}if(null!==c)for(i=l-c,l=7;0!=l&&i>0;)s=u[l],u[l--]=u[c+i-1],u[c+--i]=s;else if(8!=l)return;return u}($(t,1,-1))))return J;this.host=e}else if(this.isSpecial()){if(t=y(t),A(et,t))return J;if(null===(e=function(t){var e,r,n,o,a,i,s,u=z(t,".");if(u.length&&""==u[u.length-1]&&u.length--,(e=u.length)>4)return t;for(r=[],n=0;n<e;n++){if(""==(o=u[n]))return t;if(a=10,o.length>1&&"0"==T(o,0)&&(a=A(X,o)?16:8,o=$(o,8==a?1:2)),""===o)i=0;else{if(!A(10==a?Z:8==a?Y:tt,o))return t;i=I(o,a)}C(r,i)}for(n=0;n<e;n++)if(i=r[n],n==e-1){if(i>=j(256,5-e))return null}else if(i>255)return null;for(s=x(r),n=0;n<r.length;n++)s+=r[n]*j(256,3-n);return s}(t)))return J;this.host=e}else{if(A(rt,t))return J;for(e="",r=m(t),n=0;n<r.length;n++)e+=ct(r[n],it);this.host=e}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return p(ht,this.scheme)},shortenPath:function(){var t=this.path,e=t.length;!e||"file"==this.scheme&&1==e&&ft(t[0],!0)||t.length--},serialize:function(){var t=this,e=t.scheme,r=t.username,n=t.password,o=t.host,a=t.port,i=t.path,s=t.query,u=t.fragment,l=e+":";return null!==o?(l+="//",t.includesCredentials()&&(l+=r+(n?":"+n:"")+"@"),l+=at(o),null!==a&&(l+=":"+a)):"file"==e&&(l+="//"),l+=t.cannotBeABaseURL?i[0]:i.length?"/"+F(i,"/"):"",null!==s&&(l+="?"+s),null!==u&&(l+="#"+u),l},setHref:function(t){var e=this.parse(t);if(e)throw O(e);this.searchParams.update()},getOrigin:function(){var t=this.scheme,e=this.port;if("blob"==t)try{return new xt(t.path[0]).origin}catch(t){return"null"}return"file"!=t&&this.isSpecial()?t+"://"+at(this.host)+(null!==e?":"+e:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(b(t)+":",mt)},getUsername:function(){return this.username},setUsername:function(t){var e=m(b(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<e.length;r++)this.username+=ct(e[r],lt)}},getPassword:function(){return this.password},setPassword:function(t){var e=m(b(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<e.length;r++)this.password+=ct(e[r],lt)}},getHost:function(){var t=this.host,e=this.port;return null===t?"":null===e?at(t):at(t)+":"+e},setHost:function(t){this.cannotBeABaseURL||this.parse(t,Ut)},getHostname:function(){var t=this.host;return null===t?"":at(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,Bt)},getPort:function(){var t=this.port;return null===t?"":b(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(""==(t=b(t))?this.port=null:this.parse(t,Ht))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+F(t,"/"):""},setPathname:function(t){this.cannotBeABaseURL||(this.path=[],this.parse(t,qt))},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){""==(t=b(t))?this.query=null:("?"==T(t,0)&&(t=$(t,1)),this.query="",this.parse(t,At)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){""!=(t=b(t))?("#"==T(t,0)&&(t=$(t,1)),this.fragment="",this.parse(t,Ft)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var xt=function(t){var e=f(this,Ct),r=P(arguments.length,1)>1?arguments[1]:void 0,n=R(e,new _t(t,!1,r));a||(e.href=n.serialize(),e.origin=n.getOrigin(),e.protocol=n.getProtocol(),e.username=n.getUsername(),e.password=n.getPassword(),e.host=n.getHost(),e.hostname=n.getHostname(),e.port=n.getPort(),e.pathname=n.getPathname(),e.search=n.getSearch(),e.searchParams=n.getSearchParams(),e.hash=n.getHash())},Ct=xt.prototype,Et=function(t,e){return{get:function(){return U(this)[t]()},set:e&&function(t){return U(this)[e](t)},configurable:!0,enumerable:!0}};if(a&&c(Ct,{href:Et("serialize","setHref"),origin:Et("getOrigin"),protocol:Et("getProtocol","setProtocol"),username:Et("getUsername","setUsername"),password:Et("getPassword","setPassword"),host:Et("getHost","setHost"),hostname:Et("getHostname","setHostname"),port:Et("getPort","setPort"),pathname:Et("getPathname","setPathname"),search:Et("getSearch","setSearch"),searchParams:Et("getSearchParams"),hash:Et("getHash","setHash")}),h(Ct,"toJSON",(function(){return U(this).serialize()}),{enumerable:!0}),h(Ct,"toString",(function(){return U(this).serialize()}),{enumerable:!0}),L){var Mt=L.createObjectURL,zt=L.revokeObjectURL;Mt&&h(xt,"createObjectURL",u(Mt,L)),zt&&h(xt,"revokeObjectURL",u(zt,L))}w(xt,"URL"),o({global:!0,forced:!i,sham:!a},{URL:xt})},285:function(t,e,r){r(8789)}},function(t){t(t.s=1226)}]);
2
2
  //# sourceMappingURL=plugin.url.js.map